[arch-projects] [mkinitcpio][PATCH 2/4] init_functions: support {LABEL, {PART, }UUID}= syntax

Dave Reisner d at falconindy.com
Sun Jun 5 15:10:25 EDT 2011


On Sat, Jun 04, 2011 at 01:17:59PM -0400, Dave Reisner wrote:
> use blkid to resolve a tag name to a block device.
> 
> Signed-off-by: Dave Reisner <d at falconindy.com>
> ---
>  init_functions |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/init_functions b/init_functions
> index be3599e..f9f1742 100644
> --- a/init_functions
> +++ b/init_functions
> @@ -73,6 +73,15 @@ parse_cmdline() {
>  }
>  
>  default_mount_handler() {
> +    # resolve tag name to block device
> +    if [ "${root:0:9}" = 'PARTUUID=' ] || [ "${root:0:5}" = 'UUID=' ] || [ "${root:0:6}" = 'LABEL=' ]; then
> +        device=$(blkid -t "${root#PART}")
> +        if [ -n "$device" ]; then
> +            root=$device
> +        fi
> +        unset device
> +    fi
> +
>      if [ ${root:0:5} != "/dev/" ] || ! poll_device "${root}" ${rootdelay}; then
>          msg "Root device '${root}' doesn't exist. Attempting to create it."
>          major=""
> -- 
> 1.7.5.4
> 

This patch sucks. It misses an option to blkid. Also, I've got a working
branch on Github for this now:

https://github.com/falconindy/mkinitcpio/tree/working

Destroyed add_module and add_binary today, with great success...

dave


More information about the arch-projects mailing list