Rational: current installation of rootfs to default subvolume makes a post-install flat subvolume structure (recommended!) unnecessarily difficult to accomplish.
27 lines
547 B
Bash
Executable file
27 lines
547 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -- $1
|
|
|
|
fs=$1
|
|
mp=$2
|
|
type=$3
|
|
options=$4
|
|
dump=$5
|
|
pass=$6
|
|
|
|
case $type in
|
|
btrfs)
|
|
if [ "$mp" = "/" ]; then
|
|
mount -t btrfs ${options:+-o "$options"} $fs /target/ || exit 1
|
|
btrfs subvolume create /target/@rootfs || exit 1
|
|
umount /target || exit 1
|
|
mount -t btrfs ${options:+-o "$options,subvol=@rootfs"} $fs /target || exit 1
|
|
else
|
|
mount -t btrfs ${options:+-o "$options"} $fs /target"$mp" || exit 1
|
|
fi
|
|
echo "umount /target$mp"
|
|
exit 0
|
|
;;
|
|
esac
|
|
|
|
exit 1
|