add xenial support with basic debian parity
authorIan Kelling <ian@iankelling.org>
Fri, 16 Sep 2016 15:48:01 +0000 (08:48 -0700)
committerIan Kelling <ian@iankelling.org>
Mon, 6 Feb 2017 06:21:41 +0000 (22:21 -0800)
17 files changed:
fai-redep
fai-revm
fai/config/class/50-host-classes
fai/config/class/DEBIAN.var
fai/config/class/UBUNTU.var [changed from file to symlink]
fai/config/files/etc/apt/sources.list.d/testing-non-free.list/DEBIAN_NON_FREE [moved from fai/config/files/etc/apt/sources.list.d/testing-non-free.list/NON_FREE with 100% similarity]
fai/config/files/etc/apt/sources.list.d/unstable-non-free.list/DEBIAN_NON_FREE [moved from fai/config/files/etc/apt/sources.list.d/unstable-non-free.list/NON_FREE with 100% similarity]
fai/config/files/etc/apt/sources.list.d/xenial.list/XENIAL64 [new file with mode: 0644]
fai/config/hooks/partition.DEFAULT
fai/config/hooks/updatebase.UBUNTU [changed from file to symlink]
fai/config/package_config/FAIBASE
fai/config/package_config/UBUNTU
fai/config/scripts/GRUB_PC/11-ian
fai/config/scripts/LAST/50-misc
fai/config/scripts/UBUNTU/10-rootpw [new symlink]
fai/config/scripts/UBUNTU/30-interface [new symlink]
fai/config/scripts/UBUNTU/90-apt [deleted file]

index de4fe303b2e3a238b241a466c2e5d32b4d39ad2c..43d34bbbfb1fb20b4fa886c7e93b6f64d1ab3f1f 100755 (executable)
--- a/fai-redep
+++ b/fai-redep
@@ -46,4 +46,7 @@ ssh root@$faiserver_host bash <<'EOF'
 set -eE -o pipefail
 chmod 644 /srv/fai/config/files/home/ian/.ssh/authorized_keys/GRUB_PC
 chmod -R a+rX /srv/fai/config/distro-install-common
