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 ecb9b1649b - Show all commits

View file

@ -272,6 +272,10 @@ cd /mnt
# detect pxe env
if [ -d /run/live/medium ]; then
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
config_path='/mnt/settings.ini'
fi

View file

@ -23,9 +23,20 @@ backup_file() {
install_nfs() {
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
${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
# reload nfs exports
exportfs -vra
# append live directory, which is expected by the debian live env
mkdir -p "${nfs_path}/live"
mkdir -p "${nfs_path}/snapshots"