Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jul 1999 15:51:33 -0700 (PDT)
From:      papowell@astart.com
To:        abial@webgiro.com, papowell@astart4.astart.com, wormwang@online.sh.cn
Cc:        freebsd-small@FreeBSD.ORG, mlarsen@tech-nic.net
Subject:   picobsd-MOD.1.0.0 - configure, make, build and use
Message-ID:  <199907142251.PAA09244@astart4.astart.com>

next in thread | raw e-mail | index | archive | help
I first must thank all of the folks who have worked on the PICObsd
distribution and tools.

Especially:
 Andrzej Bialecki <abial@webgiro.com> WebGiro AB, Sweden (http://www.webgiro.com)

A couple of months ago I needed a small system on a floppy that I
could use for setting up testing and other things,  and it had to
run on systems of ... ummm... severely limited capability.  I hacked
and slashed the PICOBSD stuff, stuffed in my diagnostics, fired up
the floppy, and it worked FLAWLESSLY.
   (sigh... what a nice feeling)

In return, I am posting various changes,  updates, modifications,
fixes,  and rewrites to the PICOBSD distribution.   I must hasten
to say that many of these things were noted as 'TODO' items or were
inspired by needs that have developed since then.

You can get my mods from:

   ftp://ftp.astart.com/pub/LPRng/PICOBSD/picobsd-MOD.1.0.0.tgz
   Note: version may change as I add some things to it.

1. picobsd-MON uses Makefiles,  rather than scripts.

   Note:  this was on the Wish List for the script.
   To build a floppy image,  you do:

    cd small   (or cd isp; or cd router; or ...)
    ./configure
    make

    To put the images on the floppy, do:

    make install

2. It has 'configure' support built into it, so you can build the
   binaries, etc., in a different directory than the releases.

    cd /tmp/place/to/put/files
    .../picobsd/small/configure
    make

3. It has had all location dependencies removed, so you can put the
   picobsd stuff into another direcotry,  and not disturb your
   current distribution.

     cp -r .../picobsd/small /tmp/place/to/put/stuff
     cd /tmp/.../stuff/small
     ./configure
     edit edit edit edit
     test test test
     diff -cr .../picobsd/small . >/tmp/mydiffs

4. You can control the way that the system is built by either modifying
   values in the Makefile OR by values in a CONFIG file.  This allows
   you to have one master Makefile for all the various distributions
   and to configure them by setting values in the CONFIG file.

   (Note:  if this seems overly complex,  then consider the problems
   of fixing up and distributing changes.  You can simply copy a new
   'Makefile.in' to all of the various users and they have been updated.
   Patch is nice, but it has its limits.)

5. You can now do the following:
   a. generate single or two floppy systems (MFS_ON_FLOPPY option)
   b. put the MFS in a file and not embed it in a kernel.  This
      allows you to make modifications to the MFS size without needing
      to rebuild the kernel,  you can use the same kernel with several
      systems, etc. etc. etc.
   c. Set the number of INODES per K.  It turns out that this is useful
      when trying to make 10Meg MFS systems,  as the newfs will make non-zero
      areas on the disk image that do not compress well.  Since in my
      environment I needed LARGE files,  but few of them,  I found that
      this was very useful.
   See the OPTIONS listed below,  and details in the doc/src/How2Build.html
   file.

6. You populate the MFS and floppy file systems from the files in the
    mfs.tree and floppy.tree directories.  The mfs.tree/mtree or
    floppy.tree/mtree file contains the structure of the file system,
    and the contents of the floppy.tree and mfs.tree directories are
    (recursively) copied to the respective file systems.  This simplifies things
    tremendously if you need to set up a file system hierarchy.

    example:
       small/Makefile.in, configure,
         crunch1/   - crunch files
            crunch.conf, Makefile.in
         mfs.tree/  - MFS filesystem
            mtree   - file containing structure
            etc/... - /etc files
            root/   - /root files
         floppy.tree/ - floppy file system
            mtree   - file containing structure
            etc/... - /etc files
         lang/      - language depenedent files
            mfs.tree/  - MFS file system
              etc/     - /etc files
                rc.conf.pl   polish
                rc.conf.en   english
            floppy.tree/  - MFS file system
              etc/     - /etc files

7.  The lang/mfs.tree and lang/floppy.tree directories have the same layout
   as mfs.tree and floppy.tree, but contain language specific files.
   These get installed depending on the LANGUAGE option in the Makefile.

8. I have fixed up the crunch1 Makefile to do all sorts of fairly clever
   things.  And it cleans up nice, too.

9.  I have added a 'small' configuration to the existing ones.  This is
   a sample of a system I put together for doing brutal and nasty
   installs of FreeBSD on various systems.  The idea was to rebuild
   the file systems and then to do a restore onto them ASAP.

10.  If you select the 'forth loader' option,  then you can use the
   'xxx_load' facilities in the /boot/loader.conf file.  The Makefile
   puts the right commands in.  In addition,  it now correctly loads the
   /boot/kernel.conf file so you can put configuration changes into the
   /boot/kernel.conf file and have the kernel use them.  This is VERY
   useful when you need to repeatedly reboot a system and discover that
   the network card is configured for IO Addr 0x240, int 11, and not the
   one in the kernel.
   Note: strangely,  the documentation for the /boot/kernel.conf file
   seems to be 'retired'.  Here is a summary for the curious:

  CMD     USAGE              EXAMPLE
  di      disable dev        di de0
  dr      drq dev #          dr 4
  ei      eisa # (EISA slots)ei 4
  en      enable dev         en ep0
  ex      exit (quit)        ex 
  f       flags dev mask     f  de0 0xff
  h       help               h  
  intro   intro screen       intro
  iom     iomem  dev addr    iom ed0 0xdf0000
  ios     iosize dev size    iosize ed0 0x1000
  ir      irq dev #          irq ed0 5
  l       ls, list           l
  pn      pnp (scan)         pnp
  po      port dev addr      port ed0 0x300
  res     reset CPU          res
  q       quit               q
  v       visual mode        v

   Example:  you have a NE2000 card (ed0) at IO addr 0x240, IRQ 11

   port ed0 0x240
   ir   ed0 11

   And you are on the air.

10. The small/floppy.tree/root/{FIXDISK,PARTITION} can be used to rebuild
   a file system and restore them.
 
    use:  sh FIXDISK PARTITION
     PARTITION contains:

	# Set up the indicated disk and file system hierarchy
	# This is one of the inputs to the FIXDISK script
	# The script will format and generate the necessary disk
	# partitions
	#   drive = drive to configure
	#     you can have multiple drives
	#   slice = slice on drive
	#     you can also have multiple slices
	#   P=size:/mountpoint
	#     P = partition
	#     size in Megabytes
	#     mount point
	#
	# drive
	drive=wd0
	#slice=s4
	a=128:/
	# swap
	b=200
	# c is generated
	d=600:/usr
	e=300:/home
	f=+:/var

    You will note how ugly this is, but it works very well.  You can
    also do multiple drives, etc.  See the FIXDISK for details.

11. Enjoy.

Patrick Powell                 Astart Technologies,
papowell@astart.com            9475 Chesapeake Drive, Suite D,
Network and System             San Diego, CA 92123
  Consulting                   619-874-6543 FAX 619-279-8424 
LPRng - Print Spooler (http://www.astart.com)



Here are the options supported by the Makefile:
# Default MFS sizes for different types of the floppy. Again, most people
# shouldn't change them unless they know what they are doing.

# default size of the MFS
SIZE=1600
# Type of install - the name of the
TYPE=net
# 1 INDODE per ${INODES} bytes in the MFS
INODES=4096
# Version information
VER!= cat ${PICOBSD_DIST}/Version | sed -e 's/.*=//'
# Language suffix for files
LANGUAGE=en
#LANGUAGE=pl

# The directory where we mount our file images
MNTDIR=/mnt/${SUFFIX}

# devices to create in the /dev directory
STD_DEVS= std tun2 cuaa0 cuaa1 cuaa2 vty10 fd0 pty0 wd0 bpf3 wcd0
# set this to yes to keep MAKEDEV in the MFS
MAKEDEV=yes

# The link these directories to /stand in the MFS
STD_LINKS= /bin /sbin /usr/bin /usr/sbin /usr/libexec

# By default, support for the boot loader FORTH interpreter
# is loaded.  This is useful if you need to do extensive configuration
# If you do not need this, you can set LOADER=no
LOADER=yes
#LOADER=no

# You can put the MFS in a separate file or embed it in the
# kernel image.  If you put it in a separate file,  then you
# can edit it without needing to remake the kernel image.
#MFS_IN_FILE=no
MFS_IN_FILE=yes

# If you cannot fit the MFS and files on a single floppy, then try
# setting MFS_FLOPPY=yes.  This will put the MFS on a separate floppy
# You can put more files on the first floppy and then have the rc
# script copy them off (untar them from a .tgz file is pretty good).

#MFS_FLOPPY=yes
MFS_FLOPPY=no

# Set the size of floppy and type of floppy file system.
# This allows us to make 2880, 1440 or other floppy images
#
# The BOOT_DEVICE entry sets the device to mount after booting
# to read the various files from.
# You can use this to make a 2880 image floppy
#   FLOPPY_SIZE=2880, FLOPPY_FS=fd1440, BOOT_DEVICE=/dev/fda0
# disk on a chip
#  FLOPPY_SIZE=3944, FLOPPY_FS=DOC2k, BOOT_DEVICE=/dev/fla0c
FLOPPY_SIZE=  1440
FLOPPY_FS=  fd1440
BOOT_DEVICE= /dev/fd0a



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-small" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907142251.PAA09244>