mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-23 11:21:12 +00:00
Remove the mkswap and swapfile units
These will be provided by the ubuntu-raspi-settings-desktop in future
This commit is contained in:
parent
6d1b422a3f
commit
a312ab11a7
@ -51,35 +51,5 @@ if [ "$IMAGEFORMAT" == "none" ]; then
|
||||
}
|
||||
' /etc/fstab > /etc/fstab.new
|
||||
mv /etc/fstab.new /etc/fstab
|
||||
|
||||
# Add units for a 1GiB swapfile, generated on first boot
|
||||
cat << EOF > /lib/systemd/system/mkswap.service
|
||||
[Unit]
|
||||
Description=Create the default swapfile
|
||||
DefaultDependencies=no
|
||||
Requires=local-fs.target
|
||||
After=local-fs.target
|
||||
Before=swapfile.swap
|
||||
ConditionPathExists=!/swapfile
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStartPre=fallocate -l 1GiB /swapfile
|
||||
ExecStartPre=chmod 600 /swapfile
|
||||
ExecStart=mkswap /swapfile
|
||||
|
||||
[Install]
|
||||
WantedBy=swap.target
|
||||
EOF
|
||||
cat << EOF > /lib/systemd/system/swapfile.swap
|
||||
[Unit]
|
||||
Description=The default swapfile
|
||||
|
||||
[Swap]
|
||||
What=/swapfile
|
||||
EOF
|
||||
mkdir -p /lib/systemd/system/swap.target.wants
|
||||
ln -s ../mkswap.service /lib/systemd/system/swap.target.wants/
|
||||
ln -s ../swapfile.swap /lib/systemd/system/swap.target.wants/
|
||||
fi
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user