From d0b6a8cd4608fdffcf733f9180744819d8889be0 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Thu, 29 Sep 2016 15:18:49 -0700 Subject: [PATCH] add support for trisquel belanos --- fai-redep | 4 ++++ fai-revm | 18 ++++++------------ fai/config/basefiles/mk-basefile | 13 +++++++++++++ .../etc/apt/preferences.d/belenos/BELANOS64 | 4 ++++ .../apt/sources.list.d/belanos.list/BELENOS64 | 12 ++++++++++++ fai/config/files/etc/apt/sources.list/DEFAULT | 1 + fai/config/hooks/partition.DEFAULT | 2 ++ fai/config/scripts/DEBIAN/30-interface | 11 ++++++++--- fai/config/scripts/GRUB_PC/11-ian | 12 ++++++++---- 9 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 fai/config/files/etc/apt/preferences.d/belenos/BELANOS64 create mode 100644 fai/config/files/etc/apt/sources.list.d/belanos.list/BELENOS64 create mode 100644 fai/config/files/etc/apt/sources.list/DEFAULT diff --git a/fai-redep b/fai-redep index 97ccfae..1f0d92f 100755 --- 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 diff --git a/fai-revm b/fai-revm index 547689d..fcb9c07 100755 --- 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 diff --git a/fai/config/basefiles/mk-basefile b/fai/config/basefiles/mk-basefile index 3f539d8..a61010a 100755 --- a/fai/config/basefiles/mk-basefile +++ b/fai/config/basefiles/mk-basefile @@ -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 index 0000000..f20972b --- /dev/null +++ b/fai/config/files/etc/apt/preferences.d/belenos/BELANOS64 @@ -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 index 0000000..17b28dc --- /dev/null +++ b/fai/config/files/etc/apt/sources.list.d/belanos.list/BELENOS64 @@ -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 index 0000000..0c5461c --- /dev/null +++ b/fai/config/files/etc/apt/sources.list/DEFAULT @@ -0,0 +1 @@ +# intentionaly left empty. only using sources.list.d diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index 79826c7..8a32c31 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -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 diff --git a/fai/config/scripts/DEBIAN/30-interface b/fai/config/scripts/DEBIAN/30-interface index a962049..e249b67 100755 --- a/fai/config/scripts/DEBIAN/30-interface +++ b/fai/config/scripts/DEBIAN/30-interface @@ -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 diff --git a/fai/config/scripts/GRUB_PC/11-ian b/fai/config/scripts/GRUB_PC/11-ian index 11cd818..e27e394 100755 --- a/fai/config/scripts/GRUB_PC/11-ian +++ b/fai/config/scripts/GRUB_PC/11-ian @@ -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 -- 2.30.2