[archiso] Rename cowfile_size to cow_spacesize=

The name is more relevant since the usage is shared for both
dm-snapshot and overlayfs.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
This commit is contained in:
Gerardo Exequiel Pozzi 2015-01-27 14:37:05 -03:00
parent a637bdb857
commit 9322a0d3b7
2 changed files with 13 additions and 11 deletions

View File

@ -17,7 +17,7 @@ _mnt_dmsnapshot() {
msg ":: Found '/run/archiso/cowspace/${cow_directory}/${img_name}.cow', using as persistent." msg ":: Found '/run/archiso/cowspace/${cow_directory}/${img_name}.cow', using as persistent."
else else
msg ":: Creating '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' as persistent." msg ":: Creating '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' as persistent."
truncate -s "${cowfile_size}" "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" truncate -s "${cow_spacesize}" "/run/archiso/cowspace/${cow_directory}/${img_name}.cow"
fi fi
else else
if [[ -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" ]]; then if [[ -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" ]]; then
@ -25,7 +25,7 @@ _mnt_dmsnapshot() {
rm -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" rm -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow"
fi fi
msg ":: Creating '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' as non-persistent." msg ":: Creating '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' as non-persistent."
truncate -s "${cowfile_size}" "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" truncate -s "${cow_spacesize}" "/run/archiso/cowspace/${cow_directory}/${img_name}.cow"
fi fi
rw_dev=$(losetup --find --show "/run/archiso/cowspace/${cow_directory}/${img_name}.cow") rw_dev=$(losetup --find --show "/run/archiso/cowspace/${cow_directory}/${img_name}.cow")
@ -110,7 +110,7 @@ run_hook() {
[[ -z "${archisobasedir}" ]] && archisobasedir="arch" [[ -z "${archisobasedir}" ]] && archisobasedir="arch"
[[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch" [[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch"
[[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}" [[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}"
[[ -z "${cowfile_size}" ]] && cowfile_size="256M" [[ -z "${cow_spacesize}" ]] && cow_spacesize="256M"
if [[ -n "${cow_label}" ]]; then if [[ -n "${cow_label}" ]]; then
cow_device="/dev/disk/by-label/${cow_label}" cow_device="/dev/disk/by-label/${cow_label}"
@ -168,9 +168,9 @@ archiso_mount_handler() {
echo $(readlink -f ${cow_device}) >> /run/archiso/used_block_devices echo $(readlink -f ${cow_device}) >> /run/archiso/used_block_devices
mount -o remount,rw "/run/archiso/cowspace" mount -o remount,rw "/run/archiso/cowspace"
else else
msg ":: Mounting /run/archiso/cowspace (tmpfs) filesystem, size=${cowfile_size}..." msg ":: Mounting /run/archiso/cowspace (tmpfs) filesystem, size=${cow_spacesize}..."
mkdir -p /run/archiso/cowspace mkdir -p /run/archiso/cowspace
mount -t tmpfs -o "size=${cowfile_size}",mode=0755 cowspace /run/archiso/cowspace mount -t tmpfs -o "size=${cow_spacesize}",mode=0755 cowspace /run/archiso/cowspace
fi fi
mkdir -p "/run/archiso/cowspace/${cow_directory}" mkdir -p "/run/archiso/cowspace/${cow_directory}"

View File

@ -30,17 +30,18 @@ INDEX
performs a self-test of all files inside ${install_dir}, performs a self-test of all files inside ${install_dir},
and continue booting if ok. and continue booting if ok.
Default: (unset) Default: (unset)
* cow_label= Set the filesystem label where COW (dm-snapshot) * cow_label= Set the filesystem label where COW file (for dm-snapshot)
file must be stored. or upperdir/workdir files (for overlayfs) must be stored.
Default: (unset) Default: (unset)
* cow_device= Set the device node where COW (dm-snapshot) file * cow_device= Like cow_label= but using device node.
must be stored.
Default: (unset) or "/dev/disk/by-label/${cow_label}" Default: (unset) or "/dev/disk/by-label/${cow_label}"
* cow_directory= Set a directory inside ${cow_device}. * cow_directory= Set a directory inside ${cow_device}.
Default: "/persistent_${archisolabel}/${arch}" Default: "/persistent_${archisolabel}/${arch}"
* cow_persistent= Set if snapshot is persistent "P" or non-persistent "N". * cow_persistent= Set if snapshot is persistent "P" or non-persistent "N".
Only used for dm-snapshot mode, ignored for overlayfs.
Default: "N" (if no ${cow_device} is used) otherwise "P". Default: "N" (if no ${cow_device} is used) otherwise "P".
* cowfile_size= Set the size for COW file (dm-snapshot). * cow_spacesize= Set the size for COW space (tmpfs). Valid for both
dm-snapshot and overlayfs mode.
The argument is an integer and optional unit. The argument is an integer and optional unit.
Units are M,G (powers of 1024). Units are M,G (powers of 1024).
Default: "256M" Default: "256M"
@ -52,7 +53,8 @@ INDEX
Size is in bytes (suffix with "k", "m" and "g") or Size is in bytes (suffix with "k", "m" and "g") or
in percentage of available RAM. in percentage of available RAM.
Default: "75%" Default: "75%"
* dm_snap_prefix= Set a prefix for device-mapper snapshot node names. * dm_snap_prefix= Set a prefix for dm-snapshot node names.
Only used for dm-snapshot mode, ignored for overlayfs.
Default: "arch" Default: "arch"
* arch= Force an architecture type (i686 | x86_64). * arch= Force an architecture type (i686 | x86_64).
Do not set it for normal operations. Do not set it for normal operations.