forked from omniti-labs/kayak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
118 lines (95 loc) · 4.09 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
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
# Use is subject to license terms.
#
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 Makefile net_help.sh README.md \
sample/000000000000.sample sample/menu.lst.000000000000
TFTP_FILES=$(DESTDIR)/tftpboot/boot/platform/i86pc/kernel/amd64/unix \
$(DESTDIR)/tftpboot/kayak/miniroot.gz \
$(DESTDIR)/tftpboot/boot/grub/menu.lst \
$(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/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 $< $@
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)