]> git.ipfire.org Git - ipfire-2.x.git/blob - lfs/cdrom
core124: Ship update localnet init script
[ipfire-2.x.git] / lfs / cdrom
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
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)/$(THISAPP)
31
32 ###############################################################################
33 # Top-level Rules
34 ###############################################################################
35
36 install : $(TARGET)
37
38 check :
39
40 download :
41
42 md5 :
43
44 ###############################################################################
45 # Installation Details
46 ###############################################################################
47
48 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
49 # Update /etc/system-release, because the string might have changed
50 # since stage2 has been executed..
51 echo "$(SYSTEM_RELEASE)" > /etc/system-release
52
53 rm -rf /install/cdrom /tmp/*
54 mkdir -p /install/cdrom/doc
55
56 # Clear mtab (prevents .journal problems)
57 rm -vf /etc/mtab
58 echo > /etc/mtab
59
60 # Create filelist for packaging.
61 BUILDTARGET="$(BUILDTARGET)" BUILD_ARCH="$(BUILD_ARCH)" KVER="$(KVER)" \
62 $(DIR_SRC)/src/scripts/archive.files \
63 $(DIR_SRC)/config/rootfiles/common \
64 > /tmp/ROOTFILES
65
66 # Compress root filesystem
67 # Reason for this tar+untar+tar is removing of entries listed two or more in src/ROOTFILES
68 tar -c --exclude='#*' --exclude='proc/*' --exclude='dev/pts/*' --exclude='tmp/ROOTFILES' \
69 -C / --files-from=/tmp/ROOTFILES -f /$(SNAME).tar
70 rm -f /tmp/ROOTFILES
71 tar -x -C /tmp -f /$(SNAME).tar
72 rm -f /$(SNAME).tar
73 @mkdir /tmp/sys
74 cd /tmp && tar cf - * | xz $(XZ_OPT) > /install/cdrom/distro.img && rm -rf *
75
76 # Other files
77 touch /install/cdrom/$(SNAME)-$(VERSION)-core$(CORE).media
78 sed 's/VERSION/$(VERSION)/' $(DIR_SRC)/config/cdrom/README.txt > /install/cdrom/README.txt
79 cp $(DIR_SRC)/doc/COPYING /install/cdrom/
80 cp $(DIR_SRC)/doc/{ChangeLog,packages-list.txt} /install/cdrom/doc
81
82 # Make the ISO
83 mkdir -p /install/cdrom/boot/isolinux
84 dd if=/dev/zero bs=1k count=2 > /install/cdrom/boot/isolinux/boot.catalog
85 ifneq "$(BUILD_PLATFORM)" "arm"
86 cp /boot/vmlinuz-$(KVER)-ipfire /install/cdrom/boot/isolinux/vmlinuz
87 dracut --force --early-microcode -a "installer" --strip --xz /install/cdrom/boot/isolinux/instroot $(KVER)-ipfire
88 cp $(DIR_SRC)/config/syslinux/boot.png /install/cdrom/boot/isolinux/boot.png
89 cp /usr/lib/memtest86+/memtest.bin /install/cdrom/boot/isolinux/memtest
90 cp /usr/share/ipfire-netboot/ipxe.lkrn /install/cdrom/boot/isolinux/netboot
91 cp /usr/share/syslinux/isolinux.bin /install/cdrom/boot/isolinux/isolinux.bin
92 cp /usr/share/hwdata/pci.ids /install/cdrom/boot/isolinux/pci.ids
93 cp -vf /usr/share/syslinux/*.c32 /install/cdrom/boot/isolinux/
94 sed -e "s/VERSION/$(VERSION) - Core $(CORE)/g" \
95 $(DIR_SRC)/config/syslinux/syslinux.cfg \
96 > /install/cdrom/boot/isolinux/isolinux.cfg
97 endif
98 cd /install/cdrom && find -type f ! -name md5sum.txt | grep -v "./boot" | \
99 xargs md5sum > md5sum.txt
100
101 mkdir -p /install/images
102 ifeq "$(BUILD_PLATFORM)" "arm"
103 cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
104 . > /install/images/$(SNAME)-$(VERSION).$(BUILD_ARCH)-full-core$(CORE).iso
105 else
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).$(BUILD_ARCH)-full-core$(CORE).iso
109 isohybrid /install/images/$(SNAME)-$(VERSION).$(BUILD_ARCH)-full-core$(CORE).iso
110 endif