[arch-releng] [PATCH 1/3] use consistent syntax for boot parameter processing
From: Christian Hesse <mail@eworm.de> Signed-off-by: Christian Hesse <mail@eworm.de> --- archiso/initcpio/hooks/archiso | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/archiso/initcpio/hooks/archiso b/archiso/initcpio/hooks/archiso index addd08a..1bd9419 100644 --- a/archiso/initcpio/hooks/archiso +++ b/archiso/initcpio/hooks/archiso @@ -100,9 +100,7 @@ run_hook() { [[ -z "${archisobasedir}" ]] && archisobasedir="arch" [[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch" [[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}" - if [[ -z "${cowfile_size}" ]]; then - cowfile_size="256M" - fi + [[ -z "${cowfile_size}" ]] && cowfile_size="256M" if [[ -n "${cow_label}" ]]; then cow_device="/dev/disk/by-label/${cow_label}" -- 2.2.1
From: Christian Hesse <mail@eworm.de> Copying big amount of data results in bad performance as data is written in chunks of 4kiB (8 * 512 bytes). The default is not changed but can be overwritten. Signed-off-by: Christian Hesse <mail@eworm.de> --- archiso/initcpio/hooks/archiso | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/archiso/initcpio/hooks/archiso b/archiso/initcpio/hooks/archiso index 1bd9419..3ef4eb1 100644 --- a/archiso/initcpio/hooks/archiso +++ b/archiso/initcpio/hooks/archiso @@ -31,7 +31,7 @@ _mnt_fs() { rw_dev=$(losetup --find --show "/run/archiso/cowspace/${cow_directory}/${img_name}.cow") echo ${rw_dev} >> /run/archiso/used_block_devices - dmsetup create ${dm_snap_name} --table "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8" + dmsetup create ${dm_snap_name} --table "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} ${cow_chunksize}" _mnt_dev "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" "-w" echo $(readlink -f /dev/mapper/${dm_snap_name}) >> /run/archiso/used_block_devices @@ -112,6 +112,7 @@ run_hook() { fi [[ -z "${cow_directory}" ]] && cow_directory="persistent_${archisolabel}/${arch}" + [[ -z "${cow_chunksize}" ]] && cow_chunksize="8" # set mount handler for archiso mount_handler="archiso_mount_handler" -- 2.2.1
From: Christian Hesse <mail@eworm.de> Signed-off-by: Christian Hesse <mail@eworm.de> --- docs/README.bootparams | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/README.bootparams b/docs/README.bootparams index ca3db35..4c324f2 100644 --- a/docs/README.bootparams +++ b/docs/README.bootparams @@ -44,6 +44,9 @@ INDEX The argument is an integer and optional unit. Units are M,G (powers of 1024). Default: "256M" +* cow_chunksize= Set chunksize used for dm-snapshot. This is number + of 512 byte blocks to write at once. + Default: "8" * copytoram_size= Set the size of tmpfs. This space is used for airootfs.sfs image if copytoram=y. Size is in bytes (suffix with "k", "m" and "g") or -- 2.2.1
On 01/02/2015 07:23 AM, Christian Hesse wrote:
From: Christian Hesse <mail@eworm.de>
Signed-off-by: Christian Hesse <mail@eworm.de> --- archiso/initcpio/hooks/archiso | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/archiso/initcpio/hooks/archiso b/archiso/initcpio/hooks/archiso index addd08a..1bd9419 100644 --- a/archiso/initcpio/hooks/archiso +++ b/archiso/initcpio/hooks/archiso @@ -100,9 +100,7 @@ run_hook() { [[ -z "${archisobasedir}" ]] && archisobasedir="arch" [[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch" [[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}" - if [[ -z "${cowfile_size}" ]]; then - cowfile_size="256M" - fi + [[ -z "${cowfile_size}" ]] && cowfile_size="256M"
if [[ -n "${cow_label}" ]]; then cow_device="/dev/disk/by-label/${cow_label}"
Nice, thanks Christian. Note: I made another changed in my local repo (in overlayfs branch) that change this parameter to cow_spacesize=, it makes more sense, since this option is shared to setup tmpfs space for both methods (dm-snap and overlayfs).
Gerardo Exequiel Pozzi <vmlinuz386@gmail.com> on Fri, 2015/01/02 14:58:
On 01/02/2015 07:23 AM, Christian Hesse wrote:
From: Christian Hesse <mail@eworm.de>
Signed-off-by: Christian Hesse <mail@eworm.de> --- archiso/initcpio/hooks/archiso | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/archiso/initcpio/hooks/archiso b/archiso/initcpio/hooks/archiso index addd08a..1bd9419 100644 --- a/archiso/initcpio/hooks/archiso +++ b/archiso/initcpio/hooks/archiso @@ -100,9 +100,7 @@ run_hook() { [[ -z "${archisobasedir}" ]] && archisobasedir="arch" [[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch" [[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}" - if [[ -z "${cowfile_size}" ]]; then - cowfile_size="256M" - fi + [[ -z "${cowfile_size}" ]] && cowfile_size="256M"
if [[ -n "${cow_label}" ]]; then cow_device="/dev/disk/by-label/${cow_label}"
Nice, thanks Christian.
Note: I made another changed in my local repo (in overlayfs branch) that change this parameter to cow_spacesize=, it makes more sense, since this option is shared to setup tmpfs space for both methods (dm-snap and overlayfs).
Agreed. ;) I thought about renaming it as well but hesitated to break backward compatibility. But with overlayfs it makes even more sense. Do you want me to send a rebased patch? -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Chris get my mail address: */=0;b=c[a++];) putchar(b-1/(/* gcc -o sig sig.c && ./sig */b/42*2-3)*42);}
participants (2)
-
Christian Hesse
-
Gerardo Exequiel Pozzi