-
Notifications
You must be signed in to change notification settings - Fork 92
/
Makefile
136 lines (104 loc) · 4.61 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved.
#
VERSION?=$(shell awk '$$1 == "OmniOS" { print $$3 }' /etc/release)
BUILDSEND=rpool/kayak_image
BUILDSEND_MP=$(shell zfs get -o value -H mountpoint $(BUILDSEND))
all:
INSTALLS=anon.dtrace.conf anon.system build_image.sh build_zfs_send.sh \
data/access.log data/boot data/etc data/filelist.ramdisk data/kernel \
data/known_extras data/mdb data/platform disk_help.sh install_help.sh \
install_image.sh takeover-console.c Makefile net_help.sh README.md \
build_iso.sh digest find-and-install.sh kayak-menu.sh usbgen.sh \
loader.conf.local rpool-install.sh \
sample/000000000000.sample sample/menu.lst.000000000000
TFTP_FILES=$(DESTDIR)/tftpboot/boot/platform/i86pc/kernel/amd64/unix \
$(DESTDIR)/tftpboot/kayak/miniroot.gz \
$(DESTDIR)/tftpboot/kayak/miniroot.gz.hash \
$(DESTDIR)/tftpboot/boot/grub/menu.lst \
$(DESTDIR)/tftpboot/pxeboot $(DESTDIR)/tftpboot/boot/loader.conf.local \
$(DESTDIR)/tftpboot/boot/forth $(DESTDIR)/tftpboot/boot/defaults \
$(DESTDIR)/tftpboot/pxegrub
WEB_FILES=$(DESTDIR)/var/kayak/kayak/$(VERSION).zfs.bz2
IMG_FILES=corner.png tail_bg_v1.png OmniOS_logo_medium.png tail_bg_v2.png
anon.dtrace.conf:
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 [email protected]
cat /kernel/drv/dtrace.conf [email protected] > $@
MINIROOT_DEPS=build_image.sh anon.dtrace.conf anon.system \
install_image.sh disk_help.sh install_help.sh net_help.sh
$(BUILDSEND_MP)/kayak_$(VERSION).zfs.bz2: build_zfs_send.sh
@test -d "$(BUILDSEND_MP)" || (echo "$(BUILDSEND) missing" && false)
./build_zfs_send.sh -d $(BUILDSEND) $(VERSION)
$(DESTDIR)/tftpboot/pxegrub: /boot/grub/pxegrub
cp -p $< $@
$(DESTDIR)/tftpboot/pxeboot: /boot/pxeboot
cp -p $< $@
$(DESTDIR)/tftpboot/boot/loader.conf.local: loader.conf.local
cp -p $< $@
$(DESTDIR)/tftpboot/boot/forth: /boot/forth
cp -rp $< $@
$(DESTDIR)/tftpboot/boot/defaults: /boot/defaults
cp -rp $< $@
$(DESTDIR)/tftpboot/boot/grub/menu.lst: sample/menu.lst.000000000000
sed -e 's/@VERSION@/$(VERSION)/' $< > $@
$(DESTDIR)/tftpboot/boot/platform/i86pc/kernel/amd64/unix: /platform/i86pc/kernel/amd64/unix
cp -p $< $@
$(DESTDIR)/tftpboot/kayak/miniroot.gz: $(BUILDSEND_MP)/miniroot.gz
cp -p $< $@
$(DESTDIR)/tftpboot/kayak/miniroot.gz.hash: $(BUILDSEND_MP)/miniroot.gz
digest -a sha1 $< > $@
build_image.sh:
VERSION=$(VERSION) ./build_image.sh
build_zfs_send.sh:
VERSION=$(VERSION) ./build_zfs_image.sh
$(BUILDSEND_MP)/miniroot.gz: $(MINIROOT_DEPS)
if test -n "`zfs list -H -t snapshot $(BUILDSEND)/root@fixup 2>/dev/null`"; then \
VERSION=$(VERSION) DEBUG=$(DEBUG) ./build_image.sh $(BUILDSEND) fixup ; \
else \
VERSION=$(VERSION) DEBUG=$(DEBUG) ./build_image.sh $(BUILDSEND) begin ; \
fi
$(DESTDIR)/var/kayak/kayak/$(VERSION).zfs.bz2: $(BUILDSEND_MP)/kayak_$(VERSION).zfs.bz2
cp -p $< $@
tftp-dirs:
mkdir -p $(DESTDIR)/tftpboot/boot/grub
mkdir -p $(DESTDIR)/tftpboot/boot/platform/i86pc/kernel/amd64
mkdir -p $(DESTDIR)/tftpboot/kayak
server-dirs:
mkdir -p $(DESTDIR)/var/kayak/kayak
mkdir -p $(DESTDIR)/var/kayak/css
mkdir -p $(DESTDIR)/var/kayak/img
mkdir -p $(DESTDIR)/usr/share/kayak/data
mkdir -p $(DESTDIR)/usr/share/kayak/sample
mkdir -p $(DESTDIR)/var/kayak/log
mkdir -p $(DESTDIR)/var/svc/manifest/network
mkdir -p $(DESTDIR)/var/svc/method
install-package: tftp-dirs server-dirs
for file in $(INSTALLS) ; do \
cp $$file $(DESTDIR)/usr/share/kayak/$$file ; \
done
cp http/svc-kayak $(DESTDIR)/var/svc/method/svc-kayak
chmod a+x $(DESTDIR)/var/svc/method/svc-kayak
cp http/css/land.css $(DESTDIR)/var/kayak/css/land.css
for file in $(IMG_FILES) ; do \
cp http/img/$$file $(DESTDIR)/var/kayak/img/$$file ; \
done
cp http/kayak.xml $(DESTDIR)/var/svc/manifest/network/kayak.xml
install-tftp: tftp-dirs $(TFTP_FILES)
install-web: server-dirs $(WEB_FILES)
takeover-console: takeover-console.c
gcc -o takeover-console takeover-console.c
install-iso: takeover-console install-tftp install-web
BUILDSEND_MP=$(BUILDSEND_MP) VERSION=$(VERSION) ./build_iso.sh
install-usb: install-iso
./usbgen.sh $(BUILDSEND_MP)/$(VERSION).iso $(BUILDSEND_MP)/$(VERSION).usb-dd /tmp