Yesterday I created bering CD version and I can share with you the steps 
I did.
If you are quite impatient waiting for the official doc, you can find it 
useful.
Note that it is not fully tested. What I tested is partial/full backup, 
booting
with backup files, using lrpkg.cfg from floppy with package options
like :f,:F,:r,:R described in [1].

First read the following:
[1]http://leaf.sourceforge.net/devel/cstein/files/diskimages/dachstein-CD/README.txt
[2]http://syslinux.zytor.com/iso.php

The only files I've changed are:
initrd.lrp:/var/lib/lrpkg/root.linuxrc
     this is the original one modified basing on file from dachstein-CD
     Modification allows to use syslinux.cfg format from dachstein-CD
     (note the 'boot=' modification to use ':' decribed below). You can
     load multiple packages from cd/floppy, do the backup (by the way - 
backup
     scripts do not have to be changed) and use pkgpath.cfg and 
lrpkg.cfg files
     as described in [1].

initrd.lrp:/var/lib/lrpkg/root.version
     this is modified just to distinguish from original release

modules.lrp:/etc/init.rd/modutils
     this one is replaced by the file from dachstein-CD. Now it allows
     to get modules from mounted CD.

modules.lrp:/etc/modules
     the format of this file is exactly the same as the same file from
     dachstein-CD

modules.lrp:/lib/modules/
     I removed all modules from that directory since they are on CD now

modules.lrp:/var/lib/lrpkg/modules.local
     this is not neccesary

isolinux.cfg
     the format is the same as the syslinux.cfg file from dachstein-CD
     except that 'boot=' parameter used ':' instead of ',' before the
     filesystem specification (just to have the same convention
     everywhere in the file)

isolinux.dpy - modified for fun :)

So, the steps are:
1. change mentioned files with the ones attached in the mail body below 
(I've sent that files today as attachment but it was stopped by the 
'mail moderator', sorry, my mistake)
2. Create isolinux CD (see [2]):
a) do the CD root directory 'mycd' and in that directory:
b) do there subdirectory isolinux and copy there: isolinux.cfg, 
isolinux.dpy, initrd.lrp, linux, isolinux.bin
c) do there subdirectory lib/modules and write there the whole structure 
from http://leaf.sourceforge.net/devel/jnilo/bering/latest/modules/
d) copy there all needed packages i.e. the most important ones from 
http://leaf.sourceforge.net/devel/jnilo/bering/latest/bering-1680.bin 
and all the other you want from 
http://leaf.sourceforge.net/devel/jnilo/bering/packages/ and some from 
http://leaf.sourceforge.net/devel/jnilo/packages/ which are mentioned in 
the Table1 from http://leaf.sourceforge.net/devel/jnilo/
e) being still in the 'mycd' do the magic command:
mkisofs -o ../output.iso -b isolinux/isolinux.bin -c isolinux/boot.cat 
-no-emul-boot -boot-load-size 4 -boot-info-table -l .
what should create output.iso above the current dir.
                
I hope I did not forget anything.

Attached files:

isolinux.cfg:
display isolinux.dpy
timeout 0
default linux initrd=initrd.lrp init=/linuxrc root=/dev/ram0 
boot=/dev/fd0:msdos PKGPATH=/dev/cdrom:iso9660 LRP=root,etc,local,modules

modules:
# /etc/modules: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line.  Comments begin with
# a `#', and everything on the line after them are ignored.
#
# All modules should reside in /lib/modules, and you are required
# to list what you need *in the correct order*. Modprobe is not
# used and there is no dependacy checking.
# How they are loaded:  insmod [mount][dir]/"$module".o $args

# Available commands:
# Mount a filesystem to read modules from
# ! mount <filesystem> <device>
# Unmount a mounted filesystem
# ! umount
# Set the module load directory (defaults to /lib/modules)
# ! dir <directory>
# directory should contain a leading slash and is relative to root if 
nothing
# is mounted, or the root of any mounted filesystem specified with ! mount

