Difference between revisions of "Bering-uClibc 4.x - Developer Guide - Building an Image"

From bering-uClibc
Jump to: navigation, search
(Created placed holder)
 
(Added content on disk media and some initial notes on buildimage.pl)
Line 11: Line 11:
 
TODO Mention use of <tt>tools/buildall.sh</tt> to create all of the packages.
 
TODO Mention use of <tt>tools/buildall.sh</tt> to create all of the packages.
  
TODO Define the procedure for creating the image(s). Script <tt>tools/geniso.sh</tt> is fine for ISO images but what about USB / CF / PXE images. Should we write a <tt>buildimage.pl</tt> ?
+
TODO Also cover use of <tt>tools/prepareimagefiles.sh</tt> to prepare all the input files.
 +
 
 +
 
 +
===Boot Disk Media===
 +
For Bering-uClibc 3.x the script <tt>tools/createimage.sh</tt> was used to build the image files. Two image variants were supported:
 +
* <tt>fd</tt> for Floppy Disk media
 +
* <tt>iso</tt> for ISO 9660 CD-ROM media
 +
For Bering-uClibc 4.x Floppy Disk is no longer a viable option because of the size of the distribution. Floppy disks drives are also typically not installed on modern systems (and not that many modern systems have built-in CD-ROM drives either).
 +
 
 +
 
 +
Most users of Bering-uClibc 4.x are expected to boot from some sort of flash drive, most likely:
 +
* A Compact Flash (CF) card which is installed:
 +
** Directly onto the main board (as with the the PC Engines ALIX boards)
 +
** Into an IDE-to-CF adaptor
 +
** Into a USB-to-CF adaptor
 +
* A USB flash drive
 +
For all of these a disk image which boots using SYSLINUX is required.
 +
A CD-ROM image which boots using ISOLINUX is also required as an alternative. (A <tt>.iso</tt> image is particularly useful for testing Bering-uClibc 4.x with a Virtual Machine.)
 +
 
 +
In theory, PXE boot using PXELINUX is an option for LEAF though this is not currently supported by Bering-uClibc 4.x. While PXE can easily deliver the kernel image and the initrd image, delivering the <tt>.lrp</tt> files is more problematic and saving changes is more complex still. Other Linux distributions solve this problem by delivering files using TFTP or using NFS - see for example http://minimyth.org/ - but adding the necessary support would require additional modules in <tt>initrd.lrp</tt> and would require modifications to LINUXRC.
 +
 
 +
 
 +
===<tt>buildimage.pl</tt>===
 +
Currently (2010-09-24) [[User:Davidmbrooke|davidMbrooke]] is developing a new script - <tt>buildimage.pl</tt> - which is heavily based on <tt>buildpacket.pl</tt> and which is controlled by a similar style of configuration file. Each target image has its own configuration file (<tt>buildimage.cfg</tt>) stored in its own directory (under <tt>buildtool/image</tt>) which specifies how the results of the build process are combined with configuration file templates to construct the final disk image contents.
 +
 
 +
A <tt>buildimage.cfg</tt> file typically specifies that the image is constructed by copying files as shown below:
 +
 
 +
buildtool
 +
    package
 +
        *.lrp                            Copied to / ('''QUESTION''' or /lrp ?) on all images, controlled by configuration file
 +
    staging
 +
        boot
 +
            linux                        Copied to /isolinux or /syslinux on all images
 +
        lib
 +
            modules
 +
                2.6.35.2
 +
                    *                    Built into /modules.tgz, excluding the build and source sub-directories
 +
    tools
 +
        image
 +
            common
 +
                leaf.cfg                Copied to / on all images, edited to replace LRP and PKGPATH place holders
 +
                readme                  Copied to / on all images, edited to replace VERSION and DATE place holders
 +
            isolinux
 +
                isolinx.cfg              Copied to /isolinux on ISOLINUX images, edited to replace LRPCFG place holder
 +
                isolinux.dpy            Copied to /isolinux on ISOLINUX images, edited to replace VERSION and DATE place holders
 +
            syslinux
 +
                syslinux.cfg            Copied to /syslinux on SYSLINUX images, edited to replace LRPCFG place holder
 +
                sysliuux.dpy            Copied to /syslinux on SYSLINUX images, edited to replace VERSION and DATE place holders
 +
     
 +
 
 +
TODO What about LWP files?
 +
 
 +
TODO Add more info about <tt><buildimage.pl</tt> once it is developed and tested.
 +
 
 +
 
 +
The result of running <tt><buildimage.pl</tt> is a single file located alongside the relevant <tt>buildimage.cfg</tt>
 +
* For an ISOLINUX image this is a <tt>.iso</tt> file which is typically burned to CD-R/RW media
 +
* For a SYSLINUX image this a <tt>.tar.gz</tt> file which must be copied to a suitably prepared flash drive
 +
** '''QUESTION''' Offer <tt>.zip</tt> as an alternative, for Windows users?
 +
 
 +
 
 +
===Flash Drive Preparation for SYSLINUX===
 +
Flash drive media used for booting Bering-uClibc 4.x should be configured to meet the following criteria:
 +
