small bug fixes and improvements
authorIan Kelling <ian@iankelling.org>
Sat, 13 Aug 2016 06:25:16 +0000 (23:25 -0700)
committerIan Kelling <ian@iankelling.org>
Mon, 6 Feb 2017 06:21:41 +0000 (22:21 -0800)
Handle non-free repos. For multi-boot hosts,
have a separate file so we stop changing 50-host-classes
in git all the time.

README
dsfull
fai/config/class/50-host-classes
fai/config/distro-install-common/end
fai/config/files/etc/apt/sources.list.d/stable-non-free.list/STABLE_NON_FREE [new file with mode: 0644]
fai/config/files/etc/apt/sources.list.d/stable.list/STABLE
fai/config/files/etc/apt/sources.list.d/testing-non-free.list/NON_FREE [new file with mode: 0644]
fai/config/files/etc/apt/sources.list.d/unstable-non-free.list/NON_FREE [new file with mode: 0644]
fai/config/hooks/partition.DEFAULT

diff --git a/README b/README
index c5cf1beb7c86d5ef0db16ed210cb48bb6b896b11..3993580079c321568409b7c6e8b6518451301dde 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 Scripts for initial setup of OSes on my home network.
 
 My network is a wndr3700v2 router with openwrt on it and a few pcs
-with various gnu/linux distros on them.
+with atm: arch, debian jessie and debian stretch on them.
 
 
 Scripts meant to be called interactively:
diff --git a/dsfull b/dsfull
index c5cb230546219ffd0d9198e0fcf6892ee07f905d..44588bab377722cd45d102afa7492636bf929120 100755 (executable)
--- a/dsfull
+++ b/dsfull
@@ -24,7 +24,7 @@ set -x
 if $reboot; then
     ssh $host sudo bash <<'EOF' || [[ $? == 255 ]]
 touch /tmp/keyscript-off
-reboot ||:
+reboot
 EOF
 fi
 
index 7b23f85a27d82f735f0521d518a24c2a37b0132d..624077d3529c45b8b802a7f1c5fc9dca31ec32f7 100755 (executable)
@@ -10,16 +10,30 @@ echo "FAIBASE DEBIAN"
 case $HOSTNAME in
     demohost)
         echo "DESKTOP" ;;
-    tp|frodo|treetowl|x2)
+    tp)
         echo "DESKTOP PARTITION_PROMPT"
-        # non-portable way to see that we aren't in a pxe boot environment.
-        if [[ -e /a/bin/fai/fai-wrapper ]]; then
-            # We check the reverse condition in 51-multi-boot,
-            # and set what os we are installing, but don't check it
-            # into git since it changes regularly.
-            if isdebian-stable; then
-                echo "STABLE"
-            fi
+        # For multi-boot system.
+        # Check that we aren't in a pxe boot environment.
+        # There is probably a better way to do this.
+        # We check the reverse condition in 51-multi-boot,
+        # and set what os we are installing, but don't check it
+        # into git since it changes regularly.
+        # It's shell looks like this:
+        # if [[ ! -e /a/bin/fai/fai-wrapper ]]; then
+        #     case $HOSTNAME in
+        #         tp) : ;;
+        #         # add more multi-boot hostnames here
+        #     esac
+        # fi
+        #
+        if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
+            echo "STABLE"
+        fi
+        ;;
+    x2|frodo|treetowl)
+        echo "NON_FREE"
+        if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
+            echo "STABLE STABLE_NON_FREE"
         fi
         ;;
     lj)
index 390c20487c4c944b4dfd96a81d1b13b313f33eca..6afcd1eaf5f75cf22e52b8893679b74cd92b352a 100755 (executable)
@@ -76,6 +76,10 @@ fi
 
 dir=/q/p/c/machine_specific/$HOSTNAME/.unison
 $ROOTCMD mkdir -p $dir
+if ! $ROOTCMD test -L /root/.unison; then
+    $ROOTCMD rm -rf /root/.unison
+    $ROOTCMD ln -s -T $dir /root/.unison
+fi
 
 $ROOTCMD ln -sf /q/p /
 $ROOTCMD chown -R 1000:1000 $dir
diff --git a/fai/config/files/etc/apt/sources.list.d/stable-non-free.list/STABLE_NON_FREE b/fai/config/files/etc/apt/sources.list.d/stable-non-free.list/STABLE_NON_FREE
new file mode 100644 (file)
index 0000000..689921e
--- /dev/null
@@ -0,0 +1,11 @@
+deb http://http.us.debian.org/debian jessie contrib non-free
+deb-src http://http.us.debian.org/debian jessie contrib non-free
+
+deb http://security.debian.org/ jessie/updates contrib non-free
+deb-src http://security.debian.org/ jessie/updates contrib non-free
+
+deb http://http.us.debian.org/debian jessie-updates contrib non-free
+deb-src http://http.us.debian.org/debian jessie-updates contrib non-free
+
+deb http://http.debian.net/debian jessie-backports contrib non-free
+deb-src http://http.debian.net/debian jessie-backports contrib non-free
index 28b57d6f551935367e4c6701868868da005b1af7..0093b4f10f4a5c0ac29f24764b10a6738dee4e78 100644 (file)
@@ -6,3 +6,6 @@ deb-src http://security.debian.org/ jessie/updates main
 
 deb http://http.us.debian.org/debian jessie-updates main
 deb-src http://http.us.debian.org/debian jessie-updates main
+
+deb http://http.debian.net/debian jessie-backports main
+deb-src http://http.debian.net/debian jessie-backports main
diff --git a/fai/config/files/etc/apt/sources.list.d/testing-non-free.list/NON_FREE b/fai/config/files/etc/apt/sources.list.d/testing-non-free.list/NON_FREE
new file mode 100644 (file)
index 0000000..35fc32e
--- /dev/null
@@ -0,0 +1,8 @@
+deb http://http.us.debian.org/debian testing contrib non-free
+deb-src http://http.us.debian.org/debian testing contrib non-free
+
+deb http://security.debian.org/ testing/updates contrib non-free
+deb-src http://security.debian.org/ testing/updates contrib non-free
+
+deb http://http.us.debian.org/debian testing-updates contrib non-free
+deb-src http://http.us.debian.org/debian testing-updates contrib non-free
diff --git a/fai/config/files/etc/apt/sources.list.d/unstable-non-free.list/NON_FREE b/fai/config/files/etc/apt/sources.list.d/unstable-non-free.list/NON_FREE
new file mode 100644 (file)
index 0000000..4a92405
--- /dev/null
@@ -0,0 +1,2 @@
+deb http://http.us.debian.org/debian unstable contrib non-free
+deb-src http://http.us.debian.org/debian unstable contrib non-free
index dc328c0c44fd0ff90009d8e65e7a032025f20d3d..aa7440968b8eaca3cde4c43672a69ad5825441c0 100755 (executable)
@@ -294,7 +294,7 @@ btrfs subvolume create root_$DISTRO
 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
@@ -315,7 +315,7 @@ umount /mnt
 ## end create subvols ##
 
 
-
+# note, the mount point /a seems to get automatically created somewhere
 cat > /tmp/fai/fstab <<EOF
 $first_root_crypt  /  btrfs  noatime,subvol=root_$DISTRO  0 0
 $first_root_crypt  /q  btrfs  noatime,subvol=q  0 0
@@ -326,7 +326,13 @@ EOF
 
 if ifclass treetowl; then
     cat >> /tmp/fai/fstab <<'EOF'
-UUID=3f7b31cd-f299-40b4-a86b-7604282e2715 /i btrfs  noatime    0 2
+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