Home | History | Annotate | Line # | Download | only in bootimage
Makefile.installimage revision 1.4.18.1
      1  1.4.18.1   bouyer #	$NetBSD: Makefile.installimage,v 1.4.18.1 2017/04/21 16:51:09 bouyer 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 OMIT_SWAPIMG=	yes			# nothing to write
     34       1.1  tsutsui 
     35       1.1  tsutsui KERN_SET?=	kern-GENERIC
     36       1.1  tsutsui SETS?=		modules base etc
     37       1.1  tsutsui 
     38       1.1  tsutsui FSTAB_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/fstab.install.in
     39       1.1  tsutsui 
     40       1.1  tsutsui .if ${USE_MBR} != "no"
     41       1.1  tsutsui DISKPROTO_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.mbr.in
     42       1.1  tsutsui .else
     43       1.1  tsutsui DISKPROTO_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.in
     44       1.1  tsutsui .endif
     45       1.1  tsutsui 
     46       1.3  tsutsui # XXX: no permission info for makefs(8)
     47       1.1  tsutsui IMGDIR_EXTRA=	${RELEASEDIR}/${RELEASEMACHINEDIR}	${RELEASEMACHINEDIR}
     48       1.1  tsutsui IMGDIR_EXCLUDE= 	-s ',./installation/cdrom.*,,gp'
     49       1.1  tsutsui IMGDIR_EXCLUDE+=	-s ',./installation/liveimage.*,,gp'
     50       1.1  tsutsui IMGDIR_EXCLUDE+=	-s ',./installation/installimage.*,,gp'
     51       1.1  tsutsui 
     52       1.1  tsutsui IMGBASE=        ${INSTIMGBASE}
     53       1.1  tsutsui 
     54       1.1  tsutsui .include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage"
     55       1.1  tsutsui 
     56       1.1  tsutsui # INSTIMG_RELEASEDIR specifies where to install ${INSTIMGBASE}.img.gz.
     57       1.1  tsutsui # This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc
     58       1.1  tsutsui # but also set default here for manual builds.
     59       1.1  tsutsui INSTIMG_RELEASEDIR?=	${RELEASEMACHINEDIR}/installation/installimage
     60       1.1  tsutsui 
     61       1.1  tsutsui # should be defined elsewhere? 
     62       1.1  tsutsui MKDIR?=		mkdir -p
     63       1.1  tsutsui 
     64       1.2  tsutsui install_image: check_INSTIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
     65  1.4.18.1   bouyer 	${MKDIR} ${MKDIRPERM} ${INSTIMG_RELEASEDIR}
     66       1.1  tsutsui 	${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR}
     67       1.1  tsutsui 	# note ${MAKESUM} will be calculated in src/etc/Makefile
     68       1.1  tsutsui 
     69       1.1  tsutsui release:
     70       1.1  tsutsui 
     71