From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Date: Thu, 30 Nov 2017 08:56:49 +0100 Subject: [U-Boot] [PATCH 3/4] sunxi: Add default partition scheme In-Reply-To: <6b1dc860-0fb1-f765-b0d7-3f9d1f599308@arm.com> References: <6b1dc860-0fb1-f765-b0d7-3f9d1f599308@arm.com> Message-ID: <20171130075649.gdphoisqmkeot7gj@flea.lan> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de Hi, On Thu, Nov 30, 2017 at 12:23:06AM +0000, Andr=C3=A9 Przywara wrote: > Hi Maxime, >=20 > 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. > >=20 > > 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. > >=20 > > Signed-off-by: Maxime Ripard > > --- > > include/configs/sunxi-common.h | 9 +++++++++ > > 1 file changed, 9 insertions(+) > >=20 > > diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-com= mon.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 > > =20 > > +#define PARTS_DEFAULT \ > > + "name=3Dloader1,start=3D8k,size=3D32k,uuid=3D${uuid_gpt_loader1};" \ > > + "name=3Dloader2,size=3D984k,uuid=3D${uuid_gpt_loader2};" \ > > + "name=3Desp,size=3D128M,bootable,uuid=3D${uuid_gpt_esp};" \ >=20 > 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 the= m? > 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. 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. > > + "name=3Dsystem,size=3D-,uuid=3D${uuid_gpt_system};" >=20 > 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=3DttyS0,115200\0" \ > > SUNXI_MTDIDS_DEFAULT \ > > SUNXI_MTDPARTS_DEFAULT \ > > + "uuid_gpt_esp=3DC12A7328-F81F-11D2-BA4B-00A0C93EC93B\0" \ > > + "uuid_gpt_system=3D0FC63DAF-8483-4772-8E79-3D69D8477DE4\0" \ >=20 > 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? Maxime --=20 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: