[Lunar-commits] <lunar-iso> Use xz archives.

Peter de Ridder peter at lunar-linux.org
Thu Aug 22 18:23:46 CEST 2013


commit bf1bddca3663bb03930a791600f0f94d155ce4ec
Author: Peter de Ridder <peter at lunar-linux.org>
Date: Fri, 16 Aug 2013 16:28:48 -0700
URL: https://github.com/lunar-linux/lunar-iso/commit/bf1bddca3663bb03930a791600f0f94d155ce4ec

Use xz archives.
---
  lunar-install/sbin/lunar-install | +10/-10   
  mkfiles/bootstrap.mk             | +2/-2     
  mkfiles/kernel.mk                | +5/-5     
  mkfiles/pack.mk                  | +3/-3     
  mkfiles/stage1.mk                | +1/-1     
  mkfiles/stage2.mk                | +2/-2     
  scripts/bootstrap-lunar-cache    | +12/-4    
  7 files changed, 35 insertions(+), 27 deletions(-)

--- a/lunar-install/sbin/lunar-install
+++ b/lunar-install/sbin/lunar-install
@@ -930,8 +930,8 @@ transfer_package()
 	LINE=$(grep "^$1:" $PACKAGES_LIST)
 	MOD=$(echo $LINE | cut -d: -f1)
 	VER=$(echo $LINE | cut -d: -f4)
-	cp /var/cache/lunar/$MOD-$VER-*.tar.bz2 $TARGET/var/cache/lunar/
-	tar xjf $TARGET/var/cache/lunar/$MOD-$VER-*.tar.bz2 2> /dev/null
+	cp /var/cache/lunar/$MOD-$VER-*.tar.xz $TARGET/var/cache/lunar/
+	tar xJf $TARGET/var/cache/lunar/$MOD-$VER-*.tar.xz 2> /dev/null
 	echo $LINE >> $TARGET/var/state/lunar/packages
 	cp $TARGET/var/state/lunar/packages $TARGET/var/state/lunar/packages.backup
 }
@@ -1078,20 +1078,20 @@ transfer()
 			chmod 0700 root
 			chmod 1777 tmp var/tmp
 
-			if [ -f /var/cache/lunar/aaa_base.tar.bz2 ]; then
+			if [ -f /var/cache/lunar/aaa_base.tar.xz ]; then
 				percent_msg "Installing aaa_base: base directories and files"
-				tar xjf /var/cache/lunar/aaa_base.tar.bz2 2> /dev/null
+				tar xJf /var/cache/lunar/aaa_base.tar.xz 2> /dev/null
 			fi
-			if [ -f /var/cache/lunar/aaa_dev.tar.bz2 ]; then
+			if [ -f /var/cache/lunar/aaa_dev.tar.xz ]; then
 				percent_msg "Installing aaa_dev: device nodes"
-				tar xjf /var/cache/lunar/aaa_dev.tar.bz2 2> /dev/null
+				tar xJf /var/cache/lunar/aaa_dev.tar.xz 2> /dev/null
 			fi
 
 			for LINE in $(cat $PACKAGES_LIST | grep -v -e '^lilo:' -e '^grub:' -e '^grub2:') ; do
 				MOD=$(echo $LINE | cut -d: -f1)
 				VER=$(echo $LINE | cut -d: -f4)
 				SIZ=$(echo $LINE | cut -d: -f5)
-				percent_msg "Installing $MOD-$VER ($SIZ)\n\n($(basename /var/cache/lunar/$MOD-$VER-*.tar.bz2))"
+				percent_msg "Installing $MOD-$VER ($SIZ)\n\n($(basename /var/cache/lunar/$MOD-$VER-*.tar.xz))"
 				transfer_package $MOD
 			done
 
@@ -1492,8 +1492,8 @@ install_kernels()
 			P)
 				CCOMMAND=`$DIALOG --title "Kernel selection menu" --cancel-label "Exit" --item-help --menu "" 0 0 0 \
 					$(list_precompiled_kernels)`
-				if [ -f "/var/cache/lunar/$CCOMMAND.tar.bz2" ]; then
-					cd $TARGET && tar xjf /var/cache/lunar/$CCOMMAND.tar.bz2
+				if [ -f "/var/cache/lunar/$CCOMMAND.tar.xz" ]; then
+					cd $TARGET && tar xJf /var/cache/lunar/$CCOMMAND.tar.xz
 					#ln -s /usr/src/linux-$CCOMMAND $TARGET/usr/src/linux
 
 					KVER=$(grep "^$CCOMMAND:" $KERNEL_LIST | cut -d: -f2)
@@ -1506,7 +1506,7 @@ install_kernels()
 					fi
 
 					# Generate kernel install log
