From a59bd996876b032b6c7d30b1e4d79c596e7fd388 Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Fri, 23 Mar 2018 11:54:19 +0000 Subject: [PATCH] Restructure kayak file layout. The number of kayak files has been growing and the directory is now pretty cluttered. Move everything to appropriate sub-directories and clean up the Makefile. --- .gitignore | 9 +- Makefile | 150 ++++++++++-------- build_dialog => build/build_dialog | 7 +- build_ipcalc => build/build_ipcalc | 4 +- build_iso.sh => build/build_iso | 20 ++- build_miniroot.sh => build/build_miniroot | 34 ++-- build_usb.sh => build/build_usb | 0 build_xen.sh => build/build_xen | 0 build_zfs_send.sh => build/build_zfs_send | 0 etc/anon.d | 40 +++++ anon.dtrace.conf => etc/anon.dtrace.conf | 0 anon.system => etc/anon.system | 0 dialog.rc => etc/dialog.rc | 0 loader.conf.local => etc/loader.conf.local | 0 nossh.xml => etc/nossh.xml | 0 config-menu.sh => installer/config-menu | 8 +- dialog-install.sh => installer/dialog-install | 11 +- dialog-tzselect => installer/dialog-tzselect | 2 +- digest => installer/digest | 0 .../find-and-install | 7 +- install_image.sh => installer/install-image | 3 +- kayak-menu.sh => installer/kayak-menu | 16 +- rpool-install.sh => installer/rpool-install | 11 +- LAYOUT.md => lib/LAYOUT.md | 0 dialog.sh => lib/dialog.sh | 6 +- disk_help.sh => lib/disk_help.sh | 0 install_help.sh => lib/install_help.sh | 4 +- net_help.sh => lib/net_help.sh | 0 utils.sh => lib/utils.sh | 2 +- xen_help.sh => lib/xen_help.sh | 0 {http => smf}/kayak.xml | 0 {http => smf}/svc-kayak | 0 32 files changed, 195 insertions(+), 139 deletions(-) rename build_dialog => build/build_dialog (89%) rename build_ipcalc => build/build_ipcalc (90%) rename build_iso.sh => build/build_iso (96%) rename build_miniroot.sh => build/build_miniroot (96%) rename build_usb.sh => build/build_usb (100%) rename build_xen.sh => build/build_xen (100%) rename build_zfs_send.sh => build/build_zfs_send (100%) create mode 100644 etc/anon.d rename anon.dtrace.conf => etc/anon.dtrace.conf (100%) rename anon.system => etc/anon.system (100%) rename dialog.rc => etc/dialog.rc (100%) rename loader.conf.local => etc/loader.conf.local (100%) rename nossh.xml => etc/nossh.xml (100%) rename config-menu.sh => installer/config-menu (99%) rename dialog-install.sh => installer/dialog-install (98%) rename dialog-tzselect => installer/dialog-tzselect (99%) rename digest => installer/digest (100%) rename find-and-install.sh => installer/find-and-install (96%) rename install_image.sh => installer/install-image (97%) rename kayak-menu.sh => installer/kayak-menu (94%) rename rpool-install.sh => installer/rpool-install (87%) rename LAYOUT.md => lib/LAYOUT.md (100%) rename dialog.sh => lib/dialog.sh (91%) rename disk_help.sh => lib/disk_help.sh (100%) rename install_help.sh => lib/install_help.sh (99%) rename net_help.sh => lib/net_help.sh (100%) rename utils.sh => lib/utils.sh (97%) rename xen_help.sh => lib/xen_help.sh (100%) rename {http => smf}/kayak.xml (100%) rename {http => smf}/svc-kayak (100%) diff --git a/.gitignore b/.gitignore index fe19bf9..1283441 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,6 @@ kayak_root/ -takeover-console -ipcalc -dialog -passutil -mount_media -zpool_patch -kbd.list +bin/* +etc/kbd.list run mkiso pv-grub* diff --git a/Makefile b/Makefile index 17bc0cd..8901e7d 100644 --- a/Makefile +++ b/Makefile @@ -31,14 +31,9 @@ DESTDIR=$(BUILDSEND_MP) all: -INSTALLS=anon.dtrace.conf anon.system build_miniroot.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 src/takeover-console.c Makefile net_help.sh README.md \ - build_iso.sh digest find-and-install.sh kayak-menu.sh config-menu.sh \ - build_usb.sh ipcalc dialog src/passutil.c \ - loader.conf.local rpool-install.sh \ - sample/000000000000.sample sample/menu.lst.000000000000 +PKGDIRS=build src/include src bin etc data lib installer sample +IMG_FILES=corner.png tail_bg_v1.png OmniOS_logo_medium.png tail_bg_v2.png +PKGFILES=Makefile README.md TFTP_FILES=\ $(DESTDIR)/tftpboot/kayak/miniroot.gz \ @@ -46,24 +41,21 @@ TFTP_FILES=\ $(DESTDIR)/tftpboot/boot/grub/menu.lst \ $(DESTDIR)/tftpboot/boot/loader.conf.local \ $(DESTDIR)/tftpboot/boot/loader.rc \ - $(DESTDIR)/tftpboot/boot/forth $(DESTDIR)/tftpboot/boot/defaults \ + $(DESTDIR)/tftpboot/boot/forth \ + $(DESTDIR)/tftpboot/boot/defaults \ $(DESTDIR)/tftpboot/boot/platform/i86pc/kernel/amd64/unix \ - $(DESTDIR)/tftpboot/pxeboot $(DESTDIR)/tftpboot/pxegrub + $(DESTDIR)/tftpboot/pxeboot \ + $(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 $@.tmp - cat /kernel/drv/dtrace.conf $@.tmp > $@ - rm $@.tmp +$(DESTDIR)/tftpboot/boot/loader.conf.local: etc/loader.conf.local + sed -e 's/@VERSION@/$(VERSION)/' $< > $@ -MINIROOT_DEPS=build_miniroot.sh anon.dtrace.conf anon.system \ - install_image.sh disk_help.sh install_help.sh net_help.sh +$(DESTDIR)/tftpboot/boot/grub/menu.lst: sample/menu.lst.000000000000 + sed -e 's/@VERSION@/$(VERSION)/' $< > $@ -$(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) +# Files from proto $(DESTDIR)/tftpboot/pxegrub: $(BUILDSEND_MP)/root/boot/grub/pxegrub cp -p $< $@ @@ -74,40 +66,38 @@ $(DESTDIR)/tftpboot/pxeboot: $(BUILDSEND_MP)/root/boot/pxeboot $(DESTDIR)/tftpboot/boot/loader.rc: $(BUILDSEND_MP)/root/boot/loader.rc cp -p $< $@ -$(DESTDIR)/tftpboot/boot/loader.conf.local: loader.conf.local - sed -e 's/@VERSION@/$(VERSION)/' $< > $@ - $(DESTDIR)/tftpboot/boot/forth: $(BUILDSEND_MP)/root/boot/forth cp -rp $< $@ $(DESTDIR)/tftpboot/boot/defaults: $(BUILDSEND_MP)/root/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: $(BUILDSEND_MP)/root/platform/i86pc/kernel/amd64/unix cp -p $< $@ +$(DESTDIR)/var/kayak/kayak/$(VERSION).zfs.bz2: $(BUILDSEND_MP)/kayak_$(VERSION).zfs.bz2 + 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_miniroot.sh: - VERSION=$(VERSION) ./build_miniroot.sh +###################################################################### +# More involved targets - creation of miniroot.gz & zfs image -$(BUILDSEND_MP)/miniroot.gz: $(MINIROOT_DEPS) +$(BUILDSEND_MP)/kayak_$(VERSION).zfs.bz2: build/build_zfs_send + @test -d "$(BUILDSEND_MP)" || (echo "$(BUILDSEND) missing" && false) + ./$< -d $(BUILDSEND) $(VERSION) + +$(BUILDSEND_MP)/miniroot.gz: build/build_miniroot if test -n "`zfs list -H -t snapshot $(BUILDSEND)/root@fixup 2>/dev/null`"; then \ - VERSION=$(VERSION) DEBUG=$(DEBUG) ./build_miniroot.sh $(BUILDSEND) fixup ; \ + VERSION=$(VERSION) DEBUG=$(DEBUG) ./$< $(BUILDSEND) fixup ; \ else \ - VERSION=$(VERSION) DEBUG=$(DEBUG) ./build_miniroot.sh $(BUILDSEND) begin ; \ + VERSION=$(VERSION) DEBUG=$(DEBUG) ./$< $(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 @@ -117,61 +107,85 @@ 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)/usr/share/kayak/src + mkdir -p $(DESTDIR)/usr/share/kayak 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 +# Rebuilding the anonymous dtrace configuration file requires root in a +# zone with dtrace permissions. Provide no dependencies and it won't be +# rebuilt automatically. +# This is only used in debug mode to build a list of all files +# accessed in order to build the miniroot exclusion list. These days we +# just tend to add files by hand as required. +etc/anon.dtrace.conf: + dtrace -A -q -s etc/anon.d -o $@.tmp + cat /kernel/drv/dtrace.conf $@.tmp > $@ + rm $@.tmp -install-tftp: tftp-dirs $(TFTP_FILES) +###################################################################### +# Binaries to build from source -install-web: server-dirs $(WEB_FILES) +BINS=bin/takeover-console bin/ipcalc bin/dialog bin/passutil bin/mount_media \ + etc/kbd.list -takeover-console: src/takeover-console.c +bin/takeover-console: src/takeover-console.c gcc -o $@ $< -passutil: src/passutil.c +bin/passutil: src/passutil.c gcc -o $@ $< -mount_media: src/mount_media.c +bin/mount_media: src/mount_media.c gcc -o $@ $< -ldevinfo -zpool_patch: src/zpool_patch.c +bin/zpool_patch: src/zpool_patch.c gcc -Isrc/include -o $@ $< -lnvpair -lzfs -ipcalc: build_ipcalc - ./build_ipcalc - -dialog: build_dialog - ./build_dialog +bin/ipcalc: build/build_ipcalc + ./build/build_ipcalc -bins: takeover-console ipcalc dialog passutil mount_media kbd.list +bin/dialog: build/build_dialog + ./build/build_dialog -kbd.list: /usr/share/lib/keytables/type_6/kbd_layouts +# Not a binary but a data file generated from key tables +etc/kbd.list: /usr/share/lib/keytables/type_6/kbd_layouts grep = /usr/share/lib/keytables/type_6/kbd_layouts | cut -d= -f1 \ - > kbd.list + > etc/kbd.list + +bins: $(BINS) + +clean: + rm -f $(BINS) -install-iso: bins kbd.list install-tftp install-web - BUILDSEND_MP=$(BUILDSEND_MP) VERSION=$(VERSION) ./build_iso.sh +###################################################################### +# Install targets (see README.md) + +install-tftp: tftp-dirs $(TFTP_FILES) + +install-web: server-dirs $(WEB_FILES) + +install-iso: bins install-tftp install-web + BUILDSEND_MP=$(BUILDSEND_MP) VERSION=$(VERSION) ./build/build_iso install-usb: install-iso - ./build_usb.sh $(BUILDSEND_MP)/$(VERSION).iso \ + ./build/build_usb $(BUILDSEND_MP)/$(VERSION).iso \ $(BUILDSEND_MP)/$(VERSION).usb-dd -clean: - rm -f takeover-console passutil mount_media ipcalc dialog zpool_patch \ - kbd.list +install-package: bins tftp-dirs server-dirs + for dir in $(PKGDIRS); do \ + mkdir -p $(DESTDIR)/usr/share/kayak/$$dir; \ + cp $$dir/* $(DESTDIR)/usr/share/kayak/$$dir/; \ + done + for file in $(PKGFILES); do \ + cp $$file $(DESTDIR)/usr/share/kayak/$$file; \ + done + for file in $(IMG_FILES); do \ + cp http/img/$$file $(DESTDIR)/var/kayak/img/$$file; \ + done + \ + cp http/css/land.css $(DESTDIR)/var/kayak/css/land.css + \ + cp smf/svc-kayak $(DESTDIR)/var/svc/method/svc-kayak + chmod a+x $(DESTDIR)/var/svc/method/svc-kayak + cp smf/kayak.xml $(DESTDIR)/var/svc/manifest/network/kayak.xml diff --git a/build_dialog b/build/build_dialog similarity index 89% rename from build_dialog rename to build/build_dialog index 807a129..5e0dd83 100755 --- a/build_dialog +++ b/build/build_dialog @@ -18,6 +18,7 @@ SITE=https://mirrors.omniosce.org/dialog VER=1.3-20170509 FILE=dialog-$VER.tgz URL=$SITE/$FILE +PROG=dialog dir=`/usr/gnu/bin/mktemp -d` @@ -25,13 +26,13 @@ dir=`/usr/gnu/bin/mktemp -d` cd $dir wget $URL gtar -zxf $FILE - cd dialog-$VER + cd $PROG-$VER ./configure gmake ) -cp $dir/dialog-$VER/dialog . -strip dialog +cp $dir/$PROG-$VER/$PROG ./bin/$PROG +strip bin/$PROG rm -rf $dir diff --git a/build_ipcalc b/build/build_ipcalc similarity index 90% rename from build_ipcalc rename to build/build_ipcalc index 4839a92..3040ad9 100755 --- a/build_ipcalc +++ b/build/build_ipcalc @@ -28,8 +28,8 @@ dir=`/usr/gnu/bin/mktemp -d` CFLAGS=-D_KERNEL ) -cp $dir/$PROG-$VER/$PROG . -strip $PROG +cp $dir/$PROG-$VER/$PROG ./bin/$PROG +strip ./bin/$PROG rm -rf $dir diff --git a/build_iso.sh b/build/build_iso similarity index 96% rename from build_iso.sh rename to build/build_iso index 6e69294..58c9643 100755 --- a/build_iso.sh +++ b/build/build_iso @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/ksh # {{{ CDDL HEADER # This file and its contents are supplied under the terms of the @@ -20,7 +20,7 @@ # Build an ISO installer using the Kayak tools. # -if [ `id -u` != "0" ]; then +if [ "`id -u`" != "0" ]; then echo "You must be root to run this script." exit 1 fi @@ -136,19 +136,17 @@ echo $VERSION > $ISO_ROOT/.volsetid stage "Adding extra files to miniroot" # Extra files -cp -p \ - takeover-console \ - ipcalc passutil mount_media nossh.xml \ - dialog dialog.rc dialog.sh utils.sh dialog-tzselect \ - kbd.list \ - $BA_ROOT/kayak/. +for dir in bin; do + [ -d $BA_ROOT/kayak/$dir ] || mkdir -p $BA_ROOT/kayak/$dir + cp -p $dir/* $BA_ROOT/kayak/$dir/ +done if [ -n "$REFRESH_KAYAK" ]; then # For testing, make sure files in miniroot are current - for f in $BA_ROOT/kayak/*; do + find $BA_ROOT/kayak -type f | while read f; do [ -f "$f" ] || continue echo "REFRESH $f" - cp `basename $f` $BA_ROOT/kayak + cp `echo $f | sed 's^.*/kayak/^^'` $f done fi @@ -159,7 +157,7 @@ EOF # Have initialboot invoke an interactive installer. cat < $BA_ROOT/.initialboot -/kayak/takeover-console /kayak/kayak-menu.sh +/kayak/bin/takeover-console /kayak/installer/kayak-menu exit 0 EOF # Increase the timeout diff --git a/build_miniroot.sh b/build/build_miniroot similarity index 96% rename from build_miniroot.sh rename to build/build_miniroot index c3b4d1d..75a2cf5 100755 --- a/build_miniroot.sh +++ b/build/build_miniroot @@ -32,6 +32,7 @@ BUILDNUM=${VERSION//[a-z]/} if [ ${SRCDIR:0:1} != "/" ]; then SRCDIR=`pwd`/$SRCDIR fi +SRCDIR+=/.. if [ -z "$1" ]; then echo "$0 [checkpoint]" exit 1 @@ -241,13 +242,13 @@ step() { CHKPT="" case "$1" in - "begin") + "begin") zfs destroy -r $BASE/root 2> /dev/null zfs create -o compression=off $BASE/root || fail "zfs create failed" chkpt pkg ;; - "pkg") + "pkg") echo "Creating image of $PUBLISHER from $PKGURL" $PKG image-create -F -p $PUBLISHER=$PKGURL $ROOTDIR \ @@ -268,7 +269,7 @@ step() { chkpt fixup ;; - "fixup") + "fixup") echo "Fixing up install root" ( @@ -324,7 +325,7 @@ step() { chkpt cull ;; - "cull") + "cull") if [ -z "$BIGROOT" ]; then load_keep_list data/* while read file; do @@ -345,7 +346,7 @@ step() { chkpt mkfs ;; - "mkfs") + "mkfs") size=`/usr/bin/du -ks ${ROOTDIR} | /usr/bin/nawk '{print $1+10240}'` echo " --- making image of size $size" /usr/sbin/mkfile ${size}k $MKFILEDIR/miniroot || fail "mkfile" @@ -356,41 +357,44 @@ step() { chkpt mount ;; - "mount") + "mount") mkdir -p $WORKDIR/mnt /usr/sbin/mount -o nologging $lofidev $WORKDIR/mnt || fail "mount" chkpt copy ;; - "copy") + "copy") pushd $ROOTDIR >/dev/null /usr/bin/find . | /usr/bin/cpio -pdum $WORKDIR/mnt 2>&1 >/dev/null \ || fail "populate root" /usr/sbin/devfsadm -r $WORKDIR/mnt > /dev/null popd >/dev/null mkdir $WORKDIR/mnt/kayak - cp $SRCDIR/*.sh $WORKDIR/mnt/kayak/ - chmod a+x $WORKDIR/mnt/kayak/*.sh + for dir in etc lib installer; do + mkdir -p $WORKDIR/mnt/kayak/$dir + cp $SRCDIR/$dir/* $WORKDIR/mnt/kayak/$dir/ + chmod a+x $WORKDIR/mnt/kayak/$dir/* + done # So "bootadm update-archive" can work. - cp $SRCDIR/digest $WORKDIR/mnt/usr/bin/digest + cp $SRCDIR/installer/digest $WORKDIR/mnt/usr/bin/digest chmod 0755 $WORKDIR/mnt/usr/bin/digest make_initial_boot $WORKDIR/mnt/.initialboot if [ -n "$DEBUG" ]; then - cp $SRCDIR/anon.system $WORKDIR/mnt/etc/system - cp $SRCDIR/anon.dtrace.conf $WORKDIR/mnt/kernel/drv/dtrace.conf + cp $SRCDIR/etc/anon.system $WORKDIR/mnt/etc/system + cp $SRCDIR/etc/anon.dtrace.conf $WORKDIR/mnt/kernel/drv/dtrace.conf fi chkpt umount ;; - "umount") + "umount") /usr/sbin/umount $WORKDIR/mnt || fail "umount" /usr/sbin/lofiadm -d $MKFILEDIR/miniroot || fail "lofiadm delete" chkpt compress ;; - "compress") + "compress") $GZIP_CMD -c -f $MKFILEDIR/miniroot > $WORKDIR/miniroot.gz rm -f $MKFILEDIR/miniroot chmod 644 $WORKDIR/miniroot.gz @@ -404,7 +408,7 @@ step() { make_initial_boot() { FILE=$1 cat > $FILE <fi_mount=="/" && seen[args[0]->fi_pathname]==0/ +{ + printf("%d %s\n", timestamp/1000000, args[0]->fi_pathname); + seen[args[0]->fi_pathname] = 1; +} + diff --git a/anon.dtrace.conf b/etc/anon.dtrace.conf similarity index 100% rename from anon.dtrace.conf rename to etc/anon.dtrace.conf diff --git a/anon.system b/etc/anon.system similarity index 100% rename from anon.system rename to etc/anon.system diff --git a/dialog.rc b/etc/dialog.rc similarity index 100% rename from dialog.rc rename to etc/dialog.rc diff --git a/loader.conf.local b/etc/loader.conf.local similarity index 100% rename from loader.conf.local rename to etc/loader.conf.local diff --git a/nossh.xml b/etc/nossh.xml similarity index 100% rename from nossh.xml rename to etc/nossh.xml diff --git a/config-menu.sh b/installer/config-menu similarity index 99% rename from config-menu.sh rename to installer/config-menu index 91cd9d5..28589ec 100755 --- a/config-menu.sh +++ b/installer/config-menu @@ -18,8 +18,8 @@ ALTROOT=/mnt INITIALBOOT=$ALTROOT/.initialboot -IPCALC=/kayak/ipcalc -PASSUTIL=/kayak/passutil +IPCALC=/kayak/bin/ipcalc +PASSUTIL=/kayak/bin/passutil debug=0 if [ "$1" = '-t' ]; then @@ -29,7 +29,7 @@ else trap "" TSTP INT TERM ABRT QUIT fi -[ "$1" = "-dialog" ] && . /kayak/dialog.sh +[ "$1" = "-dialog" ] && . /kayak/lib/dialog.sh dmsg() { @@ -1102,7 +1102,7 @@ cfg_sshd() else [ -d $ALTROOT/etc/svc/profile/site ] \ || mkdir -p $ALTROOT/etc/svc/profile/site - cp /kayak/nossh.xml $ALTROOT/etc/svc/profile/site/nossh.xml + cp /kayak/etc/nossh.xml $ALTROOT/etc/svc/profile/site/nossh.xml fi } diff --git a/dialog-install.sh b/installer/dialog-install similarity index 98% rename from dialog-install.sh rename to installer/dialog-install index 639f334..8a8fcff 100755 --- a/dialog-install.sh +++ b/installer/dialog-install @@ -16,8 +16,8 @@ # Copyright 2018 OmniOS Community Edition (OmniOSce) Association. # -. /kayak/dialog.sh -. /kayak/utils.sh +. /kayak/lib/dialog.sh +. /kayak/lib/utils.sh keyboard_layout=${1:-US-English} @@ -345,14 +345,15 @@ d_info "Installing from ZFS image $ZFS_IMAGE" # Because of kayak's small miniroot, just use C as the language for now. LANG=C -. /kayak/install_help.sh -. /kayak/disk_help.sh +. /kayak/lib/install_help.sh +. /kayak/lib/disk_help.sh BuildBE $RPOOL $ZFS_IMAGE ApplyChanges $HOSTNAME $TZ $LANG $keyboard_layout MakeBootable $RPOOL # Disable SSH by default for interactive installations -[ -f /kayak/nossh.xml ] && cp /kayak/nossh.xml $ALTROOT/etc/svc/profile/site/ +[ -f /kayak/etc/nossh.xml ] && \ + cp /kayak/etc/nossh.xml $ALTROOT/etc/svc/profile/site/ if beadm list -H omnios 2>/dev/null; then dialog \ diff --git a/dialog-tzselect b/installer/dialog-tzselect similarity index 99% rename from dialog-tzselect rename to installer/dialog-tzselect index 8a7b000..a86d210 100755 --- a/dialog-tzselect +++ b/installer/dialog-tzselect @@ -9,7 +9,7 @@ # Contributed by Paul Eggert -. /kayak/dialog.sh +. /kayak/lib/dialog.sh output="${1:?Output}" diff --git a/digest b/installer/digest similarity index 100% rename from digest rename to installer/digest diff --git a/find-and-install.sh b/installer/find-and-install similarity index 96% rename from find-and-install.sh rename to installer/find-and-install index 6fec46d..5b3016b 100755 --- a/find-and-install.sh +++ b/installer/find-and-install @@ -119,11 +119,12 @@ until [[ $NEWRPOOL == "" ]]; do fi done -. /kayak/install_help.sh -. /kayak/disk_help.sh +. /kayak/lib/install_help.sh +. /kayak/lib/disk_help.sh BuildRpoolOnly $DISKLIST rm -f $SCRATCH # Running actual install. -/kayak/rpool-install.sh $RPOOL $keyboard_layout +/kayak/installer/rpool-install $RPOOL $keyboard_layout + diff --git a/install_image.sh b/installer/install-image similarity index 97% rename from install_image.sh rename to installer/install-image index 5206b1a..74cd374 100755 --- a/install_image.sh +++ b/installer/install-image @@ -25,8 +25,9 @@ # Use is subject to license terms. # -. /kayak/install_help.sh +. /kayak/lib/install_help.sh ConsoleLog /tmp/kayak.log ForceDHCP RunInstall || bomb "RunInstall failed." [[ -n "$NO_REBOOT" ]] || Reboot + diff --git a/kayak-menu.sh b/installer/kayak-menu similarity index 94% rename from kayak-menu.sh rename to installer/kayak-menu index 09df662..3b0e555 100755 --- a/kayak-menu.sh +++ b/installer/kayak-menu @@ -38,13 +38,13 @@ export TERM=sun-color export VERSION=`head -1 /etc/release | awk '{print $3}' | sed 's/[a-z]*$//g'` -. /kayak/dialog.sh +. /kayak/lib/dialog.sh if [ $debug -eq 0 ]; then echo echo "Scanning for media..." mkdir /.cdrom - /kayak/mount_media $VERSION + /kayak/bin/mount_media $VERSION fi # If dialogue is supported, offer the user a choice. @@ -93,7 +93,7 @@ if [ -n "$USE_DIALOG" ]; then --default-item US-English \ --menu "Use the arrow keys to move up and down the list" \ 19 0 16 \ - `cat /kayak/kbd.list | sed 's/.*/& &/'` \ + `cat /kayak/etc/kbd.list | sed 's/.*/& &/'` \ 2> $tmpf stat=$? if [ $stat -eq 0 ]; then @@ -127,12 +127,12 @@ d_detecting() # Preinstall menu menu_items=( \ (menu_str="Find disks, create rpool, and install OmniOSce" \ - cmds=("/kayak/find-and-install.sh $klang") \ - dcmds=("d_detecting x", "/kayak/dialog-install.sh $klang")\ + cmds=("/kayak/instaler/find-and-install $klang") \ + dcmds=("d_detecting x", "/kayak/installer/dialog-install $klang")\ default="true" \ do_subprocess="true") \ (menu_str="Install OmniOSce straight on to a preconfigured rpool" \ - cmds=("/kayak/rpool-install.sh rpool $klang") \ + cmds=("/kayak/installer/rpool-install rpool $klang") \ do_subprocess="true") \ (menu_str="Shell (for manual rpool creation)" \ cmds=("/usr/bin/bash") \ @@ -153,8 +153,8 @@ menu_items=( \ # Postinstall menu pi_menu_items=( \ (menu_str="Configure the installed OmniOS system" \ - cmds=("/kayak/config-menu.sh") \ - dcmds=("/kayak/config-menu.sh -dialog") \ + cmds=("/kayak/installer/config-menu") \ + dcmds=("/kayak/installer/config-menu -dialog") \ do_subprocess="true") \ (menu_str="Shell (for post-install ops on /mnt)" \ cmds=("/usr/bin/bash") \ diff --git a/rpool-install.sh b/installer/rpool-install similarity index 87% rename from rpool-install.sh rename to installer/rpool-install index f32d0a5..7b9010b 100644 --- a/rpool-install.sh +++ b/installer/rpool-install @@ -21,8 +21,8 @@ ZFS_IMAGE=/.cdrom/image/*.zfs.bz2 keyboard_layout=${2:-US-English} tmpf=`mktemp` -[ -n "$USE_DIALOG" ] && . /kayak/dialog.sh -. /kayak/utils.sh +[ -n "$USE_DIALOG" ] && . /kayak/lib/dialog.sh +. /kayak/lib/utils.sh zpool list $RPOOL >& /dev/null if [[ $? != 0 ]]; then @@ -34,8 +34,8 @@ fi echo "Installing from ZFS image $ZFS_IMAGE" -. /kayak/disk_help.sh -. /kayak/install_help.sh +. /kayak/lib/disk_help.sh +. /kayak/lib/install_help.sh prompt_hostname omniosce prompt_timezone @@ -47,7 +47,8 @@ BuildBE $RPOOL $ZFS_IMAGE ApplyChanges $HOSTNAME $TZ $LANG $keyboard_layout MakeBootable $RPOOL # Disable SSH by default for interactive installations -[ -f /kayak/nossh.xml ] && cp /kayak/nossh.xml $ALTROOT/etc/svc/profile/site/ +[ -f /kayak/etc/nossh.xml ] && \ + cp /kayak/etc/nossh.xml $ALTROOT/etc/svc/profile/site/ zpool list -v $RPOOL echo "" beadm list diff --git a/LAYOUT.md b/lib/LAYOUT.md similarity index 100% rename from LAYOUT.md rename to lib/LAYOUT.md diff --git a/dialog.sh b/lib/dialog.sh similarity index 91% rename from dialog.sh rename to lib/dialog.sh index 7fd89c9..5faa3b3 100644 --- a/dialog.sh +++ b/lib/dialog.sh @@ -12,14 +12,14 @@ # Copyright 2018 OmniOS Community Edition (OmniOSce) Association. -if [ -x /kayak/dialog ]; then +if [ -x /kayak/bin/dialog ]; then export USE_DIALOG=1 - export DIALOGRC=/kayak/dialog.rc + export DIALOGRC=/kayak/etc/dialog.rc export DIALOGRELEASE="`head -1 /etc/release`" dialog() { - /kayak/dialog \ + /kayak/bin/dialog \ --backtitle "$DIALOGRELEASE" \ "$@" } diff --git a/disk_help.sh b/lib/disk_help.sh similarity index 100% rename from disk_help.sh rename to lib/disk_help.sh diff --git a/install_help.sh b/lib/install_help.sh similarity index 99% rename from install_help.sh rename to lib/install_help.sh index 160d37c..7235075 100644 --- a/install_help.sh +++ b/lib/install_help.sh @@ -69,8 +69,8 @@ bomb() { exit 1 } -. /kayak/net_help.sh -. /kayak/disk_help.sh +. /kayak/lib/net_help.sh +. /kayak/lib/disk_help.sh ICFILE=/tmp/_install_config getvar(){ diff --git a/net_help.sh b/lib/net_help.sh similarity index 100% rename from net_help.sh rename to lib/net_help.sh diff --git a/utils.sh b/lib/utils.sh similarity index 97% rename from utils.sh rename to lib/utils.sh index c9d57d1..5795911 100644 --- a/utils.sh +++ b/lib/utils.sh @@ -56,7 +56,7 @@ t_prompt_timezone() { d_prompt_timezone() { # Select a timezone. - /kayak/dialog-tzselect /tmp/tz.$$ + /kayak/installer/dialog-tzselect /tmp/tz.$$ TZ="`tail -1 /tmp/tz.$$`" rm -f /tmp/tz.$$ } diff --git a/xen_help.sh b/lib/xen_help.sh similarity index 100% rename from xen_help.sh rename to lib/xen_help.sh diff --git a/http/kayak.xml b/smf/kayak.xml similarity index 100% rename from http/kayak.xml rename to smf/kayak.xml diff --git a/http/svc-kayak b/smf/svc-kayak similarity index 100% rename from http/svc-kayak rename to smf/svc-kayak