]> git.ipfire.org Git - ipfire-2.x.git/blob - lfs/cdrom
HinzugefĆ¼gt:
[ipfire-2.x.git] / lfs / cdrom
1 ###############################################################################
2 # This file is part of the IPCop Firewall. #
3 # #
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. #
8 # #
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. #
13 # #
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 #
17 # #
18 # Makefiles are based on LFSMake, which is #
19 # Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
20 # #
21 ###############################################################################
22
23 ###############################################################################
24 # Definitions
25 ###############################################################################
26
27 include Config
28
29 THISAPP = cdrom
30 DL_FILE = rawrite.exe
31 DL_FROM = $(URL_IPFIRE)
32 TARGET = $(DIR_INFO)/$(THISAPP)
33
34 ###############################################################################
35 # Top-level Rules
36 ###############################################################################
37
38 objects = $(DL_FILE) \
39 rawwritewin-0.7.zip \
40 install-en-1.4.0.pdf.zip \
41 install-fr-1.4.0.pdf.zip \
42 quickstart-en.pdf.zip \
43 quickstart-fr-1.4.0.pdf.zip
44
45 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
46 rawwritewin-0.7.zip = http://uranus.it.swin.edu.au/~jn/linux/rawwritewin-0.7.zip
47 install-en-1.4.0.pdf.zip = $(URL_SFNET)/ipcop/install-en-1.4.0.pdf.zip
48 install-fr-1.4.0.pdf.zip = $(URL_SFNET)/ipcop/install-fr-1.4.0.pdf.zip
49 quickstart-en.pdf.zip = http://www.ipcop.org/1.4.0/en/quickstart/quickstart-en.pdf.zip
50 quickstart-fr-1.4.0.pdf.zip = http://www.ipcop.org/1.4.0/fr/quickstart/quickstart-fr-1.4.0.pdf.zip
51
52 $(DL_FILE)_MD5 = 7dac6ea496014d32dbce6c50feb254ca
53 rawwritewin-0.7.zip_MD5 = 0130b497c8c3bc7d136a4236b0d9fbf6
54 install-en-1.4.0.pdf.zip_MD5 = 07e0b5131f1434010d8a00571f9acd81
55 install-fr-1.4.0.pdf.zip_MD5 = 2deb9d3bc46779cff18b681625fc4418
56 quickstart-en.pdf.zip_MD5 = ca77ef5f1efca6bc519cc42acfd69aa4
57 quickstart-fr-1.4.0.pdf.zip_MD5 = 7ec474aea03acba10371eb92579b0dec
58
59 install : $(TARGET)
60
61 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
62
63 download :$(patsubst %,$(DIR_DL)/%,$(objects))
64
65 md5 : $(subst %,%_MD5,$(objects))
66
67 ###############################################################################
68 # Downloading, checking, md5sum
69 ###############################################################################
70
71 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
72 @$(CHECK)
73
74 $(patsubst %,$(DIR_DL)/%,$(objects)) :
75 @$(LOAD)
76
77 $(subst %,%_MD5,$(objects)) :
78 @$(MD5)
79
80 ###############################################################################
81 # Installation Details
82 ###############################################################################
83
84 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
85 rm -rf /install/cdrom /tmp/*
86
87 # Compress root filesystem
88 # Reason for this tar+untar+tar is removing of entries listed two or more in src/ROOTFILES
89 mkdir -p /install/cdrom/{doc,dosutils,images}
90 tar -c -C / --files-from=$(DIR_SRC)/src/ROOTFILES.$(MACHINE) \
91 -f /$(SNAME).tar --exclude='#*' --exclude='dev/pts/*' \
92 --exclude='proc/*'
93 tar -x -C /tmp -f /$(SNAME).tar
94 rm -f /$(SNAME).tar
95 cd /tmp && tar zcf /install/cdrom/$(SNAME)-$(VERSION).tgz * && rm -rf *
96 # Other files
97 sed 's/VERSION/$(VERSION)/' $(DIR_SRC)/config/cdrom/README.txt \
98 > /install/cdrom/README.txt
99 cp $(DIR_SRC)/doc/COPYING /install/cdrom/
100 cp /install/images/*.img /install/cdrom/images
101 unzip $(DIR_DL)/install-en-1.4.0.pdf.zip -d /install/cdrom/doc/english
102 unzip $(DIR_DL)/quickstart-en.pdf.zip -d /install/cdrom/doc/english
103 unzip $(DIR_DL)/install-fr-1.4.0.pdf.zip -d /install/cdrom/doc/francais
104 unzip $(DIR_DL)/quickstart-fr-1.4.0.pdf.zip -d /install/cdrom/doc/francais
105 cp $(DIR_SRC)/doc/{ChangeLog,packages-list.txt} /install/cdrom/doc
106 cp $(DIR_DL)/rawrite.exe /install/cdrom/dosutils
107 unzip -j -L $(DIR_DL)/rawwritewin*.zip -x "*.txt" -d /install/cdrom/dosutils
108
109 # make the CDROM iso, USB(superfloppy&partionned) iso
110 if [ "$(MACHINE)" == "i386" ]; then \
111 mkdir -p /install/cdrom/boot/isolinux; \
112 dd if=/dev/zero bs=1k count=2 > /install/cdrom/boot/isolinux/boot.catalog; \
113 cp /install/images/cdinitrd.gz /install/cdrom/boot/isolinux/instroot.gz; \
114 cp /boot/vmlinuz-installer /install/cdrom/boot/isolinux/vmlinuz; \
115 cp $(DIR_SRC)/config/kernel/syslinux.cfg /install/cdrom/boot/isolinux/isolinux.cfg; \
116 cp /usr/lib/syslinux/isolinux.bin /install/cdrom/boot/isolinux/isolinux.bin; \
117 sed -e 's/boot IPFire/boot IPFire $(VERSION)/' $(DIR_SRC)/config/kernel/install-message \
118 > /install/message; \
119 cp /install/message /install/cdrom/boot/isolinux/message; \
120 cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
121 -b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
122 -c boot/isolinux/boot.catalog \
123 . > /install/images/$(SNAME)-install-$(VERSION).$(MACHINE).iso; \
124 echo "compute size +64 blocks for bootsector/fat/etc..." && \
125 dd bs=1024 count=$$((`du -k -s ../cdrom|awk '{print $$1}'` + 64)) if=/dev/zero of=/install/images/$(SNAME)-install-usb-$(VERSION).$(MACHINE).iso; \
126 echo "move boot files on top of disk" && \
127 rm -rf boot && \
128 mkdosfs -n IPFIREBOOT -F 16 -I /install/images/$(SNAME)-install-usb-$(VERSION).$(MACHINE).iso && \
129 mount -t vfat -o loop /install/images/$(SNAME)-install-usb-$(VERSION).$(MACHINE).iso /install/mnt && \
130 cp -R ../cdrom/* /install/mnt && \
131 cp /install/images/cdinitrd.gz /install/mnt/instroot.gz && \
132 cp /boot/vmlinuz-installer /install/mnt/vmlinuz && \
133 cp $(DIR_SRC)/config/kernel/syslinux.cfg /install/mnt/syslinux.cfg && \
134 cp /install/message /install/mnt/message && \
135 umount /install/mnt && echo "and make the isofile a bootable system ready for dd" && \
136 syslinux /install/images/$(SNAME)-install-usb-$(VERSION).$(MACHINE).iso && \
137 echo "# Build the USB-partitionned scheme ISO (cover majority of BIOS)" && \
138 ISOs=/install/images/$(SNAME)-install-usb-$(VERSION).$(MACHINE).iso && \
139 ISOp=/install/images/$(SNAME)-install-usbp-$(VERSION).$(MACHINE).iso && \
140 dd bs=1k if=/dev/zero of=$$ISOp count=$$((`du -k -s $$ISOs | awk '{print $$1}'` + 10 )) && \
141 echo "# Partitionning with 32 sectors geometry." && \
142 echo "# If less, some (my) bios do not recognize the key as a bootable disk." && \
143 echo -e "0,,6,*\n;\n;\n;" > /tmp/sdisk.txt && \
144 sfdisk -qLDH 256 -S 32 $$ISOp < /tmp/sdisk.txt && \
145 echo "#Just put a mbr and superfloppy at the right place. seek=32 is due to -D & 32 sectors" && \
146 echo "#in sfdisk. If you ever change partitionning, adjust also here." && \
147 /usr/local/sbin/install-mbr $$ISOp && \
148 dd if=$$ISOs of=$$ISOp bs=512 seek=32; \
149 elif [ "$(MACHINE)" == "alpha" ]; then \
150 mkdir -p /install/cdrom/etc; \
151 cp /boot/vmlinuz-$(KVER) /install/cdrom/vmlinuz; \
152 cp /install/images/cdinitrd.gz /install/cdrom/instroot.gz; \
153 cp /boot/bootlx /install/cdrom; \
154 cp $(DIR_SRC)/config/kernel/aboot.conf /install/cdrom/etc/aboot.conf; \
155 cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
156 . > /install/images/$(SNAME)-install-$(VERSION).$(MACHINE).iso; \
157 isomarkboot /install/images/$(SNAME)-install-$(VERSION).$(MACHINE).iso bootlx; \
158 fi
159