diff options
author | Sertonix <sertonix@posteo.net> | 2024-08-05 12:32:02 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2024-09-06 12:19:56 +0000 |
commit | 5147450891cc9db4c2615b7c0ac4b978bd3797c8 (patch) | |
tree | a28250db8fa45cb73c392247c5a96331c2b3cdc4 /scripts | |
parent | 323f614b8489235d28a9dc0d5b2f7864a6db7a9f (diff) | |
download | aports-5147450891cc9db4c2615b7c0ac4b978bd3797c8.zip |
scripts/mkimage.sh: fix cross creating
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/mkimage.sh | 14 | ||||
-rwxr-xr-x | scripts/mkimg.arm.sh | 2 | ||||
-rwxr-xr-x | scripts/mkimg.base.sh | 9 |
3 files changed, 20 insertions, 5 deletions
diff --git a/scripts/mkimage.sh b/scripts/mkimage.sh index e2cc3faf4b2..443c5f48878 100755 --- a/scripts/mkimage.sh +++ b/scripts/mkimage.sh @@ -2,7 +2,9 @@ # apk add \ # abuild apk-tools alpine-conf busybox fakeroot syslinux xorriso cmd:mksquashfs -# (for efi:) mtools grub-efi +# (for efi:) mtools +# (for s390x:) s390-tools +# (for ppc64le:) grub # FIXME: clean workdir out of unneeded sections # FIXME: --release: cp/mv images to REPODIR/$ARCH/releases/ @@ -302,8 +304,14 @@ for ARCH in $req_arch; do APKROOT="$WORKDIR/apkroot-$ARCH" if [ ! -e "$APKROOT" ]; then # create root for caching packages - mkdir -p "$APKROOT/etc/apk/cache" - cp -Pr /etc/apk/keys "$APKROOT/etc/apk/" + mkdir -p "$APKROOT/etc/apk/cache" "$APKROOT"/etc/apk/keys + [ -d /usr/share/apk/keys/"$ARCH" ] && + cp /usr/share/apk/keys/"$ARCH"/* "$APKROOT"/etc/apk/keys + if [ -n "$_hostkeys" ]; then + cp /etc/apk/keys/* "$APKROOT"/etc/apk/keys + else + cp "$_abuild_pubkey" "$APKROOT"/etc/apk/keys + fi apk --arch "$ARCH" --root "$APKROOT" add --initdb _repositories="$APKROOT/etc/apk/repositories" diff --git a/scripts/mkimg.arm.sh b/scripts/mkimg.arm.sh index 25d651e2264..7a5161d1de7 100755 --- a/scripts/mkimg.arm.sh +++ b/scripts/mkimg.arm.sh @@ -1,6 +1,6 @@ build_rpi_blobs() { for i in raspberrypi-bootloader-common raspberrypi-bootloader; do - apk fetch --quiet --stdout "$i" | tar -C "${DESTDIR}" -zx --strip=1 boot/ || return 1 + apk fetch --root "$APKROOT" --quiet --stdout "$i" | tar -C "${DESTDIR}" -zx --strip=1 boot/ || return 1 done } diff --git a/scripts/mkimg.base.sh b/scripts/mkimg.base.sh index 7e0fad9f6ac..681806d9868 100755 --- a/scripts/mkimg.base.sh +++ b/scripts/mkimg.base.sh @@ -8,6 +8,7 @@ build_kernel() { ${_abuild_pubkey:+--apk-pubkey $_abuild_pubkey} \ $_modloopsign \ --media \ + --keys-dir "$APKROOT/etc/apk/keys" \ --flavor "$_flavor" \ --arch "$ARCH" \ --package "$_pkgs" \ @@ -18,7 +19,7 @@ build_kernel() { || return 1 if [ -n "$boot_addons" ]; then for _add in $boot_addons; do - apk fetch --quiet --stdout $_add | tar -C "${DESTDIR}" -zx boot/ + apk fetch --root "$APKROOT" --quiet --stdout $_add | tar -C "${DESTDIR}" -zx boot/ done fi } @@ -46,6 +47,7 @@ build_apks() { fi apk index \ + --root "$APKROOT" \ --description "$RELEASE" \ --rewrite-arch "$ARCH" \ --index "$_archdir"/APKINDEX.tar.gz \ @@ -197,11 +199,14 @@ build_grub_efi() { local _format="$1" local _efi="$2" + apk fetch --root "$APKROOT" --quiet --stdout grub-efi | tar -C "$WORKDIR" -zx usr/lib/grub + # Prepare grub-efi bootloader mkdir -p "$DESTDIR/efi/boot" grub_gen_earlyconf > "$WORKDIR/grub_early.$3.cfg" grub-mkimage \ --config="$WORKDIR/grub_early.$3.cfg" \ + --directory="$WORKDIR"/usr/lib/grub/"$_format" \ --prefix="/boot/grub" \ --output="$DESTDIR/efi/boot/$_efi" \ --format="$_format" \ @@ -277,7 +282,9 @@ create_image_iso() { fi if [ "$ARCH" = ppc64le ]; then + apk fetch --root "$APKROOT" --quiet --stdout grub-ieee1275 | tar -C "$WORKDIR" -zx usr/lib/grub grub-mkrescue --output ${ISO} ${DESTDIR} -follow-links \ + --directory="$WORKDIR"/usr/lib/grub/powerpc-ieee1275 \ -sysid LINUX \ -volid "alpine-${profile_abbrev:-$PROFILE} $RELEASE $ARCH" else |