All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] grub-install: add search-file option for load.cfg
       [not found] <1326509962-12614-1-git-send-email-jon@ringle.org>
@ 2012-02-27  1:24 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; only message in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-27  1:24 UTC (permalink / raw)
  To: bug-grub, The development of GRUB 2

I had to rewrite it because of several problems involving lack of 
fallback if UUID is unavailable, lack of documentation and so on. 
Committed my version
On 14.01.2012 03:59, Jon Ringle wrote:
> Signed-off-by: Jon Ringle<jon@ringle.org>
> ---
>   util/grub-install.in |   26 +++++++++++++++++++++-----
>   1 files changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/util/grub-install.in b/util/grub-install.in
> index ff8bea8..20a3b7d 100644
> --- a/util/grub-install.in
> +++ b/util/grub-install.in
> @@ -245,6 +245,9 @@ do
>       --debug-image=*)
>   	debug_image="`echo "$option" | sed 's/--debug-image=//'`" ;;
>
> +    --search-file)
> +	set_search_file=yes ;;
> +
>       -f | --force)
>           setup_force="--force" ;;
>
> @@ -534,12 +537,25 @@ if [ "x${devabstraction_module}" = "x" ] ; then
>                echo "UUID needed with cross-disk installs, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
>             fi
>
> -          exit 1
> +          set_search_file=yes
> +        fi
> +
> +        if [ "x${set_search_file}" = xyes ]; then
> +          search_file=$(mktemp "${grubdir}/XXXXXXXXXXXXXXXXXXXXXXXXX.uuid")
> +          search_file="$("${grub_mkrelpath}" "${search_file}")"
> +        fi
> +
> +        if [ "x${search_file}" = "x" ] ; then
> +          echo "search.fs_uuid ${uuid} root ">>  "${grubdir}/load.cfg"
> +          echo 'set prefix=($root)'"${relative_grubdir}">>  "${grubdir}/load.cfg"
> +          config_opt="-c ${grubdir}/load.cfg "
> +          modules="$modules search_fs_uuid"
> +        else
> +          echo "search.file ${search_file} root ">>  "${grubdir}/load.cfg"
> +          echo 'set prefix=($root)'"${relative_grubdir}">>  "${grubdir}/load.cfg"
> +          config_opt="-c ${grubdir}/load.cfg "
> +          modules="$modules search_fs_file"
>           fi
> -        echo "search.fs_uuid ${uuid} root ">>  "${grubdir}/load.cfg"
> -	echo 'set prefix=($root)'"${relative_grubdir}">>  "${grubdir}/load.cfg"
> -	config_opt="-c ${grubdir}/load.cfg "
> -        modules="$modules search_fs_uuid"
>       elif [ "x$platform" = xefi ] || [ "x$platform" = xpc ]; then
>           # we need to hardcode the partition number in the core image's prefix.
>   	if [ x"$grub_partition" = x ]; then


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-27  1:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1326509962-12614-1-git-send-email-jon@ringle.org>
2012-02-27  1:24 ` [PATCH] grub-install: add search-file option for load.cfg Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.