2010-03-17 00:38:22 +01:00
|
|
|
ver=$(shell date +%Y.%m.%d)
|
2009-11-25 19:40:07 +01:00
|
|
|
|
|
|
|
WORKDIR=work
|
2010-10-18 04:36:41 +02:00
|
|
|
INSTALL_DIR=arch
|
2011-04-11 15:27:07 +02:00
|
|
|
COMPRESS=xz
|
2009-11-25 19:40:07 +01:00
|
|
|
|
|
|
|
ARCH?=$(shell uname -m)
|
|
|
|
|
|
|
|
PWD=$(shell pwd)
|
|
|
|
NETname=$(PWD)/archlinux-$(ver)-netinstall-$(ARCH).iso
|
|
|
|
COREname=$(PWD)/archlinux-$(ver)-core-$(ARCH).iso
|
|
|
|
|
2009-12-02 01:39:02 +01:00
|
|
|
PACKAGES="$(shell cat packages.$(ARCH))"
|
2009-11-25 19:40:07 +01:00
|
|
|
|
2010-03-17 00:38:22 +01:00
|
|
|
kver_FILE=$(WORKDIR)/root-image/etc/mkinitcpio.d/kernel26.kver
|
|
|
|
|
2009-11-25 19:40:07 +01:00
|
|
|
all: net-iso core-iso
|
|
|
|
|
|
|
|
# Rules for each type of image
|
|
|
|
core-iso: $(COREname)
|
|
|
|
net-iso: $(NETname)
|
|
|
|
|
|
|
|
$(COREname): core-pkgs base-fs
|
2010-12-07 00:07:45 +01:00
|
|
|
mkarchiso -D $(INSTALL_DIR) -c $(COMPRESS) iso $(WORKDIR) $@
|
2009-11-25 19:40:07 +01:00
|
|
|
$(NETname): base-fs
|
2010-12-07 00:07:45 +01:00
|
|
|
mkarchiso -D $(INSTALL_DIR) -c $(COMPRESS) iso $(WORKDIR) $@
|
2009-11-25 19:40:07 +01:00
|
|
|
|
|
|
|
# This is the main rule for make the working filesystem.
|
2009-12-02 01:39:02 +01:00
|
|
|
base-fs: root-image bootfiles initcpio overlay iso-mounts
|
2009-11-25 19:40:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Rules for make the root-image for base filesystem.
|
|
|
|
root-image: $(WORKDIR)/root-image/.arch-chroot
|
|
|
|
$(WORKDIR)/root-image/.arch-chroot:
|
2010-10-18 04:36:41 +02:00
|
|
|
mkarchiso -D $(INSTALL_DIR) -p base create $(WORKDIR)
|
|
|
|
mkarchiso -D $(INSTALL_DIR) -p $(PACKAGES) create $(WORKDIR)
|
2009-11-25 19:40:07 +01:00
|
|
|
|
|
|
|
# Rule for make /boot
|
2009-12-02 01:39:02 +01:00
|
|
|
bootfiles: root-image
|
2010-10-22 00:36:38 +02:00
|
|
|
mkdir -p $(WORKDIR)/iso/$(INSTALL_DIR)/boot/$(ARCH)
|
|
|
|
cp $(WORKDIR)/root-image/boot/System.map26 $(WORKDIR)/iso/$(INSTALL_DIR)/boot/$(ARCH)/
|
|
|
|
cp $(WORKDIR)/root-image/boot/vmlinuz26 $(WORKDIR)/iso/$(INSTALL_DIR)/boot/$(ARCH)/
|
2010-10-18 04:36:41 +02:00
|
|
|
cp $(WORKDIR)/root-image/boot/memtest86+/memtest.bin $(WORKDIR)/iso/$(INSTALL_DIR)/boot/memtest
|
|
|
|
cp $(WORKDIR)/root-image/usr/share/licenses/common/GPL2/license.txt $(WORKDIR)/iso/$(INSTALL_DIR)/boot/memtest.COPYING
|
|
|
|
cp boot-files/splash.png $(WORKDIR)/iso/$(INSTALL_DIR)/boot/
|
|
|
|
mkdir -p $(WORKDIR)/iso/syslinux
|
|
|
|
cp $(WORKDIR)/root-image/usr/lib/syslinux/*.c32 $(WORKDIR)/iso/syslinux/
|
|
|
|
cp $(WORKDIR)/root-image/usr/lib/syslinux/poweroff.com $(WORKDIR)/iso/syslinux/
|
|
|
|
cp $(WORKDIR)/root-image/usr/lib/syslinux/isolinux.bin $(WORKDIR)/iso/syslinux/
|
|
|
|
cp $(WORKDIR)/root-image/usr/lib/syslinux/memdisk $(WORKDIR)/iso/syslinux/
|
|
|
|
cp $(WORKDIR)/root-image/usr/lib/syslinux/pxelinux.0 $(WORKDIR)/iso/syslinux/
|
|
|
|
cp $(WORKDIR)/root-image/usr/lib/syslinux/gpxelinux.0 $(WORKDIR)/iso/syslinux/
|
|
|
|
cp boot-files/syslinux/syslinux.cfg $(WORKDIR)/iso/syslinux/syslinux.cfg
|
2010-07-21 23:54:05 +02:00
|
|
|
# Add pci.ids and modules.alias for hdt
|
2010-10-18 04:36:41 +02:00
|
|
|
mkdir -p $(WORKDIR)/iso/syslinux/hdt/
|
|
|
|
wget -O - http://pciids.sourceforge.net/v2.2/pci.ids | gzip -9 > $(WORKDIR)/iso/syslinux/hdt/pciids.gz
|
|
|
|
cat $(WORKDIR)/root-image/lib/modules/$(shell grep ^ALL_kver $(kver_FILE) | cut -d= -f2)/modules.alias | gzip -9 > $(WORKDIR)/iso/syslinux/hdt/modalias.gz
|
2009-11-25 19:40:07 +01:00
|
|
|
|
|
|
|
# Rules for initcpio images
|
2010-10-22 00:36:38 +02:00
|
|
|
initcpio: $(WORKDIR)/iso/$(INSTALL_DIR)/boot/$(ARCH)/archiso.img
|
|
|
|
$(WORKDIR)/iso/$(INSTALL_DIR)/boot/$(ARCH)/archiso.img: mkinitcpio.conf $(WORKDIR)/root-image/.arch-chroot
|
|
|
|
mkdir -p $(WORKDIR)/iso/$(INSTALL_DIR)/boot/$(ARCH)/
|
2010-03-17 00:38:22 +01:00
|
|
|
mkinitcpio -c ./mkinitcpio.conf -b $(WORKDIR)/root-image -k $(shell grep ^ALL_kver $(kver_FILE) | cut -d= -f2) -g $@
|
2009-11-25 19:40:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
# overlay filesystem
|
|
|
|
overlay:
|
|
|
|
mkdir -p $(WORKDIR)/overlay/etc/pacman.d
|
|
|
|
cp -r overlay $(WORKDIR)/
|
2010-07-03 03:42:28 +02:00
|
|
|
wget -O $(WORKDIR)/overlay/etc/pacman.d/mirrorlist http://www.archlinux.org/mirrorlist/all/
|
2009-11-25 19:40:07 +01:00
|
|
|
sed -i "s/#Server/Server/g" $(WORKDIR)/overlay/etc/pacman.d/mirrorlist
|
|
|
|
|
|
|
|
|
|
|
|
# Rule to process isomounts file.
|
2010-10-18 04:36:41 +02:00
|
|
|
iso-mounts: $(WORKDIR)/iso/$(INSTALL_DIR)/isomounts
|
|
|
|
$(WORKDIR)/iso/$(INSTALL_DIR)/isomounts: isomounts root-image
|
2009-11-25 19:40:07 +01:00
|
|
|
sed "s|@ARCH@|$(ARCH)|g" isomounts > $@
|
|
|
|
|
|
|
|
|
|
|
|
# Rule for make the [core] repo packages
|
|
|
|
core-pkgs:
|
2010-07-02 23:56:09 +02:00
|
|
|
./download-repo.sh core $(WORKDIR)/core-pkgs/src/core/pkg
|
2009-11-25 19:40:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Clean-up all work
|
|
|
|
clean:
|
|
|
|
rm -rf $(WORKDIR) $(NETname) $(COREname)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all core-iso net-iso
|
|
|
|
.PHONY: base-fs
|
2009-12-02 01:39:02 +01:00
|
|
|
.PHONY: root-image bootfiles initcpio overlay iso-mounts
|
2009-11-25 19:40:07 +01:00
|
|
|
.PHONY: core-pkgs
|
|
|
|
.PHONY: clean
|