Debian KS: Initialize default /etc/fstab

To provide a unified view of initial filesystem setup, this moves code
from base_bullseye.yaml into the kickstarts where we manage the
partition and filesystem creation.

Currently in CentOS, we have scratch-lv mounted at /scratch. ostree
support code will automatically setup symlinks to {opt, mnt, media, srv,
root} as follows:

 media -> var/rootdirs/media
 mnt -> var/rootdirs/mnt
 opt -> var/rootdirs/opt
 root -> var/rootdirs/root
 srv -> var/rootdirs/srv

Since /scratch is not a "supported" filesystem for this activity, we
will still require a minor base_bullseye.yaml temporary fix to set up
this link. (See Depends-On)

A followup activity is required here to move /scratch to /var/scratch
and make sure that the StarlingX code base is aligned.

Test Plan:
PASS - Build ISO
PASS - Install ISO and verify initial filesystem mounts
PASS - Ansible bootstrap
PASS - controller unlock

Change-Id: Iaa399228fea8bcea5bf45c9533ad2ab0f8fb74b7
Depends-On: https://review.opendev.org/c/starlingx/tools/+/838952
Story: 2009964
Task: 45147
Signed-off-by: Robert Church <robert.church@windriver.com>
This commit is contained in:
Robert Church 2022-04-18 00:20:24 -04:00
parent 35651387de
commit ecb6a09232

View File

@ -44,6 +44,7 @@
# Post - Kickstart Finalize Install UUID
# Post - Log Filesystem Setup
# Post Nochroot - Save Install scripts and Logs
# Post Nochroot - Set up /etc/fstab
#
############################################################################
#
@ -1871,9 +1872,6 @@ INSTALL_UUID=`uuidgen`
echo ${INSTALL_UUID} > /var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid
update_platform_conf "INSTALL_UUID=${INSTALL_UUID}"
# Create first_boot flag
touch /etc/platform/.first_boot
true
%end
@ -1995,3 +1993,28 @@ fi
true
%end
##########################################################################
%post --interpreter=/bin/bash --nochroot
HOOK_LABEL="post_nochroot"
. /tmp/lat/ks_functions.sh
# This needs to update all available ostree based rootfs
ilog "****************************************************"
ilog "*** Post Nochroot - Set up /etc/fstab ***"
ilog "****************************************************"
mkdir -p ${IMAGE_ROOTFS}/var/rootdirs/opt/platform-backup
mkdir -p ${IMAGE_ROOTFS}/var/rootdirs/scratch
mkdir -p ${IMAGE_ROOTFS}/var/log
echo -e "LABEL=platform_backup\t/var/rootdirs/opt/platform-backup\text4\tdefaults\t1 2" >> ${IMAGE_ROOTFS}/etc/fstab
echo -e "/dev/mapper/cgts--vg-scratch--lv\t/var/rootdirs/scratch\text4\tdefaults\t1 2" >> ${IMAGE_ROOTFS}/etc/fstab
echo -e "/dev/mapper/cgts--vg-log--lv\t/var/log\text4\tdefaults\t1 2" >> ${IMAGE_ROOTFS}/etc/fstab
# Create first_boot flag
touch ${IMAGE_ROOTFS}/etc/platform/.first_boot
true
%end