From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] sunxi: Add default partition scheme
Date: Thu, 30 Nov 2017 16:49:15 +0100 [thread overview]
Message-ID: <20171130154915.rx6i5msbdcogufrd@flea.lan> (raw)
In-Reply-To: <b2402717-faae-90b6-969d-8f9055b9ddbd@arm.com>
On Thu, Nov 30, 2017 at 09:22:07AM +0000, Andre Przywara wrote:
> Hi,
>
> On 30/11/17 07:56, Maxime Ripard wrote:
> > Hi,
> >
> > On Thu, Nov 30, 2017 at 12:23:06AM +0000, André Przywara wrote:
> >> Hi Maxime,
> >>
> >> On 28/11/17 10:34, Maxime Ripard wrote:
> >>> The partitions variable is especially useful to create a partition table
> >>> from U-Boot, either directly from the U-Boot shell, or through flashing
> >>> tools like fastboot and its oem format command.
> >>>
> >>> This is especially useful on devices with an eMMC you can't take out to
> >>> flash from another system, and booting a Linux system first to flash our
> >>> system then is not really practical.
> >>>
> >>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> >>> ---
> >>> include/configs/sunxi-common.h | 9 +++++++++
> >>> 1 file changed, 9 insertions(+)
> >>>
> >>> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> >>> index 4391a8cbc824..c9214a709221 100644
> >>> --- a/include/configs/sunxi-common.h
> >>> +++ b/include/configs/sunxi-common.h
> >>> @@ -493,6 +493,12 @@ extern int soft_i2c_gpio_scl;
> >>> #define SUNXI_MTDPARTS_DEFAULT
> >>> #endif
> >>>
> >>> +#define PARTS_DEFAULT \
> >>> + "name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};" \
> >>> + "name=loader2,size=984k,uuid=${uuid_gpt_loader2};" \
> >>> + "name=esp,size=128M,bootable,uuid=${uuid_gpt_esp};" \
> >>
> >> Those numbers look right to me, but I can't find the definition of
> >> uuid_gpt_loader{1,2} in U-Boot. Only I see them referenced by some
> >> rockchip header.
> >> Is there some magic definition I missed or do we actually need to add them?
> >> I guess you are after the Android-IA bootloader UUIDs from the Wikipedia
> >> page, starting with 2568845D- and 114EAFFE-?
> >
> > The fact that they have been left out is intentional. Without a UUID
> > defined, U-Boot will generate a random one if you have
> > CONFIG_RANDOM_UUID set. That kind of construct allow you to specifiy a
> > UUID if you want, without modifying the partitions variable.
>
> Ah, thanks for the explanation, I was afraid I missed something.
>
> > I'm totally fine with having a default one though. I just couldn't
> > find one that would be relevant, so I left it out.
>
> I guess this is fine. Wikipedia[1] points me to Android-IA having
> specified two UUIDs for boot loader partitions here [2], but I don't
> think they are really authoritative.
Yeah, I saw those as well, and came to the same conclusion :)
> >>> + "name=system,size=-,uuid=${uuid_gpt_system};"
> >>
> >> So does fastboot require a system partition? And it wouldn't know where
> >> to put the rootfs to without one?
> >> In this case I guess it's fine, because it fits the use case.
> >> But otherwise (as mentioned before) one giant partition to fill the rest
> >> of the "disk" is more annoying than helpful for regular Linux installers.
> >
> > So fasboot is dumber than you assume it to be ;)
> >
> > The only thing you do is giving it a file and a partition. So yeah,
> > you would need to have a partition defined for that.
> >
> >>> +
> >>> #define CONSOLE_ENV_SETTINGS \
> >>> CONSOLE_STDIN_SETTINGS \
> >>> CONSOLE_STDOUT_SETTINGS
> >>> @@ -511,6 +517,9 @@ extern int soft_i2c_gpio_scl;
> >>> "console=ttyS0,115200\0" \
> >>> SUNXI_MTDIDS_DEFAULT \
> >>> SUNXI_MTDPARTS_DEFAULT \
> >>> + "uuid_gpt_esp=C12A7328-F81F-11D2-BA4B-00A0C93EC93B\0" \
> >>> + "uuid_gpt_system=0FC63DAF-8483-4772-8E79-3D69D8477DE4\0" \
> >>
> >> The ESP GUID is correct, the other is "Linux filesystem data", right?
> >> Technically I guess root partition would be more suitable, but we would
> >> need to know whether it's AArch64 or ARM, if I get this correctly.
> >> Shall we use #ifdef CONFIG_ARM64 here?
> >
> > We can, what UUID do you have in mind?
>
> FreeDesktop [3] seems to define some UUIDs for Linux root partitions,
> separated by architectures, and it lists ARM and AArch64.
Ok, I'll use them then.
Thanks!
maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171130/27e1ed98/attachment.sig>
next prev parent reply other threads:[~2017-11-30 15:49 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-28 10:34 [U-Boot] [PATCH 0/4] sunxi: Ease eMMC usage and flashing Maxime Ripard
2017-11-28 10:34 ` [U-Boot] [PATCH 1/4] part: efi: Add a Kconfig option for the number of partition entries Maxime Ripard
2017-11-28 14:50 ` Tom Rini
2017-11-30 0:20 ` André Przywara
2017-11-28 10:34 ` [U-Boot] [PATCH 2/4] part: efi: Add default number of partition entries for sunxi Maxime Ripard
2017-11-30 0:22 ` André Przywara
2017-11-28 10:34 ` [U-Boot] [PATCH 3/4] sunxi: Add default partition scheme Maxime Ripard
2017-11-30 0:23 ` André Przywara
2017-11-30 7:56 ` Maxime Ripard
2017-11-30 9:22 ` Andre Przywara
2017-11-30 15:49 ` Maxime Ripard [this message]
2017-11-28 10:34 ` [U-Boot] [PATCH 4/4] fastboot: Enable flashing by default on sunxi Maxime Ripard
2017-11-30 0:23 ` André Przywara
2017-11-30 7:58 ` Maxime Ripard
2017-11-30 9:56 ` Andre Przywara
2017-11-30 15:50 ` Maxime Ripard
2017-11-28 10:35 ` [U-Boot] [PATCH 0/4] sunxi: Ease eMMC usage and flashing Maxime Ripard
-- strict thread matches above, loose matches on Subject: below --
2017-11-15 10:11 Maxime Ripard
2017-11-15 10:11 ` [U-Boot] [PATCH 3/4] sunxi: Add default partition scheme Maxime Ripard
2017-11-15 21:03 ` Alexander Graf
2017-11-16 9:29 ` Maxime Ripard
2017-11-16 10:30 ` Andre Przywara
2017-11-16 11:21 ` Maxime Ripard
2017-11-16 11:41 ` Andre Przywara
2017-11-16 11:54 ` Alexander Graf
2017-11-16 12:32 ` Emmanuel Vadot
2017-11-16 17:30 ` Tom Rini
2017-11-17 8:29 ` Maxime Ripard
[not found] ` <20171116194248.fk75jtez4unq2lse@excalibur.cnev.de>
2017-11-17 8:31 ` Maxime Ripard
2017-11-17 8:27 ` Maxime Ripard
2017-11-17 12:21 ` Andre Przywara
2017-11-17 13:04 ` Maxime Ripard
2017-11-17 14:20 ` Alexander Graf
2017-11-20 9:24 ` Maxime Ripard
2017-11-20 11:37 ` Emmanuel Vadot
2017-11-20 13:17 ` Maxime Ripard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171130154915.rx6i5msbdcogufrd@flea.lan \
--to=maxime.ripard@free-electrons.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox