relocate /pxeboot to /var/pxeboot
Relocate writable /pxeboot dir to /var/pxeboot Story: 2009101 Task: 44200 TCs will be list https://review.opendev.org/c/starlingx/metal/+/822008. Depends-on: https://review.opendev.org/c/starlingx/metal/+/822008 Change-Id: I5906a7b294470b5fe57cfd863e38738f65db2148 Signed-off-by: Bin Qian <bin.qian@windriver.com>
This commit is contained in:
parent
b81c8b799e
commit
bda5616bd6
|
@ -238,7 +238,7 @@ def persist_config():
|
|||
|
||||
try:
|
||||
subprocess.check_call(["ln", "-s", constants.CONFIG_PERMDIR +
|
||||
"/pxelinux.cfg", "/pxeboot/pxelinux.cfg"])
|
||||
"/pxelinux.cfg", "/var/pxeboot/pxelinux.cfg"])
|
||||
except subprocess.CalledProcessError:
|
||||
LOG.error("Failed to create pxelinux.cfg symlink")
|
||||
raise Exception("Failed to persist config files")
|
||||
|
|
|
@ -469,9 +469,9 @@ start()
|
|||
|
||||
# Our PXE config files are located in the config directory. Create a
|
||||
# symbolic link if it is not already created.
|
||||
if [ ! -L /pxeboot/pxelinux.cfg ]
|
||||
if [ ! -L /var/pxeboot/pxelinux.cfg ]
|
||||
then
|
||||
ln -sf $CONFIG_DIR/pxelinux.cfg /pxeboot/pxelinux.cfg
|
||||
ln -sf $CONFIG_DIR/pxelinux.cfg /var/pxeboot/pxelinux.cfg
|
||||
fi
|
||||
|
||||
# Upgrade related checks
|
||||
|
|
|
@ -12,8 +12,8 @@ VERSION=$1
|
|||
|
||||
FEED_DIR=/var/www/pages/feed/rel-$VERSION
|
||||
|
||||
rm -f /pxeboot/pxelinux.cfg.files/*-$VERSION
|
||||
rm -rf /pxeboot/rel-$VERSION
|
||||
rm -f /var/pxeboot/pxelinux.cfg.files/*-$VERSION
|
||||
rm -rf /var/pxeboot/rel-$VERSION
|
||||
|
||||
rm -f /usr/sbin/pxeboot-update-$VERSION.sh
|
||||
|
||||
|
|
|
@ -1185,19 +1185,19 @@ class ConductorManager(service.PeriodicService):
|
|||
|
||||
# Remove an old file if it exists
|
||||
try:
|
||||
os.remove("/pxeboot/pxelinux.cfg/01-" + dashed_mac)
|
||||
os.remove("/var/pxeboot/pxelinux.cfg/01-" + dashed_mac)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
try:
|
||||
os.remove("/pxeboot/pxelinux.cfg/efi-01-" + dashed_mac)
|
||||
os.remove("/var/pxeboot/pxelinux.cfg/efi-01-" + dashed_mac)
|
||||
except OSError:
|
||||
pass
|
||||
with open(os.devnull, "w") as fnull:
|
||||
try:
|
||||
subprocess.check_call( # pylint: disable=not-callable
|
||||
[pxeboot_update, "-i", "/pxeboot/pxelinux.cfg.files/" +
|
||||
pxe_config, "-o", "/pxeboot/pxelinux.cfg/01-" +
|
||||
[pxeboot_update, "-i", "/var/pxeboot/pxelinux.cfg.files/" +
|
||||
pxe_config, "-o", "/var/pxeboot/pxelinux.cfg/01-" +
|
||||
dashed_mac] + install_opts,
|
||||
stdout=fnull,
|
||||
stderr=fnull)
|
||||
|
@ -1237,12 +1237,12 @@ class ConductorManager(service.PeriodicService):
|
|||
|
||||
# Remove the old file if it exists
|
||||
try:
|
||||
os.remove("/pxeboot/pxelinux.cfg/01-" + dashed_mac)
|
||||
os.remove("/var/pxeboot/pxelinux.cfg/01-" + dashed_mac)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
try:
|
||||
os.remove("/pxeboot/pxelinux.cfg/efi-01-" + dashed_mac)
|
||||
os.remove("/var/pxeboot/pxelinux.cfg/efi-01-" + dashed_mac)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Reference in New Issue