cdrom: Update /etc/system-release when needed.
[people/teissler/ipfire-2.x.git] / lfs / cdrom
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302 3# IPFire.org - A linux based firewall #
fab611b3 4# Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
70df8302
MT
5# #
6# This program is free software: you can redistribute it and/or modify #
cd1a2927 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
cd1a2927
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
cd1a2927
MT
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 #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
cd1a2927 18# #
cd1a2927
MT
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
0fbb45e9
MT
27VER = ipfire
28
cd1a2927 29THISAPP = cdrom
cd1a2927
MT
30TARGET = $(DIR_INFO)/$(THISAPP)
31
185f92e1
MT
32ifeq "$(MACHINE_TYPE)" "arm"
33 TAR_OPTIONS =
34else
35 TAR_OPTIONS = --lzma
36endif
37
cd1a2927
MT
38###############################################################################
39# Top-level Rules
40###############################################################################
41
cd1a2927
MT
42install : $(TARGET)
43
fd0763dc 44check :
cd1a2927 45
fd0763dc 46download :
cd1a2927 47
fd0763dc 48md5 :
cd1a2927
MT
49
50###############################################################################
51# Installation Details
52###############################################################################
53
54$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
42e4fa80
MT
55 # Update /etc/system-release, because the string might have changed
56 # since stage2 has been executed..
57 echo "$(SYSTEM_RELEASE)" > /etc/system-release
58
cd1a2927 59 rm -rf /install/cdrom /tmp/*
1b453c76 60 mkdir -p /install/cdrom/doc
cd1a2927 61
1b453c76
MT
62 # Clear mtab (prevents .journal problems)
63 rm -vf /etc/mtab
9df6d70f
AF
64 echo > /etc/mtab
65
1b453c76
MT
66 # Create filelist for packaging.
67 BUILDTARGET="$(BUILDTARGET)" MACHINE="$(MACHINE)" KVER="$(KVER)" \
68 $(DIR_SRC)/src/scripts/archive.files \
69 $(DIR_SRC)/config/rootfiles/common \
70 > /tmp/ROOTFILES
71
cd1a2927
MT
72 # Compress root filesystem
73 # Reason for this tar+untar+tar is removing of entries listed two or more in src/ROOTFILES
50f96334 74 tar -c -C / --files-from=/tmp/ROOTFILES \
90c973a6 75 -f /$(SNAME).tar --exclude='#*' --exclude='dev/pts/*' \
5609904b 76 --exclude='proc/*' --exclude='tmp/ROOTFILES'
50f96334 77 rm -f /tmp/ROOTFILES
cd1a2927
MT
78 tar -x -C /tmp -f /$(SNAME).tar
79 rm -f /$(SNAME).tar
069680ac 80 @mkdir /tmp/sys
185f92e1 81 cd /tmp && tar cf /install/cdrom/$(SNAME)-$(VERSION).tlz $(TAR_OPTIONS) * && rm -rf *
03ad5f93 82
cd1a2927 83 # Other files
fab611b3 84 touch /install/cdrom/$(SNAME)-$(VERSION)-core$(CORE).media
03ad5f93 85 sed 's/VERSION/$(VERSION)/' $(DIR_SRC)/config/cdrom/README.txt > /install/cdrom/README.txt
f8031af5
MT
86 cp $(DIR_SRC)/doc/COPYING /install/cdrom/
87 cp $(DIR_SRC)/doc/{ChangeLog,packages-list.txt} /install/cdrom/doc
cd1a2927 88
33634aa8
MT
89 # Configuration
90 mkdir -p /install/cdrom/boot
fd0763dc 91 cp $(DIR_SRC)/config/syslinux/unattended.conf /install/cdrom/boot/unattended.conf
33634aa8 92
0afc6d83 93 # Make the ISO
1b453c76
MT
94 mkdir -p /install/cdrom/boot/isolinux
95 dd if=/dev/zero bs=1k count=2 > /install/cdrom/boot/isolinux/boot.catalog
1b453c76 96ifneq "$(MACHINE_TYPE)" "arm"
bc8fe5ff
AF
97 cp /boot/vmlinuz-$(KVER)-ipfire /install/cdrom/boot/isolinux/vmlinuz
98 cp /install/images/initrd /install/cdrom/boot/isolinux/instroot
df2ac655 99 cp $(DIR_SRC)/config/syslinux/boot.png /install/cdrom/boot/isolinux/boot.png
1b453c76 100 cp /usr/lib/memtest86+/memtest.bin /install/cdrom/boot/isolinux/memtest
89fd5ae0 101 cp /usr/share/ipfire-netboot/ipxe.lkrn /install/cdrom/boot/isolinux/netboot
1b453c76 102 cp /usr/share/syslinux/isolinux.bin /install/cdrom/boot/isolinux/isolinux.bin
df2ac655
MT
103 cp /usr/share/hwdata/pci.ids /install/cdrom/boot/isolinux/pci.ids
104 cp -vf /usr/share/syslinux/*.c32 /install/cdrom/boot/isolinux/
105 sed -e "s/VERSION/$(VERSION) - Core $(CORE)/g" \
106 $(DIR_SRC)/config/syslinux/syslinux.cfg \
107 > /install/cdrom/boot/isolinux/isolinux.cfg
1b453c76 108endif
d7bf4fe7 109 cd /install/cdrom && find -type f ! -name md5sum.txt | grep -v "./boot" | \
1b453c76
MT
110 xargs md5sum > md5sum.txt
111
112ifeq "$(MACHINE_TYPE)" "arm"
bc8fe5ff 113 mkdir -p /install/images
1b453c76 114 cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
3c937429 115 . > /install/images/$(SNAME)-$(VERSION).$(MACHINE)-full-core$(CORE).iso
1b453c76 116else
03ad5f93
MT
117 cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
118 -b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
3c937429 119 -c boot/isolinux/boot.catalog . > /install/images/$(SNAME)-$(VERSION).$(MACHINE)-full-core$(CORE).iso
865f26ac 120 isohybrid /install/images/$(SNAME)-$(VERSION).$(MACHINE)-full-core$(CORE).iso
1b453c76 121endif