Module Name:    src
Committed By:   aymeric
Date:           Mon Nov 19 20:05:37 UTC 2018

Modified Files:
        src/distrib/amd64/uefi-installimage: Makefile.bootimage
        src/distrib/common/bootimage: Makefile.bootimage

Log Message:
Make building boot images work with xz sets on non-NetBSD hosts.

NetBSD gzip is not toolified so we can't assume the host gzip will be able
to decompress xz files. Use the toolified xz instead in the USE_XZ_SETS case.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
    src/distrib/amd64/uefi-installimage/Makefile.bootimage
cvs rdiff -u -r1.18 -r1.19 src/distrib/common/bootimage/Makefile.bootimage

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/amd64/uefi-installimage/Makefile.bootimage
diff -u src/distrib/amd64/uefi-installimage/Makefile.bootimage:1.7 src/distrib/amd64/uefi-installimage/Makefile.bootimage:1.8
--- src/distrib/amd64/uefi-installimage/Makefile.bootimage:1.7	Sun Oct  7 10:33:44 2018
+++ src/distrib/amd64/uefi-installimage/Makefile.bootimage	Mon Nov 19 20:05:37 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.7 2018/10/07 10:33:44 martin Exp $
+#	$NetBSD: Makefile.bootimage,v 1.8 2018/11/19 20:05:37 aymeric Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -228,6 +228,7 @@ SETS_DEFAULT+=	xbase xcomp xetc xfont xs
 .endif
 
 KERN_SET?=	kern-GENERIC
+COMPRESS_PROGRAM=${"${USE_XZ_SETS:Uno}"!="no":?${TOOL_XZ}:${TOOL_GZIP}}
 TAR_SUFF=	${"${USE_XZ_SETS:Uno}"!="no":?tar.xz:tgz}
 SETS?=		${SETS_DEFAULT}
 IMG_SETS=	${KERN_SET} ${SETS}
@@ -263,7 +264,9 @@ ${TARGETFS}: prepare_md_post pre-targetf
 		false; 							\
 	fi
 	@echo Extracting ${set}.${TAR_SUFF} ...
-	@(cd ${WORKDIR}; ${TOOL_PAX} ${PAX_TIMESTAMP} -rnz -f ${SETS_DIR}/${set}.${TAR_SUFF} .)
+	@(cd ${WORKDIR}; ${TOOL_PAX} ${PAX_TIMESTAMP} -rn \
+		--use-compress-program=${COMPRESS_PROGRAM:Q} \
+		-f ${SETS_DIR}/${set}.${TAR_SUFF} .)
 .endfor
 .if defined(SECONDARY_BOOT)
 	@echo Copying secondary boot...

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.18 src/distrib/common/bootimage/Makefile.bootimage:1.19
--- src/distrib/common/bootimage/Makefile.bootimage:1.18	Sun Oct  7 18:07:00 2018
+++ src/distrib/common/bootimage/Makefile.bootimage	Mon Nov 19 20:05:37 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.18 2018/10/07 18:07:00 martin Exp $
+#	$NetBSD: Makefile.bootimage,v 1.19 2018/11/19 20:05:37 aymeric Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -217,6 +217,7 @@ WORKFSTAB?=	work.fstab
 WORKRCCONF?=	work.rc.conf
 WORKFS?=        work.rootfs
 TARGETFS?=      imgroot.fs
+COMPRESS_PROGRAM=${"${USE_XZ_SETS:Uno}"!="no":?${TOOL_XZ}:${TOOL_GZIP}}
 TAR_SUFF=	${"${USE_XZ_SETS:Uno}"!="no":?tar.xz:tgz}
 
 CLEANFILES+=	${WORKSPEC} ${WORKFSTAB} ${WORKRCCONF} ${WORKFS}
@@ -237,7 +238,9 @@ ${TARGETFS}: prepare_md_post
 		false; 							\
 	fi
 	@echo Extracting ${set}.${TAR_SUFF} ...
-	@(cd ${WORKDIR}; ${TOOL_PAX} ${PAX_TIMESTAMP} -rnz -f ${SETS_DIR}/${set}.${TAR_SUFF} .)
+	@(cd ${WORKDIR}; ${TOOL_PAX} ${PAX_TIMESTAMP} -rn \
+		--use-compress-program=${COMPRESS_PROGRAM:Q} \
+		-f ${SETS_DIR}/${set}.${TAR_SUFF} .)
 .endfor
 .if defined(SECONDARY_BOOT)
 	@echo Copying secondary boot...

Reply via email to