diff mbox series

[oe,meta-filesystems,1/5] ufs-utils: Renames from ufs-tool

Message ID 20191216034155.2675900-1-raj.khem@gmail.com
State Accepted
Commit 0e5d85318dbf52434952ed09d5f8ae43320fed09
Headers show
Series [oe,meta-filesystems,1/5] ufs-utils: Renames from ufs-tool | expand

Commit Message

Khem Raj Dec. 16, 2019, 3:41 a.m. UTC
Add a patch to fix build with musl/mips64

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 .../recipes-utils/ufs-tool/ufs-tool_git.bb    | 23 --------
 ...place-u_intXX_t-with-kernel-typedefs.patch | 54 +++++++++++++++++++
 .../recipes-utils/ufs-utils/ufs-utils_git.bb  | 32 +++++++++++
 3 files changed, 86 insertions(+), 23 deletions(-)
 delete mode 100644 meta-filesystems/recipes-utils/ufs-tool/ufs-tool_git.bb
 create mode 100644 meta-filesystems/recipes-utils/ufs-utils/ufs-utils/0001-Replace-u_intXX_t-with-kernel-typedefs.patch
 create mode 100644 meta-filesystems/recipes-utils/ufs-utils/ufs-utils_git.bb

-- 
2.24.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-filesystems/recipes-utils/ufs-tool/ufs-tool_git.bb b/meta-filesystems/recipes-utils/ufs-tool/ufs-tool_git.bb
deleted file mode 100644
index 208ac3c58b..0000000000
--- a/meta-filesystems/recipes-utils/ufs-tool/ufs-tool_git.bb
+++ /dev/null
@@ -1,23 +0,0 @@ 
-SUMMARY = "Tool to access UFS (Universal Flash Storage) devices"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-
-PV = "1.3+git${SRCPV}"
-
-BRANCH ?= "dev"
-
-SRCREV = "8b00e33003b57d7071943f63863fcf8cc48d5be9"
-
-SRC_URI = "git://github.com/westerndigitalcorporation/ufs-tool.git;protocol=git;branch=${BRANCH}"
-
-S = "${WORKDIR}/git"
-
-EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} CC="${CC}" CFLAGS="${CFLAGS}""
-
-do_configure() {
-	sed -i -e "s|-static$||g" ${S}/Makefile
-}
-do_install() {
-	install -d ${D}${bindir}/
-	install -c -m 755 ${S}/ufs-tool ${D}${bindir}/
-}
diff --git a/meta-filesystems/recipes-utils/ufs-utils/ufs-utils/0001-Replace-u_intXX_t-with-kernel-typedefs.patch b/meta-filesystems/recipes-utils/ufs-utils/ufs-utils/0001-Replace-u_intXX_t-with-kernel-typedefs.patch
new file mode 100644
index 0000000000..e69a3cf1ff
--- /dev/null
+++ b/meta-filesystems/recipes-utils/ufs-utils/ufs-utils/0001-Replace-u_intXX_t-with-kernel-typedefs.patch
@@ -0,0 +1,54 @@ 
+From 6cf6f5b9c39dfd0d46f2069c3baeab92ae980367 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 15 Dec 2019 00:58:13 -0800
+Subject: [PATCH] Replace u_intXX_t with kernel typedefs
+
+u_intXX_t requires including sys/types.h which might not work in kernel
+code, if this header is used in a kernel module
+
+Fixes
+| In file included from ufs.c:16:
+| In file included from ./ufs.h:9:
+| ./scsi_bsg_util.h:131:2: error: unknown type name 'u_int16_t'; did you mean 'uint16_t'?
+|         u_int16_t result;
+|         ^~~~~~~~~
+
+Upstream-Status: Submitted [https://github.com/westerndigitalcorporation/ufs-utils/pull/23]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ scsi_bsg_util.h | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/scsi_bsg_util.h b/scsi_bsg_util.h
+index 3f8a482..497c3ae 100644
+--- a/scsi_bsg_util.h
++++ b/scsi_bsg_util.h
+@@ -121,15 +121,15 @@ struct ufs_bsg_reply {
+ #endif /* SCSI_BSG_UFS_H.*/
+ 
+ struct rpmb_frame {
+-	u_int8_t  stuff[196];
+-	u_int8_t  key_mac[32];
+-	u_int8_t  data[256];
+-	u_int8_t  nonce[16];
+-	u_int32_t write_counter;
+-	u_int16_t addr;
+-	u_int16_t block_count;
+-	u_int16_t result;
+-	u_int16_t req_resp;
++	__u8  stuff[196];
++	__u8  key_mac[32];
++	__u8  data[256];
++	__u8  nonce[16];
++	__u32 write_counter;
++	__u16 addr;
++	__u16 block_count;
++	__u16 result;
++	__u16 req_resp;
+ };
+ 
+ #define BSG_REPLY_SZ (sizeof(struct ufs_bsg_reply))
+-- 
+2.24.1
+
diff --git a/meta-filesystems/recipes-utils/ufs-utils/ufs-utils_git.bb b/meta-filesystems/recipes-utils/ufs-utils/ufs-utils_git.bb
new file mode 100644
index 0000000000..5fdd089aef
--- /dev/null
+++ b/meta-filesystems/recipes-utils/ufs-utils/ufs-utils_git.bb
@@ -0,0 +1,32 @@ 
+SUMMARY = "Tool to access UFS (Universal Flash Storage) devices"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+PV = "1.6+git${SRCPV}"
+
+BRANCH ?= "dev"
+
+SRCREV = "a3cf93b66f4606a46354cf884d24aa966661f848"
+
+SRC_URI = "git://github.com/westerndigitalcorporation/ufs-utils.git;protocol=git;branch=${BRANCH} \
+           file://0001-Replace-u_intXX_t-with-kernel-typedefs.patch \
+"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} CC="${CC}" CFLAGS="${CFLAGS}""
+
+CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__ -D_GNU_SOURCE"
+
+do_configure() {
+	sed -i -e "s|-static$||g" ${S}/Makefile
+}
+
+do_install() {
+	install -D -m 755 ${S}/ufs-utils ${D}${bindir}/ufs-utils
+}
+
+PROVIDES += "ufs-tool"
+
+RPROVIDES_${PN} += "ufs-tool"
+