From 25537665ed2e48ff2d3042e7e0e4607c1d9ac61d Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 30 Jul 2019 20:11:35 -0400 Subject: [PATCH] images/debian: arm64 fixes --- images/debian/functions | 1 + images/debian/genimg | 46 +++++++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/images/debian/functions b/images/debian/functions index e6eca4d..ed66f94 100644 --- a/images/debian/functions +++ b/images/debian/functions @@ -10,6 +10,7 @@ boot() { ;; arm64) driveopts="id=root,if=none" + qemu=qemu-system-aarch64 _boot \ $(cpu_opts aarch64) \ -device virtio-blk-pci,drive=root \ diff --git a/images/debian/genimg b/images/debian/genimg index de37407..c7fcf79 100755 --- a/images/debian/genimg +++ b/images/debian/genimg @@ -56,7 +56,12 @@ mount /dev/nbd0p3 /mnt mkdir /mnt/boot mount /dev/nbd0p1 /mnt/boot -debootstrap --include=gnupg2 --arch=$arch $release /mnt +if [ "$arch" = "x86_64" ] +then + debootstrap --include=gnupg2 --arch=$arch $release /mnt +else + qemu-debootstrap --include=gnupg2 --arch=$arch $release /mnt +fi mount --bind /dev /mnt/dev mount --bind /dev/pts /mnt/dev/pts @@ -99,12 +104,7 @@ run_root apt-get update --allow-releaseinfo-change run_root apt-get -y install locales run_root apt-get -y install linux-image-$arch run_root apt-get -y install \ - build-essential git mercurial ssh sudo dirmngr apt-transport-https extlinux - -if [ "$arch" = "amd64" ] -then - extlinux -i /mnt/boot -fi + build-essential git mercurial ssh sudo dirmngr apt-transport-https run_root ln -sf /usr/share/zoneinfo/UTC /etc/localtime run_root systemctl enable systemd-timesyncd.service @@ -121,24 +121,30 @@ run_root update-initramfs -u linuxver=$(ls /mnt/boot | grep vmlinuz | cut -d- -f2-) -cat >/mnt/boot/extlinux.conf <>/mnt/etc/fstab </mnt/boot/extlinux.conf <<-EOF + default debian + label debian + linux vmlinuz-$linuxver + initrd initrd.img-$linuxver + append root=/dev/vda3 rw quiet + EOF + ;; + arm64) + cp /mnt/boot/vmlinuz-* $arch/vmlinuz + cp /mnt/boot/initrd.img-* $arch/initrd.img + ;; +esac sync -- 2.38.5