1 ###############################################################################
2 # This file is part of the IPCop Firewall. #
4 # IPCop is free software; you can redistribute it and/or modify #
5 # it under the terms of the GNU General Public License as published by #
6 # the Free Software Foundation; either version 2 of the License, or #
7 # (at your option) any later version. #
9 # IPCop is distributed in the hope that it will be useful, #
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
12 # GNU General Public License for more details. #
14 # You should have received a copy of the GNU General Public License #
15 # along with IPCop; if not, write to the Free Software #
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
18 # Makefiles are based on LFSMake, which is #
19 # Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
21 ###############################################################################
23 ###############################################################################
25 ###############################################################################
32 DIR_APP = $(DIR_SRC)/$(THISAPP)
33 TARGET = $(DIR_INFO)/$(THISAPP)
35 ###############################################################################
37 ###############################################################################
47 ###############################################################################
48 # Installation Details
49 ###############################################################################
53 rm -f /install/images/{cdinitrd,cdinitrd.gz,fdinitrd,fdinitrd.gz}
55 # Finish up initrd directory
56 -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} && \
57 cd /install/initrd/etc && rm -f fstab
58 cp -aRf $(DIR_SRC)/config/install/* /install/initrd/etc/
59 rm -rf /install/initrd/etc{,/udev,/udev/rules.d}/.svn
60 rm -rf /install/initrd/usr/share/man
61 chmod 755 /install/initrd/etc/halt /install/initrd/etc/rc
62 cp -f /usr/share/terminfo/l/linux /install/initrd/usr/share/terminfo/l
65 -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/scsi
66 cp -f /lib/modules/$(KVER)/kernel/drivers/scsi/{scsi_mod.ko,sd_mod.ko,sr_mod.ko} \
67 /install/initrd/lib/modules/$(KVER)/kernel/drivers/scsi/
69 -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/storage
70 cp -f /lib/modules/$(KVER)/kernel/drivers/usb/storage/*.ko \
71 /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/storage/
73 -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/host
74 cp -f /lib/modules/$(KVER)/kernel/drivers/usb/host/*.ko \
75 /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/host
77 -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/input
78 cp -f /lib/modules/$(KVER)/kernel/drivers/usb/input/usbhid.ko \
79 /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/input
81 -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/core
82 cp -f /lib/modules/$(KVER)/kernel/drivers/usb/core/*.ko \
83 /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/core
86 -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/fs
87 cp -rf /lib/modules/$(KVER)/kernel/fs/* /install/initrd/lib/modules/$(KVER)/kernel/fs
89 cp -f /lib/modules/$(KVER)/modules.* /install/initrd/lib/modules/$(KVER)
91 cp /opt/$(MACHINE)-uClibc/lib/libgcc_s.so.1 /install/initrd/lib/
93 cd /install/initrd/lib/ && ln -sf libgcc_s.so.1 libgcc_s.so
96 -mkdir -p /install/{images,mnt}
99 cp -aR /install/initrd/* /install/mnt
100 # cp -a /install/misc/bin/* /install/mnt/bin
102 # make new dependencies
103 depmod -a -F /boot/System.map-$(KVER) $(KVER)
104 touch /install/mnt/FLOPPYBOOT
106 RAMDISK_SIZE=8192 && \
107 dd if=/dev/zero of=/install/images/fdinitrd bs=1k count=$${RAMDISK_SIZE}
108 for i in `seq 0 7`; do \
109 if (! losetup /dev/loop$${i} >/dev/null 2>&1 ); then \
110 LOOPDEV="/dev/loop$${i}" \
114 losetup $$LOOPDEV /install/images/fdinitrd && \
115 mke2fs -m 0 -N 1024 $$LOOPDEV && \
116 mount -t ext2 $$LOOPDEV /install/mnt && \
117 rm -rf /install/mnt/lost+found && \
118 cp -aR /install/initrd/* /install/mnt/ && \
119 cd /install/mnt/ && find ./ -ls > $(DIR_INFO)/_build.fdinitrd && \
120 cd / && umount /install/mnt && \
122 gzip -9 /install/images/fdinitrd
124 RAMDISK_SIZE=16384 && \
125 dd if=/dev/zero of=/install/images/cdinitrd bs=1k count=$${RAMDISK_SIZE}
126 for i in `seq 0 7`; do \
127 if (! losetup /dev/loop$${i} >/dev/null 2>&1 ); then \
128 LOOPDEV="/dev/loop$${i}" \
132 losetup $$LOOPDEV /install/images/cdinitrd && \
133 mke2fs -m 0 -N 1024 $$LOOPDEV && \
134 mount -t ext2 $$LOOPDEV /install/mnt && \
135 rm -rf /install/mnt/lost+found && \
136 cp -aR /install/initrd/* /install/mnt/ && \
137 cd /install/mnt && tar xfz /install/images/drivers-$(VERSION).img && \
138 cd /install/mnt && tar xfz /install/images/scsidrv-$(VERSION).img && \
139 cd /install/mnt/ && find ./ -ls > $(DIR_INFO)/_build.cdinitrd && \
140 touch /install/mnt/CDROMBOOT && \
141 cd / && umount /install/mnt && \
143 gzip -9 /install/images/cdinitrd
144 splash -s -f /boot/splash/config/bootsplash-1024x768.cfg >> /install/images/cdinitrd.gz