diff options
Diffstat (limited to 'package')
-rw-r--r-- | package/Makefile | 4 | ||||
-rw-r--r-- | package/sdk/Makefile | 72 | ||||
-rw-r--r-- | package/sdk/files/Makefile.ib | 61 | ||||
-rw-r--r-- | package/sdk/files/README.ImageBuilder | 8 | ||||
-rw-r--r-- | package/sdk/files/sysconf | 4 |
5 files changed, 132 insertions, 17 deletions
diff --git a/package/Makefile b/package/Makefile index bd938800d..4008d434c 100644 --- a/package/Makefile +++ b/package/Makefile @@ -66,6 +66,8 @@ package-$(BR2_PACKAGE_LIBPQ) += postgresql DEV_LIBS:=tcp_wrappers glib ncurses openssl pcre popt zlib libnet libpcap mysql postgresql iptables matrixssl lzo gmp fuse portmap libelf DEV_LIBS_COMPILE:=$(patsubst %,%-compile,$(DEV_LIBS)) +SDK_DEFAULT_PACKAGES:=busybox dnsmasq iptables wireless-tools dropbear bridge +SDK_DEFAULT_COMPILE:=$(patsubst %,%-compile,$(SDK_DEFAULT_PACKAGES)) all: compile install clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m)) linux-clean @@ -106,7 +108,7 @@ ifeq ($(BR2_PACKAGE_SNORT_PGSQL),y) snort-compile: postgresql-compile endif -sdk-compile: $(DEV_LIBS_COMPILE) +sdk-compile: $(DEV_LIBS_COMPILE) $(SDK_DEFAULT_COMPILE) $(patsubst %,%-prepare,$(package-y) $(package-m) $(package-)): linux-install %-prepare: diff --git a/package/sdk/Makefile b/package/sdk/Makefile index b42dda4e4..dba08cabf 100644 --- a/package/sdk/Makefile +++ b/package/sdk/Makefile @@ -6,36 +6,76 @@ PKG_OS:=$(shell uname -s) PKG_CPU:=$(shell uname -m) PKG_RELEASE:=1 -PKG_NAME:=OpenWrt-SDK-$(PKG_OS)-$(PKG_CPU)-$(PKG_RELEASE) +SDK_NAME:=OpenWrt-SDK-$(PKG_OS)-$(PKG_CPU)-$(PKG_RELEASE) +IB_NAME:=OpenWrt-ImageBuilder-$(PKG_OS)-$(PKG_CPU)-$(PKG_RELEASE) -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +SDK_BUILD_DIR:=$(BUILD_DIR)/$(SDK_NAME) +IB_BUILD_DIR:=$(BUILD_DIR)/$(IB_NAME) all: compile -$(BIN_DIR)/$(PKG_NAME).tar.bz2: +$(BIN_DIR)/$(SDK_NAME).tar.bz2: (cd $(STAGING_DIR); \ rm -rf info man share; \ cd usr; \ rm -rf doc info man share; \ ) - rm -rf $(PKG_BUILD_DIR) - mkdir -p $(PKG_BUILD_DIR)/dl $(PKG_BUILD_DIR)/examples $(PKG_BUILD_DIR)/package - cp -a $(STAGING_DIR) $(SCRIPT_DIR) $(TOPDIR)/docs $(PKG_BUILD_DIR)/ - cp -a $(TOPDIR)/package/strace $(TOPDIR)/package/iproute2 $(PKG_BUILD_DIR)/examples - cp $(TOPDIR)/rules.mk $(PKG_BUILD_DIR)/ - cp ./files/Makefile.sdk $(PKG_BUILD_DIR)/Makefile - cp ./files/README.SDK $(PKG_BUILD_DIR)/ - cp ./files/depend.mk $(PKG_BUILD_DIR)/package/ - egrep '^BR2_(ARCH|WGET|STAGING|JLEVEL|LARGEFILE|TARGET_OPT)' $(TOPDIR)/.config > $(PKG_BUILD_DIR)/.config - find $(PKG_BUILD_DIR) -name CVS | xargs rm -rf + rm -rf $(SDK_BUILD_DIR) + mkdir -p $(SDK_BUILD_DIR)/dl $(SDK_BUILD_DIR)/examples $(SDK_BUILD_DIR)/package + cp -a $(STAGING_DIR) $(SCRIPT_DIR) $(TOPDIR)/docs $(SDK_BUILD_DIR)/ + cp -a $(TOPDIR)/package/strace $(TOPDIR)/package/iproute2 $(SDK_BUILD_DIR)/examples + cp $(TOPDIR)/rules.mk $(SDK_BUILD_DIR)/ + cp ./files/Makefile.sdk $(SDK_BUILD_DIR)/Makefile + cp ./files/README.SDK $(SDK_BUILD_DIR)/ + cp ./files/depend.mk $(SDK_BUILD_DIR)/package/ + egrep '^BR2_(ARCH|WGET|STAGING|JLEVEL|LARGEFILE|TARGET_OPT)' $(TOPDIR)/.config > $(SDK_BUILD_DIR)/.config + find $(SDK_BUILD_DIR) -name CVS | xargs rm -rf (cd $(BUILD_DIR); \ - tar cfj $@ $(PKG_NAME); \ + tar cfj $@ $(SDK_NAME); \ + ) + +$(BIN_DIR)/$(IB_NAME).tar.bz2: + rm -rf $(IB_BUILD_DIR) + mkdir -p $(IB_BUILD_DIR)/build + (cd $(BUILD_DIR); \ + cp buildroot-kernel-image loader.gz $(IB_BUILD_DIR)/build; \ + ) + mkdir -p $(IB_BUILD_DIR)/utils + (cd $(STAGING_DIR)/bin; \ + cp addpattern trx motorola-bin sed mkfs.jffs2 mksquashfs-lzma $(IB_BUILD_DIR)/utils; \ + ) + mkdir -p $(IB_BUILD_DIR)/include + mkdir -p $(IB_BUILD_DIR)/packages + (cd $(PACKAGE_DIR); \ + cp busybox_* kmod-brcm-* kmod-wlcompat* dnsmasq_* iptables_* dropbear_* kmod-diag_* \ + wireless-tools_* zlib* bridge_* ppp_* ppp-pppoe* kmod-ppp* openwrt-utils* $(IB_BUILD_DIR)/packages/; \ + ) + egrep '^[^(include|prepare|compile|install)]' < $(TOPDIR)/target/jffs2/Makefile > $(IB_BUILD_DIR)/include/jffs2.mk + egrep '^[^(include|prepare|compile|install)]' < $(TOPDIR)/target/squashfs-lzma/Makefile > $(IB_BUILD_DIR)/include/squashfs-lzma.mk + cp ./files/README.ImageBuilder $(IB_BUILD_DIR)/ + cp ./files/Makefile.ib $(IB_BUILD_DIR)/Makefile + cp -a $(TOPDIR)/target/default/target_skeleton $(IB_BUILD_DIR)/ + for target_dir in etc jffs dev proc tmp lib usr/lib usr/sbin; do \ + mkdir -p $(IB_BUILD_DIR)/target_skeleton/$$target_dir; \ + done + cp -a ./files/sysconf $(IB_BUILD_DIR)/target_skeleton/etc/ + cp -a $(TARGET_DIR)/lib/*.so* $(IB_BUILD_DIR)/target_skeleton/lib/ + cp -a $(BUILD_DIR)/libshared/libshared.so $(IB_BUILD_DIR)/target_skeleton/usr/lib/ + cp -a $(BUILD_DIR)/libnvram/libnvram.so $(IB_BUILD_DIR)/target_skeleton/usr/lib/ + cp -a $(BUILD_DIR)/libnvram/nvram $(IB_BUILD_DIR)/target_skeleton/usr/sbin/ + cp -a $(BUILD_DIR)/linksys-wlconf/wlconf $(IB_BUILD_DIR)/target_skeleton/usr/sbin/ + -$(STRIP) $(IB_BUILD_DIR)/target_skeleton/usr/lib/* $(IB_BUILD_DIR)/target_skeleton/usr/sbin/* + ln -sf /tmp/resolv.conf $(IB_BUILD_DIR)/target_skeleton/etc/resolv.conf + ln -sf /tmp $(IB_BUILD_DIR)/target_skeleton/var + find $(IB_BUILD_DIR) -name CVS | xargs rm -rf + (cd $(BUILD_DIR); \ + tar cfj $@ $(IB_NAME); \ ) source: prepare: -compile: $(BIN_DIR)/$(PKG_NAME).tar.bz2 +compile: $(BIN_DIR)/$(SDK_NAME).tar.bz2 $(BIN_DIR)/$(IB_NAME).tar.bz2 install: clean: - rm -rf $(PKG_BUILD_DIR) + rm -rf $(SDK_BUILD_DIR) $(BIN_DIR)/$(SDK_NAME).tar.bz2 $(BIN_DIR)/$(IB_NAME).tar.bz2 diff --git a/package/sdk/files/Makefile.ib b/package/sdk/files/Makefile.ib new file mode 100644 index 000000000..9fbfeee51 --- /dev/null +++ b/package/sdk/files/Makefile.ib @@ -0,0 +1,61 @@ +# OpenWrt SDK Makefile +TOPDIR:=${shell pwd} +BIN_DIR:=$(TOPDIR)/bin +BUILD_DIR:=$(TOPDIR)/build +TARGET_PATH := $(TOPDIR)/utils +MKFS_JFFS2:=$(TOPDIR)/utils/mkfs.jffs2 +IMAGE:=$(BUILD_DIR)/root_fs +TARGET_DIR:=$(TOPDIR)/root +SED:=PATH="$(TARGET_PATH)" sed -i -e +PACKAGE_DIR=$(TOPDIR)/packages +IPKG:=IPKG_INSTROOT=$(TARGET_DIR) IPKG_CONF_DIR=$(BUILD_DIR)/etc $(TARGET_DIR)/bin/ipkg -force-defaults -force-depends + +all: build + +include ./include/jffs2.mk +include ./include/squashfs-lzma.mk + +IMAGE_TARGETS := $(JFFS2_TARGETS) $(SQUASHFS_TARGETS) +TARGET_FS:=squashfs jffs2 + +define IMAGE_template +$(BIN_DIR)/openwrt-wrt54g-$(1).bin: $(BIN_DIR)/openwrt-generic-$(patsubst jffs2,jffs2-4MB,$(1)).trx + PATH=$(TARGET_PATH) addpattern -2 -i $$< -o $$@ -g + $(SED) "1s,^W54S,W54G," $$@ + +$(BIN_DIR)/openwrt-wrt54gs-$(1).bin: $(BIN_DIR)/openwrt-generic-$(patsubst jffs2,jffs2-8MB,$(1)).trx + PATH=$(TARGET_PATH) addpattern -2 -i $$< -o $$@ -g + +IMAGE_TARGETS += $(BIN_DIR)/openwrt-wrt54g-$(1).bin +IMAGE_TARGETS += $(BIN_DIR)/openwrt-wrt54gs-$(1).bin + + +$(BIN_DIR)/openwrt-motorola-$(1).bin: $(BIN_DIR)/openwrt-generic-$(patsubst jffs2,jffs2-8MB,$(1)).trx + PATH=$(TARGET_PATH) motorola-bin $$< $$@ + +IMAGE_TARGETS += $(BIN_DIR)/openwrt-motorola-$(1).bin +endef + +$(foreach fs,$(TARGET_FS),$(eval $(call IMAGE_template,$(fs)))) + +$(IMAGE_TARGETS): $(TARGET_DIR) $(BIN_DIR) packages_install + +$(BIN_DIR): + mkdir -p $@ + +$(TARGET_DIR): + mkdir -p $@ + cp -a $(TOPDIR)/target_skeleton/* $(TARGET_DIR)/ + +$(BUILD_DIR)/etc/ipkg.conf: + mkdir -p $(BUILD_DIR)/etc + echo -e 'dest root /\noption offline_root $(TARGET_DIR)' > $@ + +packages_install: $(TARGET_DIR) $(BUILD_DIR)/etc/ipkg.conf + for package in $(PACKAGE_DIR)/*.ipk; do \ + $(IPKG) install $$package; \ + done + +build: clean $(IMAGE_TARGETS) +clean: + rm -rf $(TARGET_DIR) $(BIN_DIR) $(IMAGE)-* $(BUILD_DIR)/etc diff --git a/package/sdk/files/README.ImageBuilder b/package/sdk/files/README.ImageBuilder new file mode 100644 index 000000000..7bf89392a --- /dev/null +++ b/package/sdk/files/README.ImageBuilder @@ -0,0 +1,8 @@ +This is the OpenWrt Image Builder. You can use it to make customized +OpenWrt Images without having to compile anything. + +Just put all the extra packages you need in packages/ and make changes +to target_skeleton if you like. + +After that run 'make' and it will build the OpenWrt images in the bin/ +directory. diff --git a/package/sdk/files/sysconf b/package/sdk/files/sysconf new file mode 100644 index 000000000..326a5823d --- /dev/null +++ b/package/sdk/files/sysconf @@ -0,0 +1,4 @@ +BR2_SYSCONF_TELNET_FAILSAFE_ONLY=y +BR2_SYSCONF_FAILSAFE_IP="192.168.1.1" +BR2_SYSCONF_FAILSAFE_NETMASK="255.255.255.0" +BR2_SYSCONF_FAILSAFE_MAC="00:00:BA:DC:0D:ED" |