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)
15 check_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
24 SWAPMB= 0 # no swap
25 OMIT_SWAPIMG= yes # nothing to write
26
27 KERN_SET?= kern-GENERIC
28 SETS?= modules base etc
29
30 FSTAB_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/fstab.install.in
31
32 .if ${USE_MBR} != "no"
33 DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.mbr.in
34 .else
35 DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.in
36 .endif
37
38 # XXX: no permittion info for makefs(8)
39 IMGDIR_EXTRA= ${RELEASEDIR}/${RELEASEMACHINEDIR} ${RELEASEMACHINEDIR}
40 IMGDIR_EXCLUDE= -s ',./installation/cdrom.*,,gp'
41 IMGDIR_EXCLUDE+= -s ',./installation/liveimage.*,,gp'
42 IMGDIR_EXCLUDE+= -s ',./installation/installimage.*,,gp'
43
44 IMGBASE= ${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.
51 INSTIMG_RELEASEDIR?= ${RELEASEMACHINEDIR}/installation/installimage
52
53 # should be defined elsewhere?
54 MKDIR?= mkdir -p
55
56 install_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
61 release:
62
63