From 865b9cfdcae0c4292f5b069fd1128c6495a3b122 Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Thu, 5 Sep 2024 12:12:18 +0200 Subject: [PATCH 1/5] slices: add squashfs-tools --- slices/liblzo2-2.yaml | 15 +++++++++++ slices/squashfs-tools.yaml | 25 +++++++++++++++++++ .../integration/squashfs-tools/task.yaml | 21 ++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 slices/liblzo2-2.yaml create mode 100644 slices/squashfs-tools.yaml create mode 100644 tests/spread/integration/squashfs-tools/task.yaml diff --git a/slices/liblzo2-2.yaml b/slices/liblzo2-2.yaml new file mode 100644 index 000000000..3c55b5394 --- /dev/null +++ b/slices/liblzo2-2.yaml @@ -0,0 +1,15 @@ +package: liblzo2-2 + +essential: + - liblzo2-2_copyright + +slices: + libs: + essential: + - libc6_libs + contents: + /lib/*-linux-*/liblzo2.so.2*: + + copyright: + contents: + /usr/share/doc/liblzo2-2/copyright: diff --git a/slices/squashfs-tools.yaml b/slices/squashfs-tools.yaml new file mode 100644 index 000000000..207b43649 --- /dev/null +++ b/slices/squashfs-tools.yaml @@ -0,0 +1,25 @@ +package: squashfs-tools + +essential: + - squashfs-tools_copyright + +slices: + bins: + # adding libgcc-s1 as mksquashfs crashes without + essential: + - libc6_libs + - libgcc-s1_libs + - liblz4-1_libs + - liblzma5_libs + - liblzo2-2_libs + - libzstd1_libs + - zlib1g_libs + contents: + /usr/bin/mksquashfs: + /usr/bin/sqfscat: + /usr/bin/sqfstar: + /usr/bin/unsquashfs: + + copyright: + contents: + /usr/share/doc/squashfs-tools/copyright: diff --git a/tests/spread/integration/squashfs-tools/task.yaml b/tests/spread/integration/squashfs-tools/task.yaml new file mode 100644 index 000000000..1b62b22b2 --- /dev/null +++ b/tests/spread/integration/squashfs-tools/task.yaml @@ -0,0 +1,21 @@ +summary: Integration tests for squashfs-tools + +execute: | + rootfs="$(install-slices squashfs-tools_bins)" + + # create a test folder to squash + mkdir -p "${rootfs}/test/dir1" + mkdir -p "${rootfs}/test/dir2" + + echo "test file with some content" > "${rootfs}/test/dir1/text" + echo "second test file with some content" > "${rootfs}/test/dir2/second" + + # squash it + chroot "${rootfs}" mksquashfs /test test.sq + + # unsquash it again + chroot "${rootfs}" unsquashfs test.sq + + # compare files inside + cmp "${rootfs}/test/dir1/text" "${rootfs}/squashfs-root/dir1/text" + cmp "${rootfs}/test/dir2/second" "${rootfs}/squashfs-root/dir2/second" From d00071ea758f7a3acb8e2da1d0b8290cc7bf2f87 Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Thu, 5 Sep 2024 12:17:20 +0200 Subject: [PATCH 2/5] slices/squashfs-tools: lint issue --- slices/squashfs-tools.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slices/squashfs-tools.yaml b/slices/squashfs-tools.yaml index 207b43649..10b8459b0 100644 --- a/slices/squashfs-tools.yaml +++ b/slices/squashfs-tools.yaml @@ -18,7 +18,7 @@ slices: /usr/bin/mksquashfs: /usr/bin/sqfscat: /usr/bin/sqfstar: - /usr/bin/unsquashfs: + /usr/bin/unsquashfs: copyright: contents: From 10cae3bd75da001207b521041dc644b4ed3d155d Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Tue, 1 Oct 2024 10:37:53 +0200 Subject: [PATCH 3/5] slices,tests: add notice around libgcc-s1, extend tests to sqfscat and sqfstar --- slices/squashfs-tools.yaml | 5 +++++ tests/spread/integration/squashfs-tools/task.yaml | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/slices/squashfs-tools.yaml b/slices/squashfs-tools.yaml index 10b8459b0..8d1a1a865 100644 --- a/slices/squashfs-tools.yaml +++ b/slices/squashfs-tools.yaml @@ -6,6 +6,11 @@ essential: slices: bins: # adding libgcc-s1 as mksquashfs crashes without + # In practice, libc6 should bring it anyway, BUT, there is a circular + # dependency in the archives, where libc6 depends on libgcc-s1 and + # vice versa. We don't allow that circular dependency to exist in Chisel + # and libgcc-s1 already depends on libc6, so we'll have to include this + # line here, explicitly. essential: - libc6_libs - libgcc-s1_libs diff --git a/tests/spread/integration/squashfs-tools/task.yaml b/tests/spread/integration/squashfs-tools/task.yaml index 1b62b22b2..d0513e822 100644 --- a/tests/spread/integration/squashfs-tools/task.yaml +++ b/tests/spread/integration/squashfs-tools/task.yaml @@ -13,9 +13,18 @@ execute: | # squash it chroot "${rootfs}" mksquashfs /test test.sq + ls /nono + + # test sqfscat + chroot "${rootfs}" sqfscat test.sq dir1/text | grep "test file" + # unsquash it again chroot "${rootfs}" unsquashfs test.sq # compare files inside cmp "${rootfs}/test/dir1/text" "${rootfs}/squashfs-root/dir1/text" cmp "${rootfs}/test/dir2/second" "${rootfs}/squashfs-root/dir2/second" + + # test sqfstar + tar -cvf test.tar "${rootfs}"/test + chroot "${rootfs}" sqfscat test2.squashfs < test.tar From 637f64920ffa95173c350a1e094a9b0bc57898cb Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Tue, 1 Oct 2024 10:45:57 +0200 Subject: [PATCH 4/5] tests: fix a couple of mistakes --- tests/spread/integration/squashfs-tools/task.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/spread/integration/squashfs-tools/task.yaml b/tests/spread/integration/squashfs-tools/task.yaml index d0513e822..e6fe058be 100644 --- a/tests/spread/integration/squashfs-tools/task.yaml +++ b/tests/spread/integration/squashfs-tools/task.yaml @@ -13,8 +13,6 @@ execute: | # squash it chroot "${rootfs}" mksquashfs /test test.sq - ls /nono - # test sqfscat chroot "${rootfs}" sqfscat test.sq dir1/text | grep "test file" @@ -27,4 +25,4 @@ execute: | # test sqfstar tar -cvf test.tar "${rootfs}"/test - chroot "${rootfs}" sqfscat test2.squashfs < test.tar + chroot "${rootfs}" sqfstar test2.squashfs < test.tar From 9bb2be9cf9a47a61e57e39d4e8525323f3dcbb9f Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Tue, 1 Oct 2024 10:52:01 +0200 Subject: [PATCH 5/5] slices: trailing spaces from the text --- slices/squashfs-tools.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/slices/squashfs-tools.yaml b/slices/squashfs-tools.yaml index 8d1a1a865..8f2016c9a 100644 --- a/slices/squashfs-tools.yaml +++ b/slices/squashfs-tools.yaml @@ -6,11 +6,11 @@ essential: slices: bins: # adding libgcc-s1 as mksquashfs crashes without - # In practice, libc6 should bring it anyway, BUT, there is a circular - # dependency in the archives, where libc6 depends on libgcc-s1 and - # vice versa. We don't allow that circular dependency to exist in Chisel - # and libgcc-s1 already depends on libc6, so we'll have to include this - # line here, explicitly. + # In practice, libc6 should bring it anyway, BUT, there is a circular + # dependency in the archives, where libc6 depends on libgcc-s1 and + # vice versa. We don't allow that circular dependency to exist in Chisel + # and libgcc-s1 already depends on libc6, so we'll have to include this + # line here, explicitly. essential: - libc6_libs - libgcc-s1_libs