summaryrefslogtreecommitdiff
path: root/configs/install-iso/Makefile
blob: 2b6d7f3289f5ff243835b8e51e4da8252c4f3b6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
ver=2009.01-1
kver=2.6.28-ARCH

WORKDIR=work

ARCH?=i686
BOOTLOADER?=grub-gfx

PWD:=`pwd`
FTPname:=$(PWD)/archlinux-$(ver)-ftp-$(ARCH)
COREname:=$(PWD)/archlinux-$(ver)-core-$(ARCH)
FALLBACKname=$(PWD)/archlinux-$(ver)-ftp-$(ARCH)-isolinux

PACKAGES="`cat packages.list` $(BOOTLOADER)"

all: ftp-iso ftp-usb core-iso core-usb fallback
all-iso: ftp-iso core-iso 
all-usb: ftp-usb core-usb 
all-ftp: ftp-iso ftp-usb
all-core: core-iso core-usb

core-usb: core-pkgs overlay $(BOOTLOADER)
	mkarchiso -f -p $(BOOTLOADER) usb $(WORKDIR) $(COREname).img

core-iso: core-pkgs overlay $(BOOTLOADER)
	mkarchiso -f -p $(BOOTLOADER) iso $(WORKDIR) $(COREname).iso

ftp-usb: overlay $(BOOTLOADER)
	mkarchiso -f -p $(BOOTLOADER) usb $(WORKDIR) $(FTPname).img

ftp-iso: overlay $(BOOTLOADER)
	mkarchiso -f -p $(BOOTLOADER) iso $(WORKDIR) $(FTPname).iso

overlay: base-iso
	cp -r overlay $(WORKDIR)/

root-image:
	mkarchiso -p $(PACKAGES) create $(WORKDIR)
	
base-iso: root-image
	mv $(WORKDIR)/root-image/boot $(WORKDIR)/iso/
	cp -r boot-files/* $(WORKDIR)/iso/boot/
	cp isomounts $(WORKDIR)
	sed -i "s|@ARCH@|$(ARCH)|g" "$(WORKDIR)/isomounts"
	
	mkinitcpio -c initcpio-ide -b $(WORKDIR)/root-image -k $(kver) -g $(WORKDIR)/iso/boot/archiso_ide.img
	mkinitcpio -c initcpio-pata -b $(WORKDIR)/root-image -k $(kver) -g $(WORKDIR)/iso/boot/archiso_pata.img

fallback:
	#Build the fallback ISO (isolinux) in a separate workdir
	#root-image
	mkarchiso -p "`cat packages.list` syslinux" create $(WORKDIR)-fallback
	#base-iso
	mv $(WORKDIR)-fallback/root-image/boot $(WORKDIR)-fallback/iso/
	cp -r boot-files/* $(WORKDIR)-fallback/iso/boot/
	#ugh... copied from syslinux rule
	cp -r $(WORKDIR)-fallback/root-image/usr/lib/syslinux/isolinux.bin $(WORKDIR)-fallback/iso/boot/isolinux
	cp isomounts $(WORKDIR)-fallback
	sed -i "s|@ARCH@|$(ARCH)|g" "$(WORKDIR)-fallback/isomounts"
	
	mkinitcpio -c initcpio-ide -b $(WORKDIR)-fallback/root-image -k $(kver) -g $(WORKDIR)-fallback/iso/boot/archiso_ide.img
	mkinitcpio -c initcpio-pata -b $(WORKDIR)-fallback/root-image -k $(kver) -g $(WORKDIR)-fallback/iso/boot/archiso_pata.img
	#overlay
	cp -r overlay $(WORKDIR)-fallback/
	#ftp-iso
	mkarchiso -f -p syslinux iso $(WORKDIR)-fallback $(FALLBACKname).iso

core-pkgs: base-iso
	mkdir $(WORKDIR)/core-pkgs/
	./download-repo.sh core "$(WORKDIR)/core-pkgs"

# Bootloaders
grub-gfx:
	cp -r $(WORKDIR)/root-image/usr/lib/grub/i386-pc/* $(WORKDIR)/iso/boot/grub

grub:
	cp -r $(WORKDIR)/root-image/usr/lib/grub/i386-pc/* $(WORKDIR)/iso/boot/grub

syslinux:
	cp -r $(WORKDIR)/root-image/usr/lib/syslinux/isolinux.bin $(WORKDIR)/iso/boot/isolinux

clean:
	rm -rf $(WORKDIR) $(WORKDIR)-fallback *.img.part1 $(FTPname).img $(FTPname).iso $(COREname).img $(COREname).iso $(FALLBACKname).iso