1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
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. #
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. #
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/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
30 TARGET = $(DIR_INFO)/$(THISAPP)
32 ###############################################################################
34 ###############################################################################
44 ###############################################################################
45 # Installation Details
46 ###############################################################################
47 IMGfdd := /install/images/$(SNAME)-$(VERSION)-install-usb-fdd.$(MACHINE)-$(ED)-core$(CORE).img
48 IMGhdd := /install/images/$(SNAME)-$(VERSION)-install-usb-hdd.$(MACHINE)-$(ED)-core$(CORE).img
49 IMGfs := /install/images/fs
58 mkdosfs -n IPFIRE -F 16 -I $$IMAGE && \
59 for i in /0 `seq 0 7`; do \
60 [ -e /dev/loop$${i} ] || continue; \
61 if (! losetup /dev/loop$${i} >/dev/null 2>&1 ); then \
62 LOOPDEV="/dev/loop$${i}"; \
66 losetup $$LOOPDEV $$IMAGE && \
67 mount -t vfat $$LOOPDEV /install/mnt && \
68 cp -fR /install/cdrom/* /install/mnt && \
69 mv /install/mnt/boot/isolinux/{instroot,vmlinuz,*\.msg,memtest} /install/mnt && \
70 rm -rf /install/mnt/boot && \
71 cp $(DIR_SRC)/config/syslinux/syslinux.cfg /install/mnt/syslinux.cfg && \
72 umount /install/mnt && \
73 losetup -d $$LOOPDEV && \
77 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
79 # usb-fdd superfloppy (partitionless)
80 # compute size +32 blocks for bootsector/fat/etc...
81 dd bs=1024 count=$$((`du -k -s /install/cdrom | awk '{print $$1}'` + 2048 )) \
84 IMAGE=$(IMGfdd); $(COPY_TO_IMG)
86 # Partitionned images : make a file system bigger than iso size
87 # that fit on 128MB key to let free space available
88 # on the unique partition. Image will be compressed later
89 dd bs=1k if=/dev/zero of=$(IMGfs) count=$(DISKSIZE)
90 IMAGE=$(IMGfs); $(COPY_TO_IMG)
92 # usb-hdd (64 heads, 32 sectors geometry, on a partition 1)
93 # use 64 heads as 256 does not work on Award bios (Asus A7V8X-X Gilles)
94 # use 32 sectors a minima or device is not recognised as hard disk (Frank)
95 # add 32 to IMGfs as first partition start at 32
96 COUNT=$$((`du -k -s $(IMGfs) | awk '{print $$1}'` + 32 )); \
97 dd bs=1k if=/dev/zero of=$(IMGhdd) count=$$COUNT
98 # write mbr before partitioning save a 'not msdos fs' warning from sfdisk
99 /usr/local/sbin/install-mbr -f $(IMGhdd)
100 echo -e "0,,6,*\n;\n;\n;" | sfdisk -qLD -H 64 -S 32 $(IMGhdd)
101 # copy the entire partition, make the fs and dd back
102 dd if=$(IMGfs) of=$(IMGhdd) bs=512 seek=32
104 gzip -f9 $(IMGfdd) $(IMGhdd)
105 rm -rf $$LFS/tmp/* $(IMGfs)