Home | History | Annotate | Line # | Download | only in bootimage
Makefile.installimage revision 1.9
      1  1.9      maya #	$NetBSD: Makefile.installimage,v 1.9 2021/09/25 08:54:29 maya Exp $
      2  1.1   tsutsui #
      3  1.1   tsutsui # Common Makefile to create a bootable installation image for USB flash etc.
      4  1.1   tsutsui #
      5  1.1   tsutsui 
      6  1.1   tsutsui #
      7  1.1   tsutsui # Required variables:
      8  1.1   tsutsui #	INSTIMGBASE
      9  1.1   tsutsui #		Basename of the liveimage
     10  1.1   tsutsui #
     11  1.4   tsutsui # Optional variables:
     12  1.4   tsutsui #	INSTIMAGEMB
     13  1.4   tsutsui #		target image size in MB
     14  1.4   tsutsui #		(if empty default IMAGEMB in Makefile.bootimage is used)
     15  1.4   tsutsui #
     16  1.1   tsutsui # See Makefile.bootimage for other variables.
     17  1.1   tsutsui #
     18  1.1   tsutsui 
     19  1.2   tsutsui .if !target(check_INSTIMGBASE)
     20  1.2   tsutsui check_INSTIMGBASE: .PHONY .NOTMAIN
     21  1.2   tsutsui .if !defined(INSTIMGBASE)
     22  1.1   tsutsui 	@echo "Error: INSTIMGBASE is not set"
     23  1.1   tsutsui 	@false
     24  1.2   tsutsui .else
     25  1.2   tsutsui 	@true
     26  1.1   tsutsui .endif
     27  1.1   tsutsui .endif
     28  1.1   tsutsui 
     29  1.4   tsutsui .if defined(INSTIMAGEMB)
     30  1.4   tsutsui IMAGEMB=	${INSTIMAGEMB}
     31  1.4   tsutsui .endif
     32  1.1   tsutsui SWAPMB=		0			# no swap
     33  1.1   tsutsui 
     34  1.1   tsutsui KERN_SET?=	kern-GENERIC
     35  1.1   tsutsui SETS?=		modules base etc
     36  1.9      maya .if ${MKGPUFIRMWARE:Uno} != "no"
     37  1.9      maya SETS+=		gpufw
     38  1.9      maya .endif
     39  1.1   tsutsui 
     40  1.1   tsutsui FSTAB_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/fstab.install.in
     41  1.1   tsutsui 
     42  1.7  jmcneill USE_MBR?=	no
     43  1.7  jmcneill 
     44  1.1   tsutsui .if ${USE_MBR} != "no"
     45  1.1   tsutsui DISKPROTO_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.mbr.in
     46  1.1   tsutsui .else
     47  1.1   tsutsui DISKPROTO_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.in
     48  1.1   tsutsui .endif
     49  1.1   tsutsui 
     50  1.3   tsutsui # XXX: no permission info for makefs(8)
     51  1.1   tsutsui IMGDIR_EXTRA=	${RELEASEDIR}/${RELEASEMACHINEDIR}	${RELEASEMACHINEDIR}
     52  1.1   tsutsui IMGDIR_EXCLUDE= 	-s ',./installation/cdrom.*,,gp'
     53  1.1   tsutsui IMGDIR_EXCLUDE+=	-s ',./installation/liveimage.*,,gp'
     54  1.1   tsutsui IMGDIR_EXCLUDE+=	-s ',./installation/installimage.*,,gp'
     55  1.8  jmcneill .if defined(MD_IMGDIR_EXCLUDE)
     56  1.8  jmcneill IMGDIR_EXCLUDE+=	${MD_IMGDIR_EXCLUDE}
     57  1.8  jmcneill .endif
     58  1.1   tsutsui 
     59  1.1   tsutsui IMGBASE=        ${INSTIMGBASE}
     60  1.1   tsutsui 
     61  1.1   tsutsui .include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage"
     62  1.1   tsutsui 
     63  1.1   tsutsui # INSTIMG_RELEASEDIR specifies where to install ${INSTIMGBASE}.img.gz.
     64  1.1   tsutsui # This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc
     65  1.1   tsutsui # but also set default here for manual builds.
     66  1.1   tsutsui INSTIMG_RELEASEDIR?=	${RELEASEMACHINEDIR}/installation/installimage
     67  1.1   tsutsui 
     68  1.1   tsutsui # should be defined elsewhere? 
     69  1.1   tsutsui MKDIR?=		mkdir -p
     70  1.1   tsutsui 
     71  1.2   tsutsui install_image: check_INSTIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
     72  1.5  christos 	${MKDIR} ${MKDIRPERM} ${INSTIMG_RELEASEDIR}
     73  1.1   tsutsui 	${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR}
     74  1.1   tsutsui 	# note ${MAKESUM} will be calculated in src/etc/Makefile
     75  1.1   tsutsui 
     76  1.1   tsutsui release:
     77  1.1   tsutsui 
     78