11.4Schristos#	$NetBSD: Makefile.liveimage,v 1.4 2017/02/10 16:43:59 christos Exp $
21.1Stsutsui#
31.1Stsutsui# Common Makefile to create a bootable FS image for USB flash or emulators
41.1Stsutsui#
51.1Stsutsui
61.1Stsutsui#
71.1Stsutsui# Required variables:
81.1Stsutsui#	LIVEIMGBASE
91.1Stsutsui#		Basename of the liveimage
101.1Stsutsui#
111.3Stsutsui# Optional variables:
121.3Stsutsui#	LIVEIMAGEMB
131.3Stsutsui#		target image size in MB
141.3Stsutsui#		(if empty default IMAGEMB in Makefile.bootimage is used)
151.3Stsutsui#
161.1Stsutsui# See Makefile.bootimage for other variables.
171.1Stsutsui#
181.1Stsutsui
191.2Stsutsui.if !target(check_LIVEIMGBASE)
201.2Stsutsuicheck_LIVEIMGBASE: .PHONY .NOTMAIN
211.2Stsutsui.if !defined(LIVEIMGBASE)
221.1Stsutsui	@echo "Error: LIVEIMGBASE is not set"
231.1Stsutsui	@false
241.2Stsutsui.else
251.2Stsutsui	@true
261.1Stsutsui.endif
271.1Stsutsui.endif
281.1Stsutsui
291.3Stsutsui.if defined(LIVEIMAGEMB)
301.3StsutsuiIMAGEMB=	${LIVEIMAGEMB}
311.3Stsutsui.endif
321.3Stsutsui
331.1StsutsuiIMGBASE=	${LIVEIMGBASE}
341.1Stsutsui
351.1Stsutsui.include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage"
361.1Stsutsui
371.1Stsutsui# LIVEIMG_RELEASEDIR specifies where to install ${LIVEIMGBASE}.img.gz.
381.1Stsutsui# This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc
391.1Stsutsui# but also set default here for manual builds.
401.1StsutsuiLIVEIMG_RELEASEDIR?=	${RELEASEMACHINEDIR}/installation/liveimage
411.1Stsutsui
421.1Stsutsui# should be defined elsewhere? 
431.1StsutsuiMKDIR?=		mkdir -p
441.1Stsutsui
451.2Stsutsuilive_image: check_LIVEIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
461.4Schristos	${MKDIR} ${MKDIRPERM} ${LIVEIMG_RELEASEDIR}
471.1Stsutsui	${RELEASE_INSTALL} ${IMGBASE}.img.gz ${LIVEIMG_RELEASEDIR}
481.1Stsutsui	# note ${MAKESUM} will be calculated in src/etc/Makefile
491.1Stsutsui
501.1Stsutsuirelease:
511.1Stsutsui
52