Re: [meta-intel] [PATCH 1/2] systemd-boot: use RMC database in EFI stub

2017-02-06 Thread Cal Sullivan
Thanks for reviewing these. Since they look fine to you and my build 
went well I went ahead and merged them.


Thanks,
Cal

On 02/05/2017 08:51 PM, Jianxun Zhang wrote:

I noticed there are several RMC patches in mailing list and should review them 
tomorrow. (Just returned from a vacation)

Refer to my initial comment for Saul’s. Appreciate Mikko going through the 
following up when I was off.



On Feb 2, 2017, at 12:46 PM, Ylinen, Mikko  wrote:

Hi,

On Fri, Jan 27, 2017 at 6:05 PM, Wold, Saul  wrote:
On Fri, 2017-01-27 at 15:36 +0200, Mikko Ylinen wrote:

systemd-boot's EFI stub can be built in an EFI executable
with the kernel, cmdline, and initrd.

This commit enables the EFI stub code to use the RMC database
and appends the board specific cmdline (KBOOTPARAM) to the
built-in cmdline.


If we are going to expose the KBOOTPARAM this way, shouldn't that be
done inside of RMC proper and a getter type of API to provide
KBOOTPARAM directly?

Assuming this thoughts is to the upstream RMC project.

I have to stress my opinion. RMC is designed as a _generic_ file-based 
centralized solution so that any software (EFI and user space) could get its 
service within just 1~2 API calls.

KBOOTPARAM and how to parse or use its content is too client-specific. (Even 
the name “KBOOMPARAM” is derived from kernel doc, nothing about RMC).

Packing client-specifc stuff in RMC core could damage the scalability in the 
future. Say, how could we support bootloaders that need different behavior of 
KBOOTPARAM in RMC?

I understand people want to get rid of another copy of this logic, and am 
thinking maybe we should have a new file/API in systemd-boot as the shim (?)

Thanks




Makes a lot of sense to me. However, until that API is in place, I'd suggest
we use what I'm proposing for the stub here (that's the same approach used with
the full bootloader as well).

Just want to point out the a small difference between main bootloader and stub 
at this point. the main is implemented with single-action APIs for a 
potentially better performance when query multiple files. The stub uses 
double-action API to simplify the code because it only read one file so far.

-- Mikko
--
___
meta-intel mailing list
meta-intel@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-intel


--
___
meta-intel mailing list
meta-intel@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-intel


Re: [meta-intel] [PATCH 1/2] systemd-boot: use RMC database in EFI stub

2017-02-05 Thread Jianxun Zhang
I noticed there are several RMC patches in mailing list and should review them 
tomorrow. (Just returned from a vacation)

Refer to my initial comment for Saul’s. Appreciate Mikko going through the 
following up when I was off.


> On Feb 2, 2017, at 12:46 PM, Ylinen, Mikko  wrote:
> 
> Hi,
> 
> On Fri, Jan 27, 2017 at 6:05 PM, Wold, Saul  wrote:
> On Fri, 2017-01-27 at 15:36 +0200, Mikko Ylinen wrote:
> > systemd-boot's EFI stub can be built in an EFI executable
> > with the kernel, cmdline, and initrd.
> >
> > This commit enables the EFI stub code to use the RMC database
> > and appends the board specific cmdline (KBOOTPARAM) to the
> > built-in cmdline.
> >
> If we are going to expose the KBOOTPARAM this way, shouldn't that be
> done inside of RMC proper and a getter type of API to provide
> KBOOTPARAM directly?
Assuming this thoughts is to the upstream RMC project.

I have to stress my opinion. RMC is designed as a _generic_ file-based 
centralized solution so that any software (EFI and user space) could get its 
service within just 1~2 API calls.

KBOOTPARAM and how to parse or use its content is too client-specific. (Even 
the name “KBOOMPARAM” is derived from kernel doc, nothing about RMC).

Packing client-specifc stuff in RMC core could damage the scalability in the 
future. Say, how could we support bootloaders that need different behavior of 
KBOOTPARAM in RMC?

I understand people want to get rid of another copy of this logic, and am 
thinking maybe we should have a new file/API in systemd-boot as the shim (?)

Thanks



