From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XWTsf-0007KL-VJ for mharc-grub-devel@gnu.org; Tue, 23 Sep 2014 13:28:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWTsX-0007FF-U9 for grub-devel@gnu.org; Tue, 23 Sep 2014 13:28:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWTsR-0003Xg-Q9 for grub-devel@gnu.org; Tue, 23 Sep 2014 13:27:53 -0400 Received: from mail-lb0-x22f.google.com ([2a00:1450:4010:c04::22f]:47376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWTsR-0003Wx-Ia for grub-devel@gnu.org; Tue, 23 Sep 2014 13:27:47 -0400 Received: by mail-lb0-f175.google.com with SMTP id w7so3450722lbi.6 for ; Tue, 23 Sep 2014 10:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=2cTd5Fd5PBZujOsve/lZ+vFP+EHO7jXFQDtwoImISvU=; b=p5czxXzBRoJQRTzRchW7i9ST/7kA8Z8N06D7rJIeEJetp4BozA3HvSOWbhemVyWhiR AMzdOObYzMz4nQDSXElVXrX5i5b/OtC3NNBI7BTpdOoXY9yZVWinD8PKJU/8uXmORE/u x4+5WN7QHr7SkcxatiKPW2v0fSpxH3w/hFBvnW/xkvQnCNu1LEni60Pr0oeIIC9C1v8W dCad7Yv3vSVvFX2ViLEoIZZRuGymXTpgZ8t+50Mr5Hr+SQsjAcxD7NJu122j3vTFt+lC 0ifsz2oMMdRBz9jlnHP7wYEc9PN965okKS7ekoz3yIgfcSyXOFmNXhhWU8gzOaXoYXrC pcIQ== X-Received: by 10.112.128.135 with SMTP id no7mr530073lbb.74.1411493261226; Tue, 23 Sep 2014 10:27:41 -0700 (PDT) Received: from opensuse.site (ppp94-29-94-89.pppoe.spdop.ru. [94.29.94.89]) by mx.google.com with ESMTPSA id zt1sm5000575lbc.31.2014.09.23.10.27.39 for (version=SSLv3 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Sep 2014 10:27:40 -0700 (PDT) Date: Tue, 23 Sep 2014 21:27:38 +0400 From: Andrei Borzenkov To: The development of GNU GRUB Subject: Re: [RFC PATCH] Add new partition type API and convert GPT type checks. Message-ID: <20140923212738.19382969@opensuse.site> In-Reply-To: References: <1411412346-4003-1-git-send-email-michael.marineau@coreos.com> <20140922231957.18ebb350@opensuse.site> <5420AB89.9070204@gmail.com> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.23; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22f Cc: michael.marineau@coreos.com 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: Tue, 23 Sep 2014 17:28:01 -0000 =D0=92 Mon, 22 Sep 2014 16:49:46 -0700 Michael Marineau =D0=BF=D0=B8=D1=88=D0=B5=D1= =82: > On Mon, Sep 22, 2014 at 4:06 PM, Vladimir '=CF=86-coder/phcoder' Serbinen= ko > wrote: > > On 22.09.2014 22:03, Michael Marineau wrote: > >> that is what I need to make use of and copying the code to re-read the > >> type field yet again felt silly. My final goal is actually a module > >> that will search for two partitions of the same type and select > >> between them based on some other metadata. Since searching by > >> partition type is already a common task in the grub code base > >> providing an API to do so seemed like a good starting point. Others > >> will likely find extending this to support label and uuid more useful. > >> For example with GPT the Linux kernel can use > >> "root=3DPARTUUID=3D" directly, unlike LABEL=3D or UUID=3D wh= ich must > >> be implemented in an initrd. > > Using partition type has proven to be unrelaiable in the past and grub2 > > uses as little of it as possible. Why can't your goals be achieved with > > FS UUIDs? >=20 > I'm working on CoreOS which updates /usr via read-only filesystem > images, switching between using two different partitions in an A/B > setup. The UUID in the filesystem is set when the image is created and > has nothing to do with which of the two coppies of the filesystem I > want to boot. That information is instead in the partition table, both > /usr partitions have the same special type and a set of flags that > determine which of the two to try next. It is based on the scheme > ChromeOS uses except we only have /usr instead of root and kernel > partitions. >=20 > http://www.chromium.org/chromium-os/chromiumos-design-docs/disk-format#TO= C-Selecting-the-kernel >=20 > Right now we implement this logic in an initrd and launch the final > kernel (which must match the /usr partition) via kexec. Instead I'm > moving that into a grub module because kexec does not work on many > platforms. >=20 It has GPT as prerequisite, and does not look like it would work with anything else. Just implement support in loader module. If more users appear, it is always possible to factor out common code.