Makefile.installimage revision 1.10.2.1 1 1.10.2.1 martin # $NetBSD: Makefile.installimage,v 1.10.2.1 2024/05/11 14:31:57 martin 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.10 maya SETS?= gpufw modules base etc
36 1.1 tsutsui
37 1.1 tsutsui FSTAB_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/fstab.install.in
38 1.1 tsutsui
39 1.7 jmcneill USE_MBR?= no
40 1.7 jmcneill
41 1.1 tsutsui .if ${USE_MBR} != "no"
42 1.1 tsutsui DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.mbr.in
43 1.1 tsutsui .else
44 1.1 tsutsui DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.in
45 1.1 tsutsui .endif
46 1.1 tsutsui
47 1.3 tsutsui # XXX: no permission info for makefs(8)
48 1.1 tsutsui IMGDIR_EXTRA= ${RELEASEDIR}/${RELEASEMACHINEDIR} ${RELEASEMACHINEDIR}
49 1.10.2.1 martin IMGDIR_EXCLUDE+= -s ',./installation/floppy/.*,,gp'
50 1.10.2.1 martin IMGDIR_EXCLUDE+= -s ',./installation/cdrom.*,,gp'
51 1.1 tsutsui IMGDIR_EXCLUDE+= -s ',./installation/liveimage.*,,gp'
52 1.1 tsutsui IMGDIR_EXCLUDE+= -s ',./installation/installimage.*,,gp'
53 1.8 jmcneill .if defined(MD_IMGDIR_EXCLUDE)
54 1.8 jmcneill IMGDIR_EXCLUDE+= ${MD_IMGDIR_EXCLUDE}
55 1.8 jmcneill .endif
56 1.1 tsutsui
57 1.1 tsutsui IMGBASE= ${INSTIMGBASE}
58 1.1 tsutsui
59 1.1 tsutsui .include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage"
60 1.1 tsutsui
61 1.1 tsutsui # INSTIMG_RELEASEDIR specifies where to install ${INSTIMGBASE}.img.gz.
62 1.1 tsutsui # This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc
63 1.1 tsutsui # but also set default here for manual builds.
64 1.1 tsutsui INSTIMG_RELEASEDIR?= ${RELEASEMACHINEDIR}/installation/installimage
65 1.1 tsutsui
66 1.1 tsutsui # should be defined elsewhere?
67 1.1 tsutsui MKDIR?= mkdir -p
68 1.1 tsutsui
69 1.2 tsutsui install_image: check_INSTIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
70 1.5 christos ${MKDIR} ${MKDIRPERM} ${INSTIMG_RELEASEDIR}
71 1.1 tsutsui ${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR}
72 1.1 tsutsui # note ${MAKESUM} will be calculated in src/etc/Makefile
73 1.1 tsutsui
74 1.1 tsutsui release:
75 1.1 tsutsui
76