summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-03-22 16:27:13 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2014-03-22 16:27:13 +0100
commitade8f1154feea499c3743ab14e9ced6783812316 (patch)
tree0fc32bdf28d37de35ba2e47763144b1fa4544d8e
parent89969d496f0acb304b4fd22867cb94b9ad93631e (diff)
a bunch of microblaze fixes
-rw-r--r--mk/image.mk2
-rw-r--r--target/config/Config.in17
-rw-r--r--target/linux/config/Config.in.flash4
-rw-r--r--target/linux/config/Config.in.fs23
-rw-r--r--target/microblaze/sys-available/qemu-microblaze1
-rw-r--r--target/microblaze/sys-available/qemu-microblazeel1
-rw-r--r--tools/mtd-utils/patches/darwin.patch261
-rw-r--r--tools/squashfs/Makefile2
-rw-r--r--tools/squashfs/patches/darwin.patch88
9 files changed, 386 insertions, 13 deletions
diff --git a/mk/image.mk b/mk/image.mk
index ff95c5cb0..8ae7e087e 100644
--- a/mk/image.mk
+++ b/mk/image.mk
@@ -157,7 +157,7 @@ ${BUILD_DIR}/root.squashfs: ${TARGET_DIR}
-nopad -noappend -root-owned $(MAKE_TRACE)
${FW_DIR}/${ROOTFSJFFS2}: ${TARGET_DIR}
- ${STAGING_HOST_DIR}/usr/bin/mkfs.jffs2 $(ADK_JFFS2_OPTS) -q -r ${TARGET_DIR} \
+ ${STAGING_HOST_DIR}/usr/bin/mkfs.jffs2 $(ADK_JFFS2_OPTS) -X zlib -r ${TARGET_DIR} \
--pad=$(ADK_TARGET_MTD_SIZE) -o ${FW_DIR}/${ROOTFSJFFS2} $(MAKE_TRACE)
createinitramfs: ${STAGING_TARGET_DIR}/${INITRAMFS}_list
diff --git a/target/config/Config.in b/target/config/Config.in
index 6125a2c81..84f19adec 100644
--- a/target/config/Config.in
+++ b/target/config/Config.in
@@ -218,12 +218,12 @@ choice
prompt "Qemu MICROBLAZE Emulation"
depends on ADK_TARGET_SYSTEM_QEMU_MICROBLAZE || ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL
-config ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605
- boolean "Xilinx ml605"
-
config ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800
boolean "Xilinx Spartan S3ADSP1800"
+config ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605
+ boolean "Xilinx ml605"
+
endchoice
choice
@@ -254,6 +254,8 @@ choice
prompt "Qemu Emulation with permanent storage device (disk/flash)"
depends on ADK_HARDWARE_QEMU
default ADK_TARGET_QEMU_WITH_BLOCK if ADK_TARGET_ROOTFS_ARCHIVE
+default ADK_TARGET_QEMU_WITH_BLOCK if ADK_TARGET_ROOTFS_SQUASHFS
+default ADK_TARGET_QEMU_WITH_BLOCK if ADK_TARGET_ROOTFS_JFFS2
config ADK_TARGET_QEMU_WITHOUT_BLOCK
boolean "disabled"
@@ -261,12 +263,14 @@ config ADK_TARGET_QEMU_WITHOUT_BLOCK
config ADK_TARGET_QEMU_WITH_BLOCK
boolean "enabled"
select ADK_KERNEL_SCSI_SYM53C8XX_2 if ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB
- select ADK_KERNEL_MTD_M25P80 if ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605
+ select ADK_KERNEL_MTD_M25P80 if ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605 || ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800
select ADK_KERNEL_ATA_PIIX if ADK_LINUX_MIPS || ADK_TARGET_SYSTEM_QEMU_I686 || ADK_TARGET_SYSTEM_QEMU_X86_64
select ADK_KERNEL_PATA_MACIO if ADK_TARGET_SYSTEM_QEMU_PPC
select ADK_KERNEL_SCSI_IBMVSCSI if ADK_TARGET_SYSTEM_QEMU_PPC64
select ADK_KERNEL_SCSI_SUNESP if ADK_TARGET_SYSTEM_QEMU_SPARC
select ADK_KERNEL_PATA_PLATFORM if ADK_LINUX_SH
+ select ADK_HOST_NEED_JFFS2 if ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605 || ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800
+ select ADK_HOST_NEED_SQUASHFS if ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605 || ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800
endchoice
@@ -773,15 +777,16 @@ config ADK_TARGET_ROOTFS_SQUASHFS
bool "Compressed read-only root filesystem (squashfs)"
select ADK_KERNEL_SQUASHFS
select ADK_HOST_NEED_SQUASHFS
+ select ADK_TARGET_QEMU_WITH_BLOCK if ADK_HARDWARE_QEMU
depends on ADK_TARGET_WITH_MTD
help
highly compressed read-only filesystem for MTD flash systems.
config ADK_TARGET_ROOTFS_JFFS2
bool "Compressed read-write root filesystem (jffs2)"
- select ADK_KERNEL_MISC_FILESYSTEMS
- select ADK_KERNEL_JFFS2
+ select ADK_KERNEL_JFFS2_FS
select ADK_HOST_NEED_JFFS2
+ select ADK_TARGET_QEMU_WITH_BLOCK if ADK_HARDWARE_QEMU
depends on ADK_TARGET_WITH_MTD
help
compressed read-write filesystem for MTD flash systems.
diff --git a/target/linux/config/Config.in.flash b/target/linux/config/Config.in.flash
index d8f4faf0f..03976a6d7 100644
--- a/target/linux/config/Config.in.flash
+++ b/target/linux/config/Config.in.flash
@@ -145,6 +145,6 @@ config ADK_TARGET_MTD
config ADK_TARGET_MTD_SIZE
int
- default "33554432" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE
- default "33554432" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL
+ default "16777216" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_S3ADSP1800
+ default "33554432" if ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605
default "0"
diff --git a/target/linux/config/Config.in.fs b/target/linux/config/Config.in.fs
index 377122dc5..db50c3a7f 100644
--- a/target/linux/config/Config.in.fs
+++ b/target/linux/config/Config.in.fs
@@ -11,9 +11,6 @@ config ADK_KERNEL_EXPORTFS
boolean
default y
-config ADK_KERNEL_JFFS2_FS
- boolean
-
config ADK_KERNEL_YAFFS_FS
tristate
@@ -51,6 +48,26 @@ config ADK_KERNEL_SQUASHFS_XZ
boolean
default n
+config ADK_KERNEL_JFFS2_FS_DEBUG
+ int
+ default "1"
+
+config ADK_KERNEL_JFFS2_COMPRESSION_OPTIONS
+ boolean
+ default n
+
+config ADK_KERNEL_JFFS2_ZLIB
+ boolean
+ default n
+
+config ADK_KERNEL_JFFS2_FS
+ prompt "jffs2............................. JFFS2 filesystem"
+ select ADK_KERNEL_MISC_FILESYSTEMS
+ select ADK_KERNEL_JFFS2_COMPRESSION_OPTIONS
+ select ADK_KERNEL_JFFS2_ZLIB
+ select ADK_KERNEL_JFFS2_FS_DEBUG
+ boolean
+
config ADK_KERNEL_SQUASHFS
prompt "squashfs.......................... SquashFS filesystem"
boolean
diff --git a/target/microblaze/sys-available/qemu-microblaze b/target/microblaze/sys-available/qemu-microblaze
index 63214e39b..ee9cb6a52 100644
--- a/target/microblaze/sys-available/qemu-microblaze
+++ b/target/microblaze/sys-available/qemu-microblaze
@@ -4,6 +4,7 @@ config ADK_TARGET_SYSTEM_QEMU_MICROBLAZE
select ADK_big
select ADK_qemu_microblaze
select ADK_HARDWARE_QEMU
+ select ADK_TARGET_WITH_MTD
select ADK_TARGET_KERNEL_LINUXBIN
help
Qemu support for microblaze big endian architecture.
diff --git a/target/microblaze/sys-available/qemu-microblazeel b/target/microblaze/sys-available/qemu-microblazeel
index a58083770..88c1c25db 100644
--- a/target/microblaze/sys-available/qemu-microblazeel
+++ b/target/microblaze/sys-available/qemu-microblazeel
@@ -4,6 +4,7 @@ config ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL
select ADK_qemu_microblazeel
select ADK_little
select ADK_HARDWARE_QEMU
+ select ADK_TARGET_WITH_MTD
select ADK_TARGET_KERNEL_LINUXBIN
help
Qemu support for microblaze little endian architecture.
diff --git a/tools/mtd-utils/patches/darwin.patch b/tools/mtd-utils/patches/darwin.patch
new file mode 100644
index 000000000..1df2ccba2
--- /dev/null
+++ b/tools/mtd-utils/patches/darwin.patch
@@ -0,0 +1,261 @@
+diff -Nur mtd-utils-1.5.0.orig/common.mk mtd-utils-1.5.0/common.mk
+--- mtd-utils-1.5.0.orig/common.mk 2012-05-07 09:19:39.000000000 +0200
++++ mtd-utils-1.5.0/common.mk 2014-03-22 11:25:31.000000000 +0100
+@@ -13,8 +13,6 @@
+ $(call cc-option,-Wwrite-strings) \
+ $(call cc-option,-Wno-sign-compare)
+ CFLAGS += $(WFLAGS)
+-SECTION_CFLAGS := $(call cc-option,-ffunction-sections -fdata-sections -Wl$(comma)--gc-sections)
+-CFLAGS += $(SECTION_CFLAGS)
+
+ ifneq ($(WITHOUT_LARGEFILE), 1)
+ CPPFLAGS += -D_FILE_OFFSET_BITS=64
+diff -Nur mtd-utils-1.5.0.orig/compr_lzo.c mtd-utils-1.5.0/compr_lzo.c
+--- mtd-utils-1.5.0.orig/compr_lzo.c 2012-05-07 09:19:39.000000000 +0200
++++ mtd-utils-1.5.0/compr_lzo.c 2014-03-22 11:12:06.000000000 +0100
+@@ -26,7 +26,6 @@
+ #include <string.h>
+
+ #ifndef WITHOUT_LZO
+-#include <asm/types.h>
+ #include <linux/jffs2.h>
+ #include <lzo/lzo1x.h>
+ #include "compr.h"
+diff -Nur mtd-utils-1.5.0.orig/compr_zlib.c mtd-utils-1.5.0/compr_zlib.c
+--- mtd-utils-1.5.0.orig/compr_zlib.c 2012-05-07 09:19:39.000000000 +0200
++++ mtd-utils-1.5.0/compr_zlib.c 2014-03-22 11:11:57.000000000 +0100
+@@ -39,7 +39,6 @@
+ #include <zlib.h>
+ #undef crc32
+ #include <stdio.h>
+-#include <asm/types.h>
+ #include <linux/jffs2.h>
+ #include "common.h"
+ #include "compr.h"
+diff -Nur mtd-utils-1.5.0.orig/include/byteswap.h mtd-utils-1.5.0/include/byteswap.h
+--- mtd-utils-1.5.0.orig/include/byteswap.h 1970-01-01 01:00:00.000000000 +0100
++++ mtd-utils-1.5.0/include/byteswap.h 2014-03-22 10:52:15.000000000 +0100
+@@ -0,0 +1,25 @@
++#ifndef _BYTESWAP_H
++#define _BYTESWAP_H
++
++#include <stdint.h>
++
++static __inline uint16_t __bswap_16(uint16_t __x)
++{
++ return __x<<8 | __x>>8;
++}
++
++static __inline uint32_t __bswap_32(uint32_t __x)
++{
++ return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24;
++}
++
++static __inline uint64_t __bswap_64(uint64_t __x)
++{
++ return __bswap_32(__x)+0ULL<<32 | __bswap_32(__x>>32);
++}
++
++#define bswap_16(x) __bswap_16(x)
++#define bswap_32(x) __bswap_32(x)
++#define bswap_64(x) __bswap_64(x)
++
++#endif
+diff -Nur mtd-utils-1.5.0.orig/include/endian.h mtd-utils-1.5.0/include/endian.h
+--- mtd-utils-1.5.0.orig/include/endian.h 1970-01-01 01:00:00.000000000 +0100
++++ mtd-utils-1.5.0/include/endian.h 2014-03-22 11:09:57.000000000 +0100
+@@ -0,0 +1,20 @@
++#ifndef _ENDIAN_H
++#define _ENDIAN_H
++
++#ifndef __BIG_ENDIAN
++#define __BIG_ENDIAN 4321
++#endif
++
++ #ifndef __LITTLE_ENDIAN
++ #define __LITTLE_ENDIAN 1234
++ #endif
++
++#ifndef __BYTE_ORDER
++#define __BYTE_ORDER __LITTLE_ENDIAN
++#endif
++
++#ifndef BYTE_ORDER
++#define BYTE_ORDER __LITTLE_ENDIAN
++#endif
++
++#endif
+diff -Nur mtd-utils-1.5.0.orig/include/linux/types.h mtd-utils-1.5.0/include/linux/types.h
+--- mtd-utils-1.5.0.orig/include/linux/types.h 1970-01-01 01:00:00.000000000 +0100
++++ mtd-utils-1.5.0/include/linux/types.h 2014-03-22 11:17:12.000000000 +0100
+@@ -0,0 +1,18 @@
++#ifndef _LINUX_TYPES_H
++#define _LINUX_TYPES_H
++
++#include <mtd/ubi-media.h>
++
++typedef uint16_t __u16;
++typedef uint32_t __u32;
++typedef uint64_t __u64;
++
++typedef __u16 __le16;
++typedef __u32 __le32;
++typedef __u64 __le64;
++typedef __u64 off64_t;
++
++typedef __u16 __sum16;
++typedef __u32 __wsum;
++
++#endif /* _LINUX_TYPES_H */
+diff -Nur mtd-utils-1.5.0.orig/include/mtd/jffs2-user.h mtd-utils-1.5.0/include/mtd/jffs2-user.h
+--- mtd-utils-1.5.0.orig/include/mtd/jffs2-user.h 2012-05-07 09:19:39.000000000 +0200
++++ mtd-utils-1.5.0/include/mtd/jffs2-user.h 2014-03-22 11:01:37.000000000 +0100
+@@ -9,8 +9,13 @@
+
+ /* This file is blessed for inclusion by userspace */
+ #include <linux/jffs2.h>
++#if defined(__APPLE__)
++#include "endian.h"
++#include "byteswap.h"
++#else
+ #include <endian.h>
+ #include <byteswap.h>
++#endif
+
+ #undef cpu_to_je16
+ #undef cpu_to_je32
+diff -Nur mtd-utils-1.5.0.orig/include/mtd/mtd-abi.h mtd-utils-1.5.0/include/mtd/mtd-abi.h
+--- mtd-utils-1.5.0.orig/include/mtd/mtd-abi.h 2012-05-07 09:19:39.000000000 +0200
++++ mtd-utils-1.5.0/include/mtd/mtd-abi.h 2014-03-22 11:21:06.000000000 +0100
+@@ -171,9 +171,9 @@
+ /* Get info about OOB modes (e.g., RAW, PLACE, AUTO) - legacy interface */
+ #define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
+ /* Check if an eraseblock is bad */
+-#define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t)
++#define MEMGETBADBLOCK _IOW('M', 11, off_t)
+ /* Mark an eraseblock as bad */
+-#define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t)
++#define MEMSETBADBLOCK _IOW('M', 12, off_t)
+ /* Set OTP (One-Time Programmable) mode (factory vs. user) */
+ #define OTPSELECT _IOR('M', 13, int)
+ /* Get number of OTP (One-Time Programmable) regions */
+diff -Nur mtd-utils-1.5.0.orig/include/mtd/ubi-media.h mtd-utils-1.5.0/include/mtd/ubi-media.h
+--- mtd-utils-1.5.0.orig/include/mtd/ubi-media.h 2012-05-07 09:19:39.000000000 +0200
++++ mtd-utils-1.5.0/include/mtd/ubi-media.h 2014-03-22 11:18:03.000000000 +0100
+@@ -30,7 +30,15 @@
+ #ifndef __UBI_MEDIA_H__
+ #define __UBI_MEDIA_H__
+
++#ifdef __linux__
+ #include <asm/byteorder.h>
++#else
++#include <stdint.h>
++typedef uint8_t __u8;
++typedef uint16_t __be16;
++typedef uint32_t __be32;
++typedef uint64_t __be64;
++#endif
+
+ /* The version of UBI images supported by this implementation */
+ #define UBI_VERSION 1
+diff -Nur mtd-utils-1.5.0.orig/lib/libfec.c mtd-utils-1.5.0/lib/libfec.c
+--- mtd-utils-1.5.0.orig/lib/libfec.c 2012-05-07 09:19:39.000000000 +0200
++++ mtd-utils-1.5.0/lib/libfec.c 2014-03-22 11:24:15.000000000 +0100
+@@ -61,8 +61,6 @@
+ };
+ #define gettimeofday(x, dummy) { (x)->ticks = clock() ; }
+ #define DIFF_T(a,b) (1+ 1000000*(a.ticks - b.ticks) / CLOCKS_PER_SEC )
+-typedef unsigned long u_long ;
+-typedef unsigned short u_short ;
+ #else /* typically, unix systems */
+ #include <sys/time.h>
+ #define DIFF_T(a,b) \
+@@ -625,7 +623,7 @@
+ #define FEC_MAGIC 0xFECC0DEC
+
+ struct fec_parms {
+- u_long magic ;
++ unsigned long magic ;
+ int k, n ; /* parameters of the code */
+ gf *enc_matrix ;
+ } ;
+diff -Nur mtd-utils-1.5.0.orig/lib/libmtd.c mtd-utils-1.5.0/lib/libmtd.c
+--- mtd-utils-1.5.0.orig/lib/libmtd.c 2012-05-07 09:19:39.000000000 +0200
++++ mtd-utils-1.5.0/lib/libmtd.c 2014-03-22 11:15:49.000000000 +0100
+@@ -1006,7 +1006,7 @@
+ int mtd_is_bad(const struct mtd_dev_info *mtd, int fd, int eb)
+ {
+ int ret;
+- loff_t seek;
++ off_t seek;
+
+ ret = mtd_valid_erase_block(mtd, eb);
+ if (ret)
+@@ -1015,7 +1015,7 @@
+ if (!mtd->bb_allowed)
+ return 0;
+
+- seek = (loff_t)eb * mtd->eb_size;
++ seek = (off_t)eb * mtd->eb_size;
+ ret = ioctl(fd, MEMGETBADBLOCK, &seek);
+ if (ret == -1)
+ return mtd_ioctl_error(mtd, eb, "MEMGETBADBLOCK");
+@@ -1025,7 +1025,7 @@
+ int mtd_mark_bad(const struct mtd_dev_info *mtd, int fd, int eb)
+ {
+ int ret;
+- loff_t seek;
++ off_t seek;
+
+ if (!mtd->bb_allowed) {
+ errno = EINVAL;
+@@ -1036,7 +1036,7 @@
+ if (ret)
+ return ret;
+
+- seek = (loff_t)eb * mtd->eb_size;
++ seek = (off_t)eb * mtd->eb_size;
+ ret = ioctl(fd, MEMSETBADBLOCK, &seek);
+ if (ret == -1)
+ return mtd_ioctl_error(mtd, eb, "MEMSETBADBLOCK");
+diff -Nur mtd-utils-1.5.0.orig/lib/libmtd_legacy.c mtd-utils-1.5.0/lib/libmtd_legacy.c
+--- mtd-utils-1.5.0.orig/lib/libmtd_legacy.c 2012-05-07 09:19:39.000000000 +0200
++++ mtd-utils-1.5.0/lib/libmtd_legacy.c 2014-03-22 11:22:18.000000000 +0100
+@@ -234,7 +234,7 @@
+ struct stat st;
+ struct mtd_info_user ui;
+ int fd, ret;
+- loff_t offs = 0;
++ off_t offs = 0;
+ struct proc_parse_info pi;
+
+ if (stat(node, &st)) {
+diff -Nur mtd-utils-1.5.0.orig/mkfs.jffs2.c mtd-utils-1.5.0/mkfs.jffs2.c
+--- mtd-utils-1.5.0.orig/mkfs.jffs2.c 2012-05-07 09:19:39.000000000 +0200
++++ mtd-utils-1.5.0/mkfs.jffs2.c 2014-03-22 11:11:15.000000000 +0100
+@@ -70,7 +70,12 @@
+ #include <sys/xattr.h>
+ #include <sys/acl.h>
+ #endif
++#if defined(__APPLE__)
++#include "endian.h"
++#include "byteswap.h"
++#else
+ #include <byteswap.h>
++#endif
+ #include <crc32.h>
+ #include <inttypes.h>
+
+diff -Nur mtd-utils-1.5.0.orig/rbtree.h mtd-utils-1.5.0/rbtree.h
+--- mtd-utils-1.5.0.orig/rbtree.h 2012-05-07 09:19:39.000000000 +0200
++++ mtd-utils-1.5.0/rbtree.h 2014-03-22 11:07:58.000000000 +0100
+@@ -94,8 +94,7 @@
+ #ifndef _LINUX_RBTREE_H
+ #define _LINUX_RBTREE_H
+
+-#include <linux/kernel.h>
+-#include <linux/stddef.h>
++#include <stddef.h>
+
+ struct rb_node
+ {
diff --git a/tools/squashfs/Makefile b/tools/squashfs/Makefile
index 423008ff8..06e4215b7 100644
--- a/tools/squashfs/Makefile
+++ b/tools/squashfs/Makefile
@@ -18,7 +18,7 @@ install: ${STAGING_HOST_DIR}/usr/bin/mksquashfs
$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
${MAKE} -C ${WRKBUILD}/squashfs-tools CC='${CC_FOR_BUILD}' \
- XZ_SUPPORT=1 CPPFLAGS_FOR_BUILD=$(CPPFLAGS_FOR_BUILD) \
+ XATTR_SUPPORT=0 XZ_SUPPORT=1 CPPFLAGS_FOR_BUILD=$(CPPFLAGS_FOR_BUILD) \
EXTRA_LDFLAGS=$(LDFLAGS_FOR_BUILD)
@touch $@
diff --git a/tools/squashfs/patches/darwin.patch b/tools/squashfs/patches/darwin.patch
new file mode 100644
index 000000000..b1d2ebd2e
--- /dev/null
+++ b/tools/squashfs/patches/darwin.patch
@@ -0,0 +1,88 @@
+diff -Nur squashfs4.2.orig/squashfs-tools/mksquashfs.c squashfs4.2/squashfs-tools/mksquashfs.c
+--- squashfs4.2.orig/squashfs-tools/mksquashfs.c 2011-02-28 23:24:09.000000000 +0100
++++ squashfs4.2/squashfs-tools/mksquashfs.c 2014-03-22 11:32:00.000000000 +0100
+@@ -60,6 +60,10 @@
+ #include <sys/sysinfo.h>
+ #endif
+
++#ifndef FNM_EXTMATCH
++#define FNM_EXTMATCH 0
++#endif
++
+ #ifdef SQUASHFS_TRACE
+ #define TRACE(s, args...) \
+ do { \
+@@ -721,13 +725,13 @@
+ + (((char *)A) - data_cache)))
+
+
+-inline void inc_progress_bar()
++static inline void inc_progress_bar()
+ {
+ cur_uncompressed ++;
+ }
+
+
+-inline void update_progress_bar()
++static inline void update_progress_bar()
+ {
+ pthread_mutex_lock(&progress_mutex);
+ pthread_cond_signal(&progress_wait);
+@@ -735,7 +739,7 @@
+ }
+
+
+-inline void waitforthread(int i)
++static inline void waitforthread(int i)
+ {
+ TRACE("Waiting for thread %d\n", i);
+ while(thread[i] != 0)
+@@ -3340,7 +3344,7 @@
+ }
+
+
+-inline void add_dir_entry(char *name, char *pathname, struct dir_info *sub_dir,
++static inline void add_dir_entry(char *name, char *pathname, struct dir_info *sub_dir,
+ struct inode_info *inode_info, struct dir_info *dir)
+ {
+ if((dir->count % DIR_ENTRIES) == 0) {
+diff -Nur squashfs4.2.orig/squashfs-tools/unsquashfs.c squashfs4.2/squashfs-tools/unsquashfs.c
+--- squashfs4.2.orig/squashfs-tools/unsquashfs.c 2011-02-28 23:27:06.000000000 +0100
++++ squashfs4.2/squashfs-tools/unsquashfs.c 2014-03-22 11:36:27.000000000 +0100
+@@ -29,7 +29,13 @@
+ #include "compressor.h"
+ #include "xattr.h"
+
++#ifndef FNM_EXTMATCH
++#define FNM_EXTMATCH 0
++#endif
++
++#ifdef __linux__
+ #include <sys/sysinfo.h>
++#endif
+ #include <sys/types.h>
+
+ struct cache *fragment_cache, *data_cache;
+@@ -1810,7 +1816,7 @@
+ "\n");
+
+ if(processors == -1) {
+-#ifndef linux
++#if 0
+ int mib[2];
+ size_t len = sizeof(processors);
+
+@@ -1821,11 +1827,13 @@
+ mib[1] = HW_NCPU;
+ #endif
+
++#ifdef __linux__
+ if(sysctl(mib, 2, &processors, &len, NULL, 0) == -1) {
+ ERROR("Failed to get number of available processors. "
+ "Defaulting to 1\n");
+ processors = 1;
+ }
++#endif
+ #else
+ processors = sysconf(_SC_NPROCESSORS_ONLN);
+ #endif