mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
tests: check for loopback module on pivot_root test
mount -o loop fails when the loopback module is not loaded with permission denied. Add a check if /dev/loop0 exists. If not, load the loop module. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/781 Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com> Acked-by: Christian Boltz <apparmor@cboltz.de>
This commit is contained in:
parent
3f46d96aca
commit
656a48b900
1 changed files with 5 additions and 0 deletions
|
@ -45,6 +45,11 @@ pivot_root_cleanup() {
|
|||
}
|
||||
do_onexit="pivot_root_cleanup"
|
||||
|
||||
# loopback module must be loaded for mount -o loop to work
|
||||
if [ ! -b /dev/loop0 ] ; then
|
||||
modprobe loop
|
||||
fi
|
||||
|
||||
# systemd mounts / and everything under it MS_SHARED. This breaks
|
||||
# pivot_root entirely, so attempt to detect it, and remount /
|
||||
# MS_PRIVATE temporarily.
|
||||
|
|
Loading…
Add table
Reference in a new issue