[oe-commits] org.oe.dev klibc-utils-fstype: Create a separate recipe for klibc's fstype.
pfalcon commit
openembedded-commits at lists.openembedded.org
Mon Nov 26 16:05:51 UTC 2007
klibc-utils-fstype: Create a separate recipe for klibc's fstype.
* ... built against normal system libc.
Author: pfalcon at openembedded.org
Branch: org.openembedded.dev
Revision: a04a9f33366084556ba47209e89e435996f4fbc6
ViewMTN: http://monotone.openembedded.org/revision/info/a04a9f33366084556ba47209e89e435996f4fbc6
Files:
1
packages/klibc/files/fstype-sane-and-vfat.patch
packages/klibc/klibc-utils-fstype_1.1.1.bb
Diffs:
#
# mt diff -rcfc33e4f8b788d5007fd0f33d399646615cc8b37 -ra04a9f33366084556ba47209e89e435996f4fbc6
#
#
#
# add_file "packages/klibc/files/fstype-sane-and-vfat.patch"
# content [d4a15a94ce1fcbe5660e3ae975c493c18920219b]
#
# add_file "packages/klibc/klibc-utils-fstype_1.1.1.bb"
# content [aee9890849d771d8cb3019aa6ec1ac6af845eea7]
#
============================================================
--- packages/klibc/files/fstype-sane-and-vfat.patch d4a15a94ce1fcbe5660e3ae975c493c18920219b
+++ packages/klibc/files/fstype-sane-and-vfat.patch d4a15a94ce1fcbe5660e3ae975c493c18920219b
@@ -0,0 +1,60 @@
+Patch to compile fstype util against "normal" libc (glibc/uclicb), and to
+add vfat detection.
+
+--- klibc-1.1.1/utils/fstype.c.org 2005-09-06 23:49:34.000000000 +0300
++++ klibc-1.1.1/utils/fstype.c 2007-11-24 01:07:26.000000000 +0200
+@@ -13,11 +13,18 @@
+ */
+
+ #include <sys/types.h>
++#include <linux/types.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <endian.h>
+ #include <netinet/in.h>
++#if __BYTE_ORDER == __BIG_ENDIAN
++#include <linux/byteorder/big_endian.h>
++#else
++#include <linux/byteorder/little_endian.h>
++#endif
++
+
+ #define cpu_to_be32(x) __cpu_to_be32(x) /* Needed by romfs_fs.h */
+
+@@ -105,6 +112,18 @@
+ return 0;
+ }
+
++static int vfat_image(const unsigned char *buf, unsigned long *blocks)
++{
++ const struct romfs_super_block *sb =
++ (const struct romfs_super_block *)buf;
++ if (!strncmp(buf + 54, "FAT12 ", 8)
++ || !strncmp(buf + 54, "FAT16 ", 8)
++ || !strncmp(buf + 82, "FAT32 ", 8))
++ return 1;
++
++ return 0;
++}
++
+ static int minix_image(const unsigned char *buf, unsigned long *blocks)
+ {
+ const struct minix_super_block *sb =
+@@ -167,8 +186,6 @@
+ (const struct xfs_sb *)buf;
+
+ if (__be32_to_cpu(sb->sb_magicnum) == XFS_SB_MAGIC) {
+- *blocks = __be64_to_cpu(sb->sb_dblocks) *
+- (__be32_to_cpu(sb->sb_blocksize) / BLOCK_SIZE);
+ return 1;
+ }
+ return 0;
+@@ -184,6 +201,7 @@
+ { 0, "gzip", gzip_image },
+ { 0, "cramfs", cramfs_image },
+ { 0, "romfs", romfs_image },
++ { 0, "vfat", vfat_image },
+ { 0, "xfs", xfs_image },
+ { 1, "minix", minix_image },
+ { 1, "ext3", ext3_image },
============================================================
--- packages/klibc/klibc-utils-fstype_1.1.1.bb aee9890849d771d8cb3019aa6ec1ac6af845eea7
+++ packages/klibc/klibc-utils-fstype_1.1.1.bb aee9890849d771d8cb3019aa6ec1ac6af845eea7
@@ -0,0 +1,14 @@
+SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/klibc/Stable/klibc-${PV}.tar.bz2"
+SRC_URI += "file://fstype-sane-and-vfat.patch;patch=1"
+PR = "r0"
+
+S = "${WORKDIR}/klibc-${PV}"
+
+do_compile() {
+ ${CC} -o fstype utils/fstype.c -static
+}
+
+do_install () {
+ install -d ${D}${bindir}
+ install -m 0755 fstype ${D}${bindir}/
+}
More information about the Openembedded-commits
mailing list