[Lunar-commits] <lunar-iso> Split the module lists to sepperate files

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


commit fe2a60680f0b94e0e7744408acf48d608521e551
Author: Peter de Ridder <peter at lunar-linux.org>
Date: Sun, 04 Nov 2012 02:54:54 -0800
URL: https://github.com/lunar-linux/lunar-iso/commit/fe2a60680f0b94e0e7744408acf48d608521e551

Split the module lists to sepperate files
---
  Makefile               | +1/-1     
  conf/modules.kernel    | +1/-0     
  conf/modules.stage1    | +1/-0     
  conf/modules.toolchain | +1/-0     
  mkfiles/bootstrap.mk   | +11/-2    
  mkfiles/download.mk    | +2/-3     
  mkfiles/kernel.mk      | +3/-3     
  mkfiles/stage1.mk      | +2/-2     
  mkfiles/stage2.mk      | +7/-4     
  9 files changed, 29 insertions(+), 15 deletions(-)

--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ ISO_SOURCE = $(shell bash -c "pwd -P")
 # and the general arch (i386/i686)
 ISO_ARCH=$(shell arch)
 
-include conf/config
+include $(ISO_SOURCE)/conf/config
 
 ###ISO_KSUFFIX = $(shell if echo $(ISO_KVER) | grep -q "^2\.6\." ; then echo 2.6 ; else echo 2.4 ; fi ;)
 
--- /dev/null
+++ b/conf/modules.kernel
@@ -0,0 +1 @@
+KERNEL_MODULES=linux
--- /dev/null
+++ b/conf/modules.stage1
@@ -0,0 +1 @@
+STAGE1_MODULES=acl attr bash binutils bzip2 coreutils cracklib dialog diffutils e2fsprogs file findutils gawk gcc glibc glib-2 gmp grep gzip installwatch kernel-headers less libcap libffi libmpc lunar make mpfr ncurses net-tools patch pcre perl procps readline sed shadow tar util-linux wget xz zlib
--- /dev/null
+++ b/conf/modules.toolchain
@@ -0,0 +1 @@
+TOOLCHAIN_MODULES=kernel-headers glibc binutils gcc binutils glibc
--- a/mkfiles/bootstrap.mk
+++ b/mkfiles/bootstrap.mk
@@ -1,12 +1,21 @@
-.INTERMEDIATE: bootstrap bootstrap-base bootstrap-lunar
+.INTERMEDIATE: target bootstrap bootstrap-base bootstrap-lunar
 
 .SECONDARY: $(ISO_TARGET)/.base $(ISO_TARGET)/.modules $(ISO_SOURCE)/cache/.copied
 
 bootstrap: bootstrap-base bootstrap-lunar
 
 
+# this rule is shared with the download
+$(ISO_TARGET)/.target:
+	@rm -rf $(ISO_TARGET)
+	@mkdir -p $(ISO_TARGET)
+	@touch $@
+
+target: $(ISO_TARGET)/.target
+
+
 # fill the target with the base file required
-$(ISO_TARGET)/.base:
+$(ISO_TARGET)/.base: target
 	@echo bootstrap-base
 	@mkdir -p $(ISO_TARGET)/{boot,bin,dev,etc,lib,mnt,proc,root,run,sbin,sys,tmp,usr,var} $(ISO_TARGET)/run/lock $(ISO_TARGET)/usr/{bin,include,lib,libexec,sbin,src,share} $(ISO_TARGET)/var/{cache,empty,lib,log,spool,state,tmp}
 	@ln -sf lib $(ISO_TARGET)/lib32
--- a/mkfiles/download.mk
+++ b/mkfiles/download.mk
@@ -11,15 +11,14 @@ $(ISO_SOURCE)/spool/moonbase.tar.bz2:
 	@mkdir -p $(ISO_SOURCE)/spool
 	@wget -O $@ "`lsh eval echo '$$MOONBASE_URL'`/moonbase.tar.bz2" \
 	  || { rm $@ ; exit 1 ; }
-	@touch $@
 
 
 # note: this installs an empty installed packages list
-$(ISO_TARGET)/.install-moonbase: $(ISO_SOURCE)/spool/moonbase.tar.bz2
+$(ISO_TARGET)/.install-moonbase: $(ISO_SOURCE)/spool/moonbase.tar.bz2 target
 	@echo install-moonbase
 	@mkdir -p $(ISO_TARGET)/var/lib/lunar/moonbase
 	@rm -r $(ISO_TARGET)/var/lib/lunar/moonbase
