[arch-releng] [PATCH 1/1] add boot params archisoflags= and cow_flags= for mount options

Gerardo Exequiel Pozzi vmlinuz386 at gmail.com
Sun Dec 13 03:17:10 UTC 2015


On 11/27/2015 09:04 AM, Christian Hesse wrote:
> From: Christian Hesse <mail at eworm.de>
> 
> Having files on btrfs subvolumes requires to give mount options. Add
> boot params archisoflags= and cow_flags= for this purpose. Boot
> parameters could look like this:
> 
> ... archisodevice=/dev/sdaX archisoflags=subvolume=isos
> cow_device=/dev/sdaX cow_flags=subvolume=persist ...
> 
> Signed-off-by: Christian Hesse <mail at eworm.de>
> ---
>  archiso/initcpio/hooks/archiso | 4 ++--
>  docs/README.bootparams         | 4 ++++
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/archiso/initcpio/hooks/archiso b/archiso/initcpio/hooks/archiso
> index 3edc76c..4f2b538 100644
> --- a/archiso/initcpio/hooks/archiso
> +++ b/archiso/initcpio/hooks/archiso
> @@ -135,7 +135,7 @@ archiso_mount_handler() {
>      local newroot="${1}"
>  
>      if ! mountpoint -q "/run/archiso/bootmnt"; then
> -        _mnt_dev "${archisodevice}" "/run/archiso/bootmnt" "-r"
> +        _mnt_dev -o "${archisoflags-defaults}" "${archisodevice}" "/run/archiso/bootmnt" "-r"
>          if [[ "${copytoram}" != "y" ]]; then
>              echo $(readlink -f ${archisodevice}) >> /run/archiso/used_block_devices
>          fi
> @@ -164,7 +164,7 @@ archiso_mount_handler() {
>      fi
>  
>      if [[ -n "${cow_device}" ]]; then
> -        _mnt_dev "${cow_device}" "/run/archiso/cowspace" "-r"
> +        _mnt_dev -o "${cow_flags-defaults}" "${cow_device}" "/run/archiso/cowspace" "-r"
>          echo $(readlink -f ${cow_device}) >> /run/archiso/used_block_devices
>          mount -o remount,rw "/run/archiso/cowspace"
>      else
> diff --git a/docs/README.bootparams b/docs/README.bootparams
> index 356375d..45df437 100644
> --- a/docs/README.bootparams
> +++ b/docs/README.bootparams
> @@ -21,6 +21,8 @@ INDEX
>                      Default: (unset)
>  * archisodevice=    Set the device node where archiso medium is located.
>                      Default: "/dev/disk/by-label/${archisolabel}"
> +* archisoflags=     Set extra mount options, e.g. for btrfs subvolumes.
> +                    Default: (unset)
>  * archisobasedir=   Set the base directory where all files reside.
>                      Default: "arch"
>  * copytoram=        If set to "y" or just "copytoram" without arguments,
> @@ -35,6 +37,8 @@ INDEX
>                      Default: (unset)
>  * cow_device=       Like cow_label= but using device node.
>                      Default: (unset) or "/dev/disk/by-label/${cow_label}"
> +* cow_flags=        Set extra mount options, e.g. for btrfs subvolumes.
> +                    Default: (unset)
>  * cow_directory=    Set a directory inside ${cow_device}.
>                      Default: "/persistent_${archisolabel}/${arch}"
>  * cow_persistent=   Set if snapshot is persistent "P" or non-persistent "N".
> 

Nice!

Please follow the way to set "default" settings like other things in
archiso @run_hook()

Thanks you!


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/arch-releng/attachments/20151213/2f94169a/attachment.asc>


More information about the arch-releng mailing list