source: trunk/initrd/initrd.rul @ 567

Last change on this file since 567 was 567, checked in by dennis, 8 years ago

Last software update changes, trunk is working again

  • Property svn:keywords set to Id
File size: 5.4 KB
Line 
1
2#   "SALI"
3#
4#   Copyright (C) 2010 SARA Computing and Networking Services
5#
6#   $Id: initrd.rul 567 2013-04-18 14:09:11Z dennis $
7#    vi: set filetype=make:
8#
9
10INITRD_BINARIES = $(shell file \
11                                                        initrd/build_dir/bin/* \
12                                                        initrd/build_dir/sbin/* \
13                                                        initrd/build_dir/usr/bin/* \
14                                                        initrd/build_dir/usr/sbin/* \
15                                                        | grep -v "text\|symbolic link" \
16                                                        | perl -pi -e 's/:.*//')
17
18## BEGIN import rule files
19#
20include $(INITRD_MAKED_DIR)/openssl.rul
21include $(INITRD_MAKED_DIR)/openssh.rul
22include $(INITRD_MAKED_DIR)/busybox.rul
23include $(INITRD_MAKED_DIR)/aria2.rul
24#include $(INITRD_MAKED_DIR)/libusb.rul
25include $(INITRD_MAKED_DIR)/usbutils.rul
26include $(INITRD_MAKED_DIR)/udev.rul
27include $(INITRD_MAKED_DIR)/curl.rul
28include $(INITRD_MAKED_DIR)/rsync.rul
29include $(INITRD_MAKED_DIR)/bc.rul
30include $(INITRD_MAKED_DIR)/scrub.rul
31include $(INITRD_MAKED_DIR)/lsscsi.rul
32include $(INITRD_MAKED_DIR)/e2fsprogs.rul
33include $(INITRD_MAKED_DIR)/kerneltools.rul
34include $(INITRD_MAKED_DIR)/kexec.rul
35include $(INITRD_MAKED_DIR)/lvm.rul
36include $(INITRD_MAKED_DIR)/parted.rul
37include $(INITRD_MAKED_DIR)/mdadm.rul
38#include $(INITRD_MAKED_DIR)/reiserfsprogs.rul
39include $(INITRD_MAKED_DIR)/jfsutils.rul
40include $(INITRD_MAKED_DIR)/xfsprogs.rul
41include $(INITRD_MAKED_DIR)/xmlrpc-c.rul
42#
43## END import rule files
44
45
46.PHONY: initrd_prepare
47initrd_prepare: $(INITRD_DIR)/prep
48
49## Prepare the initrd directory
50#
51$(INITRD_DIR)/prep:  $(INITRD_DIR)/initrd.rul
52
53        rm -rf $(INITRD_BUILD_DIR)
54       
55        ## Also delete install files for packages.
56        #
57        rm -f $(SRC_DIR)/*.install 
58        #$(SRC_DIR)/modules_build-stamp
59        rm -f $(INITRD_DIR)/install
60
61        ## Also regenerate initrd.img
62        #
63        rm -f $(ROOT_DIR)/build
64
65        mkdir -p $(INITRD_BUILD_DIR)
66        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/bin
67        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/sbin
68        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/etc
69        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/etc/init.d
70        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/etc/installer.d
71        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/etc/modprobe.d
72        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/etc/sali/stubs
73        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/etc/startup.d
74        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/etc/network/if-down.d
75        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/etc/network/if-post-down.d
76        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/etc/network/if-pre-up.d
77        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/etc/network/if-up.d
78        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/dev
79        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/lib
80        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/lib/firmware
81        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/proc
82        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/bin
83        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/tmp
84        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/var
85        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/var/log
86        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/var/run
87        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/usr
88        mkdir -p -m 0755 $(INITRD_BUILD_DIR)/run
89
90        test ! -d /lib64 || ( cd $(INITRD_BUILD_DIR) && ln -s lib lib64 )
91
92        mknod -m 666 $(INITRD_BUILD_DIR)/dev/tty0 c 4 0
93        mknod -m 666 $(INITRD_BUILD_DIR)/dev/tty1 c 4 1
94        mknod -m 666 $(INITRD_BUILD_DIR)/dev/tty2 c 4 2
95        mknod -m 666 $(INITRD_BUILD_DIR)/dev/tty3 c 4 3
96        mknod -m 666 $(INITRD_BUILD_DIR)/dev/tty4 c 4 4
97        mknod -m 666 $(INITRD_BUILD_DIR)/dev/tty5 c 4 5
98        mknod -m 666 $(INITRD_BUILD_DIR)/dev/tty6 c 4 6
99        mknod -m 666 $(INITRD_BUILD_DIR)/dev/console c 5 1
100        mknod -m 666 $(INITRD_BUILD_DIR)/dev/null c 1 3
101        mknod -m 666 $(INITRD_BUILD_DIR)/dev/zero c 1 5
102
103        chmod +x $(INITRD_DIR)/sali/bin/sali_functions
104
105        touch $@
106
107
108initrd: initrd_build
109
110##
111#
112initrd_build:  $(INITRD_DIR)/build
113
114        ##
115    # Also regenerate initrd.img if something has changed
116        #
117        rm -f $(ROOT_DIR)/build
118
119        touch $@
120
121## Please note that the order herebelow is important!!!
122#
123$(INITRD_DIR)/build: initrd_prepare $(SRC_DIR)/modules_build-stamp \
124        openssh_install \
125        busybox_install \
126        aria2_install \
127        usbutils_install \
128        udev_install \
129        curl_install \
130        rsync_install \
131        bc_install \
132        lsscsi_install \
133        scrub_install \
134        e2fsprogs_install \
135        kerneltools_install \
136        kexec_install \
137        lvm_install \
138        parted_install \
139        mdadm_install \
140        jfsutils_install \
141        xfsprogs_install \
142        xmlrpc_install
143
144##
145#
146initrd_install: initrd_build $(INITRD_DIR)/install
147        touch $@
148
149$(INITRD_DIR)/install:
150   
151
152        chmod +x $(INITRD_DIR)/sali/bin/sali_functions
153        $(INITRD_DIR)/sali/bin/sali_functions --makefile --stubsdir $(INITRD_DIR)/functions/stubs \
154          --tmpfile $(INITRD_DIR)/functions/functions.mbm
155
156        ## Copying SALI stuff, will be moved to a separate .rul file in the future
157        #
158        # Copy the sali directory.
159        #
160        cp -a $(INITRD_DIR)/sali/* $(INITRD_BUILD_DIR)
161
162        install -m 644 $(INITRD_DIR)/functions/stubs/* $(INITRD_BUILD_DIR)/etc/sali/stubs/
163        install -m 755 $(INITRD_DIR)/functions/functions.mbm $(INITRD_BUILD_DIR)/etc/init.d/functions
164        install -m 755 $(ROOT_DIR)/VERSION $(INITRD_BUILD_DIR)/etc/sali_version
165
166        ## Cleanup the .svn stuff
167        #
168        find $(INITRD_BUILD_DIR) -depth -type d -name .svn | xargs rm -rf
169
170        ## Finally some other libs/files
171        #
172        cp -a "/$(LIBDIR)/libnss"* "$(INITRD_BUILD_DIR)/lib"
173        cp -a "/$(LIBDIR)/ld"* "$(INITRD_BUILD_DIR)/lib"
174        cp -a "/$(LIBDIR)/libse"* "$(INITRD_BUILD_DIR)/lib"
175
176        $(COPYLIBS) $(INITRD_BUILD_DIR)/lib:$(INITRD_BUILD_DIR)/usr/lib $(INITRD_BUILD_DIR)/bin:$(INITRD_BUILD_DIR)/sbin:$(INITRD_BUILD_DIR)/usr/bin/:$(INITRD_BUILD_DIR)/usr/sbin/ $(INITRD_BUILD_DIR)
177
178        touch $@
179
180.PHONY: initrd_clean
181initrd_clean:
182        @echo "\nCLEAN:: Removing initrd specific stuff"
183        rm -rf $(INITRD_BUILD_DIR)
184
185        rm -f $(INITRD_DIR)/prep
186        rm -f $(INITRD_DIR)/install
187
188        ## These files gives a message that everything is up to date
189        #
190        rm -f initrd_install
191        rm -f initrd_build
Note: See TracBrowser for help on using the repository browser.