All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] conf/machine: k3: Enable grub-efi by default in wic images
@ 2021-06-16 18:37 Tom Rini
  2021-06-16 19:09 ` [meta-ti] " Denys Dmytriyenko
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Rini @ 2021-06-16 18:37 UTC (permalink / raw)
  To: meta-ti

All of our platforms here support running EFI binaries.  We can have wic
generate a simple grub.cfg file for us that will find the root partition
via PARTUUID and utilize the device tree that is already discoverable
via the EFI configuration tables.  Assuming the EFI loader is U-Boot,
this device tree can be replaced at run-time by the normal mechanism of
loading in to memory and passing that address as an argument to bootefi.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 conf/machine/include/k3.inc | 5 ++++-
 wic/sdimage-2part-efi.wks   | 7 +++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 wic/sdimage-2part-efi.wks

diff --git a/conf/machine/include/k3.inc b/conf/machine/include/k3.inc
index e0970698b33d..61438abe8f19 100644
--- a/conf/machine/include/k3.inc
+++ b/conf/machine/include/k3.inc
@@ -45,7 +45,10 @@ IMAGE_BOOT_FILES_MULTI_CERT = "${SPL_BINARY} u-boot.${UBOOT_SUFFIX} tiboot3.bin"
 
 IMAGE_BOOT_FILES ?= "${IMAGE_BOOT_FILES_LEGACY}"
 
-WKS_FILE ?= "sdimage-2part.wks"
+EFI_PROVIDER ?= "grub-efi"
+MACHINE_FEATURES += "efi"
+
+WKS_FILE ?= "sdimage-2part-efi.wks"
 do_image_wic[depends] += "virtual/bootloader:do_deploy"
 do_image_wic[mcdepends] += "mc::k3r5:virtual/bootloader:do_deploy mc::k3r5:ti-sci-fw:do_deploy"
 do_image_tar[mcdepends] += "mc::k3r5:virtual/bootloader:do_deploy mc::k3r5:ti-sci-fw:do_deploy"
diff --git a/wic/sdimage-2part-efi.wks b/wic/sdimage-2part-efi.wks
new file mode 100644
index 000000000000..6b03080eb5bf
--- /dev/null
+++ b/wic/sdimage-2part-efi.wks
@@ -0,0 +1,7 @@
+# short-description: Create SD card image with 2 partitions and EFI support
+# long-description: Creates a partitioned SD card image for TI platforms that
+# supports EFI.  Boot files are located in the first vfat partition with extra
+# reserved space.  We cannot use a GPT here.
+bootloader --append="rootfstype=ext4 ro"
+part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --fstype=vfat --label boot --active --align 1024 --use-uuid
+part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [meta-ti] [PATCH] conf/machine: k3: Enable grub-efi by default in wic images
  2021-06-16 18:37 [PATCH] conf/machine: k3: Enable grub-efi by default in wic images Tom Rini
@ 2021-06-16 19:09 ` Denys Dmytriyenko
  2021-06-16 21:36   ` Tom Rini
  0 siblings, 1 reply; 3+ messages in thread
From: Denys Dmytriyenko @ 2021-06-16 19:09 UTC (permalink / raw)
  To: Tom Rini; +Cc: meta-ti

On Wed, Jun 16, 2021 at 02:37:18PM -0400, Tom Rini wrote:
> All of our platforms here support running EFI binaries.  We can have wic
> generate a simple grub.cfg file for us that will find the root partition
> via PARTUUID and utilize the device tree that is already discoverable
> via the EFI configuration tables.  Assuming the EFI loader is U-Boot,
> this device tree can be replaced at run-time by the normal mechanism of
> loading in to memory and passing that address as an argument to bootefi.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  conf/machine/include/k3.inc | 5 ++++-
>  wic/sdimage-2part-efi.wks   | 7 +++++++
>  2 files changed, 11 insertions(+), 1 deletion(-)
>  create mode 100644 wic/sdimage-2part-efi.wks
> 
> diff --git a/conf/machine/include/k3.inc b/conf/machine/include/k3.inc
> index e0970698b33d..61438abe8f19 100644
> --- a/conf/machine/include/k3.inc
> +++ b/conf/machine/include/k3.inc
> @@ -45,7 +45,10 @@ IMAGE_BOOT_FILES_MULTI_CERT = "${SPL_BINARY} u-boot.${UBOOT_SUFFIX} tiboot3.bin"
>  
>  IMAGE_BOOT_FILES ?= "${IMAGE_BOOT_FILES_LEGACY}"
>  
> -WKS_FILE ?= "sdimage-2part.wks"
> +EFI_PROVIDER ?= "grub-efi"
> +MACHINE_FEATURES += "efi"
> +
> +WKS_FILE ?= "sdimage-2part-efi.wks"
>  do_image_wic[depends] += "virtual/bootloader:do_deploy"
>  do_image_wic[mcdepends] += "mc::k3r5:virtual/bootloader:do_deploy mc::k3r5:ti-sci-fw:do_deploy"
>  do_image_tar[mcdepends] += "mc::k3r5:virtual/bootloader:do_deploy mc::k3r5:ti-sci-fw:do_deploy"
> diff --git a/wic/sdimage-2part-efi.wks b/wic/sdimage-2part-efi.wks
> new file mode 100644
> index 000000000000..6b03080eb5bf
> --- /dev/null
> +++ b/wic/sdimage-2part-efi.wks
> @@ -0,0 +1,7 @@
> +# short-description: Create SD card image with 2 partitions and EFI support
> +# long-description: Creates a partitioned SD card image for TI platforms that
> +# supports EFI.  Boot files are located in the first vfat partition with extra
> +# reserved space.  We cannot use a GPT here.

Was "extra reserved space" in the boot partition lost?
Not sure if it's still needed - it was used for testing.


> +bootloader --append="rootfstype=ext4 ro"
> +part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --fstype=vfat --label boot --active --align 1024 --use-uuid
> +part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid
> -- 
> 2.17.1
> 

-- 
Regards,
Denys Dmytriyenko <denis@denix.org>
PGP: 0x420902729A92C964 - https://denix.org/0x420902729A92C964
Fingerprint: 25FC E4A5 8A72 2F69 1186  6D76 4209 0272 9A92 C964

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [meta-ti] [PATCH] conf/machine: k3: Enable grub-efi by default in wic images
  2021-06-16 19:09 ` [meta-ti] " Denys Dmytriyenko
