From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VPGdh-0004ZA-V9 for mharc-grub-devel@gnu.org; Thu, 26 Sep 2013 14:50:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPGdX-0004U3-Vx for grub-devel@gnu.org; Thu, 26 Sep 2013 14:50:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPGdP-0001eM-JZ for grub-devel@gnu.org; Thu, 26 Sep 2013 14:50:03 -0400 Received: from mail-ee0-x230.google.com ([2a00:1450:4013:c00::230]:65531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPGdP-0001e7-CS for grub-devel@gnu.org; Thu, 26 Sep 2013 14:49:55 -0400 Received: by mail-ee0-f48.google.com with SMTP id l10so736304eei.7 for ; Thu, 26 Sep 2013 11:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=Eny+5UcTPjklKIomu0vKdPLdmdW0/q/JTDhDC/EBRmc=; b=pth4CIIL36XG/QdmxrPZhUn0yFljQ2+cf0uUBnk+W7YPZlEF0kiPARfQcCOVkBH6DL 5B87SojYp2s8plrZviMJ/gMIudu3pXEzyA+/VqoCAjqEmWJSdbojxUlth88sW7rq5eBG Knf9Lts7PlKpcjEb9B9MfPUh7r7JKOikvQDgm0f6ObDT+byW2FWfqDMwjHLAf5kYbGtD o3iVTRMfTcUBJGPebcBdw1vWXK4/ieV0hmph/gkqK1wLn71fEM7IvlIBC5SiRK+q/kNL q9Y2AfBHD9ONZKhkrKM//Qe7hop1ZEgJUclMU0aDzjVPVcZGGsmoLZe1Oh0xMbSCTHYY WJ5w== X-Received: by 10.14.109.66 with SMTP id r42mr3482002eeg.43.1380221394212; Thu, 26 Sep 2013 11:49:54 -0700 (PDT) Received: from [192.168.1.113] (31-249.1-85.cust.bluewin.ch. [85.1.249.31]) by mx.google.com with ESMTPSA id h45sm7122117eeg.5.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Sep 2013 11:49:53 -0700 (PDT) Message-ID: <524481D0.80206@gmail.com> Date: Thu, 26 Sep 2013 20:49:52 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130821 Icedove/17.0.8 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [RFC] grub-install C rewrite References: <524431E6.60807@gmail.com> <20130926133504.GQ13097@csclub.uwaterloo.ca> <52443DA7.1030707@gmail.com> <20130926144400.GR13097@csclub.uwaterloo.ca> In-Reply-To: <20130926144400.GR13097@csclub.uwaterloo.ca> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2XEFOUDDJNDVDWDDXVDWB" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::230 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: Thu, 26 Sep 2013 18:50:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2XEFOUDDJNDVDWDDXVDWB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 26.09.2013 16:44, Lennart Sorensen wrote: >> windows is low priority and more of a bonus. The problems of handling >> anything that looks like a list (e.g. list of devices where / resides = on >> in case of btrfs) and code becoming hairy to handle those cases is >> bigger reason. >=20 > Sure lists can be a hassle. >=20 > I didn't check lately, but does grub-install understand a list of devic= es > to install to yet? >=20 > ie: grub-install /dev/sda /dev/sdb >=20 > After all if I have software raid, both those devices contain /boot and= > are valid to boot from. And since on things like IBM powerpc, > grub-install likes to update the firmware with the list of boot devices= , > they do all have to be specified at once or you end up with the wrong > list (which so far I have worked around by manually fixing the firmware= > settings after updating grub, which doesn't happen very often lately). >=20 > So calling grub-install for each device in turn (as I believe Debian > does on x86 if you tell it multiple boot devices), does not actually > give the correct result. >=20 This is interesting testcase which wasn't brought before. This would potentially involve creating several core.img or forcing UUID when using multiple devices. Again, pretty easy in C and hairy in bash due to list handling. > So really my main objection is that it is much harder to debug and fix > C code than it is to fix a script calling a bunch of external commands.= >=20 > At the very least a C version of grub-install must have an option to > list every command it is attempting to execute externally. Certainly > adding 'set -x' to grub-install has often been helpful. It's surely sth we can do. grub-install does only following that is affecting system: 1) mkdir -p 2) copy files. We can write exact copy commands 3) grub-mkimage. We can do the same. 4) grub-setup. Ditto 5) Create load.cfg. Ditto. 6) calling external commands. We can have 4 levels of verbosity: 0) quiet, 1) write to stderr the commands 2) like 1 but show grub_util_info 3) additionally show grub_dprintf It's also possible to have options --dry-run (doesn't really do the changes, except, perhaps, "mkdir -p") and --gen-script which would generate a list of commands which when executed would do exactly as if grub-install was run. So you can do grub-install --dry-run --gen-script=3D/tmp/myinstall ... /tmp/myinstall This has additional advantage of see which commands are really executed without having to understand the whole command flow. ------enig2XEFOUDDJNDVDWDDXVDWB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlJEgdAACgkQNak7dOguQgnDFAD6Am5FiEwH1BIixTofsW6sWwgg aVG4sntUnXPdB3v3E+AA/AgXXVPFX49F2e6/cBmkXm8Og2L90JHZ/BN479+vTdG3 =pDIh -----END PGP SIGNATURE----- ------enig2XEFOUDDJNDVDWDDXVDWB--