Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | require e2fsprogs.inc |
| 2 | |
| 3 | SRC_URI += "file://remove.ldconfig.call.patch \ |
| 4 | file://run-ptest \ |
| 5 | file://ptest.patch \ |
| 6 | file://mkdir_p.patch \ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 7 | " |
| 8 | SRC_URI:append:class-native = " \ |
| 9 | file://e2fsprogs-fix-missing-check-for-permission-denied.patch \ |
| 10 | file://quiet-debugfs.patch \ |
| 11 | " |
| 12 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 13 | SRCREV = "f4c9cc4bedacde8408edda3520a32d3842290112" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 14 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+(\.\d+)*)$" |
| 15 | |
| 16 | EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} \ |
| 17 | --enable-elf-shlibs --disable-libuuid --disable-uuidd \ |
| 18 | --disable-libblkid --enable-verbose-makecmds \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 19 | --enable-largefile --with-crond-dir=no" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 20 | |
| 21 | EXTRA_OECONF:darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs" |
| 22 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 23 | CFLAGS:append:riscv32 = " -D_FILE_OFFSET_BITS=64" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 24 | PACKAGECONFIG ??= "" |
| 25 | PACKAGECONFIG[fuse] = '--enable-fuse2fs,--disable-fuse2fs,fuse' |
| 26 | |
| 27 | # make locale rules sometimes fire, sometimes don't as git doesn't preserve |
| 28 | # file mktime. Touch the files introducing non-determinism to the build |
| 29 | do_compile:prepend (){ |
| 30 | find ${S}/po -type f -name "*.po" -exec touch {} + |
| 31 | } |
| 32 | |
| 33 | do_install () { |
| 34 | oe_runmake 'DESTDIR=${D}' install |
| 35 | oe_runmake 'DESTDIR=${D}' install-libs |
| 36 | # We use blkid from util-linux now so remove from here |
| 37 | rm -f ${D}${base_libdir}/libblkid* |
| 38 | rm -rf ${D}${includedir}/blkid |
| 39 | rm -f ${D}${base_libdir}/pkgconfig/blkid.pc |
| 40 | rm -f ${D}${base_sbindir}/blkid |
| 41 | rm -f ${D}${base_sbindir}/fsck |
| 42 | rm -f ${D}${base_sbindir}/findfs |
| 43 | |
| 44 | # e2initrd_helper and the pkgconfig files belong in libdir |
| 45 | if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then |
| 46 | install -d ${D}${libdir} |
| 47 | mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir} |
| 48 | mv ${D}${base_libdir}/pkgconfig ${D}${libdir} |
| 49 | fi |
| 50 | |
| 51 | oe_multilib_header ext2fs/ext2_types.h |
| 52 | install -d ${D}${base_bindir} |
| 53 | mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs |
Andrew Geissler | 78b7279 | 2022-06-14 06:47:25 -0500 | [diff] [blame] | 54 | mv ${D}${bindir}/lsattr ${D}${base_bindir}/lsattr.e2fsprogs |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 55 | |
| 56 | install -v -m 755 ${S}/contrib/populate-extfs.sh ${D}${base_sbindir}/ |
| 57 | |
| 58 | # Clean host path (build directory) in compile_et, mk_cmds |
| 59 | sed -i -e "s,\(ET_DIR=.*\)${S}/lib/et\(.*\),\1${datadir}/et\2,g" ${D}${bindir}/compile_et |
| 60 | sed -i -e "s,\(SS_DIR=.*\)${S}/lib/ss\(.*\),\1${datadir}/ss\2,g" ${D}${bindir}/mk_cmds |
| 61 | } |
| 62 | |
| 63 | # Need to find the right mke2fs.conf file |
| 64 | e2fsprogs_conf_fixup () { |
| 65 | for i in mke2fs mkfs.ext2 mkfs.ext3 mkfs.ext4; do |
| 66 | create_wrapper ${D}${base_sbindir}/$i MKE2FS_CONFIG=${sysconfdir}/mke2fs.conf |
| 67 | done |
| 68 | } |
| 69 | |
| 70 | do_install:append:class-native() { |
| 71 | e2fsprogs_conf_fixup |
| 72 | } |
| 73 | |
| 74 | do_install:append:class-nativesdk() { |
| 75 | e2fsprogs_conf_fixup |
| 76 | } |
| 77 | |
| 78 | do_install:append:class-target() { |
| 79 | mv ${D}${base_sbindir}/mke2fs ${D}${base_sbindir}/mke2fs.e2fsprogs |
| 80 | mv ${D}${base_sbindir}/mkfs.ext2 ${D}${base_sbindir}/mkfs.ext2.e2fsprogs |
| 81 | mv ${D}${base_sbindir}/tune2fs ${D}${base_sbindir}/tune2fs.e2fsprogs |
| 82 | } |
| 83 | |
| 84 | RDEPENDS:e2fsprogs = "e2fsprogs-badblocks e2fsprogs-dumpe2fs" |
| 85 | RRECOMMENDS:e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck" |
| 86 | |
| 87 | PACKAGES =+ "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck e2fsprogs-e2scrub e2fsprogs-mke2fs e2fsprogs-resize2fs e2fsprogs-tune2fs" |
| 88 | PACKAGES =+ "libcomerr libss libe2p libext2fs" |
| 89 | |
| 90 | FILES:e2fsprogs-dumpe2fs = "${base_sbindir}/dumpe2fs" |
| 91 | FILES:e2fsprogs-resize2fs = "${base_sbindir}/resize2fs*" |
| 92 | FILES:e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*" |
| 93 | FILES:e2fsprogs-e2scrub = "${base_sbindir}/e2scrub*" |
| 94 | FILES:e2fsprogs-mke2fs = "${base_sbindir}/mke2fs.e2fsprogs ${base_sbindir}/mkfs.ext* ${sysconfdir}/mke2fs.conf" |
| 95 | FILES:e2fsprogs-tune2fs = "${base_sbindir}/tune2fs.e2fsprogs ${base_sbindir}/e2label" |
| 96 | FILES:e2fsprogs-badblocks = "${base_sbindir}/badblocks" |
| 97 | FILES:libcomerr = "${base_libdir}/libcom_err.so.*" |
| 98 | FILES:libss = "${base_libdir}/libss.so.*" |
| 99 | FILES:libe2p = "${base_libdir}/libe2p.so.*" |
| 100 | FILES:libext2fs = "${libdir}/e2initrd_helper ${base_libdir}/libext2fs.so.*" |
| 101 | FILES:${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so ${bindir}/compile_et ${bindir}/mk_cmds" |
| 102 | |
Andrew Geissler | 78b7279 | 2022-06-14 06:47:25 -0500 | [diff] [blame] | 103 | ALTERNATIVE:${PN} = "chattr lsattr" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 104 | ALTERNATIVE_PRIORITY = "100" |
| 105 | ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr" |
| 106 | ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs" |
Andrew Geissler | 78b7279 | 2022-06-14 06:47:25 -0500 | [diff] [blame] | 107 | ALTERNATIVE_LINK_NAME[lsattr] = "${base_bindir}/lsattr" |
| 108 | ALTERNATIVE_TARGET[lsattr] = "${base_bindir}/lsattr.e2fsprogs" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 109 | |
| 110 | ALTERNATIVE:${PN}-doc = "fsck.8" |
| 111 | ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8" |
| 112 | |
| 113 | ALTERNATIVE:${PN}-mke2fs = "mke2fs mkfs.ext2" |
| 114 | ALTERNATIVE_LINK_NAME[mke2fs] = "${base_sbindir}/mke2fs" |
| 115 | ALTERNATIVE_LINK_NAME[mkfs.ext2] = "${base_sbindir}/mkfs.ext2" |
| 116 | |
| 117 | ALTERNATIVE:${PN}-tune2fs = "tune2fs" |
| 118 | ALTERNATIVE_LINK_NAME[tune2fs] = "${base_sbindir}/tune2fs" |
| 119 | |
| 120 | RDEPENDS:e2fsprogs-e2scrub = "bash" |
| 121 | RDEPENDS:${PN}-ptest += "coreutils procps bash bzip2 diffutils perl sed" |
| 122 | RDEPENDS:${PN}-ptest += "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-resize2fs e2fsprogs-tune2fs" |
| 123 | |
| 124 | do_compile_ptest() { |
| 125 | oe_runmake -C ${B}/tests |
| 126 | } |
| 127 | |
| 128 | do_install_ptest() { |
| 129 | # This file's permissions depends on the host umask so be deterministic |
| 130 | chmod 0644 ${B}/tests/test_data.tmp |
| 131 | cp -R --no-dereference --preserve=mode,links -v ${B}/tests ${D}${PTEST_PATH}/test |
| 132 | cp -R --no-dereference --preserve=mode,links -v ${S}/tests/* ${D}${PTEST_PATH}/test |
| 133 | sed -e 's!../e2fsck/e2fsck!e2fsck!g' \ |
| 134 | -e 's!../misc/tune2fs!tune2fs!g' -i ${D}${PTEST_PATH}/test/*/expect* |
| 135 | sed -e 's!../e2fsck/e2fsck!${base_sbindir}/e2fsck!g' -i ${D}${PTEST_PATH}/test/*/script |
| 136 | |
| 137 | # Remove various files |
| 138 | find "${D}${PTEST_PATH}" -type f \ |
| 139 | \( -name 'Makefile' -o -name 'Makefile.in' -o -name '*.o' -o -name '*.c' -o -name '*.h' \)\ |
| 140 | -exec rm -f {} + |
| 141 | |
| 142 | install -d ${D}${PTEST_PATH}/lib |
| 143 | install -m 0644 ${B}/lib/config.h ${D}${PTEST_PATH}/lib/ |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 144 | |
| 145 | install -d ${D}${PTEST_PATH}/data |
| 146 | install -m 0644 ${B}/tests/test_data.tmp ${D}${PTEST_PATH}/data/ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 147 | } |