Skip to content

Commit 66a626c

Browse files
Pierguido LambriEvilOlaf
authored andcommitted
Remove swapfile creation.
With the old armbian-install and smaller emmc storage, the swapfile was too big to fit onto the root file system. This would cause the installation onto the emmc to fail. Removed the entire swapfile creation as it's not needed anymore (zram is used for swap). Signed-off-by: Pierguido Lambri <plambri@runbox.eu>
1 parent e1f2e37 commit 66a626c

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

packages/bsp/common/usr/bin/armbian-install

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -490,16 +490,6 @@ create_armbian()
490490

491491
if [[ $2 == ${DISK_ROOT_PART} && -z $1 && $DEVICE_TYPE = uefi ]]; then
492492

493-
# create swap file size of your memory so we can use it for S4
494-
MEM_TOTAL=$(cat /proc/meminfo | awk '/MemTotal/ {print $2}')
495-
496-
# but no more then 16Gb
497-
[[ ${MEM_TOTAL} -gt 16107868 ]] && MEM_TOTAL=16107868
498-
dd if=/dev/zero of="${TempDir}"/rootfs/swapfile bs=${MEM_TOTAL} count=1024 conv=notrunc >> $logfile
499-
500-
mkswap "${TempDir}"/rootfs/swapfile >> $logfile
501-
chmod 0600 "${TempDir}"/rootfs/swapfile
502-
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"$/ resume=UUID=$(findmnt -no UUID -T "${TempDir}"/rootfs/swapfile) resume_offset=$(filefrag -v "${TempDir}"/rootfs/swapfile |grep " 0:"| awk '{print $4}' | cut -d"." -f1)\"/" "${TempDir}"/rootfs/etc/default/grub.d/98-armbian.cfg
503493

504494
echo "GRUB_DISABLE_OS_PROBER=false" >> "${TempDir}"/rootfs/etc/default/grub.d/98-armbian.cfg
505495

@@ -517,7 +507,6 @@ create_armbian()
517507
exit 20
518508
fi
519509
echo "UUID=$target_efi_uuid /boot/efi vfat defaults 0 2" >> "${TempDir}"/rootfs/etc/fstab
520-
echo "/swapfile none swap sw 0 0" >> "${TempDir}"/rootfs/etc/fstab
521510

522511
cat <<-hibernatemenu >"${TempDir}"/rootfs/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
523512
[Re-enable hibernate by default in upower]

0 commit comments

Comments
 (0)