rename ian to iank
[automated-distro-installer] / fai / config / hooks / partition.DEFAULT
index f81c6af7d5914398ef976f0916afb06b604866e8..94f6c25216926038270df6b910a0ee21bd4a685c 100755 (executable)
@@ -69,9 +69,7 @@ bootdev() { add-part $@ $bootn; }
 rootdev() { add-part $@ $rootn; }
 swapdev() { add-part $@ $swapn; }
 grub_extdev() { add-part $@ $grub_extn; }
-# Commented because it's not used, but left because it
-# finishes the pattern and if we ever do need to use it, it's here.
-#bios_grubdev() { add-part $@ $bios_grubn; }
+bios_grubdev() { add-part $@ $bios_grubn; }
 
 crypt-dev() { echo /dev/mapper/crypt_dev_${1##*/}; }
 crypt-name() { echo crypt_dev_${1##*/}; }
@@ -79,7 +77,14 @@ root-cryptdev() { crypt-dev $(rootdev $@); }
 swap-cryptdev() { crypt-dev $(swapdev $@); }
 root-cryptname() { crypt-name $(rootdev $@); }
 swap-cryptname() { crypt-name $(swapdev $@); }
+devbyid() {
+    local f
+    for f in $FAI/distro-install-common/devbyid \
+                 /a/bin/fai/fai/config/distro-install-common/devbyid; do
+        if [[ -e $f ]]; then $f "$@"; fi
+    done
 
+}
 
 ##### end function defs
 
@@ -115,8 +120,8 @@ fi
 for dev in ${short_devs[@]}; do
     if $partition; then break; fi
     y=$(readlink -f $dev)
-    x=($y[0-9])
-    [[ ${#x[@]}  == "${lastn}" ]] || partition=true
+    arr=($y[0-9])
+    [[ ${#arr[@]}  == "${lastn}" ]] || partition=true
     for (( i=1; i <= lastn; i++ )); do
         [[ -e ${dev}$i ]] || partition=true
     done
@@ -190,16 +195,18 @@ fi
 
 
 if [[ ! $DISTRO ]]; then
-    if ifclass STABLE_BOOTSTRAP; then
+    if ifclass VOL_STABLE_BOOTSTRAP; then
         DISTRO=debianstable_bootstrap
-    elif ifclass STRETCH64; then
+    elif ifclass VOL_STRETCH; then
         DISTRO=debiantesting
-    elif ifclass STABLE; then
+    elif ifclass VOL_STABLE; then
         DISTRO=debianstable
-    elif ifclass XENIAL64; then
+    elif ifclass VOL_XENIAL; then
         DISTRO=ubuntuxenial
-    elif ifclass BELENOS64; then
+    elif ifclass VOL_BELENOS; then
         DISTRO=trisquelbelenos
+    elif ifclass VOL_FLIDAS; then
+        DISTRO=trisquelflidas
     else
         echo "PARTITIONER ERROR: no distro class/var set" >&2
         exit 1
@@ -228,7 +235,7 @@ fi
 if ifclass tp; then
     lukspw=$(cat $luks_dir/traci)
 else
-    lukspw=$(cat $luks_dir/ian)
+    lukspw=$(cat $luks_dir/iank)
 fi
 if ifclass demohost; then
     lukspw=x
@@ -363,9 +370,6 @@ if [[ $DISTRO != debianstable_bootstrap ]]; then
     cd /mnt
 
     btrfs subvolume create root_$DISTRO
-    [[ -e nocow ]] || btrfs subvolume create nocow
-    chown root:1000 nocow
-    chattr +C nocow
 
     mkdir -p /mnt/root_$DISTRO/boot
     # could set default subvol like this, but no reason to.
@@ -418,10 +422,9 @@ BOOT_DEVICE="${short_devs[@]}"
 ROOT_PARTITION=$first_boot_dev
 EOF
 else
-    # note, fai creates the mountpoints like /nocow
+    # note, fai creates the mountpoints listed here
     cat > /tmp/fai/fstab <<EOF
 $first_root_crypt  /  btrfs  noatime,subvol=root_$DISTRO  0 0
-$first_root_crypt  /nocow  btrfs  noatime,subvol=nocow  0 0
 $first_root_crypt  /mnt/root  btrfs  noatime,subvolid=0  0 0
 $first_boot_dev  /boot  btrfs  noatime,subvol=$boot_vol  0 0
 EOF