Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | require e2fsprogs.inc |
| 2 | |
| 3 | RECIPE_NO_UPDATE_REASON = "Updating backported patches to 1.42.13 is too much pain. Let's wait until 1.43 is released." |
| 4 | |
| 5 | SRC_URI += "file://acinclude.m4 \ |
| 6 | file://remove.ldconfig.call.patch \ |
| 7 | file://fix-icache.patch \ |
| 8 | file://quiet-debugfs.patch \ |
| 9 | file://0001-mke2fs-add-the-ability-to-copy-files-from-a-given-di.patch \ |
| 10 | file://0002-misc-create_inode.c-copy-files-recursively.patch \ |
| 11 | file://0003-misc-create_inode.c-create-special-file.patch \ |
| 12 | file://0004-misc-create_inode.c-create-symlink.patch \ |
| 13 | file://0005-misc-create_inode.c-copy-regular-file.patch \ |
| 14 | file://0006-misc-create_inode.c-create-directory.patch \ |
| 15 | file://0007-misc-create_inode.c-set-owner-mode-time-for-the-inod.patch \ |
| 16 | file://0008-mke2fs.c-add-an-option-d-root-directory.patch \ |
| 17 | file://0009-misc-create_inode.c-handle-hardlinks.patch \ |
| 18 | file://0010-debugfs-use-the-functions-in-misc-create_inode.c.patch \ |
| 19 | file://0011-mke2fs.8.in-update-the-manual-for-the-d-option.patch \ |
| 20 | file://0012-Fix-musl-build-failures.patch \ |
| 21 | file://0001-e2fsprogs-fix-cross-compilation-problem.patch \ |
| 22 | file://misc-mke2fs.c-return-error-when-failed-to-populate-fs.patch \ |
| 23 | file://cache_inode.patch \ |
| 24 | file://CVE-2015-0247.patch \ |
| 25 | file://0001-libext2fs-fix-potential-buffer-overflow-in-closefs.patch \ |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame^] | 26 | file://copy-in-create-hardlinks-with-the-correct-directory-.patch \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 27 | " |
| 28 | |
| 29 | SRC_URI[md5sum] = "3f8e41e63b432ba114b33f58674563f7" |
| 30 | SRC_URI[sha256sum] = "2f92ac06e92fa00f2ada3ee67dad012d74d685537527ad1241d82f2d041f2802" |
| 31 | |
| 32 | EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-elf-shlibs --disable-libuuid --disable-uuidd --enable-verbose-makecmds" |
| 33 | EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs" |
| 34 | |
| 35 | do_configure_prepend () { |
| 36 | cp ${WORKDIR}/acinclude.m4 ${S}/ |
| 37 | } |
| 38 | |
| 39 | do_install () { |
| 40 | oe_runmake 'DESTDIR=${D}' install |
| 41 | oe_runmake 'DESTDIR=${D}' install-libs |
| 42 | # We use blkid from util-linux now so remove from here |
| 43 | rm -f ${D}${base_libdir}/libblkid* |
| 44 | rm -rf ${D}${includedir}/blkid |
| 45 | rm -f ${D}${base_libdir}/pkgconfig/blkid.pc |
| 46 | rm -f ${D}${base_sbindir}/blkid |
| 47 | rm -f ${D}${base_sbindir}/fsck |
| 48 | rm -f ${D}${base_sbindir}/findfs |
| 49 | |
| 50 | # e2initrd_helper and the pkgconfig files belong in libdir |
| 51 | if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then |
| 52 | install -d ${D}${libdir} |
| 53 | mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir} |
| 54 | mv ${D}${base_libdir}/pkgconfig ${D}${libdir} |
| 55 | fi |
| 56 | |
| 57 | oe_multilib_header ext2fs/ext2_types.h |
| 58 | install -d ${D}${base_bindir} |
| 59 | mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs |
| 60 | |
| 61 | install -v -m 755 ${S}/contrib/populate-extfs.sh ${D}${base_sbindir}/ |
| 62 | } |
| 63 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame^] | 64 | # Need to find the right mke2fs.conf file |
| 65 | e2fsprogs_conf_fixup () { |
| 66 | for i in mke2fs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.ext4dev; do |
| 67 | create_wrapper ${D}${base_sbindir}/$i MKE2FS_CONFIG=${sysconfdir}/mke2fs.conf |
| 68 | done |
| 69 | } |
| 70 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 71 | do_install_append_class-target() { |
| 72 | # Clean host path in compile_et, mk_cmds |
| 73 | sed -i -e "s,ET_DIR=\"${S}/lib/et\",ET_DIR=\"${datadir}/et\",g" ${D}${bindir}/compile_et |
| 74 | sed -i -e "s,SS_DIR=\"${S}/lib/ss\",SS_DIR=\"${datadir}/ss\",g" ${D}${bindir}/mk_cmds |
| 75 | } |
| 76 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame^] | 77 | do_install_append_class-native() { |
| 78 | e2fsprogs_conf_fixup |
| 79 | } |
| 80 | |
| 81 | do_install_append_class-nativesdk() { |
| 82 | e2fsprogs_conf_fixup |
| 83 | } |
| 84 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 85 | RDEPENDS_e2fsprogs = "e2fsprogs-badblocks" |
| 86 | RRECOMMENDS_e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck" |
| 87 | |
| 88 | PACKAGES =+ "e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-tune2fs e2fsprogs-badblocks e2fsprogs-resize2fs" |
| 89 | PACKAGES =+ "libcomerr libss libe2p libext2fs" |
| 90 | |
| 91 | FILES_e2fsprogs-resize2fs = "${base_sbindir}/resize2fs*" |
| 92 | FILES_e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*" |
| 93 | FILES_e2fsprogs-mke2fs = "${base_sbindir}/mke2fs ${base_sbindir}/mkfs.ext* ${sysconfdir}/mke2fs.conf" |
| 94 | FILES_e2fsprogs-tune2fs = "${base_sbindir}/tune2fs ${base_sbindir}/e2label" |
| 95 | FILES_e2fsprogs-badblocks = "${base_sbindir}/badblocks" |
| 96 | FILES_libcomerr = "${base_libdir}/libcom_err.so.*" |
| 97 | FILES_libss = "${base_libdir}/libss.so.*" |
| 98 | FILES_libe2p = "${base_libdir}/libe2p.so.*" |
| 99 | FILES_libext2fs = "${libdir}/e2initrd_helper ${base_libdir}/libext2fs.so.*" |
| 100 | FILES_${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so" |
| 101 | |
| 102 | BBCLASSEXTEND = "native nativesdk" |
| 103 | |
| 104 | inherit update-alternatives |
| 105 | |
| 106 | ALTERNATIVE_${PN} = "chattr" |
| 107 | ALTERNATIVE_PRIORITY = "100" |
| 108 | ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr" |
| 109 | ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs" |
| 110 | |
| 111 | ALTERNATIVE_${PN}-doc = "libblkid.3 blkid.8 findfs.8 fsck.8" |
| 112 | ALTERNATIVE_LINK_NAME[libblkid.3] = "${mandir}/man3/libblkid.3" |
| 113 | ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8" |
| 114 | ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8" |
| 115 | ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8" |
| 116 | |
| 117 | inherit ptest |
| 118 | SRC_URI += "file://run-ptest" |
| 119 | SRC_URI += "file://ptest.patch" |
| 120 | |
| 121 | RDEPENDS_${PN}-ptest += "${PN} ${PN}-tune2fs coreutils procps" |
| 122 | #RDEPENDS_${PN}-ptest += "expect" |
| 123 | |
| 124 | do_compile_ptest() { |
| 125 | oe_runmake -C ${B}/tests |
| 126 | } |
| 127 | |
| 128 | do_install_ptest() { |
| 129 | cp -a ${B}/tests ${D}${PTEST_PATH}/test |
| 130 | cp -a ${S}/tests/* ${D}${PTEST_PATH}/test |
| 131 | sed -e 's!../e2fsck/e2fsck!e2fsck!g' -i ${D}${PTEST_PATH}/test/*/expect* |
| 132 | } |