Makefile.installimage revision 1.2
1#	$NetBSD: Makefile.installimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
2#
3# Common Makefile to create a bootable installation image for USB flash etc.
4#
5
6#
7# Required variables:
8#	INSTIMGBASE
9#		Basename of the liveimage
10#
11# See Makefile.bootimage for other variables.
12#
13
14.if !target(check_INSTIMGBASE)
15check_INSTIMGBASE: .PHONY .NOTMAIN
16.if !defined(INSTIMGBASE)
17	@echo "Error: INSTIMGBASE is not set"
18	@false
19.else
20	@true
21.endif
22.endif
23
24SWAPMB=		0			# no swap
25OMIT_SWAPIMG=	yes			# nothing to write
26
27KERN_SET?=	kern-GENERIC
28SETS?=		modules base etc
29
30FSTAB_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/fstab.install.in
31
32.if ${USE_MBR} != "no"
33DISKPROTO_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.mbr.in
34.else
35DISKPROTO_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.in
36.endif
37
38# XXX: no permittion info for makefs(8)
39IMGDIR_EXTRA=	${RELEASEDIR}/${RELEASEMACHINEDIR}	${RELEASEMACHINEDIR}
40IMGDIR_EXCLUDE= 	-s ',./installation/cdrom.*,,gp'
41IMGDIR_EXCLUDE+=	-s ',./installation/liveimage.*,,gp'
42IMGDIR_EXCLUDE+=	-s ',./installation/installimage.*,,gp'
43
44IMGBASE=        ${INSTIMGBASE}
45
46.include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage"
47
48# INSTIMG_RELEASEDIR specifies where to install ${INSTIMGBASE}.img.gz.
49# This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc
50# but also set default here for manual builds.
51INSTIMG_RELEASEDIR?=	${RELEASEMACHINEDIR}/installation/installimage
52
53# should be defined elsewhere? 
54MKDIR?=		mkdir -p
55
56install_image: check_INSTIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
57	${MKDIR} ${INSTIMG_RELEASEDIR}
58	${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR}
59	# note ${MAKESUM} will be calculated in src/etc/Makefile
60
61release:
62
63