Report++
[tails-test.git] / config / chroot_local-hooks / 05-disable_swapon
blob16af130d71373132a8a4e4bf6e949f598bba4096
1 #!/bin/sh
3 set -e
5 echo "Disabling swapon"
7 # Disable swapon to avoid initscripts to setup swap space.
8 # Rationale: security-in-depth model.
10 SWAPON=/sbin/swapon
12 # Move any /sbin/swapon installed by any package out of the way,
13 # now (--rename) as well for any future one (hint: apt-get upgrade...).
14 dpkg-divert --rename --add /sbin/swapon
16 # Install a custom noop swapon executable instead.
17 cat > $SWAPON << 'EOF'
18 #!/bin/sh
19 /bin/true
20 EOF
21 chmod 755 $SWAPON