Home | History | Annotate | Line # | Download | only in bootimage
Makefile.installimage revision 1.9
      1 #	$NetBSD: Makefile.installimage,v 1.9 2021/09/25 08:54:29 maya 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 # Optional variables:
     12 #	INSTIMAGEMB
     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_INSTIMGBASE)
     20 check_INSTIMGBASE: .PHONY .NOTMAIN
     21 .if !defined(INSTIMGBASE)
     22 	@echo "Error: INSTIMGBASE is not set"
     23 	@false
     24 .else
     25 	@true
     26 .endif
     27 .endif
     28 
     29 .if defined(INSTIMAGEMB)
     30 IMAGEMB=	${INSTIMAGEMB}
     31 .endif
     32 SWAPMB=		0			# no swap
     33 
     34 KERN_SET?=	kern-GENERIC
     35 SETS?=		modules base etc
     36 .if ${MKGPUFIRMWARE:Uno} != "no"
     37 SETS+=		gpufw
     38 .endif
     39 
     40 FSTAB_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/fstab.install.in
     41 
     42 USE_MBR?=	no
     43 
     44 .if ${USE_MBR} != "no"
     45 DISKPROTO_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.mbr.in
     46 .else
     47 DISKPROTO_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.in
     48 .endif
     49 
     50 # XXX: no permission info for makefs(8)
     51 IMGDIR_EXTRA=	${RELEASEDIR}/${RELEASEMACHINEDIR}	${RELEASEMACHINEDIR}
     52 IMGDIR_EXCLUDE= 	-s ',./installation/cdrom.*,,gp'
     53 IMGDIR_EXCLUDE+=	-s ',./installation/liveimage.*,,gp'
     54 IMGDIR_EXCLUDE+=	-s ',./installation/installimage.*,,gp'
     55 .if defined(MD_IMGDIR_EXCLUDE)
     56 IMGDIR_EXCLUDE+=	${MD_IMGDIR_EXCLUDE}
     57 .endif
     58 
     59 IMGBASE=        ${INSTIMGBASE}
     60 
     61 .include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage"
     62 
     63 # INSTIMG_RELEASEDIR specifies where to install ${INSTIMGBASE}.img.gz.
     64 # This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc
     65 # but also set default here for manual builds.
     66 INSTIMG_RELEASEDIR?=	${RELEASEMACHINEDIR}/installation/installimage
     67 
     68 # should be defined elsewhere? 
     69 MKDIR?=		mkdir -p
     70 
     71 install_image: check_INSTIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
     72 	${MKDIR} ${MKDIRPERM} ${INSTIMG_RELEASEDIR}
     73 	${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR}
     74 	# note ${MAKESUM} will be calculated in src/etc/Makefile
     75 
     76 release:
     77 
     78