diff --git a/live-build/ubuntu-core/hooks/01-divert-grub-install.chroot_early b/live-build/ubuntu-core/hooks/01-divert-grub-install.chroot_early index 5e7f0519..d6fbd500 100755 --- a/live-build/ubuntu-core/hooks/01-divert-grub-install.chroot_early +++ b/live-build/ubuntu-core/hooks/01-divert-grub-install.chroot_early @@ -1,5 +1,7 @@ #!/bin/sh -ex +ARCH=$(dpkg --print-architecture) + case $ARCH in i386|amd64) dpkg-divert --quiet --add \ diff --git a/live-build/ubuntu-core/hooks/12-add-foreign-libc6.chroot b/live-build/ubuntu-core/hooks/12-add-foreign-libc6.chroot index 81200ec5..5f86911d 100644 --- a/live-build/ubuntu-core/hooks/12-add-foreign-libc6.chroot +++ b/live-build/ubuntu-core/hooks/12-add-foreign-libc6.chroot @@ -4,7 +4,7 @@ set -ex echo "I: Checking if we are amd64 and libc6:i386 should be installed" -if [ "$ARCH" = "amd64" ]; then +if [ "$(dpkg --print-architecture)" = "amd64" ]; then echo "I: Enabling i386 multiarch support on amd64" dpkg --add-architecture i386 diff --git a/live-build/ubuntu-core/hooks/16-ensure-uboot.chroot b/live-build/ubuntu-core/hooks/16-ensure-uboot.chroot index ae412fd2..4a9a5c91 100644 --- a/live-build/ubuntu-core/hooks/16-ensure-uboot.chroot +++ b/live-build/ubuntu-core/hooks/16-ensure-uboot.chroot @@ -2,7 +2,7 @@ set -e -case $ARCH in +case "$(dpkg --print-architecture)" in arm*) mkdir -p /boot/uboot cat > /etc/fw_env.config < /bin/sync <<'EOF' #! /bin/sh diff --git a/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot b/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot index a83ae2ea..63ed7d5b 100755 --- a/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot +++ b/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot @@ -18,6 +18,8 @@ _xchroot() { } #### COMMON architecture independent functions +arch=$(_xchroot "${rootd}" dpkg --print-architecture) + add_serial_console() { condev=$1 idir="$rootd/etc/init" @@ -125,7 +127,7 @@ fi #### END COMMON ARCH FUNCTIONS -case $ARCH in +case $arch in # ARM images are special armhf|arm64) echo "Configuring ARM Serial Port" diff --git a/live-build/ubuntu-touch/hooks/60-install-click.chroot b/live-build/ubuntu-touch/hooks/60-install-click.chroot index c636b801..a8b3b692 100755 --- a/live-build/ubuntu-touch/hooks/60-install-click.chroot +++ b/live-build/ubuntu-touch/hooks/60-install-click.chroot @@ -20,10 +20,12 @@ tmpdir="$(mktemp -d)" cleanup () { rm -rf "$tmpdir"; } trap cleanup EXIT +CLICKARCH=$(dpkg --print-architecture) + wget --no-verbose -O "$tmpdir/click_list" "$click_list" for package in $(cat "$tmpdir/click_list") do - if echo $package | egrep -q "_$ARCH.click|_all.click|_unknown.click|_multi.click"; then + if echo $package | egrep -q "_$CLICKARCH.click|_all.click|_unknown.click|_multi.click"; then echo "Setting up $package" wget --no-verbose -O "$tmpdir/$package" "$click_uri/$package" # FIXME: first attempt, a hard-coded list of the packages that go to