X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fhooks%2Fpartition.DEFAULT;h=8c3140b5fd3c711aadb11914591c74b650af0e1e;hb=63372a0fd027649a0ef031efe5b7d22f396340d4;hp=2dc6fd50776210ffa8ee80b88c059414b65f5f59;hpb=afabe0c27af744200aa6b6e05c5b2ab7d7518c1e;p=automated-distro-installer diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index 2dc6fd5..8c3140b 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -1,4 +1,19 @@ #!/bin/bash -x +# Copyright (C) 2016 Ian Kelling + +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR @@ -290,10 +305,11 @@ btrfs subvolume set-default 0 /mnt ## create subvols ## cd /mnt btrfs subvolume create root_$DISTRO +[[ -e q ]] || btrfs subvolume create q chown root:1000 q mkdir -p /mnt/root_$DISTRO/boot -for x in root/a q/a; do +for x in q/a q/i; do mkdir -p $x chown 1000:1000 $x chmod 755 $x @@ -314,7 +330,7 @@ umount /mnt ## end create subvols ## - +# note, the mount point /a seems to get automatically created somewhere cat > /tmp/fai/fstab <> /tmp/fai/fstab <<'EOF' -UUID=3f7b31cd-f299-40b4-a86b-7604282e2715 /i btrfs noatime 0 2 +$first_root_crypt /i btrfs noatime,subvol=i 0 0 +UUID=3f7b31cd-f299-40b4-a86b-7604282e2715 /i btrfs noatime 0 2 +EOF +fi +if ifclass frodo; then + cat >> /tmp/fai/fstab <<'EOF' +$first_root_crypt /i btrfs noatime,subvol=i 0 0 EOF fi