@ 2021-06-16 21:36   ` Tom Rini
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Rini @ 2021-06-16 21:36 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-ti

[-- Attachment #1: Type: text/plain, Size: 2517 bytes --]

On Wed, Jun 16, 2021 at 03:09:26PM -0400, Denys Dmytriyenko wrote:
> On Wed, Jun 16, 2021 at 02:37:18PM -0400, Tom Rini wrote:
> > All of our platforms here support running EFI binaries.  We can have wic
> > generate a simple grub.cfg file for us that will find the root partition
> > via PARTUUID and utilize the device tree that is already discoverable
> > via the EFI configuration tables.  Assuming the EFI loader is U-Boot,
> > this device tree can be replaced at run-time by the normal mechanism of
> > loading in to memory and passing that address as an argument to bootefi.
> > 
> > Signed-off-by: Tom Rini <trini@konsulko.com>
> > ---
> >  conf/machine/include/k3.inc | 5 ++++-
> >  wic/sdimage-2part-efi.wks   | 7 +++++++
> >  2 files changed, 11 insertions(+), 1 deletion(-)
> >  create mode 100644 wic/sdimage-2part-efi.wks
> > 
> > diff --git a/conf/machine/include/k3.inc b/conf/machine/include/k3.inc
> > index e0970698b33d..61438abe8f19 100644
> > --- a/conf/machine/include/k3.inc
> > +++ b/conf/machine/include/k3.inc
> > @@ -45,7 +45,10 @@ IMAGE_BOOT_FILES_MULTI_CERT = "${SPL_BINARY} u-boot.${UBOOT_SUFFIX} tiboot3.bin"
> >  
> >  IMAGE_BOOT_FILES ?= "${IMAGE_BOOT_FILES_LEGACY}"
> >  
> > -WKS_FILE ?= "sdimage-2part.wks"
> > +EFI_PROVIDER ?= "grub-efi"
> > +MACHINE_FEATURES += "efi"
> > +
> > +WKS_FILE ?= "sdimage-2part-efi.wks"
> >  do_image_wic[depends] += "virtual/bootloader:do_deploy"
> >  do_image_wic[mcdepends] += "mc::k3r5:virtual/bootloader:do_deploy mc::k3r5:ti-sci-fw:do_deploy"
> >  do_image_tar[mcdepends] += "mc::k3r5:virtual/bootloader:do_deploy mc::k3r5:ti-sci-fw:do_deploy"
> > diff --git a/wic/sdimage-2part-efi.wks b/wic/sdimage-2part-efi.wks
> > new file mode 100644
> > index 000000000000..6b03080eb5bf
> > --- /dev/null
> > +++ b/wic/sdimage-2part-efi.wks
> > @@ -0,0 +1,7 @@
> > +# short-description: Create SD card image with 2 partitions and EFI support
> > +# long-description: Creates a partitioned SD card image for TI platforms that
> > +# supports EFI.  Boot files are located in the first vfat partition with extra
> > +# reserved space.  We cannot use a GPT here.
> 
> Was "extra reserved space" in the boot partition lost?
> Not sure if it's still needed - it was used for testing.

I removed it as it doesn't seem to function with bootimg-efi (I didn't
see an obvious "why" either in a quick check in wic internals).  I can
use --fixed-size 128M to bring back a bunch more extra space, if needed.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 673 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-16 21:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16 18:37 [PATCH] conf/machine: k3: Enable grub-efi by default in wic images Tom Rini
2021-06-16 19:09 ` [meta-ti] " Denys Dmytriyenko
2021-06-16 21:36   ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.