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 \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 7 | file://0001-configure.ac-correct-AM_GNU_GETTEXT.patch \ |
| 8 | file://0001-intl-do-not-try-to-use-gettext-defines-that-no-longe.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 | |
| 11 | SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch \ |
| 12 | file://quiet-debugfs.patch \ |
| 13 | " |
| 14 | |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame^] | 15 | SRCREV = "506d96fe640f76ab04276e0a7c578aa108ce19f8" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+(\.\d+)*)$" |
| 17 | |
| 18 | EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} \ |
| 19 | --enable-elf-shlibs --disable-libuuid --disable-uuidd \ |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 20 | --disable-libblkid --enable-verbose-makecmds \ |
| 21 | --with-crond-dir=no" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 22 | |
| 23 | EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs" |
| 24 | |
| 25 | PACKAGECONFIG ??= "" |
| 26 | PACKAGECONFIG[fuse] = '--enable-fuse2fs,--disable-fuse2fs,fuse' |
| 27 | |
| 28 | # make locale rules sometimes fire, sometimes don't as git doesn't preserve |
| 29 | # file mktime. Touch the files introducing non-determinism to the build |
| 30 | do_compile_prepend (){ |
| 31 | find ${S}/po -type f -name "*.po" -exec touch {} + |
| 32 | } |
| 33 | |
| 34 | do_install () { |
| 35 | oe_runmake 'DESTDIR=${D}' install |
| 36 | oe_runmake 'DESTDIR=${D}' install-libs |
| 37 | # We use blkid from util-linux now so remove from here |
| 38 | rm -f ${D}${base_libdir}/libblkid* |
| 39 | rm -rf ${D}${includedir}/blkid |
| 40 | rm -f ${D}${base_libdir}/pkgconfig/blkid.pc |
| 41 | rm -f ${D}${base_sbindir}/blkid |
| 42 | rm -f ${D}${base_sbindir}/fsck |
| 43 | rm -f ${D}${base_sbindir}/findfs |
| 44 | |
| 45 | # e2initrd_helper and the pkgconfig files belong in libdir |
| 46 | if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then |
| 47 | install -d ${D}${libdir} |
| 48 | mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir} |
| 49 | mv ${D}${base_libdir}/pkgconfig ${D}${libdir} |
| 50 | fi |
| 51 | |
| 52 | oe_multilib_header ext2fs/ext2_types.h |
| 53 | install -d ${D}${base_bindir} |
| 54 | mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs |
| 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 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 84 | RDEPENDS_e2fsprogs = "e2fsprogs-badblocks e2fsprogs-dumpe2fs" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 85 | RRECOMMENDS_e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck" |
| 86 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 87 | 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] | 88 | PACKAGES =+ "libcomerr libss libe2p libext2fs" |
| 89 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 90 | FILES_e2fsprogs-dumpe2fs = "${base_sbindir}/dumpe2fs" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 91 | FILES_e2fsprogs-resize2fs = "${base_sbindir}/resize2fs*" |
| 92 | FILES_e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*" |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 93 | FILES_e2fsprogs-e2scrub = "${base_sbindir}/e2scrub*" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 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 | |
| 103 | ALTERNATIVE_${PN} = "chattr" |
| 104 | ALTERNATIVE_PRIORITY = "100" |
| 105 | ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr" |
| 106 | ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs" |
| 107 | |
| 108 | ALTERNATIVE_${PN}-doc = "fsck.8" |
| 109 | ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8" |
| 110 | |
| 111 | ALTERNATIVE_${PN}-mke2fs = "mke2fs mkfs.ext2" |
| 112 | ALTERNATIVE_LINK_NAME[mke2fs] = "${base_sbindir}/mke2fs" |
| 113 | ALTERNATIVE_LINK_NAME[mkfs.ext2] = "${base_sbindir}/mkfs.ext2" |
| 114 | |
| 115 | ALTERNATIVE_${PN}-tune2fs = "tune2fs" |
| 116 | ALTERNATIVE_LINK_NAME[tune2fs] = "${base_sbindir}/tune2fs" |
| 117 | |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 118 | RDEPENDS_e2fsprogs-e2scrub = "bash" |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 119 | RDEPENDS_${PN}-ptest += "coreutils procps bash bzip2 diffutils perl sed" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 120 | 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] | 121 | |
| 122 | do_compile_ptest() { |
| 123 | oe_runmake -C ${B}/tests |
| 124 | } |
| 125 | |
| 126 | do_install_ptest() { |
| 127 | cp -R --no-dereference --preserve=mode,links -v ${B}/tests ${D}${PTEST_PATH}/test |
| 128 | cp -R --no-dereference --preserve=mode,links -v ${S}/tests/* ${D}${PTEST_PATH}/test |
| 129 | sed -e 's!../e2fsck/e2fsck!e2fsck!g' \ |
| 130 | -e 's!../misc/tune2fs!tune2fs!g' -i ${D}${PTEST_PATH}/test/*/expect* |
| 131 | sed -e 's!../e2fsck/e2fsck!${base_sbindir}/e2fsck!g' -i ${D}${PTEST_PATH}/test/*/script |
| 132 | |
| 133 | # Remove various files |
| 134 | find "${D}${PTEST_PATH}" -type f \ |
| 135 | \( -name 'Makefile' -o -name 'Makefile.in' -o -name '*.o' -o -name '*.c' -o -name '*.h' \)\ |
| 136 | -exec rm -f {} + |
| 137 | |
| 138 | install -d ${D}${PTEST_PATH}/lib |
| 139 | install -m 0644 ${B}/lib/config.h ${D}${PTEST_PATH}/lib/ |
| 140 | } |