Fix Rawhide builds

Ignore writing to the device if it is a zram

Fixes #28
This commit is contained in:
Greg Hellings
2024-11-18 21:14:18 -06:00
parent 37f8e7c063
commit 18b7cddaaa
+2 -2
View File
@@ -21,10 +21,10 @@ elif [ -n "$swap_device_label" ]; then
swap_device=$(readlink -f /dev/disk/by-label/"$swap_device_label") swap_device=$(readlink -f /dev/disk/by-label/"$swap_device_label")
fi fi
if [ -n "${swap_device}" ] && [ -e "${swap_device}" ]; then if [ -n "${swap_device}" ] && [ -e "${swap_device}" ] && [ "${swap_device}" != "/dev/zram"* ]; then
sudo /sbin/swapoff "$swap_device" sudo /sbin/swapoff "$swap_device"
sudo dd if=/dev/zero of="$swap_device" bs=1M || : sudo dd if=/dev/zero of="$swap_device" bs=1M || :
sudo /sbin/mkswap ${swap_device_label:+-L "$swap_device_label"} ${swap_device_uuid:+-U "$swap_device_uuid"} "$swap_device" sudo /sbin/mkswap ${swap_device_label:+-L "$swap_device_label"} ${swap_device_uuid:+-U "$swap_device_uuid"} "$swap_device"
fi fi
sleep 15 # Hyper-v seems to be super fast during boot sleep 15 # Hyper-v seems to be super fast during boot