blob: f42cefcaf9f2d194a5e9612916172734213405cf [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001require e2fsprogs.inc
2
3SRC_URI += "file://remove.ldconfig.call.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -05004 file://run-ptest \
5 file://ptest.patch \
6 file://mkdir_p.patch \
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05007 file://0001-tests-u_direct_io-expect-correct-expected-output.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -05008 "
Brad Bishop19323692019-04-05 15:28:33 -04009
Patrick Williams213cb262021-08-07 19:21:33 -050010SRC_URI:append:class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch \
Brad Bishop19323692019-04-05 15:28:33 -040011 file://quiet-debugfs.patch \
12"
13
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050014SRCREV = "849005eac51ea2097bd9e5f2b0adc16b53c5486d"
Brad Bishop19323692019-04-05 15:28:33 -040015UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+(\.\d+)*)$"
16
17EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} \
18 --enable-elf-shlibs --disable-libuuid --disable-uuidd \
Brad Bishop08902b02019-08-20 09:16:51 -040019 --disable-libblkid --enable-verbose-makecmds \
20 --with-crond-dir=no"
Brad Bishop19323692019-04-05 15:28:33 -040021
Patrick Williams213cb262021-08-07 19:21:33 -050022EXTRA_OECONF:darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs"
Brad Bishop19323692019-04-05 15:28:33 -040023
24PACKAGECONFIG ??= ""
25PACKAGECONFIG[fuse] = '--enable-fuse2fs,--disable-fuse2fs,fuse'
26
27# make locale rules sometimes fire, sometimes don't as git doesn't preserve
28# file mktime. Touch the files introducing non-determinism to the build
Patrick Williams213cb262021-08-07 19:21:33 -050029do_compile:prepend (){
Brad Bishop19323692019-04-05 15:28:33 -040030 find ${S}/po -type f -name "*.po" -exec touch {} +
31}
32
33do_install () {
34 oe_runmake 'DESTDIR=${D}' install
35 oe_runmake 'DESTDIR=${D}' install-libs
36 # We use blkid from util-linux now so remove from here
37 rm -f ${D}${base_libdir}/libblkid*
38 rm -rf ${D}${includedir}/blkid
39 rm -f ${D}${base_libdir}/pkgconfig/blkid.pc
40 rm -f ${D}${base_sbindir}/blkid
41 rm -f ${D}${base_sbindir}/fsck
42 rm -f ${D}${base_sbindir}/findfs
43
44 # e2initrd_helper and the pkgconfig files belong in libdir
45 if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
46 install -d ${D}${libdir}
47 mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir}
48 mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
49 fi
50
51 oe_multilib_header ext2fs/ext2_types.h
52 install -d ${D}${base_bindir}
53 mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs
54
55 install -v -m 755 ${S}/contrib/populate-extfs.sh ${D}${base_sbindir}/
56
57 # Clean host path (build directory) in compile_et, mk_cmds
58 sed -i -e "s,\(ET_DIR=.*\)${S}/lib/et\(.*\),\1${datadir}/et\2,g" ${D}${bindir}/compile_et
59 sed -i -e "s,\(SS_DIR=.*\)${S}/lib/ss\(.*\),\1${datadir}/ss\2,g" ${D}${bindir}/mk_cmds
60}
61
62# Need to find the right mke2fs.conf file
63e2fsprogs_conf_fixup () {
64 for i in mke2fs mkfs.ext2 mkfs.ext3 mkfs.ext4; do
65 create_wrapper ${D}${base_sbindir}/$i MKE2FS_CONFIG=${sysconfdir}/mke2fs.conf
66 done
67}
68
Patrick Williams213cb262021-08-07 19:21:33 -050069do_install:append:class-native() {
Brad Bishop19323692019-04-05 15:28:33 -040070 e2fsprogs_conf_fixup
71}
72
Patrick Williams213cb262021-08-07 19:21:33 -050073do_install:append:class-nativesdk() {
Brad Bishop19323692019-04-05 15:28:33 -040074 e2fsprogs_conf_fixup
75}
76
Patrick Williams213cb262021-08-07 19:21:33 -050077do_install:append:class-target() {
Brad Bishop19323692019-04-05 15:28:33 -040078 mv ${D}${base_sbindir}/mke2fs ${D}${base_sbindir}/mke2fs.e2fsprogs
79 mv ${D}${base_sbindir}/mkfs.ext2 ${D}${base_sbindir}/mkfs.ext2.e2fsprogs
80 mv ${D}${base_sbindir}/tune2fs ${D}${base_sbindir}/tune2fs.e2fsprogs
81}
82
Patrick Williams213cb262021-08-07 19:21:33 -050083RDEPENDS:e2fsprogs = "e2fsprogs-badblocks e2fsprogs-dumpe2fs"
84RRECOMMENDS:e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck"
Brad Bishop19323692019-04-05 15:28:33 -040085
Andrew Geissler82c905d2020-04-13 13:39:40 -050086PACKAGES =+ "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck e2fsprogs-e2scrub e2fsprogs-mke2fs e2fsprogs-resize2fs e2fsprogs-tune2fs"
Brad Bishop19323692019-04-05 15:28:33 -040087PACKAGES =+ "libcomerr libss libe2p libext2fs"
88
Patrick Williams213cb262021-08-07 19:21:33 -050089FILES:e2fsprogs-dumpe2fs = "${base_sbindir}/dumpe2fs"
90FILES:e2fsprogs-resize2fs = "${base_sbindir}/resize2fs*"
91FILES:e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*"
92FILES:e2fsprogs-e2scrub = "${base_sbindir}/e2scrub*"
93FILES:e2fsprogs-mke2fs = "${base_sbindir}/mke2fs.e2fsprogs ${base_sbindir}/mkfs.ext* ${sysconfdir}/mke2fs.conf"
94FILES:e2fsprogs-tune2fs = "${base_sbindir}/tune2fs.e2fsprogs ${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 ${bindir}/compile_et ${bindir}/mk_cmds"
Brad Bishop19323692019-04-05 15:28:33 -0400101
Patrick Williams213cb262021-08-07 19:21:33 -0500102ALTERNATIVE:${PN} = "chattr"
Brad Bishop19323692019-04-05 15:28:33 -0400103ALTERNATIVE_PRIORITY = "100"
104ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr"
105ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs"
106
Patrick Williams213cb262021-08-07 19:21:33 -0500107ALTERNATIVE:${PN}-doc = "fsck.8"
Brad Bishop19323692019-04-05 15:28:33 -0400108ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
109
Patrick Williams213cb262021-08-07 19:21:33 -0500110ALTERNATIVE:${PN}-mke2fs = "mke2fs mkfs.ext2"
Brad Bishop19323692019-04-05 15:28:33 -0400111ALTERNATIVE_LINK_NAME[mke2fs] = "${base_sbindir}/mke2fs"
112ALTERNATIVE_LINK_NAME[mkfs.ext2] = "${base_sbindir}/mkfs.ext2"
113
Patrick Williams213cb262021-08-07 19:21:33 -0500114ALTERNATIVE:${PN}-tune2fs = "tune2fs"
Brad Bishop19323692019-04-05 15:28:33 -0400115ALTERNATIVE_LINK_NAME[tune2fs] = "${base_sbindir}/tune2fs"
116
Patrick Williams213cb262021-08-07 19:21:33 -0500117RDEPENDS:e2fsprogs-e2scrub = "bash"
118RDEPENDS:${PN}-ptest += "coreutils procps bash bzip2 diffutils perl sed"
119RDEPENDS:${PN}-ptest += "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-resize2fs e2fsprogs-tune2fs"
Brad Bishop19323692019-04-05 15:28:33 -0400120
121do_compile_ptest() {
122 oe_runmake -C ${B}/tests
123}
124
125do_install_ptest() {
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600126 # This file's permissions depends on the host umask so be deterministic
127 chmod 0644 ${B}/tests/test_data.tmp
Brad Bishop19323692019-04-05 15:28:33 -0400128 cp -R --no-dereference --preserve=mode,links -v ${B}/tests ${D}${PTEST_PATH}/test
129 cp -R --no-dereference --preserve=mode,links -v ${S}/tests/* ${D}${PTEST_PATH}/test
130 sed -e 's!../e2fsck/e2fsck!e2fsck!g' \
131 -e 's!../misc/tune2fs!tune2fs!g' -i ${D}${PTEST_PATH}/test/*/expect*
132 sed -e 's!../e2fsck/e2fsck!${base_sbindir}/e2fsck!g' -i ${D}${PTEST_PATH}/test/*/script
133
134 # Remove various files
135 find "${D}${PTEST_PATH}" -type f \
136 \( -name 'Makefile' -o -name 'Makefile.in' -o -name '*.o' -o -name '*.c' -o -name '*.h' \)\
137 -exec rm -f {} +
138
139 install -d ${D}${PTEST_PATH}/lib
140 install -m 0644 ${B}/lib/config.h ${D}${PTEST_PATH}/lib/
141}