Wishlist/LiveUSB distro

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Ideal method)
Line 21: Line 21:
 
* if a dedicated partition for each payload is needed (see memtest example...)
 
* if a dedicated partition for each payload is needed (see memtest example...)
 
* if multi-boot is possible: grub?
 
* if multi-boot is possible: grub?
 +
 +
==Linux distro Howto: liveCD 2 liveUSB==
 +
 +
Summary: When the neo/openmoko device is connected in mass storage mode to a linux host,
 +
# Partition the transflash into livecd (bootable flag) & home partition
 +
# Format the created partitions
 +
# Extract the iso's contents onto the livecd partition
 +
# Rename isolinux.cfg and edit it syslinux.cfg (see ubuntu tutorial link)
 +
# Make the partition bootable using syslinux:
 +
    $ sudo syslinux -f /dev/sd?
 +
 +
*[http://www.debuntu.org/how-to-install-ubuntu-linux-on-usb-bar Howto install ubuntu (or any other distro) on usb stick]
 +
*[http://www.gentoo.org/doc/en/liveusb.xml Gentoo on usb stick]
 +
*[http://pendrivelinux.com/ Windows & Linux tutorials & resources]:   
 +
    * Flash installation via Windows: XUbuntu, DSL, Knoppix, Slax, MiniMe
 +
    * Flash installation via Linux: Ubuntu Edgy, Knoppix, PCLinuxOS
 +
 +
'''Transflash partitioning schema example'''
 +
 +
* 2 Gb: /dev/sd? (where N is the transflash's number)
 +
* 700 Mb: /dev/sd?1 : containing bootable iso, FAT16
 +
* 1300 Mb: /dev/sd?2 : openmoko & bootable os home partition, EXT3?
 +
* + eventually a swap
 +
 +
The limitation of this method is that the booted OS is static (not-self modifiable). There's the option to install linux using the partition, but it's not really mobility-oriented (liveCDs are optimized for maximum autoconfiguration).
  
 
==Alternative methods==
 
==Alternative methods==
Line 39: Line 64:
  
 
Grub & memdisk can boot floppy images, but (AFAIK) not isos...
 
Grub & memdisk can boot floppy images, but (AFAIK) not isos...
 
* [http://www.knoppix.net/wiki/Cheat_Codes knoppix '''bootfrom''' cheatcode]
 
 
    bootfrom=/dev/hda1/KNX.iso
 
 
Bootfrom needs access to a running Knoppix-System '''with the same Kernel as the Bootkernel''', before it is able to mount the partition / ISO-Image. 
 
 
* Maybe there's a way to achieve a boot cd iso selecter see ([http://www.linuxquestions.org/questions/showthread.php?t=528840 this post])
 
* virtualization-oriented distro... ex [http://unit.aist.go.jp/itri/knoppix/xen/index-en.html Xenoppix]
 
 
==Transflash partitioning schema example==
 
 
* 2 Gb: /dev/sd? (where N is the transflash's number)
 
* 700 Mb: /dev/sd?1 : containing bootable iso, FAT16
 
* 1300 Mb: /dev/sd?2 : openmoko & bootable os home partition, EXT3?
 
* eventually a swap
 
 
That way, one can install a new iso when it's released. An updater script shall be written.
 
 
==Linux distro Howto: liveCD extraction and modification==
 
 
Summary: When the neo/openmoko device is connected in mass storage mode to a linux host,
 
# Partition the transflash into livecd (bootable flag) & home partition
 
# Format the created partitions
 
# Extract the iso's contents onto the livecd partition
 
# Rename isolinux.cfg and edit it syslinux.cfg (see ubuntu tutorial link)
 
# Make the partition bootable using syslinux:
 
    $ sudo syslinux -f /dev/sd?
 
 
*[http://www.debuntu.org/how-to-install-ubuntu-linux-on-usb-bar Howto install ubuntu (or any other distro) on usb stick]
 
*[http://www.gentoo.org/doc/en/liveusb.xml Gentoo on usb stick]
 
*[http://pendrivelinux.com/ Windows & Linux tutorials & resources]:   
 
    * Flash installation via Windows: XUbuntu, DSL, Knoppix, Slax, MiniMe
 
    * Flash installation via Linux: Ubuntu Edgy, Knoppix, PCLinuxOS
 
 
==Memtest86+==
 
  
 
Grub example (from stock /boot/grub/menu.lst ubuntu install):
 
Grub example (from stock /boot/grub/menu.lst ubuntu install):
Line 85: Line 74:
  
 
Using the memdisk kernel from the syslinux package, you can load disk images and execute them in a non-emulated environment.
 
Using the memdisk kernel from the syslinux package, you can load disk images and execute them in a non-emulated environment.
 +
 +
 +
* [http://www.knoppix.net/wiki/Cheat_Codes knoppix '''bootfrom''' cheatcode]
 +
 +
    bootfrom=/dev/hda1/KNX.iso
 +
 +
Bootfrom needs access to a running Knoppix-System '''with the same Kernel as the Bootkernel''', before it is able to mount the partition / ISO-Image. 
 +
 +
* Maybe there's a way to achieve a boot cd iso selecter see ([http://www.linuxquestions.org/questions/showthread.php?t=528840 this post])
 +
* virtualization-oriented distro... ex [http://unit.aist.go.jp/itri/knoppix/xen/index-en.html Xenoppix]
  
 
==Using Qemu to boot Linux from a flash drive within Windows==
 
==Using Qemu to boot Linux from a flash drive within Windows==

Revision as of 20:19, 25 March 2007

Wishes warning! This article or section documents one or more OpenMoko Wish List items, the features described here may or may not be implemented in the future.

Contents

Introduction

An openmoko device could act as the perfect geeky swiss knive: go anywhere with your Linux desktop and tools.

Similar functionality can be found in the Wizpy portable media player

When the openmoko device is in mass storage mode, a host computer should be able to boot on it, presenting a grub menu offering to boot into several images / partitions (payloads) on the transflash: memtest, UBCD (the ultimate boot cd), a lightweight security oriented livecd distro, you name it...

It's sometimes called Live USB: from Wikipedia LiveUSB definition, A live USB is a USB flash drive containing a full operating system which can be booted from. Live USBs are closely related to Live CDs, and are sometimes used interchangeably. Like Live CDs, Live USBs can be used for system administration, data recovery, or the testing of operating system distributions without committing to a permanent installation on the local hard drive. Many of the smaller Linux distributions can also be used from a USB flash drive.

Usually, all you need for this with an USB storage device (flash USB stick or external drive) is a partition, flagged "bootable" (see fdisk), containing a boot loader (say grub). But the problem is that specifications vary between motherboards, so there are variants and mandatory requirements to define (here would be a good idea), so that one can optimize/maximize the compatibility.

TODO

Testing/further research has to be conducted to determine:

  • if a bootable-flagged partition / grub doesn't mess openmoko up
  • if the phone can still act as a phone, or if the booted os can use the gprs functions
  • if the phone can recharge on mass storage mode (from the usb cable)
  • if a dedicated partition for each payload is needed (see memtest example...)
  • if multi-boot is possible: grub?

Linux distro Howto: liveCD 2 liveUSB

Summary: When the neo/openmoko device is connected in mass storage mode to a linux host,

  1. Partition the transflash into livecd (bootable flag) & home partition
  2. Format the created partitions
  3. Extract the iso's contents onto the livecd partition
  4. Rename isolinux.cfg and edit it syslinux.cfg (see ubuntu tutorial link)
  5. Make the partition bootable using syslinux:
   $ sudo syslinux -f /dev/sd?
   * Flash installation via Windows: XUbuntu, DSL, Knoppix, Slax, MiniMe
   * Flash installation via Linux: Ubuntu Edgy, Knoppix, PCLinuxOS

Transflash partitioning schema example

  • 2 Gb: /dev/sd? (where N is the transflash's number)
  • 700 Mb: /dev/sd?1 : containing bootable iso, FAT16
  • 1300 Mb: /dev/sd?2 : openmoko & bootable os home partition, EXT3?
  • + eventually a swap

The limitation of this method is that the booted OS is static (not-self modifiable). There's the option to install linux using the partition, but it's not really mobility-oriented (liveCDs are optimized for maximum autoconfiguration).

Alternative methods

The ideal way of doing it would be to have a bootloader on the usb flash, which would offer booting directly from an iso (stored on the very same device). This way, just download the new iso, and it's updated !

Hints to explore:

   If you want to boot from a iso file on a harddisk, do something in menu.lst like
   title Boot from iso on a harddisk
   map (hdX,Y)/your.iso (hdZ)
   map --rehook
   chainloader (hdZ)+1
   rootnoverify (hdZ)
   boot

Grub & memdisk can boot floppy images, but (AFAIK) not isos...

Grub example (from stock /boot/grub/menu.lst ubuntu install):

   title           Ubuntu, memtest86+
   root            (hd0,2)
   kernel          /memtest86+.bin
   quiet
   boot

Using the memdisk kernel from the syslinux package, you can load disk images and execute them in a non-emulated environment.


   bootfrom=/dev/hda1/KNX.iso 

Bootfrom needs access to a running Knoppix-System with the same Kernel as the Bootkernel, before it is able to mount the partition / ISO-Image.

  • Maybe there's a way to achieve a boot cd iso selecter see (this post)
  • virtualization-oriented distro... ex Xenoppix

Using Qemu to boot Linux from a flash drive within Windows

The following tutorial explains how to use Qemu to boot Linux from a portable USB flash device while still working within Windows. This Enables the user to have both systems running at the same time eliminating the need to restart the PC and set your BIOS options to boot Linux.

PendriveLinux article

Interesting distros/payloads

System diagnostics / recovery

General purpose

Security-oriented: pentesting, forensics, anonymous webbrowsing

The SabayonLinux distro offers a lot of boot cheatcodes, such as booting onto GeexBox. We should take a look at the method used.

List of live distros @ wikipedia

List of live distros @ distrowatch

Wikipedia LiveUSB article

Personal tools
Wishes warning! This article or section documents one or more OpenMoko Wish List items, the features described here may or may not be implemented in the future.

Introduction

An openmoko device could act as the perfect geeky swiss knive: go anywhere with your Linux desktop and tools.

Similar functionality can be found in the Wizpy portable media player

When the openmoko device is in mass storage mode, a host computer should be able to boot on it, presenting a grub menu offering to boot into several images / partitions (payloads) on the transflash: memtest, UBCD (the ultimate boot cd), a lightweight security oriented livecd distro, you name it...

It's sometimes called Live USB: from Wikipedia LiveUSB definition, A live USB is a USB flash drive containing a full operating system which can be booted from. Live USBs are closely related to Live CDs, and are sometimes used interchangeably. Like Live CDs, Live USBs can be used for system administration, data recovery, or the testing of operating system distributions without committing to a permanent installation on the local hard drive. Many of the smaller Linux distributions can also be used from a USB flash drive.

Usually, all you need for this with an USB storage device (flash USB stick or external drive) is a partition, flagged "bootable" (see fdisk), containing a boot loader (say grub). But the problem is that specifications vary between motherboards, so there are variants and mandatory requirements to define (here would be a good idea), so that one can optimize/maximize the compatibility.

TODO

Testing/further research has to be conducted to determine:

  • if a bootable-flagged partition / grub doesn't mess openmoko up
  • if the phone can still act as a phone, or if the booted os can use the gprs functions
  • if the phone can recharge on mass storage mode (from the usb cable)
  • if a dedicated partition for each payload is needed (see memtest example...)
  • if multi-boot is possible: grub?

Linux distro Howto: liveCD 2 liveUSB

Summary: When the neo/openmoko device is connected in mass storage mode to a linux host,

  1. Partition the transflash into livecd (bootable flag) & home partition
  2. Format the created partitions
  3. Extract the iso's contents onto the livecd partition
  4. Rename isolinux.cfg and edit it syslinux.cfg (see ubuntu tutorial link)
  5. Make the partition bootable using syslinux:
   $ sudo syslinux -f /dev/sd?
   * Flash installation via Windows: XUbuntu, DSL, Knoppix, Slax, MiniMe
   * Flash installation via Linux: Ubuntu Edgy, Knoppix, PCLinuxOS

Transflash partitioning schema example

  • 2 Gb: /dev/sd? (where N is the transflash's number)
  • 700 Mb: /dev/sd?1 : containing bootable iso, FAT16
  • 1300 Mb: /dev/sd?2 : openmoko & bootable os home partition, EXT3?
  • + eventually a swap

The limitation of this method is that the booted OS is static (not-self modifiable). There's the option to install linux using the partition, but it's not really mobility-oriented (liveCDs are optimized for maximum autoconfiguration).

Alternative methods

The ideal way of doing it would be to have a bootloader on the usb flash, which would offer booting directly from an iso (stored on the very same device). This way, just download the new iso, and it's updated !

Hints to explore:

   If you want to boot from a iso file on a harddisk, do something in menu.lst like
   title Boot from iso on a harddisk
   map (hdX,Y)/your.iso (hdZ)
   map --rehook
   chainloader (hdZ)+1
   rootnoverify (hdZ)
   boot

Grub & memdisk can boot floppy images, but (AFAIK) not isos...

Grub example (from stock /boot/grub/menu.lst ubuntu install):

   title           Ubuntu, memtest86+
   root            (hd0,2)
   kernel          /memtest86+.bin
   quiet
   boot

Using the memdisk kernel from the syslinux package, you can load disk images and execute them in a non-emulated environment.


   bootfrom=/dev/hda1/KNX.iso 

Bootfrom needs access to a running Knoppix-System with the same Kernel as the Bootkernel, before it is able to mount the partition / ISO-Image.

  • Maybe there's a way to achieve a boot cd iso selecter see (this post)
  • virtualization-oriented distro... ex Xenoppix

Using Qemu to boot Linux from a flash drive within Windows

The following tutorial explains how to use Qemu to boot Linux from a portable USB flash device while still working within Windows. This Enables the user to have both systems running at the same time eliminating the need to restart the PC and set your BIOS options to boot Linux.

PendriveLinux article

Interesting distros/payloads

System diagnostics / recovery

General purpose

Security-oriented: pentesting, forensics, anonymous webbrowsing

The SabayonLinux distro offers a lot of boot cheatcodes, such as booting onto GeexBox. We should take a look at the method used.

List of live distros @ wikipedia

List of live distros @ distrowatch

Wikipedia LiveUSB article