From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1S1pKi-0005Wx-CT for mharc-grub-devel@gnu.org; Sun, 26 Feb 2012 20:24:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1pKd-0005LF-B8 for grub-devel@gnu.org; Sun, 26 Feb 2012 20:24:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1pKb-0003Md-SB for grub-devel@gnu.org; Sun, 26 Feb 2012 20:24:51 -0500 Received: from mail-ey0-f169.google.com ([209.85.215.169]:58960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1pKY-0003Lk-9v; Sun, 26 Feb 2012 20:24:46 -0500 Received: by eaag11 with SMTP id g11so1866483eaa.0 for ; Sun, 26 Feb 2012 17:24:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=xJn+Dbp3NjxYo3I5z8/Zd2tplSm5gmPjIZYOiw1+MZM=; b=qn/Bw4hJiH0UEgqz8TbZGT54nwGczWO3for8aDi8Epe8fOVq1BIJjojCUEYjU0Ys4m eS7lh7lW3YWAaVnOgRoAho0LIrCcve7XbzpYJaXDvb2k6ek3L9Ip0dnbkoxVBJDBdhQL bwGR0/2ZsfcGWwe36pyOOQaeGN4v45NGTHQh8= Received: by 10.14.184.194 with SMTP id s42mr5004164eem.54.1330305884942; Sun, 26 Feb 2012 17:24:44 -0800 (PST) Received: from debian.x201.phnet (51-234.197-178.cust.bluewin.ch. [178.197.234.51]) by mx.google.com with ESMTPS id n17sm51854178eei.3.2012.02.26.17.24.41 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 26 Feb 2012 17:24:42 -0800 (PST) Message-ID: <4F4ADB58.20606@gmail.com> Date: Mon, 27 Feb 2012 02:24:40 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120216 Icedove/8.0 MIME-Version: 1.0 To: bug-grub@gnu.org, The development of GRUB 2 Subject: Re: [PATCH] grub-install: add search-file option for load.cfg References: <1326509962-12614-1-git-send-email-jon@ringle.org> In-Reply-To: <1326509962-12614-1-git-send-email-jon@ringle.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.215.169 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 01:24:52 -0000 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 > --- > 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