init tuto2: new option to format the drive in bootloader

This commit is contained in:
nemunaire 2019-03-15 19:09:15 +01:00
commit 8c881b0e3a
2 changed files with 7 additions and 7 deletions

View file

@ -67,9 +67,9 @@ files:
echo "rootfs=$ROOTFS"
[ -z "$ROOTFS" ] && { echo "No root= provided, continuing on initramfs only."; exec "${INITP}"; }
[ "$ROOTFS" = "/dev/sr0" ] && { echo "No root= provided, continuing on initramfs only."; exec "${INITP}"; }
[ -b "$ROOTFS" ] || {
[ -b "$ROOTFS" -a -z "$(cmdline adlin.alwaysformat)" ] || {
FORMATDD=$(cmdline adlin.format)
[ -b "$FORMATDD" ] && { echo "o\nn\np\n1\n\n\np\nw\nq\n" | fdisk "${FORMATDD}" && mkfs.ext4 "$FORMATDD"1; }
[ -b "$FORMATDD" ] && { echo "o\nn\np\n1\n\n\np\nw\nq\n" | fdisk "${FORMATDD}" && mkfs.ext4 -q "$FORMATDD"1; }
[ -b "$ROOTFS" ] || { echo "Invalid provided rootfs: not a valid block device."; exit 1; }
}