import fixes from Kali's method
This commit is contained in:
parent
1ad33a62ea
commit
c082c32de0
1 changed files with 13 additions and 8 deletions
|
|
@ -11,14 +11,19 @@ pass=$6
|
||||||
|
|
||||||
case $type in
|
case $type in
|
||||||
btrfs)
|
btrfs)
|
||||||
if [ "$mp" = "/" ]; then
|
# import workaround from Kali's partman-btrfs commit:7f43d2c
|
||||||
mount -t btrfs ${options:+-o "$options"} $fs /target/ || exit 1
|
options="${options%,subvol=*}"
|
||||||
btrfs subvolume create /target/@rootfs || exit 1
|
#for removing the option subvol,when thats the only option
|
||||||
umount /target || exit 1
|
#eg: options=="subvol=@", no comma present
|
||||||
mount -t btrfs ${options:+-o "$options,subvol=@rootfs"} $fs /target || exit 1
|
options="${options%subvol=*}"
|
||||||
else
|
mount -t btrfs ${options:+-o "$options"} $fs /target"$mp" || exit 1
|
||||||
mount -t btrfs ${options:+-o "$options"} $fs /target"$mp" || exit 1
|
if [ $mp = / ]; then
|
||||||
fi
|
btrfs subvolume create /target$mp/@rootfs
|
||||||
|
chmod 755 /target$mp/@rootfs
|
||||||
|
umount /target$mp
|
||||||
|
options="${options:+$options,}subvol=@rootfs"
|
||||||
|
mount -t btrfs -o $options $fs /target$mp
|
||||||
|
fi
|
||||||
echo "umount /target$mp"
|
echo "umount /target$mp"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue