From 535c3b182f82c03c2a9e0474c1f04def54985b4a Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Thu, 7 Nov 2024 10:39:47 +0100 Subject: [PATCH] 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 00000000..fea15614 --- /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 00000000..89bb4188 --- /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"