source: branches/8.09/package/base-files/Makefile @ 17119

Last change on this file since 17119 was 17119, checked in by jow, 7 years ago

[8.09] base-files: merge r17118, bump patchlevel

  • Property svn:copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.0 KB
Line 
1#
2# Copyright (C) 2007-2009 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7# $Id$
8
9include $(TOPDIR)/rules.mk
10include $(INCLUDE_DIR)/kernel.mk
11
12PKG_NAME:=base-files
13PKG_RELEASE:=14.4
14
15PKG_FILE_DEPEND:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
16
17include $(INCLUDE_DIR)/package.mk
18
19ifneq ($(DUMP),1)
20  TARGET:=-$(BOARD)
21  ifneq ($(wildcard $(PLATFORM_DIR)/base-files-$(PROFILE) $(PLATFORM_SUBDIR)/base-files-$(PROFILE)),)
22    TARGET:=$(TARGET)-$(PROFILE)
23  endif
24  LIBGCC_VERSION:=$(GCC_VERSION)
25  ifeq ($(ARCH),x86_64)
26    LIB_SUFFIX:=64
27  endif
28else
29  UCLIBC_VERSION:=<UCLIBC_VERSION>
30  LIBGCC_VERSION:=<LIBGCC_VERSION>
31endif
32
33CONFIG_PACKAGE_base-files$(TARGET):=$(CONFIG_PACKAGE_base-files)
34
35define Package/base-files$(TARGET)
36  SECTION:=base
37  CATEGORY:=Base system
38  TITLE:=Base filesystem for OpenWrt
39  URL:=http://openwrt.org/
40  VERSION:=$(PKG_RELEASE)-$(REVISION)
41  $(call Config,network.lan.proto,string,static,LAN Protocol)
42  $(call Config,network.lan.ipaddr,ip,192.168.1.1,LAN IP Address)
43  $(call Config,network.lan.netmask,netmask,255.255.255.0,LAN Network Mask)
44  $(call Config,network.lan.gateway,ip,,LAN Gateway)
45  $(call Config,network.lan.dns,ip,,LAN DNS server)
46endef
47
48define Package/base-files$(TARGET)/conffiles
49/etc/banner
50/etc/hosts
51/etc/inittab
52/etc/group
53/etc/passwd
54/etc/profile
55/etc/shells
56/etc/sysctl.conf
57$(call $(TARGET)/conffiles)
58endef
59
60define Package/base-files$(TARGET)/description
61 This package contains a base filesystem and system scripts for OpenWrt.
62endef
63
64define Package/gcc/Default
65  SECTION:=libs
66  CATEGORY:=Base system
67  DEPENDS:=@!NATIVE_TOOLCHAIN
68  URL:=http://gcc.gnu.org/
69  VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
70endef
71
72define Package/libgcc
73$(call Package/gcc/Default)
74  TITLE:=GCC support library
75  DEPENDS:=@!TARGET_avr32 @!NATIVE_TOOLCHAIN
76endef
77
78define Package/libssp
79$(call Package/gcc/Default)
80  DEPENDS:=@SSP_SUPPORT
81  TITLE:=GCC support library
82endef
83
84define Package/libstdcpp
85$(call Package/gcc/Default)
86  NAME:=libstdc++
87  TITLE:=GNU Standard C++ Library v3
88  DEPENDS:=@!NATIVE_TOOLCHAIN&&@INSTALL_LIBSTDCPP
89endef
90
91define Package/uclibc/Default
92  SECTION:=libs
93  CATEGORY:=Base system
94  DEPENDS:=@!NATIVE_TOOLCHAIN
95  URL:=http://uclibc.org/
96  VERSION:=$(UCLIBC_VERSION)$(UCLIBC_PATCHVER)-$(PKG_RELEASE)
97endef
98
99define Package/libpthread
100$(call Package/uclibc/Default)
101  TITLE:=POSIX thread library
102endef
103
104define Package/uclibc
105$(call Package/uclibc/Default)
106  TITLE:=C library embedded systems
107endef
108
109define Package/ldd
110$(call Package/uclibc/Default)
111  TITLE:=LDD trace utility
112endef
113
114define Package/ldconfig
115$(call Package/uclibc/Default)
116  TITLE:=Shared library path configuration
117endef
118
119define Build/Prepare
120        mkdir -p $(PKG_BUILD_DIR)
121endef
122
123define Build/Compile/Default
124endef
125
126define Build/Compile
127        $(call Build/Compile/Default)
128endef
129
130define Package/base-files$(TARGET)/install
131        $(CP) ./files/* $(1)/
132        if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \
133                $(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \
134        fi
135        if [ -d $(PLATFORM_DIR)/base-files/. ]; then \
136                $(CP) $(PLATFORM_DIR)/base-files/* $(1)/; \
137        fi
138        if [ -d $(PLATFORM_DIR)/base-files-$(PROFILE)/. ]; then \
139                $(CP) $(PLATFORM_DIR)/base-files-$(PROFILE)/* $(1)/; \
140        fi
141        $(if $(filter-out $(PLATFORM_DIR),$(PLATFORM_SUBDIR)), \
142                if [ -d $(PLATFORM_SUBDIR)/base-files/. ]; then \
143                        $(CP) $(PLATFORM_SUBDIR)/base-files/* $(1)/; \
144                fi; \
145                if [ -d $(PLATFORM_SUBDIR)/base-files-$(PROFILE)/. ]; then \
146                        $(CP) $(PLATFORM_SUBDIR)/base-files-$(PROFILE)/* $(1)/; \
147                fi \
148        )
149# Form valid /etc/shadow entries, by copying the user:pw pairs
150# from /etc/passwd, and adding on pw change data
151        $(if $(CONFIG_BUSYBOX_CONFIG_FEATURE_SHADOWPASSWDS), \
152                cut -d ':' -f 1-2 $(1)/etc/passwd > $(1)/etc/shadow; \
153                $(SED) 's/$$$$/:13848:0:99999:7:::/' $(1)/etc/shadow \
154        )
155        $(SED) 's,$$$$R,$(REVISION),g' $(1)/etc/banner
156        mkdir -p $(1)/dev
157        mkdir -p $(1)/etc/crontabs
158        mkdir -p $(1)/jffs
159        mkdir -p $(1)/lib/firmware
160        mkdir -p $(1)/mnt
161        mkdir -p $(1)/proc
162        mkdir -p $(1)/tmp
163        mkdir -p $(1)/usr/lib
164        mkdir -p $(1)/usr/bin
165        mkdir -p $(1)/sys
166        mkdir -p $(1)/www
167        mkdir -p $(1)/root
168        ln -sf /proc/mounts $(1)/etc/mtab
169        rm -f $(1)/var
170        ln -sf /tmp $(1)/var
171        mkdir -p $(1)/etc
172        ln -sf /tmp/resolv.conf /tmp/fstab /tmp/TZ $(1)/etc/
173        $(call Package/base-files/install-target,$(1))
174        for conffile in $(1)/etc/config/*; do \
175                if [ -f "$$$$conffile" ]; then \
176                        grep "$$$$conffile" $(1)/CONTROL/conffiles || \
177                                echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \
178                fi \
179        done
180endef
181
182define Package/libgcc/install
183        $(INSTALL_DIR) $(1)/lib
184        $(CP) $(TOOLCHAIN_DIR)/lib$(LIB_SUFFIX)/libgcc_s.so.* $(1)/lib/
185endef
186
187ifeq ($(word 1,$(subst ., ,$(LIBGCC_VERSION))),4)
188  define Package/libssp/install
189        $(INSTALL_DIR) $(1)/lib
190        $(CP) $(TOOLCHAIN_DIR)/lib$(LIB_SUFFIX)/libssp.so.* $(1)/lib/
191  endef
192endif
193
194define Package/libstdcpp/install
195        $(INSTALL_DIR) $(1)/lib
196        $(CP) $(TOOLCHAIN_DIR)/lib$(LIB_SUFFIX)/libstdc++.so.* $(1)/lib/
197endef
198
199define Package/libpthread/install
200        $(INSTALL_DIR) $(1)/lib
201        $(CP) $(TOOLCHAIN_DIR)/lib/libpthread.so.* $(1)/lib/
202        $(CP) $(TOOLCHAIN_DIR)/lib/libpthread-$(UCLIBC_VERSION).so $(1)/lib/
203endef
204
205define Package/uclibc/install
206        $(INSTALL_DIR) $(1)/lib
207        for file in ld$(LIB_SUFFIX)-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil; do \
208                $(CP) $(TOOLCHAIN_DIR)/lib/$$$$file.so.* $(1)/lib/; \
209                $(CP) $(TOOLCHAIN_DIR)/lib/$$$$file-$(UCLIBC_VERSION).so $(1)/lib/; \
210        done
211endef
212
213define Package/ldd/install
214        $(INSTALL_DIR) $(1)/bin/
215        $(CP) $(TOOLCHAIN_DIR)/target-utils/ldd $(1)/bin/
216endef
217
218define Package/ldconfig/install
219        $(INSTALL_DIR) $(1)/bin/
220        $(CP) $(TOOLCHAIN_DIR)/target-utils/ldconfig $(1)/bin/
221endef
222
223ifneq ($(DUMP),1)
224  -include $(PLATFORM_DIR)/base-files.mk
225endif
226
227$(eval $(call BuildPackage,base-files$(TARGET)))
228$(eval $(call BuildPackage,libgcc))
229$(eval $(call BuildPackage,libssp))
230$(eval $(call BuildPackage,libstdcpp))
231$(eval $(call BuildPackage,libpthread))
232$(eval $(call BuildPackage,uclibc))
233$(eval $(call BuildPackage,ldd))
234$(eval $(call BuildPackage,ldconfig))
Note: See TracBrowser for help on using the repository browser.