######################################################################
# More modules available from:
# http://leaf.sourceforge.net/devel/jnilo/bering/latest/modules/
######################################################################

! mount iso9660 /dev/cdrom

# You can directly reference modules, like this:
#/scsi/aic7xxx
#/fs/ext2

# Or change the default directory, like this:
# ! dir /lib/modules/net

# PCI ethernet cards (warning: natsemi.o & tulip.o not on floppy)
#3c59x
#eepro100
#natsemi
#tulip
/drivers/net/8139too

# Modules needed for PPP connection
#serial
#slhc
#ppp_generic
#ppp_async
#ppp_deflate

# Modules needed for PPP/PPPOE connection
#slhc
#n_hdlc
#ppp_generic
#ppp_synctty
#pppox
#pppoe

# Modules needed for ISDN
# Look for type, io and irq settings at help page of isdn.lrp documentation
#slhc
#isdn
#hisax type= io= irq=

# Masquerading 'helper' modules
/net/ipv4/netfilter/ip_conntrack_ftp
/net/ipv4/netfilter/ip_conntrack_irc
/net/ipv4/netfilter/ip_nat_ftp
/net/ipv4/netfilter/ip_nat_irc

# Templates for extra functionnalities
# Warning: the following modules are not provided on Bering floppy
# they must be downloaded

#
# Bridge support
#bridge

#
# IDE/CD-ROM support
#ide-mod
#ide-disk
#ide-probe-mod

#
# USB support
# do not forget to mount none /proc/bus/usb -t usbdevfs
#usbcore
#usb-uhci
# .. or ..
#usb-ohci

! umount

# EOF

modules.local:
I etc/modules
I lib/modules
I var/lib/lrpkg/modules.*

modutils:
#! /bin/sh
# /etc/init.d/modules: loads the appropriate modules in `boot'.

#Editted for LRP -- Dave Cinege
# Modified to mount filesystems by Charles Steinkuehler

RCDLINKS="S,S20"

PATH="/sbin:/bin:/usr/sbin:/usr/bin"
OIFS="$IFS"

DIR="/lib/modules"
MNT="/var/lib/lrpkg/mnt"
MOUNT=""

# Loop over every line in /etc/modules.
echo 'Loading modules: '
while read module args
do
        case "$module" in
                \#*|"") continue ;;
                !)      set -- $args
                        case $1 in
                                mount)  [ -n "$MOUNT" ] && umount $MOUNT
                                        mount -r -t $2 $3 $MNT
                                        MOUNT="$MNT" ;;
                                umount) [ -n "$MOUNT" ] && umount $MOUNT
                                        MOUNT="" ;;
                                dir)    DIR="$2" ;;
                        esac
                        continue ;;
        esac
                
        echo -n "$module - "
        insmod "$MOUNT$DIR/$module".o $args
done << DATA    # Insure file ends with LF...
$(cat /etc/modules)

DATA

echo
[ -n "$MOUNT" ] && umount $MOUNT

root.linuxrc:
#!/bin/sh
# Note: Modified to work with CD.
# /linuxrc (rc.-1)  Prepares root for normal inittab and boot.
# Allows main root to be a multiple parts
#
# Copyright Dave Cinege - LRP  GPL2
# Multiple disk handling portions written by JamesSturdevant 1999
# Fix corruption of linuxrc.err by LarrySettle Jan 2000
# Fix corruption of /var/lib/lrpkg/backdisk by LarrySettle Jan 2000
# Modified to load modules before looking for packages by
# Charles Steinkuehler 2001
# J. Nilo Nov 2001: Get rid of grep & cut statements for non-patched distro
# and pivot_root to tmpfs
#
# Uncomment for more verbose execution.
#VERBOSE=1

#Uncomment for debug mode (don't suppress STDOUT and STDERR)
#DEBUG=1

#  **** Adjust if needed ****
#  1/ Max size of unpacked LRP files
SYSTSIZE=6M
#  2/ Max size of /var/log directory
LOGSIZE=2M

if [ $DEBUG ] ; then
        qt () { "$@" ; }
else
        qt () { "$@" >>/linuxrc.err 2>&1 ; }
fi

source () { . $@; }

BB=/bin/busybox
PFX=/var/lib/lrpkg
CR=''
SYM="-s"

$BB mkdir /proc
$BB mount -t proc /proc /proc
/bin/busybox --install -s

VERSION="`cat ${PFX}/root.version`"

echo "LINUXRC: Bering - Initrd - $VERSION"

#
# Load any modules required to boot
#
BOOTDIR=/boot
if [ -r $BOOTDIR/etc/modules ] ; then
        # Loop over every line in modules
        [ "$VERBOSE" ] && echo "Loading modules..."

        # make sure there is a LF at the end
        ($BB cat $BOOTDIR/etc/modules; echo) |
        while read module args; do
                case "$module" in
                        \#*|"") continue;;
                esac
                /sbin/insmod $BOOTDIR/lib/modules/"$module".o $args
        done
fi

# Query /proc/cmdline line for a 'root' option.
# Skip remaining LRP stuff if we're not booting into a ramdisk

DEVICE="`sed 's/.*root=\/dev\//\1/; s/ .*//1' /proc/cmdline`"
case $DEVICE in
        ram*)
                ;;
        *)
                qt $BB umount /proc
                [ ! $VERBOSE ] && $BB rm /linuxrc.err
                exit 0
                ;;
esac

# Added by J. Nilo: Create a dynamic TMPFS

if [ "`sed '/syst_size/d' /proc/cmdline`" = "" ]; then
        SYSTSIZE="`sed 's/.*syst_size=/\1/; s/ .*//1' /proc/cmdline`"
fi
# Initialize tmpfs_size with default
qt $BB mkdir /tmpfs
echo "Mounting a $SYSTSIZE TMPFS filesystem..."
qt $BB mount -t tmpfs /dev/root /tmpfs -o size=$SYSTSIZE
qt $BB umount /proc
for ii in /*
do
        case $ii in
                /tmpfs)
                ;;
        *)
                qt $BB cp -dpR $ii /tmpfs
        esac
done
cd /tmpfs
$BB mkdir initrd
[ "$VERBOSE" ] && echo "Pivoting..."
$BB pivot_root . initrd
$BB mount -t proc /proc /proc
cd /

[ "$VERBOSE" ] && echo "Generating default dirs..."

qt mkdir /dev/inet
qt mkdir /etc
qt mkdir /tmp
qt mkdir /mnt
qt mkdir /nfs
qt mkdir /var/lock
qt mkdir /var/run

MNT="${PFX}/mnt"
qt mkdir $MNT

qt ln -s /tmp /var/tmp
qt ln -s /tmp /usr/tmp

[ "$VERBOSE" ] && echo "Generating /tmp & /var/log files ..."

if [ "`sed '/tmp_size/d' /proc/cmdline`" = "" ]; then
        TMPSIZE="`sed 's/.*tmp_size=/\1/; s/ .*//1' /proc/cmdline`"
        qt $BB mount -t tmpfs tmpfs /tmp -o size=$TMPSIZE
else
        qt $BB mount -t tmpfs tmpfs /tmp
fi
if [ "`sed '/log_size/d' /proc/cmdline`" = "" ]; then
        LOGSIZE="`sed 's/.*log_size=/\1/; s/ .*//1' /proc/cmdline`"
fi
qt $BB mount -t tmpfs tmpfs /var/log -o size=$LOGSIZE

[ "$VERBOSE" ] && echo "Generating /dev..."

source ${PFX}/root.dev.mk

#Set some permissions
chmod 1777 /var/lock
chmod 1777 /tmp

#Create and update mtab
echo "`sed 's/.*root=/\1/; s/ .*//1' /proc/cmdline` \
`grep /dev/root /proc/mounts | sed 's/.*root //1'`">/etc/mtab

