]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - lfs/initramfs
Wrote nice initscripts for the installer.
[people/ms/ipfire-3.x.git] / lfs / initramfs
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 PKG_NAME = initramfs
28 VER = LFS
29
30 THISAPP = $(PKG_NAME)-$(VER)
31
32 TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
33
34 ###############################################################################
35 # Top-level Rules
36 ###############################################################################
37
38 install : $(TARGET)
39
40 download :
41
42 ###############################################################################
43 # Installation Details
44 ###############################################################################
45
46 $(TARGET) :
47 @$(PREBUILD)
48 -mkdir -p $(INSTALLER_DIR)/{usr,bin,sbin,lib,dev,etc,mnt,root,cdrom,dev,harddisk,proc,tmp,sys,var/run}
49 -mkdir -p $(INSTALLER_DIR)/usr/{bin,sbin,lib,share/locale,share/terminfo/l,share/udhcpc}
50
51 ### glibc
52 #
53 install -c -D /lib/libc-2.7.so $(INSTALLER_DIR)/lib/libc-2.7.so
54 ln -svf libc-2.7.so $(INSTALLER_DIR)/lib/libc.so.6
55 install -c -D /lib/libdl-2.7.so $(INSTALLER_DIR)/lib/libdl-2.7.so
56 ln -svf libdl-2.7.so $(INSTALLER_DIR)/lib/libdl.so.2
57 install -c -D /lib/libnss_files-2.7.so $(INSTALLER_DIR)/lib/libnss_files-2.7.so
58 ln -svf libnss_files-2.7.so $(INSTALLER_DIR)/lib/libnss_files.so.2
59 install -c -D /lib/libcrypt-2.7.so $(INSTALLER_DIR)/lib/libcrypt-2.7.so
60 ln -svf libcrypt-2.7.so $(INSTALLER_DIR)/lib/libcrypt.so.1
61 install -c -D /lib/libm-2.7.so $(INSTALLER_DIR)/lib/libm-2.7.so
62 ln -svf libm-2.7.so $(INSTALLER_DIR)/lib/libm.so.6
63 install -c -D /lib/ld-2.7.so $(INSTALLER_DIR)/lib/ld-2.7.so
64 ln -svf ld-2.7.so $(INSTALLER_DIR)/$(LINKER)
65
66 ### udev
67 #
68 install -D /sbin/udevd $(INSTALLER_DIR)/sbin
69 install -D /sbin/udevsettle $(INSTALLER_DIR)/sbin
70 install -D /sbin/udevtrigger $(INSTALLER_DIR)/sbin
71 -cp -avf /lib/udev $(INSTALLER_DIR)/lib/
72 cp -avf /etc/udev $(INSTALLER_DIR)/etc/
73
74 ### ncurses
75 #
76 install -c -D /lib/libncursesw.so.5.6 $(INSTALLER_DIR)/lib/libncursesw.so.5.6
77 ln -svf libncursesw.so.5.6 $(INSTALLER_DIR)/lib/libncursesw.so
78
79 ### e2fsprogs
80 #
81 install -c -D /sbin/mke2fs $(INSTALLER_DIR)/sbin/mke2fs
82 install -c -D /lib/libext2fs.so.2.4 $(INSTALLER_DIR)/lib/libext2fs.so.2.4
83 ln -svf libext2fs.so.2.4 $(INSTALLER_DIR)/lib/libext2fs.so.2
84 install -c -D /lib/libuuid.so.1.2 $(INSTALLER_DIR)/lib/libuuid.so.1.2
85 ln -svf libuuid.so.1.2 $(INSTALLER_DIR)/lib/libuuid.so.1
86 install -c -D /lib/libcom_err.so.2.1 $(INSTALLER_DIR)/lib/libcom_err.so.2.1
87 ln -svf libcom_err.so.2.1 $(INSTALLER_DIR)/lib/libcom_err.so.2
88 install -c -D /lib/libblkid.so.1.0 $(INSTALLER_DIR)/lib/libblkid.so.1.0
89 ln -svf libblkid.so.1.0 $(INSTALLER_DIR)/lib/libblkid.so.1
90 install -c -D /lib/libe2p.so.2.3 $(INSTALLER_DIR)/lib/libe2p.so.2.3
91 ln -svf libe2p.so.2.3 $(INSTALLER_DIR)/lib/libe2p.so.2
92
93 ### parted
94 #
95 install -c -D /usr/sbin/parted $(INSTALLER_DIR)/usr/sbin/parted
96 install -c -D /usr/lib/libparted-1.8.so.8.0.0 $(INSTALLER_DIR)/usr/lib/libparted-1.8.so.8.0.0
97 ln -svf libparted-1.8.so.8.0.0 $(INSTALLER_DIR)/usr/lib/libparted-1.8.so.8
98
99 ### kudzu
100 #
101 install -c -D /sbin/kudzu $(INSTALLER_DIR)/sbin/kudzu
102
103 ### popt
104 #
105 install -c -D /usr/lib/libpopt.so.0.0.0 $(INSTALLER_DIR)/usr/lib/libpopt.so.0.0.0
106 ln -svf libpopt.so.0.0.0 $(INSTALLER_DIR)/usr/lib/libpopt.so.0
107
108 ### libz
109 #
110 install -c -D /lib/libz.so.1.2.3 $(INSTALLER_DIR)/lib/libz.so.1.2.3
111 ln -svf libz.so.1.2.3 $(INSTALLER_DIR)/lib/libz.so.1
112
113 ### configuration
114 #
115 cp -avf $(DIR_CONF)/install/* $(INSTALLER_DIR)/etc/
116 cp -vf $(DIR_SOURCE)/initscripts/init.d/functions $(INSTALLER_DIR)/etc/functions
117 chmod -v 755 $(INSTALLER_DIR)/etc/{halt,rc}
118 ln -svf etc/rc $(INSTALLER_DIR)/init
119 cp -vf /etc/issue /etc/group $(INSTALLER_DIR)/etc/
120 cp -f /usr/share/terminfo/l/linux $(INSTALLER_DIR)/usr/share/terminfo/l
121
122 cd $(INSTALLER_DIR) && find ./bin -maxdepth 1 -type f -exec \
123 $(TOOLS_DIR)/bin/strip --strip-all '{}' ';'
124 cd $(INSTALLER_DIR) && find ./lib -maxdepth 1 -type f -exec \
125 $(TOOLS_DIR)/bin/strip --strip-all '{}' ';'
126
127 ### kernel modules
128 #
129 -mkdir -p $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/{drivers,fs}
130 cp -avf \
131 /lib/modules/$(KVER)/kernel/drivers/{ata,block,cdrom,dma,firewire,hid,ide,net,pcmcia,scsi,usb} \
132 $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/drivers
133 cp -avf \
134 /lib/modules/$(KVER)/kernel/fs/{exportfs,ext{2,3},fat,ntfs,reiser{4,fs},udf,vfat,xfs} \
135 $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/fs
136 cp -f /lib/modules/$(KVER)/modules.* $(INSTALLER_DIR)/lib/modules/$(KVER)
137
138 ### stripping
139 #
140 # We do the stripping here because we don't want to destroy our development tree by stripping all symbols
141 # Instead we strip all binaries and libraries as we create the initramfs.
142 # It's quite safe to do strip --strip-all on libraries if they will not be used for development.
143 cd $(INSTALLER_DIR) && find .{,/usr/}/bin .{,/usr/}/sbin -maxdepth 1 -type f -exec $(TOOLS_DIR)/bin/strip --strip-all '{}' ';'
144 cd $(INSTALLER_DIR) && find .{,/usr/}/lib -maxdepth 1 -type f -exec $(TOOLS_DIR)/bin/strip --strip-all '{}' ';'
145
146 ### compressing everything
147 #
148 -find $(INSTALLER_DIR) -name .svn -exec rm -rf {} \;
149 cd $(INSTALLER_DIR) && find . | cpio -o -H newc | gzip -9 > \
150 /images/initramfs-$(VERSION).img
151
152 @$(POSTBUILD)