changes for bullseye
authorIan Kelling <iank@fsf.org>
Wed, 25 Nov 2020 05:23:49 +0000 (00:23 -0500)
committerIan Kelling <iank@fsf.org>
Wed, 25 Nov 2020 05:23:49 +0000 (00:23 -0500)
fai/config/class/50-host-classes
fai/config/distro-install-common/libreboot_grub.cfg
fai/config/files/etc/apt/sources.list.d/bulleye.list/BULLSEYE_FREE [new file with mode: 0644]
fai/config/files/etc/apt/sources.list.d/bulleye.list/BULLSEYE_NONFREE [new file with mode: 0644]
fai/config/hooks/partition.DEFAULT
faiserver-setup

index 61a55934d0054397c6c89c073942d5aca3f3e7ee..076323b14577f93795d58508c2d4c310c01a08f4 100755 (executable)
@@ -26,15 +26,24 @@ echo FAIBASE STANDARD DEBIAN
 # Debian stable basefile gets built by faisetup and gets used otherwise.
 # With X suffix, means it has gone through the dirinstall process and has eXtra
 # things installed, to speed up installation.
 # Debian stable basefile gets built by faisetup and gets used otherwise.
 # With X suffix, means it has gone through the dirinstall process and has eXtra
 # things installed, to speed up installation.
-# STRETCH64, BUSTER64, XENIAL64, FLIDAS64, FLIDAS64BIG, ETIONA64, BIONIC64, FOCAL64
 #
 #
-# The distro subvol name, we can add as many of these as we want:
-# VOL_TESTING, VOL_STRETCH, VOL_BUSTER, VOL_XENIAL, VOL_FLIDAS,
-# VOL_ETIONA VOL_STRETCH_BOOTSTRAP.  Using VOL_STRETCH_BOOTSTRAP sets up
-# the install to act like a pxe rom if grub sets a specific var.
+# STRETCH64, BUSTER64, BULLSEYE64,
+# FLIDAS64, FLIDAS64BIG, ETIONA64,
+# XENIAL64, BIONIC64, FOCAL64,
 #
 #
-# The apt sources files we want, STRETCH_FREE, STRETCH_NONFREE,
-# BUSTER_FREE, BUSTER_NONFREE, TESTING_FREE, TESTING_NONFREE,
+# The distro subvol name, we can add as many of these as we want:
+# VOL_TESTING, VOL_STRETCH, VOL_BUSTER, VOL_BULLSEYE,
+# VOL_FLIDAS, VOL_ETIONA
+# VOL_XENIAL, VOL_BIONIC VOL_FOCAL
+# VOL_STRETCH_BOOTSTRAP.
+# Using VOL_STRETCH_BOOTSTRAP sets up the install to act like a pxe rom if
+# grub sets a specific var.
+#
+# The apt sources files we want,
+# STRETCH_FREE, STRETCH_NONFREE,
+# BUSTER_FREE, BUSTER_NONFREE,
+# BULLSEYE_FREE, BULLSEYE_NONFREE
+# TESTING_FREE, TESTING_NONFREE,
 # XENIAL_FREE, BIONIC, FOCAL, FLIDAS, ETIONA, STRETCH_LINODE.
 #
 # It's all a little redundant in some cases, but it keeps things
 # XENIAL_FREE, BIONIC, FOCAL, FLIDAS, ETIONA, STRETCH_LINODE.
 #
 # It's all a little redundant in some cases, but it keeps things
