[arch-releng] [RFC] [PATCH] [archiso] Add dm_snap_prefix= boot param.
Default value is "arch". This implies that all device mapper node for snapshot devices will be for example: arch_root-image. This helps AIF to hidden these devices from "Device Configuration". Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- README | 2 ++ archiso/hooks/archiso | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README b/README index 632f985..09765fb 100644 --- a/README +++ b/README @@ -43,6 +43,8 @@ INDEX Size is in bytes (suffix with "k", "m" and "g") or in percentage of available RAM. Default: "75%" +* dm_snap_prefix= Set a prefix for device-mapper snapshot node names. + Default: "arch" * arch= Force an architecture type (i686 | x86_64). Do not set it for normal operations. Useful for running a 64 bit kernel / 32 bit userspace. diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 7e2997a..66dbafd 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -29,6 +29,7 @@ _mnt_fs() { local mnt="${2}" local img_fullname="${img##*/}"; local img_name="${img_fullname%%.*}" + local dm_snap_name="${dm_snap_prefix}_${img_name}" local ro_dev ro_dev_size ro_dev_fs_type rw_dev mkdir -p "${mnt}" @@ -42,11 +43,11 @@ _mnt_fs() { _next_loop_dev rw_dev=$(_make_loop_dev "/cowspace/${img_name}.cow") - echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} N 8" | dmsetup create ${img_name} + echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} N 8" | dmsetup create ${dm_snap_name} - msg ":: Mounting '/dev/mapper/${img_name}' (${ro_dev_fs_type}) to '${mnt}'" - if ! mount -t "${ro_dev_fs_type}" "/dev/mapper/${img_name}" "${mnt}" ; then - echo "ERROR: while mounting '/dev/mapper/${img_name}' to '${mnt}'" + msg ":: Mounting '/dev/mapper/${dm_snap_name}' (${ro_dev_fs_type}) to '${mnt}'" + if ! mount -t "${ro_dev_fs_type}" "/dev/mapper/${dm_snap_name}" "${mnt}" ; then + echo "ERROR: while mounting '/dev/mapper/${dm_snap_name}' to '${mnt}'" launch_interactive_shell fi } @@ -81,6 +82,7 @@ run_hook() { [[ -z "${cowspace_size}" ]] && cowspace_size="75%" [[ -z "${copytoram_size}" ]] && copytoram_size="75%" [[ -z "${archisobasedir}" ]] && archisobasedir="arch" + [[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch" [[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}" if [[ -z "${aitab}" ]]; then aitab="/bootmnt/${archisobasedir}/aitab" -- 1.7.6
Am 09.08.2011 21:33, schrieb Gerardo Exequiel Pozzi:
Default value is "arch". This implies that all device mapper node for snapshot devices will be for example: arch_root-image.
This helps AIF to hidden these devices from "Device Configuration".
Does this actually need to be configurable?
----- Mensaje original -----
De: Thomas Bächler <thomas@archlinux.org> Para: arch-releng@archlinux.org CC: Enviado: martes, 9 de agosto de 2011 16:39 Asunto: Re: [arch-releng] [RFC] [PATCH] [archiso] Add dm_snap_prefix= boot param.
Am 09.08.2011 21:33, schrieb Gerardo Exequiel Pozzi:
Default value is "arch". This implies that all device mapper node for snapshot devices will be for example: arch_root-image.
This helps AIF to hidden these devices from "Device Configuration".
Does this actually need to be configurable?
For official images no, but can be usefull for custom live-mediums (same objection was for archisobasedir long time ago).
On 08/09/2011 04:56 PM, Gerardo Exequiel Pozzi wrote:
----- Mensaje original -----
De: Thomas Bächler<thomas@archlinux.org> Para: arch-releng@archlinux.org CC: Enviado: martes, 9 de agosto de 2011 16:39 Asunto: Re: [arch-releng] [RFC] [PATCH] [archiso] Add dm_snap_prefix= boot param.
Am 09.08.2011 21:33, schrieb Gerardo Exequiel Pozzi:
Default value is "arch". This implies that all device mapper node for snapshot devices will be for example: arch_root-image.
This helps AIF to hidden these devices from "Device Configuration".
Does this actually need to be configurable?
For official images no, but can be usefull for custom live-mediums (same objection was for archisobasedir long time ago).
OK, for now I will implement fixed to "arch_". Maybe this parameter will be added in a future. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 10.08.2011 00:10, schrieb Gerardo Exequiel Pozzi:
On 08/09/2011 04:56 PM, Gerardo Exequiel Pozzi wrote:
----- Mensaje original -----
De: Thomas Bächler<thomas@archlinux.org> Para: arch-releng@archlinux.org CC: Enviado: martes, 9 de agosto de 2011 16:39 Asunto: Re: [arch-releng] [RFC] [PATCH] [archiso] Add dm_snap_prefix= boot param.
Am 09.08.2011 21:33, schrieb Gerardo Exequiel Pozzi:
Default value is "arch". This implies that all device mapper node for snapshot devices will be for example: arch_root-image.
This helps AIF to hidden these devices from "Device Configuration".
Does this actually need to be configurable?
For official images no, but can be usefull for custom live-mediums (same objection was for archisobasedir long time ago).
OK, for now I will implement fixed to "arch_". Maybe this parameter will be added in a future.
Well, I agree you should add the option. I just wasn't sure whether adding so many configuration options is a good idea.
On 08/09/2011 07:19 PM, Thomas Bächler wrote:
Am 10.08.2011 00:10, schrieb Gerardo Exequiel Pozzi:
On 08/09/2011 04:56 PM, Gerardo Exequiel Pozzi wrote:
----- Mensaje original -----
De: Thomas Bächler<thomas@archlinux.org> Para: arch-releng@archlinux.org CC: Enviado: martes, 9 de agosto de 2011 16:39 Asunto: Re: [arch-releng] [RFC] [PATCH] [archiso] Add dm_snap_prefix= boot param.
Am 09.08.2011 21:33, schrieb Gerardo Exequiel Pozzi:
Default value is "arch". This implies that all device mapper node for snapshot devices will be for example: arch_root-image.
This helps AIF to hidden these devices from "Device Configuration".
Does this actually need to be configurable?
For official images no, but can be usefull for custom live-mediums (same objection was for archisobasedir long time ago).
OK, for now I will implement fixed to "arch_". Maybe this parameter will be added in a future. Well, I agree you should add the option. I just wasn't sure whether adding so many configuration options is a good idea.
OK :) I think that at some time, we need to unify boot options naming, (for example prefix all with archiso_, separate words with underscore...) -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 08/09/2011 07:22 PM, Gerardo Exequiel Pozzi wrote:
On 08/09/2011 07:19 PM, Thomas Bächler wrote:
Am 10.08.2011 00:10, schrieb Gerardo Exequiel Pozzi:
On 08/09/2011 04:56 PM, Gerardo Exequiel Pozzi wrote:
----- Mensaje original -----
De: Thomas Bächler<thomas@archlinux.org> Para: arch-releng@archlinux.org CC: Enviado: martes, 9 de agosto de 2011 16:39 Asunto: Re: [arch-releng] [RFC] [PATCH] [archiso] Add dm_snap_prefix= boot param.
Am 09.08.2011 21:33, schrieb Gerardo Exequiel Pozzi:
Default value is "arch". This implies that all device mapper node for snapshot devices will be for example: arch_root-image.
This helps AIF to hidden these devices from "Device Configuration".
Does this actually need to be configurable?
For official images no, but can be usefull for custom live-mediums (same objection was for archisobasedir long time ago).
OK, for now I will implement fixed to "arch_". Maybe this parameter will be added in a future. Well, I agree you should add the option. I just wasn't sure whether adding so many configuration options is a good idea.
OK :)
I think that at some time, we need to unify boot options naming, (for example prefix all with archiso_, separate words with underscore...)
If there are no objections I will merge this. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On Thu, 11 Aug 2011 21:45:31 -0300 Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
On 08/09/2011 07:22 PM, Gerardo Exequiel Pozzi wrote:
On 08/09/2011 07:19 PM, Thomas Bächler wrote:
Am 10.08.2011 00:10, schrieb Gerardo Exequiel Pozzi:
On 08/09/2011 04:56 PM, Gerardo Exequiel Pozzi wrote:
----- Mensaje original -----
De: Thomas Bächler<thomas@archlinux.org> Para: arch-releng@archlinux.org CC: Enviado: martes, 9 de agosto de 2011 16:39 Asunto: Re: [arch-releng] [RFC] [PATCH] [archiso] Add dm_snap_prefix= boot param.
Am 09.08.2011 21:33, schrieb Gerardo Exequiel Pozzi: > Default value is "arch". This implies that all device mapper node > for snapshot devices will be for example: arch_root-image. > > This helps AIF to hidden these devices from "Device Configuration".
Does this actually need to be configurable?
For official images no, but can be usefull for custom live-mediums (same objection was for archisobasedir long time ago).
OK, for now I will implement fixed to "arch_". Maybe this parameter will be added in a future. Well, I agree you should add the option. I just wasn't sure whether adding so many configuration options is a good idea.
OK :)
I think that at some time, we need to unify boot options naming, (for example prefix all with archiso_, separate words with underscore...)
If there are no objections I will merge this.
"one or more files are wrong" maybe this is better: --> "one or more files are corrupted" Other then that, looks good on a quick glance. Dieter
On 08/12/2011 05:08 AM, Dieter Plaetinck wrote:
"one or more files are wrong" maybe this is better: --> "one or more files are corrupted"
Other then that, looks good on a quick glance.
Dieter
(Wrong email) OK, change it. Thank you. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 08/09/2011 04:33 PM, Gerardo Exequiel Pozzi wrote:
Default value is "arch". This implies that all device mapper node for snapshot devices will be for example: arch_root-image.
This helps AIF to hidden these devices from "Device Configuration".
Signed-off-by: Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> --- README | 2 ++ archiso/hooks/archiso | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/README b/README index 632f985..09765fb 100644 --- a/README +++ b/README @@ -43,6 +43,8 @@ INDEX Size is in bytes (suffix with "k", "m" and "g") or in percentage of available RAM. Default: "75%" +* dm_snap_prefix= Set a prefix for device-mapper snapshot node names. + Default: "arch" * arch= Force an architecture type (i686 | x86_64). Do not set it for normal operations. Useful for running a 64 bit kernel / 32 bit userspace. diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 7e2997a..66dbafd 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -29,6 +29,7 @@ _mnt_fs() { local mnt="${2}" local img_fullname="${img##*/}"; local img_name="${img_fullname%%.*}" + local dm_snap_name="${dm_snap_prefix}_${img_name}" local ro_dev ro_dev_size ro_dev_fs_type rw_dev
mkdir -p "${mnt}" @@ -42,11 +43,11 @@ _mnt_fs() { _next_loop_dev rw_dev=$(_make_loop_dev "/cowspace/${img_name}.cow")
- echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} N 8" | dmsetup create ${img_name} + echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} N 8" | dmsetup create ${dm_snap_name}
- msg ":: Mounting '/dev/mapper/${img_name}' (${ro_dev_fs_type}) to '${mnt}'" - if ! mount -t "${ro_dev_fs_type}" "/dev/mapper/${img_name}" "${mnt}" ; then - echo "ERROR: while mounting '/dev/mapper/${img_name}' to '${mnt}'" + msg ":: Mounting '/dev/mapper/${dm_snap_name}' (${ro_dev_fs_type}) to '${mnt}'" + if ! mount -t "${ro_dev_fs_type}" "/dev/mapper/${dm_snap_name}" "${mnt}" ; then + echo "ERROR: while mounting '/dev/mapper/${dm_snap_name}' to '${mnt}'" launch_interactive_shell fi } @@ -81,6 +82,7 @@ run_hook() { [[ -z "${cowspace_size}" ]]&& cowspace_size="75%" [[ -z "${copytoram_size}" ]]&& copytoram_size="75%" [[ -z "${archisobasedir}" ]]&& archisobasedir="arch" + [[ -z "${dm_snap_prefix}" ]]&& dm_snap_prefix="arch" [[ -z "${archisodevice}" ]]&& archisodevice="/dev/disk/by-label/${archisolabel}" if [[ -z "${aitab}" ]]; then aitab="/bootmnt/${archisobasedir}/aitab"
Pushed to master. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 12.08.2011 15:44, schrieb Gerardo Exequiel Pozzi:
@@ -81,6 +82,7 @@ run_hook() { [[ -z "${cowspace_size}" ]]&& cowspace_size="75%" [[ -z "${copytoram_size}" ]]&& copytoram_size="75%" [[ -z "${archisobasedir}" ]]&& archisobasedir="arch" + [[ -z "${dm_snap_prefix}" ]]&& dm_snap_prefix="arch" [[ -z "${archisodevice}" ]]&& archisodevice="/dev/disk/by-label/${archisolabel}" if [[ -z "${aitab}" ]]; then aitab="/bootmnt/${archisobasedir}/aitab"
Pushed to master.
And I just noticed that indentation is wrong in the last hunk.
On 08/14/2011 05:00 AM, Thomas Bächler wrote:
Am 12.08.2011 15:44, schrieb Gerardo Exequiel Pozzi:
@@ -81,6 +82,7 @@ run_hook() { [[ -z "${cowspace_size}" ]]&& cowspace_size="75%" [[ -z "${copytoram_size}" ]]&& copytoram_size="75%" [[ -z "${archisobasedir}" ]]&& archisobasedir="arch" + [[ -z "${dm_snap_prefix}" ]]&& dm_snap_prefix="arch" [[ -z "${archisodevice}" ]]&& archisodevice="/dev/disk/by-label/${archisolabel}" if [[ -z "${aitab}" ]]; then aitab="/bootmnt/${archisobasedir}/aitab" Pushed to master.
And I just noticed that indentation is wrong in the last hunk.
Looks like a email-reply, see original patch, and commit is OK, four spaces. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
participants (3)
-
Dieter Plaetinck
-
Gerardo Exequiel Pozzi
-
Thomas Bächler