diff --git a/meta-openeuler/recipes-devtools/yaffs2/yaffs2-utils/0001-define-loff_t-if-not-already-defined.patch b/meta-openeuler/recipes-devtools/yaffs2/yaffs2-utils/0001-define-loff_t-if-not-already-defined.patch new file mode 100644 index 0000000000000000000000000000000000000000..9968c6d542a5507d8fa867f4ea5e8f44d77f88b5 --- /dev/null +++ b/meta-openeuler/recipes-devtools/yaffs2/yaffs2-utils/0001-define-loff_t-if-not-already-defined.patch @@ -0,0 +1,29 @@ +From 848717da4a28d33f8aa8f889377e61e6b1b8ae67 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 13 Jul 2017 18:29:52 -0700 +Subject: [PATCH] define loff_t if not already defined + +Helps to build with musl + +Signed-off-by: Khem Raj +--- + yaffs_guts.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/yaffs_guts.h b/yaffs_guts.h +index 6bcf12d..4af17ce 100644 +--- a/yaffs_guts.h ++++ b/yaffs_guts.h +@@ -18,6 +18,10 @@ + + #include "yportenv.h" + ++#ifndef loff_t ++#define loff_t off_t ++#endif ++ + #define YAFFS_OK 1 + #define YAFFS_FAIL 0 + +-- +2.13.2 diff --git a/meta-openeuler/recipes-devtools/yaffs2/yaffs2-utils/makefile-add-ldflags.patch b/meta-openeuler/recipes-devtools/yaffs2/yaffs2-utils/makefile-add-ldflags.patch new file mode 100644 index 0000000000000000000000000000000000000000..bb21899eb339a52d6355d0c2c465dd9dd1e1f05c --- /dev/null +++ b/meta-openeuler/recipes-devtools/yaffs2/yaffs2-utils/makefile-add-ldflags.patch @@ -0,0 +1,21 @@ +Upstream-Status: Pending + +Signed-off-by: Yi Zhao + +diff --git a/utils/Makefile b/utils/Makefile +index 710ebbf..6259893 100644 +--- a/utils/Makefile ++++ b/utils/Makefile +@@ -57,10 +57,10 @@ $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) $(MKYAFFS2IMAGEOBJS) : %.o: %.c + $(CC) -c $(CFLAGS) $< -o $@ + + mkyaffsimage: $(MKYAFFSIMAGEOBJS) $(COMMONOBJS) +- $(CC) -o $@ $^ ++ $(CC) $(LDFLAGS) -o $@ $^ + + mkyaffs2image: $(MKYAFFS2IMAGEOBJS) $(COMMONOBJS) +- $(CC) -o $@ $^ ++ $(CC) $(LDFLAGS) -o $@ $^ + + + clean: diff --git a/meta-openeuler/recipes-devtools/yaffs2/yaffs2-utils_%.bbappend b/meta-openeuler/recipes-devtools/yaffs2/yaffs2-utils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ed70a982c852b397ea001d3938f0e4f546889fab --- /dev/null +++ b/meta-openeuler/recipes-devtools/yaffs2/yaffs2-utils_%.bbappend @@ -0,0 +1,23 @@ +# The recipe and patch files are from: http://git.openembedded.org/meta-openembedded/tree/meta-filesystems/recipes-filesystems/yaffs2 + +# Used when the repository name is inconsistent with the software package. +OPENEULER_REPO_NAME = "yaffs2" + +# Modify the version number according to the local software package from openEuler. +PV = "b4ce1bb" + +# Remove the package download address in the original bb file. +SRC_URI_remove = "git://www.aleph1.co.uk/yaffs2;protocol=git;branch=master \ + " + +# Change SRC_URI to local package. +# Since the bb name is yaffs2-utils, but the local package name is yaffs2, so yaffs2-${PV} not ${BP}. +SRC_URI_prepend = "file://yaffs2-${PV}.tar.gz \ + " + +# Verify SHA-256 and MD5 checksum to ensure that the file is downloaded accurately. +SRC_URI[md5sum] = "e9e02b1fc4ef543d0d750294047c563c" +SRC_URI[sha256sum] = "2633a083ed89f27a6037b616e0b7a496c04581a57f4ae2f48b6e559d377530a0" + +# S needs to be consistent with the package name in SRC_URI above. +S = "${WORKDIR}/yaffs2-${PV}" diff --git a/meta-openeuler/recipes-devtools/yaffs2/yaffs2-utils_git.bb b/meta-openeuler/recipes-devtools/yaffs2/yaffs2-utils_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..6bf321e2372d6bea6206cf12bdd012ac0503257a --- /dev/null +++ b/meta-openeuler/recipes-devtools/yaffs2/yaffs2-utils_git.bb @@ -0,0 +1,51 @@ +SUMMARY = "Yet Another Flash File System" +DESCRIPTION = "Tools for managing 'yaffs2' file systems." + +SECTION = "base" +HOMEPAGE = "http://www.yaffs.net" + +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://utils/mkyaffs2image.c;beginline=11;endline=13;md5=5f5464f9b3e981ca574e65b00e438561 \ + file://utils/mkyaffsimage.c;beginline=10;endline=12;md5=5f5464f9b3e981ca574e65b00e438561 \ + " + +PV = "0.0+git${SRCPV}" + +DEPENDS = "mtd-utils" + +# Source is the HEAD of master branch at the time of writing this recipe +SRC_URI = "git://www.aleph1.co.uk/yaffs2;protocol=git;branch=master \ + file://makefile-add-ldflags.patch \ + file://0001-define-loff_t-if-not-already-defined.patch \ + " + +SRCREV = "9a6f486e56f927eeb8dc7e4e0d84f6bb95eeaa0f" + +UPSTREAM_CHECK_COMMITS = "1" + +S = "${WORKDIR}/git" + +CFLAGS:append = " -I.. -DCONFIG_YAFFS_UTIL -DCONFIG_YAFFS_DEFINES_TYPES" +EXTRA_OEMAKE = "-e MAKEFLAGS=" + +do_compile() { + cd utils && oe_runmake +} + +INSTALL_FILES = "mkyaffsimage \ + mkyaffs2image \ + " +do_install() { + install -d ${D}${sbindir}/ + for i in ${INSTALL_FILES}; do + install -m 0755 utils/$i ${D}${sbindir}/ + done +} + +BBCLASSEXTEND = "native" + +# Fixed make clean error: +#make -C /lib/modules/4.4.0-112-generic/build M= +#make: *** /lib/modules/4.4.0-112-generic/build: No such file or directory. Stop. +#make: *** [clean] Error 2 +CLEANBROKEN = "1" diff --git a/scripts/download_code.sh b/scripts/download_code.sh index 2b03782dc53a0f89371d1abdc00b83da477917f5..5a275cee3922026015036e2cb02054a754997001 100644 --- a/scripts/download_code.sh +++ b/scripts/download_code.sh @@ -249,6 +249,7 @@ download_code() update_code_repo src-openeuler/xorg-x11-proto-devel ${SRC_BRANCH} update_code_repo src-openeuler/mtd-utils openEuler-22.03-LTS update_code_repo src-openeuler/dtc ${SRC_BRANCH} + update_code_repo src-openeuler/yaffs2 openEuler-22.03-LTS } # download iSulad related packages