index 4610044a7e60b6d3cfd1f785bdff581a12f30a39..8a1fc4ee75e8f649d30e4009b814ea3c3065e6f9 100644 (file)
@@ -25,7 +25,7 @@ function save_chosen {
 # We don't set this to fai check so we can't get into
 # an infinite reboot cycle. We depend on the os to
 # create the initial grubenv file.
 # We don't set this to fai check so we can't get into
 # an infinite reboot cycle. We depend on the os to
 # create the initial grubenv file.
-set default=/debianstretch_bootstrap # could use 0 here.
+set default=/debianbuster_bootstrap # could use 0 here.
 set timeout=1
 
 for part in (ahci*4) (ata*4); do
 set timeout=1
 
 for part in (ahci*4) (ata*4); do
@@ -43,7 +43,7 @@ done
 
 did_fai_check=false
 
 
 did_fai_check=false
 
-bs_dir=/debianstretch_bootstrap
+bs_dir=/debianbuster_bootstrap
 menuentry $bs_dir --id=$bs_dir {
     # note, we might be able to use $chosen and avoid setting this here,
     # and set it inside save_chosen. but I haven't tested it,
 menuentry $bs_dir --id=$bs_dir {
     # note, we might be able to use $chosen and avoid setting this here,
     # and set it inside save_chosen. but I haven't tested it,
diff --git a/fai/config/files/etc/apt/sources.list.d/bulleye.list/BULLSEYE_FREE b/fai/config/files/etc/apt/sources.list.d/bulleye.list/BULLSEYE_FREE
new file mode 100644 (file)
index 0000000..04e72ca
--- /dev/null
@@ -0,0 +1,11 @@
+deb http://http.us.debian.org/debian bullseye main
+deb-src http://http.us.debian.org/debian bullseye main
+
+deb http://security.debian.org/ bullseye-security main
+deb-src http://security.debian.org/ bullseye-security main
+
+deb http://http.us.debian.org/debian bullseye-updates main
+deb-src http://http.us.debian.org/debian bullseye-updates main
+
+deb http://http.debian.net/debian bullseye-backports main
+deb-src http://http.debian.net/debian bullseye-backports main
diff --git a/fai/config/files/etc/apt/sources.list.d/bulleye.list/BULLSEYE_NONFREE b/fai/config/files/etc/apt/sources.list.d/bulleye.list/BULLSEYE_NONFREE
new file mode 100644 (file)
index 0000000..2b5aa98
--- /dev/null
@@ -0,0 +1,17 @@
+deb http://http.us.debian.org/debian bullseye main contrib non-free
+deb-src http://http.us.debian.org/debian bullseye main contrib non-free
+
+deb http://security.debian.org/ bullseye-security main contrib non-free
+deb-src http://security.debian.org/ bullseye-security main contrib non-free
+
+deb http://http.us.debian.org/debian bullseye-updates main contrib non-free
+deb-src http://http.us.debian.org/debian bullseye-updates main contrib non-free
+
+deb http://http.debian.net/debian bullseye-backports main contrib non-free
+deb-src http://http.debian.net/debian bullseye-backports main contrib non-free
+
+deb http://http.us.debian.org/debian unstable main contrib non-free
+deb-src http://http.us.debian.org/debian unstable main contrib non-free
+
+deb http://http.us.debian.org/debian experimental main
+deb-src http://http.us.debian.org/debian experimental main
index 7c88c7492a8b808ceeb52eaf0c3eb25b87260c47..3d024af5dbcc789939423f3afa2fc14089677d86 100755 (executable)
@@ -305,12 +305,14 @@ esac
 
 
 if [[ ! $DISTRO ]]; then
 
 
 if [[ ! $DISTRO ]]; then
-  if ifclass VOL_STRETCH_BOOTSTRAP; then
-    DISTRO=debianstretch_bootstrap
+  if ifclass VOL_BUSTER_BOOTSTRAP; then
+    DISTRO=debianbuster_bootstrap
   elif ifclass VOL_STRETCH; then
     DISTRO=debianstretch
   elif ifclass VOL_BUSTER; then
     DISTRO=debianbuster
   elif ifclass VOL_STRETCH; then
     DISTRO=debianstretch
   elif ifclass VOL_BUSTER; then
     DISTRO=debianbuster
+  elif ifclass VOL_BULLSEYE; then
+    DISTRO=debianbullseye
   elif ifclass VOL_TESTING; then
     DISTRO=debiantesting
   elif ifclass VOL_XENIAL; then
   elif ifclass VOL_TESTING; then
     DISTRO=debiantesting
   elif ifclass VOL_XENIAL; then
@@ -319,8 +321,6 @@ if [[ ! $DISTRO ]]; then
     DISTRO=ubuntubionic
   elif ifclass VOL_FOCAL; then
     DISTRO=ubuntufocal
     DISTRO=ubuntubionic
   elif ifclass VOL_FOCAL; then
     DISTRO=ubuntufocal
-  elif ifclass VOL_BELENOS; then
-    DISTRO=trisquelbelenos
   elif ifclass VOL_FLIDAS; then
     DISTRO=trisquelflidas
   elif ifclass VOL_ETIONA; then
   elif ifclass VOL_FLIDAS; then
     DISTRO=trisquelflidas
   elif ifclass VOL_ETIONA; then
@@ -516,7 +516,7 @@ else
 fi
 
 
 fi
 
 
-if $wipe && [[ $DISTRO != debianstretch_bootstrap ]]; then
+if $wipe && [[ $DISTRO != debianbuster_bootstrap ]]; then
   # bootstrap distro doesn't use separate encrypted root.
   mount -o subvolid=0 $first_root_crypt /mnt
   # systemd creates subvolumes we want to delete.
   # bootstrap distro doesn't use separate encrypted root.
   mount -o subvolid=0 $first_root_crypt /mnt
   # systemd creates subvolumes we want to delete.
@@ -553,7 +553,7 @@ btrfs subvolume set-default 0 /mnt # already default, just ensuring it.
 mkdir -p /mnt/grub2
 cp $FAI/distro-install-common/libreboot_grub.cfg /mnt/grub2
 
 mkdir -p /mnt/grub2
 cp $FAI/distro-install-common/libreboot_grub.cfg /mnt/grub2
 
-if [[ $DISTRO == debianstretch_bootstrap ]]; then
+if [[ $DISTRO == debianbuster_bootstrap ]]; then
   # this is just convenience for the libreboot_grub config
   # so we can glob the other ones easier.
   boot_vol=$DISTRO
   # this is just convenience for the libreboot_grub config
   # so we can glob the other ones easier.
   boot_vol=$DISTRO
@@ -576,7 +576,7 @@ grub-editenv /mnt/grubenv set did_fai_check=true
 grub-editenv /mnt/grubenv set last_boot=/$boot_vol
 umount /mnt
 
 grub-editenv /mnt/grubenv set last_boot=/$boot_vol
 umount /mnt
 
-if [[ $DISTRO == debianstretch_bootstrap ]]; then
+if [[ $DISTRO == debianbuster_bootstrap ]]; then
   cat > /tmp/fai/fstab <<EOF
 $first_boot_dev  /  btrfs  noatime,subvol=$boot_vol  0 0
 EOF
   cat > /tmp/fai/fstab <<EOF
 $first_boot_dev  /  btrfs  noatime,subvol=$boot_vol  0 0
 EOF
index 58d670d531a84b230586612c6f8dc54905d37194..086a351d97760ed72385323fc422a899b2f7773e 100755 (executable)
@@ -17,7 +17,9 @@
 
 x="$(readlink -f "$BASH_SOURCE")"; source "${x%/*}/bash-trace"
 
 
 x="$(readlink -f "$BASH_SOURCE")"; source "${x%/*}/bash-trace"
 
-[[ $EUID == 0 ]] || exec sudo -i "${BASH_SOURCE}" "$@"
+[[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@"
+
+LC_USEBASHRC=t; . ~/.bashrc
 
 usage() {
   cat <<EOF
 
 usage() {
   cat <<EOF
@@ -47,6 +49,12 @@ e() { echo "+ $@"; "$@"; }
 
 base=${1:-buster}
 arch=${2:-64}
 
 base=${1:-buster}
 arch=${2:-64}
+
+if [[ $base == [[:upper:]] ]]; then
+  echo $0: error: use lowercase base
+  exit 1
+fi
+
 basefile=($BASEFILE_DIR/${base^^}${arch^^}.tar.gz)
 sed="sed -ri --follow-symlinks"
 
 basefile=($BASEFILE_DIR/${base^^}${arch^^}.tar.gz)
 sed="sed -ri --follow-symlinks"
 
@@ -74,21 +82,20 @@ if grep -xFq 'VERSION="8 (jessie)"' /etc/os-release; then
   cat >/etc/apt/sources.list.d/fai.list <<'EOF'
 deb https://fai-project.org/download jessie koeln
 EOF
   cat >/etc/apt/sources.list.d/fai.list <<'EOF'
 deb https://fai-project.org/download jessie koeln
 EOF
-elif grep -iE 'VERSION=.*(stretch|flidas|xenail|buster|etiona)' /etc/os-release; then
+elif grep -iE 'VERSION=.*(stretch|flidas|xenail|buster|bullseye|etiona)' /etc/os-release; then
   # fai on ubuntu only has official support using the universe repo, but newer
   # tends to have less bugs.
   wget -O - https://fai-project.org/download/2BF8D9FE074BCDE4.asc | apt-key add -
 
   case $base in
   # fai on ubuntu only has official support using the universe repo, but newer
   # tends to have less bugs.
   wget -O - https://fai-project.org/download/2BF8D9FE074BCDE4.asc | apt-key add -
 
   case $base in
-    stretch)
-      cat >/etc/apt/sources.list.d/fai.list <<'EOF'
-deb https://fai-project.org/download stretch koeln
+    stretch|buster|bullseye)
+      cat >/etc/apt/sources.list.d/fai.list <<EOF
+deb https://fai-project.org/download $base koeln
 EOF
       ;;
 EOF
       ;;
-    buster)
-      cat >/etc/apt/sources.list.d/fai.list <<'EOF'
-deb https://fai-project.org/download buster koeln
-EOF
+    *)
+      echo "$0: error: script needs updating for new base" >&2
+      exit 1
       ;;
   esac
 else
       ;;
   esac
 else
@@ -120,21 +127,29 @@ r=http://http.us.debian.org/debian
 # like default, but scrap httpredir, and nonfree.
 # All my systems should be able to get along without nonfree
 # for a base working system afaik.
 # like default, but scrap httpredir, and nonfree.
 # All my systems should be able to get along without nonfree
 # for a base working system afaik.
+
 cat >/etc/fai/apt/sources.list <<EOF
 deb $r $base main contrib
 cat >/etc/fai/apt/sources.list <<EOF
 deb $r $base main contrib
-deb http://security.debian.org/debian-security $base/updates main contrib
 EOF
 EOF
-
-
 case $base in
   jessie|stretch|buster)
     cat >>/etc/fai/apt/sources.list <<EOF
 case $base in
   jessie|stretch|buster)
     cat >>/etc/fai/apt/sources.list <<EOF
+deb http://security.debian.org/debian-security $base/updates main contrib
+EOF
+    ;;
+  *)
+    # new naming convention
+    cat >>/etc/fai/apt/sources.list <<EOF
+deb http://security.debian.org/debian-security $base-security main contrib
+EOF
+esac
+
+
+cat >>/etc/fai/apt/sources.list <<EOF
 # use fai repo. it's commented in the defaults. it's got bug fixes.
 # and may contain newer packages.
 deb http://fai-project.org/download $base koeln
 EOF
 # use fai repo. it's commented in the defaults. it's got bug fixes.
 # and may contain newer packages.
 deb http://fai-project.org/download $base koeln
 EOF
-    ;;
-esac
 
 if [[ $base == jessie ]]; then
   cat >>/etc/fai/apt/sources.list <<'EOF'
 
 if [[ $base == jessie ]]; then
   cat >>/etc/fai/apt/sources.list <<'EOF'