Skip to content

Commit

Permalink
feat: replace swapfile with zram
Browse files Browse the repository at this point in the history
  • Loading branch information
knoopx committed Jul 12, 2021
1 parent cbe4892 commit 765e363
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 0 additions & 5 deletions bootstrap/first-boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ resize2fs /dev/mmcblk0p2
rc-update del first-boot
rm /etc/init.d/first-boot /usr/bin/first-boot
fallocate -l 1g /swapfile
chmod 600 /swapfile
mkswap /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab
reboot
EOF

Expand Down
4 changes: 3 additions & 1 deletion bootstrap/kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -xe

apk add linux-rpi linux-rpi4 raspberrypi-bootloader zram-init

echo "modules=loop,squashfs,sd-mod,usb-storage root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes console=tty1 rootwait quiet" > /boot/cmdline.txt

cat <<EOF > /boot/config.txt
Expand Down Expand Up @@ -29,4 +31,4 @@ cat <<EOF > /etc/fstab
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
EOF

apk add linux-rpi linux-rpi4 raspberrypi-bootloader
rc-update add zram-init boot

0 comments on commit 765e363

Please sign in to comment.