X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=lfs%2Finitrd;h=56e19679bf802c30949407dc0590791053694c51;hb=53f7ba12e8d0ba9f9c72e075b4a9e4e5c4a4ac00;hp=a3bcc4f3b7efa868b69dd6b4b7ab5c227e2ea351;hpb=0db33b567183f1d6742976619b54253f5ad151b2;p=people%2Fteissler%2Fipfire-2.x.git diff --git a/lfs/initrd b/lfs/initrd index a3bcc4f3b..56e19679b 100644 --- a/lfs/initrd +++ b/lfs/initrd @@ -1,22 +1,20 @@ ############################################################################### -# This file is part of the IPCop Firewall. # # # -# IPCop is free software; you can redistribute it and/or modify # +# IPFire.org - A linux based firewall # +# Copyright (C) 2010 IPFire Team # +# # +# 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 2 of the License, or # +# the Free Software Foundation, either version 3 of the License, or # # (at your option) any later version. # # # -# IPCop is distributed in the hope that it will be useful, # +# 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 IPCop; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -# Makefiles are based on LFSMake, which is # -# Copyright (C) 2002 Rod Roard # +# along with this program. If not, see . # # # ############################################################################### @@ -32,6 +30,8 @@ THISAPP = initrd DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) +SUP_ARCH = i586 + ############################################################################### # Top-level Rules ############################################################################### @@ -53,35 +53,49 @@ $(TARGET) : rm -f /install/images/initrd # Finish up initrd directory - -mkdir -p /install/initrd/{dev,etc,mnt,root,lib/modules/$(KVER)-ipfire/kernel/drivers,cdrom,dev,harddisk,proc,tmp,usr/share/terminfo/l,var/run,sys} && \ + -mkdir -p /install/initrd/{dev,etc,mnt,root,lib/modules/$(KVER)-ipfire/kernel/drivers,cdrom,dev,harddisk,proc,tmp,usr/share/terminfo/l,var/run,sys} + cd /install/initrd && lzma -d -c /boot/ipfirerd-$(KVER).img | cpio -i + + # Copy Files packages for installer + find $(DIR_SRC)/config/rootfiles/installer/* -maxdepth 1 | xargs cat | grep -v "^#" > /tmp/ROOTFILES + + # Patch Kernel Version to rootfiles + sed -e "s/KVER/$(KVER)/g" -i /tmp/ROOTFILES + + -cd / && cpio -d -p /install/initrd < /tmp/ROOTFILES + + # Copy hid and network modules + cp -aRf /lib/modules/$(KVER)-ipfire/kernel/drivers/hid \ + /install/initrd/lib/modules/$(KVER)-ipfire/kernel/drivers/ + cp -aRf /lib/modules/$(KVER)-ipfire/kernel/drivers/net \ + /install/initrd/lib/modules/$(KVER)-ipfire/kernel/drivers/ + cd /install/initrd/etc && rm -f fstab cp -aRf $(DIR_SRC)/config/install/* /install/initrd/etc/ - rm -rf /install/initrd/etc{,/udev,/udev/rules.d}/.svn rm -rf /install/initrd/usr/share/man - chmod 755 /install/initrd/etc/halt /install/initrd/etc/rc - cp -f /usr/share/terminfo/l/linux /install/initrd/usr/share/terminfo/l + chmod 755 /install/initrd/etc/halt /install/initrd/etc/rc_installer + + cd /install/initrd/ && patch -Np0 < $(DIR_SRC)/src/patches/dracut-init_start_ipfireinstaller.patch + + # Hide udev messages + sed -i -e "s|err|none|g" /install/initrd/etc/udev/udev.conf # make new dependencies depmod -a -F /boot/System.map-$(KVER)-ipfire $(KVER)-ipfire - depmod -a -F /boot/System.map-$(KVER)-ipfire-smp $(KVER)-ipfire-smp - - cp -a /lib/modules/$(KVER)-ipfire/ /install/initrd/lib/modules/ - rm -rf /install/initrd/lib/modules/$(KVER)-ipfire/{build,source,misc/*,kernel/{crypro,sound,net}} \ - /install/initrd/lib/modules/$(KVER)-ipfire/kernel/drivers/message/fusion/mptlan* - - cp /opt/$(MACHINE)-uClibc/lib/libgcc_s.so.1 /install/initrd/lib/ - cd /install/initrd/lib/ && ln -sf libgcc_s.so.1 libgcc_s.so - -mkdir -p /install/{images,mnt} rm -rf /install/mnt/* - cp -aR /install/initrd/* /install/mnt + #Build Module deps for installer. + depmod -a -b /install/initrd/ -F /boot/System.map-$(KVER)-ipfire $(KVER)-ipfire + # Remove binary depmod files + rm -rf /install/initrd/lib/modules/$(KVER)-ipfire/modules.*.bin - # make new dependencies - depmod -a -F /boot/System.map-$(KVER)-ipfire $(KVER)-ipfire + #Name service from dhcpcd + cp -f /etc/nsswitch.conf /install/initrd/etc/ + cp -f $(DIR_SRC)/config/initrd/dhcpc/* /install/initrd/var/ipfire/dhcpc/dhcpcd-hooks/ - mksquashfs /install/initrd /install/images/initrd + cd /install/initrd && find . | cpio -o -H newc | lzma > /install/images/initrd cd /install/initrd && find ./ -ls > $(DIR_INFO)/_build.initrd.log @$(POSTBUILD)