feature: workbench pxe #2
|
@ -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
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue