2009-01-07 13:55:26 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
2009-09-11 14:25:14 +00:00
|
|
|
PROFILE ?= alpine
|
|
|
|
|
|
|
|
-include $(PROFILE).conf.mk
|
2009-01-28 14:59:15 +00:00
|
|
|
|
2009-01-28 17:21:07 +00:00
|
|
|
BUILD_DATE := $(shell date +%y%m%d)
|
|
|
|
ALPINE_RELEASE ?= $(BUILD_DATE)
|
|
|
|
ALPINE_NAME ?= alpine-test
|
2009-10-21 14:17:00 +00:00
|
|
|
ALPINE_ARCH := x86
|
2009-09-11 14:25:14 +00:00
|
|
|
DESTDIR ?= $(shell pwd)/isotmp.$(PROFILE)
|
2009-06-02 11:13:35 +00:00
|
|
|
|
2009-09-03 12:35:27 +00:00
|
|
|
MKCRAMFS = mkcramfs
|
2009-03-13 12:01:45 +00:00
|
|
|
SUDO = sudo
|
|
|
|
|
2009-02-18 12:48:22 +00:00
|
|
|
ISO ?= $(ALPINE_NAME)-$(ALPINE_RELEASE)-$(ALPINE_ARCH).iso
|
2009-01-28 17:21:07 +00:00
|
|
|
ISO_LINK ?= $(ALPINE_NAME).iso
|
2009-01-07 13:55:26 +00:00
|
|
|
ISO_DIR := $(DESTDIR)/isofs
|
2009-06-02 11:13:35 +00:00
|
|
|
ISO_PKGDIR := $(ISO_DIR)/apks
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-09-11 14:25:14 +00:00
|
|
|
APKS ?= $(shell sed 's/\#.*//; s/\*/\\*/g' $(PROFILE).packages)
|
|
|
|
|
2009-09-03 09:41:30 +00:00
|
|
|
APK_OPTS := $(addprefix --repository ,$(APK_REPOS)) --keys-dir /etc/apk/keys
|
2009-06-15 06:28:50 +00:00
|
|
|
|
|
|
|
find_apk_ver = $(shell apk search $(APK_OPTS) $(1) | sort | uniq)
|
2009-06-02 11:13:35 +00:00
|
|
|
find_apk_file = $(addsuffix .apk,$(call find_apk_ver,$(1)))
|
|
|
|
find_apk = $(addprefix $(ISO_PKGDIR)/,$(call find_apk_file,$(1)))
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-07-06 12:16:14 +00:00
|
|
|
# get apk does not support wildcards
|
|
|
|
get_apk = $(addsuffix .apk,$(shell apk fetch --simulate $(APK_OPTS) $(1) 2>&1 | sed 's:^Downloading :$(ISO_PKGDIR)/:'))
|
|
|
|
|
2009-02-11 14:47:19 +00:00
|
|
|
KERNEL_FLAVOR ?= grsec
|
|
|
|
KERNEL_PKGNAME ?= linux-$(KERNEL_FLAVOR)
|
2009-02-11 16:02:19 +00:00
|
|
|
KERNEL_NAME := $(KERNEL_FLAVOR)
|
2009-07-06 12:16:14 +00:00
|
|
|
KERNEL_APK := $(call get_apk,$(KERNEL_PKGNAME))
|
2009-02-20 09:45:24 +00:00
|
|
|
|
2009-01-07 13:55:26 +00:00
|
|
|
KERNEL := $(word 3,$(subst -, ,$(notdir $(KERNEL_APK))))-$(word 2,$(subst -, ,$(notdir $(KERNEL_APK))))
|
|
|
|
|
|
|
|
ALPINEBASELAYOUT_APK := $(call find_apk,alpine-baselayout)
|
2009-07-06 12:16:14 +00:00
|
|
|
UCLIBC_APK := $(call get_apk,uclibc)
|
|
|
|
BUSYBOX_APK := $(call get_apk,busybox)
|
|
|
|
APK_TOOLS_APK := $(call get_apk,apk-tools)
|
|
|
|
STRACE_APK := $(call get_apk,strace)
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-06-02 11:13:35 +00:00
|
|
|
APKS_FILTER ?= | grep -v -- '-dev$$' | grep -v 'sources'
|
|
|
|
|
|
|
|
APKS ?= '*'
|
|
|
|
APK_FILES := $(call find_apk,$(APKS))
|
2009-05-27 13:04:06 +00:00
|
|
|
|
2009-03-13 16:14:00 +00:00
|
|
|
all: isofs
|
2009-01-07 13:55:26 +00:00
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "Alpine ISO builder"
|
|
|
|
@echo
|
2009-03-13 16:14:00 +00:00
|
|
|
@echo "Type 'make iso' to build $(ISO)"
|
2009-01-07 13:55:26 +00:00
|
|
|
@echo
|
|
|
|
@echo "I will use the following sources files:"
|
|
|
|
@echo " 1. $(notdir $(KERNEL_APK)) (looks like $(KERNEL))"
|
2009-07-06 12:16:14 +00:00
|
|
|
@echo " 2. $(notdir $(MOD_APKS))"
|
2009-01-07 13:55:26 +00:00
|
|
|
@echo " 3. $(notdir $(ALPINEBASELAYOUT_APK))"
|
|
|
|
@echo " 4. $(notdir $(UCLIBC_APK))"
|
|
|
|
@echo " 5. $(notdir $(BUSYBOX_APK))"
|
|
|
|
ifeq ($(APK_BIN),)
|
|
|
|
@echo " 6. $(notdir $(APK_TOOLS_APK))"
|
|
|
|
else
|
|
|
|
@echo " 6. $(APK_BIN)"
|
|
|
|
endif
|
|
|
|
@echo
|
2009-02-11 14:47:19 +00:00
|
|
|
@echo "ALPINE_NAME: $(ALPINE_NAME)"
|
|
|
|
@echo "ALPINE_RELEASE: $(ALPINE_RELEASE)"
|
|
|
|
@echo "KERNEL_FLAVOR: $(KERNEL_FLAVOR)"
|
2009-02-11 16:02:19 +00:00
|
|
|
@echo "KERNEL: $(KERNEL)"
|
2009-02-11 14:47:19 +00:00
|
|
|
@echo
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-01-15 15:47:26 +00:00
|
|
|
clean:
|
|
|
|
rm -rf $(MODLOOP) $(MODLOOP_DIR) $(MODLOOP_DIRSTAMP) \
|
|
|
|
$(INITFS) $(INITFS_DIRSTAMP) $(INITFS_DIR) \
|
2009-06-03 08:13:16 +00:00
|
|
|
$(ISO_DIR) $(ISO_REPOS_DIRSTAMP)
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-02-11 16:02:19 +00:00
|
|
|
|
2009-06-02 11:13:35 +00:00
|
|
|
$(APK_FILES):
|
|
|
|
@mkdir -p "$(dir $@)";\
|
2009-07-06 12:16:14 +00:00
|
|
|
p="$(notdir $(basename $@))";\
|
|
|
|
apk fetch $(APK_REPO) -R -v -o "$(dir $@)" $${p%-[0-9]*}
|
|
|
|
# apk fetch $(APK_OPTS) -R -v -o "$(dir $@)" \
|
|
|
|
# `apk search -q $(APK_OPTS) $(APKS) | sort | uniq`
|
2009-02-20 09:45:24 +00:00
|
|
|
|
2009-01-07 13:55:26 +00:00
|
|
|
#
|
|
|
|
# Modloop
|
|
|
|
#
|
2009-02-12 07:30:02 +00:00
|
|
|
MODLOOP := $(ISO_DIR)/boot/$(KERNEL_NAME).cmg
|
2009-01-07 13:55:26 +00:00
|
|
|
MODLOOP_DIR := $(DESTDIR)/modloop
|
2009-09-11 14:25:14 +00:00
|
|
|
MODLOOP_KERNELSTAMP := $(DESTDIR)/stamp.modloop.kernel
|
2009-01-07 13:55:26 +00:00
|
|
|
MODLOOP_DIRSTAMP := $(DESTDIR)/stamp.modloop
|
2009-09-11 14:25:14 +00:00
|
|
|
MODLOOP_EXTRA ?= $(addsuffix -$(KERNEL_FLAVOR), dahdi-linux iscsitarget xtables-addons)
|
|
|
|
MODLOOP_PKGS = $(KERNEL_PKGNAME) $(MODLOOP_EXTRA)
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-02-18 12:48:22 +00:00
|
|
|
modloop: $(MODLOOP)
|
|
|
|
|
2009-09-11 14:25:14 +00:00
|
|
|
$(MODLOOP_KERNELSTAMP):
|
2009-09-03 09:41:30 +00:00
|
|
|
@echo "==> modloop: Unpacking kernel modules";
|
2009-01-07 13:55:26 +00:00
|
|
|
@rm -rf $(MODLOOP_DIR)
|
|
|
|
@mkdir -p $(MODLOOP_DIR)/lib/modules/
|
2009-09-03 09:41:30 +00:00
|
|
|
@for i in $(MODLOOP_PKGS); do \
|
|
|
|
apk fetch $(APK_OPTS) --stdout $$i \
|
|
|
|
| tar -C $(MODLOOP_DIR) -xz; \
|
2009-02-20 09:45:24 +00:00
|
|
|
done
|
2009-09-23 11:40:38 +00:00
|
|
|
@cp $(MODLOOP_DIR)/usr/share/kernel/$(KERNEL_FLAVOR)/kernel.release $@
|
2009-09-11 14:25:14 +00:00
|
|
|
|
|
|
|
MODLOOP_KERNEL_RELEASE = $(shell cat $(MODLOOP_KERNELSTAMP))
|
|
|
|
|
|
|
|
$(MODLOOP_DIRSTAMP): $(MODLOOP_KERNELSTAMP)
|
2009-01-07 13:55:26 +00:00
|
|
|
@rm -rf $(addprefix $(MODLOOP_DIR)/lib/modules/*/, source build)
|
2009-09-11 14:25:14 +00:00
|
|
|
@depmod $(MODLOOP_KERNEL_RELEASE) -b $(MODLOOP_DIR)
|
2009-01-07 13:55:26 +00:00
|
|
|
@touch $(MODLOOP_DIRSTAMP)
|
|
|
|
|
|
|
|
$(MODLOOP): $(MODLOOP_DIRSTAMP)
|
|
|
|
@echo "==> modloop: building image $(notdir $(MODLOOP))"
|
|
|
|
@mkdir -p $(dir $(MODLOOP))
|
2009-09-03 12:35:27 +00:00
|
|
|
@$(MKCRAMFS) $(MODLOOP_DIR)/lib $(MODLOOP)
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-09-03 09:41:30 +00:00
|
|
|
clean-modloop:
|
2009-09-11 14:25:14 +00:00
|
|
|
@rm -rf $(MODLOOP_DIR) $(MODLOOP_DIRSTAMP) $(MODLOOP_PKGSTAMP) $(MODLOOP)
|
2009-09-03 09:41:30 +00:00
|
|
|
|
2009-01-07 13:55:26 +00:00
|
|
|
#
|
|
|
|
# Initramfs rules
|
|
|
|
#
|
|
|
|
|
2009-09-23 11:40:38 +00:00
|
|
|
# isolinux cannot handle - in filenames
|
|
|
|
#INITFS_NAME := initramfs-$(MODLOOP_KERNEL_RELEASE)
|
|
|
|
INITFS_NAME := $(KERNEL_FLAVOR).gz
|
|
|
|
INITFS := $(ISO_DIR)/boot/$(INITFS_NAME)
|
2009-01-07 13:55:26 +00:00
|
|
|
|
|
|
|
INITFS_DIR := $(DESTDIR)/initfs
|
2009-09-03 09:41:30 +00:00
|
|
|
INITFS_TMP := $(DESTDIR)/tmp.initfs
|
|
|
|
INITFS_DIRSTAMP := $(DESTDIR)/stamp.initfs
|
2009-09-18 14:16:06 +00:00
|
|
|
INITFS_FEATURES := ata base bootchart cdrom cramfs ext3 floppy raid scsi usb
|
2009-09-03 12:36:20 +00:00
|
|
|
INITFS_PKGS := $(MODLOOP_PKGS) alpine-base acct
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-02-18 12:48:22 +00:00
|
|
|
initfs: $(INITFS)
|
2009-09-03 09:41:30 +00:00
|
|
|
|
|
|
|
$(INITFS_DIRSTAMP):
|
|
|
|
@rm -rf $(INITFS_DIR) $(INITFS_TMP)
|
|
|
|
@mkdir -p $(INITFS_DIR) $(INITFS_TMP)
|
|
|
|
@for i in `apk fetch $(APK_OPTS) --simulate -R $(INITFS_PKGS) 2>&1\
|
|
|
|
| sed 's:^Downloading ::; s:-[0-9].*::' | sort | uniq`; do \
|
|
|
|
apk fetch $(APK_OPTS) --stdout $$i \
|
|
|
|
| tar -C $(INITFS_DIR) -zx || exit 1; \
|
|
|
|
done
|
2009-09-03 14:00:23 +00:00
|
|
|
@cp -r /etc/apk/keys $(INITFS_DIR)/etc/apk/ || true
|
2009-09-03 09:41:30 +00:00
|
|
|
@touch $@
|
|
|
|
|
|
|
|
#$(INITFS): $(shell mkinitfs -F "$(INITFS_FEATURES)" -l $(KERNEL))
|
2009-09-11 14:25:14 +00:00
|
|
|
$(INITFS): $(INITFS_DIRSTAMP) $(MODLOOP_DIRSTAMP)
|
2009-09-03 09:41:30 +00:00
|
|
|
@mkinitfs -F "$(INITFS_FEATURES)" -t $(INITFS_TMP) \
|
2009-09-11 14:25:14 +00:00
|
|
|
-b $(INITFS_DIR) -o $@ $(MODLOOP_KERNEL_RELEASE)
|
2009-09-03 09:41:30 +00:00
|
|
|
|
|
|
|
clean-initfs:
|
|
|
|
@rm -rf $(INITFS) $(INITFS_DIRSTAMP) $(INITFS_DIR)
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-03-13 12:01:45 +00:00
|
|
|
#
|
|
|
|
# Vserver template rules
|
|
|
|
#
|
|
|
|
VSTEMPLATE := $(ISO_DIR)/vs-template.tar.bz2
|
|
|
|
VSTEMPLATE_DIR := $(DESTDIR)/vs-template
|
|
|
|
|
|
|
|
vstemplate: $(VSTEMPLATE)
|
|
|
|
@echo "==> vstemplate: built $(VSTEMPLATE)"
|
|
|
|
|
2009-09-23 11:40:38 +00:00
|
|
|
#must be run as root or in fakeroot
|
2009-03-13 12:01:45 +00:00
|
|
|
$(VSTEMPLATE):
|
2009-09-23 11:40:38 +00:00
|
|
|
@rm -rf "$(VSTEMPLATE_DIR)"
|
|
|
|
@mkdir -p "$(VSTEMPLATE_DIR)"
|
|
|
|
@apk add $(APK_OPTS) --initdb --root $(VSTEMPLATE_DIR) \
|
2009-09-03 09:41:30 +00:00
|
|
|
alpine-base
|
2009-09-23 11:40:38 +00:00
|
|
|
@cd $(VSTEMPLATE_DIR) && tar -jcf $@ *
|
2009-03-13 12:01:45 +00:00
|
|
|
|
2009-01-07 13:55:26 +00:00
|
|
|
#
|
|
|
|
# ISO rules
|
|
|
|
#
|
|
|
|
|
2009-09-23 11:40:38 +00:00
|
|
|
ISOLINUX_DIR := boot/isolinux
|
|
|
|
ISOLINUX := $(ISO_DIR)/$(ISOLINUX_DIR)
|
2009-01-07 13:55:26 +00:00
|
|
|
ISOLINUX_BIN := $(ISOLINUX)/isolinux.bin
|
|
|
|
ISOLINUX_CFG := $(ISOLINUX)/isolinux.cfg
|
2009-03-04 20:13:58 +00:00
|
|
|
SYSLINUX_CFG := $(ISO_DIR)/syslinux.cfg
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-07-06 12:16:14 +00:00
|
|
|
$(ISOLINUX_BIN):
|
2009-01-07 13:55:26 +00:00
|
|
|
@echo "==> iso: install isolinux"
|
|
|
|
@mkdir -p $(dir $(ISOLINUX_BIN))
|
2009-07-06 12:16:14 +00:00
|
|
|
@if ! apk fetch $(APK_REPO) --stdout syslinux | tar -O -zx usr/share/syslinux/isolinux.bin > $@; then \
|
|
|
|
rm -f $@ && exit 1;\
|
|
|
|
fi
|
2009-01-07 13:55:26 +00:00
|
|
|
|
|
|
|
$(ISOLINUX_CFG):
|
|
|
|
@echo "==> iso: configure isolinux"
|
|
|
|
@mkdir -p $(dir $(ISOLINUX_BIN))
|
|
|
|
@echo "timeout 20" >$(ISOLINUX_CFG)
|
|
|
|
@echo "prompt 1" >>$(ISOLINUX_CFG)
|
2009-02-11 13:41:56 +00:00
|
|
|
@echo "default $(KERNEL_NAME)" >>$(ISOLINUX_CFG)
|
|
|
|
@echo "label $(KERNEL_NAME)" >>$(ISOLINUX_CFG)
|
2009-02-11 16:02:19 +00:00
|
|
|
@echo " kernel /boot/$(KERNEL_NAME)" >>$(ISOLINUX_CFG)
|
2009-09-23 11:40:38 +00:00
|
|
|
@echo " append initrd=/boot/$(INITFS_NAME) alpine_dev=cdrom:iso9660 modules=loop,cramfs,sd-mod,usb-storage,floppy quiet" >>$(ISOLINUX_CFG)
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-09-11 14:25:14 +00:00
|
|
|
$(SYSLINUX_CFG): $(MODLOOP_DIRSTAMP)
|
2009-03-04 20:13:58 +00:00
|
|
|
@echo "==> iso: configure syslinux"
|
|
|
|
@echo "timeout 20" >$@
|
|
|
|
@echo "prompt 1" >>$@
|
|
|
|
@echo "default $(KERNEL_NAME)" >>$@
|
|
|
|
@echo "label $(KERNEL_NAME)" >>$@
|
|
|
|
@echo " kernel /boot/$(KERNEL_NAME)" >>$@
|
2009-09-23 11:40:38 +00:00
|
|
|
@echo " append initrd=/boot/$(INITFS_NAME) alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet" >>$@
|
2009-03-04 20:13:58 +00:00
|
|
|
|
2009-09-11 14:25:14 +00:00
|
|
|
clean-syslinux:
|
|
|
|
@rm -f $(SYSLINUX_CFG) $(ISOLINUX_CFG) $(ISOLINUX_BIN)
|
|
|
|
|
2009-02-11 13:41:56 +00:00
|
|
|
ISO_KERNEL := $(ISO_DIR)/boot/$(KERNEL_NAME)
|
2009-03-03 11:05:07 +00:00
|
|
|
ISO_REPOS_DIRSTAMP := $(DESTDIR)/stamp.isorepos
|
2009-03-13 16:14:00 +00:00
|
|
|
ISOFS_DIRSTAMP := $(DESTDIR)/stamp.isofs
|
2009-03-03 11:05:07 +00:00
|
|
|
|
2009-07-27 15:53:05 +00:00
|
|
|
$(ISO_REPOS_DIRSTAMP): $(ISO_PKGDIR)/APKINDEX.tar.gz
|
2009-08-06 11:20:58 +00:00
|
|
|
@touch $(ISO_PKGDIR)/.boot_repository
|
2009-10-21 14:17:00 +00:00
|
|
|
@rm -f $(ISO_PKGDIR)/.SIGN.*
|
2009-03-03 11:05:07 +00:00
|
|
|
@touch $@
|
|
|
|
|
2009-07-27 15:53:05 +00:00
|
|
|
$(ISO_PKGDIR)/APKINDEX.tar.gz: $(APK_FILES)
|
2009-06-02 11:13:35 +00:00
|
|
|
@echo "==> iso: generating repository index"
|
2009-09-03 16:35:58 +00:00
|
|
|
@apk index --description "$(ALPINE_NAME) $(ALPINE_RELEASE)" \
|
|
|
|
-o $@ $(ISO_PKGDIR)/*.apk
|
2009-07-30 09:12:49 +00:00
|
|
|
@abuild-sign $@
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-09-11 14:25:14 +00:00
|
|
|
$(ISO_KERNEL): $(MODLOOP_DIRSTAMP)
|
2009-01-07 13:55:26 +00:00
|
|
|
@echo "==> iso: install kernel $(KERNEL)"
|
|
|
|
@mkdir -p $(dir $(ISO_KERNEL))
|
2009-09-03 09:41:30 +00:00
|
|
|
@apk fetch $(APK_OPTS) --stdout $(KERNEL_PKGNAME) \
|
|
|
|
| tar -C $(ISO_DIR) -xz boot
|
2009-09-11 14:25:14 +00:00
|
|
|
@rm -f $(ISO_DIR)/boot/$(KERNEL_NAME)
|
|
|
|
@ln -s vmlinuz-$(MODLOOP_KERNEL_RELEASE) $@
|
2009-08-05 17:15:20 +00:00
|
|
|
@rm -rf $(ISO_DIR)/.[A-Z]* $(ISO_DIR)/.[a-z]* $(ISO_DIR)/lib
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-03-13 16:14:00 +00:00
|
|
|
$(ISOFS_DIRSTAMP): $(MODLOOP) $(INITFS) $(ISOLINUX_CFG) $(ISOLINUX_BIN) $(ISO_KERNEL) $(ISO_REPOS_DIRSTAMP) $(SYSLINUX_CFG)
|
2009-07-15 09:15:13 +00:00
|
|
|
@echo "$(ALPINE_NAME)-$(ALPINE_RELEASE) $(BUILD_DATE)" \
|
|
|
|
> $(ISO_DIR)/.alpine-release
|
2009-03-13 16:14:00 +00:00
|
|
|
@touch $@
|
|
|
|
|
|
|
|
$(ISO): $(ISOFS_DIRSTAMP)
|
2009-01-07 13:55:26 +00:00
|
|
|
@echo "==> iso: building $(notdir $(ISO))"
|
|
|
|
@genisoimage -o $(ISO) -l -J -R \
|
2009-09-23 11:40:38 +00:00
|
|
|
-b $(ISOLINUX_DIR)/isolinux.bin \
|
|
|
|
-c $(ISOLINUX_DIR)/boot.cat \
|
2009-01-07 13:55:26 +00:00
|
|
|
-no-emul-boot \
|
|
|
|
-boot-load-size 4 \
|
|
|
|
-boot-info-table \
|
|
|
|
-quiet \
|
2009-07-06 12:16:14 +00:00
|
|
|
-follow-links \
|
2009-03-27 15:23:37 +00:00
|
|
|
$(ISO_OPTS) \
|
2009-01-07 13:55:26 +00:00
|
|
|
$(ISO_DIR)
|
2009-01-28 17:21:07 +00:00
|
|
|
@ln -fs $@ $(ISO_LINK)
|
2009-01-07 13:55:26 +00:00
|
|
|
|
2009-03-13 16:14:00 +00:00
|
|
|
isofs: $(ISOFS_DIRSTAMP)
|
2009-02-11 14:47:19 +00:00
|
|
|
iso: $(ISO)
|
2009-03-27 15:23:37 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# SHA1 sum of ISO
|
|
|
|
#
|
2009-05-25 14:33:49 +00:00
|
|
|
ISO_SHA1 := $(ISO).sha1
|
2009-03-27 15:23:37 +00:00
|
|
|
|
2009-05-25 14:33:49 +00:00
|
|
|
$(ISO_SHA1): $(ISO)
|
2009-03-27 15:23:37 +00:00
|
|
|
@echo "==> Generating sha1 sum"
|
|
|
|
@sha1sum $(ISO) > $@ || rm -f $@
|
|
|
|
|
2009-05-25 14:33:49 +00:00
|
|
|
#
|
|
|
|
# USB image
|
|
|
|
#
|
|
|
|
USBIMG := $(ALPINE_NAME)-$(ALPINE_RELEASE)-$(ALPINE_ARCH).img
|
2009-06-03 11:43:58 +00:00
|
|
|
USBIMG_FREE ?= 8192
|
|
|
|
USBIMG_SIZE = $(shell echo $$(( `du -s $(ISO_DIR) | awk '{print $$1}'` + $(USBIMG_FREE) )) )
|
2009-05-25 14:33:49 +00:00
|
|
|
MBRPATH := /usr/share/syslinux/mbr.bin
|
|
|
|
|
|
|
|
$(USBIMG): $(ISOFS_DIRSTAMP)
|
2009-06-03 11:39:26 +00:00
|
|
|
@echo "==> Generating $@"
|
2009-07-15 09:56:53 +00:00
|
|
|
@mformat -C -v 'ALPINE' -c 16 -h 64 -n 32 -i $(USBIMG) \
|
2009-09-03 09:41:30 +00:00
|
|
|
-t $$(($(USBIMG_SIZE) / 1000)) ::
|
2009-06-04 13:05:31 +00:00
|
|
|
@syslinux $(USBIMG)
|
2009-07-15 09:56:53 +00:00
|
|
|
@mcopy -i $(USBIMG) $(ISO_DIR)/* $(ISO_DIR)/.[a-z]* ::
|
|
|
|
@mcopy -i $(USBIMG) /dev/zero ::/zero 2>/dev/null || true
|
|
|
|
@mdel -i $(USBIMG) ::/zero
|
2009-05-25 14:33:49 +00:00
|
|
|
|
|
|
|
USBIMG_SHA1 := $(USBIMG).sha1
|
|
|
|
$(USBIMG_SHA1): $(USBIMG)
|
|
|
|
@echo "==> Generating sha1 sum"
|
|
|
|
@sha1sum $(USBIMG) > $@ || rm -f $@
|
|
|
|
|
2009-06-03 11:34:41 +00:00
|
|
|
$(ALPINE_NAME).img: $(USBIMG)
|
|
|
|
@ln -sf $(USBIMG) $@
|
|
|
|
|
2009-06-04 13:05:31 +00:00
|
|
|
img: $(ALPINE_NAME).img
|
|
|
|
|
2009-08-06 11:44:51 +00:00
|
|
|
sha1: $(ISO_SHA1) $(USBIMG_SHA1)
|
|
|
|
|
|
|
|
release: $(ISO_SHA1)
|
|
|
|
|