[Lunar-commits] <lunar-iso> More inteligent stage2 modules

Peter de Ridder peter at lunar-linux.org
Thu Apr 11 00:32:24 CEST 2013


commit 4fc8801dc0e639aaee2f6bc88327bb058eec4804
Author: Peter de Ridder <peter at lunar-linux.org>
Date: Sun, 04 Nov 2012 16:37:08 -0800
URL: https://github.com/lunar-linux/lunar-iso/commit/4fc8801dc0e639aaee2f6bc88327bb058eec4804

More inteligent stage2 modules
---
  Makefile                        | +2/-2     
  conf/modules.stage2             | +1/-0     
  mkfiles/bootstrap.mk            | +1/-1     
  mkfiles/stage2.mk               | +8/-5     
  template/etc/lunar/local/config | +1/-0     
  5 files changed, 13 insertions(+), 8 deletions(-)

--- a/Makefile
+++ b/Makefile
@@ -7,12 +7,12 @@
 #
 
 # need to make this defined during run-time
-ISO_SOURCE = $(shell bash -c "pwd -P")
+ISO_SOURCE:=$(shell bash -c "pwd -P")
 
 # define the kernel arch name
 ###ISO_KARCH=$(shell arch | grep -qw i.86 && echo i386 || arch)
 # and the general arch (i386/i686)
-ISO_ARCH=$(shell arch)
+ISO_ARCH:=$(shell arch)
 
 include $(ISO_SOURCE)/conf/config
 
--- /dev/null
+++ b/conf/modules.stage2
@@ -0,0 +1 @@
+STAGE2_MODULES=kernel-headers glibc gcc binutils
--- a/mkfiles/bootstrap.mk
+++ b/mkfiles/bootstrap.mk
@@ -1,6 +1,6 @@
 .INTERMEDIATE: target bootstrap bootstrap-base bootstrap-lunar
 
-.SECONDARY: $(ISO_TARGET)/.base $(ISO_TARGET)/.modules $(ISO_SOURCE)/cache/.copied
+.SECONDARY: $(ISO_TARGET)/.target $(ISO_TARGET)/.base $(ISO_TARGET)/.modules $(ISO_SOURCE)/cache/.copied
 
 bootstrap: bootstrap-base bootstrap-lunar
 
--- a/mkfiles/stage2.mk
+++ b/mkfiles/stage2.mk
@@ -81,15 +81,18 @@ stage2-moonbase: $(ISO_TARGET)/.stage2-moonbase
 
 
 # build all the require modules for the iso
-$(ISO_SOURCE)/conf/modules.stage2: $(ISO_SOURCE)/spool/moonbase.tar.bz2
-	echo STAGE2_MODULES=`tar -tf $< | sed -n 's@^moonbase/core/\([^/]*/\)*\([^/]\+\)/DETAILS$$@\2 at p'` > $@
+$(ISO_SOURCE)/conf/modules.all: $(ISO_SOURCE)/spool/moonbase.tar.bz2
+	echo ALL_MODULES=`tar -tf $< | sed -n 's@^moonbase/core/\([^/]*/\)*\([^/]\+\)/DETAILS$$@\2 at p'` > $@
 
--include $(ISO_SOURCE)/conf/modules.stage2
+ifneq ($(MAKECMDGOALS),clean)
+-include $(ISO_SOURCE)/conf/modules.all
+endif
+include $(ISO_SOURCE)/conf/modules.stage2
 include $(ISO_SOURCE)/conf/modules.kernel
 
-$(ISO_TARGET)/.stage2: stage2-moonbase stage2-spool $(ISO_SOURCE)/conf/modules.stage2
+$(ISO_TARGET)/.stage2: stage2-moonbase stage2-spool $(ISO_SOURCE)/conf/modules.all
 	@echo stage2-build
-	@yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build lin -c $(filter-out $(KERNEL_MODULES),$(STAGE2_MODULES))
+	@yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build lin -c $(STAGE2_MODULES) `$(ISO_SOURCE)/scripts/chroot-build lsh sort_by_dependency $(filter-out $(KERNEL_MODULES) $(STAGE2_MODULES),$(ALL_MODULES))`
 	@touch $@
 
 stage2-build: $(ISO_TARGET)/.stage2
--- a/template/etc/lunar/local/config
+++ b/template/etc/lunar/local/config
@@ -27,3 +27,4 @@ SAFE_OPTIMIZATIONS=on
  LUNAR_ALIAS_SSL="openssl"
 LUNAR_ALIAS_KERNEL_HEADERS="kernel-headers"
 LUNAR_ALIAS_KMOD="kmod"
+LUNAR_ALIAS_UDEV="udev"




More information about the Lunar-commits mailing list