~comcloudway/builds.sr.ht

25537665ed2e48ff2d3042e7e0e4607c1d9ac61d — Drew DeVault 5 years ago cdf915e
images/debian: arm64 fixes
2 files changed, 27 insertions(+), 20 deletions(-)

M images/debian/functions
M images/debian/genimg
M images/debian/functions => images/debian/functions +1 -0
@@ 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 \

M images/debian/genimg => images/debian/genimg +26 -20
@@ 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 <<EOF
default debian
label debian
	linux vmlinuz-$linuxver
	initrd initrd.img-$linuxver
	append root=/dev/vda3 rw quiet
EOF

cat >>/mnt/etc/fstab <<EOF
/dev/vda1 /boot ext4 rw,relatime,data=ordered 0 0
/dev/vda2 swap swap defaults 0 0
/dev/vda3 / ext4 rw,relatime,data=ordered 0 0
EOF

if [ "$arch" != "amd64" ]
then
	cp /mnt/boot/vmlinuz $arch/vmlinuz
	cp /mnt/boot/initrd.img $arch/initrd.img
fi
# Boot setup
case "$arch" in 
	amd64)
		run_root apt-get -y install extlinux
		extlinux -i /mnt/boot

		cat >/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