2006-06-27 03:35:46 +03:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# 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
|
2006-05-31 15:33:06 +03:00
|
|
|
PKG_RELEASE:=8
|
2006-09-24 23:49:31 +03:00
|
|
|
|
|
|
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
2007-01-12 13:09:05 +02:00
|
|
|
PKG_FILE_DEPEND:=$(PLATFORM_DIR)
|
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)
|
|
|
|
UCLIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version 2>/dev/null}
|
|
|
|
LIBGCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version 2>/dev/null}
|
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
|
|
|
|
DESCRIPTION:=\
|
|
|
|
This package contains a base filesystem and system scripts 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)
|
|
|
|
$(call Config,network.lan.netmask,netmask,255.255.0.0,LAN Network Mask)
|
|
|
|
$(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
|
|
|
|
|
2006-05-30 23:22:58 +03:00
|
|
|
define Package/libgcc
|
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-07-02 16:36:54 +03:00
|
|
|
TITLE:=GCC support library
|
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-03-16 22:37:04 +02:00
|
|
|
define Package/libssp
|
|
|
|
SECTION:=libs
|
|
|
|
CATEGORY:=Base system
|
|
|
|
DEPENDS:=@!NATIVE_TOOLCHAIN
|
|
|
|
DEFAULT:=m
|
|
|
|
TITLE:=GCC support library
|
|
|
|
URL:=http://gcc.gnu.org/
|
|
|
|
VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
|
|
|
|
endef
|
|
|
|
|
2006-07-02 16:36:54 +03:00
|
|
|
define Package/libpthread
|
2006-09-24 23:49:31 +03:00
|
|
|
SECTION:=libs
|
|
|
|
CATEGORY:=Libraries
|
2006-08-10 22:25:26 +03:00
|
|
|
DEPENDS:=@!NATIVE_TOOLCHAIN
|
2006-07-02 16:36:54 +03:00
|
|
|
TITLE:=POSIX thread library
|
2006-09-24 23:49:31 +03:00
|
|
|
URL:=http://uclibc.org/
|
|
|
|
VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
|
2006-07-02 16:36:54 +03:00
|
|
|
endef
|
|
|
|
|
2006-05-30 23:22:58 +03:00
|
|
|
define Package/uclibc
|
2006-09-24 23:49:31 +03:00
|
|
|
SECTION:=libs
|
|
|
|
CATEGORY:=Base system
|
2006-08-10 22:25:26 +03:00
|
|
|
DEPENDS:=@!NATIVE_TOOLCHAIN
|
2006-09-24 23:49:31 +03:00
|
|
|
TITLE:=C library embedded systems
|
|
|
|
URL:=http://uclibc.org/
|
|
|
|
VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
|
2006-05-30 23:22:58 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
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-03-02 20:17:40 +02:00
|
|
|
if [ -d $(PLATFORM_DIR)/base-files/default/. ]; then \
|
|
|
|
$(CP) $(PLATFORM_DIR)/base-files/default/* $(1)/; \
|
|
|
|
fi
|
|
|
|
if [ "$(PROFILE)" != "Default" ]; then \
|
|
|
|
if [ -d $(PLATFORM_DIR)/base-files/profile-$(PROFILE)/. ]; then \
|
|
|
|
$(CP) $(PLATFORM_DIR)/base-files/profile-$(PROFILE)/* $(1)/; \
|
|
|
|
fi; \
|
2006-05-31 15:33:06 +03:00
|
|
|
fi
|
2006-05-31 09:49:51 +03:00
|
|
|
$(SED) 's,$$$$R,r$(REV),g' $(1)/etc/banner
|
|
|
|
$(SED) 's,$$$$S,$(BOARD)-$(KERNEL),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
|
|
|
|
mkdir -p $(1)/lib
|
|
|
|
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
|
|
|
|
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
|
2006-07-02 16:36:54 +03:00
|
|
|
$(CP) $(STAGING_DIR)/lib/libgcc_s.so.* $(1)/lib/
|
|
|
|
endef
|
|
|
|
|
2007-03-16 22:37:04 +02:00
|
|
|
ifeq ($(word 1,$(subst ., ,$(LIBGCC_VERSION))),4)
|
|
|
|
define Package/libssp/install
|
|
|
|
$(INSTALL_DIR) $(1)/lib
|
|
|
|
$(CP) $(STAGING_DIR)/lib/libssp.so.* $(1)/lib/
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2006-07-02 16:36:54 +03:00
|
|
|
define Package/libpthread/install
|
2006-11-23 02:29:07 +02:00
|
|
|
$(INSTALL_DIR) $(1)/lib
|
2006-07-02 16:36:54 +03:00
|
|
|
$(CP) $(STAGING_DIR)/lib/libpthread.so.* $(1)/lib/
|
|
|
|
$(CP) $(STAGING_DIR)/lib/libpthread-$(UCLIBC_VERSION).so $(1)/lib/
|
|
|
|
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 \
|
2006-05-31 09:49:51 +03:00
|
|
|
$(CP) $(STAGING_DIR)/lib/$$$$file.so.* $(1)/lib/; \
|
|
|
|
$(CP) $(STAGING_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
|
|
|
|
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))
|
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-03-02 03:23:36 +02:00
|
|
|
|