2007-09-29 14:27:54 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2007 OpenWrt.org
|
2006-06-27 00:35:46 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-07-17 22:52:59 +00:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
2006-06-21 02:32:39 +00:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
2006-05-31 13:27:11 +00:00
|
|
|
|
2005-07-17 22:52:59 +00:00
|
|
|
PKG_NAME:=base-files
|
2007-09-22 13:47:20 +00:00
|
|
|
PKG_RELEASE:=12
|
2006-09-24 20:49:31 +00:00
|
|
|
|
2007-04-26 18:04:16 +00:00
|
|
|
PKG_FILE_DEPEND:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
2005-07-17 22:52:59 +00:00
|
|
|
|
2006-06-21 02:32:39 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2005-07-24 19:58:14 +00:00
|
|
|
|
2006-05-31 14:32:17 +00:00
|
|
|
ifneq ($(DUMP),1)
|
2007-12-13 06:25:54 +00:00
|
|
|
TARGET:=-$(BOARD)
|
2007-08-07 00:04:25 +00:00
|
|
|
LIBGCC_VERSION:=$(GCC_VERSION)
|
2006-06-23 00:49:42 +00:00
|
|
|
else
|
2006-09-24 20:49:31 +00:00
|
|
|
UCLIBC_VERSION:=<UCLIBC_VERSION>
|
|
|
|
LIBGCC_VERSION:=<LIBGCC_VERSION>
|
2006-05-31 14:32:17 +00:00
|
|
|
endif
|
|
|
|
|
2006-06-02 16:03:03 +00:00
|
|
|
CONFIG_PACKAGE_base-files$(TARGET):=$(CONFIG_PACKAGE_base-files)
|
2006-05-31 06:49:51 +00:00
|
|
|
|
2006-05-31 12:33:06 +00:00
|
|
|
define Package/base-files$(TARGET)
|
2006-07-02 13:36:54 +00:00
|
|
|
SECTION:=base
|
|
|
|
CATEGORY:=Base system
|
2006-09-24 20:49:31 +00:00
|
|
|
TITLE:=Base filesystem for OpenWrt
|
|
|
|
URL:=http://openwrt.org/
|
2007-12-13 06:25:54 +00:00
|
|
|
VERSION:=$(PKG_RELEASE)-$(REVISION)
|
2007-03-02 01:23:36 +00:00
|
|
|
$(call Config,network.lan.proto,string,static,LAN Protocol)
|
|
|
|
$(call Config,network.lan.ipaddr,ip,192.168.1.1,LAN IP Address)
|
2007-03-17 03:15:41 +00:00
|
|
|
$(call Config,network.lan.netmask,netmask,255.255.255.0,LAN Network Mask)
|
2007-03-02 01:23:36 +00:00
|
|
|
$(call Config,network.lan.gateway,ip,,LAN Gateway)
|
|
|
|
$(call Config,network.lan.dns,ip,,LAN DNS server)
|
2006-05-30 20:22:58 +00:00
|
|
|
endef
|
|
|
|
|
2006-06-18 13:38:23 +00:00
|
|
|
define Package/base-files$(TARGET)/conffiles
|
|
|
|
/etc/banner
|
|
|
|
/etc/hosts
|
|
|
|
/etc/inittab
|
|
|
|
/etc/group
|
|
|
|
/etc/passwd
|
|
|
|
/etc/profile
|
|
|
|
/etc/shells
|
|
|
|
/etc/ipkg.conf
|
|
|
|
/etc/sysctl.conf
|
|
|
|
$(call $(TARGET)/conffiles)
|
|
|
|
endef
|
|
|
|
|
2007-09-07 08:34:51 +00:00
|
|
|
define Package/base-files$(TARGET)/description
|
|
|
|
This package contains a base filesystem and system scripts for OpenWrt.
|
|
|
|
endef
|
|
|
|
|
2007-04-03 22:50:27 +00:00
|
|
|
define Package/gcc/Default
|
2006-07-02 13:36:54 +00:00
|
|
|
SECTION:=libs
|
2006-09-24 20:49:31 +00:00
|
|
|
CATEGORY:=Base system
|
2006-08-10 19:25:26 +00:00
|
|
|
DEPENDS:=@!NATIVE_TOOLCHAIN
|
2006-09-24 20:49:31 +00:00
|
|
|
URL:=http://gcc.gnu.org/
|
2006-07-02 13:36:54 +00:00
|
|
|
VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
|
2006-05-30 20:22:58 +00:00
|
|
|
endef
|
|
|
|
|
2007-04-03 22:50:27 +00:00
|
|
|
define Package/libgcc
|
2007-09-07 08:34:51 +00:00
|
|
|
$(call Package/gcc/Default)
|
2007-04-03 22:50:27 +00:00
|
|
|
TITLE:=GCC support library
|
2007-09-08 19:55:42 +00:00
|
|
|
DEPENDS:=@!TARGET_avr32 @!NATIVE_TOOLCHAIN
|
2007-04-03 22:50:27 +00:00
|
|
|
endef
|
|
|
|
|
2007-03-16 20:37:04 +00:00
|
|
|
define Package/libssp
|
2007-09-07 08:34:51 +00:00
|
|
|
$(call Package/gcc/Default)
|
2007-03-16 20:37:04 +00:00
|
|
|
TITLE:=GCC support library
|
|
|
|
endef
|
|
|
|
|
2007-06-12 11:06:39 +00:00
|
|
|
define Package/libstdcpp
|
2007-09-07 08:34:51 +00:00
|
|
|
$(call Package/gcc/Default)
|
2007-06-12 11:06:39 +00:00
|
|
|
NAME:=libstdc++
|
|
|
|
TITLE:=GNU Standard C++ Library v3
|
|
|
|
DEPENDS:=@!NATIVE_TOOLCHAIN&&@INSTALL_LIBSTDCPP
|
|
|
|
endef
|
|
|
|
|
2007-04-03 22:50:27 +00:00
|
|
|
define Package/uclibc/Default
|
2006-09-24 20:49:31 +00:00
|
|
|
SECTION:=libs
|
2007-04-03 22:50:27 +00:00
|
|
|
CATEGORY:=Base system
|
2006-08-10 19:25:26 +00:00
|
|
|
DEPENDS:=@!NATIVE_TOOLCHAIN
|
2006-09-24 20:49:31 +00:00
|
|
|
URL:=http://uclibc.org/
|
2007-08-07 00:04:25 +00:00
|
|
|
VERSION:=$(UCLIBC_VERSION)$(UCLIBC_PATCHVER)-$(PKG_RELEASE)
|
2006-07-02 13:36:54 +00:00
|
|
|
endef
|
|
|
|
|
2007-04-03 22:50:27 +00:00
|
|
|
define Package/libpthread
|
2007-09-07 08:34:51 +00:00
|
|
|
$(call Package/uclibc/Default)
|
2007-04-03 22:50:27 +00:00
|
|
|
TITLE:=POSIX thread library
|
|
|
|
endef
|
|
|
|
|
2006-05-30 20:22:58 +00:00
|
|
|
define Package/uclibc
|
2007-09-07 08:34:51 +00:00
|
|
|
$(call Package/uclibc/Default)
|
2006-09-24 20:49:31 +00:00
|
|
|
TITLE:=C library embedded systems
|
2007-04-03 22:50:27 +00:00
|
|
|
endef
|
|
|
|
|
2007-09-16 10:21:53 +00:00
|
|
|
define Package/ldd
|
|
|
|
$(call Package/uclibc/Default)
|
|
|
|
TITLE:=LDD trace utility
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/ldconfig
|
|
|
|
$(call Package/uclibc/Default)
|
|
|
|
TITLE:=Shared library path configuration
|
|
|
|
endef
|
|
|
|
|
2006-05-30 20:22:58 +00:00
|
|
|
define Build/Prepare
|
|
|
|
mkdir -p $(PKG_BUILD_DIR)
|
|
|
|
endef
|
|
|
|
|
2006-11-22 23:27:29 +00:00
|
|
|
define Build/Compile/Default
|
2006-05-31 12:33:06 +00:00
|
|
|
endef
|
|
|
|
|
2006-05-30 20:22:58 +00:00
|
|
|
define Build/Compile
|
2006-11-22 23:27:29 +00:00
|
|
|
$(call Build/Compile/Default)
|
2006-05-30 20:22:58 +00:00
|
|
|
endef
|
|
|
|
|
2006-05-31 12:33:06 +00:00
|
|
|
define Package/base-files$(TARGET)/install
|
2006-11-22 23:30:57 +00:00
|
|
|
$(CP) ./files/* $(1)/
|
2007-04-24 12:05:52 +00:00
|
|
|
if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \
|
|
|
|
$(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \
|
|
|
|
fi
|
2007-09-29 14:27:54 +00:00
|
|
|
if [ -d $(PLATFORM_DIR)/base-files/. ]; then \
|
|
|
|
$(CP) $(PLATFORM_DIR)/base-files/* $(1)/; \
|
2007-03-02 18:17:40 +00:00
|
|
|
fi
|
2007-09-08 19:55:42 +00:00
|
|
|
$(if $(filter-out $(PLATFORM_DIR),$(PLATFORM_SUBDIR)), \
|
2007-09-29 14:27:54 +00:00
|
|
|
if [ -d $(PLATFORM_SUBDIR)/base-files/. ]; then \
|
|
|
|
$(CP) $(PLATFORM_SUBDIR)/base-files/* $(1)/; \
|
2007-09-08 19:55:42 +00:00
|
|
|
fi \
|
|
|
|
)
|
2007-12-14 20:07:32 +00:00
|
|
|
$(SED) 's,$$$$R,$(REVISION),g' $(1)/etc/banner
|
2007-09-30 21:29:55 +00:00
|
|
|
$(SED) 's,$$$$S,$(BOARD),g' -e 's,$$$$A,$(ARCH),g' $(1)/etc/ipkg.conf
|
2006-05-30 20:22:58 +00:00
|
|
|
mkdir -p $(1)/dev
|
|
|
|
mkdir -p $(1)/etc/crontabs
|
|
|
|
mkdir -p $(1)/jffs
|
2007-04-22 15:00:19 +00:00
|
|
|
mkdir -p $(1)/lib/firmware
|
2006-05-30 20:22:58 +00:00
|
|
|
mkdir -p $(1)/mnt
|
|
|
|
mkdir -p $(1)/proc
|
|
|
|
mkdir -p $(1)/tmp
|
|
|
|
mkdir -p $(1)/usr/lib
|
|
|
|
mkdir -p $(1)/usr/bin
|
|
|
|
mkdir -p $(1)/sys
|
|
|
|
mkdir -p $(1)/www
|
2007-09-19 19:58:07 +00:00
|
|
|
mkdir -p $(1)/root
|
2006-05-30 20:22:58 +00:00
|
|
|
ln -sf /proc/mounts $(1)/etc/mtab
|
|
|
|
rm -f $(1)/var
|
|
|
|
ln -sf /tmp $(1)/var
|
|
|
|
mkdir -p $(1)/etc
|
2007-01-08 21:33:53 +00:00
|
|
|
ln -sf /tmp/resolv.conf $(1)/etc/resolv.conf
|
2006-11-22 23:27:29 +00:00
|
|
|
$(call Package/base-files/install-target,$(1))
|
|
|
|
for conffile in $(1)/etc/config/*; do \
|
|
|
|
if [ -f "$$$$conffile" ]; then \
|
|
|
|
grep "$$$$conffile" $(1)/CONTROL/conffiles || \
|
|
|
|
echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \
|
|
|
|
fi \
|
|
|
|
done
|
2006-05-30 20:22:58 +00:00
|
|
|
endef
|
|
|
|
|
2006-07-02 13:36:54 +00:00
|
|
|
define Package/libgcc/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/lib
|
2007-08-07 00:04:25 +00:00
|
|
|
$(CP) $(TOOLCHAIN_DIR)/lib/libgcc_s.so.* $(1)/lib/
|
2006-07-02 13:36:54 +00:00
|
|
|
endef
|
|
|
|
|
2007-03-16 20:37:04 +00:00
|
|
|
ifeq ($(word 1,$(subst ., ,$(LIBGCC_VERSION))),4)
|
|
|
|
define Package/libssp/install
|
|
|
|
$(INSTALL_DIR) $(1)/lib
|
2007-08-07 00:04:25 +00:00
|
|
|
$(CP) $(TOOLCHAIN_DIR)/lib/libssp.so.* $(1)/lib/
|
2007-03-16 20:37:04 +00:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2007-06-12 11:06:39 +00:00
|
|
|
define Package/libstdcpp/install
|
|
|
|
$(INSTALL_DIR) $(1)/lib
|
2007-08-07 00:04:25 +00:00
|
|
|
$(CP) $(TOOLCHAIN_DIR)/lib/libstdc++.so.* $(1)/lib/
|
2007-06-12 11:06:39 +00:00
|
|
|
endef
|
|
|
|
|
2006-07-02 13:36:54 +00:00
|
|
|
define Package/libpthread/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/lib
|
2007-08-07 00:04:25 +00:00
|
|
|
$(CP) $(TOOLCHAIN_DIR)/lib/libpthread.so.* $(1)/lib/
|
|
|
|
$(CP) $(TOOLCHAIN_DIR)/lib/libpthread-$(UCLIBC_VERSION).so $(1)/lib/
|
2006-07-02 13:36:54 +00:00
|
|
|
endef
|
|
|
|
|
2006-05-30 20:22:58 +00:00
|
|
|
define Package/uclibc/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $(1)/lib
|
2005-11-02 02:48:48 +00:00
|
|
|
for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil; do \
|
2007-08-07 00:04:25 +00:00
|
|
|
$(CP) $(TOOLCHAIN_DIR)/lib/$$$$file.so.* $(1)/lib/; \
|
|
|
|
$(CP) $(TOOLCHAIN_DIR)/lib/$$$$file-$(UCLIBC_VERSION).so $(1)/lib/; \
|
2005-07-17 22:52:59 +00:00
|
|
|
done
|
2006-05-30 20:22:58 +00:00
|
|
|
endef
|
2005-07-17 22:52:59 +00:00
|
|
|
|
2007-04-03 22:50:27 +00:00
|
|
|
define Package/ldd/install
|
|
|
|
$(INSTALL_DIR) $(1)/bin/
|
2007-09-16 10:21:53 +00:00
|
|
|
$(CP) $(TOOLCHAIN_DIR)/target-utils/ldd $(1)/bin/
|
2007-04-03 22:50:27 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/ldconfig/install
|
|
|
|
$(INSTALL_DIR) $(1)/bin/
|
2007-09-16 10:21:53 +00:00
|
|
|
$(CP) $(TOOLCHAIN_DIR)/target-utils/ldconfig $(1)/bin/
|
2007-04-03 22:50:27 +00:00
|
|
|
endef
|
|
|
|
|
2006-11-22 23:27:29 +00:00
|
|
|
ifneq ($(DUMP),1)
|
|
|
|
-include $(PLATFORM_DIR)/base-files.mk
|
|
|
|
endif
|
|
|
|
|
2006-05-31 12:33:06 +00:00
|
|
|
$(eval $(call BuildPackage,base-files$(TARGET)))
|
2006-05-30 20:22:58 +00:00
|
|
|
$(eval $(call BuildPackage,libgcc))
|
2007-03-16 20:37:04 +00:00
|
|
|
$(eval $(call BuildPackage,libssp))
|
2007-06-12 11:06:39 +00:00
|
|
|
$(eval $(call BuildPackage,libstdcpp))
|
2006-07-02 13:36:54 +00:00
|
|
|
$(eval $(call BuildPackage,libpthread))
|
2006-05-30 20:22:58 +00:00
|
|
|
$(eval $(call BuildPackage,uclibc))
|
2007-09-16 10:21:53 +00:00
|
|
|
$(eval $(call BuildPackage,ldd))
|
|
|
|
$(eval $(call BuildPackage,ldconfig))
|