TODOs
-----
-* implement missing options (--grub, --kernel, --initrd, --squashfs, --uninstall)
-* validate partition schema/layout: is the partition schema ok and the bootable flag set? (--validate?)
-* provide --create-partition option?
-* provide --verify to check md5sums of files on usb device
-* implement logic for storing information about copied files (register every file in a set()?)
-* the last line in bootsplash (boot.msg) should mention all installed grml flavours
+* implement missing options (--kernel, --initrd, --squashfs, --uninstall)
+* provide --create-partition[s] option
+* provide --verify to check md5sums/sha1sums of files on usb device
+* validate partition schema/layout: is the partition schema ok and the bootable flag set? (--validate)
+* implement logic for storing information about copied files (register every file in a set())
+* the last line in bootsplash (boot.msg) of syslinux should mention all installed grml flavours
(attention, the line should become too long :))
* code improvements:
- improve error handling wherever possible :) => especially disk full, any other known test cases?
directly invoke "grml2usb /path/to/iso /dev/sdb1"
- initial multi-iso / multi-boot support
[Closes: issue501] [Closes: issue584]
- - provide *several* new options like --mbr, --bootoptions=...
+ - provide *several* new options like --bootloader-only, --bootoptions=...
check out the manpage for all the glory details!
- get rid of "polution" of root directory on usb-pen
[Closes: issue466]
- - always write a default MBR [Closes: issue295]
+ - always write a default MBR (thanks a lot to the work
+ and help of Thorsten Glaser!) [Closes: issue295]
- fix regressions for temporary mountpoints / wrong directories
[Closes: issue603] [Closes: issue602]
* Update debian stuff:
- drop mtools from depends
- slightly improve long description
- -- Michael Prokop <mika@grml.org> Sat, 28 Feb 2009 17:20:47 +0100
+ -- Michael Prokop <mika@grml.org> Mon, 02 Mar 2009 14:58:12 +0100
grml2usb (0.9.1) unstable; urgency=low
lilo -M /dev/sdz -s /dev/null
-Troubleshooting and Pitfalls when booting
------------------------------------------
-
-///////////////////////////////////////////////////////////
-TODO: better list type for the error message / reason part?
-See http://www.methods.co.nz/asciidoc/userguide.html
-///////////////////////////////////////////////////////////
-
-[horizontal]
-*Error message*:: ran out of input data. System halted
-
-*Reason*:: Everything OK, except for the filesystem used on your usb device. So
-instead of fat16 you use for example fat32. Fix: use the appropriate filesystem
-(fat16 for usb pens usually). The Bootsplash might be displayed, the kernel
-loads but you very soon get the error message.
-
-*Error message*:: Invalid operating system
-
-*Reason*:: the partition layout is not ok. Very probably there’s no primary
- partition or none has the flag ‘bootable’ set.
-
-*Error message*:: No operating system found.
-
-*Reason*:: you forgot to set the boot-flag on the partition. Or there really isn't
-any operating system at all.
-
-*Error message*:: kernel-panic: unable to mount root-fs...
-
-*Reason*:: Kernel boots but fails to find the root filesystem. root= argument in
-your kernel commandline is pointing to the wrong device. Adjust root=...,
-consider using root=UUID=....
-
-*Error message*:: Could not find kernel image: ...
-
-*Reason*:: either a broken isolinux/syslinux version or a broken BIOS. Check out
-whether the vendor provides a BIOS update or if using bootloader grub instead of
-isolinux/syslinux fixes the problem.
-
USB modes
---------
help="format specified partition with FAT16")
parser.add_option("--force", dest="force", action="store_true",
help="force any actions requiring manual interaction")
-parser.add_option("--grub", dest="grub", action="store_true",
- help="install grub bootloader instead of syslinux")
parser.add_option("--initrd", dest="initrd", action="store", type="string",
help="install specified initrd instead of the default [TODO]")
parser.add_option("--kernel", dest="kernel", action="store", type="string",
help="install specified kernel instead of the default [TODO]")
-parser.add_option("--lilo", dest="lilo", action="store", type="string",
+parser.add_option("--lilo-binary", dest="lilobin", action="store", type="string",
help="lilo executable to be used for installing MBR")
parser.add_option("--mbr-manager", dest="mbrmgr", action="store_true",
- help="enable boot manager menu in MBR")
+ help="enable interactive boot manager menu in MBR")
parser.add_option("--quiet", dest="quiet", action="store_true",
help="do not output anything but just errors on console")
parser.add_option("--skip-addons", dest="skipaddons", action="store_true",
help="do not install /boot/addons/ files")
parser.add_option("--skip-mbr", dest="skipmbr", action="store_true",
help="do not install a master boot record (MBR) on the device")
+parser.add_option("--syslinux", dest="syslinux", action="store_true",
+ help="install syslinux bootloader instead of grub")
parser.add_option("--syslinux-mbr", dest="syslinuxmbr", action="store_true",
help="install syslinux master boot record (MBR) instead of default")
parser.add_option("--squashfs", dest="squashfs", action="store", type="string",
initrd /boot/addons/balder10.imz
}
+menuentry "MirBSD" {
+ set root=(hd0,%(install_partition)s)
+ linux /boot/addons/bsd4grml/ldbsd.com
+}
+
menuentry "Boot OS of first partition on first disk" {
set root=(hd0,1)
chainloader +1
kernel (hd0,%(install_partition)s)/boot/release/%(grml_flavour)s/linux26 apm=power-off lang=us vga=791 quiet boot=live nomce module=%(grml_flavour)s
initrd (hd0,%(install_partition)s)/boot/release/%(grml_flavour)s/initrd.gz
+title Memory test (memtest86+)
+kernel (hd0,%(install_partition)s)/boot/addons/memtest
+
+title Grub - all in one image
+kernel (hd0,%(install_partition)s)/boot/addons/memdisk
+initrd (hd0,%(install_partition)s)/boot/addons/allinone.img
+
+title FreeDOS
+kernel (hd0,%(install_partition)s)/boot/addons/memdisk
+initrd (hd0,%(install_partition)s)/boot/addons/balder10.imz
+
+title MirBSD
+kernel (hd0,%(install_partition)s)/boot/addons/bsd4grml/ldbsd.com
+
""" % {'grml_flavour': grml_flavour, 'local_datestamp': local_datestamp, 'bootoptions': bootoptions, 'install_partition': install_partition } )
KERNEL /boot/addons/memdisk
APPEND initrd=/boot/addons/balder10.imz
+# bsd
+LABEL bsd
+MENU LABEL bsd
+KERNEL /boot/addons/bsd4grml/ldbsd.com
+
## end of global configuration
""" % {'grml_flavour': grml_flavour, 'local_datestamp': local_datestamp, 'bootoptions': bootoptions} )
@device: partition where bootloader should be installed to"""
- # Install bootloader on the device (/dev/sda),
- # not on the partition itself (/dev/sda1)?
- #if partition[-1:].isdigit():
- # device = re.match(r'(.*?)\d*$', partition).group(1)
- #else:
- # device = partition
-
- if options.grub:
- install_grub(device)
- else:
+ # by default we use grub, so install syslinux only on request
+ if options.syslinux:
try:
install_syslinux(device)
except CriticalException, error:
logging.critical("Fatal: %s" % error)
cleanup()
sys.exit(1)
+ else:
+ try:
+ install_grub(device)
+ except CriticalException, error:
+ logging.critical("Fatal: %s" % error)
+ cleanup()
+ sys.exit(1)
def install_lilo_mbr(lilo, device):
else:
lilo = '/usr/share/grml2usb/lilo/lilo.static.i386'
# finally prefer a specified lilo executable
- if options.lilo:
- lilo = options.lilo
+ if options.lilobin:
+ lilo = options.lilobin
if not is_exe(lilo):
raise Exception("lilo executable can not be execute")
proc = subprocess.Popen(["install", "--mode=664", allinoneimg, addons + 'allinone.img'])
proc.wait()
+ # bsd imag
+ bsdimg = search_file('bsd4grml', iso_mount)
+ if bsdimg is None:
+ logging.warn("Warning: bsd4grml not found - can not install it")
+ else:
+ logging.debug("cp -a %s %s" % (bsdimg, addons + '/'))
+ proc = subprocess.Popen(["cp", "-a", bsdimg, addons + '/'])
+ proc.wait()
+
# freedos image
balderimg = search_file('balder10.imz', iso_mount)
if balderimg is None:
main_identifier = re.compile(".*main config generated at: %s.*" % re.escape(str(DATESTAMP)))
if not re.match(main_identifier, string):
grub1_config_file = open(grub1_cfg, 'w')
- logging.info("Note: grml flavour %s is being installed as the default booting system." % grml_flavour)
+ # logging.info("Note: grml flavour %s is being installed as the default booting system." % grml_flavour)
grub1_config_file.write(generate_main_grub1_config(grml_flavour, install_partition, bootopt))
grub1_config_file.close()
else:
grub_flavour_config = True
if os.path.isfile(grub1_cfg):
string = open(grub1_cfg).readlines()
- logging.info("Note: you can boot flavour %s using '%s' on the commandline." % (grml_flavour, grml_flavour))
+ # logging.info("Note: you can boot flavour %s using '%s' on the commandline." % (grml_flavour, grml_flavour))
flavour = re.compile("grml2usb for %s: %s" % (re.escape(grml_flavour), re.escape(str(DATESTAMP))))
for line in string:
if flavour.match(line):
def handle_bootloader_config(grml_flavour, device, target):
"""TODO"""
- if options.grub:
- handle_grub_config(grml_flavour, device, target)
- else:
+ if options.syslinux:
handle_syslinux_config(grml_flavour, target)
+ else:
+ handle_grub_config(grml_flavour, device, target)
def handle_iso(iso, device):
command line will become the default one (that's the one that will boot when
just pressing enter on the bootprompt or wait until the boot timeout matches).
+[IMPORTANT]
+By default a compatible master boot record (MBR) is installed on the device
+(being for example /dev/sdb when executing 'grml2usb grml.iso /dev/sdb1')
+and grub is being used as default bootloader. Avoid installation of the
+default MBR using the --skip-mbr option or if you encounter any problems
+with the default MBR consider using --syslinux-mbr instead. If bootloader
+grub doesn't work for you check out the --syslinux option.
+
Options
-------
*--bootloader-only*::
-Do *not* copy files but instead just install a bootloader.
+Do *not* copy files but instead just install a bootloader. Note that the boot
+addons are copied to /boot/addons at this stage as well. If you want to skip
+copying the boot addons consider using the --skip-addons option.
*--copy-only*::
Force any (possible dangerous) actions requiring manual interaction (like --fat16).
- *--grub*::
-
-Install grub bootloader instead of syslinux.
-
*--help*::
Display usage information and exit.
option *--initrd* as well. (Be aware when using multiboot setup.)
[Notice: not implemented yet.]
- *--lilo=...*::
+ *--lilo-binary=...*::
+
+Use specified lilo executable for installing master boot record (MBR) when using
+the --syslinux-mbr option. By default any system wide (from $PATH) lilo
+executable is taken. If there can not be find any lilo executable the
+statically compiled version of the grml2usb Debian package (see
+/usr/share/grml2usb/lilo/lilo.static.[amd64|i386]) is taken.
+
+ *--mbr-manager=...*::
-Use specified lilo executable for installing master boot record (MBR). By
-default any system wide (from $PATH) lilo executable is taken. If there can not
-be find any lilo executable the statically compiled version of the grml2usb
-Debian package (see /usr/share/grml2usb/lilo/lilo.static.[amd64|i386]) is taken.
+Install master boot record (MBR) with integrated boot manager, providing a
+simple selection for specifying the device for booting from. This options is
+available only when using the default MBR and won't work if using the
+--syslinux-mbr option.
*--quiet*::
Do not install /boot/addons/ files (like dos, grub, memdisk,...).
+ *--skip-mbr*::
+
+Do not touch/install the master boot record (MBR).
+
+ *--syslinux*::
+
+Install syslinux bootloader instead of the default (being grub).
+
+ *--syslinux-mbr*::
+
+Install syslinux master boot record (MBR) instead of the default one. By
+default a very compatible MBR is installed, if you can encounter any problems
+with it you can try using the syslinux MBR instead. If that works for you please
+<<X7,let us know>> so we can adjust our default MBR accordingly.
+
+[NOTE]
+When using the --syslinux-mbr option also lilo is executed so the according
+partitions are set active.
+
*--squashfs=*::
Install specified squashfs file instead of the default.
boot/ ->
|-- addons/
- | |-- allinone.img
- | |-- balder10.imz
- | |-- chain.c32
- | |-- memdisk
- | `-- menu.c32
+ | |-- allinone.img [grub - all in one image]
+ | |-- bsd4grml/ [MirBSD]
+ | |-- balder10.imz [FreeDOS]
+ | |-- memdisk [chainloading helper]
+ | |-- memtest [memtest86+]
|-- release/
| |-- grml/
- | | |-- linux26
- | | |-- initrd.gz
+ | | |-- linux26 [Kernel]
+ | | |-- initrd.gz [initramfs]
| |-- grml64
- | | |-- linux26
- | | |-- initrd.gz
+ | | |-- linux26 [Kernel]
+ | | |-- initrd.gz [initramfs]
| |-- grml-medium
- | | |-- linux26
+ | | |-- linux26 [...]
| | |-- initrd.gz
| |-- grml64-medium
| | |-- linux26
| |-- linux26
| |-- initrd.gz
|-- grub/
- | |-- menu.lst
- | |-- splash.xpm.gz
- | `-- stage2_eltorito
+ | |-- grml.png [splash screen for grub2]
+ | |-- grub.cfg [configuration file for grub2]
+ | |-- menu.lst [configuration file for grub1]
+ | |-- splash.xpm.gz [splash screen for grub1]
+ | `-- stage2_eltorito [stage 2 loader for grub1]
`-- syslinux/
- |-- boot.msg
- |-- f1
- |-- f2
- |-- f3
+ |-- boot.msg [boot splash for syslinux]
+ |-- f1 [screen when pressing f1]
+ |-- f2 [screen when pressing f2]
+ |-- f3 [...]
|-- f4
|-- f5
|-- f6
|-- f8
|-- f9
|-- f10
- |-- logo.16
- `-- syslinux.cfg
+ |-- logo.16 [graphical part of boot splash]
+ `-- syslinux.cfg [configuration file for syslinux]
grml/
- |-- grml2usb.txt
- |-- grml-cheatcodes.txt
- |-- grml-version.txt
- |-- LICENSE.txt
- |-- md5sums
- |-- README.txt
- `-- web/
+ |-- grml2usb.txt [not yet implemented]
+ |-- grml-cheatcodes.txt [list of bootoptions for grml]
+ |-- grml-version.txt [file containing information about grml-version]
+ |-- LICENSE.txt [license information]
+ |-- md5sums [md5sums of original ISO]
+ |-- README.txt [informational text]
+ `-- web/ [browser related files]
|-- index.html
|-- style.css
`-- images/
`-- logo.png
live/
- |-- filesystem.module
- |-- grml.squashfs
- |-- grml-medium.module
- |-- grml-medium.squashfs
- |-- grml-small.module
+ |-- filesystem.module [file specifying which squashfs should be used by default]
+ |-- grml.squashfs [squashfs file]
+ |-- grml-medium.module [module specifying which squashfs should be used for grml-medium]
+ |-- grml-medium.squashfs [squashfs file for grml-medium]
+ |-- grml-small.module [...]
|-- grml-small.squashfs
|-- grml64.module
|-- grml64.squashfs
# blktrace -d /dev/sdb -o - | blkparse -i -
# grml2usb grml_2008.11.iso /dev/sdb1
+[[X6]]
+Troubleshooting and Pitfalls when booting
+-----------------------------------------
+
+Here is a list of common error messages from BIOS/bootloader when trying to boot
+from USB.
+
+///////////////////////////////////////////////////////////
+TODO: better list type for the error message / reason part?
+See http://www.methods.co.nz/asciidoc/userguide.html
+///////////////////////////////////////////////////////////
+
+[horizontal]
+*Error message*:: ran out of input data. System halted
+
+*Reason*:: Everything OK, except for the filesystem used on your usb device. So
+instead of fat16 you are using for example fat32. Fix: use the appropriate
+filesystem (fat16 for usb pens usually). The Bootsplash might be displayed, the
+kernel loads but you very soon get the error message.
+
+*Error message*:: Invalid operating system
+
+*Reason*:: the partition layout is not ok. Very probably there's no primary
+ partition (/dev/sdX{1..4}) or none has the flag 'bootable' set.
+
+*Error message*:: No operating system found.
+
+*Reason*:: you forgot to set the boot-flag on the partition. Or there really isn't
+any operating system at all. :)
+
+*Error message*:: kernel-panic: unable to mount root-fs...
+
+*Reason*:: Kernel boots but fails to find the root filesystem. The root=
+argument in your kernel commandline is pointing to the wrong device. Adjust
+root=..., consider using root=UUID=....
+
+*Error message*:: Could not find kernel image: ...
+
+*Reason*:: either a broken isolinux/syslinux version or a broken BIOS. Check out
+whether the vendor provides a BIOS update or if using bootloader grub instead of
+isolinux/syslinux fixes the problem.
+
Frequently Asked Questions (FAQ)
--------------------------------
install the new ISO using grml2usb) and you can carry additional files on a
writable medium with yourself.
+Why is there a menu.lst and a grub.cfg inside /boot/grub/?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+grml2usb supports grub version 1 (grub1) as well as grub version 2 (grub2).
+Whereas grub1 uses menu.lst the new version grub2 needs grub.cfg.
+Providing both files allows grml2usb to install grub on the target device
+no matter which grub version is available on the host where grml2usb is
+executed on.
+
Why do I have to use a FAT16 filesystem?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-You have to use a FAT16 filesystem if you consider using syslinux (being the
-default). Syslinux currently does not support any other filesystems. If you want
-to use another filesystem (like ext2/3) consider using the --grub option
-instead.
+You have to use a FAT16 filesystem only if you consider using syslinux, Syslinux
+(currently) does not support any other filesystems. If you want to use another
+filesystem (like ext2/3) just don't use syslinux (drop the --syslinux option)
+but use the default bootloader (grub) instead.
I think I've got a really cool idea!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Please <<X7,report it to the author>>. Or even better: send us a patch.
+Please <<X7,report it to the author>>. Or even better: send us a patch. :)
+
+I've problems with booting from USB.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Check out <<X6,Troubleshooting and Pitfalls when booting>>.
I've found a bug!
~~~~~~~~~~~~~~~~~
Install specified ISO on device /dev/sdb1 and format partition /dev/sdb1 with
FAT16 filesystem.
- # grml2usb --grub /home/grml/grml_2008.11.iso /dev/sdb1
+ # grml2usb --syslinux /home/grml/grml_2008.11.iso /dev/sdb1
-Install specified ISO on device /dev/sdb1 and use Grub as bootloader
-(instead of syslinux being the default).
+Install specified ISO on device /dev/sdb1 and use syslinux as bootloader
+(instead of grub being the default).
# grml2usb --kernel=/boot/vmlinuz-2.6.28-grml --initrd=/boot/initrd.img-2.6.28-grml \
/home/grml/grml_2008.11.iso /dev/sdb1