[Lunar-commits] <lunar-iso> Fixed auto building of stage1 and stage2

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


commit c3c730e652aec4bef88dbc3ee19d368db5ed2343
Author: Peter de Ridder <peter at lunar-linux.org>
Date: Sun, 07 Oct 2012 12:30:39 -0700
URL: https://github.com/lunar-linux/lunar-iso/commit/c3c730e652aec4bef88dbc3ee19d368db5ed2343

Fixed auto building of stage1 and stage2
---
  mkfiles/bootstrap.mk | +1/-1     
  mkfiles/stage1.mk    | +4/-3     
  mkfiles/stage2.mk    | +7/-3     
  3 files changed, 12 insertions(+), 7 deletions(-)

--- a/mkfiles/bootstrap.mk
+++ b/mkfiles/bootstrap.mk
@@ -37,7 +37,7 @@ $(ISO_TARGET)/.modules: $(ISO_SOURCE)/cache/.copied
 	done
 	@mkdir -p $(ISO_TARGET)/var/state/lunar
 	@touch $(ISO_TARGET)/var/state/lunar/packages.backup
-	@grep -w -v -F "`cut -d: -f1 $(ISO_SOURCE)/cache/packages`" $(ISO_TARGET)/var/state/lunar/packages.backup | cat > $(ISO_TARGET)/var/state/lunar/packages
+	@grep -v "`sed 's/^/^/;s/:.*/:/' $(ISO_SOURCE)/cache/packages`" $(ISO_TARGET)/var/state/lunar/packages.backup | cat > $(ISO_TARGET)/var/state/lunar/packages
 	@cat $(ISO_SOURCE)/cache/packages >> $(ISO_TARGET)/var/state/lunar/packages
 	@cp $(ISO_TARGET)/var/state/lunar/packages $(ISO_TARGET)/var/state/lunar/packages.backup
 	@touch $@
--- a/mkfiles/stage1.mk
+++ b/mkfiles/stage1.mk
@@ -29,18 +29,18 @@ stage1-moonbase: $(ISO_TARGET)/.stage1-moonbase
 # first build sequence to get the toolchain installed properly
 $(ISO_TARGET)/.stage1-toolchain: stage1-moonbase stage1-spool
 	@echo stage1-toolchain
-	@yes n | $(ISO_SOURCE)/scripts/chroot-build lin -rc kernel-headers glibc binutils gcc binutils glibc
+	@yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build lin -rc kernel-headers glibc binutils gcc binutils glibc
 	@touch $@
 
 stage1-toolchain: $(ISO_TARGET)/.stage1-toolchain
 
 
 # first time build all the require modules for a minimal system
-STAGE1_MODULES=acl attr bash bzip2 coreutils cracklib dialog diffutils e2fsprogs file findutils gawk gettext glib-2 gmp grep gzip installwatch less libcap libffi libmpc lunar make mpfr ncurses net-tools patch procps readline sed shadow tar util-linux wget xz zlib
+STAGE1_MODULES=acl attr bash bzip2 coreutils cracklib dialog diffutils e2fsprogs file findutils gawk glib-2 gmp grep gzip installwatch less libcap libffi libmpc lunar make mpfr ncurses net-tools patch pcre perl procps readline sed shadow tar util-linux wget xz zlib
 
 $(ISO_TARGET)/.stage1: stage1-toolchain
 	@echo stage1-build
-	@yes n | $(ISO_SOURCE)/scripts/chroot-build lin -rc $(STAGE1_MODULES)
+	@yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build lin -rc $(STAGE1_MODULES)
 	@touch $@
 
 stage1-build: $(ISO_TARGET)/.stage1
@@ -51,6 +51,7 @@ $(ISO_SOURCE)/cache/.stage1: stage1-build
 	@echo stage1-cache
 	@rm -rf $(ISO_SOURCE)/cache
 	@cp -r $(ISO_TARGET)/var/cache/lunar $(ISO_SOURCE)/cache
+	@grep $(patsubst %,-e^%:,$(STAGE1_MODULES)) $(ISO_TARGET)/var/state/lunar/packages | cat > $(ISO_SOURCE)/cache/packages
 	@tar -cjf $(ISO_SOURCE)/cache/fixup-$(ISO_BUILD).tar.bz2 -C $(ISO_TARGET) lib/$(ISO_LD_LINUX) lib/libc.so.6 lib/libdl.so.2 lib/libm.so.6 lib/librt.so.1 lib/libpthread.so.0 lib/libnss_files.so.2 lib/libutil.so.1 lib/libnsl.so.1 lib/libcrypt.so.1
 	@touch $@
 
--- a/mkfiles/stage2.mk
+++ b/mkfiles/stage2.mk
@@ -37,7 +37,10 @@ $(ISO_TARGET)/.stage2-modules: stage2-target
 	  tar -xjf "$$archive" -C $(ISO_TARGET) || exit 1 ; \
 	done
 	@mkdir -p $(ISO_TARGET)/var/state/lunar
-	@touch $(ISO_TARGET)/var/state/lunar/packages{,.backup}
+	@touch $(ISO_TARGET)/var/state/lunar/packages.backup
+	@grep -v "`sed 's/^/^/;s/:.*/:/' $(ISO_SOURCE)/cache/packages`" $(ISO_TARGET)/var/state/lunar/packages.backup | cat > $(ISO_TARGET)/var/state/lunar/packages
+	@cat $(ISO_SOURCE)/cache/packages >> $(ISO_TARGET)/var/state/lunar/packages
+	@cp $(ISO_TARGET)/var/state/lunar/packages $(ISO_TARGET)/var/state/lunar/packages.backup
 	@touch $@
 
 stage2-modules: $(ISO_TARGET)/.stage2-modules
@@ -78,11 +81,12 @@ stage2-moonbase: $(ISO_TARGET)/.stage2-moonbase
 
 
 # build all the require modules for the iso
-STAGE2_MODULES=acl attr bash binutils bzip2 coreutils cracklib dialog diffutils e2fsprogs file findutils gawk gcc gettext glib-2 glibc gmp grep gzip installwatch less libcap libffi libmpc lunar make mpfr ncurses net-tools patch procps readline sed shadow tar util-linux wget xz zlib
+STAGE2_MODULES=kernel-headers 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 binutils glibc lunar gcc make
 
 $(ISO_TARGET)/.stage2: stage2-moonbase stage2-spool
 	@echo stage2-build
-	@yes n | $(ISO_SOURCE)/scripts/chroot-build lin -c $(STAGE1_MODULES)
+	@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 $(STAGE1_MODULES)
 	@touch $@
 
 stage2-build: $(ISO_TARGET)/.stage2




More information about the Lunar-commits mailing list