# Currently the dependencies are not all handled. But that's true of
# our buildroot in general, since it wasn't really set up for end users.
-OPENWRT_TARGETS:= gcc3_3 openwrt-linux openwrt-kmodules.tar.bz2 \
+OPENWRT_TARGETS:= $(STAGING_DIR)/bin/sstrip gcc3_3 openwrt-linux openwrt-kmodules.tar.bz2 \
openwrt-shared openwrt-mtd openwrt-nvram openwrt-wlconf \
bridge dnsmasq1 iptables wtools busybox \
openwrt-rootprep
touch $(LINUX_DIR)/.unpacked
$(LINUX_DIR)/.patched: $(WRT54G_DIR)/.prepared
- $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR)/../.. $(SOURCE_DIR)/openwrt/kernel/patches
+ $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR) $(SOURCE_DIR)/openwrt/kernel/patches
# use replacement diag module code
cp -f $(SOURCE_DIR)/openwrt/kernel/diag.c $(LINUX_DIR)/drivers/net/diag/diag_led.c
cp -f $(SOURCE_DIR)/openwrt/kernel/linux.config $(LINUX_DIR)/.config
)
touch $(LINUX_DIR)/.patched
-$(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched $(LINUX_DIR)/.bbc-patched $(LINUX_DIR)/.nf-patched
+$(LINUX_DIR)/.configured: $(LINUX_DIR)/.nf-patched $(LINUX_DIR)/.patched $(LINUX_DIR)/.bbc-patched
$(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" $(LINUX_DIR)/Makefile
$(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" $(LINUX_DIR)/arch/mips/Makefile
$(SED) "s,\-mcpu=,\-mtune=,g;" $(LINUX_DIR)/arch/mips/Makefile
openwrt-kmodules.tar.bz2: $(LINUX_DIR)/$(LINUX_BINLOC)
$(MAKE) -C $(LINUX_DIR) modules
- $(MAKE) -C $(LINUX_DIR) DEPMOD=/bin/true \
+ $(MAKE) -C $(LINUX_DIR) DEPMOD=true \
INSTALL_MOD_PATH=$(LINUX_DIR)/modules modules_install
tar -C $(LINUX_DIR)/modules/lib -cjf openwrt-kmodules.tar.bz2 modules
######################################################################
openwrt-prune: openwrt-base
- -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
# remove unneeded uClibc libs
rm -rf $(TARGET_DIR)/lib/libthread_db*
rm -rf $(TARGET_DIR)/lib/libpthread*
rm -f $(TARGET_DIR)/usr/sbin/iptables-save
rm -f $(TARGET_DIR)/usr/sbin/iptables-restore
rm -f $(TARGET_DIR)/usr/sbin/ip6tables
+ rm -f $(TARGET_DIR)/usr/lib/iptables/libip6*
+ -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STAGING_DIR)/bin/sstrip 2>/dev/null || true;
######################################################################
+$(STAGING_DIR)/bin/sstrip:
+ $(CC) -o $(STAGING_DIR)/bin/sstrip $(SOURCE_DIR)/openwrt/tools/sstrip.c
+
wrt-tools:
$(CC) -o $(WRT54G_DIR)/release/tools/trx $(SOURCE_DIR)/openwrt/tools/trx.c
$(CC) -o $(WRT54G_DIR)/release/tools/addpattern $(SOURCE_DIR)/openwrt/tools/addpattern.c