Browse Source

Arch Linux fixes: console, mount, wait until boot

pull/2/head
j3s 10 months ago
parent
commit
b1cc279016
  1. 14
      archlinux/build

14
archlinux/build

@ -12,7 +12,7 @@ cleanup() {
mkdir -p "$arch"
qemu-img create -f qcow2 $arch/root.img.qcow2 20G
qemu-img create -f qcow2 $arch/root.img.qcow2 25G
modprobe nbd
qemu-nbd --connect=/dev/nbd0 $arch/root.img.qcow2
trap cleanup EXIT
@ -102,11 +102,12 @@ EOF
extlinux -i "$root"/boot
cat > "$root"/boot/extlinux.conf <<- EOF
serial 0 115200
default archlinux
label archlinux
linux vmlinuz-linux
initrd initramfs-linux.img
append root=/dev/vda2 rw quiet
append root=/dev/vda2 rw console=tty0 console=ttyS0,115200 quiet
EOF
echo "makeopts=(--skippgpcheck)" >> $root/etc/makepkg.conf
@ -126,8 +127,10 @@ EOF
cat > $root/bin/capsul-init <<-EOF
#!/bin/sh
mount -t iso9660 -o ro /dev/sr0 /mnt
cat > "/home/cyberian/.ssh/authorized_keys" <<EOW
until mount -t iso9660 -o ro /dev/sr0 /mnt; do
sleep 1
done
cat >> "/home/cyberian/.ssh/authorized_keys" <<EOW
\$(grep '\- ssh' /mnt/user-data | cut -d ' ' -f 8-)
EOW
chmod 600 "/home/cyberian/.ssh/authorized_keys"
@ -135,6 +138,7 @@ chown cyberian.cyberian "/home/cyberian/.ssh/authorized_keys"
resize2fs /dev/vda2
systemctl disable capsul-init
systemctl daemon-reload
umount /mnt
rm /etc/systemd/system/capsul-init.service
rm /bin/capsul-init
EOF
@ -143,6 +147,7 @@ chmod +x $root/bin/capsul-init
cat > $root/etc/systemd/system/capsul-init.service <<-EOF
[Unit]
Description=init capsul and EXPLODE
After=multi-user.target
[Service]
Type=oneshot
@ -162,4 +167,3 @@ run_root pacman --noconfirm -Rs go
paccache -rk0 -c "$root/var/cache/pacman/pkg"
pkill gpg-agent || true

Loading…
Cancel
Save