sample scripts - vx32 - Local 9vx git repository for patches. (HTM) git clone git://r-36.net/vx32 (DIR) Log (DIR) Files (DIR) Refs --- (DIR) commit a2b2af002a24b59fdc4ddd29bbaac557ea1186f0 (DIR) parent 3b3de41dfc0ce422a4ae0c875a6645eb699344db (HTM) Author: Jesus Galan Lopez (yiyus) <yiyu.jgl@gmail.com> Date: Wed, 29 Sep 2010 02:00:19 +0200 sample scripts Diffstat: A bin/9vxc | 14 ++++++++++++++ A bin/9vxp | 18 ++++++++++++++++++ A bin/9vxz | 13 +++++++++++++ A bin/acmevx | 13 +++++++++++++ 4 files changed, 58 insertions(+), 0 deletions(-) --- (DIR) diff --git a/bin/9vxc b/bin/9vxc @@ -0,0 +1,14 @@ +#!/usr/bin/9vx -g -ic -f +# 9vxc: a 9vx cpu sever +# If found, will exec /cfg/vx32/cpurc + +# configure a pcap ethernet device +ether0=type=pcap dev= +# root is a kfs file +localroot=/usr/local/plan9/9vx.kfs +#nvram=#Z/usr/local/plan9/9vx.nvram +# access to host files is limited +canopenpath=/usr/local/plan9/9vx +# cpu and memory are limited too +*cpulimit=20 +*memsize=128 (DIR) diff --git a/bin/9vxp b/bin/9vxp @@ -0,0 +1,18 @@ +#!/bin/sh +# 9vxp: run a lib/profile like file at init +# Reads configuration from ~/.9vxp.ini + +fatal() { echo $* 1>&2; exit 1; } +abs() { f=$1 + echo $f | grep -q '^/' || f=`pwd`/$f + ls $f || fatal $1 not found; } + +test $# -gt 0 || fatal "usage: 9vxp profile [args]" +profile="#Z"`abs $1`; shift +initprofile='. /rc/bin/termrc + home=/usr/$user; test -d $home && cd + . $profile || reboot exit with errors: $status + reboot' +conf="~/.9vxp.ini" +test -f $conf && conf="-f $conf" || unset conf +exec 9vx $conf $* -i "$initprofile" "profile=$profile" (DIR) diff --git a/bin/9vxz b/bin/9vxz @@ -0,0 +1,13 @@ +#!/bin/sh +# 9vxz: rc from the 9vx embeded image + +cmd="/386/bin/bind -a /386/bin /bin; + bind -a /rc/bin /bin; + cd '#Z"`pwd`"'; + prompt=\$sysname'# '; + rc $*; + echo reboot > '#c/reboot'" +# double quotes in cmd to pass it to rc -c +cmd=`echo $cmd | sed "s;';'';g"` +exec 9vx -g "init=/386/bin/rc -c '$cmd' + nobootprompt=local!/boot/rootfs.bz2" (DIR) diff --git a/bin/acmevx b/bin/acmevx @@ -0,0 +1,13 @@ +#!/usr/bin/9vxp +# acmevx: stand in 9vx complex + +mntgen +ramfs +plumber +bind -a '#Z/tmp' /tmp +bind '#Z/' /n/z +prompt=('; ' ' ') +if(test -f lib/acme.dump) + acme -l lib/acme.dump +if not + acme