relocate /www to /var/www

Relocate writable /www to /var/www

Passed TCs:
1. provisioned DC system, std system controller + SX subcloud
2. Provision AIO-DX, standard load w/ compute and storage nodes
3. DC Upgrade, AIO-SX subclouds
4. reinstall controller
5. backup restore

Story: 2009101
Task: 43474
Change-Id: I0fd5cd4b57655325139f7c06bd44e42d06390ab7
Signed-off-by: Bin Qian <bin.qian@windriver.com>
This commit is contained in:
Bin Qian 2021-08-16 12:59:28 -04:00
parent 14cac85e31
commit 62b4c3aa1c
8 changed files with 34 additions and 33 deletions

View File

@ -183,8 +183,8 @@ EOF
# Mirror local software repositories
SYSIMAGE_MOUNT=/mnt/sysimage
FEED_DIR=${SYSIMAGE_MOUNT}/www/pages/feed/rel-xxxPLATFORM_RELEASExxx
UPDATES_DIR=${SYSIMAGE_MOUNT}/www/pages/updates/rel-xxxPLATFORM_RELEASExxx
FEED_DIR=${SYSIMAGE_MOUNT}/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx
UPDATES_DIR=${SYSIMAGE_MOUNT}/var/www/pages/updates/rel-xxxPLATFORM_RELEASExxx
PATCHING_DIR=${SYSIMAGE_MOUNT}/opt/patching
PACKAGES_DIR=${PATCHING_DIR}/packages/xxxPLATFORM_RELEASExxx/
@ -313,7 +313,7 @@ KS="Miniboot post:"
# Create a uuid specific to this installation
INSTALL_UUID=`uuidgen`
echo $INSTALL_UUID > /www/pages/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid
echo $INSTALL_UUID > /var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid
echo "INSTALL_UUID=$INSTALL_UUID" >> /etc/platform/platform.conf
wlog "${KS} updating platform.conf with install uuid : ${INSTALL_UUID}"
@ -335,7 +335,7 @@ fi
# - Packages
# - Repodata
#
FEED_DIR=/www/pages/feed/rel-xxxPLATFORM_RELEASExxx
FEED_DIR=/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx
declare -i cut_dirs=NUM_DIRS
if [ ! -d "${FEED_DIR}/Packages" ]; then
mkdir -p "${FEED_DIR}/Packages"
@ -373,7 +373,7 @@ patches_url=xxxHTTP_URLxxx/patches
wget ${NOVERIFYSSL_WGET_OPT} -q --spider ${patches_url}/
if [ $? -eq 0 ]; then
wlog "${KS} downloading patch repository $patches_url"
cd /www/pages
cd /var/www/pages
mkdir -p updates/rel-xxxPLATFORM_RELEASExxx/Packages
mkdir -p updates/rel-xxxPLATFORM_RELEASExxx/repodata
cd updates/rel-xxxPLATFORM_RELEASExxx
@ -399,7 +399,7 @@ if [ $? -eq 0 ]; then
|| report_post_failure_with_logfile $anaconda_logdir/patches_rpmget_metadata.log
wlog "${KS} save a copy of all patch packages, preserve attributes"
find /www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages -name '*.rpm' \
find /var/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages -name '*.rpm' \
| xargs --no-run-if-empty -I files cp --preserve=all files /opt/patching/packages/xxxPLATFORM_RELEASExxx/
else
wlog "${KS} get from patches url '$patches_url' failed"

View File

