init tuto2: new option to format the drive in bootloader
This commit is contained in:
parent
84f23281fd
commit
8c881b0e3a
@ -13,15 +13,15 @@ timeout 0
|
|||||||
|
|
||||||
menu title Welcome to the EPITA ADvanced LINux administration course!
|
menu title Welcome to the EPITA ADvanced LINux administration course!
|
||||||
|
|
||||||
LABEL tutorial-nohdd
|
|
||||||
MENU LABEL ^Erase my first drive if necessary, then enter tutorial
|
|
||||||
KERNEL /boot/kernel
|
|
||||||
APPEND <CMDLINE> adlin.format=/dev/sda root=/dev/sda1 root=/dev/sr0
|
|
||||||
|
|
||||||
LABEL tutorial-hdd
|
LABEL tutorial-hdd
|
||||||
MENU LABEL Enter tutorial without erasing ^disk
|
MENU LABEL Enter tutorial without erasing ^disk
|
||||||
KERNEL /boot/kernel
|
KERNEL /boot/kernel
|
||||||
APPEND <CMDLINE> root=/dev/sda1 root=/dev/sr0
|
APPEND <CMDLINE> adlin.format=/dev/sda root=/dev/sda1 root=/dev/sr0
|
||||||
|
|
||||||
|
LABEL tutorial-forceformat
|
||||||
|
MENU LABEL ^Erase my first drive, then enter tutorial
|
||||||
|
KERNEL /boot/kernel
|
||||||
|
APPEND <CMDLINE> adlin.format=/dev/sda adlin.alwaysformat=yes root=/dev/sda1 root=/dev/sr0
|
||||||
|
|
||||||
MENU SEPARATOR
|
MENU SEPARATOR
|
||||||
|
|
||||||
|
@ -67,9 +67,9 @@ files:
|
|||||||
echo "rootfs=$ROOTFS"
|
echo "rootfs=$ROOTFS"
|
||||||
[ -z "$ROOTFS" ] && { echo "No root= provided, continuing on initramfs only."; exec "${INITP}"; }
|
[ -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}"; }
|
[ "$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)
|
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; }
|
[ -b "$ROOTFS" ] || { echo "Invalid provided rootfs: not a valid block device."; exit 1; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user