aboutsummaryrefslogtreecommitdiff
path: root/target/cramfs/cramfs-02-endian.patch
diff options
context:
space:
mode:
authorGravatar Eric Andersen <andersen@codepoet.org>2005-05-06 00:17:04 +0000
committerGravatar Eric Andersen <andersen@codepoet.org>2005-05-06 00:17:04 +0000
commit1515bfd3bbfdd1892d72cdd32ab4394f1ecc9e49 (patch)
treec7007152f3e8afe00f51a9a6bdcc5d7833b72c11 /target/cramfs/cramfs-02-endian.patch
parent42f7febfb8acfacc5cd613f57b950e1708a6084d (diff)
downloadbuildroot-1515bfd3bbfdd1892d72cdd32ab4394f1ecc9e49.tar.gz
buildroot-1515bfd3bbfdd1892d72cdd32ab4394f1ecc9e49.tar.bz2
Teach cramfs to handle byteswapping sanely. I want to specify
big endian or little endian, not whether to unconditionally do byteswapping regardless of build system byte order.
Diffstat (limited to 'target/cramfs/cramfs-02-endian.patch')
-rw-r--r--target/cramfs/cramfs-02-endian.patch19
1 files changed, 14 insertions, 5 deletions
diff --git a/target/cramfs/cramfs-02-endian.patch b/target/cramfs/cramfs-02-endian.patch
index 2b9df3f3aa..4c28b8397a 100644
--- a/target/cramfs/cramfs-02-endian.patch
+++ b/target/cramfs/cramfs-02-endian.patch
@@ -8,11 +8,12 @@
static int warn_dev, warn_gid, warn_namelen, warn_skip, warn_size, warn_uid;
static const char *const memory_exhausted = "memory exhausted";
-@@ -155,6 +156,7 @@
+@@ -155,6 +156,8 @@
" -i file insert a file image into the filesystem (requires >= 2.4.0)\n"
" -n name set name of cramfs filesystem\n"
" -p pad by %d bytes for boot code\n"
-+ " -r reverse endian-ness of filesystem\n"
++ " -l litte endian filesystem\n"
++ " -b big endian filesystem\n"
" -s sort directory entries (old option, ignored)\n"
" -v be more verbose\n"
" -z make explicit holes (requires >= 2.3.39)\n"
@@ -108,17 +109,25 @@
/* command line options */
- while ((c = getopt(argc, argv, "hEe:i:n:psvzD:q")) != EOF) {
-+ while ((c = getopt(argc, argv, "hEe:i:n:prsvzD:q")) != EOF) {
++ while ((c = getopt(argc, argv, "hEe:i:n:psvzD:qlb")) != EOF) {
switch (c) {
case 'h':
usage(MKFS_OK);
-@@ -1174,6 +1226,10 @@
+@@ -1174,6 +1227,18 @@
opt_pad = PAD_SIZE;
fslen_ub += PAD_SIZE;
break;
-+ case 'r':
++ case 'b':
++#if __BYTE_ORDER == __LITTLE_ENDIAN
+ swap_endian = 1;
+ printf("Swapping filesystem endian-ness\n");
++#endif
++ break;
++ case 'l':
++#if __BYTE_ORDER == __BIG_ENDIAN
++ swap_endian = 1;
++ printf("Swapping filesystem endian-ness\n");
++#endif
+ break;
case 's':
/* old option, ignored */