############################################################################### # # # IPFire.org - A linux based firewall # # Copyright (C) 2007 Michael Tremer & Christian Schmidt # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation, either version 3 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program. If not, see . # # # ############################################################################### ############################################################################### # Definitions ############################################################################### include Config PKG_NAME = initramfs VER = LFS THISAPP = $(PKG_NAME)-$(VER) TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP) ############################################################################### # Top-level Rules ############################################################################### install : $(TARGET) download : ############################################################################### # Installation Details ############################################################################### $(TARGET) : @$(PREBUILD) -mkdir -p $(INSTALLER_DIR)/{usr,bin,sbin,lib,dev,etc,mnt,root,cdrom,dev,harddisk,proc,tmp,sys,var/run} -mkdir -p $(INSTALLER_DIR)/usr/{bin,sbin,lib,share/locale,share/terminfo/l,share/udhcpc} ### glibc # install -c -D /lib/libc-2.7.so $(INSTALLER_DIR)/lib/libc-2.7.so ln -svf libc-2.7.so $(INSTALLER_DIR)/lib/libc.so.6 install -c -D /lib/libdl-2.7.so $(INSTALLER_DIR)/lib/libdl-2.7.so ln -svf libdl-2.7.so $(INSTALLER_DIR)/lib/libdl.so.2 install -c -D /lib/libnss_files-2.7.so $(INSTALLER_DIR)/lib/libnss_files-2.7.so ln -svf libnss_files-2.7.so $(INSTALLER_DIR)/lib/libnss_files.so.2 install -c -D /lib/libcrypt-2.7.so $(INSTALLER_DIR)/lib/libcrypt-2.7.so ln -svf libcrypt-2.7.so $(INSTALLER_DIR)/lib/libcrypt.so.1 install -c -D /lib/libm-2.7.so $(INSTALLER_DIR)/lib/libm-2.7.so ln -svf libm-2.7.so $(INSTALLER_DIR)/lib/libm.so.6 install -c -D /lib/libutil-2.7.so $(INSTALLER_DIR)/lib/libutil-2.7.so ln -svf libutil-2.7.so $(INSTALLER_DIR)/lib/libutil.so.1 install -c -D /lib/libpthread-2.7.so $(INSTALLER_DIR)/lib/libpthread-2.7.so ln -svf libpthread-2.7.so $(INSTALLER_DIR)/lib/libpthread.so.0 install -c -D /lib/ld-2.7.so $(INSTALLER_DIR)/lib/ld-2.7.so ln -svf ld-2.7.so $(INSTALLER_DIR)/$(LINKER) ### udev # install -D /sbin/udevd $(INSTALLER_DIR)/sbin install -D /sbin/udevsettle $(INSTALLER_DIR)/sbin install -D /sbin/udevtrigger $(INSTALLER_DIR)/sbin -cp -avf /lib/udev $(INSTALLER_DIR)/lib/ cp -avf /etc/udev $(INSTALLER_DIR)/etc/ ### ncurses # install -c -D /lib/libncursesw.so.5.6 $(INSTALLER_DIR)/lib/libncursesw.so.5.6 ln -svf libncursesw.so.5.6 $(INSTALLER_DIR)/lib/libncursesw.so ### e2fsprogs # install -c -D /sbin/mke2fs $(INSTALLER_DIR)/sbin/mke2fs install -c -D /lib/libext2fs.so.2.4 $(INSTALLER_DIR)/lib/libext2fs.so.2.4 ln -svf libext2fs.so.2.4 $(INSTALLER_DIR)/lib/libext2fs.so.2 install -c -D /lib/libuuid.so.1.2 $(INSTALLER_DIR)/lib/libuuid.so.1.2 ln -svf libuuid.so.1.2 $(INSTALLER_DIR)/lib/libuuid.so.1 install -c -D /lib/libcom_err.so.2.1 $(INSTALLER_DIR)/lib/libcom_err.so.2.1 ln -svf libcom_err.so.2.1 $(INSTALLER_DIR)/lib/libcom_err.so.2 install -c -D /lib/libblkid.so.1.0 $(INSTALLER_DIR)/lib/libblkid.so.1.0 ln -svf libblkid.so.1.0 $(INSTALLER_DIR)/lib/libblkid.so.1 install -c -D /lib/libe2p.so.2.3 $(INSTALLER_DIR)/lib/libe2p.so.2.3 ln -svf libe2p.so.2.3 $(INSTALLER_DIR)/lib/libe2p.so.2 ### parted # install -c -D /usr/sbin/parted $(INSTALLER_DIR)/usr/sbin/parted install -c -D /usr/lib/libparted-1.8.so.8.0.0 $(INSTALLER_DIR)/usr/lib/libparted-1.8.so.8.0.0 ln -svf libparted-1.8.so.8.0.0 $(INSTALLER_DIR)/usr/lib/libparted-1.8.so.8 ### kudzu # install -c -D /sbin/kudzu $(INSTALLER_DIR)/sbin/kudzu ### popt # install -c -D /usr/lib/libpopt.so.0.0.0 $(INSTALLER_DIR)/usr/lib/libpopt.so.0.0.0 ln -svf libpopt.so.0.0.0 $(INSTALLER_DIR)/usr/lib/libpopt.so.0 ### libz # install -c -D /lib/libz.so.1.2.3 $(INSTALLER_DIR)/lib/libz.so.1.2.3 ln -svf libz.so.1.2.3 $(INSTALLER_DIR)/lib/libz.so.1 ### newt # install -c -D /usr/lib/libnewt.so.0.52.7 $(INSTALLER_DIR)/usr/lib/libnewt.so.0.52.7 ln -svf libnewt.so.0.52.7 $(INSTALLER_DIR)/usr/lib/libnewt.so.0.52 ### slang # install -c -D /usr/lib/libslang.so.2.1.3 $(INSTALLER_DIR)/usr/lib/libslang.so.2.1.3 ln -svf libslang.so.2.1.3 $(INSTALLER_DIR)/usr/lib/libslang.so.2 ### python # install -c -D /usr/lib/libpython2.5.so.1.0 $(INSTALLER_DIR)/usr/lib/libpython2.5.so.1.0 ln -svf libpython2.5.so.1.0 $(INSTALLER_DIR)/usr/lib/libpython2.5.so install -D /usr/bin/python $(INSTALLER_DIR)/usr/bin/python -mkdir -p $(INSTALLER_DIR)/usr/lib/python2.5/{site-packages,lib-dynload} cp -avf /usr/lib/python2.5/{encodings,logging} \ $(INSTALLER_DIR)/usr/lib/python2.5/ cp -avf /usr/lib/python2.5/{UserDict,bdb,cmd,codecs,copy*,fnmatch,gettext,glob,gzip,linecache,locale,os,pickle,posixpath,pty,re,shlex,site,socket,sre*,stat,string,struct,subprocess,traceback,tty,types}.py{,o} \ $(INSTALLER_DIR)/usr/lib/python2.5/ cp -avf /usr/lib/python2.5/site-packages/{_{snack,kudzu}module.so,{kudzu,snack}.py,iconv.so} \ $(INSTALLER_DIR)/usr/lib/python2.5/site-packages cp -avf /usr/lib/python2.5/lib-dynload/{{binascii,collections,cPickle,cStringIO,fcntl,operator,select,termios,time,zlib},_{socket,struct}}.so \ $(INSTALLER_DIR)/usr/lib/python2.5/lib-dynload ### configuration # cp -avf $(DIR_CONF)/install/* $(INSTALLER_DIR)/etc/ cp -vf $(DIR_SOURCE)/initscripts/init.d/functions $(INSTALLER_DIR)/etc/functions chmod -v 755 $(INSTALLER_DIR)/etc/{halt,rc} ln -svf etc/rc $(INSTALLER_DIR)/init cp -vf /etc/issue /etc/group $(INSTALLER_DIR)/etc/ cp -vf /usr/share/terminfo/l/linux $(INSTALLER_DIR)/usr/share/terminfo/l cd $(INSTALLER_DIR) && find ./bin -maxdepth 1 -type f -exec \ $(TOOLS_DIR)/bin/strip --strip-all '{}' ';' cd $(INSTALLER_DIR) && find ./lib -maxdepth 1 -type f -exec \ $(TOOLS_DIR)/bin/strip --strip-all '{}' ';' ### kernel modules # -mkdir -p $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/{drivers,fs} cp -avf \ /lib/modules/$(KVER)/kernel/drivers/{ata,block,cdrom,dma,firewire,hid,ide,net,pcmcia,scsi,usb} \ $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/drivers cp -avf \ /lib/modules/$(KVER)/kernel/fs/{exportfs,ext{2,3},fat,ntfs,reiser{4,fs},udf,vfat,xfs} \ $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/fs cp -f /lib/modules/$(KVER)/modules.* $(INSTALLER_DIR)/lib/modules/$(KVER) ### stripping # # We do the stripping here because we don't want to destroy our development tree by stripping all symbols # Instead we strip all binaries and libraries as we create the initramfs. # It's quite safe to do strip --strip-all on libraries if they will not be used for development. cd $(INSTALLER_DIR) && find .{,/usr/}/bin .{,/usr/}/sbin -maxdepth 1 -type f -exec $(TOOLS_DIR)/bin/strip --strip-all '{}' ';' cd $(INSTALLER_DIR) && find .{,/usr/}/lib -maxdepth 1 -type f -exec $(TOOLS_DIR)/bin/strip --strip-all '{}' ';' ### compressing everything # -find $(INSTALLER_DIR) -name .svn -exec rm -rf {} \; cd $(INSTALLER_DIR) && find . | cpio -o -H newc | lzma e -si -so > \ /images/initramfs-$(VERSION).img @$(POSTBUILD)