Installer
[people/teissler/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 VER = ipfire
30
31 THISAPP = cdrom
32 DL_FILE = rawrite.exe
33 DL_FROM = $(URL_IPFIRE)
34 TARGET = $(DIR_INFO)/$(THISAPP)
35
36 ###############################################################################
37 # Top-level Rules
38 ###############################################################################
39
40 objects = $(DL_FILE) \
41 rawwritewin-0.7.zip
42
43 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
44 rawwritewin-0.7.zip = http://uranus.it.swin.edu.au/~jn/linux/rawwritewin-0.7.zip
45
46 $(DL_FILE)_MD5 = 7dac6ea496014d32dbce6c50feb254ca
47 rawwritewin-0.7.zip_MD5 = 0130b497c8c3bc7d136a4236b0d9fbf6
48
49 install : $(TARGET)
50
51 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
52
53 download :$(patsubst %,$(DIR_DL)/%,$(objects))
54
55 md5 : $(subst %,%_MD5,$(objects))
56
57 ###############################################################################
58 # Downloading, checking, md5sum
59 ###############################################################################
60
61 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
62 @$(CHECK)
63
64 $(patsubst %,$(DIR_DL)/%,$(objects)) :
65 @$(LOAD)
66
67 $(subst %,%_MD5,$(objects)) :
68 @$(MD5)
69
70 ###############################################################################
71 # Installation Details
72 ###############################################################################
73
74 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
75 rm -rf /install/cdrom /tmp/*
76
77 # Compress root filesystem
78 # Reason for this tar+untar+tar is removing of entries listed two or more in src/ROOTFILES
79 mkdir -p /install/cdrom/{doc,dosutils,images}
80 find $(DIR_SRC)/config/rootfiles/common -maxdepth 1 -type f | xargs cat >> /tmp/ROOTFILES
81 find $(DIR_SRC)/config/rootfiles/ver_$(IPFVER) -maxdepth 1 -type f | xargs cat >> /tmp/ROOTFILES
82 tar -c -C / --files-from=/tmp/ROOTFILES \
83 -f /$(SNAME).tar --exclude='#*' --exclude='dev/pts/*' \
84 --exclude='proc/*' --exclude='tmp/ROOTFILES'
85 rm -f /tmp/ROOTFILES
86 tar -x -C /tmp -f /$(SNAME).tar
87 rm -f /$(SNAME).tar
88 cd /tmp && tar jcf /install/cdrom/$(SNAME)-$(VERSION).tbz2 * && rm -rf *
89
90 # Other files
91 sed 's/VERSION/$(VERSION)/' $(DIR_SRC)/config/cdrom/README.txt > /install/cdrom/README.txt
92 cp $(DIR_SRC)/doc/COPYING /install/cdrom/
93 cp /install/images/*.img /install/cdrom/images
94 cp $(DIR_SRC)/doc/{ChangeLog,packages-list.txt} /install/cdrom/doc
95 cp $(DIR_DL)/rawrite.exe /install/cdrom/dosutils
96 unzip -j -L $(DIR_DL)/rawwritewin*.zip -x "*.txt" -d /install/cdrom/dosutils
97
98 # Make the ISO
99 mkdir -p /install/cdrom/boot/isolinux; \
100 dd if=/dev/zero bs=1k count=2 > /install/cdrom/boot/isolinux/boot.catalog; \
101 cp /install/images/cdinitrd.gz /install/cdrom/boot/isolinux/instroot.gz; \
102 cp /boot/vmlinuz-$(KVER) /install/cdrom/boot/isolinux/vmlinuz; \
103 cp $(DIR_SRC)/config/kernel/syslinux.cfg /install/cdrom/boot/isolinux/isolinux.cfg; \
104 cp $(DIR_SRC)/config/kernel/install-message /install/cdrom/boot/isolinux/message; \
105 cp /usr/lib/syslinux/isolinux.bin /install/cdrom/boot/isolinux/isolinux.bin; \
106 cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
107 -b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
108 -c boot/isolinux/boot.catalog . > /install/images/$(SNAME)-$(VERSION).$(MACHINE)-$(IPFVER).iso