diff --git a/ostree/initramfs-ostree/debian/patches/0002-debian-Add-CentOS-compatible-initial-AIO-partitionin.patch b/ostree/initramfs-ostree/debian/patches/0002-debian-Add-CentOS-compatible-initial-AIO-partitionin.patch deleted file mode 100644 index 996cdcd6b..000000000 --- a/ostree/initramfs-ostree/debian/patches/0002-debian-Add-CentOS-compatible-initial-AIO-partitionin.patch +++ /dev/null @@ -1,197 +0,0 @@ -From: Robert Church -Date: Sun, 20 Feb 2022 14:50:05 +0800 -Subject: debian: Add CentOS compatible initial AIO partitioning/formatting - -Add support for initial AIO partitioning and LVM formatting for AIO -hosts. -- Creates platform-backup partition -- Creates default cgts-vg volume group and physical volume -- Creates initial logical volumes for scratch-lv and log-lv - -Signed-off-by: Robert Church - -Rebase to meta-lat 20220220 -Signed-off-by: Hongxu Jia ---- - init-ostree-install.sh | 119 ++++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 117 insertions(+), 2 deletions(-) - -diff --git a/init-ostree-install.sh b/init-ostree-install.sh -index 5f16ba9..2988ba2 100644 ---- a/init-ostree-install.sh -+++ b/init-ostree-install.sh -@@ -85,7 +85,9 @@ OPTIONAL: - BSZ=# - MB size of boot partition - RSZ=# - MB size of root partition - VSZ=# - MB size of var partition (0 for auto expand) -- -+ StarlingX -+ inststx=0 - install StarlingX partitioning -+ personality=aio - StarlingX install personality (aio,con,wor,sto) - EOF - } - -@@ -107,7 +109,7 @@ conflict_label() { - local op=$1 - local 'label' 'd' 'devs' 'conflict' 'i' 'fstype' - conflict=1 -- for label in otaefi otaboot otaboot_b otaroot otaroot_b fluxdata; do -+ for label in otaefi otaboot otaboot_b otaroot otaroot_b fluxdata platform_backup platform_pv; do - devs=$(blkid -t LABEL=$label -o device |grep -v $INSTDEV) - if [ "$devs" != "" ] ; then - i=0 -@@ -546,6 +548,8 @@ IP="" - MAX_TIMEOUT_FOR_WAITING_LOWSPEED_DEVICE=60 - OSTREE_KERNEL_ARGS=${OSTREE_KERNEL_ARGS=%OSTREE_KERNEL_ARGS%} - KS="" -+INSTSTX=${INSTSTX=""} -+PERSONALITY=${PERSONALITY=""} - - if [ "$OSTREE_KERNEL_ARGS" = "%OSTREE_KERNEL_ARGS%" ] ; then - OSTREE_KERNEL_ARGS="ro rootwait" -@@ -642,6 +646,10 @@ read_args() { - RSZ=$optarg ;; - VSZ=*) - VSZ=$optarg ;; -+ inststx=*) -+ INSTSTX=$optarg ;; -+ personality=*) -+ PERSONALITY=$optarg ;; - esac - done - # defaults if not set -@@ -654,6 +662,9 @@ read_args() { - if [ "$INSTGPG" = "" ] ; then INSTGPG=1 ; fi - if [ "$INSTFLUX" = "" ] ; then INSTFLUX=1 ; fi - if [ "$INSTSBD" = "" ] ; then INSTSBD=2 ; fi -+ if [ "$INSTSTX" = "" ] ; then INSTSTX=0 ; fi -+ if [ "$PERSONALITY" = "" ] ; then PERSONALITY=aio ; fi -+ - } - - shell_start() { -@@ -778,6 +789,40 @@ grub_partition() { - fi - fi - -+ ############################################ -+ # StarlingX: Temp partitioning compatability -+ if [ "$INSTSTX" = 1 ] ; then -+ if [ "$VSZ" = 0 ] ; then -+ # /var using up the remainder of the disk -+ echo "WARNING WARNING - Can't allocate StarlingX partitions, /var will use the remainder of the disk" -+ else -+ case $PERSONALITY in -+ aio) -+ echo "Allocating StarlingX AIO host partitioning" -+ CGCS_PV_SIZE=183296 -+ PLATFORM_BACKUP_SIZE=30000 -+ -+ grub_pt_update -+ end=$(($first+($PLATFORM_BACKUP_SIZE*1024*1024/$lsz)-1)) -+ a="$a -n $p:$first:$end -c $p:platform_backup" -+ grub_pt_update -+ end=$(($first+($CGCS_PV_SIZE*1024*1024/$lsz)-1)) -+ a="$a -n $p:$first:$end -c $p:platform_pv -t $p:8E00" -+ ;; -+ con) -+ echo "WARNING WARNING: StarlingX standard controller host partitioning not supported" -+ ;; -+ wor) -+ echo "WARNING WARNING: StarlingX worker host partitioning not supported" -+ ;; -+ sto) -+ echo "WARNING WARNING: StarlingX storage host partitioning not supported" -+ ;; -+ esac -+ fi -+ fi -+ ############################################ -+ - sgdisk $a -p ${dev} - } - -@@ -958,6 +1003,40 @@ if [ -n "${KS}" ]; then - fi - fi - -+############################################ -+# StarlingX: Clean up the volume group -+if [ "$INSTSTX" = 1 ] ; then -+ if [ "$VSZ" = 0 ] ; then -+ # /var using up the remainder of the disk -+ echo "WARNING WARNING - No volume group info to clean up, /var will use the remainder of the disk" -+ else -+ case $PERSONALITY in -+ aio) -+ echo "AIO: Clean up the volume group so that the disk can be re-partitioned" -+ vgremove -f cgts-vg -+ -+ # Find and wipe any existing PVs -+ partitions=$(pvs -o pv_name --noheading | grep -v '\[unknown\]') -+ for p in $partitions -+ do -+ echo "Pre-wiping $p (pvs present)" -+ dd if=/dev/zero of=$p bs=512 count=34 -+ dd if=/dev/zero of=$p bs=512 count=34 seek=$((`blockdev --getsz $p` - 34)) -+ pvremove -f $p -+ wipefs -a $p -+ done -+ ;; -+ con) -+ ;; -+ wor) -+ ;; -+ sto) -+ ;; -+ esac -+ fi -+fi -+############################################ -+ - # Early curl exec - - if [ "${ECURL}" != "" -a "${ECURL}" != "none" ] ; then -@@ -1161,6 +1240,42 @@ if [ "$BL" = "grub" -a "$INSTFMT" != "0" ] ; then - mkfs.ext4 -F -L fluxdata ${fs_dev}${FLUXPART} - fi - fi -+ ######################################## -+ # StarlingX: Temp VG/PV/LV/FS formatting -+ if [ "$INSTSTX" = 1 ] ; then -+ if [ "$VSZ" = 0 ] ; then -+ echo "WARNING WARNING - Skipping StarlingX default LVM storage, /var will use the remainder of the disk" -+ else -+ case $PERSONALITY in -+ aio) -+ echo "Creating StarlingX AIO host default LVM storage" -+ LOG_VOL_SIZE=8000 -+ SCRATCH_VOL_SIZE=16000 -+ -+ pi=$((pi+1)) -+ mkfs.ext4 -F -L platform_backup ${fs_dev}${pi} -+ -+ pi=$((pi+1)) -+ vgcreate --yes --force cgts-vg ${fs_dev}${pi} -+ lvcreate --yes -n log-lv --size "${LOG_VOL_SIZE}MB" cgts-vg -+ mkfs.ext4 -F /dev/cgts-vg/log-lv -+ lvcreate -n scratch-lv --size "${SCRATCH_VOL_SIZE}MB" cgts-vg -+ mkfs.ext4 -F /dev/cgts-vg/scratch-lv -+ -+ ;; -+ con) -+ echo "WARNING WARNING: StarlingX standard controller host default LVM storage not supported" -+ ;; -+ wor) -+ echo "WARNING WARNING: StarlingX worker host default LVM storage not supported" -+ ;; -+ sto) -+ echo "WARNING WARNING: StarlingX storage host default LVM storage not supported" -+ ;; -+ esac -+ fi -+ fi -+ ######################################## - elif [ "$INSTFMT" != 0 ] ; then - if [ $INSTSF = 1 ] ; then - dosfslabel ${fs_dev}${p1} boot diff --git a/ostree/initramfs-ostree/debian/patches/0003-debian-Copy-sysroot-var-log-to-LVM-volume.patch b/ostree/initramfs-ostree/debian/patches/0002-debian-Copy-sysroot-var-log-to-LVM-volume.patch similarity index 85% rename from ostree/initramfs-ostree/debian/patches/0003-debian-Copy-sysroot-var-log-to-LVM-volume.patch rename to ostree/initramfs-ostree/debian/patches/0002-debian-Copy-sysroot-var-log-to-LVM-volume.patch index 5caf60397..fb0435235 100644 --- a/ostree/initramfs-ostree/debian/patches/0003-debian-Copy-sysroot-var-log-to-LVM-volume.patch +++ b/ostree/initramfs-ostree/debian/patches/0002-debian-Copy-sysroot-var-log-to-LVM-volume.patch @@ -1,6 +1,6 @@ From: Charles Short Date: Thu, 17 Feb 2022 15:21:03 -0500 -Subject: [PATCH 3/3] debian: Copy /sysroot/var/log to LVM volume +Subject: debian: Copy /sysroot/var/log to LVM volume Sync the contents of ostree/1/var/log and the cgts-vg/log-lv volume so services will start properly @@ -12,10 +12,10 @@ Signed-off-by: Charles Short 1 file changed, 9 insertions(+) diff --git a/init-ostree-install.sh b/init-ostree-install.sh -index 2988ba2..a2ccf10 100644 +index 0e5b8f3..1a53f3c 100644 --- a/init-ostree-install.sh +++ b/init-ostree-install.sh -@@ -1528,6 +1528,15 @@ if [ -d ${PHYS_SYSROOT}/ostree/1/usr/homedirs/home ] ; then +@@ -1486,6 +1486,15 @@ if [ -d ${PHYS_SYSROOT}/ostree/1/usr/homedirs/home ] ; then tar --xattrs --xattrs-include='*' -xf - -C /var1/home 2> /dev/null fi diff --git a/ostree/initramfs-ostree/debian/patches/0005-Make-boot-efi-mount-as-rw.patch b/ostree/initramfs-ostree/debian/patches/0003-Make-boot-efi-mount-as-rw.patch similarity index 89% rename from ostree/initramfs-ostree/debian/patches/0005-Make-boot-efi-mount-as-rw.patch rename to ostree/initramfs-ostree/debian/patches/0003-Make-boot-efi-mount-as-rw.patch index eb6827c52..3b6e7aafa 100644 --- a/ostree/initramfs-ostree/debian/patches/0005-Make-boot-efi-mount-as-rw.patch +++ b/ostree/initramfs-ostree/debian/patches/0003-Make-boot-efi-mount-as-rw.patch @@ -8,10 +8,10 @@ Signed-off-by: Jim Somerville 1 file changed, 6 insertions(+) diff --git a/init-ostree-install.sh b/init-ostree-install.sh -index cc7a507..e11289a 100644 +index 1a53f3c..7f7f925 100644 --- a/init-ostree-install.sh +++ b/init-ostree-install.sh -@@ -1589,6 +1589,12 @@ if [ -d /sys/firmware/efi/efivars ] ;then +@@ -1549,6 +1549,12 @@ if [ -d /sys/firmware/efi/efivars ] ;then fi fi diff --git a/ostree/initramfs-ostree/debian/patches/0004-Wipe-signatures-and-zero-first-4KiB.patch b/ostree/initramfs-ostree/debian/patches/0004-Wipe-signatures-and-zero-first-4KiB.patch deleted file mode 100644 index 66cb8e98e..000000000 --- a/ostree/initramfs-ostree/debian/patches/0004-Wipe-signatures-and-zero-first-4KiB.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Robert Church -Date: Sat, 26 Feb 2022 22:08:52 -0500 -Subject: Wipe signatures and zero first 4KiB - -To avoid any previous ext4 file system signatures that could have been -present from previous installs, add lvcreate options to wipe signatures -and zero the first 4KiB of data in the LV. This will avoid requiring -user interaction. - - WARNING: ext4 signature detected on /dev/cgts-vg/scratch-lv at offset - 1080. Wipe it? [y/n]: - -Signed-off-by: Robert Church ---- - init-ostree-install.sh | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/init-ostree-install.sh b/init-ostree-install.sh -index a2ccf10..cc7a507 100644 ---- a/init-ostree-install.sh -+++ b/init-ostree-install.sh -@@ -1257,9 +1257,9 @@ if [ "$BL" = "grub" -a "$INSTFMT" != "0" ] ; then - - pi=$((pi+1)) - vgcreate --yes --force cgts-vg ${fs_dev}${pi} -- lvcreate --yes -n log-lv --size "${LOG_VOL_SIZE}MB" cgts-vg -+ lvcreate -y -Wy -Zy -n log-lv --size "${LOG_VOL_SIZE}MB" cgts-vg - mkfs.ext4 -F /dev/cgts-vg/log-lv -- lvcreate -n scratch-lv --size "${SCRATCH_VOL_SIZE}MB" cgts-vg -+ lvcreate -y -Wy -Zy -n scratch-lv --size "${SCRATCH_VOL_SIZE}MB" cgts-vg - mkfs.ext4 -F /dev/cgts-vg/scratch-lv - - ;; diff --git a/ostree/initramfs-ostree/debian/patches/0006-debian-set-default-size-variables-in-install-script.patch b/ostree/initramfs-ostree/debian/patches/0004-debian-set-default-size-variables-in-install-script.patch similarity index 76% rename from ostree/initramfs-ostree/debian/patches/0006-debian-set-default-size-variables-in-install-script.patch rename to ostree/initramfs-ostree/debian/patches/0004-debian-set-default-size-variables-in-install-script.patch index 9e7e57fec..ca5cbfe12 100644 --- a/ostree/initramfs-ostree/debian/patches/0006-debian-set-default-size-variables-in-install-script.patch +++ b/ostree/initramfs-ostree/debian/patches/0004-debian-set-default-size-variables-in-install-script.patch @@ -1,7 +1,9 @@ -From 52ad1b5821b76b26db2933338a46f478fadb3fcb Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Tue, 1 Mar 2022 14:28:01 +0800 -Subject: [PATCH 5/5] debian: set default size variables in install script +Subject: debian: set default size variables in install script +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit If don’t specify the size variables (FSZ BSZ RSZ VSZ) on the grub command line nor the --inst-flux option in the lat-disk command. @@ -14,10 +16,10 @@ Signed-off-by: Hongxu Jia 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init-ostree-install.sh b/init-ostree-install.sh -index 56f01c0..42091d4 100644 +index 7f7f925..a302abc 100644 --- a/init-ostree-install.sh +++ b/init-ostree-install.sh -@@ -509,9 +509,9 @@ fatal() { +@@ -528,9 +528,9 @@ fatal() { # default values must match ostree-settings.inc BLM=2506 FSZ=32 @@ -30,6 +32,3 @@ index 56f01c0..42091d4 100644 # end values from ostree-settings.inc LUKS=0 BIOSPLUSEFI=0 --- -2.25.1 - diff --git a/ostree/initramfs-ostree/debian/patches/0007-Wait-for-devices-to-be-configured-after-boot.patch b/ostree/initramfs-ostree/debian/patches/0005-Wait-for-devices-to-be-configured-after-boot.patch similarity index 81% rename from ostree/initramfs-ostree/debian/patches/0007-Wait-for-devices-to-be-configured-after-boot.patch rename to ostree/initramfs-ostree/debian/patches/0005-Wait-for-devices-to-be-configured-after-boot.patch index c4cd2dc50..f5e0b883a 100644 --- a/ostree/initramfs-ostree/debian/patches/0007-Wait-for-devices-to-be-configured-after-boot.patch +++ b/ostree/initramfs-ostree/debian/patches/0005-Wait-for-devices-to-be-configured-after-boot.patch @@ -1,7 +1,6 @@ -From 97ae81f83a1e98b84aeaf6cfc64f79ac9ea99315 Mon Sep 17 00:00:00 2001 From: Dan Voiculeasa Date: Tue, 19 Jul 2022 10:32:46 +0300 -Subject: [PATCH] Wait for devices to be configured after boot +Subject: Wait for devices to be configured after boot It was observed that dhcp requests happen too soon after boot. It may happen that the NIC driver won't rename the interface @@ -17,10 +16,10 @@ Signed-off-by: Dan Voiculeasa 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init-ostree-install.sh b/init-ostree-install.sh -index 9bfcd2a..5442391 100644 +index a302abc..4dc3079 100644 --- a/init-ostree-install.sh +++ b/init-ostree-install.sh -@@ -965,7 +965,9 @@ if [ "$INSTSH" = 1 -o "$INSTSH" = 3 -o "$INSTSH" = 4 ] ; then +@@ -920,7 +920,9 @@ if [ "$INSTSH" = 1 -o "$INSTSH" = 3 -o "$INSTSH" = 4 ] ; then lreboot fi @@ -31,6 +30,3 @@ index 9bfcd2a..5442391 100644 if [ "$INSTNAME" = "" ] ; then fatal "Error no remote archive name, need kernel argument: instname=..." --- -2.34.1 - diff --git a/ostree/initramfs-ostree/debian/patches/0008-init-ostree-install.sh-break-hardlink-in-var.patch b/ostree/initramfs-ostree/debian/patches/0006-init-ostree-install.sh-break-hardlinks-in-var.patch similarity index 88% rename from ostree/initramfs-ostree/debian/patches/0008-init-ostree-install.sh-break-hardlink-in-var.patch rename to ostree/initramfs-ostree/debian/patches/0006-init-ostree-install.sh-break-hardlinks-in-var.patch index da1559d50..2fc1ecc81 100644 --- a/ostree/initramfs-ostree/debian/patches/0008-init-ostree-install.sh-break-hardlink-in-var.patch +++ b/ostree/initramfs-ostree/debian/patches/0006-init-ostree-install.sh-break-hardlinks-in-var.patch @@ -1,7 +1,6 @@ -From c4eaf35440afe4ef0473b90b32566a05f99dfbd6 Mon Sep 17 00:00:00 2001 From: Zhang Xiao Date: Sat, 6 Aug 2022 12:39:16 +0000 -Subject: [PATCH] init-ostree-install.sh: break hardlinks in /var +Subject: init-ostree-install.sh: break hardlinks in /var Here the root filesystem is managed by OSTree. OSTree is designed to manage/deploy read-only filesystem. For read-only filesystem, hardlink @@ -21,10 +20,10 @@ Signed-off-by: Zhang Xiao 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init-ostree-install.sh b/init-ostree-install.sh -index 0e5b8f3..f66224d 100644 +index 4dc3079..41bae2a 100644 --- a/init-ostree-install.sh +++ b/init-ostree-install.sh -@@ -1478,11 +1478,11 @@ else +@@ -1480,11 +1480,11 @@ else mount -o $mount_flags LABEL=fluxdata /var1 fi if [ -d ${PHYS_SYSROOT}/ostree/1/var ] ; then @@ -38,6 +37,3 @@ index 0e5b8f3..f66224d 100644 tar --xattrs --xattrs-include='*' -xf - -C /var1/home 2> /dev/null fi --- -2.32.0 - diff --git a/ostree/initramfs-ostree/debian/patches/series b/ostree/initramfs-ostree/debian/patches/series index 81cd5d5ce..531d86d17 100644 --- a/ostree/initramfs-ostree/debian/patches/series +++ b/ostree/initramfs-ostree/debian/patches/series @@ -1,8 +1,6 @@ 0001-Prevent-auto-expansion-of-fluxdata-partition.patch -0002-debian-Add-CentOS-compatible-initial-AIO-partitionin.patch -0003-debian-Copy-sysroot-var-log-to-LVM-volume.patch -0004-Wipe-signatures-and-zero-first-4KiB.patch -0005-Make-boot-efi-mount-as-rw.patch -0006-debian-set-default-size-variables-in-install-script.patch -0007-Wait-for-devices-to-be-configured-after-boot.patch -0008-init-ostree-install.sh-break-hardlink-in-var.patch +0002-debian-Copy-sysroot-var-log-to-LVM-volume.patch +0003-Make-boot-efi-mount-as-rw.patch +0004-debian-set-default-size-variables-in-install-script.patch +0005-Wait-for-devices-to-be-configured-after-boot.patch +0006-init-ostree-install.sh-break-hardlinks-in-var.patch