add support for trisquel belanos
authorIan Kelling <ian@iankelling.org>
Thu, 29 Sep 2016 22:18:49 +0000 (15:18 -0700)
committerIan Kelling <ian@iankelling.org>
Mon, 6 Feb 2017 06:21:41 +0000 (22:21 -0800)
fai-redep
fai-revm
fai/config/basefiles/mk-basefile
fai/config/files/etc/apt/preferences.d/belenos/BELANOS64 [new file with mode: 0644]
fai/config/files/etc/apt/sources.list.d/belanos.list/BELENOS64 [new file with mode: 0644]
fai/config/files/etc/apt/sources.list/DEFAULT [new file with mode: 0644]
fai/config/hooks/partition.DEFAULT
fai/config/scripts/DEBIAN/30-interface
fai/config/scripts/GRUB_PC/11-ian

index 97ccfaeb3dccf6956fcc788ad23fe3da56ef8375..1f0d92f2ad2584522d0461567a7d2bceedcb5cbf 100755 (executable)
--- a/fai-redep
+++ b/fai-redep
@@ -42,6 +42,10 @@ scp ~/.ssh/id_rsa.pub \
 s scp -r /q/root/luks /q/root/shadow \
   root@$faiserver_host:/srv/fai/config/distro-install-common
 scp /a/bin/devbyid root@$faiserver_host:/srv/fai/nfsroot/usr/local/bin
+# built this with mk-basefile -J BELENOS64. it's stored in it's own repo which
+# is published alongside this one called fai-basefiles due
+# to being a large binary file.
+scp /a/bin/basefiles/BELENOS64.tar.xz root@$faiserver_host:/srv/fai/config/basefiles
 ssh root@$faiserver_host bash <<'EOF'
 set -eE -o pipefail
 set -x
index 547689d462ae2f550eae0b07b1d839ebb62ab5cf..fcb9c073a58e0c74ba2702f490f0d82f4a53670e 100755 (executable)
--- a/fai-revm
+++ b/fai-revm
@@ -44,11 +44,9 @@ EOF
 }
 
 
-# not sure why I wanted to have this option before. oh well.
-redeploy=true
-
+new_disk=false
 reboot=true
-temp=$(getopt -l opt o "$@") || usage 1
+temp=$(getopt -l help hnr "$@") || usage 1
 eval set -- "$temp"
 while true; do
     case $1 in
@@ -61,10 +59,6 @@ while true; do
 done
 
 
-if [[ $1 == -r ]]; then
-    redeploy=false
-fi
-
 # change this to test different disk counts. 1 and > 1 should be the only
 # important things to test.
 disk_count=1
@@ -94,10 +88,10 @@ if is_arch_revm; then
 else
     ./pxe-server fai
     sleep 2
-    if $redeploy; then
-        ./fai-redep
-    fi
-    variant=ubuntu16.04
+    # I don't think these variants actually make a diff for us, but I
+    # use the appropriate one when trying a new distro just in case.
+    variant=ubuntu14.04
+    #variant=ubuntu16.04
     #variant=debian8
 fi
 
index 3f539d8b782e44d0f1e489621a92c004652cea8d..a61010a59cfe3d1654cff8770b19d5ce2e2312c6 100755 (executable)
@@ -23,6 +23,7 @@
 MIRROR_DEBIAN=http://http.us.debian.org/debian
 #MIRROR_DEBIAN=http://localmirror/debian/
 MIRROR_UBUNTU=http://mirror.netcologne.de/ubuntu/
+MIRROR_TRISQUEL=http://mirror.fsf.org/trisquel/
 MIRROR_CENTOS=http://mirror.netcologne.de/
 #MIRROR_CENTOS=http://localmirror
 #MIRROR_SLC=http://localmirror
@@ -30,6 +31,7 @@ MIRROR_CENTOS=http://mirror.netcologne.de/
 EXCLUDE_SQUEEZE=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data
 EXCLUDE_WHEEZY=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data
 EXCLUDE_JESSIE=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data
+EXCLUDE_BELENOS=dhcp3-client,dhcp3-common,info
 EXCLUDE_TRUSTY=dhcp3-client,dhcp3-common,info
 EXCLUDE_XENIAL=isc-dhcp-client,isc-dhcp-common,udhcpc,dibbler-client,dhcpcd5,info,tasksel,tasksel-data
 
@@ -219,6 +221,16 @@ xenial() {
 }
 
 
+belenos() {
+    ln -sf gutsy /usr/share/debootstrap/scripts/belenos
+    local arch=$1
+
+    check
+    debootstrap --arch $arch --exclude=${EXCLUDE_BELENOS} --include=${INCLUDE_DEBIAN} belenos $xtmp ${MIRROR_TRISQUEL}
+    cleanup-deb
+    tarit
+}
+
 unknown() {
 
     echo "Unknown distribution. Aborting."
@@ -277,6 +289,7 @@ case "$target" in
     SLC7_64) slc amd64 7 ;;
     TRUSTY32) trusty i386 ;;
     TRUSTY64) trusty amd64 ;;
