Add minimal subvolume support for /.
Rational: current installation of rootfs to default subvolume makes a post-install flat subvolume structure (recommended!) unnecessarily difficult to accomplish.
This commit is contained in:
parent
af781092e3
commit
500ee0c6f6
3 changed files with 21 additions and 3 deletions
7
debian/changelog
vendored
7
debian/changelog
vendored
|
|
@ -1,3 +1,10 @@
|
||||||
|
partman-btrfs (53) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
[ Nicholas D Steeves ]
|
||||||
|
* Add minimal subvolume support for /.
|
||||||
|
|
||||||
|
-- Nicholas D Steeves <nsteeves@gmail.com> Mon, 09 Mar 2020 17:26:59 -0400
|
||||||
|
|
||||||
partman-btrfs (52) unstable; urgency=medium
|
partman-btrfs (52) unstable; urgency=medium
|
||||||
|
|
||||||
* Team upload
|
* Team upload
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,14 @@ for dev in $DEVICES/*; do
|
||||||
[ -f "$id/mountpoint" ] || continue
|
[ -f "$id/mountpoint" ] || continue
|
||||||
mountpoint=$(cat $id/mountpoint)
|
mountpoint=$(cat $id/mountpoint)
|
||||||
# due to #249322, #255135, #258117:
|
# due to #249322, #255135, #258117:
|
||||||
if [ "$mountpoint" = /tmp ]; then
|
if [ "$mountpoint" = "/tmp" ]; then
|
||||||
rm -f $id/options/noexec
|
rm -f $id/options/noexec
|
||||||
fi
|
fi
|
||||||
options=$(get_mountoptions $dev $id)
|
if [ "$mountpoint" = "/" ]; then
|
||||||
|
options="$(get_mountoptions $dev $id),subvol=@rootfs"
|
||||||
|
else
|
||||||
|
options=$(get_mountoptions $dev $id)
|
||||||
|
fi
|
||||||
# There is no btrfs fsck
|
# There is no btrfs fsck
|
||||||
echo "$path" "$mountpoint" btrfs $options 0 0
|
echo "$path" "$mountpoint" btrfs $options 0 0
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,14 @@ pass=$6
|
||||||
|
|
||||||
case $type in
|
case $type in
|
||||||
btrfs)
|
btrfs)
|
||||||
mount -t btrfs ${options:+-o "$options"} $fs /target$mp || exit 1
|
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"
|
echo "umount /target$mp"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue