1 # $NetBSD: Makefile.installimage,v 1.4 2012/11/03 14:25:32 tsutsui Exp $
3 # Common Makefile to create a bootable installation image for USB flash etc.
9 # Basename of the liveimage
13 # target image size in MB
14 # (if empty default IMAGEMB in Makefile.bootimage is used)
16 # See Makefile.bootimage for other variables.
19 .if !target(check_INSTIMGBASE)
20 check_INSTIMGBASE: .PHONY .NOTMAIN
21 .if !defined(INSTIMGBASE)
22 @echo "Error: INSTIMGBASE is not set"
29 .if defined(INSTIMAGEMB)
30 IMAGEMB= ${INSTIMAGEMB}
33 OMIT_SWAPIMG= yes # nothing to write
35 KERN_SET?= kern-GENERIC
36 SETS?= modules base etc
38 FSTAB_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/fstab.install.in
40 .if ${USE_MBR} != "no"
41 DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.mbr.in
43 DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.in
46 # XXX: no permission info for makefs(8)
47 IMGDIR_EXTRA= ${RELEASEDIR}/${RELEASEMACHINEDIR} ${RELEASEMACHINEDIR}
48 IMGDIR_EXCLUDE= -s ',./installation/cdrom.*,,gp'
49 IMGDIR_EXCLUDE+= -s ',./installation/liveimage.*,,gp'
50 IMGDIR_EXCLUDE+= -s ',./installation/installimage.*,,gp'
52 IMGBASE= ${INSTIMGBASE}
54 .include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage"
56 # INSTIMG_RELEASEDIR specifies where to install ${INSTIMGBASE}.img.gz.
57 # This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc
58 # but also set default here for manual builds.
59 INSTIMG_RELEASEDIR?= ${RELEASEMACHINEDIR}/installation/installimage
61 # should be defined elsewhere?
64 install_image: check_INSTIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
65 ${MKDIR} ${INSTIMG_RELEASEDIR}
66 ${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR}
67 # note ${MAKESUM} will be calculated in src/etc/Makefile