Multiple Targets for PeeWee Linux

Ralph Stickley [email protected]
Fri, 8 Sep 2000 08:32:56 -0700 (PDT)


Adi,
Dang..Just lost about an hour trying to reply to this when Netscape just died -
kill the mouse, killed X windows everything. Netscape BITES!! where's IE when
you need it (or maybe some other browser!!!)....

Ok, I'll see what I can remember...

--- Adi Linden <[email protected]> wrote:
> Hi,
> 
> Just some notes to what I see here...
> 
> 
> There is no need to configure the actual device being used. The script
> will automatically determine the size of the target device and calculate
> the proper sizes.
> 
Good idea - too many variations was bothering me...

> 
> Partition sizes are configured by specifying free space! I found it really
> annoying having to resize partitions as they grew or ram for a ramdisk
> shrunk. Since we need to calculate before doing anything anyways, I
> figured I calculate the needed space and make the additional free space
> configurable.
> 
Another good idea!

> Bootlocation should not include the partition, just the device. The script
> picks the proper partition.
> 
Hmmmm....need to look into that - when do I use it now - mkBootDevice....

> 
> Here is the list of variables that are sensibly selected to be
> configurable.
> 
> These first variables are customizable but shouldn't require change. They
> define system defaults. I added the above numbers to indicate which
> setting apply where.
>  
>     #####
>     #
>     # Only change these if you really know what you are doing!!!
>     #
>     #####
> 
>     # define the initrd size
>     rd_initrd_size=                {3,4,5,8,9}
> 
>     # define the safety margin for the boot partition
>     rd_size_boot_margin=           {3,4,5}
> 
>     # define the safety margin for fit in flash calculations
>     rd_size_margin=                {1,2,3,4,5,6,7,8,9,10}
> 
these in kb ?? or percent ??