-	@tar -xjf $(ISO_SOURCE)/spool/moonbase.tar.bz2 -C $(ISO_TARGET)/var/lib/lunar moonbase/core moonbase/aliases
+	@tar -xjf $< -C $(ISO_TARGET)/var/lib/lunar moonbase/core moonbase/aliases
 	@mkdir -p $(ISO_TARGET)/var/lib/lunar/moonbase/zlocal
 	@mkdir -p $(ISO_TARGET)/var/state/lunar/moonbase
 	@touch $(ISO_TARGET)/var/state/lunar/{packages,depends}{,.backup}
--- a/mkfiles/kernel.mk
+++ b/mkfiles/kernel.mk
@@ -3,9 +3,9 @@
 kernel: linux
 
 
-$(ISO_TARGET)/var/spool/lunar/linux.tar.bz2: stage2
+$(ISO_TARGET)/var/cache/lunar/linux-$(ISO_BUILD).tar.bz2: stage2
 	cp $(ISO_SOURCE)/kernels/conf/generic $(ISO_TARGET)/etc/lunar/local/.config.current
-	yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build lin linux
+	yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build lin -c linux
 	mv $(ISO_TARGET)/var/cache/lunar/linux-$$($(ISO_SOURCE)/scripts/chroot-build lvu installed linux)-$(ISO_BUILD).tar.bz2 $@
 
-linux: $(ISO_TARGET)/var/spool/lunar/linux.tar.bz2
+linux: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_BUILD).tar.bz2
--- a/mkfiles/stage1.mk
+++ b/mkfiles/stage1.mk
@@ -27,7 +27,7 @@ stage1-moonbase: $(ISO_TARGET)/.stage1-moonbase
 
 
 # first build sequence to get the toolchain installed properly
-TOOLCHAIN_MODULES=kernel-headers glibc binutils gcc binutils glibc
+include $(ISO_SOURCE)/conf/modules.toolchain
 
 $(ISO_TARGET)/.stage1-toolchain: stage1-moonbase stage1-spool
 	@echo stage1-toolchain
@@ -38,7 +38,7 @@ stage1-toolchain: $(ISO_TARGET)/.stage1-toolchain
 
 
 # first time build all the require modules for a minimal system
-STAGE1_MODULES=acl attr bash binutils bzip2 coreutils cracklib dialog diffutils e2fsprogs file findutils gawk gcc glibc glib-2 gmp grep gzip installwatch kernel-headers less libcap libffi libmpc lunar make mpfr ncurses net-tools patch pcre perl procps readline sed shadow tar util-linux wget xz zlib
+include $(ISO_SOURCE)/conf/modules.stage1
 
 $(ISO_TARGET)/.stage1: stage1-toolchain
 	@echo stage1-build
--- a/mkfiles/stage2.mk
+++ b/mkfiles/stage2.mk
@@ -81,12 +81,15 @@ stage2-moonbase: $(ISO_TARGET)/.stage2-moonbase
 
 
 # build all the require modules for the iso
-STAGE2_MODULES=kernel-headers glibc gcc binutils pkgconfig xz gettext attr acl gawk sed ncurses readline zlib cracklib libcap util-linux e2fsprogs libffi gmp bzip2 glib-2 wget shadow coreutils net-tools gzip mpfr procps file bash dialog diffutils findutils grep installwatch less tar patch libmpc lunar make
+$(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_TARGET)/.stage2: stage2-moonbase stage2-spool
+-include $(ISO_SOURCE)/conf/modules.stage2
+include $(ISO_SOURCE)/conf/modules.kernel
+
+$(ISO_TARGET)/.stage2: stage2-moonbase stage2-spool $(ISO_SOURCE)/conf/modules.stage2
 	@echo stage2-build
-	#@yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build lin -c kernel-headers glibc gcc binutils
-	@yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build lin -c $(STAGE2_MODULES)
+	@yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build lin -c $(filter-out $(KERNEL_MODULES),$(STAGE2_MODULES))
 	@touch $@
 
 stage2-build: $(ISO_TARGET)/.stage2




More information about the Lunar-commits mailing list