blob: a8edeefc973ff88a44cd457731644795a897f176 [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 \
Patrick Williamsf1e5d692016-03-30 15:21:19 -050026 file://copy-in-create-hardlinks-with-the-correct-directory-.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050027"
28
29SRC_URI[md5sum] = "3f8e41e63b432ba114b33f58674563f7"
30SRC_URI[sha256sum] = "2f92ac06e92fa00f2ada3ee67dad012d74d685537527ad1241d82f2d041f2802"
31
32EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-elf-shlibs --disable-libuuid --disable-uuidd --enable-verbose-makecmds"
33EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs"
34
35do_configure_prepend () {
36 cp ${WORKDIR}/acinclude.m4 ${S}/
37}
38
39do_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 Williamsf1e5d692016-03-30 15:21:19 -050064# Need to find the right mke2fs.conf file
65e2fsprogs_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 Williamsc124f4f2015-09-15 14:41:29 -050071do_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 Williamsf1e5d692016-03-30 15:21:19 -050077do_install_append_class-native() {
78 e2fsprogs_conf_fixup
79}
80
81do_install_append_class-nativesdk() {
82 e2fsprogs_conf_fixup
83}
84
Patrick Williamsc124f4f2015-09-15 14:41:29 -050085RDEPENDS_e2fsprogs = "e2fsprogs-badblocks"
86RRECOMMENDS_e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck"
87
88PACKAGES =+ "e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-tune2fs e2fsprogs-badblocks e2fsprogs-resize2fs"
89PACKAGES =+ "libcomerr libss libe2p libext2fs"
90
91FILES_e2fsprogs-resize2fs = "${base_sbindir}/resize2fs*"
92FILES_e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*"
93FILES_e2fsprogs-mke2fs = "${base_sbindir}/mke2fs ${base_sbindir}/mkfs.ext* ${sysconfdir}/mke2fs.conf"
94FILES_e2fsprogs-tune2fs = "${base_sbindir}/tune2fs ${base_sbindir}/e2label"
95FILES_e2fsprogs-badblocks = "${base_sbindir}/badblocks"
96FILES_libcomerr = "${base_libdir}/libcom_err.so.*"
97FILES_libss = "${base_libdir}/libss.so.*"
98FILES_libe2p = "${base_libdir}/libe2p.so.*"
99FILES_libext2fs = "${libdir}/e2initrd_helper ${base_libdir}/libext2fs.so.*"
100FILES_${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so"
101
102BBCLASSEXTEND = "native nativesdk"
103
104inherit update-alternatives
105
106ALTERNATIVE_${PN} = "chattr"
107ALTERNATIVE_PRIORITY = "100"
108ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr"
109ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs"
110
111ALTERNATIVE_${PN}-doc = "libblkid.3 blkid.8 findfs.8 fsck.8"
112ALTERNATIVE_LINK_NAME[libblkid.3] = "${mandir}/man3/libblkid.3"
113ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8"
114ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8"
115ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
116
117inherit ptest
118SRC_URI += "file://run-ptest"
119SRC_URI += "file://ptest.patch"
120
121RDEPENDS_${PN}-ptest += "${PN} ${PN}-tune2fs coreutils procps"
122#RDEPENDS_${PN}-ptest += "expect"
123
124do_compile_ptest() {
125 oe_runmake -C ${B}/tests
126}
127
128do_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}