1
by Joey Hess
initial commit of partman-btrfs |
1 |
#!/bin/sh
|
2 |
||
3 |
set -- $1 |
|
4 |
||
5 |
fs=$1 |
|
6 |
mp=$2 |
|
7 |
type=$3 |
|
8 |
options=$4 |
|
9 |
dump=$5 |
|
10 |
pass=$6 |
|
11 |
||
12 |
case $type in |
|
13 |
btrfs)
|
|
54.1.1
by Surbhi Palande
Adding support for creating and respectively mounting btrfs subvolumes |
14 |
options="${options%,subvol=*}" |
15 |
#for removing the option subvol,when thats the only option
|
|
16 |
#eg: options=="subvol=@", no comma present
|
|
17 |
options="${options%subvol=*}" |
|
1
by Joey Hess
initial commit of partman-btrfs |
18 |
mount -t btrfs ${options:+-o "$options"} $fs /target$mp || exit 1 |
54.1.1
by Surbhi Palande
Adding support for creating and respectively mounting btrfs subvolumes |
19 |
case $mp in |
20 |
/)
|
|
21 |
btrfs subvolume create /target$mp/@
|
|
22 |
umount /target$mp
|
|
23 |
options="${options:+$options,}subvol=@" |
|
24 |
mount -t btrfs -o $options $fs /target$mp |
|
25 |
;;
|
|
26 |
/home)
|
|
27 |
btrfs subvolume create /target$mp/@home
|
|
28 |
umount /target$mp
|
|
29 |
options="${options:+$options,}subvol=@home" |
|
30 |
mount -t btrfs -o $options $fs /target$mp |
|
31 |
;;
|
|
32 |
esac
|
|
1
by Joey Hess
initial commit of partman-btrfs |
33 |
echo "umount /target$mp" |
34 |
exit 0 |
|
35 |
;;
|
|
36 |
esac
|
|
37 |
||
38 |
exit 1 |