> 
> Makes a lot of sense to me. However, until that API is in place, I'd suggest
> we use what I'm proposing for the stub here (that's the same approach used 
> with
> the full bootloader as well).
Just want to point out the a small difference between main bootloader and stub 
at this point. the main is implemented with single-action APIs for a 
potentially better performance when query multiple files. The stub uses 
double-action API to simplify the code because it only read one file so far.
> 
> -- Mikko 
> -- 
> ___
> meta-intel mailing list
> meta-intel@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-intel

-- 
___
meta-intel mailing list
meta-intel@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-intel


Re: [meta-intel] [PATCH 1/2] systemd-boot: use RMC database in EFI stub

2017-02-02 Thread Ylinen, Mikko
Hi,

On Fri, Jan 27, 2017 at 6:05 PM, Wold, Saul  wrote:

> On Fri, 2017-01-27 at 15:36 +0200, Mikko Ylinen wrote:
> > systemd-boot's EFI stub can be built in an EFI executable
> > with the kernel, cmdline, and initrd.
> >
> > This commit enables the EFI stub code to use the RMC database
> > and appends the board specific cmdline (KBOOTPARAM) to the
> > built-in cmdline.
> >
> If we are going to expose the KBOOTPARAM this way, shouldn't that be
> done inside of RMC proper and a getter type of API to provide
> KBOOTPARAM directly?


Makes a lot of sense to me. However, until that API is in place, I'd suggest
we use what I'm proposing for the stub here (that's the same approach used
with
the full bootloader as well).

-- Mikko
-- 
___
meta-intel mailing list
meta-intel@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-intel


Re: [meta-intel] [PATCH 1/2] systemd-boot: use RMC database in EFI stub

2017-01-27 Thread Wold, Saul
On Fri, 2017-01-27 at 15:36 +0200, Mikko Ylinen wrote:
> systemd-boot's EFI stub can be built in an EFI executable
> with the kernel, cmdline, and initrd.
> 
> This commit enables the EFI stub code to use the RMC database
> and appends the board specific cmdline (KBOOTPARAM) to the
> built-in cmdline.
> 
If we are going to expose the KBOOTPARAM this way, shouldn't that be
done inside of RMC proper and a getter type of API to provide
KBOOTPARAM directly?

Sau!

> Signed-off-by: Mikko Ylinen 
> ---
>  ...Link-RMC-library-into-bootloader-and-stub.patch | 39 +++
>  ...-sd-boot-Link-RMC-library-into-bootloader.patch | 31 -
>  ...-kernel-command-line-fragment-in-EFI-stub.patch | 81
> ++
>  .../systemd-boot/systemd-boot_%.bbappend   |  3 +-
>  4 files changed, 122 insertions(+), 32 deletions(-)
>  create mode 100644 common/recipes-bsp/systemd-boot/systemd-
> boot/0001-sd-boot-Link-RMC-library-into-bootloader-and-stub.patch
>  delete mode 100644 common/recipes-bsp/systemd-boot/systemd-
> boot/0001-sd-boot-Link-RMC-library-into-bootloader.patch
>  create mode 100644 common/recipes-bsp/systemd-boot/systemd-
> boot/0004-sd-boot-Support-global-kernel-command-line-fragment-in-EFI-
> stub.patch
> 
> diff --git a/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-
> boot-Link-RMC-library-into-bootloader-and-stub.patch
> b/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-
> library-into-bootloader-and-stub.patch
> new file mode 100644
> index 000..2f248e2
> --- /dev/null
> +++ b/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-
> RMC-library-into-bootloader-and-stub.patch
> @@ -0,0 +1,39 @@
> +From fe1c2fdfe81f2ac2b41fe8543ba07f1911770d26 Mon Sep 17 00:00:00
> 2001
> +From: Jianxun Zhang 
> +Date: Sat, 21 May 2016 18:52:07 -0700
> +Subject: [PATCH] sd-boot: Link RMC library into bootloader and stub
> +
> +Add RMC library into bootloader binary and stub.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Jianxun Zhang 
> +---
> + Makefile.am | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/Makefile.am b/Makefile.am
> +index 305099ab6..9fb6f9b7b 100644
> +--- a/Makefile.am
>  b/Makefile.am
> +@@ -2802,7 +2802,7 @@ $(top_builddir)/src/boot/efi/%.o:
> $(top_srcdir)/src/boot/efi/%.c $(addprefix $(t
> + 
> + $(systemd_boot_solib): $(systemd_boot_objects)
> + $(AM_V_CCLD)$(LD) $(efi_ldflags) $(systemd_boot_objects) \
> +--o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-
> file-name); \
> ++-o $@ -lefi -lgnuefi -lrmcefi $(shell $(CC) -print-
> libgcc-file-name); \
> + nm -D -u $@ | grep ' U ' && exit 1 || :
> + 
> + $(systemd_boot): $(systemd_boot_solib)
> +@@ -2852,7 +2852,7 @@ $(top_builddir)/src/boot/efi/%.o:
> $(top_srcdir)/src/boot/efi/%.c $(addprefix $(t
> + 
> + $(stub_solib): $(stub_objects)
> + $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \
> +--o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-
> file-name); \
> ++-o $@ -lefi -lgnuefi -lrmcefi $(shell $(CC) -print-
> libgcc-file-name); \
> + nm -D -u $@ | grep ' U ' && exit 1 || :
> + 
> + $(stub): $(stub_solib)
> +-- 
> +2.11.0
> +
> diff --git a/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-
> boot-Link-RMC-library-into-bootloader.patch b/common/recipes-
> bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-library-into-
> bootloader.patch
> deleted file mode 100644
> index 626efce..000
> --- a/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-
> RMC-library-into-bootloader.patch
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -From 1ccd031ce97501f8ee63f39e8794437d568115dc Mon Sep 17 00:00:00
> 2001
> -From: Jianxun Zhang 
> -Date: Sat, 21 May 2016 18:52:07 -0700
> -Subject: [PATCH 1/3] sd-boot: Link RMC library into bootloader
> -
> -Add RMC library into bootloader binary. EFI stub is not changed
> -until we really need rmc in stub.
> -
> -Upstream-Status: Pending
> -
> -Signed-off-by: Jianxun Zhang 
> 
> - Makefile.am | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/Makefile.am b/Makefile.am
> -index 305099a..df176a5 100644
>  a/Makefile.am
> -+++ b/Makefile.am
> -@@ -2802,7 +2802,7 @@ $(top_builddir)/src/boot/efi/%.o:
> $(top_srcdir)/src/boot/efi/%.c $(addprefix $(t
> - 
> - $(systemd_boot_solib): $(systemd_boot_objects)
> - $(AM_V_CCLD)$(LD) $(efi_ldflags) $(systemd_boot_objects) \
> ---o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-
> file-name); \
> -+-o $@ -lefi -lgnuefi -lrmcefi $(shell $(CC) -print-
> libgcc-file-name); \
> - nm -D -u $@ | grep ' U ' && exit 1 || :
> - 
> - $(systemd_boot): $(systemd_boot_solib)
> --- 
> -2.7.4
> -
> diff --git a/common/recipes-bsp/systemd-boot/systemd-boot/0004-sd-
> 

[meta-intel] [PATCH 1/2] systemd-boot: use RMC database in EFI stub

2017-01-27 Thread Mikko Ylinen
systemd-boot's EFI stub can be built in an EFI executable
with the kernel, cmdline, and initrd.

This commit enables the EFI stub code to use the RMC database
and appends the board specific cmdline (KBOOTPARAM) to the
built-in cmdline.

Signed-off-by: Mikko Ylinen 
---
 ...Link-RMC-library-into-bootloader-and-stub.patch | 39 +++
 ...-sd-boot-Link-RMC-library-into-bootloader.patch | 31 -
 ...-kernel-command-line-fragment-in-EFI-stub.patch | 81 ++
 .../systemd-boot/systemd-boot_%.bbappend   |  3 +-
 4 files changed, 122 insertions(+), 32 deletions(-)
 create mode 100644 
common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-library-into-bootloader-and-stub.patch
 delete mode 100644 
common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-library-into-bootloader.patch
 create mode 100644 
common/recipes-bsp/systemd-boot/systemd-boot/0004-sd-boot-Support-global-kernel-command-line-fragment-in-EFI-stub.patch

diff --git 
a/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-library-into-bootloader-and-stub.patch
 
b/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-library-into-bootloader-and-stub.patch
new file mode 100644
index 000..2f248e2
--- /dev/null
+++ 
b/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-library-into-bootloader-and-stub.patch
@@ -0,0 +1,39 @@
+From fe1c2fdfe81f2ac2b41fe8543ba07f1911770d26 Mon Sep 17 00:00:00 2001
+From: Jianxun Zhang 
+Date: Sat, 21 May 2016 18:52:07 -0700
+Subject: [PATCH] sd-boot: Link RMC library into bootloader and stub
+
+Add RMC library into bootloader binary and stub.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jianxun Zhang 
+---
+ Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 305099ab6..9fb6f9b7b 100644
+--- a/Makefile.am
 b/Makefile.am
+@@ -2802,7 +2802,7 @@ $(top_builddir)/src/boot/efi/%.o: 
$(top_srcdir)/src/boot/efi/%.c $(addprefix $(t
+ 
+ $(systemd_boot_solib): $(systemd_boot_objects)
+   $(AM_V_CCLD)$(LD) $(efi_ldflags) $(systemd_boot_objects) \
+-  -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
++  -o $@ -lefi -lgnuefi -lrmcefi $(shell $(CC) 
-print-libgcc-file-name); \
+   nm -D -u $@ | grep ' U ' && exit 1 || :
+ 
+ $(systemd_boot): $(systemd_boot_solib)
+@@ -2852,7 +2852,7 @@ $(top_builddir)/src/boot/efi/%.o: 
$(top_srcdir)/src/boot/efi/%.c $(addprefix $(t
+ 
+ $(stub_solib): $(stub_objects)
+   $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \
+-  -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
++  -o $@ -lefi -lgnuefi -lrmcefi $(shell $(CC) 
-print-libgcc-file-name); \
+   nm -D -u $@ | grep ' U ' && exit 1 || :
+ 
+ $(stub): $(stub_solib)
+-- 
+2.11.0
+
diff --git 
a/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-library-into-bootloader.patch
 
b/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-library-into-bootloader.patch
deleted file mode 100644
index 626efce..000
--- 
a/common/recipes-bsp/systemd-boot/systemd-boot/0001-sd-boot-Link-RMC-library-into-bootloader.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 1ccd031ce97501f8ee63f39e8794437d568115dc Mon Sep 17 00:00:00 2001
-From: Jianxun Zhang 
-Date: Sat, 21 May 2016 18:52:07 -0700
-Subject: [PATCH 1/3] sd-boot: Link RMC library into bootloader
-
-Add RMC library into bootloader binary. EFI stub is not changed
-until we really need rmc in stub.
-
-Upstream-Status: Pending
-
-Signed-off-by: Jianxun Zhang 

- Makefile.am | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index 305099a..df176a5 100644
 a/Makefile.am
-+++ b/Makefile.am
-@@ -2802,7 +2802,7 @@ $(top_builddir)/src/boot/efi/%.o: 
$(top_srcdir)/src/boot/efi/%.c $(addprefix $(t
- 
- $(systemd_boot_solib): $(systemd_boot_objects)
-   $(AM_V_CCLD)$(LD) $(efi_ldflags) $(systemd_boot_objects) \
--  -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
-+  -o $@ -lefi -lgnuefi -lrmcefi $(shell $(CC) 
-print-libgcc-file-name); \
-   nm -D -u $@ | grep ' U ' && exit 1 || :
- 
- $(systemd_boot): $(systemd_boot_solib)
--- 
-2.7.4
-
diff --git 
a/common/recipes-bsp/systemd-boot/systemd-boot/0004-sd-boot-Support-global-kernel-command-line-fragment-in-EFI-stub.patch
 
b/common/recipes-bsp/systemd-boot/systemd-boot/0004-sd-boot-Support-global-kernel-command-line-fragment-in-EFI-stub.patch
new file mode 100644
index 000..7508269
--- /dev/null
+++ 
b/common/recipes-bsp/systemd-boot/systemd-boot/0004-sd-boot-Support-global-kernel-command-line-fragment-in-EFI-stub.patch
@@ -0,0 +1,81 @@
+From 4cb9c65ea9c0eba3ba04d036dccd4a5ab3d2547b Mon Sep 17 00:00:00 2001
+From: Mikko Ylinen