Difference between revisions of "Sugar on a Stick/Linux"

From Sugar Labs
Jump to navigation Jump to search
Line 25: Line 25:
 
*: <pre>./tools_livecd-iso-to-disk.sh --overlay-size-mb 400 --delete-home --extra-kernel-args selinux=0 ./SoaS3-200909271154.iso /dev/sd(*)</pre>
 
*: <pre>./tools_livecd-iso-to-disk.sh --overlay-size-mb 400 --delete-home --extra-kernel-args selinux=0 ./SoaS3-200909271154.iso /dev/sd(*)</pre>
 
** (*) ''be sure of your USB/SD device name. Use the mount command or the partition manager to confirm it before executing the script. It is VERY DANGEROUS to your other discs if this is entered wrong.''
 
** (*) ''be sure of your USB/SD device name. Use the mount command or the partition manager to confirm it before executing the script. It is VERY DANGEROUS to your other discs if this is entered wrong.''
** <pre>--format --reset-mbr</pre> arguments for the shell script were recommended, but may be excluded to preserve the existing disc format and data.
+
** The <code>--format --reset-mbr</code> arguments for the shell script were recommended, but may be excluded to preserve the existing disc format and data.
  
 
== Put [[Sugar on a Stick/Installation/OLPC | SoaS on an OLPC XO-1]] ==
 
== Put [[Sugar on a Stick/Installation/OLPC | SoaS on an OLPC XO-1]] ==

Revision as of 21:18, 27 September 2009

Introduction

This page offers a variety of experimental options for putting a Sugar on a Stick image on a USB flash drive under GNU/Linux. Look at the page Contents box to the right to select a suitable option.

For released versions, see v1 Strawberry.

If you have questions, trouble, or feedback, please let us know on the discussion page. "Sugar on a Stick" is provided in a number of variants. If you can improve these instructions, please edit the page and do so!

SoaS v2

(Fedora 12 alpha) See Soas Fedora image matrix.

  • Sugar on a Stick v2 snapshots are available for download at http://download.sugarlabs.org/soas/snapshots/2/soas04.iso, (27 September 2009).
  • Use ONLY this script file to create a bootable image, http://bit.ly/livecd-iso-to-disk.
  • The .iso file may be burnt to a CD-ROM and booted on your PC (or mounted in a virtual machine to boot it):
    1. Press <Esc> at the blue. initial boot screen,
    2. Press <Tab> to enter more boot options,
    3. Append selinux=0 to the startup command arguments,
    4. Press <Enter> to continue with the boot.

Note:

  • See this announcement for more information.
  • Do NOT use installation instructions in other sections of this page for this version of SoaS.
  • Note that selinux must be disabled in the startup (selinux=0) or Sugar will not load.
    This precludes using a dd command to write a USB or SD image. The SCRIPT MUST BE USED.
    ./tools_livecd-iso-to-disk.sh --overlay-size-mb 400 --delete-home --extra-kernel-args selinux=0 ./SoaS3-200909271154.iso /dev/sd(*)
    • (*) be sure of your USB/SD device name. Use the mount command or the partition manager to confirm it before executing the script. It is VERY DANGEROUS to your other discs if this is entered wrong.
    • The --format --reset-mbr arguments for the shell script were recommended, but may be excluded to preserve the existing disc format and data.

Put SoaS on an OLPC XO-1

Put SoaS onto a stick using Fedora and Ubuntu

This is known to work in Fedora and Ubuntu.

First, start downloading a SoaS .iso image from the download locations section, then return here.

