integ/ostree/initramfs-ostree/debian/patches/0003-debian-Copy-sysroot-var-log-to-LVM-volume.patch
Robert Church 7ba7c83297 debian: Allow ISO installs to proceed without user prompts
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]:

Change-Id: Ifeb0ddf193820a3e5d98006093813355d2494797
Story: 2009101
Task: 44628
Signed-off-by: Robert Church <robert.church@windriver.com>
2022-02-28 02:20:28 -05:00

34 lines
1.1 KiB
Diff

From: Charles Short <charles.short@windriver.com>
Date: Thu, 17 Feb 2022 15:21:03 -0500
Subject: [PATCH 3/3] 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
at boot.
Signed-off-by: Charles Short <charles.short@windriver.com>
---
init-ostree-install.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/init-ostree-install.sh b/init-ostree-install.sh
index 0a84179..d777682 100644
--- a/init-ostree-install.sh
+++ b/init-ostree-install.sh
@@ -1512,6 +1512,15 @@ if [ -d ${PHYS_SYSROOT}/ostree/1/usr/homedirs/home ] ; then
tar --xattrs --xattrs-include='*' -xf - -C /var1/home 2> /dev/null
fi
+if [ -b /dev/cgts-vg/log-lv ]; then
+ if [ -d ${PHYS_SYSROOT}/ostree/1/var/log/apt ] ; then
+ mnt_point=$(mktemp -d)
+ mount -t ext4 /dev/cgts-vg/log-lv ${mnt_point} || fatal "Error mounting ${mnt_point}"
+ cp -rp ${PHYS_SYSROOT}/ostree/1/var/log/* ${mnt_point}
+ umount ${mnt_point}
+ fi
+fi
+
if [ -n "${KS}" ]; then
rootfs=`ls ${PHYS_SYSROOT}/ostree/? -d`
if [ "$INSTAB" = 1 ] ; then