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