* A single disk partition which is specified to be Bootable and with a file system type which matches the installed file system
 +
** File system hex code "b" which <tt>fdisk</tt> lists as "W95 FAT32" is recommended
 +
** '''QUESTION''' When is "c" which <tt>fdisk</tt> lists as "W95 FAT32 LBA" required / desirable?
 +
* A file system on that disk partition which is compatible with the Linux <tt>vfat</tt> driver
 +
** FAT32 is recommended
 +
* A SYSLINUX install on that disk partition (which creates <tt>/ldlinux.sys</tt> and installs the MBR)
 +
The contents of the generated <tt>.tar.gz</tt> file can then be copied onto the flash drive.
 +
 
 +
 
 +
The procedure for all this will need to be detailed in the [[Bering-uClibc 4.x - User Guide]]
  
  

Revision as of 16:35, 24 September 2010

Building an Image
Prev Bering-uClibc 4.x - Developer Guide


TODO Mention use of tools/buildall.sh to create all of the packages.

TODO Also cover use of tools/prepareimagefiles.sh to prepare all the input files.


Boot Disk Media

For Bering-uClibc 3.x the script tools/createimage.sh was used to build the image files. Two image variants were supported:

  • fd for Floppy Disk media
  • iso for ISO 9660 CD-ROM media

For Bering-uClibc 4.x Floppy Disk is no longer a viable option because of the size of the distribution. Floppy disks drives are also typically not installed on modern systems (and not that many modern systems have built-in CD-ROM drives either).


Most users of Bering-uClibc 4.x are expected to boot from some sort of flash drive, most likely:

  • A Compact Flash (CF) card which is installed:
    • Directly onto the main board (as with the the PC Engines ALIX boards)
    • Into an IDE-to-CF adaptor
    • Into a USB-to-CF adaptor
  • A USB flash drive

For all of these a disk image which boots using SYSLINUX is required. A CD-ROM image which boots using ISOLINUX is also required as an alternative. (A .iso image is particularly useful for testing Bering-uClibc 4.x with a Virtual Machine.)

In theory, PXE boot using PXELINUX is an option for LEAF though this is not currently supported by Bering-uClibc 4.x. While PXE can easily deliver the kernel image and the initrd image, delivering the .lrp files is more problematic and saving changes is more complex still. Other Linux distributions solve this problem by delivering files using TFTP or using NFS - see for example http://minimyth.org/ - but adding the necessary support would require additional modules in initrd.lrp and would require modifications to LINUXRC.


buildimage.pl

Currently (2010-09-24) davidMbrooke is developing a new script - buildimage.pl - which is heavily based on buildpacket.pl and which is controlled by a similar style of configuration file. Each target image has its own configuration file (buildimage.cfg) stored in its own directory (under buildtool/image) which specifies how the results of the build process are combined with configuration file templates to construct the final disk image contents.

A buildimage.cfg file typically specifies that the image is constructed by copying files as shown below:

buildtool
    package
        *.lrp                            Copied to / (QUESTION or /lrp ?) on all images, controlled by configuration file
    staging
        boot
            linux                        Copied to /isolinux or /syslinux on all images
        lib
            modules
                2.6.35.2
                    *                    Built into /modules.tgz, excluding the build and source sub-directories
    tools
        image
            common
                leaf.cfg                 Copied to / on all images, edited to replace LRP and PKGPATH place holders
                readme                   Copied to / on all images, edited to replace VERSION and DATE place holders
            isolinux
                isolinx.cfg              Copied to /isolinux on ISOLINUX images, edited to replace LRPCFG place holder
                isolinux.dpy             Copied to /isolinux on ISOLINUX images, edited to replace VERSION and DATE place holders
            syslinux
                syslinux.cfg             Copied to /syslinux on SYSLINUX images, edited to replace LRPCFG place holder
                sysliuux.dpy             Copied to /syslinux on SYSLINUX images, edited to replace VERSION and DATE place holders
      

TODO What about LWP files?

TODO Add more info about <buildimage.pl once it is developed and tested.


The result of running <buildimage.pl is a single file located alongside the relevant buildimage.cfg

  • For an ISOLINUX image this is a .iso file which is typically burned to CD-R/RW media
  • For a SYSLINUX image this a .tar.gz file which must be copied to a suitably prepared flash drive
    • QUESTION Offer .zip as an alternative, for Windows users?


Flash Drive Preparation for SYSLINUX

Flash drive media used for booting Bering-uClibc 4.x should be configured to meet the following criteria:

  • A single disk partition which is specified to be Bootable and with a file system type which matches the installed file system
    • File system hex code "b" which fdisk lists as "W95 FAT32" is recommended
    • QUESTION When is "c" which fdisk lists as "W95 FAT32 LBA" required / desirable?
  • A file system on that disk partition which is compatible with the Linux vfat driver
    • FAT32 is recommended
  • A SYSLINUX install on that disk partition (which creates /ldlinux.sys and installs the MBR)

The contents of the generated .tar.gz file can then be copied onto the flash drive.


The procedure for all this will need to be detailed in the Bering-uClibc 4.x - User Guide



Prev Up