Commit 23447d73 authored by Mike Hibler's avatar Mike Hibler

FreeNAS 9 support, "improved" FreeNAS 8 support.

A clientside top-level "gmake freenas-tarball" will build everything and
construct an appropriate tarball. You must either build on FreeBSD 8.3 or
FreeBSD 9.2, depending on the version of FreeNAS you are targetting.

This cannot be done native on the FreeNAS box! In part because there is
no compiler there, but even if there was, the install target would wreak
havoc on a full root filesystem; it assumes it is working on a skeleton
FS with just the Emulab stuff in it.

Mostly this commit is grotesque Makefile hacking due to our tragic
client-side tmcc OS-specific directory structure. Hey, don't blame me!
It was, um...okay DO blame me...
parent 3e69966e
......@@ -30,10 +30,12 @@ REL := $(shell $(SRCDIR)/tmcc/osstuff.sh -r)
include $(OBJDIR)/Makeconf
SUBDIRS = lib tools os sensors tmcc protogeni
SUBDIRS = lib tools os sensors protogeni
ifneq ($(EVENTSYS),0)
SUBDIRS += event
endif
# tmcc should be last as the freenas* install targets mess with the hierarchy
SUBDIRS += tmcc
ifeq ($(WITH_EMULAB),1)
all: all-subdirs
......@@ -98,27 +100,8 @@ freenas-os-check:
#
freenas-tarball: freenas-os-check tarball-check
echo "Building and installing client-side in $(TARBALLDESTDIR)..."
DESTDIR=$(TARBALLDESTDIR) $(MAKE) client-install
echo "Tweaking for FreeNAS..."
(cd $(TARBALLDESTDIR); \
mkdir -p cfg cfg/rc.d cfg/local data local; \
mv etc/emulab cfg/emulab; \
mv usr/local/etc/emulab local/emulab; \
mv var/emulab data/emulab; \
ln -sf /data/emulab conf/base/var/emulab; \
rm -rf var data/emulab/sup; \
mkdir -p data/emulab/shadow data/emulab/vms; \
chflags noschg sbin/init; \
rm -rf boot etc root sbin usr/*; \
mv local usr/local; \
ln -sf /usr/local/emulab cfg/local/emulab)
(cd $(SRCDIR)/tmcc/freenas8; \
cp genvmtype $(TARBALLDESTDIR)/cfg/emulab/; \
cp testbed $(TARBALLDESTDIR)/cfg/rc.d/; \
cp bscontrol.proxy.pl $(TARBALLDESTDIR)/usr/local/emulab/bscontrol.proxy; \
cp freenas-config libfreenas.pm libvnode_blockstore.pm $(TARBALLDESTDIR)/usr/local/emulab/; \
rm -f $(TARBALLDESTDIR)/usr/local/emulab/rc/rc.kname; \
chmod -R g-w $(TARBALLDESTDIR)/usr/local/emulab)
OSSTUFF="OS=FreeBSD DIST=FreeNAS REL=$(REL)" \
DESTDIR=$(TARBALLDESTDIR) $(MAKE) client-install
echo "Creating tarball freenas-client.tar.gz..."
tar czf freenas-client.tar.gz -C $(TARBALLDESTDIR) .
......
......@@ -4952,6 +4952,7 @@ outfiles="Makeconf GNUmakefile setversion \
tmcc/freebsd7/GNUmakefile tmcc/freebsd7/netif-emulab \
tmcc/freebsd9/GNUmakefile tmcc/freebsd9/netif-emulab \
tmcc/freebsd10/GNUmakefile tmcc/freebsd10/netif-emulab \
tmcc/freenas8/GNUmakefile tmcc/freenas9/GNUmakefile \
tmcc/cygwinxp/GNUmakefile tmcc/dp/GNUmakefile \
tmcc/openbsd/GNUmakefile tmcc/ron/GNUmakefile \
tmcc/plab/GNUmakefile tmcc/cygwinseven/GNUmakefile \
......
......@@ -277,6 +277,7 @@ outfiles="Makeconf GNUmakefile setversion \
tmcc/freebsd7/GNUmakefile tmcc/freebsd7/netif-emulab \
tmcc/freebsd9/GNUmakefile tmcc/freebsd9/netif-emulab \
tmcc/freebsd10/GNUmakefile tmcc/freebsd10/netif-emulab \
tmcc/freenas8/GNUmakefile tmcc/freenas9/GNUmakefile \
tmcc/cygwinxp/GNUmakefile tmcc/dp/GNUmakefile \
tmcc/openbsd/GNUmakefile tmcc/ron/GNUmakefile \
tmcc/plab/GNUmakefile tmcc/cygwinseven/GNUmakefile \
......
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = @top_builddir@
SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
include $(OBJDIR)/Makeconf
SCRIPTS =
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
#
all: $(SCRIPTS)
include $(TESTBED_SRCDIR)/GNUmakerules
# clientside/tmcc OS depenedent directory for equivalent FreeBSD version
FBSDBASEDIR = freebsd7
OETCDIR = $(DESTDIR)$(CLIENT_ETCDIR)
NETCDIR = $(DESTDIR)/cfg/emulab
OBINDIR = $(DESTDIR)$(CLIENT_BINDIR)
NBINDIR = $(DESTDIR)/usr/local/emulab
OVARDIR = $(DESTDIR)$(CLIENT_VARDIR)
NVARDIR = $(DESTDIR)/data/emulab
ORCDIR = $(DESTDIR)/$(CLIENT_BINDIR)/rc
INSTALL = /usr/bin/install -c
destdircheck:
@if [ -z "$(DESTDIR)" ]; then \
echo "You must define DESTDIR for this target!"; \
false; \
fi
@if [ "$(DESTDIR)" = "/" ]; then \
echo "DESTDIR is '/', really really bad idea!"; \
false; \
fi
basefbsd-install:
(cd ../$(FBSDBASEDIR); $(MAKE) all install)
#
# This target is NOT intended for a native install (e.g., DESTDIR=/),
# it is only for a partial tree that is being used to construct a tarball.
#
# It would in fact be EXTREMELY DESTRUCTIVE if applied to a fully-populated
# filesystem (e.g., "rm -rf /etc" below). So DO NOT remove the destdircheck.
#
install client-install: destdircheck basefbsd-install
echo "Tweaking FreeBSD 8.3 installed files for FreeNAS..."
mkdir -p $(DESTDIR)/cfg $(DESTDIR)/cfg/rc.d $(DESTDIR)/cfg/local
mkdir -p $(DESTDIR)/data $(DESTDIR)/local $(DESTDIR)/conf/base/var
mv $(OETCDIR) $(NETCDIR)
rm -f $(ORCDIR)/rc.kname $(ORCDIR)/rc.canaryd $(ORCDIR)/rc.linktest
mv $(OBINDIR) $(DESTDIR)/local/emulab
mv $(OVARDIR) $(NVARDIR)
ln -sf /data/emulab $(DESTDIR)/conf/base/var/emulab
rm -rf $(NVARDIR)/sup
mkdir -p $(NVARDIR)/shadow $(NVARDIR)/vms
chflags noschg $(DESTDIR)/sbin/init
rm -rf $(DESTDIR)/boot $(DESTDIR)/etc $(DESTDIR)/root $(DESTDIR)/sbin
rm -rf $(DESTDIR)/usr/* $(DESTDIR)/var
mv $(DESTDIR)/local $(DESTDIR)/usr/local
ln -sf /usr/local/emulab $(DESTDIR)/cfg/local/emulab
echo "Installing FreeNAS files..."
$(INSTALL) -m 644 $(SRCDIR)/genvmtype $(NETCDIR)/
$(INSTALL) -m 755 $(SRCDIR)/testbed $(DESTDIR)/cfg/rc.d/
$(INSTALL) -m 755 $(SRCDIR)/bscontrol.proxy.pl $(NBINDIR)/bscontrol.proxy
$(INSTALL) -m 755 $(SRCDIR)/freenas-config $(NBINDIR)/
$(INSTALL) -m 644 $(SRCDIR)/libfreenas.pm $(NBINDIR)/
$(INSTALL) -m 644 $(SRCDIR)/libvnode_blockstore.pm $(NBINDIR)/
subboss-install simple-install:
frisbee-mfs-install mfs-install:
# (cd $(DESTDIR); \
# mkdir -p cfg cfg/rc.d cfg/local data local; \
# mv etc/emulab cfg/emulab; \
# mv usr/local/etc/emulab local/emulab; \
# rm -f local/emulab/rc/rc.canaryd local/emulab/rc/rc.linktest; \
# mv var/emulab data/emulab; \
# ln -sf /data/emulab conf/base/var/emulab; \
# rm -rf var data/emulab/sup; \
# mkdir -p data/emulab/shadow data/emulab/vms; \
# chflags noschg sbin/init; \
# rm -rf boot etc root sbin usr/*; \
# mv local usr/local; \
# ln -sf /usr/local/emulab cfg/local/emulab)
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = @top_builddir@
SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
include $(OBJDIR)/Makeconf
SCRIPTS =
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
#
all: $(SCRIPTS)
include $(TESTBED_SRCDIR)/GNUmakerules
# clientside/tmcc OS depenedent directory for equivalent FreeBSD version
FBSDBASEDIR = freebsd9
OETCDIR = $(DESTDIR)$(CLIENT_ETCDIR)
NETCDIR = $(DESTDIR)/cfg/emulab
OBINDIR = $(DESTDIR)$(CLIENT_BINDIR)
NBINDIR = $(DESTDIR)/usr/local/emulab
OVARDIR = $(DESTDIR)$(CLIENT_VARDIR)
NVARDIR = $(DESTDIR)/data/emulab
ORCDIR = $(DESTDIR)/$(CLIENT_BINDIR)/rc
INSTALL = /usr/bin/install -c
destdircheck:
@if [ -z "$(DESTDIR)" ]; then \
echo "You must define DESTDIR for this target!"; \
false; \
fi
@if [ "$(DESTDIR)" = "/" ]; then \
echo "DESTDIR is '/', really really bad idea!"; \
false; \
fi
basefbsd-install:
(cd ../$(FBSDBASEDIR); $(MAKE) all install)
#
# This target is NOT intended for a native install (e.g., DESTDIR=/),
# it is only for a partial tree that is being used to construct a tarball.
#
# It would in fact be EXTREMELY DESTRUCTIVE if applied to a fully-populated
# filesystem (e.g., "rm -rf /etc" below). So DO NOT remove the destdircheck.
#
install client-install: destdircheck basefbsd-install
echo "Tweaking FreeBSD 8.3 installed files for FreeNAS..."
mkdir -p $(DESTDIR)/cfg $(DESTDIR)/cfg/rc.d $(DESTDIR)/cfg/local
mkdir -p $(DESTDIR)/data $(DESTDIR)/local $(DESTDIR)/conf/base/var
mv $(OETCDIR) $(NETCDIR)
rm -f $(ORCDIR)/rc.kname $(ORCDIR)/rc.canaryd $(ORCDIR)/rc.linktest
mv $(OBINDIR) $(DESTDIR)/local/emulab
mv $(OVARDIR) $(NVARDIR)
ln -sf /data/emulab $(DESTDIR)/conf/base/var/emulab
rm -rf $(NVARDIR)/sup
mkdir -p $(NVARDIR)/shadow $(NVARDIR)/vms
chflags noschg $(DESTDIR)/sbin/init
rm -rf $(DESTDIR)/boot $(DESTDIR)/etc $(DESTDIR)/root $(DESTDIR)/sbin
rm -rf $(DESTDIR)/usr/* $(DESTDIR)/var
mv $(DESTDIR)/local $(DESTDIR)/usr/local
ln -sf /usr/local/emulab $(DESTDIR)/cfg/local/emulab
echo "Installing FreeNAS files..."
$(INSTALL) -m 644 $(SRCDIR)/genvmtype $(NETCDIR)/
$(INSTALL) -m 755 $(SRCDIR)/testbed $(DESTDIR)/cfg/rc.d/
$(INSTALL) -m 755 $(SRCDIR)/bscontrol.proxy.pl $(NBINDIR)/bscontrol.proxy
$(INSTALL) -m 755 $(SRCDIR)/freenas-config $(NBINDIR)/
$(INSTALL) -m 644 $(SRCDIR)/libfreenas.pm $(NBINDIR)/
$(INSTALL) -m 644 $(SRCDIR)/libvnode_blockstore.pm $(NBINDIR)/
subboss-install simple-install:
frisbee-mfs-install mfs-install:
#!/usr/bin/perl -wT
#
# Copyright (c) 2013-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
use strict;
use English;
use Getopt::Std;
#
# Proxy for the blockstore server control program on boss.
#
sub usage()
{
print STDERR "Usage: bscontrol [-hd] command args\n";
print STDERR " -h This message\n";
print STDERR " -d Print additional debug info\n";
print STDERR "commands:\n";
print STDERR " pools Print size info about pools\n";
print STDERR " volumes Print info about volumes\n";
print STDERR " create <pool> <vol> <size> [ <fstype> ]\n";
print STDERR " Create <vol> in <pool> with <size> in MiB; optionally create a filesystem of type <fstype> on it\n";
print STDERR " destroy <pool> <vol>\n";
print STDERR " Destroy <vol> in <pool>\n";
exit(-1);
}
my $optlist = "hd";
my $debug = 0;
#
# Turn off line buffering on output
#
$| = 1;
# Drag in path stuff so we can find emulab stuff.
BEGIN { require "/etc/emulab/paths.pm"; import emulabpaths; }
# Libraries
use libfreenas;
# Protos
sub fatal($);
# Commands
my %cmds = (
"pools" => \&pools,
"volumes" => \&volumes,
"create" => \&create,
"destroy" => \&destroy,
);
#
# Parse command arguments. Once we return from getopts, all that should be
# left are the required arguments.
#
my %options = ();
if (! getopts($optlist, \%options)) {
usage();
}
if (defined($options{h})) {
usage();
}
if (defined($options{d})) {
$debug = 1;
}
if (@ARGV < 1) {
usage();
}
my $cmd = shift;
if (!exists($cmds{$cmd})) {
print STDERR "Unrecognized command '$cmd', should be one of:\n";
print STDERR " ", join(", ", keys %cmds), "\n";
usage();
}
exit(&{$cmds{$cmd}}(@ARGV));
#
# Print all the available pools from which blockstores can be allocated
# along with size info.
#
sub pools()
{
my $pref = freenasPoolList();
foreach my $pool (keys %{$pref}) {
my $size = int($pref->{$pool}->{'size'});
my $avail = int($pref->{$pool}->{'avail'});
print "pool=$pool size=$size avail=$avail\n";
}
return 0;
}
#
# Print uninterpreted volume info.
#
sub volumes()
{
my $vref = freenasVolumeList(1);
foreach my $vol (keys %{$vref}) {
my $pool = $vref->{$vol}->{'pool'};
my $iname = $vref->{$vol}->{'iname'};
my $size = int($vref->{$vol}->{'size'});
if ($iname) {
print "volume=$vol pool=$pool size=$size iname=$iname\n";
} else {
print "volume=$vol pool=$pool size=$size\n";
}
}
return 0;
}
sub create($$$;$)
{
my ($pool,$vol,$size,$fstype) = @_;
if (defined($pool) && $pool =~ /^([-\w]+)$/) {
$pool = $1;
} else {
print STDERR "bscontrol_proxy: bogus pool arg\n";
return 1;
}
if (defined($vol) && $vol =~ /^([-\w]+)$/) {
$vol = $1;
} else {
print STDERR "bscontrol_proxy: bogus volume arg\n";
return 1;
}
if (defined($size) && $size =~ /^(\d+)$/) {
$size = $1;
} else {
print STDERR "bscontrol_proxy: bogus size arg\n";
return 1;
}
if (!defined($fstype)) {
$fstype = "none";
} elsif ($fstype =~ /^(ext2|ext3|ext4|ufs)$/) {
$fstype = $1;
} else {
print STDERR "bscontrol_proxy: bogus fstype arg\n";
return 1;
}
my $rv = freenasVolumeCreate($pool, $vol, $size);
if ($rv == 0 && $fstype ne "none") {
$rv = freenasFSCreate($pool, $vol, $fstype);
}
return $rv;
}
sub destroy($$$)
{
my ($pool,$vol) = @_;
if (defined($pool) && $pool =~ /^([-\w]+)$/) {
$pool = $1;
} else {
print STDERR "bscontrol_proxy: bogus pool arg\n";
return 1;
}
if (defined($vol) && $vol =~ /^([-\w]+)$/) {
$vol = $1;
} else {
print STDERR "bscontrol_proxy: bogus volume arg\n";
return 1;
}
return freenasVolumeDestroy($pool, $vol);
}
This diff is collapsed.
This diff is collapsed.
#!/bin/sh
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
# PROVIDE: testbed
# REQUIRE: sshd
#
. /etc/rc.subr
. /etc/emulab/paths.sh
name="testbed"
command="$BINDIR/rc/rc.testbed"
load_rc_config $name
run_rc_command "$1"
#!/usr/bin/perl -wT
BEGIN { require "/etc/emulab/paths.pm"; import emulabpaths; }
use libutil;
use libsetup;
use libtmcc;
use libvnode_blockstore;
use Getopt::Std;
use Data::Dumper;
# func protos
sub mkvnconfig($);
my $setup = 0;
my $teardown = 0;
my %opts = ();
if (!getopts("st", \%opts)) {
print STDERR "Usage: $0 [-s|-t]\n";
exit 1;
}
$setup = 1
if exists($opts{'s'});
$teardown = 1
if exists($opts{'t'});
# Set debugging in library
libvnode_blockstore::setDebug(1);
# Test FreeNAS list parsing
my @list = libvnode_blockstore::parseFreeNASListing("ist_extent");
print "Dump of FreeNAS ist_extent:\n" . Dumper(@list);
# List off slice info
my $sliceh = libvnode_blockstore::getSliceList();
print "Dump of FreeNAS slices:\n" . Dumper(%$sliceh);
# List off pools
my $pools = libvnode_blockstore::getPoolList();
print "Dump of FreeNAS pools:\n" . Dumper(%$pools);
# Grab and stash away storageconfig stuff for some vnode.
my $vnodeid = "dboxvm1-1";
my $vnconfig = mkvnconfig($vnodeid);
# do full, bottom-up slice setup
if ($setup) {
libvnode_blockstore::vnodeCreate($vnodeid, undef, $vnconfig,
$vnconfig->{'private'});
}
# Sleep for a bit...
#sleep 30;
# Tear it down!
if ($teardown) {
libvnode_blockstore::vnodeDestroy($vnodeid, undef, $vnconfig,
$vnconfig->{'private'});
}
exit(0);
# Try to allocate a slice.
my %sconf = (
'CMD' => "SLICE",
'IDX' => "1",
'BSID' => "rz-1",
'VOLNAME' => "d-1",
'VOLSIZE' => "51200",
);
libvnode_blockstore::allocSlice($vnodeid, \%sconf, $vnconfig,
$vnconfig->{'private'});
# Try to export it!
my %sconf2 = (
'CMD' => "EXPORT",
'IDX' => "2",
'CLASS' => "SAN",
'PROTO' => "iSCSI",
'VOLNAME' => "d-1",
'VOLSIZE' => "51200",
'PERMS' => "rw",
'UUID' => "iqn.2000-10.net.emulab:tbres:sandev:d-1",
'UUID_TYPE' => "iqn",
);
libvnode_blockstore::exportSlice($vnodeid, \%sconf2, $vnconfig,
$vnconfig->{'private'});
sub mkvnconfig($) {
my $vnodeid = shift;
libsetup_setvnodeid($vnodeid);
my %vnconfig = ( "vnodeid" => $vnodeid,
"config" => undef,
"ifconfig" => undef,
"ldconfig" => undef,
"tunconfig" => undef,
"attributes"=> undef,
);
$vnconfig{'private'} = {};
my %tmp;
my @tmp;
my $tmp;
my %attrs;
#libtmcc::configtmcc("portnum",7778);
fatal("Could not get vnode config for $vnodeid")
if (getgenvnodeconfig(\%tmp));
$vnconfig{"config"} = \%tmp;
fatal("getifconfig($vnodeid): $!")
if (getifconfig(\@tmp));
$vnconfig{"ifconfig"} = [ @tmp ];
fatal("getlinkdelayconfig($vnodeid): $!")
if (getlinkdelayconfig(\@tmp));
$vnconfig{"ldconfig"} = [ @tmp ];
fatal("gettunnelconfig($vnodeid): $!")
if (gettunnelconfig(\$tmp));
$vnconfig{"tunconfig"} = $tmp;
fatal("getnodeattributes($vnodeid): $!")
if (getnodeattributes(\%attrs));
$vnconfig{"attributes"} = \%attrs;
fatal("getstorageconfig($vnodeid): $!")
if (getstorageconfig(\@tmp));
$vnconfig{"storageconfig"} = \@tmp;
print "vnconfig:\n" . Dumper(%vnconfig);
return \%vnconfig;
}
......@@ -37,6 +37,48 @@ else
arg=$1
fi
# XXX cheezy hack for cross-building: if OSSTUFF env is set, use that info
if [ -n "$OSSTUFF" ]; then
for _kv in $OSSTUFF; do
_k=${_kv%%=*}
_v=${_kv##*=}
case $_k in
TAG|OS|DIST|REL)
eval $_k=\"$_v\"
;;
esac
done
if [ -z "$OS" -o -z "$DIST" -o -z "$REL" ]; then
echo "osstuff: malformed OSSTUFF environment var"
exit 1
fi
if [ -z "$TAG" ]; then
p1=`echo $DIST | tr '[A-Z]' '[a-z]'`
p2=`echo $REL | sed -e 's/^\([0-9]*\).*/\1/'`
TAG="${p1}${p2}"
fi
case $arg in
-a)
echo "TAG=$TAG OS=$OS DIST=$DIST REL=$REL"
;;
-t)
echo "$TAG"
;;
-o)
echo "$OS"
;;
-d)
echo "$DIST"
;;
-r)
echo "$REL"
;;
esac
exit 0
fi
os=`uname -s`
tag=
dist=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment