cvs commit: src/share/examples/diskless clone_root

Dag-Erling Smørgrav des at des.no
Thu Sep 23 12:29:18 PDT 2004


Brooks Davis <brooks at one-eyed-alien.net> writes:
> The problem is that currently there is no way to populate /var without a
> minimum of mtree which lives in /usr.  Since /var is supposed to exist
> before we mount /usr there's a dependency problem.  We should be able
> to fix the mtree dependency now that bsdtar is available since we could
> install a pax archive derived from the mtree file.

...or mtree could move to /sbin.

>                                                     We also strongly
> desire the creation of syslog files which currently requires newsyslog.

You can easily implement 'newsyslog -CC' with sh, touch, chown and
chmod:

while read file arg1 arg2 rest ; do
    touch "${file}"
    case ${arg1} in
    *:*)
        chown "${arg1}" "${file}"
        arg1="${arg2}"
        ;;
    esac
    case ${arg1} in
    [0-7][0-7][0-7])
        chmod "0${arg1}" "${file}"
        ;;
    esac
done </etc/newsyslog.conf

(unfortunately, chown is in /usr/sbin, so you may have to skip that
step, or do the chown later.  touch is in /usr/bin, but see below)

> The requirement for touch might be removable but I haven't really tried
> since the others are more fundamental.

You can easily implement 'touch' with sh and test:

touch() {
    /bin/test -e "$1" || :>"$1"
}

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the cvs-src mailing list