Ask for block device, add steps loop, add 'wipe' and 'partition' steps

This commit is contained in:
maride
2017-07-30 23:33:59 +02:00
parent f1ba4f6ecb
commit add83c13d3
3 changed files with 45 additions and 0 deletions

12
steps/10-wipe.step Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
echo "~> Going to wipe $blockdevice. You sure? (y/N) "
read answer
if [ "$answer" == "y" ]; then
echo "~> OK. Be patient now, that could take some time..."
dd if=/dev/zero of=$blockdevice status=progress
return $?
else
exit 1
fi

15
steps/20-partition.step Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
echo "~> Setting up $blockdevice with:"
echo " * 300M EFI (FAT32) partition"
echo " * <full> crypted (LUKS) root (EXT4) partition"
echo "g\nn\n1\n2048\n+300M\nn\n2\n\n\np\nw"
if [ "$?" -eq 0 ]; then
echo "~> Seems to have worked. Yay!"
exit 0
else
echo "~> Failed. :("
exit 1
fi