Makefile.installimage revision 1.4
1149487Stjr#	$NetBSD: Makefile.installimage,v 1.4 2012/11/03 14:25:32 tsutsui Exp $
260786Sps#
3161478Sdelphij# Common Makefile to create a bootable installation image for USB flash etc.
460786Sps#
560786Sps
660786Sps#
760786Sps# Required variables:
860786Sps#	INSTIMGBASE
960786Sps#		Basename of the liveimage
1060786Sps#
1160786Sps# Optional variables:
1260786Sps#	INSTIMAGEMB
1360786Sps#		target image size in MB
1460786Sps#		(if empty default IMAGEMB in Makefile.bootimage is used)
1560786Sps#
1660786Sps# See Makefile.bootimage for other variables.
1760786Sps#
1860786Sps
1960786Sps.if !target(check_INSTIMGBASE)
20161478Sdelphijcheck_INSTIMGBASE: .PHONY .NOTMAIN
2160786Sps.if !defined(INSTIMGBASE)
22161478Sdelphij	@echo "Error: INSTIMGBASE is not set"
2389019Sps	@false
2489019Sps.else
2560786Sps	@true
26161478Sdelphij.endif
2760786Sps.endif
2889019Sps
2989019Sps.if defined(INSTIMAGEMB)
3089019SpsIMAGEMB=	${INSTIMAGEMB}
3160786Sps.endif
3260786SpsSWAPMB=		0			# no swap
3360786SpsOMIT_SWAPIMG=	yes			# nothing to write
3460786Sps
3560786SpsKERN_SET?=	kern-GENERIC
36128345StjrSETS?=		modules base etc
3760786Sps
3863128SpsFSTAB_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/fstab.install.in
39161478Sdelphij
4060786Sps.if ${USE_MBR} != "no"
4160786SpsDISKPROTO_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.mbr.in
4260786Sps.else
43161478SdelphijDISKPROTO_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.in
4460786Sps.endif
45161478Sdelphij
46161478Sdelphij# XXX: no permission info for makefs(8)
4760786SpsIMGDIR_EXTRA=	${RELEASEDIR}/${RELEASEMACHINEDIR}	${RELEASEMACHINEDIR}
4860786SpsIMGDIR_EXCLUDE= 	-s ',./installation/cdrom.*,,gp'
49161478SdelphijIMGDIR_EXCLUDE+=	-s ',./installation/liveimage.*,,gp'
5060786SpsIMGDIR_EXCLUDE+=	-s ',./installation/installimage.*,,gp'
5160786Sps
5260786SpsIMGBASE=        ${INSTIMGBASE}
5360786Sps
5460786Sps.include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage"
5563128Sps
5660786Sps# INSTIMG_RELEASEDIR specifies where to install ${INSTIMGBASE}.img.gz.
5760786Sps# This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc
5860786Sps# but also set default here for manual builds.
5960786SpsINSTIMG_RELEASEDIR?=	${RELEASEMACHINEDIR}/installation/installimage
6060786Sps
6160786Sps# should be defined elsewhere? 
6260786SpsMKDIR?=		mkdir -p
6363128Sps
6463128Spsinstall_image: check_INSTIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
6560786Sps	${MKDIR} ${INSTIMG_RELEASEDIR}
66161478Sdelphij	${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR}
67161478Sdelphij	# note ${MAKESUM} will be calculated in src/etc/Makefile
68161478Sdelphij
69161478Sdelphijrelease:
70161478Sdelphij
7160786Sps