blob: 97e29c8916fa07b11bd9a11dfb280720b1eb2088 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001require e2fsprogs.inc
2
3RECIPE_NO_UPDATE_REASON = "Updating backported patches to 1.42.13 is too much pain. Let's wait until 1.43 is released."
4
5SRC_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 \
26"
27
28SRC_URI[md5sum] = "3f8e41e63b432ba114b33f58674563f7"
29SRC_URI[sha256sum] = "2f92ac06e92fa00f2ada3ee67dad012d74d685537527ad1241d82f2d041f2802"
30
31EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-elf-shlibs --disable-libuuid --disable-uuidd --enable-verbose-makecmds"
32EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs"
33
34do_configure_prepend () {
35 cp ${WORKDIR}/acinclude.m4 ${S}/
36}
37
38do_install () {
39 oe_runmake 'DESTDIR=${D}' install
40 oe_runmake 'DESTDIR=${D}' install-libs
41 # We use blkid from util-linux now so remove from here
42 rm -f ${D}${base_libdir}/libblkid*
43 rm -rf ${D}${includedir}/blkid
44 rm -f ${D}${base_libdir}/pkgconfig/blkid.pc
45 rm -f ${D}${base_sbindir}/blkid
46 rm -f ${D}${base_sbindir}/fsck
47 rm -f ${D}${base_sbindir}/findfs
48
49 # e2initrd_helper and the pkgconfig files belong in libdir
50 if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
51 install -d ${D}${libdir}
52 mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir}
53 mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
54 fi
55
56 oe_multilib_header ext2fs/ext2_types.h
57 install -d ${D}${base_bindir}
58 mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs
59
60 install -v -m 755 ${S}/contrib/populate-extfs.sh ${D}${base_sbindir}/
61}
62
63do_install_append_class-target() {
64 # Clean host path in compile_et, mk_cmds
65 sed -i -e "s,ET_DIR=\"${S}/lib/et\",ET_DIR=\"${datadir}/et\",g" ${D}${bindir}/compile_et
66 sed -i -e "s,SS_DIR=\"${S}/lib/ss\",SS_DIR=\"${datadir}/ss\",g" ${D}${bindir}/mk_cmds
67}
68
69RDEPENDS_e2fsprogs = "e2fsprogs-badblocks"
70RRECOMMENDS_e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck"
71
72PACKAGES =+ "e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-tune2fs e2fsprogs-badblocks e2fsprogs-resize2fs"
73PACKAGES =+ "libcomerr libss libe2p libext2fs"
74
75FILES_e2fsprogs-resize2fs = "${base_sbindir}/resize2fs*"
76FILES_e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*"
77FILES_e2fsprogs-mke2fs = "${base_sbindir}/mke2fs ${base_sbindir}/mkfs.ext* ${sysconfdir}/mke2fs.conf"
78FILES_e2fsprogs-tune2fs = "${base_sbindir}/tune2fs ${base_sbindir}/e2label"
79FILES_e2fsprogs-badblocks = "${base_sbindir}/badblocks"
80FILES_libcomerr = "${base_libdir}/libcom_err.so.*"
81FILES_libss = "${base_libdir}/libss.so.*"
82FILES_libe2p = "${base_libdir}/libe2p.so.*"
83FILES_libext2fs = "${libdir}/e2initrd_helper ${base_libdir}/libext2fs.so.*"
84FILES_${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so"
85
86BBCLASSEXTEND = "native nativesdk"
87
88inherit update-alternatives
89
90ALTERNATIVE_${PN} = "chattr"
91ALTERNATIVE_PRIORITY = "100"
92ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr"
93ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs"
94
95ALTERNATIVE_${PN}-doc = "libblkid.3 blkid.8 findfs.8 fsck.8"
96ALTERNATIVE_LINK_NAME[libblkid.3] = "${mandir}/man3/libblkid.3"
97ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8"
98ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8"
99ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
100
101inherit ptest
102SRC_URI += "file://run-ptest"
103SRC_URI += "file://ptest.patch"
104
105RDEPENDS_${PN}-ptest += "${PN} ${PN}-tune2fs coreutils procps"
106#RDEPENDS_${PN}-ptest += "expect"
107
108do_compile_ptest() {
109 oe_runmake -C ${B}/tests
110}
111
112do_install_ptest() {
113 cp -a ${B}/tests ${D}${PTEST_PATH}/test
114 cp -a ${S}/tests/* ${D}${PTEST_PATH}/test
115 sed -e 's!../e2fsck/e2fsck!e2fsck!g' -i ${D}${PTEST_PATH}/test/*/expect*
116}