1 # $NetBSD: Makefile.liveimage,v 1.4 2017/02/10 16:43:59 christos Exp $ 2 # 3 # Common Makefile to create a bootable FS image for USB flash or emulators 4 # 5 6 # 7 # Required variables: 8 # LIVEIMGBASE 9 # Basename of the liveimage 10 # 11 # Optional variables: 12 # LIVEIMAGEMB 13 # target image size in MB 14 # (if empty default IMAGEMB in Makefile.bootimage is used) 15 # 16 # See Makefile.bootimage for other variables. 17 # 18 19 .if !target(check_LIVEIMGBASE) 20 check_LIVEIMGBASE: .PHONY .NOTMAIN 21 .if !defined(LIVEIMGBASE) 22 @echo "Error: LIVEIMGBASE is not set" 23 @false 24 .else 25 @true 26 .endif 27 .endif 28 29 .if defined(LIVEIMAGEMB) 30 IMAGEMB= ${LIVEIMAGEMB} 31 .endif 32 33 IMGBASE= ${LIVEIMGBASE} 34 35 .include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage" 36 37 # LIVEIMG_RELEASEDIR specifies where to install ${LIVEIMGBASE}.img.gz. 38 # This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc 39 # but also set default here for manual builds. 40 LIVEIMG_RELEASEDIR?= ${RELEASEMACHINEDIR}/installation/liveimage 41 42 # should be defined elsewhere? 43 MKDIR?= mkdir -p 44 45 live_image: check_LIVEIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz 46 ${MKDIR} ${MKDIRPERM} ${LIVEIMG_RELEASEDIR} 47 ${RELEASE_INSTALL} ${IMGBASE}.img.gz ${LIVEIMG_RELEASEDIR} 48 # note ${MAKESUM} will be calculated in src/etc/Makefile 49 50 release: 51 52