@ -16,7 +16,7 @@ if [ $? -ne 0 ]; then
echo "INSTALL_UUID=$INSTALL_UUID" >> /etc/platform/platform.conf
fi
cd /www/pages
cd /var/www/pages
# Sync software repository
feed_url=http://pxecontroller:${http_port:-8080}/feed/
anaconda_logdir=/var/log/anaconda
@ -38,7 +38,7 @@ shopt -s nullglob
. /etc/build.info
CURRENT_REL_DIR=rel-${SW_VERSION}
OTHER_REL_DIR=
for REL_DIR in /www/pages/feed/*; do
for REL_DIR in /var/www/pages/feed/*; do
if [[ ! $REL_DIR =~ "${SW_VERSION}" ]]; then
OTHER_REL_DIR=`basename $REL_DIR`
OTHER_REL_VERSION=${OTHER_REL_DIR:4}
@ -49,8 +49,8 @@ done
# If second release is installed, find the latest version of the installer
# RPM and install the pxeboot files we require to boot hosts with that release.
if [ ! -z "$OTHER_REL_DIR" ]; then
PATCH_RPM=`find /www/pages/updates/${OTHER_REL_DIR}/Packages -name 'pxe-network-installer*' | sort -V | tail -1`
BASE_RPM=`find /www/pages/feed/${OTHER_REL_DIR}/Packages -name 'pxe-network-installer*' | sort -V | tail -1`
PATCH_RPM=`find /var/www/pages/updates/${OTHER_REL_DIR}/Packages -name 'pxe-network-installer*' | sort -V | tail -1`
BASE_RPM=`find /var/www/pages/feed/${OTHER_REL_DIR}/Packages -name 'pxe-network-installer*' | sort -V | tail -1`
if [ ! -z "$PATCH_RPM" ]; then
INSTALL_RPM=$PATCH_RPM

View File

@ -82,7 +82,7 @@ else
NOVERIFYSSL_WGET_OPT=""
fi
cd /www/pages
cd /var/www/pages
mkdir -p feed/rel-xxxPLATFORM_RELEASExxx/Packages
mkdir -p feed/rel-xxxPLATFORM_RELEASExxx/repodata
cd feed/rel-xxxPLATFORM_RELEASExxx
@ -101,7 +101,7 @@ patches_url=xxxHTTP_URLxxx/patches
wget ${NOVERIFYSSL_WGET_OPT} -q --spider ${patches_url}/
if [ $? -eq 0 ]; then
echo "Downloading patches..." >/dev/console
cd /www/pages
cd /var/www/pages
mkdir -p updates/rel-xxxPLATFORM_RELEASExxx/Packages
mkdir -p updates/rel-xxxPLATFORM_RELEASExxx/repodata
cd updates/rel-xxxPLATFORM_RELEASExxx
@ -120,7 +120,7 @@ if [ $? -eq 0 ]; then
wget ${NOVERIFYSSL_WGET_OPT} --mirror --no-parent --no-host-directories --reject 'index.html*' \
--cut-dirs=$patches_cut_dirs $patches_url/metadata/ -o $anaconda_logdir/patches_rpmget_metadata.log \
|| report_post_failure_with_logfile $anaconda_logdir/patches_rpmget_metadata.log
find /www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages -name '*.rpm' \
find /var/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages -name '*.rpm' \
| xargs --no-run-if-empty -I files cp --preserve=all files /opt/patching/packages/xxxPLATFORM_RELEASExxx/
echo "Done" >/dev/console
@ -128,6 +128,6 @@ fi
# Create a uuid specific to this installation
INSTALL_UUID=`uuidgen`
echo $INSTALL_UUID > /www/pages/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid
echo $INSTALL_UUID > /var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid
echo "INSTALL_UUID=$INSTALL_UUID" >> /etc/platform/platform.conf
%end

View File

@ -60,26 +60,26 @@ else
fi
if [ -d $srcdir/Packages ] ; then
mkdir -p /mnt/sysimage/www/pages/feed/rel-xxxPLATFORM_RELEASExxx
cp -r $srcdir/Packages /mnt/sysimage/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/Packages
cp -r $srcdir/repodata /mnt/sysimage/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/repodata
mkdir -p /mnt/sysimage/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx
cp -r $srcdir/Packages /mnt/sysimage/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/Packages
cp -r $srcdir/repodata /mnt/sysimage/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/repodata
fi
if [ -d $srcdir/patches ]; then
mkdir -p /mnt/sysimage/www/pages/updates/rel-xxxPLATFORM_RELEASExxx
cp -r $srcdir/patches/Packages /mnt/sysimage/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages
cp -r $srcdir/patches/repodata /mnt/sysimage/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/repodata
mkdir -p /mnt/sysimage/var/www/pages/updates/rel-xxxPLATFORM_RELEASExxx
cp -r $srcdir/patches/Packages /mnt/sysimage/var/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages
cp -r $srcdir/patches/repodata /mnt/sysimage/var/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/repodata
mkdir -p /mnt/sysimage/opt/patching
cp -r $srcdir/patches/metadata /mnt/sysimage/opt/patching/metadata
mkdir -p /mnt/sysimage/opt/patching/packages/xxxPLATFORM_RELEASExxx
find /mnt/sysimage/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages -name '*.rpm' \
find /mnt/sysimage/var/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages -name '*.rpm' \
| xargs --no-run-if-empty -I files cp --preserve=all files /mnt/sysimage/opt/patching/packages/xxxPLATFORM_RELEASExxx/
fi
# Create a uuid specific to this installation
INSTALL_UUID=`uuidgen`
echo $INSTALL_UUID > /mnt/sysimage/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid
echo $INSTALL_UUID > /mnt/sysimage/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid
echo "INSTALL_UUID=$INSTALL_UUID" >> /mnt/sysimage/etc/platform/platform.conf
%end

View File

@ -75,7 +75,7 @@ EOF
anaconda_logdir=/var/log/anaconda
mkdir -p $anaconda_logdir
cd /www/pages
cd /var/www/pages
mkdir -p feed/rel-xxxPLATFORM_RELEASExxx/Packages
mkdir -p feed/rel-xxxPLATFORM_RELEASExxx/repodata
cd feed/rel-xxxPLATFORM_RELEASExxx
@ -91,7 +91,7 @@ wget --mirror --no-parent --no-host-directories --reject 'index.html*' --cut-dir
patches_url=http://xxxBOOT_SERVERxxx/umalab/`hostname`_feed/patches
wget -q --spider ${patches_url}/
if [ $? -eq 0 ]; then
cd /www/pages
cd /var/www/pages
mkdir -p updates/rel-xxxPLATFORM_RELEASExxx/Packages
mkdir -p updates/rel-xxxPLATFORM_RELEASExxx/repodata
cd updates/rel-xxxPLATFORM_RELEASExxx
@ -106,7 +106,8 @@ if [ $? -eq 0 ]; then
cd /opt/patching
wget --mirror --no-parent --no-host-directories --reject 'index.html*' --cut-dirs=$patches_cut_dirs $patches_url/metadata/ -o $anaconda_logdir/patches_rpmget_metadata.log \
|| report_post_failure_with_logfile $anaconda_logdir/patches_rpmget_metadata.log
find /www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages -name '*.rpm' \
find /var/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages -name '*.rpm' \
| xargs --no-run-if-empty -I files cp --preserve=all files /opt/patching/packages/xxxPLATFORM_RELEASExxx/
echo "Done" >/dev/console
@ -114,6 +115,6 @@ fi
# Create a uuid specific to this installation
INSTALL_UUID=`uuidgen`
echo $INSTALL_UUID > /www/pages/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid
echo $INSTALL_UUID > /var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid
echo "INSTALL_UUID=$INSTALL_UUID" >> /etc/platform/platform.conf
%end

View File

@ -64,7 +64,7 @@ ln -s installer-bzImage_1.0 %{buildroot}/pxeboot/rel-%{platform_release}/install
ln -s installer-intel-x86-64-initrd_1.0 %{buildroot}/pxeboot/rel-%{platform_release}/installer-initrd
install -v -D -m 644 %{_sourcedir}/squashfs.img \
%{buildroot}/www/pages/feed/rel-%{platform_release}/LiveOS/squashfs.img
%{buildroot}/var/www/pages/feed/rel-%{platform_release}/LiveOS/squashfs.img
install -v -d -m 755 %{buildroot}%{_sbindir}
@ -140,5 +140,5 @@ ln -s pxelinux.cfg/grub.cfg %{buildroot}/pxeboot/grub.cfg
%dir /pxeboot
/pxeboot/*
%{_sbindir}/pxeboot-update-%{platform_release}.sh
/www/pages/feed/rel-%{platform_release}/LiveOS/squashfs.img
/var/www/pages/feed/rel-%{platform_release}/LiveOS/squashfs.img

View File

@ -18,7 +18,7 @@ BuildRequires: perl
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(POSIX)
%define feed_dir /www/pages/feed/rel-%{platform_release}
%define feed_dir /var/www/pages/feed/rel-%{platform_release}
%prep
%setup

View File

@ -1,5 +1,5 @@
%define platform_release 1
%define feed_dir /www/pages/feed/rel-%{platform_release}
%define feed_dir /var/www/pages/feed/rel-%{platform_release}
Summary: Platform Kickstarts
Name: platform-kickstarts
@ -44,9 +44,9 @@ install -D -m 0444 extra_cfgs/* %{buildroot}/extra_cfgs
%files
%defattr(-,root,root,-)
/www
/www/pages
/www/pages/feed
/var/www
/var/www/pages
/var/www/pages/feed
%package pxeboot
Summary: Kickstarts Pxeboot Server