#Clear this file
INITRD="`sed 's/.*initrd=//;s/.lrp.*//' /proc/cmdline`"
echo "$INITRD">${PFX}/packages

# Query /proc/cmdline to see if we want to ask for a second disk
# to be inserted for use as a rescue set
DISKWAIT="`sed 's/.*diskwait=/\1/; s/ .*//1' /proc/cmdline`"
case $DISKWAIT in
        YES|Yes|yes|1)
echo
echo "        ***   Insert 2nd disk.  Press <enter> to continue.   ***"
echo
                read KEYCHAR
                unset KEYCHAR
                ;;
esac

# Query /proc/cmdline line for a 'boot' option.
# This will solve the chicken and egg problem of specing boot devices
# not in root.mount. Falls back to root.mount (and /proc/filesystems)
# if boot= entry fails.  IE  boot=/dev/device[:filesystem]

DEVICE="`sed 's/.*boot=\/dev\//\1/; s/ .*//1' /proc/cmdline`"
FSTYPE="`echo $DEVICE | sed 's/.*://'`"
DEVICE="`echo $DEVICE | sed 's/:.*//'`"
DEVICE="$DEVICE `cat ${PFX}/root.mount`"
FSTYPE="$FSTYPE `cat /proc/filesystems | sed 's/nodev//' | \
  sed 's/^[     ]*//' | sed '/^proc$/d'`"

# Works like mount -t auto and trys against the listed
# filesystems.

rc=1
for d in ${DEVICE}; do

        for t in ${FSTYPE}; do

                if qt mount -r -t $t /dev/$d $MNT ; then
                        echo
                        [ "$VERBOSE" ] && echo "Mounted /dev/$d as $t"
                        qt ln -sf /dev/$d /dev/boot
                        echo $t>${PFX}/boot.fstype
                        echo "$INITRD=-t $t /dev/$d">${PFX}/backdisk
                        echo "/dev/$d $t">$PFX/pkgpath.disks
                        devlist="/dev/$d:+$MNT:-$t"
                        rdevlist="$devlist"
                        rc=0
                        break
                fi
        done

        [ $rc -eq 0 ] && break
done

if [ $rc -ne 0 ]; then
        echo "LINUXRC: Could not mount the boot device. Can't install packages."
        echo "         *** This is not an error since CD is used. ***"
# 
exit 1
fi

expr () { exp $@ ; }

if [ -r $MNT/pkgpath.cfg ]; then
        PKGPATH="`sed s/$CR\$// $MNT/pkgpath.cfg`"
else
        PKGPATH="`sed 's/.*PKGPATH=.*/PKGPATH/' /proc/cmdline`"
        if [ "$PKGPATH" = "PKGPATH" ]; then
                PKGPATH="`sed 's/.*PKGPATH=/\1/; s/ .*//1' /proc/cmdline`"
        else
                PKGPATH=""
        fi
fi

if [ -n "$PKGPATH" ]; then
        [ "$VERBOSE" ] && echo "PKGPATH: $PKGPATH"
        devcount=1
        OIFS=$IFS; IFS=','
        for dev in ${PKGPATH}; do
                IFS=':'
                set -- ${dev}
                dev=$1
                qt mkdir /mnt$devcount
                IFS=$OIFS
                fnd=0
                for t in $2 ${FSTYPE}; do
                        if [ $fnd -eq 0 ]; then
                        [ "$VERBOSE" ] && echo "mounting $dev on /mnt$devcount"
                        if qt mount -r -t $t $dev /mnt$devcount ; then
                                [ "$VERBOSE" ] && echo "Mounted $dev as $t"
                                echo "$dev $t">>$PFX/pkgpath.disks                     
 
                                devlist="$dev:+/mnt$devcount:-$t,$devlist"
                                rdevlist="$rdevlist,$dev:+/mnt$devcount:-$t"
                                fnd=1
                        fi
                        fi
                done
                devcount=$(expr $devcount + 1)
                IFS=','
        done
        IFS=$OIFS
