1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License, Version 1.0 only
   6 # (the "License").  You may not use this file except in compliance
   7 # with the License.
   8 #
   9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10 # or http://www.opensolaris.org/os/licensing.
  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 #
  23 # Copyright 2012 OmniTI Computer Consulting, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 
  27 VERSION?=$(shell awk '$$1 == "OmniOS" { print $$3 }' /etc/release)
  28 BUILDSEND=rpool/kayak_image
  29 
  30 
  31 BUILDSEND_MP=$(shell zfs get -o value -H mountpoint $(BUILDSEND))
  32 
  33 all:
  34 
  35 INSTALLS=anon.dtrace.conf anon.system build_image.sh build_zfs_send.sh \
  36         data/access.log data/boot data/etc data/filelist.ramdisk data/kernel \
  37         data/known_extras data/mdb data/platform disk_help.sh install_help.sh \
  38         install_image.sh Makefile net_help.sh README.md \
  39         sample/000000000000.sample sample/menu.lst.000000000000
  40 
  41 TFTP_FILES=$(DESTDIR)/tftpboot/boot/platform/i86pc/kernel/amd64/unix \
  42         $(DESTDIR)/tftpboot/kayak/miniroot.gz \
  43         $(DESTDIR)/tftpboot/boot/grub/menu.lst \
  44         $(DESTDIR)/tftpboot/pxegrub
  45 
  46 WEB_FILES=$(DESTDIR)/var/kayak/kayak/$(VERSION).zfs.bz2
  47 IMG_FILES=corner.png tail_bg_v1.png OmniOS_logo_medium.png tail_bg_v2.png
  48 
  49 anon.dtrace.conf:
  50         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
  51         cat /kernel/drv/dtrace.conf $@.tmp > $@
  52         rm $@.tmp
  53 
  54 MINIROOT_DEPS=build_image.sh anon.dtrace.conf anon.system \
  55         install_image.sh disk_help.sh install_help.sh net_help.sh
  56 
  57 $(BUILDSEND_MP)/kayak_$(VERSION).zfs.bz2:       build_zfs_send.sh
  58         @test -d "$(BUILDSEND_MP)" || (echo "$(BUILDSEND) missing" && false)
  59         ./build_zfs_send.sh -d $(BUILDSEND) $(VERSION)
  60 
  61 $(DESTDIR)/tftpboot/pxegrub:    /boot/grub/pxegrub
  62         cp -p $< $@
  63 
  64 $(DESTDIR)/tftpboot/boot/grub/menu.lst: sample/menu.lst.000000000000
  65         sed -e 's/@VERSION@/$(VERSION)/' $< > $@
  66 
  67 $(DESTDIR)/tftpboot/boot/platform/i86pc/kernel/amd64/unix:      /platform/i86pc/kernel/amd64/unix
  68         cp -p $< $@
  69 
  70 $(DESTDIR)/tftpboot/kayak/miniroot.gz:  $(BUILDSEND_MP)/miniroot.gz
  71         cp -p $< $@
  72 
  73 build_image.sh:
  74         VERSION=$(VERSION) ./build_image.sh
  75 
  76 build_zfs_send.sh:
  77         VERSION=$(VERSION) ./build_zfs_image.sh
  78 
  79 $(BUILDSEND_MP)/miniroot.gz:    $(MINIROOT_DEPS)
  80         if test -n "`zfs list -H -t snapshot $(BUILDSEND)/root@fixup 2>/dev/null`"; then \
  81           VERSION=$(VERSION) DEBUG=$(DEBUG) ./build_image.sh $(BUILDSEND) fixup ; \
  82         else \
  83           VERSION=$(VERSION) DEBUG=$(DEBUG) ./build_image.sh $(BUILDSEND) begin ; \
  84         fi
  85 
  86 $(DESTDIR)/var/kayak/kayak/$(VERSION).zfs.bz2:  $(BUILDSEND_MP)/kayak_$(VERSION).zfs.bz2
  87         cp -p $< $@
  88 
  89 tftp-dirs:
  90         mkdir -p $(DESTDIR)/tftpboot/boot/grub
  91         mkdir -p $(DESTDIR)/tftpboot/boot/platform/i86pc/kernel/amd64
  92         mkdir -p $(DESTDIR)/tftpboot/kayak
 
  99         mkdir -p $(DESTDIR)/usr/share/kayak/sample
 100         mkdir -p $(DESTDIR)/var/kayak/log
 101         mkdir -p $(DESTDIR)/var/svc/manifest/network
 102         mkdir -p $(DESTDIR)/var/svc/method
 103 
 104 install-package:        tftp-dirs server-dirs
 105         for file in $(INSTALLS) ; do \
 106                 cp $$file $(DESTDIR)/usr/share/kayak/$$file ; \
 107         done
 108         cp http/svc-kayak $(DESTDIR)/var/svc/method/svc-kayak
 109         chmod a+x $(DESTDIR)/var/svc/method/svc-kayak
 110         cp http/css/land.css $(DESTDIR)/var/kayak/css/land.css
 111         for file in $(IMG_FILES) ; do \
 112                 cp http/img/$$file $(DESTDIR)/var/kayak/img/$$file ; \
 113         done
 114         cp http/kayak.xml $(DESTDIR)/var/svc/manifest/network/kayak.xml
 115 
 116 install-tftp:   tftp-dirs $(TFTP_FILES)
 117 
 118 install-web:    server-dirs $(WEB_FILES)
  | 
   1 #
   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
   5 # 1.0 of the CDDL.
   6 #
   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.
  10 #
  11 
  12 #
  13 # Copyright 2017 OmniTI Computer Consulting, Inc.  All rights reserved.
  14 #
  15 
  16 VERSION?=$(shell awk '$$1 == "OmniOS" { print $$3 }' /etc/release)
  17 BUILDSEND=rpool/kayak_image
  18 
  19 
  20 BUILDSEND_MP=$(shell zfs get -o value -H mountpoint $(BUILDSEND))
  21 
  22 all:
  23 
  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
  29 
  30 TFTP_FILES=$(DESTDIR)/tftpboot/boot/platform/i86pc/kernel/amd64/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
  37 
  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
  40 
  41 anon.dtrace.conf:
  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 > $@
  44         rm $@.tmp
  45 
  46 MINIROOT_DEPS=build_image.sh anon.dtrace.conf anon.system \
  47         install_image.sh disk_help.sh install_help.sh net_help.sh
  48 
  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)
  52 
  53 $(DESTDIR)/tftpboot/pxegrub:    /boot/grub/pxegrub
  54         cp -p $< $@
  55 
  56 $(DESTDIR)/tftpboot/pxeboot:    /boot/pxeboot
  57         cp -p $< $@
  58 
  59 $(DESTDIR)/tftpboot/boot/loader.conf.local:     loader.conf.local
  60         cp -p $< $@
  61 
  62 $(DESTDIR)/tftpboot/boot/forth: /boot/forth
  63         cp -rp $< $@
  64 
  65 $(DESTDIR)/tftpboot/boot/defaults:      /boot/defaults
  66         cp -rp $< $@
  67 
  68 $(DESTDIR)/tftpboot/boot/grub/menu.lst: sample/menu.lst.000000000000
  69         sed -e 's/@VERSION@/$(VERSION)/' $< > $@
  70 
  71 $(DESTDIR)/tftpboot/boot/platform/i86pc/kernel/amd64/unix:      /platform/i86pc/kernel/amd64/unix
  72         cp -p $< $@
  73 
  74 $(DESTDIR)/tftpboot/kayak/miniroot.gz:  $(BUILDSEND_MP)/miniroot.gz
  75         cp -p $< $@
  76 
  77 $(DESTDIR)/tftpboot/kayak/miniroot.gz.hash:     $(BUILDSEND_MP)/miniroot.gz
  78         digest -a sha1 $< > $@
  79 
  80 build_image.sh:
  81         VERSION=$(VERSION) ./build_image.sh
  82 
  83 build_zfs_send.sh:
  84         VERSION=$(VERSION) ./build_zfs_image.sh
  85 
  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 ; \
  89         else \
  90           VERSION=$(VERSION) DEBUG=$(DEBUG) ./build_image.sh $(BUILDSEND) begin ; \
  91         fi
  92 
  93 $(DESTDIR)/var/kayak/kayak/$(VERSION).zfs.bz2:  $(BUILDSEND_MP)/kayak_$(VERSION).zfs.bz2
  94         cp -p $< $@
  95 
  96 tftp-dirs:
  97         mkdir -p $(DESTDIR)/tftpboot/boot/grub
  98         mkdir -p $(DESTDIR)/tftpboot/boot/platform/i86pc/kernel/amd64
  99         mkdir -p $(DESTDIR)/tftpboot/kayak
 
 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
 110 
 111 install-package:        tftp-dirs server-dirs
 112         for file in $(INSTALLS) ; do \
 113                 cp $$file $(DESTDIR)/usr/share/kayak/$$file ; \
 114         done
 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 ; \
 120         done
 121         cp http/kayak.xml $(DESTDIR)/var/svc/manifest/network/kayak.xml
 122 
 123 install-tftp:   tftp-dirs $(TFTP_FILES)
 124 
 125 install-web:    server-dirs $(WEB_FILES)
 126 
 127 takeover-console:       takeover-console.c
 128         gcc -o takeover-console takeover-console.c
 129 
 130 install-iso:    takeover-console install-tftp install-web
 131         BUILDSEND_MP=$(BUILDSEND_MP) VERSION=$(VERSION) ./build_iso.sh
 132 
 133 install-usb:    install-iso
 134         ./usbgen.sh $(BUILDSEND_MP)/$(VERSION).iso $(BUILDSEND_MP)/$(VERSION).usb-dd /tmp
  |