Commit 005a89f8 authored by Mike Hibler's avatar Mike Hibler

FreeBSD 12 (aka, "current") support I started long ago.

parent 8cf38fc2
......@@ -4559,6 +4559,7 @@ outfiles="Makeconf GNUmakefile setversion \
tmcc/freebsd/init/10/GNUmakefile \
tmcc/freebsd/init/10.3/GNUmakefile \
tmcc/freebsd/init/11/GNUmakefile \
tmcc/freebsd/init/12/GNUmakefile \
tmcc/freebsd/supfile tmcc/freebsd/sethostname \
tmcc/linux/GNUmakefile tmcc/linux/supfile \
tmcc/linux/sethostname.dhclient \
......@@ -4580,6 +4581,7 @@ outfiles="Makeconf GNUmakefile setversion \
tmcc/freebsd9/GNUmakefile tmcc/freebsd9/netif-emulab \
tmcc/freebsd10/GNUmakefile tmcc/freebsd10/netif-emulab \
tmcc/freebsd11/GNUmakefile tmcc/freebsd11/netif-emulab \
tmcc/freebsd12/GNUmakefile tmcc/freebsd12/netif-emulab \
tmcc/freenas8/GNUmakefile tmcc/freenas9/GNUmakefile \
tmcc/cygwinxp/GNUmakefile tmcc/dp/GNUmakefile \
tmcc/openbsd/GNUmakefile tmcc/ron/GNUmakefile \
......
#
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
# Copyright (c) 2000-2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -286,6 +286,7 @@ outfiles="Makeconf GNUmakefile setversion \
tmcc/freebsd/init/10/GNUmakefile \
tmcc/freebsd/init/10.3/GNUmakefile \
tmcc/freebsd/init/11/GNUmakefile \
tmcc/freebsd/init/12/GNUmakefile \
tmcc/freebsd/supfile tmcc/freebsd/sethostname \
tmcc/linux/GNUmakefile tmcc/linux/supfile \
tmcc/linux/sethostname.dhclient \
......@@ -307,6 +308,7 @@ outfiles="Makeconf GNUmakefile setversion \
tmcc/freebsd9/GNUmakefile tmcc/freebsd9/netif-emulab \
tmcc/freebsd10/GNUmakefile tmcc/freebsd10/netif-emulab \
tmcc/freebsd11/GNUmakefile tmcc/freebsd11/netif-emulab \
tmcc/freebsd12/GNUmakefile tmcc/freebsd12/netif-emulab \
tmcc/freenas8/GNUmakefile tmcc/freenas9/GNUmakefile \
tmcc/cygwinxp/GNUmakefile tmcc/dp/GNUmakefile \
tmcc/openbsd/GNUmakefile tmcc/ron/GNUmakefile \
......
......@@ -68,20 +68,17 @@ FBSDMAJ := $(basename $(FBSDREL))
WITH_LTHREADS = 0
ifeq ($(FBSDMAJ),4)
WITH_LTHREADS = 1
endif
ifeq ($(FBSDMAJ),5)
# XXX 5.3 and linuxthreads don't see to get along
# 7.0 and beyond should not need it
ifneq ($(FBSDREL),5.3)
ifneq ($(FBSDMAJ),7)
ifneq ($(FBSDMAJ),8)
ifneq ($(FBSDMAJ),9)
ifneq ($(FBSDMAJ),10)
ifneq ($(FBSDMAJ),11)
WITH_LTHREADS = 1
endif
endif
endif
endif
endif
ifeq ($(FBSDMAJ),6)
WITH_LTHREADS = 1
endif
endif
......
......@@ -76,20 +76,17 @@ endif
WITH_LTHREADS = 0
ifeq ($(FBSDMAJ),4)
WITH_LTHREADS = 1
endif
ifeq ($(FBSDMAJ),5)
# XXX 5.3 and linuxthreads don't see to get along
# 7.0 and beyond should not need it
ifneq ($(FBSDREL),5.3)
ifneq ($(FBSDMAJ),7)
ifneq ($(FBSDMAJ),8)
ifneq ($(FBSDMAJ),9)
ifneq ($(FBSDMAJ),10)
ifneq ($(FBSDMAJ),11)
WITH_LTHREADS = 1
endif
endif
endif
endif
endif
ifeq ($(FBSDMAJ),6)
WITH_LTHREADS = 1
endif
endif
......
......@@ -15,8 +15,11 @@ include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT -DTESTBED
init: init.c pathnames.h
$(CC) $(CFLAGS) -static -o init $< -lutil -lcrypt
init.c: pathnames.h mntopts.h
getmntopts.c: mntopts.h
init: init.c getmntopts.c
$(CC) $(CFLAGS) -static -o init $^ -lutil -lcrypt
install:
......
/*-
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if 0
#ifndef lint
static char sccsid[] = "@(#)getmntopts.c 8.3 (Berkeley) 3/29/95";
#endif /* not lint */
#endif
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: head/sbin/mount/getmntopts.c 314436 2017-02-28 23:42:47Z imp $");
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/uio.h>
#include <err.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mntopts.h"
int getmnt_silent = 0;
void
getmntopts(const char *options, const struct mntopt *m0, int *flagp,
int *altflagp)
{
const struct mntopt *m;
int negative, len;
char *opt, *optbuf, *p;
int *thisflagp;
/* Copy option string, since it is about to be torn asunder... */
if ((optbuf = strdup(options)) == NULL)
err(1, NULL);
for (opt = optbuf; (opt = strtok(opt, ",")) != NULL; opt = NULL) {
/* Check for "no" prefix. */
if (opt[0] == 'n' && opt[1] == 'o') {
negative = 1;
opt += 2;
} else
negative = 0;
/*
* for options with assignments in them (ie. quotas)
* ignore the assignment as it's handled elsewhere
*/
p = strchr(opt, '=');
if (p != NULL)
*++p = '\0';
/* Scan option table. */
for (m = m0; m->m_option != NULL; ++m) {
len = strlen(m->m_option);
if (strncasecmp(opt, m->m_option, len) == 0)
if (opt[len] == '\0' || opt[len] == '=')
break;
}
/* Save flag, or fail if option is not recognized. */
if (m->m_option) {
thisflagp = m->m_altloc ? altflagp : flagp;
if (negative == m->m_inverse)
*thisflagp |= m->m_flag;
else
*thisflagp &= ~m->m_flag;
} else if (!getmnt_silent) {
errx(1, "-o %s: option not supported", opt);
}
}
free(optbuf);
}
void
rmslashes(char *rrpin, char *rrpout)
{
char *rrpoutstart;
*rrpout = *rrpin;
for (rrpoutstart = rrpout; *rrpin != '\0'; *rrpout++ = *rrpin++) {
/* skip all double slashes */
while (*rrpin == '/' && *(rrpin + 1) == '/')
rrpin++;
}
/* remove trailing slash if necessary */
if (rrpout - rrpoutstart > 1 && *(rrpout - 1) == '/')
*(rrpout - 1) = '\0';
else
*rrpout = '\0';
}
int
checkpath(const char *path, char *resolved)
{
struct stat sb;
if (realpath(path, resolved) == NULL || stat(resolved, &sb) != 0)
return (1);
if (!S_ISDIR(sb.st_mode)) {
errno = ENOTDIR;
return (1);
}
return (0);
}
void
build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val,
size_t len)
{
int i;
if (*iovlen < 0)
return;
i = *iovlen;
*iov = realloc(*iov, sizeof **iov * (i + 2));
if (*iov == NULL) {
*iovlen = -1;
return;
}
(*iov)[i].iov_base = strdup(name);
(*iov)[i].iov_len = strlen(name) + 1;
i++;
(*iov)[i].iov_base = val;
if (len == (size_t)-1) {
if (val != NULL)
len = strlen(val) + 1;
else
len = 0;
}
(*iov)[i].iov_len = (int)len;
*iovlen = ++i;
}
/*
* This function is needed for compatibility with parameters
* which used to use the mount_argf() command for the old mount() syscall.
*/
void
build_iovec_argf(struct iovec **iov, int *iovlen, const char *name,
const char *fmt, ...)
{
va_list ap;
char val[255] = { 0 };
va_start(ap, fmt);
vsnprintf(val, sizeof(val), fmt, ap);
va_end(ap);
build_iovec(iov, iovlen, name, strdup(val), (size_t)-1);
}
/*
* Free the iovec and reset to NULL with zero length. Useful for calling
* nmount in a loop.
*/
void
free_iovec(struct iovec **iov, int *iovlen)
{
int i;
for (i = 0; i < *iovlen; i++)
free((*iov)[i].iov_base);
free(*iov);
}
......@@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
......@@ -41,7 +41,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 7/15/93";
#endif
static const char rcsid[] =
"$FreeBSD: releng/11.0/sbin/init/init.c 299874 2016-05-16 00:34:48Z araujo $";
"$FreeBSD: head/sbin/init/init.c 314436 2017-02-28 23:42:47Z imp $";
#endif /* not lint */
#include <sys/param.h>
......@@ -870,6 +870,7 @@ single_user(void)
sigset_t mask;
const char *shell;
char *argv[2];
struct timeval tv, tn;
#ifdef SECURE
struct ttyent *typ;
struct passwd *pp;
......@@ -884,8 +885,13 @@ single_user(void)
if (Reboot) {
/* Instead of going single user, let's reboot the machine */
sync();
reboot(howto);
_exit(0);
if (reboot(howto) == -1) {
emergency("reboot(%#x) failed, %s", howto,
strerror(errno));
_exit(1); /* panic and reboot */
}
warning("reboot(%#x) returned", howto);
_exit(0); /* panic as well */
}
shell = get_shell();
......@@ -1061,7 +1067,14 @@ single_user(void)
* reboot(8) killed shell?
*/
warning("single user shell terminated.");
sleep(STALL_TIMEOUT);
gettimeofday(&tv, NULL);
tn = tv;
tv.tv_sec += STALL_TIMEOUT;
while (tv.tv_sec > tn.tv_sec || (tv.tv_sec ==
tn.tv_sec && tv.tv_usec > tn.tv_usec)) {
sleep(1);
gettimeofday(&tn, NULL);
}
_exit(0);
} else {
warning("single user shell terminated, restarting");
......
/*-
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)mntopts.h 8.7 (Berkeley) 3/29/95
* $FreeBSD: head/sbin/mount/mntopts.h 314436 2017-02-28 23:42:47Z imp $
*/
struct mntopt {
const char *m_option; /* option name */
int m_inverse; /* if a negative option, e.g. "atime" */
long long m_flag; /* bit to set, e.g. MNT_RDONLY */
int m_altloc; /* 1 => set bit in altflags */
};
/* User-visible MNT_ flags. */
#define MOPT_ASYNC { "async", 0, MNT_ASYNC, 0 }
#define MOPT_NOATIME { "atime", 1, MNT_NOATIME, 0 }
#define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC, 0 }
#define MOPT_NOSUID { "suid", 1, MNT_NOSUID, 0 }
#define MOPT_NOSYMFOLLOW { "symfollow", 1, MNT_NOSYMFOLLOW, 0 }
#define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY, 0 }
#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS, 0 }
#define MOPT_UNION { "union", 0, MNT_UNION, 0 }
#define MOPT_USERQUOTA { "userquota", 0, 0, 0 }
#define MOPT_GROUPQUOTA { "groupquota", 0, 0, 0 }
#define MOPT_NOCLUSTERR { "clusterr", 1, MNT_NOCLUSTERR, 0 }
#define MOPT_NOCLUSTERW { "clusterw", 1, MNT_NOCLUSTERW, 0 }
#define MOPT_SUIDDIR { "suiddir", 0, MNT_SUIDDIR, 0 }
#define MOPT_SNAPSHOT { "snapshot", 0, MNT_SNAPSHOT, 0 }
#define MOPT_MULTILABEL { "multilabel", 0, MNT_MULTILABEL, 0 }
#define MOPT_ACLS { "acls", 0, MNT_ACLS, 0 }
#define MOPT_NFS4ACLS { "nfsv4acls", 0, MNT_NFS4ACLS, 0 }
#define MOPT_AUTOMOUNTED { "automounted",0, MNT_AUTOMOUNTED, 0 }
/* Control flags. */
#define MOPT_FORCE { "force", 0, MNT_FORCE, 0 }
#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 }
#define MOPT_RO { "ro", 0, MNT_RDONLY, 0 }
#define MOPT_RW { "rw", 1, MNT_RDONLY, 0 }
/* This is parsed by mount(8), but is ignored by specific mount_*(8)s. */
#define MOPT_AUTO { "auto", 0, 0, 0 }
/* A handy macro as terminator of MNT_ array. */
#define MOPT_END { NULL, 0, 0, 0 }
#define MOPT_FSTAB_COMPAT \
MOPT_RO, \
MOPT_RW, \
MOPT_AUTO
/* Standard options which all mounts can understand. */
#define MOPT_STDOPTS \
MOPT_USERQUOTA, \
MOPT_GROUPQUOTA, \
MOPT_FSTAB_COMPAT, \
MOPT_NOATIME, \
MOPT_NOEXEC, \
MOPT_SUIDDIR, /* must be before MOPT_NOSUID */ \
MOPT_NOSUID, \
MOPT_NOSYMFOLLOW, \
MOPT_RDONLY, \
MOPT_UNION, \
MOPT_NOCLUSTERR, \
MOPT_NOCLUSTERW, \
MOPT_MULTILABEL, \
MOPT_ACLS, \
MOPT_NFS4ACLS, \
MOPT_AUTOMOUNTED
void getmntopts(const char *, const struct mntopt *, int *, int *);
void rmslashes(char *, char *);
int checkpath(const char *, char resolved_path[]);
extern int getmnt_silent;
void build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, size_t len);
void build_iovec_argf(struct iovec **iov, int *iovlen, const char *name, const char *fmt, ...);
void free_iovec(struct iovec **iovec, int *iovlen);
......@@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
......@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*
* @(#)pathnames.h 8.1 (Berkeley) 6/5/93
* $FreeBSD: releng/11.0/sbin/init/pathnames.h 290548 2015-11-08 17:33:48Z trasz $
* $FreeBSD: head/sbin/init/pathnames.h 314436 2017-02-28 23:42:47Z imp $
*/
#include <paths.h>
......
#
# Copyright (c) 2000-2017 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/>.
#
# }}}
#
#
# XXX ONLY RUN THIS INSTALL ON A FREEBSD 12.x TESTBED NODE!
#
# Trivial. These things just need to be installed into the right place
# on a testbed node before cutting an image.
#
#
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: netif-emulab $(SCRIPTS)
include $(TESTBED_SRCDIR)/GNUmakerules
SYSETCDIR = $(DESTDIR)/etc
JAILDIR = $(SYSETCDIR)/jail
ETCDIR = $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR = $(DESTDIR)$(CLIENT_BINDIR)
VARDIR = $(DESTDIR)$(CLIENT_VARDIR)
LETCDIR = $(DESTDIR)/usr/local/etc
RCDIR = $(LETCDIR)/rc.d
ISMFS = $(ETCDIR)/ismfs
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
install client-install: bincheck basefbsd-install etc-install \
sup-install script-install bin-install
subboss-install: bincheck basefbsd-subboss-install etc-install \
sup-install script-install bin-install
simple-install: script-install bin-install
#
# XXX make sure the isc-dhcpd port is installed,
# XXX as of June 2015, the FreeBSD port no longer maintains the
# /usr/bin/perl symlink which we rely on, so it may be wrong or missing.
#
bincheck:
@if [ ! -x /usr/local/sbin/dhclient ]; then \
echo "Need to install net/isc-dhcp3-client port"; \
false; \
fi
@if [ ! -x /usr/bin/perl ]; then \
ln -sf /usr/local/bin/perl5 /usr/bin/perl; \
fi
dir-install:
$(INSTALL) -m 755 -o root -g wheel -d $(DESTDIR)/boot
$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)/rc.d
$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)/rc.conf.d
$(INSTALL) -m 755 -o root -g wheel -d $(ETCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(BINDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(LETCDIR)/sudoers.d
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/db
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/jails
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/logs
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/sup
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/boot
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/lock
-rm -rf $(DESTDIR)/etc/testbed
ln -s emulab $(DESTDIR)/etc/testbed
-rm -rf $(LETCDIR)/testbed
ln -s emulab $(LETCDIR)/testbed
basefbsd-install: dir-install
(cd ../freebsd5; $(MAKE) all install)
rm -rf $(SYSETCDIR)/rc.conf.d
rm -f $(LETCDIR)/dhclient*
ln -s /etc/dhclient-enter-hooks $(LETCDIR)/
ln -s /etc/dhclient-exit-hooks $(LETCDIR)/
$(INSTALL) -m 644 $(SRCDIR)/sudoers.emulab $(LETCDIR)/sudoers.d/emulab
basefbsd-subboss-install: dir-install
(cd ../freebsd5; $(MAKE) all subboss-install)
rm -rf $(SYSETCDIR)/rc.conf.d
rm -f $(LETCDIR)/dhclient*
ln -s /etc/dhclient-enter-hooks $(LETCDIR)/
ln -s /etc/dhclient-exit-hooks $(LETCDIR)/
$(INSTALL) -m 644 $(SRCDIR)/sudoers.emulab $(LETCDIR)/sudoers.d/emulab
tweak-syslog:
@if [ -f $(SYSETCDIR)/newsyslog.conf ]; then \
if `grep -q 'Added by Emulab' $(SYSETCDIR)/newsyslog.conf`; then \
sed -i .preemulab -e '/Added by Emulab/,$$d' $(SYSETCDIR)/newsyslog.conf; \
fi; \
cat $(SRCDIR)/newsyslog.conf.tail >> $(SYSETCDIR)/newsyslog.conf; \
fi
# Do not even pretend to do cvsup anymore
sup-install: dir-install
rm -f $(ETCDIR)/supfile
bin-install: dir-install
etc-install: dir-install sysetc-install
$(INSTALL) -m 644 $(SRCDIR)/group $(ETCDIR)/group
$(INSTALL) -m 600 $(SRCDIR)/master.passwd $(ETCDIR)/master.passwd
$(INSTALL) -m 444 $(SRCDIR)/hosts $(ETCDIR)/hosts
sysetc-install: dir-install netif-emulab tweak-syslog
$(INSTALL) -m 444 $(SRCDIR)/rc.conf $(SYSETCDIR)/rc.conf
$(INSTALL) -m 444 $(SRCDIR)/sysctl.conf $(SYSETCDIR)/sysctl.conf
$(INSTALL) -m 555 ./netif-emulab $(SYSETCDIR)/rc.d/netif-emulab
rm -f $(SYSETCDIR)/rc.early
$(INSTALL) -m 644 $(SRCDIR)/loader.conf $(DESTDIR)/boot/loader.conf
$(INSTALL) -m 755 $(SRCDIR)/dhclient-exit-hooks \
$(SYSETCDIR)/dhclient-exit-hooks
script-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/rc.freebsd $(BINDIR)/rc
#
# XXX we still do this like freebsd5!
#
frisbee-mfs-install: destdircheck
(cd ../freebsd5; $(MAKE) all frisbee-mfs-install)
rm -f $(SYSETCDIR)/testbed/dhclient
rm -f $(LETCDIR)/dhclient*
ln -s /etc/dhclient-enter-hooks $(LETCDIR)/
ln -s /etc/dhclient-exit-hooks $(LETCDIR)/
@if [ -r $(SRCDIR)/master.passwd ]; then \
$(INSTALL) -m 600 $(SRCDIR)/master.passwd $(SYSETCDIR); \
pwd_mkdb -d $(SYSETCDIR) $(SYSETCDIR)/master.passwd; \
fi
@if [ -r $(SRCDIR)/group ]; then \
$(INSTALL) -m 644 $(SRCDIR)/group $(SYSETCDIR); \
fi
mfs-install:
(cd ../freebsd5; $(MAKE) all mfs-install)
rm -f $(SYSETCDIR)/testbed/dhclient
rm -f $(LETCDIR)/dhclient*
ln -s /etc/dhclient-enter-hooks $(LETCDIR)/
ln -s /etc/dhclient-exit-hooks $(LETCDIR)/
@if [ -r $(SRCDIR)/master.passwd ]; then \
$(INSTALL) -m 600 $(SRCDIR)/master.passwd $(SYSETCDIR); \
pwd_mkdb -d $(SYSETCDIR) $(SYSETCDIR)/master.passwd; \
fi
@if [ -r $(SRCDIR)/group ]; then \
$(INSTALL) -m 644 $(SRCDIR)/group $(SYSETCDIR); \
fi
#!/bin/sh
#
# Copyright (c) 2000-2015 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/>.
#
# }}}
#
. /etc/emulab/paths.sh
echo "`date`: ${interface}: ${reason}" >>$LOGDIR/dhclient-exit.log 2>&1
if [ x$reason != xREBOOT -a x$reason != xBOUND -a x$reason != xRENEW -a x$reason != xREBIND ]
then
exit 0
fi
date >$LOGDIR/dhclient.log 2>&1
#
# ElabinElab support (inner boss and ops)
#
if [ -e "$ETCDIR/outer_bossnode" ]; then
#
# Inner boss or ops. The outer network has now been configured.
# Call rc.inelab to get the inner control network configured (we
# have to ask outer boss in the usual manner).
#
$BINDIR/rc/rc.inelab >>$LOGDIR/dhclient.log 2>&1
# Then kill as we normally do.
killall dhclient >>$LOGDIR/dhclient.log 2>&1
exit 0
fi
#
# ElabinElab support
#
# The enter-hooks script should weed out outer boss calls, so there
# should be nothing to do here. However, just in case we smack em down
# again here.
#
if [ x"$new_domain_name_servers" = "x1.1.1.1" ]; then
exit_status=1
exit 1
fi
#
# Remember our server IP, real hostname, router IP, etc.
#
echo $new_dhcp_server_identifier > $BOOTDIR/bossip
echo $new_host_name