From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Date: Thu, 30 Nov 2017 16:49:15 +0100 Subject: [U-Boot] [PATCH 3/4] sunxi: Add default partition scheme In-Reply-To: References: <6b1dc860-0fb1-f765-b0d7-3f9d1f599308@arm.com> <20171130075649.gdphoisqmkeot7gj@flea.lan> Message-ID: <20171130154915.rx6i5msbdcogufrd@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 On Thu, Nov 30, 2017 at 09:22:07AM +0000, Andre Przywara wrote: > Hi, >=20 > On 30/11/17 07:56, Maxime Ripard wrote: > > Hi, > >=20 > > On Thu, Nov 30, 2017 at 12:23:06AM +0000, Andr=C3=A9 Przywara wrote: > >> Hi Maxime, > >> > >> On 28/11/17 10:34, Maxime Ripard wrote: > >>> The partitions variable is especially useful to create a partition ta= ble > >>> from U-Boot, either directly from the U-Boot shell, or through flashi= ng > >>> 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 > >>> --- > >>> include/configs/sunxi-common.h | 9 +++++++++ > >>> 1 file changed, 9 insertions(+) > >>> > >>> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-c= ommon.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};" \ > >> > >> 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 Wikiped= ia > >> page, starting with 2568845D- and 114EAFFE-? > >=20 > > 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. >=20 > Ah, thanks for the explanation, I was afraid I missed something. >=20 > > 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. >=20 > 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=3Dsystem,size=3D-,uuid=3D${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 re= st > >> of the "disk" is more annoying than helpful for regular Linux installe= rs. > >=20 > > So fasboot is dumber than you assume it to be ;) > >=20 > > 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. > >=20 > >>> + > >>> #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" \ > >> > >> 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? > >=20 > > We can, what UUID do you have in mind? >=20 > 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 --=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: