Add zstdio support for booting Trixie kernels in Xen
v3 cover Add zstdio support for booting Trixie kernels in Xen
Hi,
Here is v3 of this series. I've addressed all the noted code formatting issues.
But I've declined to make the change to the safe math primitives because I'm sure overflow is not possible and it divereges from the original xzio source this work is based on.
Logan
--
Changes in v3:
* Fixed various code cleanups as suggested by Daniel
* Removed all tab characters to address formatting issues noticed by Avnish
Changes in v2:
* Fixed Numerous code formatting issues as noticed by Avnish
--
Debian has started compressing the kernel images in the Trixie release. This breaks booting xen kernels seeing grub has no support to decompress the zstd images[1][2].
To improve this situation, this patch series adds zstdio support in a way that's very similar to xzio. The first patch adds this support. The remaining patchs expand the file_filter tests so this functionality is covered.
--
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1102066
[2] https://www.mail-archive.com/[email protected]/msg41663.html
Logan Gunthorpe (4):
io: Implement zstdio decompression
tests/file_filter: Regenerate gpg keys
tests/file_filter: Add zstd test file
tests/file_filter: Add zstd tests
Makefile.util.def | 1 + grub-core/Makefile.core.def | 7 + grub-core/io/zstdio.c | 243 ++++++++++++++++++++++++++++++++ include/grub/file.h | 3 +- tests/file_filter/file.gz.sig | Bin 96 -> 310 bytes tests/file_filter/file.lzop.sig | Bin 96 -> 310 bytes tests/file_filter/file.xz.sig | Bin 96 -> 310 bytes tests/file_filter/file.zstd | Bin 0 -> 26 bytes tests/file_filter/file.zstd.sig | Bin 0 -> 310 bytes tests/file_filter/keys | Bin 994 -> 1308 bytes tests/file_filter/keys.pub | Bin 990 -> 657 bytes tests/file_filter/test.cfg | 1 + tests/file_filter_test.in | 7 +- 13 files changed, 259 insertions(+), 3 deletions(-) create mode 100644 grub-core/io/zstdio.c create mode 100644 tests/file_filter/file.zstd create mode 100644 tests/file_filter/file.zstd.sig
base-commit: 6b5c671d35b1b84468da1fef2b9bd8e05682f7e6 --
2.47.3
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
PATCH v3 1/4 io: Implement zstdio decompression
Add zstd based io decompression.
Based largely on the existing xzio, implement the same features using the zstd library already included in the project.
--- Makefile.util.def | 1 + grub-core/Makefile.core.def | 7 ++ grub-core/io/zstdio.c | 243 ++++++++++++++++++++++++++++++++++++ include/grub/file.h | 3 +- 4 files changed, 253 insertions(+), 1 deletion(-) create mode 100644 grub-core/io/zstdio.c
Makefile.util.def +1 -0
@@ -162,6 +162,7 @@ library = { common = grub-core/io/gzio.c; common = grub-core/io/xzio.c; common = grub-core/io/lzopio.c; + common = grub-core/io/zstdio.c; common = grub-core/kern/ia64/dl_helper.c; common = grub-core/kern/arm/dl_helper.c; common = grub-core/kern/arm64/dl_helper.c;
grub-core/Makefile.core.def +7 -0
@@ -2512,6 +2512,13 @@ module = { cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/minilzo -DMINILZO_HAVE_CONFIG_H'; }; +module = { + name = zstdio; + common = io/zstdio.c; + cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/zstd'; + cflags='-Wno-unreachable-code'; +}; + module = { name = testload; common = commands/testload.c;
grub-core/io/zstdio.c new file +243 -0
243 lines not on this page · raw message
include/grub/file.h +2 -1
@@ -190,9 +190,10 @@ typedef enum grub_file_filter_idGRUB_FILE_FILTER_GZIO ,GRUB_FILE_FILTER_XZIO ,GRUB_FILE_FILTER_LZOPIO , +GRUB_FILE_FILTER_ZSTDIO ,GRUB_FILE_FILTER_MAX ,GRUB_FILE_FILTER_COMPRESSION_FIRST =GRUB_FILE_FILTER_GZIO , -GRUB_FILE_FILTER_COMPRESSION_LAST =GRUB_FILE_FILTER_LZOPIO , +GRUB_FILE_FILTER_COMPRESSION_LAST =GRUB_FILE_FILTER_ZSTDIO , } grub_file_filter_id_t;typedef grub_file_t (*grub_file_filter_t ) (grub_file_t in,enum grub_file_type type);
Signature · 7 lines
2.47.3 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH v3 1/4] io: Implement zstdio decompression
Quoted 6 lines · Logan Gunthorpe
Add zstd based io decompression.
Based largely on the existing xzio, implement the same features using the zstd library already included in the project.
Signed-off-by Logan Gunthorpe <[email protected]>
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
PATCH v3 2/4 tests/file_filter: Regenerate gpg keys
In reply to Logan Gunthorpe via Grub-develThe 'keys' file is not a valid GPG secret key so it is not possible to generate new signatures.
Create a new key and use gpg --export-secret-key to export the key and gpg --export to export the public key. Then resign all the signatures with gpg --detach-sign.
--- tests/file_filter/file.gz.sig | Bin 96 -> 310 bytes tests/file_filter/file.lzop.sig | Bin 96 -> 310 bytes tests/file_filter/file.xz.sig | Bin 96 -> 310 bytes tests/file_filter/keys | Bin 994 -> 1308 bytes tests/file_filter/keys.pub | Bin 990 -> 657 bytes 5 files changed, 0 insertions(+), 0 deletions(-)
tests/file_filter/file.gz.sig binary +0 -0
tests/file_filter/file.lzop.sig binary +0 -0
tests/file_filter/file.xz.sig binary +0 -0
tests/file_filter/keys binary +0 -0
tests/file_filter/keys.pub binary +0 -0
Signature · 7 lines
2.47.3 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
PATCH v3 3/4 tests/file_filter: Add zstd test file
In reply to Logan Gunthorpe via Grub-develAdd a file.zstd similar to the other compression methods and generate a gpg signature with gpg --detach-sign
--- tests/file_filter/file.zstd | Bin 0 -> 26 bytes tests/file_filter/file.zstd.sig | Bin 0 -> 310 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/file_filter/file.zstd create mode 100644 tests/file_filter/file.zstd.sig
tests/file_filter/file.zstd new file binary +0 -0
tests/file_filter/file.zstd.sig new file binary +0 -0
Signature · 7 lines
2.47.3 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
PATCH v3 4/4 tests/file_filter: Add zstd tests
In reply to Logan Gunthorpe via Grub-develTest zstd decompression in the same way that other decompressors are tested.
--- tests/file_filter/test.cfg | 1 + tests/file_filter_test.in | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-)
tests/file_filter/test.cfg +1 -0
@@ -3,4 +3,5 @@ set check_signatures=enforce cat /file.gz cat /file.xz cat /file.lzop +cat /file.zstd set check_signatures=
tests/file_filter_test.in +5 -2
@@ -19,14 +19,15 @@ grubshell=@builddir@/grub-shell . "@builddir@/grub-core/modinfo.sh" -filters="gzio xzio lzopio pgp" +filters="gzio xzio lzopio zstdio pgp" modules="cat mpi" for mod in $(cut -d ' ' -f 2 "@builddir@/grub-core/crypto.lst" | sort -u); do modules="$modules $mod" done -for file in file.gz file.xz file.lzop file.gz.sig file.xz.sig file.lzop.sig keys.pub; do +for file in file.gz file.xz file.lzop file.zstd file.gz.sig file.xz.sig \ + file.lzop.sig file.zstd.sig keys.pub; do files="$files /$file=@srcdir@/tests/file_filter/$file" done
@@ -35,6 +36,8 @@ result="Hello, user! Hello, user! +Hello, user! + Hello, user!" out="$("${grubshell}" --modules="$modules $filters" --files="$files" "@srcdir@/tests/file_filter/test.cfg")"
Signature · 7 lines
2.47.3 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 32 lines · Logan Gunthorpe via Grub-devel
Hi,
Here is v3 of this series. I've addressed all the noted code formatting issues.
But I've declined to make the change to the safe math primitives because I'm sure overflow is not possible and it divereges from the original xzio source this work is based on.
Logan
--
Changes in v3:
* Fixed various code cleanups as suggested by Daniel
* Removed all tab characters to address formatting issues noticed by AvnishChanges in v2:
* Fixed Numerous code formatting issues as noticed by Avnish--
Debian has started compressing the kernel images in the Trixie release. This breaks booting xen kernels seeing grub has no support to decompress the zstd images[1][2].
To improve this situation, this patch series adds zstdio support in a way that's very similar to xzio. The first patch adds this support. The remaining patchs expand the
file_filtertests so this functionality is covered.--
Quoted 8 lines
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1102066
[2] https://www.mail-archive.com/[email protected]/msg41663.htmlLogan Gunthorpe (4):
io: Implement zstdio decompression
tests/file_filter: Regenerate gpg keys
tests/file_filter: Add zstd test file
tests/file_filter: Add zstd tests
For all patches Reviewed-by: Daniel Kiper <[email protected]>...
Daniel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel