Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/github/pr/17'
Browse files Browse the repository at this point in the history
  • Loading branch information
mika committed Feb 2, 2023
2 parents 0ac4551 + 099f921 commit 2d82a9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion usr_sbin/grml2ram
Expand Up @@ -65,6 +65,7 @@ fi

GRMLSIZE="$(du $IMAGE | awk '{print $1}')"
RAM=$(/usr/bin/gawk '/MemFree/{print $2}' /proc/meminfo)
LOOPDEV=$(/sbin/losetup -j "${IMAGE}" -n -O NAME)

case "$*" in -f|--force)
ewarn "Forcing copy process for grml-image (${GRMLSIZE}kB) as requested via force option." ; eend 0
Expand All @@ -80,7 +81,7 @@ esac
einfo "Copying $IMAGE to RAM, this might take a while."
rsync -a --progress $IMAGE /tmp/GRML
LANGUAGE=C LANG=C LC_ALL=C perl << EOF
open LOOP, '</dev/loop0' or die $!;
open LOOP, '<${LOOPDEV}' or die $!;
open DEST, '</tmp/GRML' or die $!;
ioctl(LOOP, 0x4C06, fileno(DEST)) or die $!;
close LOOP;
Expand Down

0 comments on commit 2d82a9d

Please sign in to comment.