]> git.ipfire.org Git - ipfire-3.x.git/blob - lfs/cdrom
Renamed the initramfs file from init0 to initrd0.
[ipfire-3.x.git] / lfs / cdrom
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 VER = ipfire
28
29 THISAPP = cdrom
30 TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
31
32 ###############################################################################
33 # Top-level Rules
34 ###############################################################################
35
36 install : $(TARGET)
37
38 download :
39
40 ###############################################################################
41 # Installation Details
42 ###############################################################################
43
44 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
45 @rm -rf $(CDROM_DIR)/* $(CDROM_DIR)/.$(SNAME)info
46
47 mkdir -p $(CDROM_DIR)/{isolinux,doc}
48
49 ### Compressing root fs
50 #
51 find $(DIR_SOURCE)/rootfiles/core -maxdepth 1 -type f | xargs cat | \
52 grep -v ^# | sed -e "s/KVER/$(KVER)/g" | sort | uniq > $(CDROM_DIR)/archive.files
53
54 cd / && cpio -o -H newc < $(CDROM_DIR)/archive.files \
55 > $(CDROM_DIR)/$(SNAME)-$(VERSION).img.tmp 2>$(CDROM_DIR)/archive.errors
56
57 @cat $(CDROM_DIR)/archive.errors
58 @if grep -q "No such file or directory" < $(CDROM_DIR)/archive.errors; then \
59 exit 1; \
60 fi
61
62 lzma_sdk e $(CDROM_DIR)/$(SNAME)-$(VERSION).img.tmp \
63 $(CDROM_DIR)/$(SNAME)-$(VERSION).img
64
65 # These files won't be included in the iso
66 @rm -f $(CDROM_DIR)/archive.{files,errors} $(CDROM_DIR)/$(SNAME)-$(VERSION).img.tmp
67
68 # Other files
69 sed 's/VERSION/$(VERSION)/' $(DIR_CONF)/cdrom/README.txt > $(CDROM_DIR)/README
70 cp -vf $(DIR_SRC)/doc/COPYING $(CDROM_DIR)
71 cp -vf $(DIR_SRC)/doc/{ChangeLog,packages-list.txt} $(CDROM_DIR)/doc
72
73 cp -vf $(IMAGES_DIR)/initramfs-$(VERSION).img $(CDROM_DIR)/isolinux/initrd0
74 cp -vf /boot/ipfirekernel-$(KVER) $(CDROM_DIR)/isolinux/ipfire0
75
76 cp -vf /usr/lib/syslinux/{vesamenu.c32,isolinux.bin} \
77 $(DIR_CONF)/bootloader/splash.{jpg,lss} $(DIR_CONF)/bootloader/*.msg \
78 $(CDROM_DIR)/isolinux
79 sed -e "s/VERSION/$(VERSION)/g" $(DIR_CONF)/bootloader/installer.conf > \
80 $(CDROM_DIR)/isolinux/isolinux.cfg
81 cp -vf /usr/lib/memtest86+/memtest.bin $(CDROM_DIR)/isolinux/memtest
82
83 # Creating the info file
84 echo -e "Release: $(NAME)-$(VERSION)" \
85 "\nBuild host: $$(hostname)\nDate: $$(date)" \
86 "\nMD5: $$(md5sum $(CDROM_DIR)/$(SNAME)-$(VERSION).img | awk '{ print $$1 }')" \
87 > $(CDROM_DIR)/.$(SNAME)info
88
89 cd $(CDROM_DIR) && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
90 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
91 -boot-info-table . > $(IMAGES_DIR)/$(SNAME)-$(VERSION).$(MACHINE).iso
92
93 @rm -rf $(CDROM_DIR)/* $(CDROM_DIR)/.$(SNAME)info
94
95 ### REBUILD THIS AT EVERY PASS