From 92d2db4502fabefa0bf6b6e311c5112f1797a89e Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Mon, 30 Sep 2024 06:02:36 -0400 Subject: [PATCH 01/24] feat(24.04): add dpkg and dependencies (#320) --------- Co-authored-by: Cristovao Cordeiro Co-authored-by: Rafid Bin Mostofa --- slices/diffutils.yaml | 18 ++++++ slices/dpkg.yaml | 59 ++++++++++++++++++++ slices/libc-bin.yaml | 7 +++ slices/tar.yaml | 31 ++++++++++ tests/spread/integration/diffutils/task.yaml | 23 ++++++++ tests/spread/integration/dpkg/task.yaml | 12 ++++ tests/spread/integration/tar/task.yaml | 33 +++++++++++ 7 files changed, 183 insertions(+) create mode 100644 slices/diffutils.yaml create mode 100644 slices/dpkg.yaml create mode 100644 slices/tar.yaml create mode 100644 tests/spread/integration/diffutils/task.yaml create mode 100644 tests/spread/integration/dpkg/task.yaml create mode 100644 tests/spread/integration/tar/task.yaml diff --git a/slices/diffutils.yaml b/slices/diffutils.yaml new file mode 100644 index 000000000..630ca73a8 --- /dev/null +++ b/slices/diffutils.yaml @@ -0,0 +1,18 @@ +package: diffutils + +essential: + - diffutils_copyright + +slices: + bins: + essential: + - libc6_libs + contents: + /usr/bin/cmp: + /usr/bin/diff: + /usr/bin/diff3: + /usr/bin/sdiff: + + copyright: + contents: + /usr/share/doc/diffutils/copyright: diff --git a/slices/dpkg.yaml b/slices/dpkg.yaml new file mode 100644 index 000000000..0df05ba41 --- /dev/null +++ b/slices/dpkg.yaml @@ -0,0 +1,59 @@ +package: dpkg + +essential: + - dpkg_copyright + +slices: + bins: + essential: + - dpkg_config + - dpkg_var + - libbz2-1.0_libs + - libc-bin_ldconfig + - libc6_libs + - liblzma5_libs + - libmd0_libs + - libselinux1_libs + - libzstd1_libs + - tar_tar + - zlib1g_libs + contents: + /usr/bin/dpkg: + /usr/bin/dpkg-deb: + /usr/bin/dpkg-divert: + /usr/bin/dpkg-maintscript-helper: + /usr/bin/dpkg-query: + /usr/bin/dpkg-realpath: + /usr/bin/dpkg-split: + /usr/bin/dpkg-statoverride: + /usr/bin/dpkg-trigger: + /usr/bin/update-alternatives: + /usr/libexec/dpkg/*: + /usr/sbin/start-stop-daemon: + + copyright: + contents: + /usr/share/doc/dpkg/copyright: + + config: + contents: + /etc/dpkg/dpkg.cfg: + /etc/dpkg/dpkg.cfg.d/: + + locales: + essential: + - dpkg_bins + contents: + /usr/share/locale/**/dpkg.mo: + + tables: + contents: + /usr/share/dpkg/*table: + + var: + # Directories that are included in the tarball because they need to exist in /var + contents: + /var/lib/dpkg/alternatives/: + /var/lib/dpkg/info/: + /var/lib/dpkg/parts/: + /var/lib/dpkg/updates/: diff --git a/slices/libc-bin.yaml b/slices/libc-bin.yaml index ea49d9995..5841fb58f 100644 --- a/slices/libc-bin.yaml +++ b/slices/libc-bin.yaml @@ -8,6 +8,13 @@ slices: contents: /etc/nsswitch.conf: {copy: /usr/share/libc-bin/nsswitch.conf} + ldconfig: + essential: + - dash_bins + contents: + /usr/sbin/ldconfig: + /usr/sbin/ldconfig.real: + locale: contents: /usr/lib/locale/C.utf8/LC_ADDRESS: diff --git a/slices/tar.yaml b/slices/tar.yaml new file mode 100644 index 000000000..31d5f5733 --- /dev/null +++ b/slices/tar.yaml @@ -0,0 +1,31 @@ +package: tar + +essential: + - tar_copyright + +slices: + bins: + essential: + - tar_rmt + - tar_tar + contents: + /usr/sbin/tarcat: + + copyright: + contents: + /usr/share/doc/tar/copyright: + + rmt: + essential: + - libc6_libs + contents: + /etc/rmt: {symlink: /usr/sbin/rmt-tar} + /usr/sbin/rmt-tar: + + tar: + essential: + - libacl1_libs + - libc6_libs + - libselinux1_libs + contents: + /usr/bin/tar: diff --git a/tests/spread/integration/diffutils/task.yaml b/tests/spread/integration/diffutils/task.yaml new file mode 100644 index 000000000..bf4e8f5cb --- /dev/null +++ b/tests/spread/integration/diffutils/task.yaml @@ -0,0 +1,23 @@ +summary: Integration tests for diffutils + +execute: | + # Chisel a minimum number of slices to give us a runnable system that we can + # test in. + rootfs="$(install-slices diffutils_bins)" + + mkdir "${rootfs}/test" + echo "This is a test file" > "${rootfs}/test1.txt" + echo "This is another test file" > "${rootfs}/test2.txt" + + # Compare two different files with cmp + chroot "${rootfs}/" cmp -b /test1.txt /test2.txt | grep -q '/test1.txt /test2.txt differ: byte 10, line 1' + + # Compare with diff + cp "${rootfs}/test1.txt" "${rootfs}/test3.txt" + [[ "$(chroot "${rootfs}/" diff /test1.txt /test3.txt)" == "" ]] + + # Compare with diff3 + chroot "${rootfs}/" diff3 -a /test1.txt /test2.txt /test3.txt | grep -q -e '====2' -e '[1-3]:1c' + + # ...and sdiff + chroot "${rootfs}/" sdiff /test1.txt /test2.txt | grep -q -E 'This is a test file\s+| This is another test file' diff --git a/tests/spread/integration/dpkg/task.yaml b/tests/spread/integration/dpkg/task.yaml new file mode 100644 index 000000000..5e10958b0 --- /dev/null +++ b/tests/spread/integration/dpkg/task.yaml @@ -0,0 +1,12 @@ +summary: Integration tests for dpkg + +execute: | + # Chisel a minimum number of slices to give us a runnable system that we can + # test in. + rootfs="$(install-slices coreutils_bins diffutils_bins dpkg_bins)" + + # Get a sample deb file to install. Contains no dependencies or install scripts. + wget -P "${rootfs}/" http://archive.ubuntu.com/ubuntu/pool/main/l/lsb-release-minimal/lsb-release_12.1-1_all.deb + + # Run a smoke test for dpkg to ensure that it does not throw an error + chroot "${rootfs}/" dpkg --install ./lsb-release_12.1-1_all.deb diff --git a/tests/spread/integration/tar/task.yaml b/tests/spread/integration/tar/task.yaml new file mode 100644 index 000000000..269467e60 --- /dev/null +++ b/tests/spread/integration/tar/task.yaml @@ -0,0 +1,33 @@ +summary: Integration tests for tar + +execute: | + # Chisel a minimum number of slices to give us a runnable system that we can + # test in. + rootfs="$(install-slices tar_tar)" + + mkdir "${rootfs}/test" + + echo "This is a test file" > "${rootfs}/test/test.txt" + touch --date=2020-01-01T00:00:00Z "${rootfs}/test/test.txt" + touch --date=2020-01-01T00:00:00Z "${rootfs}/test/" + + # Create an uncompressed tarball and compare to a known hash. + chroot "${rootfs}/" tar -cf test.tar /test/ + [[ $(sha256sum "${rootfs}/test.tar" | cut -d' ' -f1) == f5893661db55f15954c90dee860ee6c93042ea482c303f5f162c8078cdc79928 ]] + + # Decompress back to a new directory and ensure the file is correct. + mkdir "${rootfs}/test-result" + chroot "${rootfs}/" tar -xf test.tar -C /test-result + [[ "$(cat ${rootfs}/test/test.txt)" == "$(cat ${rootfs}/test-result/test/test.txt)" ]] + # Check modification times + [[ $(stat -c %Y ${rootfs}/test-result/test) == 1577836800 ]] + [[ $(stat -c %Y ${rootfs}/test-result/test) == 1577836800 ]] + + # Expect an error gzipping a tarball since gzip is not installed in the chroot. + ! chroot "${rootfs}/" tar -czf test.tar.gz /test/ 2| grep -q "tar (child): gzip: Cannot exec: No such file or directory" + + # New environment for rmt slice. + rootfs="$(install-slices tar_rmt)" + + # We can't really do much with rmt, so just check that the executable works. + chroot "${rootfs}/" rmt-tar --version From 8265ea301820fc3108fbee641bb2326c8c1c7aeb Mon Sep 17 00:00:00 2001 From: Hadrien Patte Date: Mon, 30 Sep 2024 14:15:27 +0200 Subject: [PATCH 02/24] feat(24.04): add SDF for ocl-icd-libopencl1 (#353) --- slices/ocl-icd-libopencl1.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 slices/ocl-icd-libopencl1.yaml diff --git a/slices/ocl-icd-libopencl1.yaml b/slices/ocl-icd-libopencl1.yaml new file mode 100644 index 000000000..ed38aa678 --- /dev/null +++ b/slices/ocl-icd-libopencl1.yaml @@ -0,0 +1,15 @@ +package: ocl-icd-libopencl1 + +essential: + - ocl-icd-libopencl1_copyright + +slices: + libs: + essential: + - libc6_libs + contents: + /usr/lib/*-linux-*/libOpenCL.so.1*: + + copyright: + contents: + /usr/share/doc/ocl-icd-libopencl1/copyright: From fab72aa0efaf1dd61f86a70d24425e491a2a59e1 Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Mon, 30 Sep 2024 14:40:41 +0200 Subject: [PATCH 03/24] slices: add distro-info-data (#336) --- slices/distro-info-data.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 slices/distro-info-data.yaml diff --git a/slices/distro-info-data.yaml b/slices/distro-info-data.yaml new file mode 100644 index 000000000..18d214120 --- /dev/null +++ b/slices/distro-info-data.yaml @@ -0,0 +1,14 @@ +package: distro-info-data + +essential: + - distro-info-data_copyright + +slices: + data: + contents: + /usr/share/distro-info/debian.csv: + /usr/share/distro-info/ubuntu.csv: + + copyright: + contents: + /usr/share/doc/distro-info-data/copyright: From e87050ba56225c7efccb7ef2f44ebe6bb605cce3 Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Mon, 30 Sep 2024 15:19:24 +0200 Subject: [PATCH 04/24] slices: add ubuntu-keyring slices (#332) --- slices/ubuntu-keyring.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 slices/ubuntu-keyring.yaml diff --git a/slices/ubuntu-keyring.yaml b/slices/ubuntu-keyring.yaml new file mode 100644 index 000000000..02a1fcad5 --- /dev/null +++ b/slices/ubuntu-keyring.yaml @@ -0,0 +1,19 @@ +package: ubuntu-keyring + +essential: + - ubuntu-keyring_copyright + +slices: + keys: + contents: + /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg: + /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg: + /usr/share/keyrings/ubuntu-archive-keyring.gpg: + /usr/share/keyrings/ubuntu-archive-removed-keys.gpg: + /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg: + /usr/share/keyrings/ubuntu-cloudimage-removed-keys.gpg: + /usr/share/keyrings/ubuntu-master-keyring.gpg: + + copyright: + contents: + /usr/share/doc/ubuntu-keyring/copyright: From ca4fb32d8b9d26264ca204c19f9d5ecc9fdc074d Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Tue, 1 Oct 2024 11:46:17 +0200 Subject: [PATCH 05/24] feat(24.04): add fonts-ubuntu (#343) --- slices/fonts-ubuntu.yaml | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 slices/fonts-ubuntu.yaml diff --git a/slices/fonts-ubuntu.yaml b/slices/fonts-ubuntu.yaml new file mode 100644 index 000000000..9854e92d6 --- /dev/null +++ b/slices/fonts-ubuntu.yaml @@ -0,0 +1,55 @@ +package: fonts-ubuntu + +essential: + - fonts-ubuntu_copyright + +slices: + all: + essential: + - fonts-ubuntu_ubuntu + - fonts-ubuntu_ubuntu-mono + - fonts-ubuntu_ubuntu-sans + - fonts-ubuntu_ubuntu-sans-mono + + config: + contents: + /etc/fonts/conf.d/71-ubuntulegacy.conf: + /usr/share/fontconfig/conf.avail/71-ubuntulegacy.conf: + + ubuntu: + contents: + /usr/share/fonts/truetype/ubuntu/Ubuntu-B.ttf: + /usr/share/fonts/truetype/ubuntu/Ubuntu-BI.ttf: + /usr/share/fonts/truetype/ubuntu/Ubuntu-C.ttf: + /usr/share/fonts/truetype/ubuntu/Ubuntu-Italic[wdth,wght].ttf: + /usr/share/fonts/truetype/ubuntu/Ubuntu-L.ttf: + /usr/share/fonts/truetype/ubuntu/Ubuntu-LI.ttf: + /usr/share/fonts/truetype/ubuntu/Ubuntu-M.ttf: + /usr/share/fonts/truetype/ubuntu/Ubuntu-MI.ttf: + /usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf: + /usr/share/fonts/truetype/ubuntu/Ubuntu-RI.ttf: + /usr/share/fonts/truetype/ubuntu/Ubuntu-Th.ttf: + /usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: + + ubuntu-mono: + contents: + /usr/share/fonts/truetype/ubuntu/UbuntuMono-B.ttf: + /usr/share/fonts/truetype/ubuntu/UbuntuMono-BI.ttf: + /usr/share/fonts/truetype/ubuntu/UbuntuMono-Italic[wght].ttf: + /usr/share/fonts/truetype/ubuntu/UbuntuMono-R.ttf: + /usr/share/fonts/truetype/ubuntu/UbuntuMono-RI.ttf: + /usr/share/fonts/truetype/ubuntu/UbuntuMono[wght].ttf: + + ubuntu-sans: + contents: + /usr/share/fonts/truetype/ubuntu/UbuntuSans-Italic[wdth,wght].ttf: + /usr/share/fonts/truetype/ubuntu/UbuntuSans[wdth,wght].ttf: + + ubuntu-sans-mono: + contents: + /usr/share/fonts/truetype/ubuntu/UbuntuSansMono-Italic[wght].ttf: + /usr/share/fonts/truetype/ubuntu/UbuntuSansMono[wght].ttf: + + copyright: + contents: + /usr/share/doc/fonts-ubuntu/copyright: From 5acb6fbc214bc6ee6e7da2a3d4ab8a0353c201b1 Mon Sep 17 00:00:00 2001 From: Hadrien Patte Date: Tue, 1 Oct 2024 14:37:09 +0200 Subject: [PATCH 06/24] feat(24.04): add ffmpeg dependencies slices (#328) --- slices/libcdio-cdda2t64.yaml | 16 ++++++++++++++++ slices/libcdio-paranoia2t64.yaml | 17 +++++++++++++++++ slices/libcdio19t64.yaml | 15 +++++++++++++++ slices/libnorm1t64.yaml | 17 +++++++++++++++++ slices/libpgm-5.3-0t64.yaml | 15 +++++++++++++++ slices/libxcb-dri2-0.yaml | 16 ++++++++++++++++ slices/libxcb-dri3-0.yaml | 16 ++++++++++++++++ slices/libxcb-glx0.yaml | 16 ++++++++++++++++ slices/libxcb-present0.yaml | 16 ++++++++++++++++ slices/libxcb-randr0.yaml | 16 ++++++++++++++++ slices/libxcb-render0.yaml | 16 ++++++++++++++++ slices/libxcb-shape0.yaml | 16 ++++++++++++++++ slices/libxcb-shm0.yaml | 16 ++++++++++++++++ slices/libxcb-sync1.yaml | 16 ++++++++++++++++ slices/libxcb-xfixes0.yaml | 16 ++++++++++++++++ slices/libxcb1.yaml | 17 +++++++++++++++++ slices/libxdmcp6.yaml | 16 ++++++++++++++++ slices/libzimg2.yaml | 17 +++++++++++++++++ slices/libzmq5.yaml | 22 ++++++++++++++++++++++ 19 files changed, 312 insertions(+) create mode 100644 slices/libcdio-cdda2t64.yaml create mode 100644 slices/libcdio-paranoia2t64.yaml create mode 100644 slices/libcdio19t64.yaml create mode 100644 slices/libnorm1t64.yaml create mode 100644 slices/libpgm-5.3-0t64.yaml create mode 100644 slices/libxcb-dri2-0.yaml create mode 100644 slices/libxcb-dri3-0.yaml create mode 100644 slices/libxcb-glx0.yaml create mode 100644 slices/libxcb-present0.yaml create mode 100644 slices/libxcb-randr0.yaml create mode 100644 slices/libxcb-render0.yaml create mode 100644 slices/libxcb-shape0.yaml create mode 100644 slices/libxcb-shm0.yaml create mode 100644 slices/libxcb-sync1.yaml create mode 100644 slices/libxcb-xfixes0.yaml create mode 100644 slices/libxcb1.yaml create mode 100644 slices/libxdmcp6.yaml create mode 100644 slices/libzimg2.yaml create mode 100644 slices/libzmq5.yaml diff --git a/slices/libcdio-cdda2t64.yaml b/slices/libcdio-cdda2t64.yaml new file mode 100644 index 000000000..64d11e1b4 --- /dev/null +++ b/slices/libcdio-cdda2t64.yaml @@ -0,0 +1,16 @@ +package: libcdio-cdda2t64 + +essential: + - libcdio-cdda2t64_copyright + +slices: + libs: + essential: + - libc6_libs + - libcdio19t64_libs + contents: + /usr/lib/*-linux-*/libcdio_cdda.so.2*: + + copyright: + contents: + /usr/share/doc/libcdio-cdda2t64/copyright: diff --git a/slices/libcdio-paranoia2t64.yaml b/slices/libcdio-paranoia2t64.yaml new file mode 100644 index 000000000..e5e35da67 --- /dev/null +++ b/slices/libcdio-paranoia2t64.yaml @@ -0,0 +1,17 @@ +package: libcdio-paranoia2t64 + +essential: + - libcdio-paranoia2t64_copyright + +slices: + libs: + essential: + - libc6_libs + - libcdio-cdda2t64_libs + - libcdio19t64_libs + contents: + /usr/lib/*-linux-*/libcdio_paranoia.so.2*: + + copyright: + contents: + /usr/share/doc/libcdio-paranoia2t64/copyright: diff --git a/slices/libcdio19t64.yaml b/slices/libcdio19t64.yaml new file mode 100644 index 000000000..a53d79e88 --- /dev/null +++ b/slices/libcdio19t64.yaml @@ -0,0 +1,15 @@ +package: libcdio19t64 + +essential: + - libcdio19t64_copyright + +slices: + libs: + essential: + - libc6_libs + contents: + /usr/lib/*-linux-*/libcdio.so.19*: + + copyright: + contents: + /usr/share/doc/libcdio19t64/copyright: diff --git a/slices/libnorm1t64.yaml b/slices/libnorm1t64.yaml new file mode 100644 index 000000000..d5e63a646 --- /dev/null +++ b/slices/libnorm1t64.yaml @@ -0,0 +1,17 @@ +package: libnorm1t64 + +essential: + - libnorm1t64_copyright + +slices: + libs: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + contents: + /usr/lib/*-linux-*/libnorm.so.1*: + + copyright: + contents: + /usr/share/doc/libnorm1t64/copyright: diff --git a/slices/libpgm-5.3-0t64.yaml b/slices/libpgm-5.3-0t64.yaml new file mode 100644 index 000000000..fe84e6e3e --- /dev/null +++ b/slices/libpgm-5.3-0t64.yaml @@ -0,0 +1,15 @@ +package: libpgm-5.3-0t64 + +essential: + - libpgm-5.3-0t64_copyright + +slices: + libs: + essential: + - libc6_libs + contents: + /usr/lib/*-linux-*/libpgm-5.3.so.0*: + + copyright: + contents: + /usr/share/doc/libpgm-5.3-0t64/copyright: diff --git a/slices/libxcb-dri2-0.yaml b/slices/libxcb-dri2-0.yaml new file mode 100644 index 000000000..7bea39523 --- /dev/null +++ b/slices/libxcb-dri2-0.yaml @@ -0,0 +1,16 @@ +package: libxcb-dri2-0 + +essential: + - libxcb-dri2-0_copyright + +slices: + libs: + essential: + - libc6_libs + - libxcb1_libs + contents: + /usr/lib/*-linux-*/libxcb-dri2.so.0*: + + copyright: + contents: + /usr/share/doc/libxcb-dri2-0/copyright: diff --git a/slices/libxcb-dri3-0.yaml b/slices/libxcb-dri3-0.yaml new file mode 100644 index 000000000..3075cc49b --- /dev/null +++ b/slices/libxcb-dri3-0.yaml @@ -0,0 +1,16 @@ +package: libxcb-dri3-0 + +essential: + - libxcb-dri3-0_copyright + +slices: + libs: + essential: + - libc6_libs + - libxcb1_libs + contents: + /usr/lib/*-linux-*/libxcb-dri3.so.0*: + + copyright: + contents: + /usr/share/doc/libxcb-dri3-0/copyright: diff --git a/slices/libxcb-glx0.yaml b/slices/libxcb-glx0.yaml new file mode 100644 index 000000000..dd2866e3b --- /dev/null +++ b/slices/libxcb-glx0.yaml @@ -0,0 +1,16 @@ +package: libxcb-glx0 + +essential: + - libxcb-glx0_copyright + +slices: + libs: + essential: + - libc6_libs + - libxcb1_libs + contents: + /usr/lib/*-linux-*/libxcb-glx.so.0*: + + copyright: + contents: + /usr/share/doc/libxcb-glx0/copyright: diff --git a/slices/libxcb-present0.yaml b/slices/libxcb-present0.yaml new file mode 100644 index 000000000..8fb471e3e --- /dev/null +++ b/slices/libxcb-present0.yaml @@ -0,0 +1,16 @@ +package: libxcb-present0 + +essential: + - libxcb-present0_copyright + +slices: + libs: + essential: + - libc6_libs + - libxcb1_libs + contents: + /usr/lib/*-linux-*/libxcb-present.so.0*: + + copyright: + contents: + /usr/share/doc/libxcb-present0/copyright: diff --git a/slices/libxcb-randr0.yaml b/slices/libxcb-randr0.yaml new file mode 100644 index 000000000..bec5d8646 --- /dev/null +++ b/slices/libxcb-randr0.yaml @@ -0,0 +1,16 @@ +package: libxcb-randr0 + +essential: + - libxcb-randr0_copyright + +slices: + libs: + essential: + - libc6_libs + - libxcb1_libs + contents: + /usr/lib/*-linux-*/libxcb-randr.so.0*: + + copyright: + contents: + /usr/share/doc/libxcb-randr0/copyright: diff --git a/slices/libxcb-render0.yaml b/slices/libxcb-render0.yaml new file mode 100644 index 000000000..180344b2f --- /dev/null +++ b/slices/libxcb-render0.yaml @@ -0,0 +1,16 @@ +package: libxcb-render0 + +essential: + - libxcb-render0_copyright + +slices: + libs: + essential: + - libc6_libs + - libxcb1_libs + contents: + /usr/lib/*-linux-*/libxcb-render.so.0*: + + copyright: + contents: + /usr/share/doc/libxcb-render0/copyright: diff --git a/slices/libxcb-shape0.yaml b/slices/libxcb-shape0.yaml new file mode 100644 index 000000000..58cb9c1d3 --- /dev/null +++ b/slices/libxcb-shape0.yaml @@ -0,0 +1,16 @@ +package: libxcb-shape0 + +essential: + - libxcb-shape0_copyright + +slices: + libs: + essential: + - libc6_libs + - libxcb1_libs + contents: + /usr/lib/*-linux-*/libxcb-shape.so.0*: + + copyright: + contents: + /usr/share/doc/libxcb-shape0/copyright: diff --git a/slices/libxcb-shm0.yaml b/slices/libxcb-shm0.yaml new file mode 100644 index 000000000..282829500 --- /dev/null +++ b/slices/libxcb-shm0.yaml @@ -0,0 +1,16 @@ +package: libxcb-shm0 + +essential: + - libxcb-shm0_copyright + +slices: + libs: + essential: + - libc6_libs + - libxcb1_libs + contents: + /usr/lib/*-linux-*/libxcb-shm.so.0*: + + copyright: + contents: + /usr/share/doc/libxcb-shm0/copyright: diff --git a/slices/libxcb-sync1.yaml b/slices/libxcb-sync1.yaml new file mode 100644 index 000000000..e83a9de9a --- /dev/null +++ b/slices/libxcb-sync1.yaml @@ -0,0 +1,16 @@ +package: libxcb-sync1 + +essential: + - libxcb-sync1_copyright + +slices: + libs: + essential: + - libc6_libs + - libxcb1_libs + contents: + /usr/lib/*-linux-*/libxcb-sync.so.1*: + + copyright: + contents: + /usr/share/doc/libxcb-sync1/copyright: diff --git a/slices/libxcb-xfixes0.yaml b/slices/libxcb-xfixes0.yaml new file mode 100644 index 000000000..6fba1a7d9 --- /dev/null +++ b/slices/libxcb-xfixes0.yaml @@ -0,0 +1,16 @@ +package: libxcb-xfixes0 + +essential: + - libxcb-xfixes0_copyright + +slices: + libs: + essential: + - libc6_libs + - libxcb1_libs + contents: + /usr/lib/*-linux-*/libxcb-xfixes.so.0*: + + copyright: + contents: + /usr/share/doc/libxcb-xfixes0/copyright: diff --git a/slices/libxcb1.yaml b/slices/libxcb1.yaml new file mode 100644 index 000000000..36aa3b845 --- /dev/null +++ b/slices/libxcb1.yaml @@ -0,0 +1,17 @@ +package: libxcb1 + +essential: + - libxcb1_copyright + +slices: + libs: + essential: + - libc6_libs + - libxau6_libs + - libxdmcp6_libs + contents: + /usr/lib/*-linux-*/libxcb.so.1*: + + copyright: + contents: + /usr/share/doc/libxcb1/copyright: diff --git a/slices/libxdmcp6.yaml b/slices/libxdmcp6.yaml new file mode 100644 index 000000000..7c28abadf --- /dev/null +++ b/slices/libxdmcp6.yaml @@ -0,0 +1,16 @@ +package: libxdmcp6 + +essential: + - libxdmcp6_copyright + +slices: + libs: + essential: + - libbsd0_libs + - libc6_libs + contents: + /usr/lib/*-linux-*/libXdmcp.so.6*: + + copyright: + contents: + /usr/share/doc/libxdmcp6/copyright: diff --git a/slices/libzimg2.yaml b/slices/libzimg2.yaml new file mode 100644 index 000000000..84a4a13ef --- /dev/null +++ b/slices/libzimg2.yaml @@ -0,0 +1,17 @@ +package: libzimg2 + +essential: + - libzimg2_copyright + +slices: + libs: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + contents: + /usr/lib/*-linux-*/libzimg.so.2*: + + copyright: + contents: + /usr/share/doc/libzimg2/copyright: diff --git a/slices/libzmq5.yaml b/slices/libzmq5.yaml new file mode 100644 index 000000000..776a92576 --- /dev/null +++ b/slices/libzmq5.yaml @@ -0,0 +1,22 @@ +package: libzmq5 + +essential: + - libzmq5_copyright + +slices: + libs: + essential: + - libbsd0_libs + - libc6_libs + - libgcc-s1_libs + - libgssapi-krb5-2_libs + - libnorm1t64_libs + - libpgm-5.3-0t64_libs + - libsodium23_libs + - libstdc++6_libs + contents: + /usr/lib/*-linux-*/libzmq.so.5*: + + copyright: + contents: + /usr/share/doc/libzmq5/copyright: From e769028627ce235f0dab9a2c11cebd9ec79299cb Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Tue, 1 Oct 2024 17:43:49 +0200 Subject: [PATCH 07/24] feat(24.04): add squashfs-tools (#347) --- slices/liblzo2-2.yaml | 15 ++++++++++ slices/squashfs-tools.yaml | 30 +++++++++++++++++++ .../integration/squashfs-tools/task.yaml | 28 +++++++++++++++++ 3 files changed, 73 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..8f2016c9a --- /dev/null +++ b/slices/squashfs-tools.yaml @@ -0,0 +1,30 @@ +package: squashfs-tools + +essential: + - squashfs-tools_copyright + +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 + - 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..e6fe058be --- /dev/null +++ b/tests/spread/integration/squashfs-tools/task.yaml @@ -0,0 +1,28 @@ +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 + + # 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}" sqfstar test2.squashfs < test.tar From 430950e8ad434abd811ae9e3b8f96609fe0fb2ae Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Wed, 2 Oct 2024 12:01:16 +0600 Subject: [PATCH 08/24] feat(24.04): add slice to generate DB (#357) This commit adds a new slice ``base-files_chisel`` which does not extract anything from the package, rather comes with an artificial path where the Chisel DB should be generated. This commit is the first one to introduce the "generate" keyword to paths. The "generate" keyword is designed to _generate_ various bookkeeping stuff for a chiselled file system. Right now, it only supports one value: "manifest". Mark a path with "generate: manifest" to generate a Chisel DB at that location. Please note that, the marking path must be in the following format: /absolute/path/to/dir/** The path must be an absolute directory path with no wildcard in it's name followed by trailing ** which makes sure nothing else is generated in that directory. --------- Co-authored-by: Cristovao Cordeiro --- slices/base-files.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/slices/base-files.yaml b/slices/base-files.yaml index a22cd74a2..d73d7ad37 100644 --- a/slices/base-files.yaml +++ b/slices/base-files.yaml @@ -66,6 +66,13 @@ slices: /etc/os-release: /usr/lib/os-release: + # Dedicated slice for generating the Chisel manifest. + chisel: + essential: + - base-files_var + contents: + /var/lib/chisel/**: {generate: manifest} + copyright: contents: /usr/share/doc/base-files/copyright: From d6cbdaaa1198a6bde09044645def760610b3b701 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Wed, 2 Oct 2024 03:06:10 -0400 Subject: [PATCH 09/24] feat(24.04): add libnotify4 and dependencies (#137) --- slices/libgdk-pixbuf-2.0-0.yaml | 29 +++++++++++++++++ slices/libgdk-pixbuf2.0-common.yaml | 10 ++++++ slices/libglib2.0-0t64.yaml | 32 +++++++++++++++++-- slices/libnotify-bin.yaml | 17 ++++++++++ slices/libnotify4.yaml | 17 ++++++++++ slices/shared-mime-info.yaml | 25 +++++++++++++++ .../integration/libgdk-pixbuf-2.0-0/task.yaml | 23 +++++++++++++ .../integration/libglib2.0-0t64/task.yaml | 12 +++++++ .../integration/libnotify-bin/task.yaml | 17 ++++++++++ .../integration/shared-mime-info/task.yaml | 7 ++++ 10 files changed, 186 insertions(+), 3 deletions(-) create mode 100644 slices/libgdk-pixbuf-2.0-0.yaml create mode 100644 slices/libgdk-pixbuf2.0-common.yaml create mode 100644 slices/libnotify-bin.yaml create mode 100644 slices/libnotify4.yaml create mode 100644 slices/shared-mime-info.yaml create mode 100644 tests/spread/integration/libgdk-pixbuf-2.0-0/task.yaml create mode 100644 tests/spread/integration/libglib2.0-0t64/task.yaml create mode 100644 tests/spread/integration/libnotify-bin/task.yaml create mode 100644 tests/spread/integration/shared-mime-info/task.yaml diff --git a/slices/libgdk-pixbuf-2.0-0.yaml b/slices/libgdk-pixbuf-2.0-0.yaml new file mode 100644 index 000000000..4f79fee2c --- /dev/null +++ b/slices/libgdk-pixbuf-2.0-0.yaml @@ -0,0 +1,29 @@ +package: libgdk-pixbuf-2.0-0 + +essential: + - libgdk-pixbuf-2.0-0_copyright + +slices: + bins: + essential: + - libgdk-pixbuf-2.0-0_libs + contents: + /usr/lib/*-linux-*/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders: + + libs: + essential: + - libc6_libs + - libglib2.0-0t64_libs + - libjpeg8_libs + - libpng16-16t64_libs + - libtiff6_libs + - shared-mime-info_data + contents: + /usr/lib/*-linux-*/gdk-pixbuf-2.0/*/loaders/*: + /usr/lib/*-linux-*/libgdk_pixbuf-2.0.so.0*: + + copyright: + contents: + /usr/share/doc/libgdk-pixbuf-2.0-0/copyright: + essential: + - libgdk-pixbuf2.0-common_copyright diff --git a/slices/libgdk-pixbuf2.0-common.yaml b/slices/libgdk-pixbuf2.0-common.yaml new file mode 100644 index 000000000..06a12bf9b --- /dev/null +++ b/slices/libgdk-pixbuf2.0-common.yaml @@ -0,0 +1,10 @@ +package: libgdk-pixbuf2.0-common + +essential: + - libgdk-pixbuf2.0-common_copyright + +slices: + copyright: + # This package has no dependencies and only contains a changelog and copyright file. + contents: + /usr/share/doc/libgdk-pixbuf2.0-common/copyright: diff --git a/slices/libglib2.0-0t64.yaml b/slices/libglib2.0-0t64.yaml index 69e9852f7..e179333da 100644 --- a/slices/libglib2.0-0t64.yaml +++ b/slices/libglib2.0-0t64.yaml @@ -4,6 +4,13 @@ essential: - libglib2.0-0t64_copyright slices: + bins: + essential: + # On armhf (only), these also need libgcc-s1_libs + - libglib2.0-0t64_libs + contents: + /usr/lib/*-linux-*/glib-2.0/*: + core: essential: - libc6_libs @@ -11,18 +18,37 @@ slices: contents: /usr/lib/*-linux-*/libglib-2.0.so.0*: + libgmodule: + essential: + - libglib2.0-0t64_core + contents: + /usr/lib/*-linux-*/libgmodule-2.0.so.0*: + + libgobject: + essential: + - libffi8_libs + - libglib2.0-0t64_core + contents: + /usr/lib/*-linux-*/libgobject-2.0.so.0*: + + libgthread: + essential: + - libglib2.0-0t64_core + contents: + /usr/lib/*-linux-*/libgthread-2.0.so.0*: + libs: essential: - libffi8_libs - libglib2.0-0t64_core + - libglib2.0-0t64_libgmodule + - libglib2.0-0t64_libgobject + - libglib2.0-0t64_libgthread - libmount1_libs - libselinux1_libs - zlib1g_libs contents: /usr/lib/*-linux-*/libgio-2.0.so.0*: - /usr/lib/*-linux-*/libgmodule-2.0.so.0*: - /usr/lib/*-linux-*/libgobject-2.0.so.0*: - /usr/lib/*-linux-*/libgthread-2.0.so.0*: copyright: contents: diff --git a/slices/libnotify-bin.yaml b/slices/libnotify-bin.yaml new file mode 100644 index 000000000..878e75d42 --- /dev/null +++ b/slices/libnotify-bin.yaml @@ -0,0 +1,17 @@ +package: libnotify-bin + +essential: + - libnotify-bin_copyright + +slices: + bins: + essential: + - libc6_libs + - libglib2.0-0t64_libs + - libnotify4_libs + contents: + /usr/bin/notify-send: + + copyright: + contents: + /usr/share/doc/libnotify-bin/copyright: diff --git a/slices/libnotify4.yaml b/slices/libnotify4.yaml new file mode 100644 index 000000000..c3e9c8ea4 --- /dev/null +++ b/slices/libnotify4.yaml @@ -0,0 +1,17 @@ +package: libnotify4 + +essential: + - libnotify4_copyright + +slices: + libs: + essential: + - libc6_libs + - libgdk-pixbuf-2.0-0_libs + - libglib2.0-0t64_libs + contents: + /usr/lib/*-linux-*/libnotify.so.4*: + + copyright: + contents: + /usr/share/doc/libnotify4/copyright: diff --git a/slices/shared-mime-info.yaml b/slices/shared-mime-info.yaml new file mode 100644 index 000000000..94e103a97 --- /dev/null +++ b/slices/shared-mime-info.yaml @@ -0,0 +1,25 @@ +package: shared-mime-info + +essential: + - shared-mime-info_copyright + +slices: + bins: + essential: + - libc6_libs + - libgcc-s1_libs + - libglib2.0-0t64_core + - libstdc++6_libs + - libxml2_libs + contents: + /usr/bin/update-mime-database: + + data: + contents: + /usr/share/gettext/its/shared-mime-info.*: + /usr/share/mime/packages/freedesktop.org.xml: + /usr/share/pkgconfig/shared-mime-info.pc: + + copyright: + contents: + /usr/share/doc/shared-mime-info/copyright: diff --git a/tests/spread/integration/libgdk-pixbuf-2.0-0/task.yaml b/tests/spread/integration/libgdk-pixbuf-2.0-0/task.yaml new file mode 100644 index 000000000..2d788293d --- /dev/null +++ b/tests/spread/integration/libgdk-pixbuf-2.0-0/task.yaml @@ -0,0 +1,23 @@ +summary: Integration tests for libgdk-pixbuf-2.0-0 + +execute: | + if [[ $(uname -m) == "s390x" ]]; then + rootfs="$(install-slices dash_bins libgdk-pixbuf-2.0-0_bins)" + else + rootfs="$(install-slices dash_bins liblerc4_libs libgdk-pixbuf-2.0-0_bins)" + fi + + chroot "${rootfs}" sh -c '/usr/lib/*-linux-*/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders' > loaders + + grep -q "libpixbufloader-ani.so" loaders + grep -q "libpixbufloader-bmp.so" loaders + grep -q "libpixbufloader-gif.so" loaders + grep -q "libpixbufloader-icns.so" loaders + grep -q "libpixbufloader-ico.so" loaders + grep -q "libpixbufloader-pnm.so" loaders + grep -q "libpixbufloader-qtif.so" loaders + ! grep -q "libpixbufloader-svg.so" loaders # svg should not be installed + grep -q "libpixbufloader-tga.so" loaders + grep -q "libpixbufloader-tiff.so" loaders + grep -q "libpixbufloader-xbm.so" loaders + grep -q "libpixbufloader-xpm.so" loaders diff --git a/tests/spread/integration/libglib2.0-0t64/task.yaml b/tests/spread/integration/libglib2.0-0t64/task.yaml new file mode 100644 index 000000000..f1d9e961a --- /dev/null +++ b/tests/spread/integration/libglib2.0-0t64/task.yaml @@ -0,0 +1,12 @@ +summary: Integration tests for libglib2.0-0t64 + +execute: | + if [[ $(uname -m) == "arm32v7" ]]; then + rootfs="$(install-slices dash_bins libgcc-s1_libs libglib2.0-0t64_bins)" + else + rootfs="$(install-slices dash_bins libglib2.0-0t64_bins)" + fi + + chroot "${rootfs}" sh -c '/usr/lib/*-linux-*/glib-2.0/gio-querymodules' 2| grep -q 'Usage: gio-querymodules' + chroot "${rootfs}" sh -c '/usr/lib/*-linux-*/glib-2.0/glib-compile-schemas --version' | grep -q '2\.80\.0' + chroot "${rootfs}" sh -c '/usr/lib/*-linux-*/glib-2.0/gio-launch-desktop sh -c "echo Testing"' | grep -q Testing diff --git a/tests/spread/integration/libnotify-bin/task.yaml b/tests/spread/integration/libnotify-bin/task.yaml new file mode 100644 index 000000000..eb83be565 --- /dev/null +++ b/tests/spread/integration/libnotify-bin/task.yaml @@ -0,0 +1,17 @@ +summary: Integration tests for libnotify-bin + +execute: | + # liblerc4_libs required by libtiff6_libs on most architectures. + # See: https://github.com/canonical/chisel-releases/blob/ubuntu-24.04/slices/libtiff6.yaml + if [[ $(uname -m) == "s390x" ]] then + rootfs="$(install-slices libnotify-bin_bins)" + else + rootfs="$(install-slices liblerc4_libs libnotify-bin_bins)" + fi + + chroot "${rootfs}/" notify-send --help + + # Create a dbus UUID for the machine. The ID was generated on my machine with `dbus-uuidgen` + mkdir -p "${rootfs}/var/lib/dbus" + echo "09d781d32ff8502821328d1566c7a8a7" > "${rootfs}/var/lib/dbus/machine-id" + ! chroot "${rootfs}/" notify-send "This will fail." 2| grep -q 'Cannot autolaunch D-Bus without X11 $DISPLAY' diff --git a/tests/spread/integration/shared-mime-info/task.yaml b/tests/spread/integration/shared-mime-info/task.yaml new file mode 100644 index 000000000..82c716bb8 --- /dev/null +++ b/tests/spread/integration/shared-mime-info/task.yaml @@ -0,0 +1,7 @@ +summary: Integration tests for shared-mime-info + +execute: | + rootfs="$(install-slices shared-mime-info_bins shared-mime-info_data)" + + chroot "${rootfs}" update-mime-database -v |& grep -q 'update-mime-database (shared-mime-info) 2.4' + chroot "${rootfs}" update-mime-database /usr/share/mime From 799574776aa1ce3eaf17977d8c91768e1d10aaf6 Mon Sep 17 00:00:00 2001 From: zhijie-yang Date: Wed, 2 Oct 2024 16:45:59 +0200 Subject: [PATCH 10/24] feat(24.04): add perl (#291) --------- Co-authored-by: Anas Husseini Co-authored-by: Rafid Bin Mostofa Co-authored-by: Cristovao Cordeiro --- slices/libgdbm-compat4t64.yaml | 16 + slices/libgdbm6t64.yaml | 15 + slices/libperl5.38t64.yaml | 331 +++++++++++ slices/perl-base.yaml | 78 +++ slices/perl-modules-5.38.yaml | 522 ++++++++++++++++++ slices/perl.yaml | 89 +++ .../libperl5.38t64/prepare_test_imports.py | 52 ++ .../integration/libperl5.38t64/task.yaml | 14 + tests/spread/integration/perl-base/task.yaml | 7 + .../perl-modules-5.38/prepare_test_imports.py | 52 ++ .../integration/perl-modules-5.38/task.yaml | 14 + tests/spread/integration/perl/archive.zip | Bin 0 -> 172 bytes tests/spread/integration/perl/task.yaml | 44 ++ tests/spread/integration/perl/test.pod | 14 + 14 files changed, 1248 insertions(+) create mode 100644 slices/libgdbm-compat4t64.yaml create mode 100644 slices/libgdbm6t64.yaml create mode 100644 slices/libperl5.38t64.yaml create mode 100644 slices/perl-base.yaml create mode 100644 slices/perl-modules-5.38.yaml create mode 100644 slices/perl.yaml create mode 100644 tests/spread/integration/libperl5.38t64/prepare_test_imports.py create mode 100644 tests/spread/integration/libperl5.38t64/task.yaml create mode 100644 tests/spread/integration/perl-base/task.yaml create mode 100644 tests/spread/integration/perl-modules-5.38/prepare_test_imports.py create mode 100644 tests/spread/integration/perl-modules-5.38/task.yaml create mode 100644 tests/spread/integration/perl/archive.zip create mode 100644 tests/spread/integration/perl/task.yaml create mode 100644 tests/spread/integration/perl/test.pod diff --git a/slices/libgdbm-compat4t64.yaml b/slices/libgdbm-compat4t64.yaml new file mode 100644 index 000000000..7fb4465f6 --- /dev/null +++ b/slices/libgdbm-compat4t64.yaml @@ -0,0 +1,16 @@ +package: libgdbm-compat4t64 + +essential: + - libgdbm-compat4t64_copyright + +slices: + libs: + essential: + - libc6_libs + - libgdbm6t64_libs + contents: + /usr/lib/*-linux-*/libgdbm_compat.so.4*: + + copyright: + contents: + /usr/share/doc/libgdbm-compat4t64/copyright: diff --git a/slices/libgdbm6t64.yaml b/slices/libgdbm6t64.yaml new file mode 100644 index 000000000..01052ef22 --- /dev/null +++ b/slices/libgdbm6t64.yaml @@ -0,0 +1,15 @@ +package: libgdbm6t64 + +essential: + - libgdbm6t64_copyright + +slices: + libs: + essential: + - libc6_libs + contents: + /usr/lib/*-linux-*/libgdbm.so.6*: + + copyright: + contents: + /usr/share/doc/libgdbm6t64/copyright: diff --git a/slices/libperl5.38t64.yaml b/slices/libperl5.38t64.yaml new file mode 100644 index 000000000..6e18384ef --- /dev/null +++ b/slices/libperl5.38t64.yaml @@ -0,0 +1,331 @@ +package: libperl5.38t64 + +essential: + - libperl5.38t64_copyright + +slices: + bins: + essential: + - libc6_libs + - perl-modules-5.38_standard + contents: + /usr/bin/cpan5.38*-*-linux-*: + /usr/bin/perl5.38*-*-linux-*: + + core-libs: + contents: + /usr/lib/*-linux-*/libperl.so.5.38*: + /usr/lib/*-linux-*/perl/5.38: + + standard: + essential: + - libc6_libs + - libperl5.38t64_bits + - libperl5.38t64_compiler-utils + - libperl5.38t64_compress + - libperl5.38t64_config + - libperl5.38t64_core-routines + - libperl5.38t64_data-dumper + - libperl5.38t64_data-structures + - libperl5.38t64_databases + - libperl5.38t64_devel + - libperl5.38t64_digest + - libperl5.38t64_encodings + - libperl5.38t64_error-handling + - libperl5.38t64_file-handling + - libperl5.38t64_gnu + - libperl5.38t64_hashing + - libperl5.38t64_i18n + - libperl5.38t64_io-modules + - libperl5.38t64_linux + - libperl5.38t64_loaders + - libperl5.38t64_machine + - libperl5.38t64_math + - libperl5.38t64_module-utils + - libperl5.38t64_networking + - libperl5.38t64_std-headers + - libperl5.38t64_system-utils + - libperl5.38t64_text-processing + - libperl5.38t64_threading + - libperl5.38t64_time + - perl-modules-5.38_standard + + bits: + contents: + /usr/lib/*-linux-*/perl/5.38*/bits/**.ph: + + compiler-utils: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_compiler-utils + - perl-modules-5.38_core + contents: + # The Perl Compiler Backend + /usr/lib/*-linux-*/perl/5.38*/B.pm: + /usr/lib/*-linux-*/perl/5.38*/B/**.pm: + # Generic interface to Perl Compiler backends + /usr/lib/*-linux-*/perl/5.38*/O.pm: + # Disable named opcodes when compiling perl code + /usr/lib/*-linux-*/perl/5.38*/Opcode.pm: + /usr/lib/*-linux-*/perl/5.38*/_h2ph_pre.ph: + /usr/lib/*-linux-*/perl/5.38*/asm-generic/**.ph: + /usr/lib/*-linux-*/perl/5.38*/asm/**.ph: + # Perl pragma to restrict unsafe operations when compiling + /usr/lib/*-linux-*/perl/5.38*/ops.pm: + + compress: + essential: + - libbz2-1.0_libs + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + - zlib1g_libs + contents: + /usr/lib/*-linux-*/perl/5.38*/Compress/**.pm: + + config: + essential: + - libcrypt1_libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/Config.pm: + /usr/lib/*-linux-*/perl/5.38*/Config.pod: + /usr/lib/*-linux-*/perl/5.38*/Config_git.pl: + /usr/lib/*-linux-*/perl/5.38*/Config_heavy.pl: + /usr/lib/*-linux-*/perl/cross-config-5.38*/Config.pm: + /usr/lib/*-linux-*/perl/cross-config-5.38*/Config_heavy.pl: + /usr/lib/*-linux-*/perl/debian-config-data-5.38*/config.sh.debug.gz: + /usr/lib/*-linux-*/perl/debian-config-data-5.38*/config.sh.shared.gz: + /usr/lib/*-linux-*/perl/debian-config-data-5.38*/config.sh.static.gz: + + core-routines: + essential: + - libcrypt1_libs + contents: + /usr/lib/*-linux-*/perl/5.38*/CORE/**.h: + + data-dumper: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/Data/Dumper.pm: + + data-structures: + essential: + - libperl5.38t64_core-libs + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/List/**.pm: + /usr/lib/*-linux-*/perl/5.38*/Scalar/**.pm: + + databases: + essential: + - libdb5.3t64_libs + - libgdbm-compat4t64_libs + - libgdbm6t64_libs + - libperl5.38t64_core-libs + - perl-modules-5.38_core + - perl-modules-5.38_databases + contents: + /usr/lib/*-linux-*/perl/5.38*/DB_File.pm: + /usr/lib/*-linux-*/perl/5.38*/GDBM_File.pm: + /usr/lib/*-linux-*/perl/5.38*/NDBM_File.pm: + /usr/lib/*-linux-*/perl/5.38*/ODBM_File.pm: + /usr/lib/*-linux-*/perl/5.38*/SDBM_File.pm: + + devel: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + - perl-modules-5.38_devel + contents: + /usr/lib/*-linux-*/perl/5.38*/Devel/**.pm: + + digest: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + - perl-modules-5.38_digest + contents: + /usr/lib/*-linux-*/perl/5.38*/Digest/**.pm: + + encodings: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/Encode.pm: + /usr/lib/*-linux-*/perl/5.38*/Encode/**.pm: + /usr/lib/*-linux-*/perl/5.38*/encoding.pm: + /usr/lib/*-linux-*/perl/5.38*/endian.ph: + + error-handling: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/Errno.pm: + /usr/lib/*-linux-*/perl/5.38*/errno.ph: + + file-handling: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/Cwd.pm: + /usr/lib/*-linux-*/perl/5.38*/Fcntl.pm: + /usr/lib/*-linux-*/perl/5.38*/File/**.pm: + /usr/lib/*-linux-*/perl/5.38*/Storable.pm: + + filters: + essential: + - libc6_libs + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/Filter/**.pm: + + gnu: + contents: + /usr/lib/*-linux-*/perl/5.38*/gnu/**.ph: + + hashing: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/Hash/**.pm: + + io-modules: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/IO.pm: + /usr/lib/*-linux-*/perl/5.38*/IO/**.pm: + /usr/lib/*-linux-*/perl/5.38*/PerlIO/**.pm: + + linux: + contents: + /usr/lib/*-linux-*/perl/5.38*/linux/**.ph: + + loaders: + essential: + - libc6_libs + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/DynaLoader.pm: + /usr/lib/*-linux-*/perl/5.38*/auto/**.so: + + i18n: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/I18N/**.pm: + + machine: + essential: + - libperl5.38t64_core-libs + contents: + /usr/lib/*-linux-*/perl/5.38*/machine/: + + math: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/Math/**.pm: + + module-utils: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/Sub/**.pm: + /usr/lib/*-linux-*/perl/5.38*/attributes.pm: + /usr/lib/*-linux-*/perl/5.38*/features-time64.ph: + /usr/lib/*-linux-*/perl/5.38*/features.ph: + /usr/lib/*-linux-*/perl/5.38*/lib.pm: + /usr/lib/*-linux-*/perl/5.38*/mro.pm: + + networking: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/IPC/**.pm: + /usr/lib/*-linux-*/perl/5.38*/Socket.pm: + + std-headers: + contents: + /usr/lib/*-linux-*/perl/5.38*/signal.ph: + /usr/lib/*-linux-*/perl/5.38*/stdarg.ph: + /usr/lib/*-linux-*/perl/5.38*/stdc-predef.ph: + /usr/lib/*-linux-*/perl/5.38*/stddef.ph: + /usr/lib/*-linux-*/perl/5.38*/unistd.ph: + /usr/lib/*-linux-*/perl/5.38*/wait.ph: + + system-utils: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/POSIX.pm: + /usr/lib/*-linux-*/perl/5.38*/POSIX.pod: + /usr/lib/*-linux-*/perl/5.38*/Sys/**.pm: + /usr/lib/*-linux-*/perl/5.38*/sys/**.ph: + /usr/lib/*-linux-*/perl/5.38*/syscall.ph: + /usr/lib/*-linux-*/perl/5.38*/sysexits.ph: + /usr/lib/*-linux-*/perl/5.38*/syslimits.ph: + /usr/lib/*-linux-*/perl/5.38*/syslog.ph: + + text-processing: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/MIME/**.pm: + /usr/lib/*-linux-*/perl/5.38*/Unicode/**.pm: + /usr/lib/*-linux-*/perl/5.38*/re.pm: + + threading: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/threads.pm: + /usr/lib/*-linux-*/perl/5.38*/threads/**.pm: + + time: + essential: + - libperl5.38t64_core-libs + - perl-base_modules + - perl-modules-5.38_core + contents: + /usr/lib/*-linux-*/perl/5.38*/Time/**.pm: + + copyright: + contents: + /usr/share/doc/libperl5.38t64/copyright: diff --git a/slices/perl-base.yaml b/slices/perl-base.yaml new file mode 100644 index 000000000..d58211e91 --- /dev/null +++ b/slices/perl-base.yaml @@ -0,0 +1,78 @@ +package: perl-base + +essential: + - perl-base_copyright + +slices: + bins: + essential: + - libc6_libs + # perl binary requires libcrypt.so.1 upon loading + - libcrypt1_libs + contents: + # hard link + /usr/bin/perl: + /usr/bin/perl5.38.2: {copy: /usr/bin/perl} + + modules: + essential: + - libc6_libs + - libcrypt1_libs + contents: + /usr/lib/*-linux-*/perl-base/AutoLoader.pm: + /usr/lib/*-linux-*/perl-base/Carp.pm: + /usr/lib/*-linux-*/perl-base/Carp/**.pm: + /usr/lib/*-linux-*/perl-base/Config.pm: + /usr/lib/*-linux-*/perl-base/Config_git.pl: + /usr/lib/*-linux-*/perl-base/Config_heavy.pl: + /usr/lib/*-linux-*/perl-base/Cwd.pm: + /usr/lib/*-linux-*/perl-base/DynaLoader.pm: + /usr/lib/*-linux-*/perl-base/Errno.pm: + /usr/lib/*-linux-*/perl-base/Exporter.pm: + /usr/lib/*-linux-*/perl-base/Exporter/**.pm: + /usr/lib/*-linux-*/perl-base/Fcntl.pm: + /usr/lib/*-linux-*/perl-base/File/**.pm: + /usr/lib/*-linux-*/perl-base/FileHandle.pm: + /usr/lib/*-linux-*/perl-base/Getopt/**.pm: + /usr/lib/*-linux-*/perl-base/Hash/**.pm: + /usr/lib/*-linux-*/perl-base/IO.pm: + /usr/lib/*-linux-*/perl-base/IO/**.pm: + /usr/lib/*-linux-*/perl-base/IPC/**.pm: + /usr/lib/*-linux-*/perl-base/List/**.pm: + /usr/lib/*-linux-*/perl-base/POSIX.pm: + /usr/lib/*-linux-*/perl-base/Scalar/**.pm: + /usr/lib/*-linux-*/perl-base/SelectSaver.pm: + /usr/lib/*-linux-*/perl-base/Socket.pm: + /usr/lib/*-linux-*/perl-base/Symbol.pm: + /usr/lib/*-linux-*/perl-base/Text/**.pm: + /usr/lib/*-linux-*/perl-base/Tie/**.pm: + /usr/lib/*-linux-*/perl-base/XSLoader.pm: + /usr/lib/*-linux-*/perl-base/attributes.pm: + /usr/lib/*-linux-*/perl-base/auto/**.so: + /usr/lib/*-linux-*/perl-base/base.pm: + /usr/lib/*-linux-*/perl-base/builtin.pm: + /usr/lib/*-linux-*/perl-base/bytes.pm: + /usr/lib/*-linux-*/perl-base/bytes_heavy.pl: + /usr/lib/*-linux-*/perl-base/constant.pm: + /usr/lib/*-linux-*/perl-base/feature.pm: + /usr/lib/*-linux-*/perl-base/fields.pm: + /usr/lib/*-linux-*/perl-base/integer.pm: + /usr/lib/*-linux-*/perl-base/lib.pm: + /usr/lib/*-linux-*/perl-base/locale.pm: + /usr/lib/*-linux-*/perl-base/overload.pm: + /usr/lib/*-linux-*/perl-base/overloading.pm: + /usr/lib/*-linux-*/perl-base/parent.pm: + /usr/lib/*-linux-*/perl-base/re.pm: + /usr/lib/*-linux-*/perl-base/strict.pm: + /usr/lib/*-linux-*/perl-base/utf8.pm: + /usr/lib/*-linux-*/perl-base/vars.pm: + /usr/lib/*-linux-*/perl-base/warnings.pm: + /usr/lib/*-linux-*/perl-base/warnings/**.pm: + + unicore: + contents: + /usr/lib/*-linux-*/perl-base/unicore/**.pl: + + copyright: + contents: + /usr/share/doc/perl-base/copyright: diff --git a/slices/perl-modules-5.38.yaml b/slices/perl-modules-5.38.yaml new file mode 100644 index 000000000..d952e9b27 --- /dev/null +++ b/slices/perl-modules-5.38.yaml @@ -0,0 +1,522 @@ +package: perl-modules-5.38 + +essential: + - perl-modules-5.38_copyright + +slices: + # The _core slice contains the perl modules that are tightly + # dependent upon each other. Splitting them into separate slices + # would cause cyclic dependencies. + core: + essential: + - perl-base_modules + contents: + /usr/share/perl/5.38: + /usr/share/perl/5.38*/AutoLoader.pm: + /usr/share/perl/5.38*/AutoSplit.pm: + /usr/share/perl/5.38*/Carp.pm: + /usr/share/perl/5.38*/Carp/**.pm: + /usr/share/perl/5.38*/Class/**.pm: + /usr/share/perl/5.38*/Compress/**.pm: + /usr/share/perl/5.38*/DirHandle.pm: + /usr/share/perl/5.38*/Exporter.pm: + /usr/share/perl/5.38*/Exporter/**.pm: + /usr/share/perl/5.38*/Fatal.pm: + /usr/share/perl/5.38*/File/**.pm: + /usr/share/perl/5.38*/FileCache.pm: + /usr/share/perl/5.38*/FileHandle.pm: + /usr/share/perl/5.38*/FindBin.pm: + /usr/share/perl/5.38*/I18N/**.pm: + /usr/share/perl/5.38*/IO/**.pm: + /usr/share/perl/5.38*/IO/**.pod: + /usr/share/perl/5.38*/IPC/**.pm: + /usr/share/perl/5.38*/Locale/Maketext.pm: + /usr/share/perl/5.38*/Locale/Maketext.pod: + /usr/share/perl/5.38*/Locale/Maketext/**.pm: + /usr/share/perl/5.38*/Locale/Maketext/**.pod: + /usr/share/perl/5.38*/SelectSaver.pm: + /usr/share/perl/5.38*/SelfLoader.pm: + /usr/share/perl/5.38*/Symbol.pm: + /usr/share/perl/5.38*/Text/**.pm: + /usr/share/perl/5.38*/Tie/**.pm: + /usr/share/perl/5.38*/XSLoader.pm: + /usr/share/perl/5.38*/_charnames.pm: + /usr/share/perl/5.38*/base.pm: + /usr/share/perl/5.38*/builtin.pm: + /usr/share/perl/5.38*/bytes.pm: + /usr/share/perl/5.38*/bytes_heavy.pl: + /usr/share/perl/5.38*/charnames.pm: + /usr/share/perl/5.38*/constant.pm: + /usr/share/perl/5.38*/deprecate.pm: + /usr/share/perl/5.38*/experimental.pm: + /usr/share/perl/5.38*/feature.pm: + /usr/share/perl/5.38*/fields.pm: + /usr/share/perl/5.38*/filetest.pm: + /usr/share/perl/5.38*/if.pm: + /usr/share/perl/5.38*/integer.pm: + /usr/share/perl/5.38*/locale.pm: + /usr/share/perl/5.38*/overload.pm: + /usr/share/perl/5.38*/overload/**.pm: + /usr/share/perl/5.38*/overloading.pm: + /usr/share/perl/5.38*/parent.pm: + /usr/share/perl/5.38*/stable.pm: + /usr/share/perl/5.38*/strict.pm: + /usr/share/perl/5.38*/utf8.pm: + /usr/share/perl/5.38*/vars.pm: + /usr/share/perl/5.38*/warnings.pm: + /usr/share/perl/5.38*/warnings/register.pm: + + standard: + essential: + - perl-base_modules + - perl-modules-5.38_app-cpan + - perl-modules-5.38_app-prove + - perl-modules-5.38_archive + - perl-modules-5.38_attribute + - perl-modules-5.38_autodie + - perl-modules-5.38_autouse + - perl-modules-5.38_benchmark + - perl-modules-5.38_bigmath + - perl-modules-5.38_blib + - perl-modules-5.38_compiler-utils + - perl-modules-5.38_config + - perl-modules-5.38_core-routines + - perl-modules-5.38_cpan + - perl-modules-5.38_databases + - perl-modules-5.38_debug + - perl-modules-5.38_devel + - perl-modules-5.38_diagnostics + - perl-modules-5.38_digest + - perl-modules-5.38_dumps + - perl-modules-5.38_encodings + - perl-modules-5.38_english + - perl-modules-5.38_exutils + - perl-modules-5.38_filters + - perl-modules-5.38_internals + - perl-modules-5.38_json-pp + - perl-modules-5.38_less + - perl-modules-5.38_math + - perl-modules-5.38_memoize + - perl-modules-5.38_misc + - perl-modules-5.38_module + - perl-modules-5.38_networking + - perl-modules-5.38_next + - perl-modules-5.38_params + - perl-modules-5.38_perl-ostype + - perl-modules-5.38_perlio + - perl-modules-5.38_pod + - perl-modules-5.38_safe + - perl-modules-5.38_search + - perl-modules-5.38_sort + - perl-modules-5.38_subs + - perl-modules-5.38_system-utils + - perl-modules-5.38_tap + - perl-modules-5.38_term + - perl-modules-5.38_thread + - perl-modules-5.38_time + - perl-modules-5.38_unicode + - perl-modules-5.38_unicore + - perl-modules-5.38_universal + - perl-modules-5.38_user + - perl-modules-5.38_version + - perl-modules-5.38_vmsish + + app-prove: + essential: + - perl-modules-5.38_core + - perl-modules-5.38_system-utils + contents: + /usr/share/perl/5.38*/App/Prove.pm: + /usr/share/perl/5.38*/App/Prove/**.pm: + + app-cpan: + essential: + - perl-modules-5.38_core + - perl-modules-5.38_digest + - perl-modules-5.38_encodings + - perl-modules-5.38_networking + - perl-modules-5.38_time + contents: + /usr/share/perl/5.38*/App/Cpan.pm: + + archive: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Archive/**.pm: + + attribute: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Attribute/**.pm: + + autodie: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/autodie.pm: + /usr/share/perl/5.38*/autodie/Scope/**.pm: + /usr/share/perl/5.38*/autodie/Util.pm: + /usr/share/perl/5.38*/autodie/exception.pm: + /usr/share/perl/5.38*/autodie/exception/**.pm: + /usr/share/perl/5.38*/autodie/hints.pm: + /usr/share/perl/5.38*/autodie/skip.pm: + + autouse: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/autouse.pm: + + benchmark: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Benchmark.pm: + + bigmath: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/bigfloat.pm: + /usr/share/perl/5.38*/bigint.pm: + /usr/share/perl/5.38*/bignum.pm: + /usr/share/perl/5.38*/bigrat.pm: + + blib: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/blib.pm: + + compiler-utils: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/B/**.pm: + + config: + essential: + - perl-modules-5.38_core + - perl-modules-5.38_digest + contents: + /usr/share/perl/5.38*/Config/**.pm: + + # CORE - Namespace for Perl's core routines + # https://perldoc.perl.org/CORE + core-routines: + essential: + - perl-base_modules + contents: + /usr/share/perl/5.38*/CORE.pod: + + # CPAN - query, download and build perl modules from CPAN sites + # https://perldoc.perl.org/CPAN + cpan: + essential: + - perl-modules-5.38_core + - perl-modules-5.38_digest + - perl-modules-5.38_encodings + - perl-modules-5.38_networking + - perl-modules-5.38_time + contents: + /usr/share/perl/5.38*/CPAN.pm: + /usr/share/perl/5.38*/CPAN/**: + /usr/share/perl/5.38*/Parse/CPAN/Meta.pm: + + databases: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/AnyDBM_File.pm: + /usr/share/perl/5.38*/DBM_Filter.pm: + /usr/share/perl/5.38*/DBM_Filter/**.pm: + + debug: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/DB.pm: + + devel: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Devel/**.pm: + + diagnostics: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/diagnostics.pm: + + digest: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Digest.pm: + /usr/share/perl/5.38*/Digest/**.pm: + + dumps: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Dumpvalue.pm: + /usr/share/perl/5.38*/dumpvar.pl: + + encodings: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Encode/**: + /usr/share/perl/5.38*/encoding/warnings.pm: + + english: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/English.pm: + + exutils: + essential: + - perl-modules-5.38_core + - perl-modules-5.38_system-utils + contents: + /usr/share/perl/5.38*/ExtUtils/**.pm: + /usr/share/perl/5.38*/ExtUtils/**.pod: + /usr/share/perl/5.38*/ExtUtils/MANIFEST.SKIP: + /usr/share/perl/5.38*/ExtUtils/typemap: + /usr/share/perl/5.38*/ExtUtils/xsubpp: + + filters: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Filter/**.pm: + + # Internals - Reserved special namespace for internals related functions + # https://perldoc.perl.org/Internals + internals: + essential: + - perl-base_modules + contents: + /usr/share/perl/5.38*/Internals.pod: + + json-pp: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/JSON/PP.pm: + /usr/share/perl/5.38*/JSON/PP/**.pm: + + less: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/less.pm: + + math: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Math/**.pm: + + memoize: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Memoize.pm: + /usr/share/perl/5.38*/Memoize/**.pm: + + misc: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/meta_notation.pm: + /usr/share/perl/5.38*/perl5db.pl: + /usr/share/perl/5.38*/perlfaq.pm: + /usr/share/perl/5.38*/pod/perldiag.pod: + + module: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Module/**.pm: + /usr/share/perl/5.38*/Module/**.pod: + + networking: + essential: + - perl-modules-5.38_core + - perl-modules-5.38_digest + - perl-modules-5.38_encodings + - perl-modules-5.38_time + contents: + /usr/share/perl/5.38*/HTTP/**.pm: + /usr/share/perl/5.38*/Net/**.pm: + /usr/share/perl/5.38*/Net/**.pod: + + next: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/NEXT.pm: + + params: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Params/Check.pm: + + perl-ostype: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Perl/OSType.pm: + + perlio: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/PerlIO.pm: + /usr/share/perl/5.38*/PerlIO/**.pm: + /usr/share/perl/5.38*/open.pm: + + pod: + essential: + - perl-modules-5.38_core + - perl-modules-5.38_digest + - perl-modules-5.38_encodings + - perl-modules-5.38_networking + - perl-modules-5.38_system-utils + - perl-modules-5.38_time + contents: + /usr/share/perl/5.38*/Pod/**.pm: + /usr/share/perl/5.38*/Pod/**.pod: + + safe: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Safe.pm: + + search: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Search/**.pm: + + sort: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/sort.pm: + + subs: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/subs.pm: + + system-utils: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Env.pm: + /usr/share/perl/5.38*/Getopt/**.pm: + /usr/share/perl/5.38*/sigtrap.pm: + + tap: + essential: + - perl-modules-5.38_core + - perl-modules-5.38_test2 + contents: + /usr/share/perl/5.38*/TAP/**.pm: + /usr/share/perl/5.38*/TAP/**.pod: + + term: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Term/**.pm: + + test: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Test.pm: + /usr/share/perl/5.38*/Test/**.pm: + /usr/share/perl/5.38*/Test/**.pod: + /usr/share/perl/5.38*/ok.pm: + + test2: + essential: + - perl-modules-5.38_core + - perl-modules-5.38_term + contents: + /usr/share/perl/5.38*/Test2.pm: + /usr/share/perl/5.38*/Test2/**.pm: + /usr/share/perl/5.38*/Test2/**.pod: + + thread: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Thread.pm: + /usr/share/perl/5.38*/Thread/**.pm: + + time: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/Time/**.pm: + + unicode: + essential: + - perl-modules-5.38_core + - perl-modules-5.38_test + - perl-modules-5.38_test2 + contents: + /usr/share/perl/5.38*/Unicode/**.pl: + /usr/share/perl/5.38*/Unicode/**.pm: + /usr/share/perl/5.38*/Unicode/**.txt: + + unicore: + essential: + - perl-modules-5.38_core + - perl-modules-5.38_test + - perl-modules-5.38_test2 + contents: + /usr/share/perl/5.38*/unicore/**: + + universal: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/UNIVERSAL.pm: + + user: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/User/**.pm: + + version: + essential: + - perl-modules-5.38_core + contents: + /usr/share/perl/5.38*/version.pm: + /usr/share/perl/5.38*/version.pod: + /usr/share/perl/5.38*/version/Internals.pod: + /usr/share/perl/5.38*/version/regex.pm: + + # vmsish - Control VMS-specific language features + vmsish: + essential: + - perl-base_modules + contents: + /usr/share/perl/5.38*/vmsish.pm: + + copyright: + contents: + /usr/share/doc/perl-modules-5.38/copyright: diff --git a/slices/perl.yaml b/slices/perl.yaml new file mode 100644 index 000000000..ea150affb --- /dev/null +++ b/slices/perl.yaml @@ -0,0 +1,89 @@ +package: perl + +essential: + - perl_copyright + +slices: + bins: + essential: + - perl_encodings + - perl_misc + - perl_pod + - perl_ptar + - perl_utils + - perl_zip + + encodings: + essential: + - libperl5.38t64_standard + - perl-base_bins + contents: + /usr/bin/enc2xs: + /usr/bin/encguess: + /usr/bin/json_pp: + /usr/bin/piconv: + + ptar: + essential: + - libperl5.38t64_standard + - perl-base_bins + contents: + /usr/bin/ptar: + /usr/bin/ptardiff: + /usr/bin/ptargrep: + + pod: + essential: + - libperl5.38t64_standard + - perl-base_bins + contents: + /usr/bin/pod2html: + /usr/bin/pod2man: + /usr/bin/pod2text: + /usr/bin/pod2usage: + /usr/bin/podchecker: + + zip: + essential: + - libperl5.38t64_standard + - perl-base_bins + contents: + /usr/bin/streamzip: + /usr/bin/zipdetails: + + utils: + essential: + - libperl5.38t64_standard + - perl-base_bins + contents: + /usr/bin/h2ph: + /usr/bin/h2xs: + /usr/bin/instmodsh: + /usr/bin/perlbug: + /usr/bin/perldoc: + /usr/bin/perlivp: + # hard link + /usr/bin/perlthanks: {copy: /usr/bin/perlbug} + /usr/bin/pl2pm: + /usr/bin/splain: + /usr/bin/xsubpp: + + misc: + essential: + - libperl5.38t64_standard + - perl-base_bins + - perl_config + contents: + /usr/bin/corelist: + /usr/bin/cpan: + /usr/bin/libnetcfg: + /usr/bin/prove: + /usr/bin/shasum: + + config: + contents: + /etc/perl/Net/libnet.cfg: + + copyright: + contents: + /usr/share/doc/perl/copyright: diff --git a/tests/spread/integration/libperl5.38t64/prepare_test_imports.py b/tests/spread/integration/libperl5.38t64/prepare_test_imports.py new file mode 100644 index 000000000..6a81f9912 --- /dev/null +++ b/tests/spread/integration/libperl5.38t64/prepare_test_imports.py @@ -0,0 +1,52 @@ +import glob +import os +import subprocess + +import yaml + +NO_IMPORT = {"feature"} +PROJECT_PATH = os.environ.get("PROJECT_PATH", os.getcwd()) + +slice_def = yaml.safe_load( + open(os.path.join(PROJECT_PATH, "slices/libperl5.38t64.yaml"), encoding="utf-8") +) + +slices = slice_def.get("slices", []) + +for slice_name, chisel_slice in slices.items(): + slice_deps = set() + for filename in chisel_slice.get("contents", {}): + if filename.endswith(".pm"): + globbing = glob.glob(filename) + for perl_module in globbing: + proc = subprocess.run( + ["scandeps", "--no-recurse", perl_module], + capture_output=True, + text=True, + check=True, + ) + if proc.returncode != 0: + raise RuntimeError( + "Failed to inspect module dependencies for {}".format( + perl_module + ) + ) + slice_deps.update( + { + line.split("=>")[0].strip(" '") + for line in proc.stdout.splitlines() + } + ) + if len(slice_deps) == 0: + continue + + test_dir = os.path.join( + PROJECT_PATH, "tests/spread/integration/libperl5.38t64/cases" + ) + os.makedirs(test_dir, exist_ok=True) + filepath = os.path.join(test_dir, "{}.pm".format(slice_name)) + with open(filepath, "w", encoding="utf-8") as f: + for item in slice_deps: + if item in NO_IMPORT: + continue + f.write("use %s;\n" % item) diff --git a/tests/spread/integration/libperl5.38t64/task.yaml b/tests/spread/integration/libperl5.38t64/task.yaml new file mode 100644 index 000000000..66eb9196a --- /dev/null +++ b/tests/spread/integration/libperl5.38t64/task.yaml @@ -0,0 +1,14 @@ +summary: The integration test of the libperl5.38t64 package slices + +execute: | + apt update + apt install libmodule-scandeps-perl -y + python3 prepare_test_imports.py + + for slice in $(ls cases); do + slice_name=$(echo $slice | cut -d'.' -f1) + rootfs=$(install-slices libperl5.38t64_$slice_name base-files_base perl-base_bins) + cp cases/$slice $rootfs/ + chroot $rootfs /usr/bin/perl $slice + done + diff --git a/tests/spread/integration/perl-base/task.yaml b/tests/spread/integration/perl-base/task.yaml new file mode 100644 index 000000000..ef2886da0 --- /dev/null +++ b/tests/spread/integration/perl-base/task.yaml @@ -0,0 +1,7 @@ +summary: Integration tests for perl-base + +execute: | + rootfs=$(install-slices base-files_base bash_bins coreutils_bins perl-base_bins) + mkdir -p "$rootfs/dev" + mount --bind /dev "$rootfs/dev" + chroot "$rootfs" perl -e 'print "hello world\n";' | grep "hello world" diff --git a/tests/spread/integration/perl-modules-5.38/prepare_test_imports.py b/tests/spread/integration/perl-modules-5.38/prepare_test_imports.py new file mode 100644 index 000000000..c5489cb6f --- /dev/null +++ b/tests/spread/integration/perl-modules-5.38/prepare_test_imports.py @@ -0,0 +1,52 @@ +import glob +import os +import subprocess + +import yaml + +NO_IMPORT = {"feature"} +PROJECT_PATH = os.environ.get("PROJECT_PATH", os.getcwd()) + +slice_def = yaml.safe_load( + open(os.path.join(PROJECT_PATH, "slices/perl-modules-5.38.yaml"), encoding="utf-8") +) + +slices = slice_def.get("slices", []) + +for slice_name, chisel_slice in slices.items(): + slice_deps = set() + for filename in chisel_slice.get("contents", {}): + if filename.endswith(".pm"): + globbing = glob.glob(filename) + for perl_module in globbing: + proc = subprocess.run( + ["scandeps", "--no-recurse", perl_module], + capture_output=True, + text=True, + check=True, + ) + if proc.returncode != 0: + raise RuntimeError( + "Failed to inspect module dependencies for {}".format( + perl_module + ) + ) + slice_deps.update( + { + line.split("=>")[0].strip(" '") + for line in proc.stdout.splitlines() + } + ) + if len(slice_deps) == 0: + continue + + test_dir = os.path.join( + PROJECT_PATH, "tests/spread/integration/perl-modules-5.38/cases" + ) + os.makedirs(test_dir, exist_ok=True) + filepath = os.path.join(test_dir, "{}.pm".format(slice_name)) + with open(filepath, "w", encoding="utf-8") as f: + for item in slice_deps: + if item in NO_IMPORT: + continue + f.write("use %s;\n" % item) diff --git a/tests/spread/integration/perl-modules-5.38/task.yaml b/tests/spread/integration/perl-modules-5.38/task.yaml new file mode 100644 index 000000000..e9dab4d19 --- /dev/null +++ b/tests/spread/integration/perl-modules-5.38/task.yaml @@ -0,0 +1,14 @@ +summary: The integration test of the perl-modules-5.38 package slices + +execute: | + apt update + apt install libmodule-scandeps-perl -y + python3 prepare_test_imports.py + + for slice in $(ls cases); do + slice_name=$(echo $slice | cut -d'.' -f1) + rootfs=$(install-slices perl-modules-5.38_$slice_name base-files_base perl-base_bins) + cp cases/$slice $rootfs/ + chroot $rootfs /usr/bin/perl $slice + done + diff --git a/tests/spread/integration/perl/archive.zip b/tests/spread/integration/perl/archive.zip new file mode 100644 index 0000000000000000000000000000000000000000..534488c6a360fbe3a85d60823bc4b1604595757f GIT binary patch literal 172 zcmWIWW@h1H0D&nD;*pmXKV`81*&xixAj6QBnUiX$S5i?D8p6rI{C(Pqv|m76TEWf0 z$nt_2s18IJ8X9s1cr!A|G2=2w0%Se|BM@(C1hJ5eWrY}vW@LajD;r25BM|xnX?GBZ F0RYxFB8vb3 literal 0 HcmV?d00001 diff --git a/tests/spread/integration/perl/task.yaml b/tests/spread/integration/perl/task.yaml new file mode 100644 index 000000000..64bf698b9 --- /dev/null +++ b/tests/spread/integration/perl/task.yaml @@ -0,0 +1,44 @@ +summary: Integration tests for bins in perl + +execute: | + set -ex + # Test 1: ptar + rootfs=$(install-slices perl_ptar) + touch "$rootfs/file1.txt" + tar -cf "$rootfs/archive.tar" "$rootfs/file1.txt" + + out=$(chroot "$rootfs" /usr/bin/ptar -tvf archive.tar 2>null) + test "/$out" = "$rootfs/file1.txt" + + # Test 2: pod + rootfs=$(install-slices perl_pod coreutils_bins) + in=$(cat "test.pod") + cp test.pod "$rootfs/" + chroot "$rootfs" /usr/bin/pod2html --infile=/test.pod --outfile=test.html 2>null + test -f "$rootfs/test.html" + chroot "$rootfs" /usr/bin/pod2man /test.pod 2>null + chroot "$rootfs" /usr/bin/pod2text /test.pod 2>null + chroot "$rootfs" /usr/bin/podchecker /test.pod 2>null + + # Test 3: zip + rootfs=$(install-slices perl_zip) + cp archive.zip "$rootfs/" + chroot "$rootfs" /usr/bin/zipdetails "archive.zip" 2>null + + # Test 4: encodings + rootfs=$(install-slices perl_encodings) + in='锟斤拷' + tmp=$(chroot "$rootfs" /usr/bin/piconv -f utf-8 -t gbk -s $in 2>null) + out=$(chroot "$rootfs" /usr/bin/piconv -f gbk -t utf-8 -s $tmp 2>null) + test "$out" = "$in" + + # Test 5: misc + rootfs=$(install-slices perl_misc) + out=$(chroot "$rootfs" /usr/bin/corelist -d 2024-07-26 2>null) + test "$out" = """ + Data for 2023-11-29 + 2024-07-26 was first released with perl v5.19.5""" + + echo "1234" > "$rootfs/file1.txt" + out=$(chroot "$rootfs" /usr/bin/shasum file1.txt 2>null) + test "$out" = "1be168ff837f043bde17c0314341c84271047b31 file1.txt" diff --git a/tests/spread/integration/perl/test.pod b/tests/spread/integration/perl/test.pod new file mode 100644 index 000000000..b4153e788 --- /dev/null +++ b/tests/spread/integration/perl/test.pod @@ -0,0 +1,14 @@ +=pod + +=head1 NAME + +test_pod - test pod + +=head1 SYNOPSIS + +test_pod [options] + + Options: + --help Show this usage message + +=cut From 321146328b912f49e27e1a06e47b1125c679839e Mon Sep 17 00:00:00 2001 From: Adrian Clay Lake Date: Thu, 3 Oct 2024 09:50:13 +0200 Subject: [PATCH 11/24] feat: xz utils changes (#338) --------- Co-authored-by: Enderson Maia Co-authored-by: Rafid Bin Mostofa Co-authored-by: Cristovao Cordeiro --- slices/coreutils.yaml | 19 ++++++++-- slices/xz-utils.yaml | 35 ++++++++++++++++++ tests/spread/integration/coreutils/task.yaml | 11 ++++++ tests/spread/integration/xz-utils/task.yaml | 38 ++++++++++++++++++++ 4 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 slices/xz-utils.yaml create mode 100644 tests/spread/integration/coreutils/task.yaml create mode 100644 tests/spread/integration/xz-utils/task.yaml diff --git a/slices/coreutils.yaml b/slices/coreutils.yaml index d693039f2..38b819b98 100644 --- a/slices/coreutils.yaml +++ b/slices/coreutils.yaml @@ -12,7 +12,9 @@ slices: bins: essential: + - coreutils_expr - coreutils_libs + - coreutils_mkdir - libacl1_libs - libattr1_libs - libc6_libs @@ -49,7 +51,6 @@ slices: /usr/bin/echo: /usr/bin/env: /usr/bin/expand: - /usr/bin/expr: /usr/bin/factor: /usr/bin/false: /usr/bin/fmt: @@ -66,7 +67,6 @@ slices: /usr/bin/ls: /usr/bin/md5sum: /usr/bin/md5sum.textutils: - /usr/bin/mkdir: /usr/bin/mkfifo: /usr/bin/mknod: /usr/bin/mktemp: @@ -129,6 +129,21 @@ slices: /usr/bin/yes: /usr/sbin/chroot: + expr: + essential: + - libc6_libs + - libgmp10_libs + contents: + /usr/bin/expr: + + mkdir: + essential: + - libc6_libs + - libpcre2-8-0_libs + - libselinux1_libs + contents: + /usr/bin/mkdir: + copyright: contents: /usr/share/doc/coreutils/copyright: diff --git a/slices/xz-utils.yaml b/slices/xz-utils.yaml new file mode 100644 index 000000000..83f53dc02 --- /dev/null +++ b/slices/xz-utils.yaml @@ -0,0 +1,35 @@ +package: xz-utils + +essential: + - xz-utils_copyright + +slices: + bins: + essential: + - libc6_libs + - liblzma5_libs + contents: + /usr/bin/lzmainfo: + /usr/bin/unxz: + /usr/bin/xz: + /usr/bin/xzcat: + scripts: # scripts which add xz compression to common utils + essential: + # shebang in scripts reference interpreter in /bin not /usr/bin + - base-files_bin + - base-files_tmp # utils require temporary storage + - coreutils_expr # used by xzcmp and xzdiff + - coreutils_mkdir # used by xzcmp and xzdiff + - diffutils_bins # used by xzcmp and xzdiff + - grep_bins # needed for xz grep utils + - xz-utils_bins + contents: + /usr/bin/xzcmp: + /usr/bin/xzdiff: + /usr/bin/xzegrep: + /usr/bin/xzfgrep: + /usr/bin/xzgrep: + + copyright: + contents: + /usr/share/doc/xz-utils/copyright: diff --git a/tests/spread/integration/coreutils/task.yaml b/tests/spread/integration/coreutils/task.yaml new file mode 100644 index 000000000..7b1641393 --- /dev/null +++ b/tests/spread/integration/coreutils/task.yaml @@ -0,0 +1,11 @@ +summary: Integration tests for coreutils + +execute: | + # test expr binary + rootfs_expr="$(install-slices coreutils_expr)" + chroot "$rootfs_expr" expr --version + + # test mkdir binary + rootfs_mkdir="$(install-slices coreutils_mkdir)" + chroot "$rootfs_mkdir" mkdir test_dir + test -d "$rootfs_mkdir/test_dir" diff --git a/tests/spread/integration/xz-utils/task.yaml b/tests/spread/integration/xz-utils/task.yaml new file mode 100644 index 000000000..587247609 --- /dev/null +++ b/tests/spread/integration/xz-utils/task.yaml @@ -0,0 +1,38 @@ +summary: Integration tests for xz-utils + +execute: | + rootfs="$(install-slices xz-utils_bins xz-utils_scripts dash_bins)" + + # make artificial /dev/null for testing + mkdir "$rootfs/dev" + touch "$rootfs/dev/null" + + # smoke test + chroot "$rootfs" xz --version + + # test compression + echo "compressed content" > uncompressed.txt + cp uncompressed.txt "${rootfs}/" + chroot "$rootfs" xz -z uncompressed.txt + + # test xzgrep + chroot "$rootfs" xzgrep "$(cat uncompressed.txt)" uncompressed.txt.xz + + # test xzdiff + echo "one" > FILE1 + echo "two" > FILE2 + cp FILE1 FILE2 "${rootfs}/" + chroot "$rootfs" xz -zk FILE1 + chroot "$rootfs" xz -zk FILE2 + chroot "$rootfs" xzdiff FILE1.xz FILE2.xz > xzdiff_result || true + chroot "$rootfs" diff FILE1 FILE2 > diff_result || true + cmp xzdiff_result diff_result + + # test xzcat + chroot "$rootfs" xzcat FILE1.xz > xzcat_result + cmp xzcat_result FILE1 + + # test xzcmp + chroot "$rootfs" xzcmp -b FILE1.xz FILE2.xz | cut -d: -f2 > xzcmp_result + chroot "$rootfs" cmp -b FILE1 FILE2 | cut -d: -f2 > cmp_result + cmp xzcmp_result cmp_result From 84ac1d8fe0c42931d92d4ba17301351751f6123e Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Tue, 8 Oct 2024 00:55:00 +1300 Subject: [PATCH 12/24] feat(24.04): openjdk-21-jdk-headless slice (#313) --- slices/openjdk-21-jdk-headless.yaml | 160 +++++++++++++++ slices/openjdk-21-jre-headless.yaml | 183 ++++++++++++++++++ .../openjdk-21-jdk-headless/Main.java | 5 + .../MonitoringTest.java | 7 + .../SerializableObject.java | 4 + .../openjdk-21-jdk-headless/task.yaml | 125 ++++++++++++ .../openjdk-21-jre-headless/ConsoleTest.java | 11 ++ .../openjdk-21-jre-headless/Main.java | 5 + .../openjdk-21-jre-headless/PrefsTest.java | 13 ++ .../ReadCertificate.java | 35 ++++ .../openjdk-21-jre-headless/TestJMX.java | 42 ++++ .../openjdk-21-jre-headless/TestJMXMBean.java | 3 + .../openjdk-21-jre-headless/task.yaml | 59 ++++++ 13 files changed, 652 insertions(+) create mode 100644 slices/openjdk-21-jdk-headless.yaml create mode 100644 slices/openjdk-21-jre-headless.yaml create mode 100644 tests/spread/integration/openjdk-21-jdk-headless/Main.java create mode 100644 tests/spread/integration/openjdk-21-jdk-headless/MonitoringTest.java create mode 100644 tests/spread/integration/openjdk-21-jdk-headless/SerializableObject.java create mode 100644 tests/spread/integration/openjdk-21-jdk-headless/task.yaml create mode 100644 tests/spread/integration/openjdk-21-jre-headless/ConsoleTest.java create mode 100644 tests/spread/integration/openjdk-21-jre-headless/Main.java create mode 100644 tests/spread/integration/openjdk-21-jre-headless/PrefsTest.java create mode 100644 tests/spread/integration/openjdk-21-jre-headless/ReadCertificate.java create mode 100644 tests/spread/integration/openjdk-21-jre-headless/TestJMX.java create mode 100644 tests/spread/integration/openjdk-21-jre-headless/TestJMXMBean.java create mode 100644 tests/spread/integration/openjdk-21-jre-headless/task.yaml diff --git a/slices/openjdk-21-jdk-headless.yaml b/slices/openjdk-21-jdk-headless.yaml new file mode 100644 index 000000000..ac919ca29 --- /dev/null +++ b/slices/openjdk-21-jdk-headless.yaml @@ -0,0 +1,160 @@ +package: openjdk-21-jdk-headless + +essential: + - openjdk-21-jdk-headless_copyright + +slices: + + # OpenJDK binaries slice + core: + essential: + - libc6_libs + - openjdk-21-jre-headless_core + - zlib1g_libs + contents: + /usr/lib/jvm/java-21-openjdk-*/bin/javac: + /usr/lib/jvm/java-21-openjdk-*/bin/javadoc: + /usr/lib/jvm/java-21-openjdk-*/bin/javap: + /usr/lib/jvm/java-21-openjdk-*/bin/jdeprscan: + /usr/lib/jvm/java-21-openjdk-*/bin/jdeps: + /usr/lib/jvm/java-21-openjdk-*/bin/jimage: + /usr/lib/jvm/java-21-openjdk-*/bin/serialver: + # used by javac + /usr/lib/jvm/java-21-openjdk-*/lib/ct.sym: + + standard: + essential: + - openjdk-21-jdk-headless_core + - openjdk-21-jre-headless_standard + contents: + /usr/lib/jvm/java-21-openjdk-*/bin/jar: + /usr/lib/jvm/java-21-openjdk-*/bin/jarsigner: + /usr/lib/jvm/java-21-openjdk-*/bin/jcmd: + /usr/lib/jvm/java-21-openjdk-*/bin/jdb: + /usr/lib/jvm/java-21-openjdk-*/bin/jfr: + /usr/lib/jvm/java-21-openjdk-*/bin/jhsdb: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-21-openjdk-*/bin/jinfo: + /usr/lib/jvm/java-21-openjdk-*/bin/jmap: + /usr/lib/jvm/java-21-openjdk-*/bin/jps: + /usr/lib/jvm/java-21-openjdk-*/bin/jrunscript: + /usr/lib/jvm/java-21-openjdk-*/bin/jshell: + /usr/lib/jvm/java-21-openjdk-*/bin/jstack: + /usr/lib/jvm/java-21-openjdk-*/bin/jstat: + /usr/lib/jvm/java-21-openjdk-*/bin/jstatd: + /usr/lib/jvm/java-21-openjdk-*/bin/jwebserver: + + # OpenJDK modules required to build the runtime image + modules: + essential: + - openjdk-21-jdk-headless_core + contents: + /usr/lib/jvm/java-21-openjdk-*/bin/jlink: + /usr/lib/jvm/java-21-openjdk-*/bin/jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.base.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.compiler.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.datatransfer.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.desktop.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.instrument.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.logging.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.management.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.management.rmi.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.naming.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.net.http.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.prefs.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.rmi.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.scripting.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.se.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.security.jgss.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.security.sasl.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.smartcardio.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.sql.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.sql.rowset.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.transaction.xa.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.xml.crypto.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.xml.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.accessibility.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.attach.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.charsets.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.compiler.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.crypto.cryptoki.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.crypto.ec.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.dynalink.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.editpad.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.hotspot.agent.jmod: + arch: + - amd64 + - arm64 + - ppc64el + - riscv64 + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.httpserver.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.ed.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.jvmstat.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.le.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.opt.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.vm.ci.jmod: + arch: + - amd64 + - arm64 + - riscv64 + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.vm.compiler.jmod: + arch: + - amd64 + - arm64 + - riscv64 + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.vm.compiler.management.jmod: + arch: + - amd64 + - arm64 + - riscv64 + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jartool.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.javadoc.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jcmd.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jconsole.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jdeps.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jdi.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jdwp.agent.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jfr.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jlink.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jpackage.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jshell.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jsobject.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jstatd.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.localedata.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.management.agent.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.management.jfr.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.management.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.naming.dns.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.naming.rmi.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.net.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.nio.mapmode.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.random.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.sctp.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.security.auth.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.security.jgss.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.unsupported.desktop.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.unsupported.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.xml.dom.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.zipfs.jmod: + + # OpenJDK headers for JNI + headers: + contents: + /usr/lib/jvm/java-21-openjdk-*/include/classfile_constants.h: + /usr/lib/jvm/java-21-openjdk-*/include/jni.h: + /usr/lib/jvm/java-21-openjdk-*/include/jvmti.h: + /usr/lib/jvm/java-21-openjdk-*/include/jvmticmlr.h: + /usr/lib/jvm/java-21-openjdk-*/include/linux/jni_md.h: + + # OpenJDK headers for the debug agent development + debug-headers: + contents: + /usr/lib/jvm/java-21-openjdk-*/include/jdwpTransport.h: + + copyright: + essential: + - openjdk-21-jre-headless_copyright + contents: + /usr/share/doc/openjdk-21-jdk-headless: diff --git a/slices/openjdk-21-jre-headless.yaml b/slices/openjdk-21-jre-headless.yaml new file mode 100644 index 000000000..93481e079 --- /dev/null +++ b/slices/openjdk-21-jre-headless.yaml @@ -0,0 +1,183 @@ +package: openjdk-21-jre-headless + +essential: + - openjdk-21-jre-headless_copyright + +slices: + + # A set of slices to run headless openjdk runtime + standard: + essential: + - openjdk-21-jre-headless_class-data-sharing + - openjdk-21-jre-headless_console + - openjdk-21-jre-headless_core + - openjdk-21-jre-headless_debug + - openjdk-21-jre-headless_jfr + - openjdk-21-jre-headless_management + - openjdk-21-jre-headless_prefs + - openjdk-21-jre-headless_rmi + - openjdk-21-jre-headless_security + - openjdk-21-jre-headless_tools + + # List of classes required to create the Class Data Sharing archive + class-data-sharing: + essential: + - openjdk-21-jre-headless_core + contents: + /usr/lib/jvm/java-21-openjdk-*/lib/classlist: + + # A minimal set of files to run a Java application + # excluded dependencies: + # - ca-certificates-java_essential - needs chisel support to run + # maintainer scripts. + # - java-common - provides update-alternatives, + # not relevant. + # - util-linux - needed for bash completion + # not relevant. + # - libjpeg8 - used in awt, not relevant + # - liblcms2-2 - used in awt, not relevant + core: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + - zlib1g_libs + contents: + /etc/java-21-openjdk/jaxp.properties: + /etc/java-21-openjdk/jvm-*.cfg: + /etc/java-21-openjdk/logging.properties: + /etc/java-21-openjdk/net.properties: + /etc/java-21-openjdk/security/java.policy: + /etc/java-21-openjdk/security/java.security: + /usr/lib/jvm/java-21-openjdk-*/bin/java: + /usr/lib/jvm/java-21-openjdk-*/conf/jaxp.properties: + /usr/lib/jvm/java-21-openjdk-*/conf/logging.properties: + /usr/lib/jvm/java-21-openjdk-*/conf/net.properties: + /usr/lib/jvm/java-21-openjdk-*/conf/security/java.policy: + /usr/lib/jvm/java-21-openjdk-*/conf/security/java.security: + /usr/lib/jvm/java-21-openjdk-*/lib/jexec: + /usr/lib/jvm/java-21-openjdk-*/lib/jspawnhelper: + /usr/lib/jvm/java-21-openjdk-*/lib/jvm.cfg: + /usr/lib/jvm/java-21-openjdk-*/lib/jvm.cfg-default: + /usr/lib/jvm/java-21-openjdk-*/lib/libextnet.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libjava.so: + # lib/modules support + /usr/lib/jvm/java-21-openjdk-*/lib/libjimage.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libjli.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libjsig.so: + # required for IO. + /usr/lib/jvm/java-21-openjdk-*/lib/libnet.so: + # required for IO. + /usr/lib/jvm/java-21-openjdk-*/lib/libnio.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libverify.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libzip.so: + /usr/lib/jvm/java-21-openjdk-*/lib/modules: + /usr/lib/jvm/java-21-openjdk-*/lib/server/libjsig.so: + /usr/lib/jvm/java-21-openjdk-*/lib/server/libjvm.so: + /usr/lib/jvm/java-21-openjdk-*/lib/tzdb.dat: + + # Native part of jdk.prefs modules + prefs: + essential: + - openjdk-21-jre-headless_core + contents: + /usr/lib/jvm/java-21-openjdk-*/lib/libprefs.so: + + # Native part of java.rmi + rmi: + essential: + - openjdk-21-jre-headless_security + contents: + /usr/lib/jvm/java-21-openjdk-*/bin/rmiregistry: + /usr/lib/jvm/java-21-openjdk-*/lib/librmi.so: + + # Native part of the console support + console: + essential: + - openjdk-21-jre-headless_core + contents: + /usr/lib/jvm/java-21-openjdk-*/lib/lible.so: + + # Debug support + debug: + essential: + - openjdk-21-jre-headless_core + contents: + /usr/lib/jvm/java-21-openjdk-*/lib/libattach.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libdt_socket.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libinstrument.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libjdwp.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libsaproc.so: + arch: + - amd64 + - arm64 + - armhf + - ppc64el + - riscv64 + + # Configuration and native part of Java Management Extensions + management: + essential: + - openjdk-21-jre-headless_rmi + contents: + /etc/java-21-openjdk/management/jmxremote.access: + /etc/java-21-openjdk/management/management.properties: + /usr/lib/jvm/java-21-openjdk-*/conf/management/jmxremote.access: + /usr/lib/jvm/java-21-openjdk-*/conf/management/management.properties: + /usr/lib/jvm/java-21-openjdk-*/lib/libmanagement.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libmanagement_agent.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libmanagement_ext.so: + + # Security configuration files and native libraries + security: + essential: + - libnss3_libs + - libpcsclite1_libs + - openjdk-21-jre-headless_core + contents: + /etc/java-21-openjdk/security/blocked.certs: + /etc/java-21-openjdk/security/default.policy: + /etc/java-21-openjdk/security/nss.cfg: + /etc/java-21-openjdk/security/policy/limited/default_US_export.policy: + /etc/java-21-openjdk/security/policy/limited/default_local.policy: + /etc/java-21-openjdk/security/policy/limited/exempt_local.policy: + /etc/java-21-openjdk/security/policy/unlimited/default_US_export.policy: + /etc/java-21-openjdk/security/policy/unlimited/default_local.policy: + /etc/java-21-openjdk/security/public_suffix_list.dat: + /usr/lib/jvm/java-21-openjdk-*/conf/security/nss.cfg: + /usr/lib/jvm/java-21-openjdk-*/conf/security/policy/limited/default_US_export.policy: + /usr/lib/jvm/java-21-openjdk-*/conf/security/policy/limited/default_local.policy: + /usr/lib/jvm/java-21-openjdk-*/conf/security/policy/limited/exempt_local.policy: + /usr/lib/jvm/java-21-openjdk-*/conf/security/policy/unlimited/default_US_export.policy: + /usr/lib/jvm/java-21-openjdk-*/conf/security/policy/unlimited/default_local.policy: + /usr/lib/jvm/java-21-openjdk-*/lib/libj2gss.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libj2pcsc.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libj2pkcs11.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libjaas.so: + /usr/lib/jvm/java-21-openjdk-*/lib/security/blocked.certs: + /usr/lib/jvm/java-21-openjdk-*/lib/security/cacerts: + /usr/lib/jvm/java-21-openjdk-*/lib/security/default.policy: + /usr/lib/jvm/java-21-openjdk-*/lib/security/public_suffix_list.dat: + + # OpenJDK tools + tools: + essential: + - openjdk-21-jre-headless_security + contents: + /usr/lib/jvm/java-21-openjdk-*/bin/jpackage: + /usr/lib/jvm/java-21-openjdk-*/bin/keytool: + + # Java Flight Recorder configuration and jar file + jfr: + essential: + - openjdk-21-jre-headless_core + contents: + /etc/java-21-openjdk/jfr/default.jfc: + /etc/java-21-openjdk/jfr/profile.jfc: + /usr/lib/jvm/java-21-openjdk-*/lib/jfr/default.jfc: + /usr/lib/jvm/java-21-openjdk-*/lib/jfr/profile.jfc: + /usr/lib/jvm/java-21-openjdk-*/lib/jrt-fs.jar: + + copyright: + contents: + /usr/share/doc/openjdk-21-jre-headless/copyright: diff --git a/tests/spread/integration/openjdk-21-jdk-headless/Main.java b/tests/spread/integration/openjdk-21-jdk-headless/Main.java new file mode 100644 index 000000000..40b5eeef0 --- /dev/null +++ b/tests/spread/integration/openjdk-21-jdk-headless/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args){ + System.out.println("Hello world"); + } +} diff --git a/tests/spread/integration/openjdk-21-jdk-headless/MonitoringTest.java b/tests/spread/integration/openjdk-21-jdk-headless/MonitoringTest.java new file mode 100644 index 000000000..aa09573ff --- /dev/null +++ b/tests/spread/integration/openjdk-21-jdk-headless/MonitoringTest.java @@ -0,0 +1,7 @@ +public class MonitoringTest { + public static void main(String[] args) throws InterruptedException { + while (true) { + Thread.sleep(1000); + } + } +} diff --git a/tests/spread/integration/openjdk-21-jdk-headless/SerializableObject.java b/tests/spread/integration/openjdk-21-jdk-headless/SerializableObject.java new file mode 100644 index 000000000..b46056421 --- /dev/null +++ b/tests/spread/integration/openjdk-21-jdk-headless/SerializableObject.java @@ -0,0 +1,4 @@ +import java.io.Serializable; + +public class SerializableObject implements Serializable { +} diff --git a/tests/spread/integration/openjdk-21-jdk-headless/task.yaml b/tests/spread/integration/openjdk-21-jdk-headless/task.yaml new file mode 100644 index 000000000..83023e6fb --- /dev/null +++ b/tests/spread/integration/openjdk-21-jdk-headless/task.yaml @@ -0,0 +1,125 @@ +summary: Integration tests for openjdk-21-jdk-headless + +environment: + SLICE/core: "core" + SLICE/standard: "standard" + SLICE/modules: "modules" + +execute: | + pids=() + cleanup() { + for pid in "${pids[@]}"; do + kill "$pid" 2>/dev/null + done + } + for sig in INT QUIT HUP TERM; do trap "cleanup; trap - $sig EXIT; kill -s $sig "'"$$"' "$sig"; done + trap cleanup EXIT + + apt install --update -y openjdk-21-jdk-headless curl + nohup java MonitoringTest.java & + pid=$! + pids+=("$pid") + + # Test different slice installations + echo "SLICE=${SLICE}" + rootfs="$(install-slices openjdk-21-jdk-headless_${SLICE} dash_bins)" + cp *.java ${rootfs}/ + javac *.java + cp *.class ${rootfs}/ + cd ${rootfs} + mkdir -p proc sys tmp + mount --bind /proc proc + mount --bind /sys sys + mount --bind /tmp tmp + case ${SLICE} in + core) + for java in `find usr/lib/jvm -name java`; do + home=$(dirname ${java}) + # /usr/lib/jvm/java-21-openjdk-*/bin/javac: + chroot . ${home}/javac /Main.java -d / + # /usr/lib/jvm/java-21-openjdk-*/bin/javadoc: + chroot . ${home}/javadoc /Main.java + # /usr/lib/jvm/java-21-openjdk-*/bin/javap: + chroot . ${home}/javap -l /Main.class + # /usr/lib/jvm/java-21-openjdk-*/bin/jdeprscan: + chroot . ${home}/jdeprscan --class-path . Main + # /usr/lib/jvm/java-21-openjdk-*/bin/jdeps: + chroot . ${home}/jdeps -m java.base + # /usr/lib/jvm/java-21-openjdk-*/bin/jimage: + chroot . ${home}/jimage info ${home}/../lib/modules + # /usr/lib/jvm/java-21-openjdk-*/bin/serialver: + chroot . ${home}/serialver -classpath / SerializableObject + done + ;; + standard) + for java in `find usr/lib/jvm -name java`; do + home=$(dirname ${java}) + # /usr/lib/jvm/java-21-openjdk-*/bin/jar: + # /usr/lib/jvm/java-21-openjdk-*/bin/jarsigner: + chroot . ${home}/jar cvf test.jar *.java + DNAME="CN=Sample Cert, OU=R&D, O=Company Ltd., L=Dublin 4, S=Dublin, C=IE" + chroot . ${home}/keytool -genkeypair -keystore foo -storepass barbar -keyalg RSA -dname "$DNAME" -alias foo + chroot . ${home}/jarsigner -keystore foo -storepass barbar test.jar foo + # /usr/lib/jvm/java-21-openjdk-*/bin/jdb: + chroot . /usr/bin/sh -c "echo run | ${home}/jdb Main.java" + # /usr/lib/jvm/java-21-openjdk-*/bin/jcmd: + chroot . ${home}/jcmd jdk.compiler/com.sun.tools.javac.launcher.Main VM.version + # /usr/lib/jvm/java-21-openjdk-*/bin/jhsdb: + if [ -f ${home}/jhsdb ]; then + chroot . ${home}/jhsdb jstack --pid ${pid} + fi + # /usr/lib/jvm/java-21-openjdk-*/bin/jfr: + chroot . ${home}/jcmd ${pid} JFR.start maxsize=1MB + chroot . ${home}/jcmd ${pid} JFR.stop + chroot . ${home}/jcmd ${pid} JFR.dump filename=/tmp/recording.jfr + chroot . ${home}/jfr print /tmp/recording.jfr > /dev/null + # /usr/lib/jvm/java-21-openjdk-*/bin/jinfo: + chroot . ${home}/jinfo ${pid} + # /usr/lib/jvm/java-21-openjdk-*/bin/jshell: + chroot . /usr/bin/sh -c "echo 'System.out.println(\"hello world\")' | ${home}/jshell" + # /usr/lib/jvm/java-21-openjdk-*/bin/jmap: + chroot . ${home}/jmap ${pid} + # /usr/lib/jvm/java-21-openjdk-*/bin/jps: + chroot . ${home}/jps -l + # /usr/lib/jvm/java-21-openjdk-*/bin/jstack: + chroot . ${home}/jstack ${pid} + # /usr/lib/jvm/java-21-openjdk-*/bin/jstat: + chroot . ${home}/jstat -gc ${pid} + # /usr/lib/jvm/java-21-openjdk-*/bin/jstatd: + nohup chroot . ${home}/jstatd > ./jstatd.log & + pids+=($!) + for retry in 0 1 2 3 4 5; do + if [ ${retry} -eq 5 ]; then + exit 1 + fi + grep -q "bound to /JStatRemoteHost" "jstatd.log" && break + sleep 10 + done + # /usr/lib/jvm/java-21-openjdk-amd64/bin/jwebserver + nohup chroot . ${home}/jwebserver & + sleep 10 + pids+=($!) + for retry in 0 1 2 3 4 5; do + if [ ${retry} -eq 5 ]; then + exit 1 + fi + curl http://127.0.0.1:8000 && break + sleep 10 + done + # /usr/lib/jvm/java-21-openjdk-*/bin/jrunscript: + ${home}/jrunscript -q + done + ;; + modules) + cd ${rootfs} + for jlink in `find usr/lib/jvm -name jlink`; do + output=$(basename $(mktemp -u)) + chroot . ${jlink} --add-modules java.base --output ${output} + rm -rf ${rootfs}/${output} + done + for jmod in `find usr/lib/jvm -name jmod`; do + home=$(dirname ${jmod}) + chroot . ${jmod} list ${home}/../jmods/java.rmi.jmod + done + ;; + esac diff --git a/tests/spread/integration/openjdk-21-jre-headless/ConsoleTest.java b/tests/spread/integration/openjdk-21-jre-headless/ConsoleTest.java new file mode 100644 index 000000000..6f85fb63a --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/ConsoleTest.java @@ -0,0 +1,11 @@ +import java.io.Console; + +public class ConsoleTest { + public static void main(String[] args) { + Console c = System.console(); + if (c == null) { + throw new RuntimeException("Console is not available"); + } + c.printf("console output %s\n", "success"); + } +} diff --git a/tests/spread/integration/openjdk-21-jre-headless/Main.java b/tests/spread/integration/openjdk-21-jre-headless/Main.java new file mode 100644 index 000000000..47e5d0af7 --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args) { + System.out.println("Hello world"); + } +} diff --git a/tests/spread/integration/openjdk-21-jre-headless/PrefsTest.java b/tests/spread/integration/openjdk-21-jre-headless/PrefsTest.java new file mode 100644 index 000000000..73c4ee63e --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/PrefsTest.java @@ -0,0 +1,13 @@ +import java.util.prefs.*; + +public class PrefsTest { + public static void main(String[] args) { + if ("put".equals(args[0])) { + Preferences.userRoot().put("a", "b"); + } else if ("get".equals(args[0])) { + if (!"b".equals(Preferences.userRoot().get("a", null))) { + throw new RuntimeException("Unable to read the preference"); + } + } + } +} diff --git a/tests/spread/integration/openjdk-21-jre-headless/ReadCertificate.java b/tests/spread/integration/openjdk-21-jre-headless/ReadCertificate.java new file mode 100644 index 000000000..644b2b0dd --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/ReadCertificate.java @@ -0,0 +1,35 @@ +import java.security.cert.*; +import java.io.*; + +public class ReadCertificate { + + static final String PEM = """ +-----BEGIN CERTIFICATE----- +MIIDazCCAlOgAwIBAgIULvuqN3MiptnZSYS9y1qJAZYKFA4wDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA4MTUwMjQzNDhaFw0yNTA4 +MTUwMjQzNDhaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDm3990peBuPYaz0UEEc75Q7i79P4RzrD84MxhDpoPs +MSdnmO3rTkIG84Wp72+8T7TGjGjBhX++8UmZLrXy2AfcejZi3JcddMWH4V5XEnAj +hTBe1HLkiotayZst/cxuTP6KmuahjsROAqriCv/A4BBA8KjYx1e4E9k9+81FreZy +PJ8p3m7R8qZ/DtjuW1aMQ3oDRKA/iqQhLHVpJy/iYiyjwTdJm6/lA3ywGCr6ZMWm +9tWUT+4TvhyRM67Y0gcCtH51cwxPqUFGEKAkLWIu2fS6DaoXtHylxgGeKKPes3JX +uSn9QezEEqvrgLFQRqIUS8tNZFEhoJQ7dmxMP/XKAD51AgMBAAGjUzBRMB0GA1Ud +DgQWBBSb70j+xaI3eTxp4H7MDm1MLVRGNTAfBgNVHSMEGDAWgBSb70j+xaI3eTxp +4H7MDm1MLVRGNTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAp +0GIjKtwvD7BkQy+cf3dsdwYodxoIYl4E8UvHfBSPQQfFNh+chHPmrNYRuFM3Q6sT +ogNhHKLecQMK4tNUDa/vVRGnqmZVWjxqLnyH/qFKtakqPB6h6x4h50huzA+twhNm +SDjg3QqqpOuUzrs77JqYkxSjqd0QgmwmgxOdbcF0SY+ebQhAd0UXY7wIs6ByDEHO +kElgJmnGKhOpf1SFpQh2qpKGq/MvcdHWN4oKri440wCf+czkrOTyGVc275oTbRnM +Z76Ro4JDuomyWeR9iQ5pP5ug4ciflLa7hlYcH0xJbF3b2M3BlnUYKMqih/TjqKdr +NBs121h64SPY0gh7kIvF +-----END CERTIFICATE----- + """; + + public static void main(String[] args) throws Throwable { + java.security.cert.Certificate cert = CertificateFactory.getInstance("X509").generateCertificate(new ByteArrayInputStream(PEM.getBytes())); + if (cert == null) + throw new RuntimeException("It should be possible to decode a certificate"); + } +} diff --git a/tests/spread/integration/openjdk-21-jre-headless/TestJMX.java b/tests/spread/integration/openjdk-21-jre-headless/TestJMX.java new file mode 100644 index 000000000..4d65d7f5c --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/TestJMX.java @@ -0,0 +1,42 @@ +import java.lang.management.ManagementFactory; +import javax.management.Attribute; +import javax.management.AttributeList; +import javax.management.AttributeNotFoundException; +import javax.management.DynamicMBean; +import javax.management.InstanceAlreadyExistsException; +import javax.management.InvalidAttributeValueException; +import javax.management.MBeanException; +import javax.management.MBeanInfo; +import javax.management.MBeanRegistrationException; +import javax.management.MBeanServer; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.NotCompliantMBeanException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.*; + +import com.sun.tools.attach.*; + + +public class TestJMX implements TestJMXMBean { + + static final String CONNECTOR_ADDRESS = + "com.sun.management.jmxremote.localConnectorAddress"; + + @Override + public void test() { + + } + + public static void main(String[] args) throws Throwable { + ObjectName objectName = new ObjectName("test:type=basic,name=mbeantest"); + MBeanServer server = ManagementFactory.getPlatformMBeanServer(); + server.registerMBean(new TestJMX(), objectName); + JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:5000/jmxrmi"); + int count = JMXConnectorFactory.connect(url) + .getMBeanServerConnection() + .getMBeanCount(); + System.out.println(count); + } +} diff --git a/tests/spread/integration/openjdk-21-jre-headless/TestJMXMBean.java b/tests/spread/integration/openjdk-21-jre-headless/TestJMXMBean.java new file mode 100644 index 000000000..c75f6c573 --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/TestJMXMBean.java @@ -0,0 +1,3 @@ +public interface TestJMXMBean { + void test(); +} diff --git a/tests/spread/integration/openjdk-21-jre-headless/task.yaml b/tests/spread/integration/openjdk-21-jre-headless/task.yaml new file mode 100644 index 000000000..00910ca1a --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/task.yaml @@ -0,0 +1,59 @@ +summary: Integration tests for openjdk-21-jre-headless + +environment: + SLICE/classdatasharing: "class-data-sharing" + SLICE/core: "core" + SLICE/prefs: "prefs" +# SLICE/rmi: "rmi" # Tested in management slice +# SLICE/console: "console" # This test requires /dev/pty. Skip it. + SLICE/debug: "debug" + SLICE/management: "management" + SLICE/jfr: "jfr" + SLICE/security: "security" + SLICE/tools: "tools" + +execute: | + # Test different slice installations + echo "SLICE=${SLICE}" + rootfs="$(install-slices openjdk-21-jre-headless_${SLICE})" + apt install --update -y openjdk-21-jdk-headless + javac *.java + cp *.java ${rootfs}/ + cp *.class ${rootfs}/ + cd ${rootfs} + mkdir -p proc/self + for java in `find usr/lib/jvm -name java`; do + ln -sf /${java} proc/self/exe + chroot . ${java} --version + case ${SLICE} in + class-data-sharing) + chroot . ${java} -XX:ArchiveClassesAtExit=archive.cds /Main.java + ;; + core) + chroot . ${java} /Main.java + ;; + prefs) + chroot . ${java} /PrefsTest.java put + chroot . ${java} /PrefsTest.java get + ;; + debug) + chroot . ${java} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 /Main.java + ;; + management) + chroot . ${java} -Dcom.sun.management.jmxremote.port=5000 \ + -Dcom.sun.management.jmxremote.authenticate=false \ + -Dcom.sun.management.jmxremote=true \ + -Dcom.sun.management.jmxremote.ssl=false -cp . TestJMX + ;; + jfr) + chroot . ${java} -XX:+FlightRecorder -XX:StartFlightRecording=duration=60s,filename=dump.jfr /Main.java + ;; + security) + chroot . ${java} /ReadCertificate.java + ;; + tools) + DNAME="CN=Sample Cert, OU=R&D, O=Company Ltd., L=Dublin 4, S=Dublin, C=IE" + chroot . $(dirname ${java})/keytool -genkeypair -keystore foo -storepass barbar -keyalg RSA -dname "$DNAME" + ;; + esac + done From a1d67c9817297d007d7a348114b46193f7cf1d35 Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Thu, 10 Oct 2024 21:26:02 +1300 Subject: [PATCH 13/24] fix: remove jvm.cfg-default (packaging) (#363) jvm.cfg-default is a packaging artifact: https://salsa.debian.org/openjdk-team/openjdk/-/blob/master/debian/rules?ref_type=heads#L1335 It is not needed for the runtime. --- slices/openjdk-21-jre-headless.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/slices/openjdk-21-jre-headless.yaml b/slices/openjdk-21-jre-headless.yaml index 93481e079..659afe8b3 100644 --- a/slices/openjdk-21-jre-headless.yaml +++ b/slices/openjdk-21-jre-headless.yaml @@ -58,7 +58,6 @@ slices: /usr/lib/jvm/java-21-openjdk-*/lib/jexec: /usr/lib/jvm/java-21-openjdk-*/lib/jspawnhelper: /usr/lib/jvm/java-21-openjdk-*/lib/jvm.cfg: - /usr/lib/jvm/java-21-openjdk-*/lib/jvm.cfg-default: /usr/lib/jvm/java-21-openjdk-*/lib/libextnet.so: /usr/lib/jvm/java-21-openjdk-*/lib/libjava.so: # lib/modules support From f9129e665c89fd49ca0907342c583b7ee5dc2a96 Mon Sep 17 00:00:00 2001 From: Cristovao Cordeiro Date: Thu, 10 Oct 2024 10:34:54 +0200 Subject: [PATCH 14/24] fix(spread): check chisel binary integrity (#365) --- spread.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spread.yaml b/spread.yaml index b2bb3b951..83e8dbc7f 100644 --- a/spread.yaml +++ b/spread.yaml @@ -84,16 +84,16 @@ backends: prepare: | # Deb arch to GOARCH arch="$(dpkg --print-architecture | sed -e 's/armhf/arm/g' -e 's/ppc64el/ppc64le/g')" - chisel_tar="chisel.tar.gz" apt install -y curl wget curl -s https://api.github.com/repos/canonical/chisel/releases/latest \ | awk "/browser_download_url/ && /chisel_v/ && /$arch/" \ | cut -d : -f 2,3 \ | tr -d \" \ - | xargs wget -O $chisel_tar + | xargs wget - tar -xf $chisel_tar -C /usr/local/bin + sha384sum -c chisel_v*sha384 + tar -xf chisel_v*tar.gz -C /usr/local/bin prepare-each: chisel version From fb721909f67167f2610c7c43322a0c04d8bf5177 Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Tue, 15 Oct 2024 19:52:37 +1100 Subject: [PATCH 15/24] feat(24.04): add wget slices (#364) --- slices/wget.yaml | 20 ++++++++++++++++++++ tests/spread/integration/wget/task.yaml | 12 ++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 slices/wget.yaml create mode 100644 tests/spread/integration/wget/task.yaml diff --git a/slices/wget.yaml b/slices/wget.yaml new file mode 100644 index 000000000..60f3dbb5a --- /dev/null +++ b/slices/wget.yaml @@ -0,0 +1,20 @@ +package: wget + +essential: + - wget_copyright + +slices: + bins: + essential: + - libc6_libs + - libidn2-0_libs + - libpcre2-8-0_libs + - libpsl5t64_libs + - libssl3t64_libs + - libuuid1_libs + - zlib1g_libs + contents: + /usr/bin/wget: + copyright: + contents: + /usr/share/doc/wget/copyright: diff --git a/tests/spread/integration/wget/task.yaml b/tests/spread/integration/wget/task.yaml new file mode 100644 index 000000000..c0a823998 --- /dev/null +++ b/tests/spread/integration/wget/task.yaml @@ -0,0 +1,12 @@ +summary: Integration tests for wget + +execute: | + # Chisel a minimum number of slices to give us a runnable system that we can + # test in. + rootfs="$(install-slices ca-certificates_data wget_bins)" + cp /etc/resolv.conf "${rootfs}/etc/" + + # Download Chisel release and compare to a known hash. + chroot "${rootfs}/" wget https://github.com/canonical/chisel/releases/download/v1.0.0/chisel_v1.0.0_linux_amd64.tar.gz + chroot "${rootfs}/" wget https://github.com/canonical/chisel/releases/download/v1.0.0/chisel_v1.0.0_linux_amd64.tar.gz.sha384 + cd "${rootfs}" && sha384sum -c chisel_v1.0.0_linux_amd64.tar.gz.sha384 From 6aa1b244845b95536b71477a0c4c38af42874bec Mon Sep 17 00:00:00 2001 From: Hadrien Patte Date: Fri, 18 Oct 2024 04:28:51 +0200 Subject: [PATCH 16/24] feat(24.04): add fontconfig slices (#220) --- slices/fontconfig.yaml | 33 +++++++++++++++++++ tests/spread/integration/fontconfig/task.yaml | 28 ++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 slices/fontconfig.yaml create mode 100644 tests/spread/integration/fontconfig/task.yaml diff --git a/slices/fontconfig.yaml b/slices/fontconfig.yaml new file mode 100644 index 000000000..9e3800d41 --- /dev/null +++ b/slices/fontconfig.yaml @@ -0,0 +1,33 @@ +package: fontconfig + +essential: + - fontconfig_copyright + +slices: + bins: + essential: + - fontconfig-config_config + - fontconfig_cache + - libc6_libs + - libfontconfig1_libs + - libfreetype6_libs + contents: + /usr/bin/fc-cache: + /usr/bin/fc-cat: + /usr/bin/fc-conflist: + /usr/bin/fc-list: + /usr/bin/fc-match: + /usr/bin/fc-pattern: + /usr/bin/fc-query: + /usr/bin/fc-scan: + /usr/bin/fc-validate: + + cache: + contents: + # The postinst script runs fc-cache to regenerate + # the fonts cache and populate that directory + /var/cache/fontconfig/: {make: true} + + copyright: + contents: + /usr/share/doc/fontconfig/copyright: diff --git a/tests/spread/integration/fontconfig/task.yaml b/tests/spread/integration/fontconfig/task.yaml new file mode 100644 index 000000000..86231f525 --- /dev/null +++ b/tests/spread/integration/fontconfig/task.yaml @@ -0,0 +1,28 @@ +summary: Integration tests for fontconfig + +execute: | + rootfs="$(install-slices fontconfig_bins)" + + # Test fc-cache + chroot ${rootfs} fc-cache + + # Test fc-cat + chroot ${rootfs} fc-cat + + # Test fc-conflist + chroot ${rootfs} fc-conflist + + # Test fc-list + chroot ${rootfs} fc-list + + # Test fc-pattern + chroot ${rootfs} fc-pattern /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf | grep 'Pattern has 1 elts' + + # Test fc-query + chroot ${rootfs} fc-query /usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf | grep 'fullname: "DejaVu Serif"' + + # Test fc-scan + chroot ${rootfs} fc-scan /usr/share/fonts/truetype/dejavu/DejaVuSansMono-Oblique.ttf | grep 'fullname: "DejaVu Sans Mono Oblique"' + + # Test fc-validate + chroot ${rootfs} fc-validate /usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf | grep 'Satisfy the coverage for en language' From 2547a1e76a3ea9333c329bfa1c81a25a1deb40ab Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Fri, 18 Oct 2024 08:18:05 +0200 Subject: [PATCH 17/24] feat(24.04): openjdk-17 headless slices (#350) --- slices/openjdk-17-jdk-headless.yaml | 156 +++++++++++++++ slices/openjdk-17-jre-headless.yaml | 179 ++++++++++++++++++ .../openjdk-17-jdk-headless/Main.java | 5 + .../MonitoringTest.java | 7 + .../RemoteInterface.java | 4 + .../SerializableObject.java | 4 + .../openjdk-17-jdk-headless/all.policy | 3 + .../openjdk-17-jdk-headless/task.yaml | 112 +++++++++++ .../openjdk-17-jre-headless/Main.java | 5 + .../openjdk-17-jre-headless/PrefsTest.java | 13 ++ .../ReadCertificate.java | 14 ++ .../openjdk-17-jre-headless/TestJMX.java | 39 ++++ .../openjdk-17-jre-headless/TestJMXMBean.java | 3 + .../openjdk-17-jre-headless/certificate.pem | 21 ++ .../openjdk-17-jre-headless/task.yaml | 62 ++++++ 15 files changed, 627 insertions(+) create mode 100644 slices/openjdk-17-jdk-headless.yaml create mode 100644 slices/openjdk-17-jre-headless.yaml create mode 100644 tests/spread/integration/openjdk-17-jdk-headless/Main.java create mode 100644 tests/spread/integration/openjdk-17-jdk-headless/MonitoringTest.java create mode 100644 tests/spread/integration/openjdk-17-jdk-headless/RemoteInterface.java create mode 100644 tests/spread/integration/openjdk-17-jdk-headless/SerializableObject.java create mode 100644 tests/spread/integration/openjdk-17-jdk-headless/all.policy create mode 100644 tests/spread/integration/openjdk-17-jdk-headless/task.yaml create mode 100644 tests/spread/integration/openjdk-17-jre-headless/Main.java create mode 100644 tests/spread/integration/openjdk-17-jre-headless/PrefsTest.java create mode 100644 tests/spread/integration/openjdk-17-jre-headless/ReadCertificate.java create mode 100644 tests/spread/integration/openjdk-17-jre-headless/TestJMX.java create mode 100644 tests/spread/integration/openjdk-17-jre-headless/TestJMXMBean.java create mode 100644 tests/spread/integration/openjdk-17-jre-headless/certificate.pem create mode 100644 tests/spread/integration/openjdk-17-jre-headless/task.yaml diff --git a/slices/openjdk-17-jdk-headless.yaml b/slices/openjdk-17-jdk-headless.yaml new file mode 100644 index 000000000..72ca2c274 --- /dev/null +++ b/slices/openjdk-17-jdk-headless.yaml @@ -0,0 +1,156 @@ +package: openjdk-17-jdk-headless + +essential: + - openjdk-17-jdk-headless_copyright + +slices: + + # OpenJDK binaries slice + core: + essential: + - libc6_libs + - openjdk-17-jre-headless_core + - openjdk-17-jre-headless_javac + - zlib1g_libs + contents: + /usr/lib/jvm/java-17-openjdk-*/bin/javac: + /usr/lib/jvm/java-17-openjdk-*/bin/javadoc: + /usr/lib/jvm/java-17-openjdk-*/bin/javap: + /usr/lib/jvm/java-17-openjdk-*/bin/jdeprscan: + /usr/lib/jvm/java-17-openjdk-*/bin/jdeps: + /usr/lib/jvm/java-17-openjdk-*/bin/jimage: + /usr/lib/jvm/java-17-openjdk-*/bin/serialver: + + standard: + essential: + - openjdk-17-jdk-headless_core + - openjdk-17-jre-headless_standard + contents: + /usr/lib/jvm/java-17-openjdk-*/bin/jar: + /usr/lib/jvm/java-17-openjdk-*/bin/jarsigner: + /usr/lib/jvm/java-17-openjdk-*/bin/jcmd: + /usr/lib/jvm/java-17-openjdk-*/bin/jdb: + /usr/lib/jvm/java-17-openjdk-*/bin/jfr: + /usr/lib/jvm/java-17-openjdk-*/bin/jhsdb: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-17-openjdk-*/bin/jinfo: + /usr/lib/jvm/java-17-openjdk-*/bin/jmap: + /usr/lib/jvm/java-17-openjdk-*/bin/jps: + /usr/lib/jvm/java-17-openjdk-*/bin/jrunscript: + /usr/lib/jvm/java-17-openjdk-*/bin/jshell: + /usr/lib/jvm/java-17-openjdk-*/bin/jstack: + /usr/lib/jvm/java-17-openjdk-*/bin/jstat: + /usr/lib/jvm/java-17-openjdk-*/bin/jstatd: + + # OpenJDK modules required to build the runtime image + modules: + essential: + - openjdk-17-jdk-headless_core + contents: + /usr/lib/jvm/java-17-openjdk-*/bin/jlink: + /usr/lib/jvm/java-17-openjdk-*/bin/jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.base.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.compiler.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.datatransfer.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.desktop.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.instrument.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.logging.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.management.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.management.rmi.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.naming.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.net.http.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.prefs.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.rmi.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.scripting.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.se.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.security.jgss.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.security.sasl.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.smartcardio.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.sql.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.sql.rowset.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.transaction.xa.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.xml.crypto.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.xml.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.accessibility.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.attach.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.charsets.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.compiler.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.crypto.cryptoki.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.crypto.ec.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.dynalink.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.editpad.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.hotspot.agent.jmod: + arch: + - amd64 + - arm64 + - ppc64el + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.httpserver.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.incubator.foreign.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.incubator.vector.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.ed.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.jvmstat.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.le.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.opt.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.vm.ci.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.vm.compiler.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.vm.compiler.management.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jartool.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.javadoc.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jcmd.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jconsole.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jdeps.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jdi.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jdwp.agent.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jfr.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jlink.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jpackage.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jshell.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jsobject.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jstatd.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.localedata.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.management.agent.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.management.jfr.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.management.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.naming.dns.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.naming.rmi.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.net.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.nio.mapmode.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.random.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.sctp.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.security.auth.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.security.jgss.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.unsupported.desktop.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.unsupported.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.xml.dom.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.zipfs.jmod: + + # OpenJDK headers for JNI + headers: + contents: + /usr/lib/jvm/java-17-openjdk-*/include/classfile_constants.h: + /usr/lib/jvm/java-17-openjdk-*/include/jni.h: + /usr/lib/jvm/java-17-openjdk-*/include/jvmti.h: + /usr/lib/jvm/java-17-openjdk-*/include/jvmticmlr.h: + /usr/lib/jvm/java-17-openjdk-*/include/linux/jni_md.h: + + # OpenJDK headers for the debug agent development + debug-headers: + contents: + /usr/lib/jvm/java-17-openjdk-*/include/jdwpTransport.h: + + copyright: + essential: + - openjdk-17-jre-headless_copyright + contents: + /usr/share/doc/openjdk-17-jdk-headless: diff --git a/slices/openjdk-17-jre-headless.yaml b/slices/openjdk-17-jre-headless.yaml new file mode 100644 index 000000000..45d5c1b1c --- /dev/null +++ b/slices/openjdk-17-jre-headless.yaml @@ -0,0 +1,179 @@ +package: openjdk-17-jre-headless + +essential: + - openjdk-17-jre-headless_copyright + +slices: + + standard: + essential: + - openjdk-17-jre-headless_class-data-sharing + - openjdk-17-jre-headless_core + - openjdk-17-jre-headless_debug + - openjdk-17-jre-headless_jfr + - openjdk-17-jre-headless_management + - openjdk-17-jre-headless_prefs + - openjdk-17-jre-headless_rmi + - openjdk-17-jre-headless_security + - openjdk-17-jre-headless_tools + + # List of classes required to create the Class Data Sharing archive + class-data-sharing: + essential: + - openjdk-17-jre-headless_core + contents: + /usr/lib/jvm/java-17-openjdk-*/lib/classlist: + + # A minimal set of files to run a Java application + # excluded dependencies: + # - ca-certificates-java_essential - needs chisel support to run + # maintainer scripts. + # - java-common - provides update-alternatives, + # not relevant. + # - util-linux - needed for bash completion + # not relevant. + # - libjpeg8 - used in awt, not relevant + # - liblcms2-2 - used in awt, not relevant + core: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + - zlib1g_libs + contents: + /etc/java-17-openjdk/jvm-*.cfg: + /etc/java-17-openjdk/logging.properties: + /etc/java-17-openjdk/net.properties: + /etc/java-17-openjdk/security/java.policy: + /etc/java-17-openjdk/security/java.security: + /usr/lib/jvm/java-17-openjdk-*/bin/java: + /usr/lib/jvm/java-17-openjdk-*/conf/logging.properties: + /usr/lib/jvm/java-17-openjdk-*/conf/net.properties: + /usr/lib/jvm/java-17-openjdk-*/conf/security/java.policy: + /usr/lib/jvm/java-17-openjdk-*/conf/security/java.security: + /usr/lib/jvm/java-17-openjdk-*/lib/jexec: + /usr/lib/jvm/java-17-openjdk-*/lib/jspawnhelper: + /usr/lib/jvm/java-17-openjdk-*/lib/jvm.cfg: + /usr/lib/jvm/java-17-openjdk-*/lib/libextnet.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libjava.so: + # lib/modules support + /usr/lib/jvm/java-17-openjdk-*/lib/libjimage.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libjli.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libjsig.so: + # required for IO. + /usr/lib/jvm/java-17-openjdk-*/lib/libnet.so: + # required for IO. + /usr/lib/jvm/java-17-openjdk-*/lib/libnio.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libverify.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libzip.so: + /usr/lib/jvm/java-17-openjdk-*/lib/modules: + /usr/lib/jvm/java-17-openjdk-*/lib/server/libjsig.so: + /usr/lib/jvm/java-17-openjdk-*/lib/server/libjvm.so: + /usr/lib/jvm/java-17-openjdk-*/lib/tzdb.dat: + + # Native part of jdk.prefs modules + prefs: + essential: + - openjdk-17-jre-headless_core + contents: + /usr/lib/jvm/java-17-openjdk-*/lib/libprefs.so: + + # Native part of java.rmi + rmi: + essential: + - openjdk-17-jre-headless_security + contents: + /usr/lib/jvm/java-17-openjdk-*/bin/rmiregistry: + /usr/lib/jvm/java-17-openjdk-*/lib/librmi.so: + + # Debug support + debug: + essential: + - openjdk-17-jre-headless_core + contents: + /usr/lib/jvm/java-17-openjdk-*/lib/libattach.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libdt_socket.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libinstrument.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libjdwp.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libsaproc.so: + arch: + - amd64 + - arm64 + - armhf + - ppc64el + + # Configuration and native part of Java Management Extensions + management: + essential: + - openjdk-17-jre-headless_rmi + contents: + /etc/java-17-openjdk/management/jmxremote.access: + /etc/java-17-openjdk/management/management.properties: + /usr/lib/jvm/java-17-openjdk-*/conf/management/jmxremote.access: + /usr/lib/jvm/java-17-openjdk-*/conf/management/management.properties: + /usr/lib/jvm/java-17-openjdk-*/lib/libmanagement.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libmanagement_agent.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libmanagement_ext.so: + + # Security configuration files and native libraries + security: + essential: + - libnss3_libs + - libpcsclite1_libs + - openjdk-17-jre-headless_core + contents: + /etc/java-17-openjdk/security/blocked.certs: + /etc/java-17-openjdk/security/default.policy: + /etc/java-17-openjdk/security/nss.cfg: + /etc/java-17-openjdk/security/policy/limited/default_US_export.policy: + /etc/java-17-openjdk/security/policy/limited/default_local.policy: + /etc/java-17-openjdk/security/policy/limited/exempt_local.policy: + /etc/java-17-openjdk/security/policy/unlimited/default_US_export.policy: + /etc/java-17-openjdk/security/policy/unlimited/default_local.policy: + /etc/java-17-openjdk/security/public_suffix_list.dat: + /usr/lib/jvm/java-17-openjdk-*/conf/security/nss.cfg: + /usr/lib/jvm/java-17-openjdk-*/conf/security/policy/limited/default_US_export.policy: + /usr/lib/jvm/java-17-openjdk-*/conf/security/policy/limited/default_local.policy: + /usr/lib/jvm/java-17-openjdk-*/conf/security/policy/limited/exempt_local.policy: + /usr/lib/jvm/java-17-openjdk-*/conf/security/policy/unlimited/default_US_export.policy: + /usr/lib/jvm/java-17-openjdk-*/conf/security/policy/unlimited/default_local.policy: + /usr/lib/jvm/java-17-openjdk-*/lib/libj2gss.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libj2pcsc.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libj2pkcs11.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libjaas.so: + /usr/lib/jvm/java-17-openjdk-*/lib/security/blocked.certs: + /usr/lib/jvm/java-17-openjdk-*/lib/security/cacerts: + /usr/lib/jvm/java-17-openjdk-*/lib/security/default.policy: + /usr/lib/jvm/java-17-openjdk-*/lib/security/public_suffix_list.dat: + + # OpenJDK tools + tools: + essential: + - openjdk-17-jre-headless_security + contents: + /usr/lib/jvm/java-17-openjdk-*/bin/keytool: + /usr/lib/jvm/java-17-openjdk-amd64/bin/jpackage: + arch: + - amd64 + + # Java Flight Recorder configuration and jar file + jfr: + essential: + - openjdk-17-jre-headless_core + contents: + /etc/java-17-openjdk/jfr/default.jfc: + /etc/java-17-openjdk/jfr/profile.jfc: + /usr/lib/jvm/java-17-openjdk-*/lib/jfr/default.jfc: + /usr/lib/jvm/java-17-openjdk-*/lib/jfr/profile.jfc: + /usr/lib/jvm/java-17-openjdk-*/lib/jrt-fs.jar: + + # Javac JDK API signatures for the backwards compatibility + javac: + essential: + - openjdk-17-jre-headless_core + contents: + /usr/lib/jvm/java-17-openjdk-*/lib/ct.sym: + + copyright: + contents: + /usr/share/doc/openjdk-17-jre-headless/copyright: diff --git a/tests/spread/integration/openjdk-17-jdk-headless/Main.java b/tests/spread/integration/openjdk-17-jdk-headless/Main.java new file mode 100644 index 000000000..40b5eeef0 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jdk-headless/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args){ + System.out.println("Hello world"); + } +} diff --git a/tests/spread/integration/openjdk-17-jdk-headless/MonitoringTest.java b/tests/spread/integration/openjdk-17-jdk-headless/MonitoringTest.java new file mode 100644 index 000000000..aa09573ff --- /dev/null +++ b/tests/spread/integration/openjdk-17-jdk-headless/MonitoringTest.java @@ -0,0 +1,7 @@ +public class MonitoringTest { + public static void main(String[] args) throws InterruptedException { + while (true) { + Thread.sleep(1000); + } + } +} diff --git a/tests/spread/integration/openjdk-17-jdk-headless/RemoteInterface.java b/tests/spread/integration/openjdk-17-jdk-headless/RemoteInterface.java new file mode 100644 index 000000000..d19403634 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jdk-headless/RemoteInterface.java @@ -0,0 +1,4 @@ +import java.rmi.Remote; + +public class RemoteInterface implements Remote { +} diff --git a/tests/spread/integration/openjdk-17-jdk-headless/SerializableObject.java b/tests/spread/integration/openjdk-17-jdk-headless/SerializableObject.java new file mode 100644 index 000000000..b46056421 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jdk-headless/SerializableObject.java @@ -0,0 +1,4 @@ +import java.io.Serializable; + +public class SerializableObject implements Serializable { +} diff --git a/tests/spread/integration/openjdk-17-jdk-headless/all.policy b/tests/spread/integration/openjdk-17-jdk-headless/all.policy new file mode 100644 index 000000000..1d0ce8867 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jdk-headless/all.policy @@ -0,0 +1,3 @@ +grant { + permission java.security.AllPermission; +}; diff --git a/tests/spread/integration/openjdk-17-jdk-headless/task.yaml b/tests/spread/integration/openjdk-17-jdk-headless/task.yaml new file mode 100644 index 000000000..a25411f91 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jdk-headless/task.yaml @@ -0,0 +1,112 @@ +summary: Integration tests for openjdk-17-jdk-headless + +environment: + SLICE/core: "core" + SLICE/standard: "standard" + SLICE/modules: "modules" + +execute: | + pids=() + cleanup() { + for pid in "${pids[@]}"; do + kill "$pid" || true + done + } + for sig in INT QUIT HUP TERM; do trap "cleanup; trap - $sig EXIT; kill -s $sig "'"$$"' "$sig"; done + trap cleanup EXIT + + apt install --update -y openjdk-17-jdk-headless + + # Test different slice installations + echo "SLICE=${SLICE}" + rootfs="$(install-slices openjdk-17-jdk-headless_${SLICE} dash_bins)" + cp *.java ${rootfs}/ + cp all.policy ${rootfs}/ + javac *.java + + nohup java -cp . MonitoringTest & + pid=$! + pids+=("$pid") + + cp *.class ${rootfs}/ + cd ${rootfs} + mkdir -p proc sys tmp + mount --bind /proc proc + mount --bind /sys sys + mount --bind /tmp tmp + case ${SLICE} in + core) + for java in `find usr/lib/jvm -name java`; do + home=$(dirname ${java}) + # /usr/lib/jvm/java-17-openjdk-*/bin/javac: + chroot . ${home}/javac /Main.java -d / + # /usr/lib/jvm/java-17-openjdk-*/bin/javadoc: + chroot . ${home}/javadoc /Main.java + # /usr/lib/jvm/java-17-openjdk-*/bin/javap: + chroot . ${home}/javap -l /Main.class + # /usr/lib/jvm/java-17-openjdk-*/bin/jdeprscan: + chroot . ${home}/jdeprscan --class-path . Main + # /usr/lib/jvm/java-17-openjdk-*/bin/jdeps: + chroot . ${home}/jdeps -m java.base + # /usr/lib/jvm/java-17-openjdk-*/bin/jimage: + chroot . ${home}/jimage info ${home}/../lib/modules + # /usr/lib/jvm/java-17-openjdk-*/bin/serialver: + chroot . ${home}/serialver -classpath / SerializableObject + done + ;; + standard) + for java in `find usr/lib/jvm -name java`; do + home=$(dirname ${java}) + # /usr/lib/jvm/java-17-openjdk-*/bin/jar: + # /usr/lib/jvm/java-17-openjdk-*/bin/jarsigner: + chroot . ${home}/jar cvf test.jar *.java + DNAME="CN=Sample Cert, OU=R&D, O=Company Ltd., L=Dublin 4, S=Dublin, C=IE" + chroot . ${home}/keytool -genkeypair -keystore foo -storepass barbar -keyalg RSA -dname "$DNAME" -alias foo + chroot . ${home}/jarsigner -keystore foo -storepass barbar test.jar foo + # /usr/lib/jvm/java-17-openjdk-*/bin/jdb: + chroot . /usr/bin/sh -c "echo run | ${home}/jdb Main.java" + # /usr/lib/jvm/java-17-openjdk-*/bin/jcmd: + chroot . ${home}/jcmd MonitoringTest VM.version + # /usr/lib/jvm/java-17-openjdk-*/bin/jhsdb: + if [ -f ${home}/jhsdb ]; then + chroot . ${home}/jhsdb jstack --pid ${pid} + fi + # /usr/lib/jvm/java-17-openjdk-*/bin/jfr: + chroot . ${home}/jcmd ${pid} JFR.start name=recording maxsize=1MB + chroot . ${home}/jcmd ${pid} JFR.dump name=recording filename=/tmp/recording.jfr + chroot . ${home}/jfr print /tmp/recording.jfr > /dev/null + # /usr/lib/jvm/java-17-openjdk-*/bin/jinfo: + chroot . ${home}/jinfo ${pid} + # /usr/lib/jvm/java-17-openjdk-*/bin/jrunscript: + chroot . ${home}/jrunscript -q + # /usr/lib/jvm/java-17-openjdk-*/bin/jshell: + chroot . /usr/bin/sh -c "echo 'System.out.println(\"hello world\")' | ${home}/jshell" + # /usr/lib/jvm/java-17-openjdk-*/bin/jstack: + chroot . ${home}/jstack ${pid} + # /usr/lib/jvm/java-17-openjdk-*/bin/jstat: + chroot . ${home}/jstat -gc ${pid} + # /usr/lib/jvm/java-17-openjdk-*/bin/jstatd: + nohup chroot . ${home}/jstatd -J-Djava.security.policy=all.policy > ./jstatd.log & + pids+=($!) + for retry in 0 1 2 3 4 5; do + if [ ${retry} -eq 5 ]; then + exit 1 + fi + grep -q "bound to /JStatRemoteHost" "jstatd.log" && break + sleep 10 + done + done + ;; + modules) + cd ${rootfs} + for jlink in `find usr/lib/jvm -name jlink`; do + output=$(basename $(mktemp -u)) + chroot . ${jlink} --add-modules java.base --output ${output} + rm -rf ${rootfs}/${output} + done + for jmod in `find usr/lib/jvm -name jmod`; do + home=$(dirname ${jmod}) + chroot . ${jmod} list ${home}/../jmods/java.rmi.jmod + done + ;; + esac diff --git a/tests/spread/integration/openjdk-17-jre-headless/Main.java b/tests/spread/integration/openjdk-17-jre-headless/Main.java new file mode 100644 index 000000000..47e5d0af7 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args) { + System.out.println("Hello world"); + } +} diff --git a/tests/spread/integration/openjdk-17-jre-headless/PrefsTest.java b/tests/spread/integration/openjdk-17-jre-headless/PrefsTest.java new file mode 100644 index 000000000..73c4ee63e --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/PrefsTest.java @@ -0,0 +1,13 @@ +import java.util.prefs.*; + +public class PrefsTest { + public static void main(String[] args) { + if ("put".equals(args[0])) { + Preferences.userRoot().put("a", "b"); + } else if ("get".equals(args[0])) { + if (!"b".equals(Preferences.userRoot().get("a", null))) { + throw new RuntimeException("Unable to read the preference"); + } + } + } +} diff --git a/tests/spread/integration/openjdk-17-jre-headless/ReadCertificate.java b/tests/spread/integration/openjdk-17-jre-headless/ReadCertificate.java new file mode 100644 index 000000000..ef92fd99b --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/ReadCertificate.java @@ -0,0 +1,14 @@ +import java.security.cert.*; +import java.io.*; +import java.nio.file.Files; +import java.nio.file.Path; + +public class ReadCertificate { + + public static void main(String[] args) throws Throwable { + byte[] pem = Files.readAllBytes(Path.of("certificate.pem")); + java.security.cert.Certificate cert = CertificateFactory.getInstance("X509").generateCertificate(new ByteArrayInputStream(pem)); + if (cert == null) + throw new RuntimeException("It should be possible to decode a certificate"); + } +} diff --git a/tests/spread/integration/openjdk-17-jre-headless/TestJMX.java b/tests/spread/integration/openjdk-17-jre-headless/TestJMX.java new file mode 100644 index 000000000..e27d058d8 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/TestJMX.java @@ -0,0 +1,39 @@ +import java.lang.management.ManagementFactory; +import javax.management.Attribute; +import javax.management.AttributeList; +import javax.management.AttributeNotFoundException; +import javax.management.DynamicMBean; +import javax.management.InstanceAlreadyExistsException; +import javax.management.InvalidAttributeValueException; +import javax.management.MBeanException; +import javax.management.MBeanInfo; +import javax.management.MBeanRegistrationException; +import javax.management.MBeanServer; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.NotCompliantMBeanException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.*; +import com.sun.tools.attach.*; + +public class TestJMX implements TestJMXMBean { + + static final String CONNECTOR_ADDRESS = + "com.sun.management.jmxremote.localConnectorAddress"; + + @Override + public void test() { + } + + public static void main(String[] args) throws Throwable { + ObjectName objectName = new ObjectName("test:type=basic,name=mbeantest"); + MBeanServer server = ManagementFactory.getPlatformMBeanServer(); + server.registerMBean(new TestJMX(), objectName); + JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:5000/jmxrmi"); + int count = JMXConnectorFactory.connect(url) + .getMBeanServerConnection() + .getMBeanCount(); + System.out.println(count); + } +} diff --git a/tests/spread/integration/openjdk-17-jre-headless/TestJMXMBean.java b/tests/spread/integration/openjdk-17-jre-headless/TestJMXMBean.java new file mode 100644 index 000000000..c75f6c573 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/TestJMXMBean.java @@ -0,0 +1,3 @@ +public interface TestJMXMBean { + void test(); +} diff --git a/tests/spread/integration/openjdk-17-jre-headless/certificate.pem b/tests/spread/integration/openjdk-17-jre-headless/certificate.pem new file mode 100644 index 000000000..645e9f80c --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/certificate.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDazCCAlOgAwIBAgIULvuqN3MiptnZSYS9y1qJAZYKFA4wDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA4MTUwMjQzNDhaFw0yNTA4 +MTUwMjQzNDhaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDm3990peBuPYaz0UEEc75Q7i79P4RzrD84MxhDpoPs +MSdnmO3rTkIG84Wp72+8T7TGjGjBhX++8UmZLrXy2AfcejZi3JcddMWH4V5XEnAj +hTBe1HLkiotayZst/cxuTP6KmuahjsROAqriCv/A4BBA8KjYx1e4E9k9+81FreZy +PJ8p3m7R8qZ/DtjuW1aMQ3oDRKA/iqQhLHVpJy/iYiyjwTdJm6/lA3ywGCr6ZMWm +9tWUT+4TvhyRM67Y0gcCtH51cwxPqUFGEKAkLWIu2fS6DaoXtHylxgGeKKPes3JX +uSn9QezEEqvrgLFQRqIUS8tNZFEhoJQ7dmxMP/XKAD51AgMBAAGjUzBRMB0GA1Ud +DgQWBBSb70j+xaI3eTxp4H7MDm1MLVRGNTAfBgNVHSMEGDAWgBSb70j+xaI3eTxp +4H7MDm1MLVRGNTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAp +0GIjKtwvD7BkQy+cf3dsdwYodxoIYl4E8UvHfBSPQQfFNh+chHPmrNYRuFM3Q6sT +ogNhHKLecQMK4tNUDa/vVRGnqmZVWjxqLnyH/qFKtakqPB6h6x4h50huzA+twhNm +SDjg3QqqpOuUzrs77JqYkxSjqd0QgmwmgxOdbcF0SY+ebQhAd0UXY7wIs6ByDEHO +kElgJmnGKhOpf1SFpQh2qpKGq/MvcdHWN4oKri440wCf+czkrOTyGVc275oTbRnM +Z76Ro4JDuomyWeR9iQ5pP5ug4ciflLa7hlYcH0xJbF3b2M3BlnUYKMqih/TjqKdr +NBs121h64SPY0gh7kIvF +-----END CERTIFICATE----- diff --git a/tests/spread/integration/openjdk-17-jre-headless/task.yaml b/tests/spread/integration/openjdk-17-jre-headless/task.yaml new file mode 100644 index 000000000..275c4a6a1 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/task.yaml @@ -0,0 +1,62 @@ +summary: Integration tests for openjdk-17-jre-headless + +environment: + SLICE/classdatasharing: "class-data-sharing" + SLICE/core: "core" + SLICE/prefs: "prefs" +# SLICE/rmi: "rmi" # Tested in management slice + SLICE/debug: "debug" + SLICE/management: "management" + SLICE/jfr: "jfr" + SLICE/security: "security" + SLICE/tools: "tools" + +execute: | + # Test different slice installations + echo "SLICE=${SLICE}" + rootfs="$(install-slices openjdk-17-jre-headless_${SLICE} dash_bins)" + apt install --update -y openjdk-11-jdk-headless + javac *.java + jar cvf test.jar *.java + cp *.jar ${rootfs}/ + cp *.java ${rootfs}/ + cp *.class ${rootfs}/ + cp certificate.pem ${rootfs}/ + cd ${rootfs} + mkdir -p proc/self + for java in `find usr/lib/jvm -name java`; do + ln -sf /${java} proc/self/exe + chroot . ${java} --version + case ${SLICE} in + class-data-sharing) + chroot . ${java} -Xshare:dump + chroot . ${java} -XX:ArchiveClassesAtExit=archive.cds /Main.java + ;; + core) + chroot . ${java} -cp . Main + ;; + prefs) + chroot . ${java} -cp . PrefsTest put + chroot . ${java} -cp . PrefsTest get + ;; + debug) + chroot . ${java} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -cp . Main + ;; + management) + chroot . ${java} -Dcom.sun.management.jmxremote.port=5000 \ + -Dcom.sun.management.jmxremote.authenticate=false \ + -Dcom.sun.management.jmxremote=true \ + -Dcom.sun.management.jmxremote.ssl=false -cp . TestJMX + ;; + jfr) + chroot . ${java} -XX:+FlightRecorder -XX:StartFlightRecording=duration=60s,filename=dump.jfr -cp . Main + ;; + security) + chroot . ${java} -cp . ReadCertificate + ;; + tools) + DNAME="CN=Sample Cert, OU=R&D, O=Company Ltd., L=Dublin 4, S=Dublin, C=IE" + chroot . $(dirname ${java})/keytool -genkeypair -keystore foo -storepass barbar -keyalg RSA -dname "$DNAME" + ;; + esac + done From d55463bd705036ec4b654ce036778512053d668d Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Fri, 18 Oct 2024 08:18:31 +0200 Subject: [PATCH 18/24] feat(24.04): openjdk-11 headless slices (#349) --- slices/openjdk-11-jdk-headless.yaml | 162 +++++++++++++++ slices/openjdk-11-jre-headless.yaml | 192 ++++++++++++++++++ .../openjdk-11-jdk-headless/Main.java | 5 + .../MonitoringTest.java | 7 + .../RemoteInterface.java | 4 + .../SerializableObject.java | 4 + .../openjdk-11-jdk-headless/all.policy | 3 + .../openjdk-11-jdk-headless/task.yaml | 114 +++++++++++ .../openjdk-11-jre-headless/Main.java | 5 + .../openjdk-11-jre-headless/PrefsTest.java | 13 ++ .../ReadCertificate.java | 14 ++ .../openjdk-11-jre-headless/TestJMX.java | 39 ++++ .../openjdk-11-jre-headless/TestJMXMBean.java | 3 + .../openjdk-11-jre-headless/certificate.pem | 21 ++ .../openjdk-11-jre-headless/task.yaml | 63 ++++++ 15 files changed, 649 insertions(+) create mode 100644 slices/openjdk-11-jdk-headless.yaml create mode 100644 slices/openjdk-11-jre-headless.yaml create mode 100644 tests/spread/integration/openjdk-11-jdk-headless/Main.java create mode 100644 tests/spread/integration/openjdk-11-jdk-headless/MonitoringTest.java create mode 100644 tests/spread/integration/openjdk-11-jdk-headless/RemoteInterface.java create mode 100644 tests/spread/integration/openjdk-11-jdk-headless/SerializableObject.java create mode 100644 tests/spread/integration/openjdk-11-jdk-headless/all.policy create mode 100644 tests/spread/integration/openjdk-11-jdk-headless/task.yaml create mode 100644 tests/spread/integration/openjdk-11-jre-headless/Main.java create mode 100644 tests/spread/integration/openjdk-11-jre-headless/PrefsTest.java create mode 100644 tests/spread/integration/openjdk-11-jre-headless/ReadCertificate.java create mode 100644 tests/spread/integration/openjdk-11-jre-headless/TestJMX.java create mode 100644 tests/spread/integration/openjdk-11-jre-headless/TestJMXMBean.java create mode 100644 tests/spread/integration/openjdk-11-jre-headless/certificate.pem create mode 100644 tests/spread/integration/openjdk-11-jre-headless/task.yaml diff --git a/slices/openjdk-11-jdk-headless.yaml b/slices/openjdk-11-jdk-headless.yaml new file mode 100644 index 000000000..a2436fab4 --- /dev/null +++ b/slices/openjdk-11-jdk-headless.yaml @@ -0,0 +1,162 @@ +package: openjdk-11-jdk-headless + +essential: + - openjdk-11-jdk-headless_copyright + +slices: + + # OpenJDK binaries slice + core: + essential: + - libc6_libs + - openjdk-11-jre-headless_core + - openjdk-11-jre-headless_javac + - zlib1g_libs + contents: + /usr/lib/jvm/java-11-openjdk-*/bin/javac: + /usr/lib/jvm/java-11-openjdk-*/bin/javadoc: + /usr/lib/jvm/java-11-openjdk-*/bin/javap: + /usr/lib/jvm/java-11-openjdk-*/bin/jdeprscan: + /usr/lib/jvm/java-11-openjdk-*/bin/jdeps: + /usr/lib/jvm/java-11-openjdk-*/bin/jimage: + /usr/lib/jvm/java-11-openjdk-*/bin/serialver: + + # excludes jaotc - this requires binutils + standard: + essential: + - openjdk-11-jdk-headless_core + - openjdk-11-jre-headless_standard + contents: + /usr/lib/jvm/java-11-openjdk-*/bin/jar: + /usr/lib/jvm/java-11-openjdk-*/bin/jarsigner: + /usr/lib/jvm/java-11-openjdk-*/bin/jcmd: + /usr/lib/jvm/java-11-openjdk-*/bin/jdb: + /usr/lib/jvm/java-11-openjdk-*/bin/jfr: + /usr/lib/jvm/java-11-openjdk-*/bin/jhsdb: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-11-openjdk-*/bin/jinfo: + /usr/lib/jvm/java-11-openjdk-*/bin/jmap: + /usr/lib/jvm/java-11-openjdk-*/bin/jps: + /usr/lib/jvm/java-11-openjdk-*/bin/jrunscript: + /usr/lib/jvm/java-11-openjdk-*/bin/jshell: + /usr/lib/jvm/java-11-openjdk-*/bin/jstack: + /usr/lib/jvm/java-11-openjdk-*/bin/jstat: + /usr/lib/jvm/java-11-openjdk-*/bin/jstatd: + /usr/lib/jvm/java-11-openjdk-*/bin/rmic: + + # OpenJDK modules required to build the runtime image + modules: + essential: + - openjdk-11-jdk-headless_core + contents: + /usr/lib/jvm/java-11-openjdk-*/bin/jlink: + /usr/lib/jvm/java-11-openjdk-*/bin/jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.base.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.compiler.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.datatransfer.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.desktop.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.instrument.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.logging.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.management.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.management.rmi.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.naming.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.net.http.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.prefs.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.rmi.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.scripting.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.se.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.security.jgss.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.security.sasl.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.smartcardio.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.sql.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.sql.rowset.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.transaction.xa.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.xml.crypto.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.xml.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.accessibility.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.aot.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.attach.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.charsets.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.compiler.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.crypto.cryptoki.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.crypto.ec.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.dynalink.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.editpad.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.hotspot.agent.jmod: + arch: + - amd64 + - arm64 + - ppc64el + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.httpserver.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.ed.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.jvmstat.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.le.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.opt.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.vm.ci.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.vm.compiler.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.vm.compiler.management.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jartool.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.javadoc.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jcmd.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jconsole.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jdeps.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jdi.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jdwp.agent.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jfr.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jlink.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jshell.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jsobject.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jstatd.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.localedata.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.management.agent.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.management.jfr.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.management.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.naming.dns.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.naming.ldap.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.naming.rmi.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.net.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.pack.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.rmic.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.scripting.nashorn.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.scripting.nashorn.shell.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.sctp.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.security.auth.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.security.jgss.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.unsupported.desktop.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.unsupported.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.xml.dom.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.zipfs.jmod: + + # OpenJDK headers for JNI + headers: + contents: + /usr/lib/jvm/java-11-openjdk-*/include/classfile_constants.h: + /usr/lib/jvm/java-11-openjdk-*/include/jni.h: + /usr/lib/jvm/java-11-openjdk-*/include/jvmti.h: + /usr/lib/jvm/java-11-openjdk-*/include/jvmticmlr.h: + /usr/lib/jvm/java-11-openjdk-*/include/linux/jni_md.h: + + # OpenJDK headers for the debug agent development + debug-headers: + contents: + /usr/lib/jvm/java-11-openjdk-*/include/jdwpTransport.h: + + copyright: + essential: + - openjdk-11-jre-headless_copyright + contents: + /usr/share/doc/openjdk-11-jdk-headless: diff --git a/slices/openjdk-11-jre-headless.yaml b/slices/openjdk-11-jre-headless.yaml new file mode 100644 index 000000000..3b2d5c77d --- /dev/null +++ b/slices/openjdk-11-jre-headless.yaml @@ -0,0 +1,192 @@ +package: openjdk-11-jre-headless + +essential: + - openjdk-11-jre-headless_copyright + +slices: + + # A minimal set of files to run a Java application + # excluded dependencies: + # - ca-certificates-java_essential - needs chisel support to run + # maintainer scripts. + # - java-common - provides update-alternatives, + # not relevant. + # - util-linux - needed for bash completion + # not relevant. + # - libjpeg8 - used in awt, not relevant + # - liblcms2-2 - used in awt, not relevant + standard: + essential: + - openjdk-11-jre-headless_class-data-sharing + - openjdk-11-jre-headless_core + - openjdk-11-jre-headless_debug + - openjdk-11-jre-headless_jfr + - openjdk-11-jre-headless_management + - openjdk-11-jre-headless_prefs + - openjdk-11-jre-headless_rmi + - openjdk-11-jre-headless_security + - openjdk-11-jre-headless_tools + + # List of classes required to create the Class Data Sharing archive + class-data-sharing: + essential: + - openjdk-11-jre-headless_core + contents: + /usr/lib/jvm/java-11-openjdk-*/lib/classlist: + arch: + - amd64 + - arm64 + - armhf + - i386 + - ppc64el + - s390x + + # A minimal set of files to run a Java application + core: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + - zlib1g_libs + contents: + /etc/java-11-openjdk/jvm-*.cfg: + /etc/java-11-openjdk/logging.properties: + /etc/java-11-openjdk/management/jmxremote.access: + /etc/java-11-openjdk/management/management.properties: + /etc/java-11-openjdk/net.properties: + /etc/java-11-openjdk/security/java.policy: + /etc/java-11-openjdk/security/java.security: + /usr/lib/jvm/java-11-openjdk-*/bin/java: + /usr/lib/jvm/java-11-openjdk-*/conf/logging.properties: + /usr/lib/jvm/java-11-openjdk-*/conf/management/jmxremote.access: + /usr/lib/jvm/java-11-openjdk-*/conf/management/management.properties: + /usr/lib/jvm/java-11-openjdk-*/conf/net.properties: + /usr/lib/jvm/java-11-openjdk-*/conf/security/java.policy: + /usr/lib/jvm/java-11-openjdk-*/conf/security/java.security: + /usr/lib/jvm/java-11-openjdk-*/lib/jexec: + /usr/lib/jvm/java-11-openjdk-*/lib/jli/libjli.so: + /usr/lib/jvm/java-11-openjdk-*/lib/jspawnhelper: + /usr/lib/jvm/java-11-openjdk-*/lib/jvm.cfg: + /usr/lib/jvm/java-11-openjdk-*/lib/libextnet.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libjava.so: + # lib/modules support + /usr/lib/jvm/java-11-openjdk-*/lib/libjimage.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libjsig.so: + # required for IO. + /usr/lib/jvm/java-11-openjdk-*/lib/libnet.so: + # required for IO. + /usr/lib/jvm/java-11-openjdk-*/lib/libnio.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libverify.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libzip.so: + /usr/lib/jvm/java-11-openjdk-*/lib/modules: + /usr/lib/jvm/java-11-openjdk-*/lib/server/libjsig.so: + /usr/lib/jvm/java-11-openjdk-*/lib/server/libjvm.so: + /usr/lib/jvm/java-11-openjdk-*/lib/tzdb.dat: + + # Native part of jdk.prefs modules + prefs: + essential: + - openjdk-11-jre-headless_core + contents: + /usr/lib/jvm/java-11-openjdk-*/lib/libprefs.so: + + # Native part of java.rmi + rmi: + essential: + - openjdk-11-jre-headless_security + contents: + /usr/lib/jvm/java-11-openjdk-*/bin/rmid: + /usr/lib/jvm/java-11-openjdk-*/bin/rmiregistry: + /usr/lib/jvm/java-11-openjdk-*/lib/librmi.so: + + # Debug support + debug: + essential: + - openjdk-11-jre-headless_core + contents: + /usr/lib/jvm/java-11-openjdk-*/lib/libattach.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libdt_socket.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libinstrument.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libjdwp.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libsaproc.so: + arch: + - amd64 + - arm64 + - armhf + - ppc64el + + # Configuration and native part of Java Management Extensions + management: + essential: + - openjdk-11-jre-headless_rmi + contents: + /etc/java-11-openjdk/management/jmxremote.access: + /etc/java-11-openjdk/management/management.properties: + /usr/lib/jvm/java-11-openjdk-*/conf/management/jmxremote.access: + /usr/lib/jvm/java-11-openjdk-*/conf/management/management.properties: + /usr/lib/jvm/java-11-openjdk-*/lib/libmanagement.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libmanagement_agent.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libmanagement_ext.so: + + # Security configuration files and native libraries + security: + essential: + - libnss3_libs + - libpcsclite1_libs + - openjdk-11-jre-headless_core + contents: + /etc/java-11-openjdk/security/blocked.certs: + /etc/java-11-openjdk/security/default.policy: + /etc/java-11-openjdk/security/nss.cfg: + /etc/java-11-openjdk/security/policy/limited/default_US_export.policy: + /etc/java-11-openjdk/security/policy/limited/default_local.policy: + /etc/java-11-openjdk/security/policy/limited/exempt_local.policy: + /etc/java-11-openjdk/security/policy/unlimited/default_US_export.policy: + /etc/java-11-openjdk/security/policy/unlimited/default_local.policy: + /etc/java-11-openjdk/security/public_suffix_list.dat: + /usr/lib/jvm/java-11-openjdk-*/conf/security/nss.cfg: + /usr/lib/jvm/java-11-openjdk-*/conf/security/policy/limited/default_US_export.policy: + /usr/lib/jvm/java-11-openjdk-*/conf/security/policy/limited/default_local.policy: + /usr/lib/jvm/java-11-openjdk-*/conf/security/policy/limited/exempt_local.policy: + /usr/lib/jvm/java-11-openjdk-*/conf/security/policy/unlimited/default_US_export.policy: + /usr/lib/jvm/java-11-openjdk-*/conf/security/policy/unlimited/default_local.policy: + /usr/lib/jvm/java-11-openjdk-*/lib/libj2gss.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libj2pcsc.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libj2pkcs11.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libjaas.so: + /usr/lib/jvm/java-11-openjdk-*/lib/security/blocked.certs: + /usr/lib/jvm/java-11-openjdk-*/lib/security/cacerts: + /usr/lib/jvm/java-11-openjdk-*/lib/security/default.policy: + /usr/lib/jvm/java-11-openjdk-*/lib/security/public_suffix_list.dat: + + # OpenJDK tools + tools: + essential: + - openjdk-11-jre-headless_security + contents: + /usr/lib/jvm/java-11-openjdk-*/bin/jjs: + /usr/lib/jvm/java-11-openjdk-*/bin/keytool: + /usr/lib/jvm/java-11-openjdk-*/bin/pack200: + /usr/lib/jvm/java-11-openjdk-*/bin/unpack200: + + # Java Flight Recorder configuration and jar file + jfr: + essential: + - openjdk-11-jre-headless_core + contents: + /etc/java-11-openjdk/jfr/default.jfc: + /etc/java-11-openjdk/jfr/profile.jfc: + /usr/lib/jvm/java-11-openjdk-*/lib/jfr/default.jfc: + /usr/lib/jvm/java-11-openjdk-*/lib/jfr/profile.jfc: + /usr/lib/jvm/java-11-openjdk-*/lib/jrt-fs.jar: + + # Javac JDK API signatures for the backwards compatibility + javac: + essential: + - openjdk-11-jre-headless_core + contents: + /usr/lib/jvm/java-11-openjdk-*/lib/ct.sym: + + copyright: + contents: + /usr/share/doc/openjdk-11-jre-headless/copyright: diff --git a/tests/spread/integration/openjdk-11-jdk-headless/Main.java b/tests/spread/integration/openjdk-11-jdk-headless/Main.java new file mode 100644 index 000000000..40b5eeef0 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jdk-headless/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args){ + System.out.println("Hello world"); + } +} diff --git a/tests/spread/integration/openjdk-11-jdk-headless/MonitoringTest.java b/tests/spread/integration/openjdk-11-jdk-headless/MonitoringTest.java new file mode 100644 index 000000000..aa09573ff --- /dev/null +++ b/tests/spread/integration/openjdk-11-jdk-headless/MonitoringTest.java @@ -0,0 +1,7 @@ +public class MonitoringTest { + public static void main(String[] args) throws InterruptedException { + while (true) { + Thread.sleep(1000); + } + } +} diff --git a/tests/spread/integration/openjdk-11-jdk-headless/RemoteInterface.java b/tests/spread/integration/openjdk-11-jdk-headless/RemoteInterface.java new file mode 100644 index 000000000..d19403634 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jdk-headless/RemoteInterface.java @@ -0,0 +1,4 @@ +import java.rmi.Remote; + +public class RemoteInterface implements Remote { +} diff --git a/tests/spread/integration/openjdk-11-jdk-headless/SerializableObject.java b/tests/spread/integration/openjdk-11-jdk-headless/SerializableObject.java new file mode 100644 index 000000000..b46056421 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jdk-headless/SerializableObject.java @@ -0,0 +1,4 @@ +import java.io.Serializable; + +public class SerializableObject implements Serializable { +} diff --git a/tests/spread/integration/openjdk-11-jdk-headless/all.policy b/tests/spread/integration/openjdk-11-jdk-headless/all.policy new file mode 100644 index 000000000..1d0ce8867 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jdk-headless/all.policy @@ -0,0 +1,3 @@ +grant { + permission java.security.AllPermission; +}; diff --git a/tests/spread/integration/openjdk-11-jdk-headless/task.yaml b/tests/spread/integration/openjdk-11-jdk-headless/task.yaml new file mode 100644 index 000000000..b5afd1f02 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jdk-headless/task.yaml @@ -0,0 +1,114 @@ +summary: Integration tests for openjdk-11-jdk-headless + +environment: + SLICE/core: "core" + SLICE/standard: "standard" + SLICE/modules: "modules" + +execute: | + pids=() + cleanup() { + for pid in "${pids[@]}"; do + kill "$pid" || true + done + } + for sig in INT QUIT HUP TERM; do trap "cleanup; trap - $sig EXIT; kill -s $sig "'"$$"' "$sig"; done + trap cleanup EXIT + + apt install --update -y openjdk-11-jdk-headless + + # Test different slice installations + echo "SLICE=${SLICE}" + rootfs="$(install-slices openjdk-11-jdk-headless_${SLICE} dash_bins)" + cp *.java ${rootfs}/ + cp all.policy ${rootfs}/ + javac *.java + + nohup java -cp . MonitoringTest & + pid=$! + pids+=("$pid") + + cp *.class ${rootfs}/ + cd ${rootfs} + mkdir -p proc sys tmp + mount --bind /proc proc + mount --bind /sys sys + mount --bind /tmp tmp + case ${SLICE} in + core) + for java in `find usr/lib/jvm -name java`; do + home=$(dirname ${java}) + # /usr/lib/jvm/java-11-openjdk-*/bin/javac: + chroot . ${home}/javac /Main.java -d / + # /usr/lib/jvm/java-11-openjdk-*/bin/javadoc: + chroot . ${home}/javadoc /Main.java + # /usr/lib/jvm/java-11-openjdk-*/bin/javap: + chroot . ${home}/javap -l /Main.class + # /usr/lib/jvm/java-11-openjdk-*/bin/jdeprscan: + chroot . ${home}/jdeprscan --class-path . Main + # /usr/lib/jvm/java-11-openjdk-*/bin/jdeps: + chroot . ${home}/jdeps -m java.base + # /usr/lib/jvm/java-11-openjdk-*/bin/jimage: + chroot . ${home}/jimage info ${home}/../lib/modules + # /usr/lib/jvm/java-11-openjdk-*/bin/serialver: + chroot . ${home}/serialver -classpath / SerializableObject + done + ;; + standard) + for java in `find usr/lib/jvm -name java`; do + home=$(dirname ${java}) + # /usr/lib/jvm/java-11-openjdk-*/bin/jar: + # /usr/lib/jvm/java-11-openjdk-*/bin/jarsigner: + chroot . ${home}/jar cvf test.jar *.java + DNAME="CN=Sample Cert, OU=R&D, O=Company Ltd., L=Dublin 4, S=Dublin, C=IE" + chroot . ${home}/keytool -genkeypair -keystore foo -storepass barbar -keyalg RSA -dname "$DNAME" -alias foo + chroot . ${home}/jarsigner -keystore foo -storepass barbar test.jar foo + # /usr/lib/jvm/java-11-openjdk-*/bin/jdb: + chroot . /usr/bin/sh -c "echo run | ${home}/jdb Main.java" + # /usr/lib/jvm/java-11-openjdk-*/bin/jcmd: + chroot . ${home}/jcmd MonitoringTest VM.version + # /usr/lib/jvm/java-11-openjdk-*/bin/jhsdb: + if [ -f ${home}/jhsdb ]; then + chroot . ${home}/jhsdb jstack --pid ${pid} + fi + # /usr/lib/jvm/java-11-openjdk-*/bin/jfr: + chroot . ${home}/jcmd ${pid} JFR.start name=recording maxsize=1MB + chroot . ${home}/jcmd ${pid} JFR.dump name=recording filename=/tmp/recording.jfr + chroot . ${home}/jfr print /tmp/recording.jfr > /dev/null + # /usr/lib/jvm/java-11-openjdk-*/bin/jinfo: + chroot . ${home}/jinfo ${pid} + # /usr/lib/jvm/java-11-openjdk-*/bin/jrunscript: + chroot . /usr/bin/sh -c "echo 'exit()' | ${home}/jrunscript" + # /usr/lib/jvm/java-11-openjdk-*/bin/jshell: + chroot . /usr/bin/sh -c "echo 'System.out.println(\"hello world\")' | ${home}/jshell" + # /usr/lib/jvm/java-11-openjdk-*/bin/jstack: + chroot . ${home}/jstack ${pid} + # /usr/lib/jvm/java-11-openjdk-*/bin/jstat: + chroot . ${home}/jstat -gc ${pid} + # /usr/lib/jvm/java-11-openjdk-*/bin/jstatd: + nohup chroot . ${home}/jstatd -J-Djava.security.policy=all.policy > ./jstatd.log & + pids+=($!) + for retry in 0 1 2 3 4 5; do + if [ ${retry} -eq 5 ]; then + exit 1 + fi + grep -q "bound to /JStatRemoteHost" "jstatd.log" && break + sleep 10 + done + # /usr/lib/jvm/java-11-openjdk-*/bin/rmic + chroot . ${home}/rmic -classpath . RemoteInterface + done + ;; + modules) + cd ${rootfs} + for jlink in `find usr/lib/jvm -name jlink`; do + output=$(basename $(mktemp -u)) + chroot . ${jlink} --add-modules java.base --output ${output} + rm -rf ${rootfs}/${output} + done + for jmod in `find usr/lib/jvm -name jmod`; do + home=$(dirname ${jmod}) + chroot . ${jmod} list ${home}/../jmods/java.rmi.jmod + done + ;; + esac diff --git a/tests/spread/integration/openjdk-11-jre-headless/Main.java b/tests/spread/integration/openjdk-11-jre-headless/Main.java new file mode 100644 index 000000000..47e5d0af7 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args) { + System.out.println("Hello world"); + } +} diff --git a/tests/spread/integration/openjdk-11-jre-headless/PrefsTest.java b/tests/spread/integration/openjdk-11-jre-headless/PrefsTest.java new file mode 100644 index 000000000..73c4ee63e --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/PrefsTest.java @@ -0,0 +1,13 @@ +import java.util.prefs.*; + +public class PrefsTest { + public static void main(String[] args) { + if ("put".equals(args[0])) { + Preferences.userRoot().put("a", "b"); + } else if ("get".equals(args[0])) { + if (!"b".equals(Preferences.userRoot().get("a", null))) { + throw new RuntimeException("Unable to read the preference"); + } + } + } +} diff --git a/tests/spread/integration/openjdk-11-jre-headless/ReadCertificate.java b/tests/spread/integration/openjdk-11-jre-headless/ReadCertificate.java new file mode 100644 index 000000000..ef92fd99b --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/ReadCertificate.java @@ -0,0 +1,14 @@ +import java.security.cert.*; +import java.io.*; +import java.nio.file.Files; +import java.nio.file.Path; + +public class ReadCertificate { + + public static void main(String[] args) throws Throwable { + byte[] pem = Files.readAllBytes(Path.of("certificate.pem")); + java.security.cert.Certificate cert = CertificateFactory.getInstance("X509").generateCertificate(new ByteArrayInputStream(pem)); + if (cert == null) + throw new RuntimeException("It should be possible to decode a certificate"); + } +} diff --git a/tests/spread/integration/openjdk-11-jre-headless/TestJMX.java b/tests/spread/integration/openjdk-11-jre-headless/TestJMX.java new file mode 100644 index 000000000..e27d058d8 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/TestJMX.java @@ -0,0 +1,39 @@ +import java.lang.management.ManagementFactory; +import javax.management.Attribute; +import javax.management.AttributeList; +import javax.management.AttributeNotFoundException; +import javax.management.DynamicMBean; +import javax.management.InstanceAlreadyExistsException; +import javax.management.InvalidAttributeValueException; +import javax.management.MBeanException; +import javax.management.MBeanInfo; +import javax.management.MBeanRegistrationException; +import javax.management.MBeanServer; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.NotCompliantMBeanException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.*; +import com.sun.tools.attach.*; + +public class TestJMX implements TestJMXMBean { + + static final String CONNECTOR_ADDRESS = + "com.sun.management.jmxremote.localConnectorAddress"; + + @Override + public void test() { + } + + public static void main(String[] args) throws Throwable { + ObjectName objectName = new ObjectName("test:type=basic,name=mbeantest"); + MBeanServer server = ManagementFactory.getPlatformMBeanServer(); + server.registerMBean(new TestJMX(), objectName); + JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:5000/jmxrmi"); + int count = JMXConnectorFactory.connect(url) + .getMBeanServerConnection() + .getMBeanCount(); + System.out.println(count); + } +} diff --git a/tests/spread/integration/openjdk-11-jre-headless/TestJMXMBean.java b/tests/spread/integration/openjdk-11-jre-headless/TestJMXMBean.java new file mode 100644 index 000000000..c75f6c573 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/TestJMXMBean.java @@ -0,0 +1,3 @@ +public interface TestJMXMBean { + void test(); +} diff --git a/tests/spread/integration/openjdk-11-jre-headless/certificate.pem b/tests/spread/integration/openjdk-11-jre-headless/certificate.pem new file mode 100644 index 000000000..645e9f80c --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/certificate.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDazCCAlOgAwIBAgIULvuqN3MiptnZSYS9y1qJAZYKFA4wDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA4MTUwMjQzNDhaFw0yNTA4 +MTUwMjQzNDhaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDm3990peBuPYaz0UEEc75Q7i79P4RzrD84MxhDpoPs +MSdnmO3rTkIG84Wp72+8T7TGjGjBhX++8UmZLrXy2AfcejZi3JcddMWH4V5XEnAj +hTBe1HLkiotayZst/cxuTP6KmuahjsROAqriCv/A4BBA8KjYx1e4E9k9+81FreZy +PJ8p3m7R8qZ/DtjuW1aMQ3oDRKA/iqQhLHVpJy/iYiyjwTdJm6/lA3ywGCr6ZMWm +9tWUT+4TvhyRM67Y0gcCtH51cwxPqUFGEKAkLWIu2fS6DaoXtHylxgGeKKPes3JX +uSn9QezEEqvrgLFQRqIUS8tNZFEhoJQ7dmxMP/XKAD51AgMBAAGjUzBRMB0GA1Ud +DgQWBBSb70j+xaI3eTxp4H7MDm1MLVRGNTAfBgNVHSMEGDAWgBSb70j+xaI3eTxp +4H7MDm1MLVRGNTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAp +0GIjKtwvD7BkQy+cf3dsdwYodxoIYl4E8UvHfBSPQQfFNh+chHPmrNYRuFM3Q6sT +ogNhHKLecQMK4tNUDa/vVRGnqmZVWjxqLnyH/qFKtakqPB6h6x4h50huzA+twhNm +SDjg3QqqpOuUzrs77JqYkxSjqd0QgmwmgxOdbcF0SY+ebQhAd0UXY7wIs6ByDEHO +kElgJmnGKhOpf1SFpQh2qpKGq/MvcdHWN4oKri440wCf+czkrOTyGVc275oTbRnM +Z76Ro4JDuomyWeR9iQ5pP5ug4ciflLa7hlYcH0xJbF3b2M3BlnUYKMqih/TjqKdr +NBs121h64SPY0gh7kIvF +-----END CERTIFICATE----- diff --git a/tests/spread/integration/openjdk-11-jre-headless/task.yaml b/tests/spread/integration/openjdk-11-jre-headless/task.yaml new file mode 100644 index 000000000..114d3387a --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/task.yaml @@ -0,0 +1,63 @@ +summary: Integration tests for openjdk-11-jre-headless + +environment: + SLICE/classdatasharing: "class-data-sharing" + SLICE/core: "core" + SLICE/prefs: "prefs" +# SLICE/rmi: "rmi" # Tested in management slice + SLICE/debug: "debug" + SLICE/management: "management" + SLICE/jfr: "jfr" + SLICE/security: "security" + SLICE/tools: "tools" + +execute: | + # Test different slice installations + echo "SLICE=${SLICE}" + rootfs="$(install-slices openjdk-11-jre-headless_${SLICE} dash_bins)" + apt install --update -y openjdk-11-jdk-headless + javac *.java + jar cvf test.jar *.java + cp *.jar ${rootfs}/ + cp *.java ${rootfs}/ + cp *.class ${rootfs}/ + cp certificate.pem ${rootfs}/ + cd ${rootfs} + mkdir -p proc/self + for java in `find usr/lib/jvm -name java`; do + ln -sf /${java} proc/self/exe + chroot . ${java} --version + case ${SLICE} in + class-data-sharing) + chroot . ${java} -Xshare:dump + ;; + core) + chroot . ${java} -cp . Main + ;; + prefs) + chroot . ${java} -cp . PrefsTest put + chroot . ${java} -cp . PrefsTest get + ;; + debug) + chroot . ${java} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -cp . Main + ;; + management) + chroot . ${java} -Dcom.sun.management.jmxremote.port=5000 \ + -Dcom.sun.management.jmxremote.authenticate=false \ + -Dcom.sun.management.jmxremote=true \ + -Dcom.sun.management.jmxremote.ssl=false -cp . TestJMX + ;; + jfr) + chroot . ${java} -XX:+FlightRecorder -XX:StartFlightRecording=duration=60s,filename=dump.jfr -cp . Main + ;; + security) + chroot . ${java} -cp . ReadCertificate + ;; + tools) + DNAME="CN=Sample Cert, OU=R&D, O=Company Ltd., L=Dublin 4, S=Dublin, C=IE" + chroot . $(dirname ${java})/keytool -genkeypair -keystore foo -storepass barbar -keyalg RSA -dname "$DNAME" + chroot . $(dirname ${java})/pack200 foo.pack.gz test.jar + chroot . $(dirname ${java})/unpack200 foo.pack.gz test1.jar + ;; + esac + done From 3bf3f9ef7429c56e3716066e7023a45858e67af0 Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Mon, 21 Oct 2024 12:30:35 +0200 Subject: [PATCH 19/24] feat: extract _server_vm and _client_vm slices (#360) --- slices/openjdk-8-jre-headless.yaml | 42 +++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/slices/openjdk-8-jre-headless.yaml b/slices/openjdk-8-jre-headless.yaml index 501a767be..2d247c955 100644 --- a/slices/openjdk-8-jre-headless.yaml +++ b/slices/openjdk-8-jre-headless.yaml @@ -10,6 +10,8 @@ slices: - libc6_libs - libgcc-s1_libs - libstdc++6_libs + - openjdk-8-jre-headless_client-vm + - openjdk-8-jre-headless_server-vm - zlib1g_libs contents: /etc/java-8-openjdk/calendars.properties: @@ -20,8 +22,6 @@ slices: # various classes and how they can interact with the system. /etc/java-8-openjdk/security/java.policy: /usr/lib/jvm/java-8-openjdk-*/jre/bin/java: - /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/client/libjsig.so: {arch: armhf} - /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/client/libjvm.so: {arch: armhf} /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/jli/libjli.so: /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/jvm.cfg-default: /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/libjava.so: @@ -30,17 +30,6 @@ slices: /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/libnio.so: /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/libverify.so: /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/libzip.so: - /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/server/libjsig.so: - arch: - - amd64 - - arm64 - - ppc64el - /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/server/libjvm.so: - arch: - - amd64 - - arm64 - - ppc64el - - s390x /usr/lib/jvm/java-8-openjdk-*/jre/lib/calendars.properties: /usr/lib/jvm/java-8-openjdk-*/jre/lib/content-types.properties: /usr/lib/jvm/java-8-openjdk-*/jre/lib/currency.data: @@ -53,6 +42,33 @@ slices: /usr/lib/jvm/java-8-openjdk-*/jre/lib/security/java.policy: /usr/lib/jvm/java-8-openjdk-*/jre/lib/tzdb.dat: + client-vm: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + contents: + /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/client/libjsig.so: {arch: armhf} + /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/client/libjvm.so: {arch: armhf} + + server-vm: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + contents: + /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/server/libjsig.so: + arch: + - amd64 + - arm64 + - ppc64el + /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/server/libjvm.so: + arch: + - amd64 + - arm64 + - ppc64el + - s390x + locale: essential: - openjdk-8-jre-headless_core From 7824fd72f13d8503314026b1cc548bd1778311a5 Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Thu, 31 Oct 2024 15:30:57 +0600 Subject: [PATCH 20/24] fix(24.04): add default archive in chisel.yaml (#375) --- chisel.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/chisel.yaml b/chisel.yaml index d414b9c44..d5aa55478 100644 --- a/chisel.yaml +++ b/chisel.yaml @@ -2,6 +2,7 @@ format: v1 archives: ubuntu: + default: true version: 24.04 components: [main, universe] suites: [noble, noble-security, noble-updates] From c2a9c425d418d2d41ed1ed3dbbaf5c8d4a3031f9 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Wed, 6 Nov 2024 14:06:34 +0100 Subject: [PATCH 21/24] fix(spread-24.04): make spread work on armhf (#370) This fixes an error where spread tests on docker for armhf was failing the preparation step due to getting both the arm and arm64 downloads. --- spread.yaml | 2 +- tests/spread/integration/dash/task.yaml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/spread/integration/dash/task.yaml diff --git a/spread.yaml b/spread.yaml index 83e8dbc7f..f40a24fd7 100644 --- a/spread.yaml +++ b/spread.yaml @@ -87,7 +87,7 @@ prepare: | apt install -y curl wget curl -s https://api.github.com/repos/canonical/chisel/releases/latest \ - | awk "/browser_download_url/ && /chisel_v/ && /$arch/" \ + | awk "/browser_download_url/ && /chisel_v/ && /_$arch\./" \ | cut -d : -f 2,3 \ | tr -d \" \ | xargs wget diff --git a/tests/spread/integration/dash/task.yaml b/tests/spread/integration/dash/task.yaml new file mode 100644 index 000000000..3d3f7e4b9 --- /dev/null +++ b/tests/spread/integration/dash/task.yaml @@ -0,0 +1,8 @@ +summary: Integration tests for dash + +execute: | + rootfs="$(install-slices dash_bins)" + + chroot "${rootfs}" dash -c "echo Success > /test" + + test $(cat "${rootfs}/test") == "Success" From 535c3b182f82c03c2a9e0474c1f04def54985b4a Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Thu, 7 Nov 2024 10:39:47 +0100 Subject: [PATCH 22/24] feat: add dosfstools (#341) --- slices/dosfstools.yaml | 24 +++++++++++++++++++ tests/spread/integration/dosfstools/task.yaml | 24 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 slices/dosfstools.yaml create mode 100644 tests/spread/integration/dosfstools/task.yaml diff --git a/slices/dosfstools.yaml b/slices/dosfstools.yaml new file mode 100644 index 000000000..fea15614e --- /dev/null +++ b/slices/dosfstools.yaml @@ -0,0 +1,24 @@ +package: dosfstools + +essential: + - dosfstools_copyright + +slices: + bins: + essential: + - libc6_libs + contents: + /usr/sbin/dosfsck: + /usr/sbin/dosfslabel: + /usr/sbin/fatlabel: + /usr/sbin/fsck.fat: + /usr/sbin/fsck.msdos: + /usr/sbin/fsck.vfat: + /usr/sbin/mkdosfs: + /usr/sbin/mkfs.fat: + /usr/sbin/mkfs.msdos: + /usr/sbin/mkfs.vfat: + + copyright: + contents: + /usr/share/doc/dosfstools/copyright: diff --git a/tests/spread/integration/dosfstools/task.yaml b/tests/spread/integration/dosfstools/task.yaml new file mode 100644 index 000000000..89bb4188a --- /dev/null +++ b/tests/spread/integration/dosfstools/task.yaml @@ -0,0 +1,24 @@ +summary: Integration tests for dosfstools + +execute: | + # Chisel a minimum number of slices to give us a runnable system that we can + # test in. + rootfs="$(install-slices dosfstools_bins)" + + # create a test image + dd if=/dev/zero of="${rootfs}/test.img" bs=1M count=250 + + # format the test image as fat + chroot "${rootfs}" mkfs.fat test.img + + # check that the format was fine + chroot "${rootfs}" fsck.fat test.img | grep "0 files" + + # change the label of the image + chroot "${rootfs}" fatlabel test.img "TESTIMG" + + # verify it changed + chroot "${rootfs}" fatlabel test.img | grep "TESTIMG" + + # cleanup + rm "${rootfs}/test.img" From c396fec5330cea8da911e247bd622402b84e7c42 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Thu, 7 Nov 2024 10:53:46 +0100 Subject: [PATCH 23/24] feat(24.04): gpg and dependencies (#324) --- slices/gpg.yaml | 24 ++++++++++++++++ slices/gpgconf.yaml | 32 ++++++++++++++++++++++ slices/libassuan0.yaml | 16 +++++++++++ slices/libnpth0t64.yaml | 15 ++++++++++ tests/spread/integration/gpg/task.yaml | 23 ++++++++++++++++ tests/spread/integration/gpgconf/task.yaml | 12 ++++++++ 6 files changed, 122 insertions(+) create mode 100644 slices/gpg.yaml create mode 100644 slices/gpgconf.yaml create mode 100644 slices/libassuan0.yaml create mode 100644 slices/libnpth0t64.yaml create mode 100644 tests/spread/integration/gpg/task.yaml create mode 100644 tests/spread/integration/gpgconf/task.yaml diff --git a/slices/gpg.yaml b/slices/gpg.yaml new file mode 100644 index 000000000..9b2aaf5f2 --- /dev/null +++ b/slices/gpg.yaml @@ -0,0 +1,24 @@ +package: gpg + +essential: + - gpg_copyright + +slices: + bins: + essential: + # gpgconf is not included here as some gpg tasks work without it. + - libassuan0_libs + - libbz2-1.0_libs + - libc6_libs + - libgcrypt20_libs + - libgpg-error0_libs + - libnpth0t64_libs + - libreadline8t64_libs + - libsqlite3-0_libs + - zlib1g_libs + contents: + /usr/bin/gpg: + + copyright: + contents: + /usr/share/doc/gpg/copyright: diff --git a/slices/gpgconf.yaml b/slices/gpgconf.yaml new file mode 100644 index 000000000..1d88e5598 --- /dev/null +++ b/slices/gpgconf.yaml @@ -0,0 +1,32 @@ +package: gpgconf + +essential: + - gpgconf_copyright + +slices: + bins: + essential: + - gpgconf_gpg-connect-agent + - gpgconf_gpgconf + + gpg-connect-agent: + essential: + - libassuan0_libs + - libc6_libs + - libgcrypt20_libs + - libgpg-error0_libs + - libreadline8t64_libs + contents: + /usr/bin/gpg-connect-agent: + + gpgconf: + essential: + - libc6_libs + - libgcrypt20_libs + - libgpg-error0_libs + contents: + /usr/bin/gpgconf: + + copyright: + contents: + /usr/share/doc/gpgconf/copyright: diff --git a/slices/libassuan0.yaml b/slices/libassuan0.yaml new file mode 100644 index 000000000..e71bc6794 --- /dev/null +++ b/slices/libassuan0.yaml @@ -0,0 +1,16 @@ +package: libassuan0 + +essential: + - libassuan0_copyright + +slices: + libs: + essential: + - libc6_libs + - libgpg-error0_libs + contents: + /usr/lib/*-linux-*/libassuan.so.0*: + + copyright: + contents: + /usr/share/doc/libassuan0/copyright: diff --git a/slices/libnpth0t64.yaml b/slices/libnpth0t64.yaml new file mode 100644 index 000000000..54b18e4d9 --- /dev/null +++ b/slices/libnpth0t64.yaml @@ -0,0 +1,15 @@ +package: libnpth0t64 + +essential: + - libnpth0t64_copyright + +slices: + libs: + essential: + - libc6_libs + contents: + /usr/lib/*-linux-*/libnpth.so.0*: + + copyright: + contents: + /usr/share/doc/libnpth0t64/copyright: diff --git a/tests/spread/integration/gpg/task.yaml b/tests/spread/integration/gpg/task.yaml new file mode 100644 index 000000000..a546da6ba --- /dev/null +++ b/tests/spread/integration/gpg/task.yaml @@ -0,0 +1,23 @@ +summary: Integration tests for gpg + +execute: | + rootfs="$(install-slices gpg_bins)" + + # Create a key-generation script + echo << EOF > "${rootfs}/keygen-script" + Key-Type: default + Key-Length: 2048 + Subkey-Type: default + Subkey-Length: 2048 + Name-Real: Root Superuser + Name-Email: example@example.com + Expire-Date: 0 + %no-protection + EOF + # Needs a root homedir + mkdir -p "${rootfs}/root" + + chroot "${rootfs}/" gpg --version + chroot "${rootfs}/" gpg --list-secret-keys + # Generate a key + chroot "${rootfs}/" gpg --batch --generate-key /keygen-script diff --git a/tests/spread/integration/gpgconf/task.yaml b/tests/spread/integration/gpgconf/task.yaml new file mode 100644 index 000000000..6ab065602 --- /dev/null +++ b/tests/spread/integration/gpgconf/task.yaml @@ -0,0 +1,12 @@ +summary: Integration tests for gpgconf + +execute: | + rootfs="$(install-slices gpgconf_gpgconf)" + + # Basic check + chroot "${rootfs}/" gpgconf --list-components + + rootfs="$(install-slices dash_bins gpgconf_gpg-connect-agent)" + chroot "${rootfs}/" gpg-connect-agent --version + output=$(! chroot "${rootfs}/" sh -c 'gpg-connect-agent /help 2>&1') + [[ "$output" == *'No agent running' ]] From d8dc1f7c0e1997c4a0f845ae4a7737ccb75f333e Mon Sep 17 00:00:00 2001 From: Hadrien Patte Date: Thu, 7 Nov 2024 12:28:09 +0100 Subject: [PATCH 24/24] feat(24.04): add ffmpeg dependencies slices (#359) --- slices/libbluray2.yaml | 19 +++++++++++++++++++ slices/libdrm-amdgpu1.yaml | 16 ++++++++++++++++ slices/libdrm-common.yaml | 13 +++++++++++++ slices/libdrm-intel1.yaml | 17 +++++++++++++++++ slices/libdrm-nouveau2.yaml | 16 ++++++++++++++++ slices/libdrm-radeon1.yaml | 16 ++++++++++++++++ slices/libdrm2.yaml | 16 ++++++++++++++++ slices/libva-drm2.yaml | 17 +++++++++++++++++ slices/libwayland-client0.yaml | 16 ++++++++++++++++ slices/libzvbi0t64.yaml | 19 +++++++++++++++++++ 10 files changed, 165 insertions(+) create mode 100644 slices/libbluray2.yaml create mode 100644 slices/libdrm-amdgpu1.yaml create mode 100644 slices/libdrm-common.yaml create mode 100644 slices/libdrm-intel1.yaml create mode 100644 slices/libdrm-nouveau2.yaml create mode 100644 slices/libdrm-radeon1.yaml create mode 100644 slices/libdrm2.yaml create mode 100644 slices/libva-drm2.yaml create mode 100644 slices/libwayland-client0.yaml create mode 100644 slices/libzvbi0t64.yaml diff --git a/slices/libbluray2.yaml b/slices/libbluray2.yaml new file mode 100644 index 000000000..d9a8736fe --- /dev/null +++ b/slices/libbluray2.yaml @@ -0,0 +1,19 @@ +package: libbluray2 + +essential: + - libbluray2_copyright + +slices: + libs: + essential: + - libc6_libs + - libfontconfig1_libs + - libfreetype6_libs + - libudfread0_libs + - libxml2_libs + contents: + /usr/lib/*-linux-*/libbluray.so.2*: + + copyright: + contents: + /usr/share/doc/libbluray2/copyright: diff --git a/slices/libdrm-amdgpu1.yaml b/slices/libdrm-amdgpu1.yaml new file mode 100644 index 000000000..7be8192e7 --- /dev/null +++ b/slices/libdrm-amdgpu1.yaml @@ -0,0 +1,16 @@ +package: libdrm-amdgpu1 + +essential: + - libdrm-amdgpu1_copyright + +slices: + libs: + essential: + - libc6_libs + - libdrm2_libs + contents: + /usr/lib/*-linux-*/libdrm_amdgpu.so.1*: + + copyright: + contents: + /usr/share/doc/libdrm-amdgpu1/copyright: diff --git a/slices/libdrm-common.yaml b/slices/libdrm-common.yaml new file mode 100644 index 000000000..2d2d17c35 --- /dev/null +++ b/slices/libdrm-common.yaml @@ -0,0 +1,13 @@ +package: libdrm-common + +essential: + - libdrm-common_copyright + +slices: + data: + contents: + /usr/share/libdrm/amdgpu.ids: + + copyright: + contents: + /usr/share/doc/libdrm-common/copyright: diff --git a/slices/libdrm-intel1.yaml b/slices/libdrm-intel1.yaml new file mode 100644 index 000000000..6e5d94b29 --- /dev/null +++ b/slices/libdrm-intel1.yaml @@ -0,0 +1,17 @@ +package: libdrm-intel1 + +essential: + - libdrm-intel1_copyright + +slices: + libs: + essential: + - libc6_libs + - libdrm2_libs + - libpciaccess0_libs + contents: + /usr/lib/*-linux-*/libdrm_intel.so.1*: + + copyright: + contents: + /usr/share/doc/libdrm-intel1/copyright: diff --git a/slices/libdrm-nouveau2.yaml b/slices/libdrm-nouveau2.yaml new file mode 100644 index 000000000..54789f56a --- /dev/null +++ b/slices/libdrm-nouveau2.yaml @@ -0,0 +1,16 @@ +package: libdrm-nouveau2 + +essential: + - libdrm-nouveau2_copyright + +slices: + libs: + essential: + - libc6_libs + - libdrm2_libs + contents: + /usr/lib/*-linux-*/libdrm_nouveau.so.2*: + + copyright: + contents: + /usr/share/doc/libdrm-nouveau2/copyright: diff --git a/slices/libdrm-radeon1.yaml b/slices/libdrm-radeon1.yaml new file mode 100644 index 000000000..68407e3fb --- /dev/null +++ b/slices/libdrm-radeon1.yaml @@ -0,0 +1,16 @@ +package: libdrm-radeon1 + +essential: + - libdrm-radeon1_copyright + +slices: + libs: + essential: + - libc6_libs + - libdrm2_libs + contents: + /usr/lib/*-linux-*/libdrm_radeon.so.1*: + + copyright: + contents: + /usr/share/doc/libdrm-radeon1/copyright: diff --git a/slices/libdrm2.yaml b/slices/libdrm2.yaml new file mode 100644 index 000000000..8bf121e2d --- /dev/null +++ b/slices/libdrm2.yaml @@ -0,0 +1,16 @@ +package: libdrm2 + +essential: + - libdrm2_copyright + +slices: + libs: + essential: + - libc6_libs + - libdrm-common_data + contents: + /usr/lib/*-linux-*/libdrm.so.2*: + + copyright: + contents: + /usr/share/doc/libdrm2/copyright: diff --git a/slices/libva-drm2.yaml b/slices/libva-drm2.yaml new file mode 100644 index 000000000..a5a70d1e3 --- /dev/null +++ b/slices/libva-drm2.yaml @@ -0,0 +1,17 @@ +package: libva-drm2 + +essential: + - libva-drm2_copyright + +slices: + libs: + essential: + - libc6_libs + - libdrm2_libs + - libva2_libs + contents: + /usr/lib/*-linux-*/libva-drm.so.2*: + + copyright: + contents: + /usr/share/doc/libva-drm2/copyright: diff --git a/slices/libwayland-client0.yaml b/slices/libwayland-client0.yaml new file mode 100644 index 000000000..a8a20c5e5 --- /dev/null +++ b/slices/libwayland-client0.yaml @@ -0,0 +1,16 @@ +package: libwayland-client0 + +essential: + - libwayland-client0_copyright + +slices: + libs: + essential: + - libc6_libs + - libffi8_libs + contents: + /usr/lib/*-linux-*/libwayland-client.so.0*: + + copyright: + contents: + /usr/share/doc/libwayland-client0/copyright: diff --git a/slices/libzvbi0t64.yaml b/slices/libzvbi0t64.yaml new file mode 100644 index 000000000..6ce898744 --- /dev/null +++ b/slices/libzvbi0t64.yaml @@ -0,0 +1,19 @@ +package: libzvbi0t64 + +essential: + - libzvbi0t64_copyright + +slices: + libs: + essential: + - libc6_libs + - libpng16-16t64_libs + # The dependency on libzvbi-common is omitted as that package only contains + # translation strings in machine object files under /usr/share/locale + contents: + /usr/lib/*-linux-*/libzvbi-chains.so.0*: + /usr/lib/*-linux-*/libzvbi.so.0*: + + copyright: + contents: + /usr/share/doc/libzvbi0t64/copyright: