X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=lfs%2Finitrd;h=cf4f2808501ff45361435e124969c0f6b7950a09;hp=35da2464ade6e570909a91cb1b1d8033678e6fa5;hb=ab8d438fdda2b682b9e08a25fd1710312e35d1f5;hpb=6d9d8b63e82ab435ab1443b5d5802ca05c7221fa diff --git a/lfs/initrd b/lfs/initrd index 35da2464ad..cf4f280850 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) 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 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 . # # # ############################################################################### @@ -50,96 +48,54 @@ md5 : $(TARGET) : @$(PREBUILD) - rm -f /install/images/{cdinitrd,cdinitrd.gz,fdinitrd,fdinitrd.gz} + rm -f /install/images/initrd # Finish up initrd directory - -mkdir -p /install/initrd/{dev,etc,mnt,root,lib/modules/$(KVER)/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/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 - # Extra modules - -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/scsi - cp -f /lib/modules/$(KVER)/kernel/drivers/scsi/{scsi_mod.ko,sd_mod.ko,sr_mod.ko} \ - /install/initrd/lib/modules/$(KVER)/kernel/drivers/scsi/ - - -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/storage - cp -f /lib/modules/$(KVER)/kernel/drivers/usb/storage/*.ko \ - /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/storage/ - - -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/host - cp -f /lib/modules/$(KVER)/kernel/drivers/usb/host/*.ko \ - /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/host - - -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/input - cp -f /lib/modules/$(KVER)/kernel/drivers/usb/input/usbhid.ko \ - /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/input - - -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/core - cp -f /lib/modules/$(KVER)/kernel/drivers/usb/core/*.ko \ - /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/core - - # File system - -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/fs - cp -rf /lib/modules/$(KVER)/kernel/fs/* /install/initrd/lib/modules/$(KVER)/kernel/fs + # 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,mISDN,source,misc/*,kernel/{sound,drivers/{acpi,bluetooth,cpufreq,hwmon,gpu,rtc,isdn,media,video,watchdog}}} \ + /install/initrd/lib/modules/$(KVER)-ipfire/kernel/drivers/message/fusion/mptlan* \ + /install/initrd/lib/modules/$(KVER)-ipfire/net/{bridge,netfilter,ipsec} \ + /install/initrd/lib/modules/$(KVER)-ipfire/dahdi - cp -f /lib/modules/$(KVER)/modules.* /install/initrd/lib/modules/$(KVER) + # ... acpi/dock.ko is needed for libata +# -mkdir -p /install/initrd/lib/modules/$(KVER)-ipfire/kernel/drivers/acpi +# cp -a /lib/modules/$(KVER)-ipfire/kernel/drivers/acpi/dock.ko \ +# /install/initrd/lib/modules/$(KVER)-ipfire/kernel/drivers/acpi/dock.ko 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 - - # Floppy initrd + -mkdir -p /install/{images,mnt} rm -rf /install/mnt/* cp -aR /install/initrd/* /install/mnt - # cp -a /install/misc/bin/* /install/mnt/bin - - # make new dependencies - depmod -a -F /boot/System.map-$(KVER) $(KVER) - touch /install/mnt/FLOPPYBOOT - - RAMDISK_SIZE=8192 && \ - dd if=/dev/zero of=/install/images/fdinitrd bs=1k count=$${RAMDISK_SIZE} - for i in `seq 0 7`; do \ - if (! losetup /dev/loop$${i} >/dev/null 2>&1 ); then \ - LOOPDEV="/dev/loop$${i}" \ - break; \ - fi; \ - done && \ - losetup $$LOOPDEV /install/images/fdinitrd && \ - mke2fs -m 0 -N 1024 $$LOOPDEV && \ - mount -t ext2 $$LOOPDEV /install/mnt && \ - rm -rf /install/mnt/lost+found && \ - cp -aR /install/initrd/* /install/mnt/ && \ - cd /install/mnt/ && find ./ -ls > $(DIR_INFO)/_build.fdinitrd && \ - cd / && umount /install/mnt && \ - losetup -d $$LOOPDEV - gzip -9 /install/images/fdinitrd - - RAMDISK_SIZE=16384 && \ - dd if=/dev/zero of=/install/images/cdinitrd bs=1k count=$${RAMDISK_SIZE} - for i in `seq 0 7`; do \ - if (! losetup /dev/loop$${i} >/dev/null 2>&1 ); then \ - LOOPDEV="/dev/loop$${i}" \ - break; \ - fi; \ - done && \ - losetup $$LOOPDEV /install/images/cdinitrd && \ - mke2fs -m 0 -N 1024 $$LOOPDEV && \ - mount -t ext2 $$LOOPDEV /install/mnt && \ - rm -rf /install/mnt/lost+found && \ - cp -aR /install/initrd/* /install/mnt/ && \ - cd /install/mnt && tar xfz /install/images/drivers-$(VERSION).img && \ - cd /install/mnt && tar xfz /install/images/scsidrv-$(VERSION).img && \ - cd /install/mnt/ && find ./ -ls > $(DIR_INFO)/_build.cdinitrd && \ - touch /install/mnt/CDROMBOOT && \ - cd / && umount /install/mnt && \ - losetup -d $$LOOPDEV - gzip -9 /install/images/cdinitrd + + # make new dependencies for installer + depmod -a -F /boot/System.map-$(KVER)-ipfire \ + -b /install/initrd $(KVER)-ipfire + + # Remove binary depmod files + rm -rf /install/initrd/lib/modules/$(KVER)-ipfire/modules.*.bin + + cd /install/initrd && strip --strip-all {,usr/}{,s}bin/* || true + cd /install/initrd && strip --strip-debug {,usr/}lib/* || true + + cd /install/initrd && ln -svf sbin/init init + + cd /install/initrd && find . | cpio -o -H newc | lzma > /install/images/initrd + cd /install/initrd && find ./ -ls > $(DIR_INFO)/_build.initrd.log @$(POSTBUILD)