Skip to content

Commit

Permalink
20110303 release:
Browse files Browse the repository at this point in the history
/etc/rc was slightly reorganized in 4.9, reflect these changes, don't untar tardirs twice, still ok on 4.8 too.
fix rc.shutdown too (so we don't extract before re-compacting tardirs).
  • Loading branch information
yellowman committed Jun 2, 2012
1 parent 48d962c commit a075fa1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
6 changes: 5 additions & 1 deletion cfgflashrd
Expand Up @@ -113,8 +113,10 @@ vnuncfgroot() {
if [ -z "$dest" -a -z "$novnd" ]; then
cat <<-EOF
% cfgflashrd [-disk "dev" | -image "filename"] [-rdroot "filename"] [-com0 "speed"] [-mp] [-tz "tzfile"]
use -disk to configure an attached disk
"dev" as in wd2, sd3, etc...
use -rdroot flag if you have built rdrootfs image and want to change disk parameters on it
or, use -image to configure a disk image
use -rdroot flag if you have an rdrootfs image and want to change disk parameters on it
use -com0 flag if you want to direct console from vga to com0 at "speed" speed
use -mp to set bsd.mp as primary kernel, if exists (shifting bsd to bsd.sp)
use -tz to copy /usr/share/zoneinfo/"tzfile" to destination image /etc/localtime
Expand Down Expand Up @@ -436,9 +438,11 @@ fi

if [ ! -z "$tzfile" ]; then
if [ -f /usr/share/zoneinfo/$tzfile ]; then
rm $tmpmntvnd/localtime
cp /usr/share/zoneinfo/$tzfile $tmpmntvnd/localtime
else
if [ -f $tzfile ]; then
rm $tmpmntvnd/localtime
cp $tzfile $tmpmntvnd/localtime
fi
fi
Expand Down
27 changes: 15 additions & 12 deletions etc/rc.conf.local
Expand Up @@ -4,18 +4,21 @@

tardirs="var"

if [ ! -f /tmp/.tardirs ]; then
# /etc/rc runs rc.conf, then /etc/netstart runs it again, but only do this stuff once

for i in $tardirs; do
echo tardirs: extracting $i
tar xpf /flash/$i.tar -C /$i
done

chmod 1777 /tmp
fi

touch /tmp/.tardirs
for i in $tardirs; do
# rc.conf runs early in /etc/rc, and again in /etc/netstart
# in OpenBSD 4.9, mfs dirs are not yet available on the first run
# therefore, check for mount first
if mount | egrep ^mfs".*"/$i >/dev/null ; then
if [ ! -f /$i/.tardirs.$i ]; then
echo tardirs: extracting $i
tar xpf /flash/$i.tar -C /$i
touch /$i/.tardirs.$i
fi
fi
done

# XXX one day, track down the cause of this insanity
chmod 1777 /tmp >/dev/null 2>&1

# Insert actual rc.conf.local directives HERE

Expand Down
1 change: 1 addition & 0 deletions etc/rc.shutdown
Expand Up @@ -15,6 +15,7 @@ if [ ! -z "$tardirs" ]; then

for i in $tardirs; do
echo tardirs: compacting $i
rm -f /$i/.tardirs.$i
tar cf /flash/$i.tar -C /$i .
done

Expand Down
2 changes: 1 addition & 1 deletion flashrd
Expand Up @@ -6,7 +6,7 @@

date=`date +%Y%m%d`
arch=`uname -m`
vers=20101001
vers=20110303

export device=svnd3 # least likely to conflict ?
export rootdevice=svnd2 # used to mount flash vnd for writing of stuff inside
Expand Down
5 changes: 5 additions & 0 deletions stand/rc
Expand Up @@ -32,6 +32,11 @@ mkvndmnt()
x=0
fail=0

if [ ! -f $1/openbsd.vnd ]; then
echo bootstrap: $1/openbsd.vnd not found!
fail=1
fi

if ! vnconfig $vnd $1/openbsd.vnd; then
fail=1
fi
Expand Down

0 comments on commit a075fa1

Please sign in to comment.