mirror of
https://salsa.debian.org/kernel-team/initramfs-tools.git
synced 2026-01-26 07:37:54 +00:00
unmkinitramfs: Add support for lzma compression
The kernel and mkinitramfs support lzma compression, but for some reason this was not included in unmkinitramfs. - Add a format code, magic entry, and decompression command for lzma to unmkinitramfs - Add lzma to the compression commands in the test case Signed-off-by: Ben Hutchings <benh@debian.org>
This commit is contained in:
parent
e28d365867
commit
02bd63ab71
2
debian/tests/unmkinitramfs
vendored
2
debian/tests/unmkinitramfs
vendored
@ -57,7 +57,7 @@ for n_early in 0 1 2; do
|
||||
continue
|
||||
fi
|
||||
|
||||
for compressor in no_compressor gzip bzip2 xz lzop 'lz4 -l' zstd; do
|
||||
for compressor in no_compressor gzip bzip2 lzma xz lzop 'lz4 -l' zstd; do
|
||||
# If last archive is early, it can't be compressed
|
||||
if [ $n_main -eq 0 ] && [ "$compressor" != no_compressor ]; then
|
||||
continue
|
||||
|
||||
@ -65,6 +65,7 @@ enum format {
|
||||
FORMAT_CPIO_NEW,
|
||||
FORMAT_GZIP,
|
||||
FORMAT_BZIP2,
|
||||
FORMAT_LZMA,
|
||||
FORMAT_XZ,
|
||||
FORMAT_LZO,
|
||||
FORMAT_LZ4,
|
||||
@ -86,6 +87,7 @@ static const struct magic_entry magic_table[] = {
|
||||
MAGIC_ENTRY(CPIO_NEW_CRC_MAGIC, FORMAT_CPIO_NEW),
|
||||
MAGIC_ENTRY("\x1f\x8b\x08", FORMAT_GZIP),
|
||||
MAGIC_ENTRY("BZh", FORMAT_BZIP2),
|
||||
MAGIC_ENTRY("\x5d\0\0", FORMAT_LZMA),
|
||||
MAGIC_ENTRY("\xfd""7zXZ\0", FORMAT_XZ),
|
||||
MAGIC_ENTRY("\x89LZO\0\r\n\x1a\n", FORMAT_LZO),
|
||||
/* lz4 "legacy" format, the only version that the kernel supports */
|
||||
@ -97,6 +99,7 @@ static const struct magic_entry magic_table[] = {
|
||||
static const char *const decomp_table[][2] = {
|
||||
[FORMAT_GZIP] = { "gzip", "-cd" },
|
||||
[FORMAT_BZIP2] = { "bzip2", "-cd" },
|
||||
[FORMAT_LZMA] = { "lzma", "-cd" },
|
||||
[FORMAT_XZ] = { "xzcat" },
|
||||
[FORMAT_LZO] = { "lzop", "-cd" },
|
||||
[FORMAT_LZ4] = { "lz4cat" },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user