-					#tar -tf /var/cache/lunar/$CCOMMAND.tar.bz2 | sed '/^usr\/src/d;s:^:/:g' >> $TARGET/var/log/lunar/install/linux-${CCOMMAND} 2> /dev/null
+					#tar -tf /var/cache/lunar/$CCOMMAND.tar.xz | sed '/^usr\/src/d;s:^:/:g' >> $TARGET/var/log/lunar/install/linux-${CCOMMAND} 2> /dev/null
 
 					# Generate kernel md5sum log
 					#cat $TARGET/var/log/lunar/install/linux-${CCOMMAND} | xargs -i md5sum {} >> $TARGET/var/log/lunar/md5sum/linux-${CCOMMAND} 2> /dev/null
--- a/mkfiles/bootstrap.mk
+++ b/mkfiles/bootstrap.mk
@@ -42,8 +42,8 @@ $(ISO_SOURCE)/cache/.copied:
 $(ISO_TARGET)/.modules: $(ISO_SOURCE)/cache/.copied
 	@echo bootstrap-lunar
 	@mkdir -p $(ISO_TARGET)
-	@for archive in $(ISO_SOURCE)/cache/*-$(ISO_BUILD).tar.bz2 ; do \
-	  tar -xjf "$$archive" -C $(ISO_TARGET) || exit 1 ; \
+	@for archive in $(ISO_SOURCE)/cache/*-$(ISO_BUILD).tar.xz ; do \
+	  tar -xJf "$$archive" -C $(ISO_TARGET) || exit 1 ; \
 	done
 	@mkdir -p $(ISO_TARGET)/var/state/lunar
 	@touch $(ISO_TARGET)/var/state/lunar/packages.backup
--- a/mkfiles/kernel.mk
+++ b/mkfiles/kernel.mk
@@ -10,8 +10,8 @@ $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar: stage2
 	@yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build lin -c linux
 	@mv $(ISO_TARGET)/boot/vmlinuz-* $(ISO_TARGET)/boot/linux
 	@mv $(ISO_TARGET)/boot/initramfs-*.img $(ISO_TARGET)/boot/initrd
-	@bunzip2 -c $(ISO_TARGET)/var/cache/lunar/linux-$$($(ISO_SOURCE)/scripts/chroot-build lvu installed linux)-$(ISO_BUILD).tar.bz2 > $@.tmp
-	@rm $(ISO_TARGET)/var/cache/lunar/linux-$$($(ISO_SOURCE)/scripts/chroot-build lvu installed linux)-$(ISO_BUILD).tar.bz2
+	@xz -d -c $(ISO_TARGET)/var/cache/lunar/linux-$$($(ISO_SOURCE)/scripts/chroot-build lvu installed linux)-$(ISO_BUILD).tar.xz > $@.tmp
+	@rm $(ISO_TARGET)/var/cache/lunar/linux-$$($(ISO_SOURCE)/scripts/chroot-build lvu installed linux)-$(ISO_BUILD).tar.xz
 	@mv $@.tmp $@
 
 .INTERMEDIATE: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files
@@ -25,10 +25,10 @@ $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files: $(ISO_TARGET)/var/cache/l
 	-name 'Makefile*' -o \
 	-name 'Kconfig*' \) -printf 'usr/src/%P\n' > $@
 
-$(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar.bz2: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files
+$(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar.xz: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files
 	@tar -rf $< -C $(ISO_TARGET) -T $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files
 	@rm $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files
 	@echo "linux-$(ISO_ARCH):$$($(ISO_SOURCE)/scripts/chroot-build lvu installed linux):You have no choice" > $(ISO_TARGET)/var/cache/lunar/kernels
-	@bzip2 $<
+	@xz $<
 
-linux: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar.bz2
+linux: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar.xz
--- a/mkfiles/pack.mk
+++ b/mkfiles/pack.mk
@@ -47,8 +47,8 @@ $(ISO_TARGET)/.aaa_base.list: $(ISO_TARGET)/.aaa_base.found $(ISO_TARGET)/.aaa_b
 	@sort $^ | uniq -u | sed 's:^/::' > $@
 
 # Create tar with not tracked files
-$(ISO_TARGET)/var/cache/lunar/aaa_base.tar.bz2: $(ISO_TARGET)/.aaa_base.list
+$(ISO_TARGET)/var/cache/lunar/aaa_base.tar.xz: $(ISO_TARGET)/.aaa_base.list
 	@echo pack-base
-	@tar -cjf $@ -C $(ISO_TARGET) --no-recursion -T $<
+	@tar -cJf $@ -C $(ISO_TARGET) --no-recursion -T $<
 
-pack-base: $(ISO_TARGET)/var/cache/lunar/aaa_base.tar.bz2
+pack-base: $(ISO_TARGET)/var/cache/lunar/aaa_base.tar.xz
--- a/mkfiles/stage1.mk
+++ b/mkfiles/stage1.mk
@@ -54,7 +54,7 @@ $(ISO_SOURCE)/cache/.stage1: stage1-build
 	@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
+	@tar -cJf $(ISO_SOURCE)/cache/fixup-$(ISO_BUILD).tar.xz -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 $@
 
 stage1-cache: $(ISO_SOURCE)/cache/.stage1
--- a/mkfiles/stage2.mk
+++ b/mkfiles/stage2.mk
@@ -36,8 +36,8 @@ stage2-base: $(ISO_TARGET)/.stage2-base
 # install the module caches
 $(ISO_TARGET)/.stage2-modules: stage2-target
 	@echo stage2-modules
-	@for archive in $(ISO_SOURCE)/cache/*-$(ISO_BUILD).tar.bz2 ; do \
-	  tar -xjf "$$archive" -C $(ISO_TARGET) || exit 1 ; \
+	@for archive in $(ISO_SOURCE)/cache/*-$(ISO_BUILD).tar.xz ; do \
+	  tar -xJf "$$archive" -C $(ISO_TARGET) || exit 1 ; \
 	done
 	@mkdir -p $(ISO_TARGET)/var/state/lunar
 	@touch $(ISO_TARGET)/var/state/lunar/packages.backup
--- a/scripts/bootstrap-lunar-cache
+++ b/scripts/bootstrap-lunar-cache
@@ -37,14 +37,14 @@ done
 for mod in $NEED_MODULES ; do
   # check for cache file presence
   MODULE_VERSION=`lsh installed_version $mod`
-  CACHE="$mod-$MODULE_VERSION-$ISO_BUILD.tar.bz2"
+  CACHE="$mod-$MODULE_VERSION-$ISO_BUILD.tar.xz"
   if [ ! -f "$ISO_SOURCE/cache/$CACHE" ] ; then
     cp "$LUNAR_CACHE/$CACHE" "$ISO_SOURCE/cache/$CACHE" && echo "$mod:$(date --date=@$(stat -c%Z $LUNAR_CACHE/$CACHE) +%Y%m%d):installed:$MODULE_VERSION:0KB" >> "$ISO_SOURCE/cache/packages" || NEED_CACHE="$NEED_CACHE $mod"
   fi
 done
 
-if [ ! -f "$ISO_SOURCE/cache/fixup-$ISO_BUILD.tar.bz2" ] ; then
-  tar -cjf "$ISO_SOURCE/cache/fixup-$ISO_BUILD.tar.bz2" /lib/ld-linux.so.2 /lib/ld-linux-x86-64.so.2 /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
+if [ ! -f "$ISO_SOURCE/cache/fixup-$ISO_BUILD.tar.xz" ] ; then
+  tar -cJf "$ISO_SOURCE/cache/fixup-$ISO_BUILD.tar.xz" /lib/ld-linux.so.2 /lib/ld-linux-x86-64.so.2 /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
 fi
 
 if [ -z "$NEED_CACHE" ] ; then
@@ -61,7 +61,9 @@ if [ -n "$REBUILD_MANUAL" ] ; then
 fi
 
 OLD_ARCHIVE=`lunar set ACHIVE`
+OLD_COMPRESS_METHOD=`lunar set COMPRESS_METHOD`
 lunar set ARCHIVE on
+lunar set COMPRESS_METHOD xz
 lin -c $NEED_CACHE
 OLD_ARCHIVE=${OLD_ARCHIVE#*=}
 if [ -z "$OLD_ARCHIVE" ] ; then
@@ -69,10 +71,16 @@ if [ -z "$OLD_ARCHIVE" ] ; then
 else
   lunar set ARCHIVE $OLD_ARCHIVE
 fi
+OLD_COMPRESS_METHOD=${OLD_COMPRESS_METHOD#*=}
+if [ -z "$OLD_COMPRESS_METHOD" ] ; then
+  lunar unset COMPRESS_METHOD
+else
+  lunar set COMPRESS_METHOD $OLD_COMPRESS_METHOD
+fi
 
 for mod in $NEED_CACHE ; do
   # check for cache file presence
-  CACHE="$mod-$(lsh installed_version $mod)-$ISO_BUILD.tar.bz2"
+  CACHE="$mod-$(lsh installed_version $mod)-$ISO_BUILD.tar.xz"
   if [ ! -f "$ISO_SOURCE/cache/$CACHE" ] ; then
     cp "$LUNAR_CACHE/$CACHE" "$ISO_SOURCE/cache/$CACHE" || NO_CACHE="$NO_CACHE $mod"
   fi




More information about the Lunar-commits mailing list