Skip to content

Commit

Permalink
Make options -M and -2 work
Browse files Browse the repository at this point in the history
  • Loading branch information
vaeth committed Mar 10, 2021
1 parent 747adf9 commit 99677b2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Pablo Cholaky <waltercool at slash.cl>
Guillaume Delvit (https://github.com/guiguid) (Arch documentation)
Sven Eden <sven.eden at gmx.de>
Florian Gamböck <mail at floga.de>:
GimmeHardware (https://github.com/GimmeHardware)
Karol Herbst <git at karolherbst.de>
ko-zu
Thomas Kear
Expand Down
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# ChangeLog for zram-init:

*zram-init-10.12:
Martin Väth <martin at mvath.de>:
- Make the options -M and -2 work. Thanks to GimmeHardware for the
report. See https://github.com/vaeth/zram-init/issues/34

*zram-init-10.11:
Kriss:
- Fix typo introduced in 10.10

*zram-init-10.10:
Martin Väth <martin at mvath.de>:
- Let mlim (-S) actually be in megabytes as documented (not in bytes).
Expand Down
12 changes: 6 additions & 6 deletions sbin/zram-init.in
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,11 @@ ext2)
|| xFatal 'mkfs.ext2 ${devnode} failed'
eval "set -- a $tune2fs_opt"
shift
tune2fs -c0 -i0 -m0 -- "$devnode" >/dev/null
tune2fs -c0 -i0 -m0 ${1+"$@"} -- "$devnode" >/dev/null
$mount || exit 0
eval "set -- a $mount_opt"
shift
mount -t ext2 ${opts:+-o "$opts"} -- "$devnode" "$dir" \
mount -t ext2 ${opts:+-o "$opts"} ${1+"$@"} -- "$devnode" "$dir" \
|| xFatal 'mount ${devnode} failed';;
ext4)
fsopts=$fsopts',extent,^uninit_bg,dir_nlink,extra_isize,^has_journal'
Expand All @@ -427,12 +427,12 @@ ext4)
|| xFatal 'mkfs.ext4 ${devnode} failed'
eval "set -- a $tune2fs_opt"
shift
tune2fs -c0 -i0 -m0 -- "$devnode" >/dev/null
tune2fs -c0 -i0 -m0 ${1+"$@"} -- "$devnode" >/dev/null
$mount || exit 0
! $discard || opts=$opts${opts:+,}'discard'
eval "set -- a $mount_opt"
shift
mount -t ext4 ${opts:+-o "$opts"} -- "$devnode" "$dir" \
mount -t ext4 ${opts:+-o "$opts"} ${1+"$@"} -- "$devnode" "$dir" \
|| xFatal 'mount ${devnode} failed';;
btrfs)
mkfs.btrfs -d single -m single \
Expand All @@ -442,7 +442,7 @@ btrfs)
$mount || exit 0
eval "set -- a $mount_opt"
shift
mount -t btrfs ${opts:+-o "$opts"} -- "$devnode" "$dir" \
mount -t btrfs ${opts:+-o "$opts"} ${1+"$@"} -- "$devnode" "$dir" \
|| xFatal 'mount ${devnode} failed';;
xfs)
mkfs.xfs ${label:+-L "$label"} ${uuid:+-m uuid="$uuid"} \
Expand All @@ -451,7 +451,7 @@ xfs)
$mount || exit 0
eval "set -- a $mount_opt"
shift
mount -t xfs ${opts:+-o "$opts"} -- "$devnode" "$dir" \
mount -t xfs ${opts:+-o "$opts"} ${1+"$@"} -- "$devnode" "$dir" \
|| xFatal 'mount ${devnode} failed';;
*)
xFatal 'unsupported filesystem ${fstype}';;
Expand Down

0 comments on commit 99677b2

Please sign in to comment.