diff options
author | Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> | 2009-11-19 04:34:59 -0300 |
---|---|---|
committer | Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> | 2009-11-19 23:02:46 -0300 |
commit | 23b12f0dde504a61c76a60180b476e6fdcd01ddd (patch) | |
tree | 325ec40f470bfbd3f9b6193b58f45bf616f90b10 /configs/install-iso | |
parent | 0da2b87966039b419df0b9bb8d83ae696ac1436d (diff) | |
download | archiso32-23b12f0dde504a61c76a60180b476e6fdcd01ddd.tar.xz |
Initial rewrite of install-iso/Makefile to avoid rebuilds!
Rewrite the Makefile to avoid rebuild of squashfs images,
base filesystem, and redownload of packages for make the core-pkgs.
For now (what is tested): type make and all images will be created
in < 4 minutes (under tmpfs on Athlon 64 X2 5200+ 4GB)
419489280 Nov 19 05:32 archlinux-2009.11-core-i686.img
394309632 Nov 19 05:32 archlinux-2009.11-core-i686.iso
189181440 Nov 19 05:31 archlinux-2009.11-netinstall-i686.img
171581440 Nov 19 05:31 archlinux-2009.11-netinstall-i686.iso
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Diffstat (limited to 'configs/install-iso')
-rw-r--r-- | configs/install-iso/Makefile | 97 |
1 files changed, 59 insertions, 38 deletions
diff --git a/configs/install-iso/Makefile b/configs/install-iso/Makefile index b0d18bc..0dbdf33 100644 --- a/configs/install-iso/Makefile +++ b/configs/install-iso/Makefile @@ -1,69 +1,90 @@ -ver=2009.08 -kver=2.6.30-ARCH +ver=2009.11 +kver=2.6.31-ARCH WORKDIR=work -ARCH?=`uname -m` +ARCH?=$(shell uname -m) BOOTLOADER?=grub-gfx -PWD:=`pwd` -NETname:=$(PWD)/archlinux-$(ver)-netinstall-$(ARCH) -COREname:=$(PWD)/archlinux-$(ver)-core-$(ARCH) +PWD=$(shell pwd) +NETname=$(PWD)/archlinux-$(ver)-netinstall-$(ARCH) +COREname=$(PWD)/archlinux-$(ver)-core-$(ARCH) PACKAGES="$(shell cat packages.$(ARCH)) $(BOOTLOADER)" -all: net-iso net-usb core-iso core-usb -all-iso: net-iso core-iso -all-usb: net-usb core-usb +all: all-net all-core +all-iso: net-iso core-iso +all-usb: net-usb core-usb all-net: net-iso net-usb all-core: core-iso core-usb -core-usb: core-pkgs overlay $(BOOTLOADER) - mkarchiso -f -p $(BOOTLOADER) usb $(WORKDIR) $(COREname).img +net-iso: $(NETname).iso +net-usb: $(NETname).img +core-iso: $(COREname).iso +core-usb: $(COREname).img + +# Rules for each type of image +$(COREname).iso: core-pkgs base-fs $(BOOTLOADER) + mkarchiso -p $(BOOTLOADER) iso $(WORKDIR) $@ +$(COREname).img: core-pkgs base-fs $(BOOTLOADER) + mkarchiso -p $(BOOTLOADER) usb $(WORKDIR) $@ +$(NETname).iso: base-fs $(BOOTLOADER) + mkarchiso -p $(BOOTLOADER) iso $(WORKDIR) $@ +$(NETname).img: base-fs $(BOOTLOADER) + mkarchiso -p $(BOOTLOADER) usb $(WORKDIR) $@ + +base-fs: boot-files initcpio overlay iso-mounts +# Rule for make /boot +boot-files: root-image + 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/ -core-iso: core-pkgs overlay $(BOOTLOADER) - mkarchiso -f -p $(BOOTLOADER) iso $(WORKDIR) $(COREname).iso +# Rule to process isomounts file. +iso-mounts: $(WORKDIR)/isomounts +$(WORKDIR)/isomounts: isomounts root-image + sed "s|@ARCH@|$(ARCH)|g" $< > $@ -net-usb: overlay $(BOOTLOADER) - mkarchiso -f -p $(BOOTLOADER) usb $(WORKDIR) $(NETname).img +# 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) -net-iso: overlay $(BOOTLOADER) - mkarchiso -f -p $(BOOTLOADER) iso $(WORKDIR) $(NETname).iso +# 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 $@ -overlay: base-iso +# overlay filesystem +overlay: cp -r overlay $(WORKDIR)/ if [ ! -d $(WORKDIR)/overlay/etc/pacman.d ]; then \ mkdir -m755 $(WORKDIR)/overlay/etc/pacman.d; \ fi wget -O $(WORKDIR)/overlay/etc/pacman.d/mirrorlist http://www.archlinux.org/mirrorlist/$(ARCH)/all/ - sed -i "s/#Server/Server/g" "$(WORKDIR)/overlay/etc/pacman.d/mirrorlist" + sed -i "s/#Server/Server/g" $(WORKDIR)/overlay/etc/pacman.d/mirrorlist -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 $(WORKDIR)/root-image/usr/share/licenses/common/GPL2/license.txt $(WORKDIR)/iso/boot/memtest86+/memtest.bin.COPYING - 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 - -core-pkgs: base-iso - mkdir $(WORKDIR)/core-pkgs/ - ./download-repo.sh core "$(WORKDIR)/core-pkgs" +# Rule for make the core repo packages +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-up all work clean: - rm -rf $(WORKDIR) *.img.part1 $(NETname).img $(NETname).iso $(COREname).img $(COREname).iso + 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 |