> The following settings apply to file locations, target devices, etc. They
> apply to literally all methods.
> 
>     #####
>     #
>     # Configurable paramters
>     #
>     #####
> 
>     # selected device layout
>     rd_scheme=                      {put a name to the numbers above}
> 
>     # define if we maintain fstab and rc.init
>     rd_initscripts=                 {needed if you have a custom rc.init
>                                      or fstab, prvents rd_function from
>                                      playing with it}
> 
>     # define default verbosity
>     rd_action_verbosity=             {how much we dump to the screen}
> 
>     # temporary files directory
>     rd_tmp=
> 
>     # the temporary mount point
>     rd_mount=
> 
>     # the kernel name
>     rd_kernel=                       {the kernel image (bzImage) w/o path}
> 
>     # the initrd name
>     rd_initrd=                       {the initrd name w/o path}
> 
>     # the ramdisk name
>     rd_ramdisk=                      {the ramdisk name w/o path}
> 
> The following variables are used by the raw floppy only.
> 
>     ####
>     # target specific options - floppy
> 
>     # the target device
>     rd_floppy=                        {just in case you're not using fd0}
> 
>     # the free space on the unompressed ramdisk
>     rd_ramdisk_fd_free=
> 
> The following applies to mostly all flash based systems {1,2,3,4,5}
> 
>     ####
>     # target device specific - hd or flash
> 
>     # the target device on the development system
>     rd_target=                         {device (/dev/sda) w/o partition #}
> 
>     # the final boot device
>     rd_boot=                           {device (/dev/hda) w/o partition #}
> 
> The following is needed for the systems with a single ramdisk or the
> uncompressed ramdisk.
> 
>     ####
>     # single ramdisk parameters
> 
>     # the free space on the uncompressed ramdisk in kB
>     rd_ramdisk_free=                    {1,2,3,4}
> 
> These variables are required by the read-only root system.
> 
>     ####
>     # multiple ramdisk parameters
>     # the free space on the /dev - /var partition in kB
>     # this partition also contains the /var tree!!!
>     rd_dev_free=                        {5}
> 
>     # the free space on the /etc partition in kb
>     rd_etc_free=                        {5}
> 
>     # the free space on the /home partition
>     # this partition also contains /root
>     rd_home_free=                       {5}
>  
> The next are bootloader options that are valid for any system using
> syslinux or lilo. Note, that I haven't fixed syslinux.cfg for all
> bootoptions yet. But that will happen sometime soon.
> 
>     ####
>     # bootloader options
> 
>     # prompt timeout
>     rd_bp_time=                         {1,2,3,4,5,7,8,9,10}
> 
>     # kernel label
>     rd_bp_label=                        {1,2,3,4,5,7,8,9,10}
> 
>     # vga options
>     rd_bp_vga=                          {1,2,3,4,5,7,8,9,10}
> 
> This about covers it.
> 
> > The next step is to activate the Erase/Foramt command to handle all the
> various
> > partitions; and the Load command must build the ramdisk images etc..
> 
> The loading script does everything! Fdisk, partition and format the
> device. Install the bootloader, restore the DOS MBR for syslinux (if you
> switch from lilo to syslinux). Create intrd, ramdisk compressed or
> uncompressed, removes the kernel from the filesystem where it's not
> needed...
> 
> So the sequence to use rd_functions without rd_dialog should be as
> follows:
> 
>   1.  source rd_functions
>   2.  set rd_base to the devel root dir (i.e./root/PeeWee/Embedded_Build)
>   3.  call func_rd_env
>   4.  call func_rd_defaults <project name>
>   5.  load custom setting (redefininging some variables defined in prev step)
>   
>       Note: I wrote function that save whatever rd_dialog defines in a
>             config file. But that's irrelevant as long as pwlconfig has
>             all needed variables defined at this point. The build-in way
>             pwlconfig works should be fine.
>   6.  call function that installs filesystem
>          {1}  func_rd_build_comp_rd_fat
>          {2}  func_rd_build_comp_rd_ext2
>          {3}  func_rd_build_uncomp_rd_fat
>          {4}  func_rd_build_uncomp_rd_ext2
>          {5}  func_rd_build_ro_root_rd  
>          {6}  func_rd_build_fd_raw   
> 
>          Proposed: 
>          {7}  func_rd_build_fd_fat   
>          {8}  func_rd_build_rd_iso  
>          {9}  func_rd_build_ro_iso  
>          {10} func_rd_build_rw_root  
> 
> A last note, when the function in step 6 is called all required variables
> need to be configured properly. There are no exhausting checks when it
> comes to determining if the variables actually exist or have sane
> locations. They will simply be used...
> 
> Hope this makes sense. Hey, I think I did ok documenting the script. I
> look at it and I can still figure out what it does, even after a couple of
> weeks :)  Now if someone previously unexposed to the script can have the
> same satisfying experience I am happy :-)
> 
Yep...I went back and read it closer after this e-mail makes more sense now.

So, what I'd propose is to do the following:

1. write a "main" function that
-- reads the project.defaults file and converts those parameters into rd_xxx
variables (or rename some of your variables to match the defaults)
-- activates the choosen scheme as outlined in 1-6 above

2. Call pwl_ramdisk or mkbootDevice from pwlconfig 

3. Add parameters to project.defaults file as required.

Hmmm...not to hard...I'll try to send my latest pwlconfig and pwl_target and
project.defaults file this afternoon. 

You might think about the "main" function and the variable names (note read
project.defaults file to see the names of the variables used in pwl_xxx files).

Ok...didn't loose to much (except some wity coments :) and about an hour of
time! ahhh...

Later,
Ralph

> TTYL,
> Adi
> 
> ---------------------------------------------------
> See the list archives at http://adis.on.ca/archives/
> See the PWL homepage at  http://peeweelinux.com
> ---------------------------------------------------


__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/
---------------------------------------------------
See the list archives at http://adis.on.ca/archives/
See the PWL homepage at  http://peeweelinux.com
---------------------------------------------------