2018-03-05 07:48:12 +01:00
|
|
|
run_hook ()
|
|
|
|
{
|
|
|
|
# Format and run immediately cow_device
|
|
|
|
|
|
|
|
if [[ "${format}" == "y" ]]; then
|
|
|
|
sfdisk -l
|
|
|
|
|
|
|
|
[[ -z "${formatdevice}" ]] && formatdevice=/dev/sda
|
2018-04-01 23:56:32 +02:00
|
|
|
[[ -z "${formatpartition}" ]] && formatpartition=3
|
2018-03-05 07:48:12 +01:00
|
|
|
|
2018-03-05 08:19:57 +01:00
|
|
|
fdisk ${formatdevice} <<EOT
|
|
|
|
p
|
|
|
|
n
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-05 08:28:54 +01:00
|
|
|
|
2018-03-05 08:19:57 +01:00
|
|
|
p
|
|
|
|
w
|
|
|
|
EOT
|
|
|
|
|
2018-04-01 23:56:32 +02:00
|
|
|
mkfs.btrfs -f -L cow_device ${formatdevice}${formatpartition}
|
2018-03-05 07:48:12 +01:00
|
|
|
|
2018-04-01 23:56:32 +02:00
|
|
|
reboot -f
|
2018-03-05 07:48:12 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
# vim: set ft=sh ts=4 sw=4 et:
|