boot_device="$device"2
syst_device="$device"3
-
- # Use UUID
- # Give time to devices table be updated
- sleep 2
- reboot_device="`blkid | grep ^$boot_device: | cut -d ' ' -f 2 | sed -e 's/"//g'`"
-
- # Use device name: might lead to wrong results:
- # During install boot_device might be /dev/sdb2, but on but be /dev/sda2
- #reboot_device="$boot_device"
fi
fi
hydra_sudo_run parted -s -- $device set 2 boot on
-# Take a small break to device table be updated
+# Take a small break to devices table be updated
sleep 2
# Create volumes.
# Boot device must be available before installing kernel and initramfs.
if [ "$grub" == "y" ] && [ "$encrypt" != "y" ]; then
echo "Boot device setup..."
+
hydra_sudo_run mkfs.ext4 $boot_device
- hydra_sudo_run mount $boot_device $WORK/boot
- echo "$reboot_device /boot ext4 defaults,errors=remount-ro 0 2" | $SUDO tee -a $WORK/etc/fstab > /dev/null
+ hydra_sudo_run mount $boot_device $WORK/boot
fi
# Kernel.
hydra_sudo_run chroot $WORK update-initramfs -u
else
$APT_INSTALL dracut -y
+
+ # Ensure initramfs-tools is absent
+ hydra_sudo_run chroot $WORK apt-get autoremove -y
fi
# Grub.
fi
fi
+# Set boot partition config
+if [ "$grub" == "y" ] && [ "$encrypt" != "y" ]; then
+ # Use UUID
+ # Reboot device must be calculated after filesystem creation and grub installation
+ #reboot_device="`blkid | grep ^$boot_device: | cut -d ' ' -f 2 | sed -e 's/"//g'`"
+ reboot_device="`blkid $boot_device | cut -d ' ' -f 2 | sed -e 's/"//g'`"
+
+ # Use device name: might lead to wrong results
+ # During install boot_device might be /dev/sdb2, but on but be /dev/sda2
+ #reboot_device="$boot_device"
+
+ echo "$reboot_device /boot ext4 defaults,errors=remount-ro 0 2" | $SUDO tee -a $WORK/etc/fstab > /dev/null
+fi
+
# Utils.
echo "Installing basic utilities..."
$APT_INSTALL screen cron lsb-release openssl -y
- Review fstab, crypttab and optional GRUB configuration.
See https://padrao.fluxo.info/install for more information.
+
+If you know what you're doing, you might test the installation using:
+
+ sudo kvm -m 512 -hda $device
+
EOF