Geaendert:
[people/pmueller/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         sed -e "s/KVER/$(KVER)/g" $(DIR_SRC)/src/ROOTFILES.$(MACHINE) > /tmp/ROOTFILES
91         tar -c -C / --files-from=/tmp/ROOTFILES \
92             -f /$(SNAME).tar --exclude='#*' --exclude='dev/pts/*' \
93             --exclude='proc/*'
94         rm -f /tmp/ROOTFILES
95         tar -x -C /tmp -f /$(SNAME).tar
96         rm -f /$(SNAME).tar
97         cd /tmp && tar zcf /install/cdrom/$(SNAME)-$(VERSION).tgz * && rm -rf *
98         # Other files
99         sed 's/VERSION/$(VERSION)/' $(DIR_SRC)/config/cdrom/README.txt \
100                 > /install/cdrom/README.txt
101         cp $(DIR_SRC)/doc/COPYING             /install/cdrom/
102         cp /install/images/*.img              /install/cdrom/images
103         unzip $(DIR_DL)/install-en-1.4.0.pdf.zip -d /install/cdrom/doc/english
104         unzip $(DIR_DL)/quickstart-en.pdf.zip -d /install/cdrom/doc/english
105         unzip $(DIR_DL)/install-fr-1.4.0.pdf.zip -d /install/cdrom/doc/francais
106         unzip $(DIR_DL)/quickstart-fr-1.4.0.pdf.zip -d /install/cdrom/doc/francais
107         cp $(DIR_SRC)/doc/{ChangeLog,packages-list.txt} /install/cdrom/doc
108         cp $(DIR_DL)/rawrite.exe              /install/cdrom/dosutils
109         unzip -j -L $(DIR_DL)/rawwritewin*.zip -x "*.txt" -d /install/cdrom/dosutils
110
111         # make the CDROM iso, USB(superfloppy&partionned) iso
112         if [ "$(MACHINE)" == "i386" ]; then \
113                 mkdir -p /install/cdrom/boot/isolinux; \
114                 dd if=/dev/zero  bs=1k count=2            > /install/cdrom/boot/isolinux/boot.catalog; \
115                 cp /install/images/cdinitrd.gz              /install/cdrom/boot/isolinux/instroot.gz; \
116                 cp /boot/vmlinuz-installer                  /install/cdrom/boot/isolinux/vmlinuz; \
117                 cp $(DIR_SRC)/config/kernel/syslinux.cfg    /install/cdrom/boot/isolinux/isolinux.cfg; \
118                 cp /usr/lib/syslinux/isolinux.bin           /install/cdrom/boot/isolinux/isolinux.bin; \
119                 sed -e 's/boot IPFire/boot IPFire $(VERSION)/' $(DIR_SRC)/config/kernel/install-message \
120                         > /install/message; \
121                 cp /install/message /install/cdrom/boot/isolinux/message; \
122                 cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
123                         -b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
124                         -c boot/isolinux/boot.catalog \
125                         . > /install/images/$(SNAME)-install-$(VERSION).$(MACHINE).iso; \
126                 echo "compute size +64 blocks for bootsector/fat/etc..." && \
127                 dd bs=1024 count=$$((`du -k -s ../cdrom|awk '{print $$1}'` + 64)) if=/dev/zero of=/install/images/$(SNAME)-install-usb-$(VERSION).$(MACHINE).iso; \
128                 echo "move boot files on top of disk" && \
129                 rm -rf boot && \
130                 mkdosfs -n IPFIREBOOT -F 16 -I /install/images/$(SNAME)-install-usb-$(VERSION).$(MACHINE).iso && \
131                 mount -t vfat -o loop /install/images/$(SNAME)-install-usb-$(VERSION).$(MACHINE).iso /install/mnt && \
132                 cp -R ../cdrom/* /install/mnt && \
133                 cp /install/images/cdinitrd.gz              /install/mnt/instroot.gz && \
134                 cp /boot/vmlinuz-installer                  /install/mnt/vmlinuz && \
135                 cp $(DIR_SRC)/config/kernel/syslinux.cfg    /install/mnt/syslinux.cfg && \
136                 cp /install/message /install/mnt/message && \
137                 umount /install/mnt && echo "and make the isofile a bootable system ready for dd" && \
138                 syslinux /install/images/$(SNAME)-install-usb-$(VERSION).$(MACHINE).iso && \
139                 echo "# Build the USB-partitionned scheme ISO (cover majority of BIOS)" && \
140                 ISOs=/install/images/$(SNAME)-install-usb-$(VERSION).$(MACHINE).iso && \
141                 ISOp=/install/images/$(SNAME)-install-usbp-$(VERSION).$(MACHINE).iso && \
142                 dd bs=1k if=/dev/zero of=$$ISOp count=$$((`du -k -s $$ISOs | awk '{print $$1}'` + 10 )) && \
143                 echo "# Partitionning with 32 sectors geometry." && \
144                 echo "# If less, some (my) bios do not recognize the key as a bootable disk." && \
145                 echo -e "0,,6,*\n;\n;\n;" > /tmp/sdisk.txt && \
146                 sfdisk -qLDH 256 -S 32 $$ISOp < /tmp/sdisk.txt && \
147                 echo "#Just put a mbr and superfloppy at the right place. seek=32 is due to -D & 32 sectors" && \
148                 echo "#in sfdisk. If you ever change partitionning, adjust also here." && \
149                 /usr/local/sbin/install-mbr $$ISOp && \
150                 dd if=$$ISOs of=$$ISOp bs=512 seek=32; \
151         elif [ "$(MACHINE)" == "alpha" ]; then \
152                 mkdir -p /install/cdrom/etc; \
153                 cp /boot/vmlinuz-$(KVER) /install/cdrom/vmlinuz; \
154                 cp /install/images/cdinitrd.gz  /install/cdrom/instroot.gz; \
155                 cp /boot/bootlx /install/cdrom; \
156                 cp $(DIR_SRC)/config/kernel/aboot.conf /install/cdrom/etc/aboot.conf; \
157                 cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
158                         . > /install/images/$(SNAME)-install-$(VERSION).$(MACHINE).iso; \
159                 isomarkboot /install/images/$(SNAME)-install-$(VERSION).$(MACHINE).iso bootlx; \
160         fi
161