2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved.
16 VERSION?
=$(shell awk
'$$1 == "unleashed" { print $$2 }' /etc
/release
)
17 BUILDSEND
=rpool
/kayak_image
20 BUILDSEND_MP
=$(shell zfs
get -o value
-H mountpoint
$(BUILDSEND
))
24 INSTALLS
=anon.dtrace.conf anon.system build_image.sh build_zfs_send.sh \
25 data
/access.log data
/boot data
/etc data
/filelist.ramdisk data
/kernel \
26 data
/known_extras data
/mdb data
/platform disk_help.sh install_help.sh \
27 install_image.sh takeover-console.c Makefile net_help.sh README.md \
28 sample
/000000000000.sample sample
/menu.lst
.000000000000
30 TFTP_FILES
=$(DESTDIR
)/tftpboot
/boot
/platform
/i86pc
/kernel
/unix \
31 $(DESTDIR
)/tftpboot
/kayak
/miniroot.gz \
32 $(DESTDIR
)/tftpboot
/kayak
/miniroot.gz.hash \
33 $(DESTDIR
)/tftpboot
/boot
/grub
/menu.lst \
34 $(DESTDIR
)/tftpboot
/pxeboot
$(DESTDIR
)/tftpboot
/boot
/loader.conf.local \
35 $(DESTDIR
)/tftpboot
/boot
/forth
$(DESTDIR
)/tftpboot
/boot
/defaults \
36 $(DESTDIR
)/tftpboot
/pxegrub
38 WEB_FILES
=$(DESTDIR
)/var
/kayak
/kayak
/$(VERSION
).zfs.bz2
39 IMG_FILES
=corner.png tail_bg_v1.png OmniOS_logo_medium.png tail_bg_v2.png
42 dtrace
-A
-q
-n
'int seen[string]; fsinfo:::/args[0]->fi_mount=="/" && seen[args[0]->fi_pathname]==0/{printf("%d %s\n",timestamp/1000000, args[0]->fi_pathname);seen[args[0]->fi_pathname]=1;}' -o
$@.tmp
43 cat
/kernel
/drv
/dtrace.conf
$@.tmp
> $@
46 MINIROOT_DEPS
=build_image.sh anon.dtrace.conf anon.system \
47 install_image.sh disk_help.sh install_help.sh net_help.sh
49 $(BUILDSEND_MP
)/kayak_
$(VERSION
).zfs.bz2
: build_zfs_send.sh
50 @
test -d
"$(BUILDSEND_MP)" ||
(echo
"$(BUILDSEND) missing" && false
)
51 .
/build_zfs_send.sh
-d
$(BUILDSEND
) $(VERSION
)
53 $(DESTDIR
)/tftpboot
/pxegrub
: /boot
/grub
/pxegrub
56 $(DESTDIR
)/tftpboot
/pxeboot
: /boot
/pxeboot
59 $(DESTDIR
)/tftpboot
/boot
/loader.conf.local
: loader.conf.local
62 $(DESTDIR
)/tftpboot
/boot
/forth
: /boot
/forth
65 $(DESTDIR
)/tftpboot
/boot
/defaults
: /boot
/defaults
68 $(DESTDIR
)/tftpboot
/boot
/grub
/menu.lst
: sample
/menu.lst
.000000000000
69 sed
-e
's/@VERSION@/$(VERSION)/' $< > $@
71 $(DESTDIR
)/tftpboot
/boot
/platform
/i86pc
/kernel
/unix
: /platform
/i86pc
/kernel
/unix
74 $(DESTDIR
)/tftpboot
/kayak
/miniroot.gz
: $(BUILDSEND_MP
)/miniroot.gz
77 $(DESTDIR
)/tftpboot
/kayak
/miniroot.gz.hash
: $(BUILDSEND_MP
)/miniroot.gz
78 digest
-a sha1
$< > $@
81 VERSION
=$(VERSION
) .
/build_image.sh
84 VERSION
=$(VERSION
) .
/build_zfs_image.sh
86 $(BUILDSEND_MP
)/miniroot.gz
: $(MINIROOT_DEPS
)
87 if
test -n
"`zfs list -H -t snapshot $(BUILDSEND)/root@fixup 2>/dev/null`"; then \
88 VERSION
=$(VERSION
) DEBUG
=$(DEBUG
) .
/build_image.sh
$(BUILDSEND
) fixup
; \
90 VERSION
=$(VERSION
) DEBUG
=$(DEBUG
) .
/build_image.sh
$(BUILDSEND
) begin
; \
93 $(DESTDIR
)/var
/kayak
/kayak
/$(VERSION
).zfs.bz2
: $(BUILDSEND_MP
)/kayak_
$(VERSION
).zfs.bz2
97 mkdir
-p
$(DESTDIR
)/tftpboot
/boot
/grub
98 mkdir
-p
$(DESTDIR
)/tftpboot
/boot
/platform
/i86pc
/kernel
99 mkdir
-p
$(DESTDIR
)/tftpboot
/kayak
102 mkdir
-p
$(DESTDIR
)/var
/kayak
/kayak
103 mkdir
-p
$(DESTDIR
)/var
/kayak
/css
104 mkdir
-p
$(DESTDIR
)/var
/kayak
/img
105 mkdir
-p
$(DESTDIR
)/usr
/share
/kayak
/data
106 mkdir
-p
$(DESTDIR
)/usr
/share
/kayak
/sample
107 mkdir
-p
$(DESTDIR
)/var
/kayak
/log
108 mkdir
-p
$(DESTDIR
)/var
/svc
/manifest
/network
109 mkdir
-p
$(DESTDIR
)/var
/svc
/method
111 install-package
: tftp-dirs server-dirs
112 for file in
$(INSTALLS
) ; do \
113 cp
$$file $(DESTDIR
)/usr
/share
/kayak
/$$file ; \
115 cp http
/svc-kayak
$(DESTDIR
)/var
/svc
/method
/svc-kayak
116 chmod a
+x
$(DESTDIR
)/var
/svc
/method
/svc-kayak
117 cp http
/css
/land.css
$(DESTDIR
)/var
/kayak
/css
/land.css
118 for file in
$(IMG_FILES
) ; do \
119 cp http
/img
/$$file $(DESTDIR
)/var
/kayak
/img
/$$file ; \
121 cp http
/kayak.xml
$(DESTDIR
)/var
/svc
/manifest
/network
/kayak.xml
123 install-tftp
: tftp-dirs
$(TFTP_FILES
)
125 install-web
: server-dirs
$(WEB_FILES
)
127 takeover-console
: src
/takeover-console.c
129 mount_media
: src
/mount_media.c
130 gcc
-o
$@
$< -ldevinfo
132 install-iso
: $(BUILDSEND_MP
)/$(VERSION
).iso
133 $(BUILDSEND_MP
)/$(VERSION
).iso
: takeover-console mount_media
$(BUILDSEND_MP
)/miniroot.gz
$(BUILDSEND_MP
)/kayak_
$(VERSION
).zfs.bz2
134 BUILDSEND_MP
=$(BUILDSEND_MP
) VERSION
=$(VERSION
) .
/build_iso.sh
136 install-usb
: $(BUILDSEND_MP
)/$(VERSION
).img
137 $(BUILDSEND_MP
)/$(VERSION
).img
: $(BUILDSEND_MP
)/$(VERSION
).iso
138 .
/usbgen.sh
$(BUILDSEND_MP
)/$(VERSION
).iso
$(BUILDSEND_MP
)/$(VERSION
).img
/tmp