Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(overlayfs): allow hostonly and nfs support #2269

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions modules.d/90overlayfs/module-setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

check() {
[[ $hostonly ]] && return 1
require_kernel_modules overlay || return 1
return 255
}

Expand All @@ -10,10 +10,11 @@ depends() {
}

installkernel() {
instmods overlay
hostonly="" instmods overlay
}

install() {
inst_hook mount 01 "$moddir/mount-overlayfs.sh"
inst_hook pre-mount 01 "$moddir/prepare-overlayfs.sh"
inst_hook mount 01 "$moddir/mount-overlayfs.sh" # overlay on top of block device
inst_hook pre-pivot 10 "$moddir/mount-overlayfs.sh" # overlay on top of network device (e.g. nfs)
}
7 changes: 7 additions & 0 deletions test/TEST-20-NFS/client-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ while read -r dev _ fstype opts rest || [ -n "$dev" ]; do
break
done < /proc/mounts

# fail the test of rd.live.overlay did not worked as expected
if grep -qF 'rd.live.overlay' /proc/cmdline; then
if ! strstr "$(cat /proc/mounts)" LiveOS_rootfs; then
echo "nfs-FAIL" | dd oflag=direct,dsync of=/dev/disk/by-id/ata-disk_marker
fi
fi

if [ "$fstype" = "nfs" -o "$fstype" = "nfs4" ]; then

serverip=${dev%:*}
Expand Down
Loading