diff --git a/alpine-install-on-disk.sh b/alpine-install-on-disk.sh index 320499e..5fc48ff 100755 --- a/alpine-install-on-disk.sh +++ b/alpine-install-on-disk.sh @@ -50,6 +50,12 @@ sudo mount ${DISK}1 $rootfs_tmpdir # keep right permissions, use sudo sudo tar xf $IMAGE -C $rootfs_tmpdir +# These are required by grub-install +# And also for generating grub config that contains rootfstype +for dir in dev proc sys; do + sudo mount --bind /${dir} ${rootfs_tmpdir}/${dir} +done + # Add SSH keys run_root mkdir -p root/.ssh sudo cp $SSH_KEYS $rootfs_tmpdir/root/.ssh/authorized_keys @@ -94,11 +100,10 @@ alpine-unconfigured EOF # Setup bootloader -for dir in dev proc sys; do - sudo mount --bind /${dir} ${rootfs_tmpdir}/${dir} -done run_root apk add grub-bios +echo 'GRUB_CMDLINE_LINUX_DEFAULT="quiet rootfstype=ext4"' >> ${rootfs_tmpdir}/etc/default/grub +run_root grub-mkconfig -o /boot/grub/grub.cfg run_root grub-install --target=i386-pc ${DISK} # Cleanup