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