[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dbootstrap now working, busybox needs serial con change.



Adam Di Carlo wrote:
> Erik Andersen <andersen@xmission.com> writes:
> 
> > I don't think logging to /var/log/messages would work well, since we
> > have no guarantee that the root filesystem is writable, and even if it
> > is writable, there are lots of cases where eternal, persistent spammage
> > of /var would not be nice. 

It should be writable because dbootstrap requires it to store temporary
informations (/tmp/kbdconf when configuring the keyboard, /tmp/notarget when
configuring the network before mounting the target filesystem, at drivers
configuration step, ...).

> > Hmm. I've been thinking about writing a micro syslogd for busybox, and I
> > could have busybox just log this crap to to the syslog. Then those that
> > want to see logging stuff could add something like this to /etc/init.d/rcS:
> > 
> >     # Setup a 256k ramdisk on /dev/ram2 and mount it over /var
> >     # so syslogd can log stuff...
> >     #
> >     echo -n "Building ramdisks: "
> >     dd if=/dev/zero of=/dev/ram2 bs=1k count=256 > /dev/null 2>&1
> >     /bin/mkfs.ext2 -n30 /dev/ram2 256 > /dev/null 2>&1
> >     mount /dev/ram2 /var -t ext2 -o rw
> >     mkdir /var/log
> >     echo "done."
> 
> Yuck yuck yuck.  Isn't there a better (simpler) way?

I like this solution especially for nfsroot because the filesystem could then
be mounted read-only instead of rw with root access.  It will be more secure.
We could then write all temporary data to /var/tmp for instance.

I don't think it is needed for initrd because the ramdisk is already writable.
Just keep enough space to store the log (256k could be too much, maybe 100k ?).

Regards.

-- 
 Eric Delaunay                 | "La guerre justifie l'existence des militaires.
 delaunay@lix.polytechnique.fr | En les supprimant." Henri Jeanson (1900-1970)


Reply to: