2009-11-19 08:34:59 +01:00
|
|
|
ver=2009.11
|
|
|
|
kver=2.6.31-ARCH
|
2008-10-21 06:41:54 +02:00
|
|
|
|
2008-12-19 05:08:38 +01:00
|
|
|
WORKDIR=work
|
|
|
|
|
2009-11-19 08:34:59 +01:00
|
|
|
ARCH?=$(shell uname -m)
|
2008-12-21 09:20:56 +01:00
|
|
|
BOOTLOADER?=grub-gfx
|
|
|
|
|
2009-11-19 08:34:59 +01:00
|
|
|
PWD=$(shell pwd)
|
|
|
|
NETname=$(PWD)/archlinux-$(ver)-netinstall-$(ARCH)
|
|
|
|
COREname=$(PWD)/archlinux-$(ver)-core-$(ARCH)
|
2008-12-21 09:20:56 +01:00
|
|
|
|
2009-07-24 19:00:46 +02:00
|
|
|
PACKAGES="$(shell cat packages.$(ARCH)) $(BOOTLOADER)"
|
2008-09-07 03:39:35 +02:00
|
|
|
|
2009-11-19 08:34:59 +01:00
|
|
|
all: all-net all-core
|
|
|
|
all-iso: net-iso core-iso
|
|
|
|
all-usb: net-usb core-usb
|
2009-07-26 11:04:25 +02:00
|
|
|
all-net: net-iso net-usb
|
2008-12-23 08:36:38 +01:00
|
|
|
all-core: core-iso core-usb
|
2008-09-07 03:39:35 +02:00
|
|
|
|
2009-11-19 08:34:59 +01:00
|
|
|
# Rules for each type of image
|
2009-11-20 01:25:51 +01:00
|
|
|
core-iso: $(COREname).iso
|
|
|
|
$(COREname).iso: core-pkgs base-fs
|
2009-11-19 08:34:59 +01:00
|
|
|
mkarchiso -p $(BOOTLOADER) iso $(WORKDIR) $@
|
2009-11-20 01:25:51 +01:00
|
|
|
core-usb: $(COREname).img
|
|
|
|
$(COREname).img: core-pkgs base-fs
|
2009-11-19 08:34:59 +01:00
|
|
|
mkarchiso -p $(BOOTLOADER) usb $(WORKDIR) $@
|
2009-11-20 01:25:51 +01:00
|
|
|
net-iso: $(NETname).iso
|
|
|
|
$(NETname).iso: base-fs
|
2009-11-19 08:34:59 +01:00
|
|
|
mkarchiso -p $(BOOTLOADER) iso $(WORKDIR) $@
|
2009-11-20 01:25:51 +01:00
|
|
|
net-usb: $(NETname).img
|
|
|
|
$(NETname).img: base-fs
|
2009-11-19 08:34:59 +01:00
|
|
|
mkarchiso -p $(BOOTLOADER) usb $(WORKDIR) $@
|
|
|
|
|
2009-11-20 01:25:51 +01:00
|
|
|
|
|
|
|
# This is the main rule for make the working filesystem.
|
2009-11-19 08:34:59 +01:00
|
|
|
base-fs: boot-files initcpio overlay iso-mounts
|
2009-11-20 01:25:51 +01:00
|
|
|
|
2009-11-19 08:34:59 +01:00
|
|
|
# Rule for make /boot
|
2009-11-20 01:25:51 +01:00
|
|
|
boot-files: root-image $(BOOTLOADER)
|
2009-11-19 08:34:59 +01:00
|
|
|
cp -r $(WORKDIR)/root-image/boot $(WORKDIR)/iso/
|
|
|
|
cp $(WORKDIR)/root-image/usr/share/licenses/common/GPL2/license.txt $(WORKDIR)/iso/boot/memtest86+/memtest.bin.COPYING
|
|
|
|
cp -r boot-files/* $(WORKDIR)/iso/boot/
|
2008-09-07 03:39:35 +02:00
|
|
|
|
2009-11-19 08:34:59 +01:00
|
|
|
# Rule to process isomounts file.
|
|
|
|
iso-mounts: $(WORKDIR)/isomounts
|
|
|
|
$(WORKDIR)/isomounts: isomounts root-image
|
|
|
|
sed "s|@ARCH@|$(ARCH)|g" $< > $@
|
2008-09-07 03:39:35 +02:00
|
|
|
|
2009-11-19 08:34:59 +01:00
|
|
|
# Rules for make the root-image for base filesystem.
|
|
|
|
root-image: $(WORKDIR)/root-image/.arch-chroot
|
|
|
|
$(WORKDIR)/root-image/.arch-chroot:
|
|
|
|
mkarchiso -p $(PACKAGES) create $(WORKDIR)
|
2008-09-07 03:39:35 +02:00
|
|
|
|
2009-11-19 08:34:59 +01:00
|
|
|
# Rules for initcpio images
|
|
|
|
initcpio: $(WORKDIR)/iso/boot/archiso_ide.img $(WORKDIR)/iso/boot/archiso_pata.img
|
|
|
|
$(WORKDIR)/iso/boot/archiso_ide.img: initcpio-ide root-image
|
|
|
|
mkinitcpio -c ./initcpio-ide -b $(WORKDIR)/root-image -k $(kver) -g $@
|
|
|
|
$(WORKDIR)/iso/boot/archiso_pata.img: initcpio-pata root-image
|
|
|
|
mkinitcpio -c ./initcpio-pata -b $(WORKDIR)/root-image -k $(kver) -g $@
|
2008-09-07 03:39:35 +02:00
|
|
|
|
2009-11-19 08:34:59 +01:00
|
|
|
# overlay filesystem
|
|
|
|
overlay:
|
2009-08-23 18:30:24 +02:00
|
|
|
if [ ! -d $(WORKDIR)/overlay/etc/pacman.d ]; then \
|
2009-11-20 01:25:51 +01:00
|
|
|
mkdir -p -m755 $(WORKDIR)/overlay/etc/pacman.d; \
|
2009-08-23 18:30:24 +02:00
|
|
|
fi
|
2009-11-20 01:25:51 +01:00
|
|
|
cp -r overlay $(WORKDIR)/
|
2009-07-24 19:03:14 +02:00
|
|
|
wget -O $(WORKDIR)/overlay/etc/pacman.d/mirrorlist http://www.archlinux.org/mirrorlist/$(ARCH)/all/
|
2009-11-19 08:34:59 +01:00
|
|
|
sed -i "s/#Server/Server/g" $(WORKDIR)/overlay/etc/pacman.d/mirrorlist
|
2008-09-07 03:39:35 +02:00
|
|
|
|
2009-11-20 01:25:51 +01:00
|
|
|
# Rule for make the [core] repo packages
|
2009-11-19 08:34:59 +01:00
|
|
|
core-pkgs:
|
|
|
|
./download-repo.sh core $(WORKDIR)/core-pkgs
|
2008-12-21 09:20:56 +01:00
|
|
|
|
|
|
|
# Bootloaders
|
2009-11-20 01:25:51 +01:00
|
|
|
grub-gfx: root-image
|
2008-12-19 09:02:00 +01:00
|
|
|
cp -r $(WORKDIR)/root-image/usr/lib/grub/i386-pc/* $(WORKDIR)/iso/boot/grub
|
2009-11-20 01:25:51 +01:00
|
|
|
grub: root-image
|
2008-12-19 09:02:00 +01:00
|
|
|
cp -r $(WORKDIR)/root-image/usr/lib/grub/i386-pc/* $(WORKDIR)/iso/boot/grub
|
2009-11-20 01:25:51 +01:00
|
|
|
syslinux: root-image
|
2008-12-19 09:02:00 +01:00
|
|
|
cp -r $(WORKDIR)/root-image/usr/lib/syslinux/isolinux.bin $(WORKDIR)/iso/boot/isolinux
|
|
|
|
|
2009-11-19 08:34:59 +01:00
|
|
|
# Clean-up all work
|
2008-09-07 03:39:35 +02:00
|
|
|
clean:
|
2009-11-19 08:34:59 +01:00
|
|
|
rm -rf $(WORKDIR) $(NETname).img $(NETname).iso $(COREname).img $(COREname).iso
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all all-iso all-usb all-net all-core
|
|
|
|
.PHONY: net-iso net-usb core-iso core-usb
|
|
|
|
.PHONY: base-fs boot-files iso-mounts root-image initcpio overlay core-pkgs
|
|
|
|
.PHONY: grub-gfx grub syslinux
|
|
|
|
.PHONY: clean
|