X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fhooks%2Fpartition.DEFAULT;h=79826c7da5fac44a1897320ec005c9e77c22daa0;hb=2eebb95531424e04797094d622eebdd7ece5b38b;hp=aa7440968b8eaca3cde4c43672a69ad5825441c0;hpb=1d331faf4f315ae3356ceecb648170d3d74473df;p=automated-distro-installer diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index aa74409..79826c7 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 @@ -145,15 +160,19 @@ for dev in ${devs[@]}; do done if [[ ! $DISTRO ]]; then - if ifclass STABLE; then + if ifclass STRETCH64; then + DISTRO=debiantesting + elif ifclass STABLE; then DISTRO=debianstable + elif ifclass XENIAL64; then + DISTRO=ubuntuxenial else - DISTRO=debiantesting + echo "PARTITIONER ERROR: no distro class/var set" >&2 + exit 1 fi fi - case ${#boot_devs[@]} in # need double the space if we are raid 10, and then # might as well give some extra overhead. @@ -324,18 +343,14 @@ $first_boot_dev /boot btrfs noatime,subvol=boot_$DISTRO 0 0 EOF +# I will avoid using uuid in the future. if ifclass treetowl; then cat >> /tmp/fai/fstab <<'EOF' +$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' -/q/i /i none bind 0 0 -EOF -fi - swaps=() for dev in ${devs[@]}; do swaps+=(`swap-cryptname`)