From 1a8d6d203efee8b03d358ef95189717e7e116dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 14 Oct 2020 15:09:34 +0200 Subject: [PATCH] Add creation of a 1GB swapfile for desktop pi images. --- .../ubuntu/hooks/099-ubuntu-image-customization.chroot | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot b/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot index 1363d677..65e06cd9 100644 --- a/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot +++ b/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot @@ -19,5 +19,12 @@ if [ "$IMAGEFORMAT" == "none" ]; then # Make the writable partition grow echo "LABEL=writable / ext4 defaults,x-systemd.growfs 0 0" >>/etc/fstab + + # Create a 1GB swapfile + dd if=/dev/zero of=/swapfile bs=1M count=1024 + chmod 0600 /swapfile + mkswap /swapfile + + echo "/swapfile none swap sw 0 0" >>/etc/fstab fi fi