]> git.ipfire.org Git - thirdparty/dracut.git/blobdiff - modules.d/90dmsquash-live/dmsquash-live-root.sh
feat(livenet): add memory size check depending on live image size
[thirdparty/dracut.git] / modules.d / 90dmsquash-live / dmsquash-live-root.sh
index e9434c9343791b944b4ca92ed2b402e69d4b72ad..81c6ed8e73170148741a2d66496cf738bebfb784 100755 (executable)
@@ -315,6 +315,8 @@ if [ -e /run/initramfs/live/${live_dir}/${squash_image} ]; then
 fi
 if [ -e "$SQUASHED" ]; then
     if [ -n "$live_ram" ]; then
+        imgsize=$(($(stat -c %s -- $SQUASHED) / (1024 * 1024)))
+        check_live_ram $imgsize
         echo 'Copying live image to RAM...' > /dev/kmsg
         echo ' (this may take a minute)' > /dev/kmsg
         dd if=$SQUASHED of=/run/initramfs/squashed.img bs=512 2> /dev/null