Ask for block device, add steps loop, add 'wipe' and 'partition' steps
This commit is contained in:
12
steps/10-wipe.step
Normal file
12
steps/10-wipe.step
Normal 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
15
steps/20-partition.step
Normal 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
|
||||
Reference in New Issue
Block a user