From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VPI5e-0001nJ-UR for mharc-grub-devel@gnu.org; Thu, 26 Sep 2013 16:23:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPI5W-0001mp-LG for grub-devel@gnu.org; Thu, 26 Sep 2013 16:23:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPI5P-0005TP-BJ for grub-devel@gnu.org; Thu, 26 Sep 2013 16:23:02 -0400 Received: from mail.csclub.uwaterloo.ca ([129.97.134.52]:60188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPI5P-0005TJ-74 for grub-devel@gnu.org; Thu, 26 Sep 2013 16:22:55 -0400 Received: from caffeine.csclub.uwaterloo.ca (caffeine.csclub.uwaterloo.ca [129.97.134.17]) by mail.csclub.uwaterloo.ca (Postfix) with SMTP id 953972D23C for ; Thu, 26 Sep 2013 16:22:53 -0400 (EDT) Received: by caffeine.csclub.uwaterloo.ca (sSMTP sendmail emulation); Thu, 26 Sep 2013 16:22:53 -0400 From: "Lennart Sorensen" Date: Thu, 26 Sep 2013 16:22:53 -0400 To: The development of GNU GRUB Subject: Re: [RFC] grub-install C rewrite Message-ID: <20130926202253.GS13097@csclub.uwaterloo.ca> References: <524431E6.60807@gmail.com> <20130926133504.GQ13097@csclub.uwaterloo.ca> <52443DA7.1030707@gmail.com> <20130926144400.GR13097@csclub.uwaterloo.ca> <524481D0.80206@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <524481D0.80206@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 129.97.134.52 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 20:23:10 -0000 On Thu, Sep 26, 2013 at 08:49:52PM +0200, Vladimir '=CF=86-coder/phcoder'= Serbinenko wrote: > This is interesting testcase which wasn't brought before. This would > potentially involve creating several core.img or forcing UUID when usin= g > multiple devices. Again, pretty easy in C and hairy in bash due to list > handling. No, one core.img is fine. The boot disk is the boot disk in each case (so on x86 device 0x80). The same core.img gets inserted too all the devices, so that if it happens to be the boot disk, it works. Since the partition is raid1, the same UUID is everywhere. I do not expect booting from a raid5 device to be possible as the boot partition (althoug hperhaps grub is smart enough to read the kernel from an md raid5 device these days). > 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 >=20 > 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. --=20 Len Sorensen