SpectreOS/configs/hooks/cow_device
2022-10-04 19:01:31 +02:00

29 lines
428 B
Bash
Executable file

run_hook ()
{
# Format and run immediately cow_device
if [[ "${format}" == "y" ]]; then
sfdisk -l
[[ -z "${formatdevice}" ]] && formatdevice=/dev/sda
[[ -z "${formatpartition}" ]] && formatpartition=3
fdisk ${formatdevice} <<EOT
p
n
p
w
EOT
mkfs.btrfs -f -L cow_device ${formatdevice}${formatpartition}
reboot -f
fi
}
# vim: set ft=sh ts=4 sw=4 et: