OSDN Git Service

[update] : Added --cowspace
[alterlinux/alterlinux.git] / system / initcpio / hooks / archiso
index 7f2f9a7..e091b8e 100644 (file)
@@ -1,4 +1,6 @@
 #!/bin/ash
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
 
 # args: source, newroot, mountpoint
 _mnt_dmsnapshot() {
@@ -12,7 +14,7 @@ _mnt_dmsnapshot() {
 
     ro_dev="$(losetup --find --show --read-only -- "${img}")"
     echo "${ro_dev}" >> /run/archiso/used_block_devices
-    ro_dev_size="$(blockdev --getsz -- "${ro_dev}")"
+    ro_dev_size="$(blockdev --getsz "${ro_dev}")"
 
     if [ "${cow_persistent}" = "P" ]; then
         if [ -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" ]; then
@@ -133,7 +135,8 @@ run_hook() {
     # shellcheck disable=SC2154
     # defined via initcpio's parse_cmdline()
     [ -z "${archisodevice}" ] && archisodevice="/dev/disk/by-label/${archisolabel}"
-    [ -z "${cow_spacesize}" ] && cow_spacesize="256M"
+    #[ -z "${cow_spacesize}" ] && cow_spacesize="256M"
+    [ -z "${cow_spacesize}" ] && cow_spacesize="%COWSPACE%"
     # shellcheck disable=SC2154
     # defined via initcpio's parse_cmdline()
     if [ -n "${cow_label}" ]; then