summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-02-11 13:41:56 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-02-11 13:41:56 +0000
commit78e0ab1faa965cbea9133fcbad7de5af43c2c6a9 (patch)
tree7cb969dfdfd380af06719a55baed24591c36030d
parent0c3be1aed6f3c4bcb8e0681567ec1e9518cdf811 (diff)
downloadabuild-78e0ab1faa965cbea9133fcbad7de5af43c2c6a9.tar.gz
abuild-78e0ab1faa965cbea9133fcbad7de5af43c2c6a9.tar.bz2
abuild-78e0ab1faa965cbea9133fcbad7de5af43c2c6a9.tar.xz
abuild-78e0ab1faa965cbea9133fcbad7de5af43c2c6a9.zip
alpine.mk: initial support for other kernel flavors
-rwxr-xr-xalpine.mk26
1 files changed, 19 insertions, 7 deletions
diff --git a/alpine.mk b/alpine.mk
index 7fad019..2c39f83 100755
--- a/alpine.mk
+++ b/alpine.mk
@@ -14,8 +14,10 @@ ISO_DIR := $(DESTDIR)/isofs
find_apk = $(firstword $(wildcard $(addprefix $(APKDIRS),$(1)-[0-9]*.apk)))
-KERNEL_APK := $(call find_apk,linux-grsec)
-MODULE_APK := $(wildcard $(subst /linux-grsec-,/linux-grsec-mod-,$(KERNEL_APK)))
+KERNEL_FLAVOR ?= linux-grsec
+KERNEL_NAME := $(subst linux-,,$(KERNEL_FLAVOR))
+KERNEL_APK := $(call find_apk,$(KERNEL_FLAVOR))
+MODULE_APK := $(wildcard $(subst /$(KERNEL_FLAVOR)-,/$(KERNEL_FLAVOR)-mod-,$(KERNEL_APK)))
KERNEL := $(word 3,$(subst -, ,$(notdir $(KERNEL_APK))))-$(word 2,$(subst -, ,$(notdir $(KERNEL_APK))))
ALPINEBASELAYOUT_APK := $(call find_apk,alpine-baselayout)
@@ -37,6 +39,8 @@ help:
@echo
@echo "Type 'make' to build $(ISO)"
@echo
+ @echo "kernel: $(KERNEL_NAME)"
+ @echo
@echo "I will use the following sources files:"
@echo " 1. $(notdir $(KERNEL_APK)) (looks like $(KERNEL))"
@echo " 2. $(notdir $(MODULE_APK))"
@@ -56,6 +60,13 @@ clean:
$(ISO_DIR)
#
+# Repos
+#
+APORTS_DIR :=
+REPOS_DIR := $(ISO_DIR)/packages
+REPOS_DIRSTAMP := $(DESTDIR)/stamp.repos
+
+#
# Modloop
#
MODLOOP := $(ISO_DIR)/boot/modloop.cmg
@@ -164,12 +175,12 @@ $(ISOLINUX_CFG):
@mkdir -p $(dir $(ISOLINUX_BIN))
@echo "timeout 20" >$(ISOLINUX_CFG)
@echo "prompt 1" >>$(ISOLINUX_CFG)
- @echo "default linux" >>$(ISOLINUX_CFG)
- @echo "label linux" >>$(ISOLINUX_CFG)
- @echo " kernel /boot/vmlinuz" >>$(ISOLINUX_CFG)
+ @echo "default $(KERNEL_NAME)" >>$(ISOLINUX_CFG)
+ @echo "label $(KERNEL_NAME)" >>$(ISOLINUX_CFG)
+ @echo " kernel /boot/$(KERNAL_NAME)" >>$(ISOLINUX_CFG)
@echo " append initrd=/boot/initramfs.gz alpine_dev=cdrom modules=floppy quiet" >>$(ISOLINUX_CFG)
-ISO_KERNEL := $(ISO_DIR)/boot/vmlinuz
+ISO_KERNEL := $(ISO_DIR)/boot/$(KERNEL_NAME)
ISO_APKS := $(ISO_DIR)/apks
ISO_APKINDEX := $(ISO_APKS)/APK_INDEX.gz
@@ -185,7 +196,8 @@ $(ISO_APKS): $(SOURCE_APKS)
$(ISO_KERNEL): $(KERNEL_APK)
@echo "==> iso: install kernel $(KERNEL)"
@mkdir -p $(dir $(ISO_KERNEL))
- @tar -C $(ISO_DIR) -xzf $(KERNEL_APK) boot/vmlinuz boot/System.map
+ @tar -C $(ISO_DIR) -xzf $(KERNEL_APK)
+ @rm -f $(ISO_DIR)/.[A-Z]*
@touch $(ISO_KERNEL)
$(ISO): $(MODLOOP) $(INITFS) $(ISOLINUX_CFG) $(ISOLINUX_BIN) $(ISO_KERNEL) $(ISO_APKS)