fi

if [ -r $MNT/lrpkg.cfg ]; then
        ROOTMAP="`sed s/$CR\$// $MNT/lrpkg.cfg`"
else
        ROOTMAP="`sed 's/.*LRP=/\1/; s/ .*//1' /proc/cmdline`"
fi

if [ -n "$ROOTMAP" ]; then

        echo "LINUXRC: Installing..."

        OIFS=$IFS; IFS=','
        for f in ${ROOTMAP}; do
                IFS=':'
                set -- $f
                f=$1
                multi=1 ; revrs=0
                case $2 in
                        f) multi=1 ; revrs=0 ;;
                        F) multi=0 ; revrs=0 ;;
                        r) multi=1 ; revrs=1 ;;
                        R) multi=0 ; revrs=1 ;;
                esac
                if [ "$revrs" = 1 ]; then
                        usedevlist=$rdevlist
                else
                        usedevlist=$devlist
                fi
                fnd=0
                echo -n "$f:"
                IFS=","
                for devtype in ${usedevlist}; do
                        dev="`echo $devtype|sed 's/:+.*/\1/'`"
                        mnt="`echo $devtype|sed 's/.*:+/\1/; s/:-.*/\1/'`"
                        t="`echo $devtype|sed 's/.*:-/\1/'`"
                        [ "$VERBOSE" ] && echo -n " dev: $dev mnt: $mnt t: $t f: 
$mnt/$f.lrp"
                        if [ $multi -eq 1 -o $fnd -eq 0 ]; then
                        if [ -f $mnt/$f.lrp ]; then
                                gunzip -c $mnt/$f.lrp > /dev/null
                                if [ $? -eq 0 ]; then
                                        echo -n " $dev"
                                        gunzip -c $mnt/$f.lrp | qt busybox tar -x
                                        #Update installed packages file
                                        [ $fnd -eq 0 ] && echo "$f">>$PFX/packages
                                        backdisk="$f=-t $t $dev"
                                        fnd=1
                                else
                                        echo -n " $dev(cpt!)"
                                        fnd=1
                                fi
                        fi
                        fi
                done

                [ -n "$backdisk"  ] && echo $backdisk >>$PFX/backdisk

                if [ $fnd -eq 0 ]; then
                        echo -n " (nf!)"
                fi
                echo ""
        done
        IFS=$OIFS
        echo "Finished."
else
        echo "LINUXRC: LRP= in /proc/cmdline is empty. Can't install packages."
fi

[ "$VERBOSE" ] && echo "Generating POSIXness links..."

LINKS="`cat ${PFX}/root.pn.links`"
for f in ${LINKS}; do
        qt ln $SYM /bin/POSIXness /$f
done

[ "$VERBOSE" ] && echo "Generating tinylogin links..."

LINKS="`cat ${PFX}/root.log.links`"
for f in ${LINKS}; do
        qt ln $SYM /bin/tinylogin /$f
done

# We need to set permissons after etc is installed, so it sets owner and
# group correctly. (No /etc/passwd and /etc/group on the first run : P )

[ "$VERBOSE" ] && echo "chown and chmod /dev..."

source ${PFX}/root.dev.own

source ${PFX}/root.dev.mod

#Can't hurt
sync
sleep 1

#qt umount /proc
OIFS=$IFS; IFS=','
for devtype in ${devlist}; do
        mnt="`echo $devtype|sed 's/.*:+/\1/; s/:-.*/\1/'`"
        [ "$VERBOSE" ] && echo "unmounting $mnt"
        qt umount $mnt
        if [ ! "$mnt" = "$MNT" ]; then
                [ "$VERBOSE" ] && echo "removing $mnt"
                qt rmdir $mnt
        fi
done
IFS=$OIFS
[ ! $VERBOSE ] && rm /linuxrc.err

exec /sbin/init

exit 0

root.version:
V1.0-rc1 CD


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

Reply via email to