feature: workbench pxe #2

Merged
pedro merged 83 commits from pxe into main 2024-09-28 02:19:31 +00:00
2 changed files with 15 additions and 0 deletions
Showing only changes of commit 8e4186d9d4 - Show all commits

View File

@ -272,6 +272,10 @@ cd /mnt
# detect pxe env # detect pxe env
if [ -d /run/live/medium ]; then if [ -d /run/live/medium ]; then
config_path='/run/live/medium/settings.ini' config_path='/run/live/medium/settings.ini'
# debian live nfs path is readonly, do a trick
# to make snapshots subdir readwrite
nfs_host="\$(df -hT | grep nfs | cut -f1 -d: | head -n1)"
mount \${nfs_host}:/snapshots /run/live/medium/snapshots
else else
config_path='/mnt/settings.ini' config_path='/mnt/settings.ini'
fi fi

View File

@ -23,9 +23,20 @@ backup_file() {
install_nfs() { install_nfs() {
backup_file /etc/exports backup_file /etc/exports
# debian live nfs path is readonly, do a trick
# to make snapshots subdir readwrite
if grep -q "/snapshots" /proc/mounts; then
mount --bind "${nfs_path}/snapshots" "/snapshots"
fi
cat > /etc/exports <<END cat > /etc/exports <<END
${nfs_path} ${nfs_allowed_lan}(rw,sync,no_subtree_check,no_root_squash) ${nfs_path} ${nfs_allowed_lan}(rw,sync,no_subtree_check,no_root_squash)
/snapshots ${nfs_allowed_lan}(rw,sync,no_subtree_check,no_root_squash)
END END
# reload nfs exports
exportfs -vra
# append live directory, which is expected by the debian live env # append live directory, which is expected by the debian live env
mkdir -p "${nfs_path}/live" mkdir -p "${nfs_path}/live"
mkdir -p "${nfs_path}/snapshots" mkdir -p "${nfs_path}/snapshots"