]> git.ipfire.org Git - people/arne_f/ipfire-2.x.git/commitdiff
linux: Simplify compiling and installing the kernel
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 5 Jul 2018 22:27:24 +0000 (23:27 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Jul 2018 13:02:47 +0000 (14:02 +0100)
There was loads of duplicated code which could have been
made shorter by adding one variable.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/linux

index 4355daa9f7814f9628f6e61d4ea055c5aaee6f08..f4700859cf08751869d2aefed22abd552f84f969 100644 (file)
--- a/lfs/linux
+++ b/lfs/linux
@@ -37,16 +37,22 @@ CXXFLAGS   =
 PAK_VER    = 75
 DEPS      = ""
 
+KERNEL_ARCH   = $(BUILD_ARCH)
+KERNEL_TARGET = bzImage
+HEADERS_ARCH  = $(BUILD_PLATFORM)
+
 ifeq "$(BUILD_ARCH)" "i586"
        KERNEL_ARCH = i386
-else
-       KERNEL_ARCH = $(BUILD_ARCH)
 endif
 
 ifeq "$(BUILD_ARCH)" "aarch64"
        HEADERS_ARCH = arm64
-else
-       HEADERS_ARCH = $(BUILD_PLATFORM)
+       KERNEL_ARCH  = arm64
+       KERNEL_TARGET = Image
+endif
+
+ifeq "$(BUILD_ARCH)" "armv5tel"
+       KERNEL_TARGET = zImage
 endif
 
 VERSUFIX=ipfire$(KCFG)
@@ -171,26 +177,11 @@ else
        cd $(DIR_APP) && make clean
        cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ -$(VERSUFIX)/' Makefile
 
-ifeq "$(KCFG)" "-kirkwood"
-       cd $(DIR_APP) && make $(MAKETUNING) zImage modules
-       cd $(DIR_APP) && cp -v arch/arm/boot/zImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
-#      cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/uImage-$(VERSUFIX)
-else
-ifeq "$(KCFG)" "-multi"
-ifeq "$(BUILD_ARCH)" "armv5tel"
-       cd $(DIR_APP) && make $(MAKETUNING) zImage modules
-       cd $(DIR_APP) && cp -v arch/arm/boot/zImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
-endif
-ifeq "$(BUILD_ARCH)" "aarch64"
-       cd $(DIR_APP) && make $(MAKETUNING) Image modules
-       cd $(DIR_APP) && cp -v arch/arm64/boot/Image /boot/vmlinuz-$(VER)-$(VERSUFIX)
-endif
-else
-       cd $(DIR_APP) && make $(MAKETUNING) bzImage modules
-       cd $(DIR_APP) && cp -v arch/$(KERNEL_ARCH)/boot/bzImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
-endif
-endif
+       # Build the kernel
+       cd $(DIR_APP) && make $(MAKETUNING) $(KERNEL_TARGET) modules
 
+       # Install the kernel
+       cd $(DIR_APP) && cp -v arch/$(KERNEL_ARCH)/boot/$(KERNEL_TARGET) /boot/vmlinuz-$(VER)-$(VERSUFIX)
        cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
        cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX)
        cd $(DIR_APP) && make $(MAKETUNING) modules_install