(A program called UNetBootin available at http://unetbootin.sourceforge.net/ does all this magic for you... or you can do the magic yourself:)
  • Make sure you have the syslinux package installed on the operating system that you will use to prepare the Live USB image. It is recommended that you also have the isomd5sum package installed. The cryptsetup package is another option potentially used by the "livecd-iso-to-disk" installation script. (On Ubuntu, sudo apt-get install syslinux isomd5sum cryptsetup will install the packages. They are also available through the Synaptic Package Manager.)
(On Gentoo, one needs to uncomment 'SAMPLE FILE' in /etc/mtools/mtools.conf to make syslinux work.)
  • syslinux is needed to set up booting on the FAT file system of the USB disc or Live CD.
  • isomd5sum is needed for the recommended verification step, which checks that the .iso file is complete after its travels. If there is a problem with the .iso file, the script will exit and provide a failure message. The verification step can be bypassed by using the --noverify option.
  • cryptsetup is only needed for the option to provide password protection and encryption for the persistent /home/liveuser folder. It is not necessary if one applies the recommended --unencrypted-home option. The --unencrypted-home option is preferred because the reduced overhead improves robustness with the compressed squashfs file system employed by the Live USB deployment.
  • Check the USB device. In the example below the device is /dev/sdb:
df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              19G  7.0G   11G  40% /
tmpfs                 1.5G     0  1.5G   0% /lib/init/rw
varrun                1.5G   96K  1.5G   1% /var/run
varlock               1.5G     0  1.5G   0% /var/lock
udev                  1.5G  2.9M  1.5G   1% /dev
tmpfs                 1.5G  104K  1.5G   1% /dev/shm
lrm                   1.5G  2.0M  1.5G   1% /lib/modules/2.6.27-11-generic/volatile
/dev/sdb1             996M  913M   84M  92% /mnt/myUSBdisc
  • Unmount the drive,
sudo umount /dev/sdb1
  • Then check to see that the partition is marked as bootable,
sudo fdisk -l <----that's a lowercase letter 'L' for the list option.

You should see output that looks like this:

Disk /dev/sdb: 1047 MB, 1047265280 bytes
255 heads, 63 sectors/track, 127 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0008325f
. 
 Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         127     1020096    6  FAT16

The '*' under the Boot column is what you want to see.

If not, then
  • For Ubuntu 8.10, menu: System -> Administration -> Partition Editor (GParted).
  1. Select your USB device (/dev/sdb for the rest of these instructions),
  2. then your partition (/dev/sdb1),
  3. then menu: Partition -> Manage Flags,
  4. check the boot box,
  5. and Close to mark the partition as bootable.
  • For Fedora,
  1. parted /dev/sdb
  2. toggle 1 boot
  3. quit
  • Also, check to see that you do not already have an existing boot loader (such as GRUB) in the MBR of your stick. (If you have not previously used this stick as a live boot, you can skip this step.) To be sure that the USB stick's MBR is wiped clean, overwrite it completely using:
dd if=/dev/zero of=/dev/sdb bs=446 count=1
(Actually, that didn't work for me. But this did:
lilo -M /dev/sdb
It put in a standard MBR that boots whichever partition has been called bootable. It does not install LILO as such.)
  • Change mode to make the script executable.
chmod +x livecd-iso-to-disk.sh
  • Run it as root, making sure to pass the correct USB device and to set overlay and home size appropriately, depending on the stick size.
sudo ./livecd-iso-to-disk.sh --overlay-size-mb 300 --home-size-mb 160 --delete-home --unencrypted-home soas-strawberry.iso /dev/sdb1
The livecd-iso-to-disk installation has the advantage over the liveusb-creator installation method by allowing a persistent /home/liveuser folder with the --home-size-mb NNN option. This feature would allow you to update the OS image while keeping the user files (by running the script against your existing installation but leaving out the --home-size-mb NNN option).
  • The --delete-home option is used to avoid an error message while requesting both a new home (with --home-size-mb) and a persistent home (indirectly with --unencrypted-home). You wouldn't use the --delete-home option on an upgrade of the operation system only.
Depending on the size of your USB stick, you may have to decrease --overlay-size-mb and --home-size-mb values (for example, for a 1-GB stick, use 200 for each).
  • If you get an error about udevinfo, you have the new version of udev where "udevadm info" is the proper command. :Create an executable file called udevinfo somewhere in your path with the following contents:
#!/bin/bash
udevadm info $*
  • Watch out for errors in the output of the script, the script seems to ignore them! (and say all is fine on the last line).

livecd-iso-to-disk.sh transcript

$ sudo ./livecd-iso-to-disk.sh --overlay-size-mb 300 --home-size-mb 160 --delete-home --unencrypted-home Soas2-200906211228.iso /dev/sdb1
Verifying image...
/home/walter/Desktop/Soas2-200906211228.iso:   9f1aa3c7a19dd9c68d1047d681f703c6
Fragment sums: f5ddb7deb26b6474bd59be9f57b6c7abcd624e1ccc682ddf664ba73da4ed
Fragment count: 20
Checking: 100.0%

The media check is complete, the result is: PASS.

It is OK to use this media.
Copying live image to USB stick
Updating boot config file
Initializing persistent overlay file
300+0 records in
300+0 records out
314572800 bytes (315 MB) copied, 88.7551 s, 3.5 MB/s
Initializing persistent /home
160+0 records in
160+0 records out
167772160 bytes (168 MB) copied, 48.1191 s, 3.5 MB/s
Formatting unencrypted /home
mke2fs 1.41.4 (27-Jan-2009)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
40960 inodes, 163840 blocks
8192 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
20 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks: 
	8193, 24577, 40961, 57345, 73729

Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
tune2fs 1.41.4 (27-Jan-2009)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
Installing boot loader
USB stick set up as live image!

Full Fedora 11 Install of Sugar-Desktop on a Stick to USB

Uses Logical Volume Manager (LVM) layer over the file structure on the USB flash drive. Other methods on this page install a LiveUSB image that uses a compressed file system (SquashFS) to hold the system and content.

THIS IS A WORK IN PROGRESS. Please make suggestions or improvements.

Download of Prebuilt SUGAR-DESKTOP USB.img file

  • DOWNLOAD Link:[[1]]

Requires:

  • GNU/Linux system with ability to decompress archive
  • 4 GB or larger USB Stick
  • Familiarity with dd commands in terminal (see below)

Make your OWN Custom SUGAR-DESKTOP USB Boot Stick

  • Uses Fedora 11 Net Install CD,[2] so best with a fast internet connection.
  • USB 2.0 recommended or install would take a excessive time using USB 1.0
  • Requires 4-GB USB drive. (Tested with Cruzer Micro USB Stick, an 8-GB Toshiba USB drive works faster.)
  1. Boot from CD
  2. Enter language, time, location, root user password
  3. Replace existing Linux system
  4. Review and modify partitioning layout
  5. edit LVM VolGroup
  6. delete LV_swap (needed to fit on 4GB stick and for reduced writes to USB)
  7. edit LV_root (Edit LVM and increase to max size on (/dev/sda*)
  8. size:(change to max shown)
  9. yes for no swap file
  10. Write changes to disk *NOTE: Be sure this is the USB drive, or you will ruin your hard disk installation on the host PC.
  11. install boot loader Fedora/dev/mapper/VolGroup-lv_root
  12. enable network interface (DHCP, IPv4)
  13. retrieve install informtion for Fedora 11-i386
  14. Select customize now
    1. sugar-desktop ONLY / deselect gnome-desktop
    2. deselect other unwanted applications in categories (Games, etc)
    Installer will reformat drive; install bootloader; transfer 957 packages (about 2 hours)
  15. reboot
  16. Configuration setup (Graphical), add user and password on first boot
  17. Log in User
  18. Select Sugar on selection bar
  • You can also do a hard disk install of SUGAR this way (not tested yet)
  • This procedure can be used with a Windows PC if it will boot from CD

8 GB Gnome/Sugar-Desktop USB

  • install gnome or KDE desktop with this technique and then, use add/remove programs to install sugar from other desktops
  • you get a 8GB USB that boots either gnome or sugar (8 GB Toshiba USB)

This Works well....can switch back between desktops by logging off and back on.

AUTO Login to SUGAR

TO bypass gdm Login and start up Stick in SUGAR DESKTOP:

  • start up and log in to sugar
  • Open Terminal Application
su -
password=sugarroot
yum install gedit
(after gedit is installed:)
gedit /etc/gdm/gdm.schemas
  • change: (to true and add sugar)
 --snip--
<key>daemon/AutomaticLoginEnable</key>
<signature>b</signature>
<default>true</default>
</schema>
<schema>
<key>daemon/AutomaticLogin</key>
<signature>s</signature>
<default>sugar</default>
</schema> 
 --snip--
  • Reboot

Duplication of USB Sticks

Caution: This is a work in progress

Preparation of target device

Caution if you purchase Sandisk cruzer micro 4 GB USB you have to use Windows machine to to start the U3 program and delete the hidden U3 directory

This will make the USB a full 4GB otherwise it will be too small to use dd to copy .img file

  • U3 partition will not be removed by formating with Partition Manager

CAUTION VERY DANGEROUS IF NOT ENTERED CORRECTLY:

  • Enter Terminal
su -
<password>
(Need to be ROOT or get permission denied)
  • Target USB device MUST be larger for this to work (not all USB Sticks are exactly the same size)
    • be certain of the device identifier, /dev/sd(x), for your USB Stick. (I use the partition editor in Ubuntu 9.04 to identify the USB device.)
  • Note that .img file on Desktop can be compressed for distribution.

Example of sucessful clone session:'

Make Image from USB:
  • 8-GB Toshiba USB
root@xxxxx:/home/robert/Desktop# dd if=/dev/sda* of=USB8.img
15687680+0 records in
15687680+0 records out
8032092160 bytes (8.0 GB) copied, 421.146 s, 19.1 MB/s
use image to write USB Clone:
  • 4-GB SanDisk Cruzer with U3 partition removed
root@xxxx:/home/robert/Desktop# dd if=USB4C2.img of=/dev/sdg bs=4k
986623+1 records in
986623+1 records out
4041211392 bytes (4.0 GB) copied, 595.509 s, 6.8 MB/s

Make a Sugar-Desktop on a Stick VMware appliance

Prebuilt VMware Appliances: [3]

  1. Download and expand file
  2. copy to USB Stick (min 4GB)
  3. Play with VMPlayer (free) available here: [4]

OR

These instructions will help you put a SoaS image onto a USB stick that boots into VMware Player that then runs a VMware Virtual Appliance containing a SoaS image.

openSUSE Sugar-Desktop on a stick

  • The openSUSE version is a .raw image that is burned to a stick by the dd command. It creates a usb stick that boots sugar-desktop with 55 applications.
  • This is a persistent live image on a stick (a file system is created on the stick on first boot)
  • Download Link for .raw files:[[5]]

Dual Mode .iso Files

NOTE: Latest versions of opensuse-edu-sugar.iso files can be burned to USB with dd command. "They are dual mode" Download: [[6]]

The resulting USB/SD has not got persistence. It is equivalent to Booting from the CD

Example record:

  • be sure /dev/sd(x) points to your USB (can destroy your Hard Disk if wrong) use Partition Manager to see proper label...
dd if=openSUSE-Sugar-live-unstable.i686-0.2.0-Build5.1.iso of=/dev/sd(x)* bs=4M
102+1 records in
102+1 records out
428867584 bytes (429 MB) copied, 53.2686 s, 8.1 MB/s

What's next?

After you've created your stick, it's time to boot your stick and test it out. Please also report your observations.