+    BELENOS64) belenos amd64 ;;
     XENIAL32) xenial i386 ;;
     XENIAL64) xenial amd64 ;;
     SQUEEZE32) squeeze i386 ;;
diff --git a/fai/config/files/etc/apt/preferences.d/belenos/BELANOS64 b/fai/config/files/etc/apt/preferences.d/belenos/BELANOS64
new file mode 100644 (file)
index 0000000..f20972b
--- /dev/null
@@ -0,0 +1,4 @@
+# a bit older distro, so get all backports
+Package: *
+Pin: release a=belenos-backports
+Pin-Priority: 500
diff --git a/fai/config/files/etc/apt/sources.list.d/belanos.list/BELENOS64 b/fai/config/files/etc/apt/sources.list.d/belanos.list/BELENOS64
new file mode 100644 (file)
index 0000000..17b28dc
--- /dev/null
@@ -0,0 +1,12 @@
+deb http://mirror.fsf.org/trisquel/ belenos main
+deb-src http://mirror.fsf.org/trisquel/ belenos main
+
+deb http://mirror.fsf.org/trisquel/ belenos-updates main
+deb-src http://mirror.fsf.org/trisquel/ belenos-updates main
+
+deb http://mirror.fsf.org/trisquel/ belenos-security main
+deb-src http://mirror.fsf.org/trisquel/ belenos-security main
+
+# Uncomment this lines to enable the backports optional repository
+deb http://mirror.fsf.org/trisquel/ belenos-backports main
+deb-src http://mirror.fsf.org/trisquel/ belenos-backports main
diff --git a/fai/config/files/etc/apt/sources.list/DEFAULT b/fai/config/files/etc/apt/sources.list/DEFAULT
new file mode 100644 (file)
index 0000000..0c5461c
--- /dev/null
@@ -0,0 +1 @@
+# intentionaly left empty. only using sources.list.d
index 79826c7da5fac44a1897320ec005c9e77c22daa0..8a32c31b49cb81eb8c4953cea8b9cd1e247f4170 100755 (executable)
@@ -166,6 +166,8 @@ if [[ ! $DISTRO ]]; then
         DISTRO=debianstable
     elif ifclass XENIAL64; then
         DISTRO=ubuntuxenial
+    elif ifclass BELENOS64; then
+        DISTRO=trisquelbelenos
     else
         echo "PARTITIONER ERROR: no distro class/var set" >&2
         exit 1
index a962049c11120b3cc7f96cffcc74ef636a5351d2..e249b6746cd3f7d6eb893263a46922a96c761a80 100755 (executable)
@@ -5,9 +5,14 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
 if ! ifclass STABLE; then
     if ifclass VM; then
-        # For a vm, we only get  ID_NET_NAME_MAC from below,
-        # but when it reboots, it uses ID_NET_NAME_SLOT.
-        NIC1=ens3
+        # older distro still uses eth0
+        if ifclass BELENOS64; then
+            NIC1=eth0
+        else
+            # For a vm, we only get  ID_NET_NAME_MAC from below,
+            # but when it reboots, it uses ID_NET_NAME_SLOT.
+            NIC1=ens3
+        fi
     else
         # get persistent interface name. Note, these class conditions
         # will need to get modified for new oses. testing vm doesn't use
index 11cd818d50df43b2130ed64bf08608cf9bb79e39..e27e394e8ac3509032d1ab194fc8c35812ebee92 100755 (executable)
@@ -54,9 +54,16 @@ cp -rL /home/ian/.ssh /root
 chown -R root:root /root/.ssh
 chmod 700 /root/.ssh
 
+
 # default jessie groups + kvm, systemd-journal, adm
-usermod -aG adm,cdrom,floppy,sudo,audio,dip,video,plugdev,netdev,systemd-journal ian
+usermod -aG adm,cdrom,floppy,sudo,audio,dip,video,plugdev,netdev ian
 
+if getent group systemd-journal >/dev/null; then
+  usermod -aG systemd-journal ian
+  # makes the journal be saved to disk.
+  mkdir -p /var/log/journal
+  chmod 755 /var/log/journal
+fi
 # https://askubuntu.com/questions/33416/how-do-i-disable-the-boot-splash-screen-and-only-show-kernel-and-boot-text-inst
 # it suggests not having plymouth-theme-ubuntu-text, but
 # making it not installed then kills plymouth, then makes
@@ -75,6 +82,3 @@ for g in plugdev audio video cdrom; do
     $ROOTCMD usermod -a -G $g traci
 done
 
-# makes the journal be saved to disk.
-$ROOTCMD mkdir -p $FAI_ROOT/var/log/journal
-$ROOTCMD chmod 755 $FAI_ROOT/var/log/journal