+cd /srv/fai/config/basefiles
+u=http://fai-project.org/download/basefiles/XENIAL64.tar.xz
+wget -nv -O /srv/fai/config/basefiles/${u##*/} $u
 EOF
index d8833ab4b01e2e920f6f31bc2793a64c56f0b763..547689d462ae2f550eae0b07b1d839ebb62ab5cf 100755 (executable)
--- a/fai-revm
+++ b/fai-revm
@@ -65,7 +65,9 @@ if [[ $1 == -r ]]; then
     redeploy=false
 fi
 
-disk_count=2
+# change this to test different disk counts. 1 and > 1 should be the only
+# important things to test.
+disk_count=1
 
 
 if [[ $script_dir == /a/bin/* ]]; then
@@ -95,7 +97,8 @@ else
     if $redeploy; then
         ./fai-redep
     fi
-    variant=debian8
+    variant=ubuntu16.04
+    #variant=debian8
 fi
 
 name=demohost
index 6f32a08cdef0ce4ee85106dbbff4ebc052f368ae..6f3f8a885f729c9580d9aa49a3b59ce2bd05bd5b 100755 (executable)
 # 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. Each host needs
-# to have a class of either STABLE or STRETCH64.
+# to have a class of either DEBIAN + STABLE or STRETCH64,
+# or UBUNTU + XENIAL64.
 #
 # It's shell looks like this:
 # if [[ ! -e /a/bin/fai/fai-wrapper ]]; then
 #     case $HOSTNAME in
-#         tp) STABLE ;;
+#         tp) DEBIAN STABLE ;;
 #         # add more multi-boot hostnames here
 #     esac
 # fi
@@ -39,10 +40,10 @@ if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
 fi
 
 # use a list of classes for our demo machine
-echo "FAIBASE DEBIAN PARTITION_PROMPT"
+echo "FAIBASE PARTITION_PROMPT"
 case $HOSTNAME in
     x2|frodo|treetowl)
-        echo "NON_FREE"
+        echo "DEBIAN_NON_FREE"
         if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
             echo "STABLE_NON_FREE"
         fi
index 1f6e441d6349260461d7aff857c04626cc8a1e51..397b5ea9b0564e335da1d94a4e46588df7ee35dd 100644 (file)
@@ -10,7 +10,7 @@ MODULESLIST="usbhid psmouse"
 
 # if you have enough RAM (>2GB) you may want to enable this line. It
 # also puts /var/cache into a ramdisk.
-# uncommented from upstream
+# ian: uncommented
 FAI_RAMDISKS="$target/var/lib/dpkg $target/var/cache"
 
 # if you want to use the faiserver as APT proxy
deleted file mode 100644 (file)
index f45c3ce3caf38e3d2255b21642e0073d624159e9..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-ubuntudist=xenial
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..702cb15b7a5ea314d11b448d96aeaf83fefdb039
--- /dev/null
@@ -0,0 +1 @@
+DEBIAN.var
\ No newline at end of file
diff --git a/fai/config/files/etc/apt/sources.list.d/xenial.list/XENIAL64 b/fai/config/files/etc/apt/sources.list.d/xenial.list/XENIAL64
new file mode 100644 (file)
index 0000000..452f266
--- /dev/null
@@ -0,0 +1,11 @@
+###### Ubuntu Main Repos
+deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe
+deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main universe
+
+###### Ubuntu Update Repos
+deb http://us.archive.ubuntu.com/ubuntu/ xenial-security main universe
+deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main universe
+deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main universe
+deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-security main universe
+deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main universe
+deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main universe
index 39c0b3fa9ade884445c36fb0fddfa403a7bc0c4f..8c3140b5fd3c711aadb11914591c74b650af0e1e 100755 (executable)
@@ -342,6 +342,7 @@ EOF
 # these 2 are alternative ways to identify a subvol, i think i prefer the 2nd.
 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
deleted file mode 100755 (executable)
index dadaa48693fef04a7db9d4b6f712e644980fcd1c..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#! /bin/bash
-
-# use external mirror, remove this script when using a mirror from CD
-
-cat <<EOM > $target/etc/apt/sources.list
-# external mirror
-deb MIRRORURL $ubuntudist main restricted universe multiverse
-deb MIRRORURL $ubuntudist-updates main restricted universe multiverse
-deb MIRRORURL $ubuntudist-security main restricted universe multiverse
-EOM
-
-# determine a fast mirror for Ubuntu
-list=$(curl -s http://mirrors.ubuntu.com/mirrors.txt)
-mirror=$(netselect $list | awk '{print $2}')
-sed -i -e "s#MIRRORURL#$mirror#" $target/etc/apt/sources.list
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..77bc497dd5ff4a51ccaf7f3e228bd6abf4584b17
--- /dev/null
@@ -0,0 +1 @@
+updatebase.DEBIAN
\ No newline at end of file
index 591327b11b89b08573f8a260dc7d9ede89f6c3c3..cab58ba8a9ad04fa4a63e2fbe229c99bac6ed265 100644 (file)
@@ -1,4 +1,4 @@
-PACKAGES aptitude DEBIAN
+PACKAGES aptitude DEBIAN UBUNTU
 fai-client
 cron
 debconf-utils
index 6028909e50848934a8a0b851b2bf705a5e783b19..4a5a976f5348df8a627e14eb29d01ec19f040868 100644 (file)
@@ -13,7 +13,7 @@ PACKAGES install DHCPC
 isc-dhcp-client
 
 PACKAGES install GRUB_PC
-grub-pc
+grub-pc cryptsetup btrfs-tools bridge-utils
 
 PACKAGES aptitude-r XORG
 ubuntu-desktop
index 5d064be41bfa8593539c54ac1e1d9d65ee494c8d..11cd818d50df43b2130ed64bf08608cf9bb79e39 100755 (executable)
@@ -26,9 +26,10 @@ fi
 
 if ifclass DEBIAN; then
     fcopy -M /etc/apt/preferences.d/unstable
-    fcopy -riM /etc/apt/sources.list.d
-    $ROOTCMD apt-get update
 fi
+fcopy -riM /etc/apt/sources.list.d
+$ROOTCMD apt-get update
+
 
 
 # note:
@@ -55,6 +56,17 @@ 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
+
+# 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
+# the system not boot.
+sed -ri 's/(^ *GRUB_CMDLINE_LINUX.*)quiet splash/\1/' /etc/default/grub
+# on xenial, no grub is displayed at all. fix that.
+# found just by noticing this in the config file, and a
+# warning about it in error.log
+sed -i '/^ *GRUB_HIDDEN_TIMEOUT/d' /etc/default/grub
+update-grub2
 EOF
 
 
index 11bafd52d33033b11c23113fb16de7b091cb13db..232b0c807d2feb1f3edeb84b49c5cd58655d1fdf 100755 (executable)
@@ -46,7 +46,7 @@ if [ $do_init_tasks -eq 1 ] ; then
 fi
 
 # Make sure everything is configured properly
-if ifclass DEBIAN ; then
+if ifclass DEBIAN || ifclass UBUNTU; then
         echo "Running \"apt-get -f install\" for the last time."
         $ROOTCMD apt-get -f install
 fi
diff --git a/fai/config/scripts/UBUNTU/10-rootpw b/fai/config/scripts/UBUNTU/10-rootpw
new file mode 120000 (symlink)
index 0000000..c0d9817
--- /dev/null
@@ -0,0 +1 @@
+../DEBIAN/10-rootpw
\ No newline at end of file
diff --git a/fai/config/scripts/UBUNTU/30-interface b/fai/config/scripts/UBUNTU/30-interface
new file mode 120000 (symlink)
index 0000000..e3dce43
--- /dev/null
@@ -0,0 +1 @@
+../DEBIAN/30-interface
\ No newline at end of file
diff --git a/fai/config/scripts/UBUNTU/90-apt b/fai/config/scripts/UBUNTU/90-apt
deleted file mode 100755 (executable)
index b75555b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#! /bin/bash
-
-# check if we already use an external mirror
-grep -q "external mirror" $target/etc/apt/sources.list && exit 0
-
-cat <<EOM > $target/etc/apt/sources.list
-# external mirror
-deb MIRRORURL $ubuntudist main restricted universe multiverse
-deb MIRRORURL $ubuntudist-updates main restricted universe multiverse
-deb MIRRORURL $ubuntudist-security main restricted universe multiverse
-EOM
-
-# determine a fast mirror for Ubuntu
-list=$(curl -s http://mirrors.ubuntu.com/mirrors.txt)
-mirror=$(netselect $list | awk '{print $2}')
-sed -i -e "s#MIRRORURL#$mirror#" $target/etc/apt/sources.list