From d4076fa2a8712c551db31967ca25d34c132418de Mon Sep 17 00:00:00 2001 From: pedro Date: Wed, 25 Sep 2024 20:16:03 -0300 Subject: [PATCH] pxe: do the trick for rw snapshots dir --- deploy-workbench.sh | 4 ++++ pxe/install-pxe.sh | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/deploy-workbench.sh b/deploy-workbench.sh index 7111840..3313e9e 100755 --- a/deploy-workbench.sh +++ b/deploy-workbench.sh @@ -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 diff --git a/pxe/install-pxe.sh b/pxe/install-pxe.sh index ed94e07..96ac03d 100755 --- a/pxe/install-pxe.sh +++ b/pxe/install-pxe.sh @@ -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 <