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 && ln -sfn bin sbin
58 cd /install/initrd/etc && rm -f fstab
59 cp -aRf $(DIR_SRC)/config/install/* /install/initrd/etc/
60 mv -f /install/initrd/etc/fstab /install/initrd/etc/fstab.boot
61 cd /install/initrd/etc && ln -s /tmp/fstab fstab
62 rm -rf /install/initrd/etc{,/udev,/udev/rules.d}/.svn
63 rm -rf /install/initrd/usr/share/man
64 chmod 755 /install/initrd/etc/halt /install/initrd/etc/rc
65 cp -f /usr/share/terminfo/l/linux /install/initrd/usr/share/terminfo/l
68 -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/scsi
69 cp -f /lib/modules/$(KVER)/kernel/drivers/scsi/{scsi_mod.ko,sd_mod.ko,sr_mod.ko} \
70 /install/initrd/lib/modules/$(KVER)/kernel/drivers/scsi/
72 -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/storage
73 cp -f /lib/modules/$(KVER)/kernel/drivers/usb/storage/*.ko \
74 /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/storage/
76 -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/host
77 cp -f /lib/modules/$(KVER)/kernel/drivers/usb/host/*.ko \
78 /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/host
80 -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/input
81 cp -f /lib/modules/$(KVER)/kernel/drivers/usb/input/usbhid.ko \
82 /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/input
84 -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/core
85 cp -f /lib/modules/$(KVER)/kernel/drivers/usb/core/*.ko \
86 /install/initrd/lib/modules/$(KVER)/kernel/drivers/usb/core
89 -mkdir -p /install/initrd/lib/modules/$(KVER)/kernel/fs
90 cp -rf /lib/modules/$(KVER)/kernel/fs/* /install/initrd/lib/modules/$(KVER)/kernel/fs
92 cp -f /lib/modules/$(KVER)/modules.* /install/initrd/lib/modules/$(KVER)
94 cp /opt/$(MACHINE)-uClibc/lib/libgcc_s.so.1 /install/initrd/lib/
96 cd /install/initrd/lib/ && ln -sf libgcc_s.so.1 libgcc_s.so
99 -mkdir -p /install/{images,mnt}
100 rm -rf /install/mnt/*
102 cp -aR /install/initrd/* /install/mnt
103 # cp -a /install/misc/bin/* /install/mnt/bin
105 # make new dependencies
106 depmod -a -F /boot/System.map-$(KVER) $(KVER)
107 touch /install/mnt/FLOPPYBOOT
109 RAMDISK_SIZE=8192 && \
110 dd if=/dev/zero of=/install/images/fdinitrd bs=1k count=$${RAMDISK_SIZE}
111 for i in `seq 0 7`; do \
112 if (! losetup /dev/loop$${i} >/dev/null 2>&1 ); then \
113 LOOPDEV="/dev/loop$${i}" \
117 losetup $$LOOPDEV /install/images/fdinitrd && \
118 mke2fs -m 0 -N 1024 $$LOOPDEV && \
119 mount -t ext2 $$LOOPDEV /install/mnt && \
120 rm -rf /install/mnt/lost+found && \
121 cp -aR /install/initrd/* /install/mnt/ && \
122 cd /install/mnt/ && find ./ -ls > $(DIR_INFO)/_build.fdinitrd && \
123 cd / && umount /install/mnt && \
125 gzip -9 /install/images/fdinitrd
127 RAMDISK_SIZE=11264 && \
128 dd if=/dev/zero of=/install/images/cdinitrd bs=1k count=$${RAMDISK_SIZE}
129 for i in `seq 0 7`; do \
130 if (! losetup /dev/loop$${i} >/dev/null 2>&1 ); then \
131 LOOPDEV="/dev/loop$${i}" \
135 losetup $$LOOPDEV /install/images/cdinitrd && \
136 mke2fs -m 0 -N 1024 $$LOOPDEV && \
137 mount -t ext2 $$LOOPDEV /install/mnt && \
138 rm -rf /install/mnt/lost+found && \
139 cp -aR /install/initrd/* /install/mnt/ && \
140 cd /install/mnt && tar xfz /install/images/drivers-$(VERSION).img && \
141 cd /install/mnt && tar xfz /install/images/scsidrv-$(VERSION).img && \
142 cd /install/mnt/ && find ./ -ls > $(DIR_INFO)/_build.cdinitrd && \
143 touch /install/mnt/CDROMBOOT && \
144 cd / && umount /install/mnt && \
146 gzip -9 /install/images/cdinitrd