I finally have a working update to the /linuxrc script for bering.

To avoid any nasty space<>tab confusion, and to avoid sending attachments to the list, I've made a small tarball with the new script, an example leaf.cfg file, and some documentation avaialble as a tarball at the following URL:
http://lrp.steinkuehler.net/files/kernels/misc-stuff/linuxrc-2004-03-12.tgz


There are a few items on the 'TODO' list, mainly because I have not discussed them on-list, and I don't want to change any bering-specific functionality that's actually desired.

TODO
----

TEST & FIX BUGS
- It seems to work OK for me :-)

Improve handling of corrupt packages?
- Set CPT flag when installing packages, if any package is corrupt
- If CPT flag set, output warning message and pause
    (wait for keypress? timeout? either?)
    Note: Debian stable linuxrc script includes a handy 'press any
    key' with automatic timeout routine.

Remove the code that keeps the CD-ROM mounted and makes a symlink
to /lib/modules on the CD?  This doesn't look necessary, as the
current modutils automounts the CD anyway, if present.

<not linuxrc related>
Modify modutils to look in /lib/modules or <cdrom>/lib/modules
(as appropriate) for modules, instead of through the *ENTIRE*
filesystem?

Modify modutils to mount the CD-ROM read-only using the iso9660
filesystem (gets rid of errors on bootup).

</TODO>

I'd appreciate it if the bering developers could look over and test the new script, and if someone with a DOC could test to make sure everything still works with the 'DOC Hack' removed.

The README file and a detailed changelog follows.

--
Charles Steinkuehler
[EMAIL PROTECTED]

---------------------------------------------------

<README>
New /linuxrc usage notes.

There is no more boot= setting required (or used), so this variable (if
present) can and should be removed from the kernel command line.  The
first (leftmost) device in PKGPATH= is used to create the backup
entries for initrd.lrp.  The 'legacy' /dev/boot symlink and boot.fstype
file (in /var/lib/lrpkg/) have been removed, as well.

There is a new LEAFCFG= variable, which specifies the device (if any)
to mount when looking for a leaf.cfg file, which can be used to
override kernel command line settings for such things as ramdisk size,
packages to load, and package path.  The 'legacy' files lrpkg.cfg and
pkgpath.cfg are no longer used and will be ignored, if present.  The
LEAFCFG variable has the syntax:
  LEAFCFG=/dev/device[:filesystem]

Any specified filesystem is tried first.  If no filesystem is
specified, or a mount using the specified filesystem fails for any
reason, all filesystems currently enabled in the kernel (entries in
/proc/filesystems that do not start with 'nodev') will be used to try
to mount the configuration device.

Variables that may be set in leaf.cfg include:
  VERBOSE       (if non-null enables additional output from linuxrc
  LRP           Packages to load
  PKGPATH       Device(s) to load packages from
  syst_size     Size of root ramdisk
  tmp_size      Size of /tmp ramdisk
  log_size      Size of /var/log ramdisk

Note that spaces, tabs, newlines, or commas may be used to seperate
entries in the LRP and PKGPATH variables.

In addition, the leaf.cfg file is sourced as a shell script, allowing
the potential for extention of the leafcfg scripts without requiring
a modification of the physical boot media (ie: anything from:
  echo "Hi Mom!"

to:
  insmod $MNT/MyWierdDevice.o --with-parameters
  insmod $MNT/NewFileSystem.o
  mknod /dev/mydevice -b 123 231
  PKGPATH="$KCMD_PKGPATH,/dev/mydev:newfs"

Variables avaiable for use in the leaf.cfg script include any kernel
command line parameters (prefixed by KCMD_), the mount point of the
LEAFCFG device (MNT), and available filesystems (FILESYSTEMS).  See
the linuxrc script for full details.

Note that the leaf.cfg file is processed *BEFORE* any packages are
loaded (in fact, before the package path and package list are
finalized), so it would be possible, for example, to load any
kernel modules or other software directly off the LEAFCFG= device
required to read package files off of attached devices.  It is only
necessary to have support for the LEAFCFG= device either compiled
into the kernel, or included in the /boot directory of the initial
ramdisk.

This means a floppy and CD-ROM system could potentially use exactly
the same initial ramdisk, with the kernel modules required to load
files from the CD installed by leaf.cfg rather than /linuxrc.

There are probably many other possible ways to extend the startup
scripts functionality using leaf.cfg, I'm just mentioning what
immediately comes to mind.
</README>

---------------------------------------------------

<changelog>
Parse /proc/cmdline & assign to variables (prefixed by KCMD_) to
avoid repeated 'echo /proc/cmdline | sed ...'

Updated code using kernel command line variables to reference new
$KCMD_* variables

Remove unnecessary $BB once busybox links are installed

Change BOOTDIR -> BPFX

Change /var/lib/lrpkg -> $PFX in *LOTS* of places

Change disk wait conditional to Y*|y*|1

Removed boot= device mounting procedure

Migrated boot device file initialization to pkgpath routine
(first PKGPATH entry used in place of former boot= value)
  - packages
  - backdisk
  - pkgpath.disks

Added routine to mount config device (new LEAFCFG= setting) and
source any leaf.cfg file found

Removed DOC 'hack' (boot= device no longer mounted twice)

Removed fnd= logic from PKGPATH processing & replaced w/break

Remvoed search for lrpkg.cfg on all mounted devices (replaced
by leaf.cfg and LEAFCFG=)

Tweaked fnd= logic in package installation so if a valid pkg is
found after a corrupt package, it installs correctly

Explicitly set IFS, and use a single OIFS="$IFS" at the start of
the script

Created Lecho procedure to prepend LINUXRC: to output

Removed "if grep ..." from PKGPATH processing
  - No boot= device to test for duplication of devices

Added warning if PKGPATH unset or null

Rephrased warning for LRP unset or null

Undid Bering 'fix' to devlist/rdevlist so PKGPATH processing
matches Dachstein (left-hand entries are higher priority than
right-hand entries).

Factored 'echo -n " $dev" out of two lines in package installation
procedure (bonus: $dev prints out while initial gzip test is being
run for package integrity, providing user feedback).
</changelog>


------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

_______________________________________________
leaf-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to