Difference between revisions of "Talk:Sugar Creation Kit/sck/Advanced Topics"

From Sugar Labs
Jump to navigation Jump to search
m (delete entry)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Help with install, sweets on a Raspberry pi ==
 
*from IRC with permission--[[User:Satellit|Satellit]] 08:01, 22 June 2012 (EDT)
 
*Based on these instructions: http://wiki.sugarlabs.org/go/Platform_Team/Guide/Sugar_via_Sweets
 
<inkyfingers> Image from: http://www.raspbian.org/
 
<inkyfingers> is Debian Hard Float (armhf) for RPi
 
<inkyfingers> Is armhf likely to be a problem for <sweets>?
 
<alsroot> inkyfingers: I didn't try to run sugar on arm. OLPC people support it but I dunno do they use sugar directly from upstream brunches (what was used for sweets (not SD)) or not
 
<inkyfingers> #644010 is now marked fixed - so wheezy seems fine to me with python 2.7 - I believe eliminated.
 
<alsroot> btw, whats exact sugar version you are running on Raspberry?
 
<inkyfingers> Ok tried sdk/sugar and dextrose/
 
<inkyfingers> dextrose marginally more success.
 
<inkyfingers> * Booting Rpi ... will try to ssh for notes . I tested Sugar 0.88 and 0.94
 
...
 
<inkyfingers>  raspbian@pisces:~$ sweets  dextrose/sugar:emulator
 
<inkyfingers> Xephyr on :30.0
 
<inkyfingers> About my computer:
 
<inkyfingers> Build: Debian GNU/Linux testing/unstable
 
<inkyfingers> Sugar: 0.88.1
 
...
 
<inkyfingers> I will try to write only about sweets  dextrose/sugar:emulator ...
 
<inkyfingers> F1 to F6 all fine ok
 
<alsroot> thats fine..
 
<alsroot> though, in my mind SD, finally, is more useful way to start sugar itself. but unfortunately, it does not [yet]support arm
 
<inkyfingers> I could see no avatars in F1 in dextrose <seen fine in sdk, 0.94>
 
<inkyfingers> I have no Activities in F3
 
<alsroot> for activities, you can unzip some of them (that are pure python) to ~/Activities
 
<inkyfingers> That would be a good next step.
 
<inkyfingers> Two usb ports are used by mouse and kbd. I will prepare a USB stick next and try that out.
 
<alsroot> inkyfingers: btw, how long it took to build sugar via "sweets" command?
 
<inkyfingers> Over 8 or 9 mins of 100% CPU
 
<inkyfingers> sorry ssh into my rubbish notes is hard !! I keep not finding what I want!
 
<inkyfingers> raspbian@pisces:~$ sweets  sdk/sugar:emulator
 
<inkyfingers> -- Solve sdk/sugar-artwork for building
 
<inkyfingers> -- Solve sdk/sugar-base for building
 
<inkyfingers> -- Solve sdk/sugar-toolkit for building
 
<inkyfingers> -- Solve sdk/sugar-datastore for building
 
<inkyfingers> -- Solve sdk/telepathy-mission-control for building
 
<inkyfingers> -- Solve sdk/sugar for building
 
<inkyfingers> -- Build sdk/sugar-artwork (0.94.0)
 
<inkyfingers> -- Build sdk/sugar-base (0.94.0)
 
<inkyfingers> -- Build sdk/sugar-toolkit (0.94.0)
 
<inkyfingers> -- Build sdk/sugar-datastore (0.94.0)
 
<inkyfingers> -- Build sdk/telepathy-mission-control (5.7.1)
 
<inkyfingers> -- Build sdk/sugar (0.94.1)
 
<inkyfingers> this made me think Activities should be on-board?
 
<alsroot> inkyfingers: nope, this way you can't install activities
 
<alsroot> dunno will Browse work on or not (to open ASLO), but just download .xo files to unzip them to ~/Activities
 
<inkyfingers> So that trace was just my first successful launch
 
<inkyfingers> df -h (before that command)
 
<inkyfingers> Filesystem      Size  Used Avail Use% Mounted on
 
<inkyfingers> rootfs          3.3G  2.1G  1.1G  68% /
 
<inkyfingers> now
 
<inkyfingers> rootfs          3.3G  2.2G  985M  69% /
 
  
==Test report==
+
==Ubuntu on Chromebook==
  <inkyfingers> Test report:
+
*Copied from: https://plus.google.com/109993695638569781190/posts/b2fazijJppZ
<inkyfingers> Product of :sweets  sdk/sugar:emulator
+
Olof Johansson
<inkyfingers> on Raspberry pi, running OS from www.raspbian.org
+
Oct 28, 2012 (edited)  - Public
<inkyfingers> Build: Debian GNU/Linux testing/unstable
+
[edited to fix some typos and the cgpt commandline and setting sector alignment]
<inkyfingers> Sugar: 0.94.1
+
 
<inkyfingers> All Function keys, F1 to 6, work ok
+
Sunday night is "Hack your Chromebook" time!                                                                                                                                                                     
<inkyfingers> Avatars seen ok in F1 and F2,
+
 
<inkyfingers> F3 I have 2 working activities
+
A word of caution: be careful, there are some ways in which you can mess up your system below, in particular the steps that partitions and writes data to the SD card. If you're unsure of what you're doing, you're better off waiting until someone refines the instructions and makes them more user friendly.
<inkyfingers> Full control to "spare partition"
+
 
<inkyfingers> Journal is probably being slow to update - not correct/full, partial record.
+
I got Ubuntu installed on my ARM Chromebook tonight. Here's a messy brain dump of what I did. The system was already in devmode when I started (see http://goo.gl/TSZxs for info on how to achieve that). I also already had a tarball of an Ubuntu filesystem, created with the "rootstock" tool. [edit: you can use the distributed ubuntu-core tarball directly from ubuntu as well, and then install additional packages on top]
<inkyfingers> No connection to ASLO,
+
 
<inkyfingers> 8 Activities, downloaded to pc, and transferred to spare partition.
+
Get an SD card, insert it in a reader on your Ubuntu PC (mine was a 16GB card that ended up at /dev/sdd on the PC, so the below reflects that):
<inkyfingers> irc-10.xo starts and tested ok
+
 
<inkyfingers> chat-77.xo starts and works, test tx ok
+
First, the SD card needs a GPT partition table. I'm lazy and mixed tools here to make it easy for myself. First, I created the blank partition table in parted:
<inkyfingers> browse-129.xo, Reports, failed to start
+
 
<inkyfingers> surf-115.xo Reports, failed to start
+
# sudo parted /dev/sdd
<inkyfingers> terminal-39.xo Reports, failed to start
+
(parted) mktable gpt
...
+
(parted) quit
<inkyfingers> speak-41.xo  Reports, failed to start
+
 
<inkyfingers> physics-10.xo Reports, failed to start
+
Then edit it with gdisk (apt-get install gdisk), since the syntax is close to what I am used with regular cfdisk. The first part sets the sector alignment to 4M based on the recommendation from Arnd in the comments below:
<inkyfingers> sugar_commander Reports, failed to start
+
 
I am able to use the host browser to access ASLO, and download and test Activities in the version specified for 0.94.1
+
sudo gdisk /dev/sdd
 +
x
 +
l
 +
8192
 +
m
 +
 
 +
n
 +
1
 +
<enter>
 +
+16M
 +
7f00    (ChromeOS kernel)
 +
 
 +
n
 +
2
 +
<enter>
 +
+16M
 +
7f00
 +
 
 +
n
 +
3
 +
<enter>
 +
<enter>
 +
<enter>
 +
 
 +
This creates three partitions; two kernel ones and one for the root filesystem. I wanted two kernel partitions to make it easier to tinker with the kernel and have a fallback to a known-good kernel in case the one being tested fails.
 +
 
 +
 
 +
Then, create a filesystem on the root partition:
 +
 
 +
sudo mkfs.ext4 /dev/sdd3
 +
 
 +
mount /dev/sdd3 somewhere and extract your rootstock filesystem to it:
 +
sudo mount /dev/sdd3 /mnt
 +
cd /mnt
 +
sudo tar xvpf /work/rootstock/armel.tar.gz
 +
 
 +
Then, since we are going to use the same kernel as we boot Chrome
 +
OS with, copy over the contents from /lib/modules and /lib/firmware
 +
from your running system into the same location on the SD card
 +
(i.e. /mnt/lib/modules /mnt/lib/firmware). I did it by creating a tarball
 +
on the Chrome OS machine and scp:ing it over to my PC. I'll leave the
 +
details as an exercise for the reader here.
 +
 
 +
Now the only remaining piece is to put an actual kernel on the kernel
 +
partitions of the SD card.
 +
 
 +
This is something I did on my Chromebook system directly. Be VERY careful here, mmcblk1 and mmcblk0 are very easy to mistype, and you won't like the results from doing it (I nuked my stateful partition by mistake once when I went through this because I dd:d a kernel to mmcblk0p1 instead of mmcblk1p1).
 +
 
 +
The kernel command line is going to be different from what you use for
 +
Chrome OS, so you'll need to repack the kernel blob manually first. This
 +
is what I did:
 +
 
 +
cd /tmp
 +
echo "console=tty1 debug verbose root=/dev/mmcblk1p3 rootwait rw" > /tmp/config
 +
vbutil_kernel --pack /tmp/newkern --keyblock /usr/share/vboot/devkeys/kernel.keyblock --version 1 --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk --config=/tmp/config --vmlinuz /boot/vmlinuz-3.4.0 --arch arm
 +
 
 +
Then I moved the SD card to the Chromebook, and wrote out the kernel:
 +
 
 +
dd if=/tmp/newkern of=/dev/mmcblk1p1
 +
dd if=/tmp/newkern of=/dev/mmcblk1p2
 +
 
 +
Now, enable boot from "USB" (which includes SD card on these systems):
 +
crossystem dev_boot_usb=1
 +
 
 +
Final step is to mark the partitions on the SD card as known good so
 +
that the firmware will try to boot them:
 +
 
 +
cgpt add -i 1 -S 1 -T 5 -P 10 -l KERN-A /dev/mmcblk1
 +
cgpt add -i 2 -S 1 -T 5 -P 5 -l KERN-B /dev/mmcblk1
 +
 
 +
I.e. mark both as successful, first partition as priority 10, second
 +
as priority 5. I don't think tries are technically needed here since
 +
the partition is already marked as successful, but I included it by
 +
habit. Same with the label names, they shouldn't be needed.
 +
 
 +
Then reboot. At the devmode screen, you type ctrl-u to load the kernel
 +
and boot from the SD card.
 +
 
 +
After a few seconds, you'll get the kernel log on the console, followed by
 +
(depending on what you have on your root filesystem) a login prompt. I
 +
had a very minimal install without X-windows first, so I just got a text login prompt. I later installed ubuntu-desktop, and it will boot up to login prompt and let you login with an UI environment. The trackpad isn't behaving perfectly though, so there's some tuning to be done.
 +
 
 +
I'm sure there will be others more than happy to carry the flag on getting this going nice and smoothly from here though. I'm also looking forward to getting reports of other distros being functional, so bring them on!

Latest revision as of 22:52, 28 October 2013

Ubuntu on Chromebook

Olof Johansson Oct 28, 2012 (edited) - Public [edited to fix some typos and the cgpt commandline and setting sector alignment]

Sunday night is "Hack your Chromebook" time!

A word of caution: be careful, there are some ways in which you can mess up your system below, in particular the steps that partitions and writes data to the SD card. If you're unsure of what you're doing, you're better off waiting until someone refines the instructions and makes them more user friendly.

I got Ubuntu installed on my ARM Chromebook tonight. Here's a messy brain dump of what I did. The system was already in devmode when I started (see http://goo.gl/TSZxs for info on how to achieve that). I also already had a tarball of an Ubuntu filesystem, created with the "rootstock" tool. [edit: you can use the distributed ubuntu-core tarball directly from ubuntu as well, and then install additional packages on top]

Get an SD card, insert it in a reader on your Ubuntu PC (mine was a 16GB card that ended up at /dev/sdd on the PC, so the below reflects that):

First, the SD card needs a GPT partition table. I'm lazy and mixed tools here to make it easy for myself. First, I created the blank partition table in parted:

  1. sudo parted /dev/sdd

(parted) mktable gpt (parted) quit

Then edit it with gdisk (apt-get install gdisk), since the syntax is close to what I am used with regular cfdisk. The first part sets the sector alignment to 4M based on the recommendation from Arnd in the comments below:

sudo gdisk /dev/sdd x l 8192 m

n 1 <enter> +16M 7f00 (ChromeOS kernel)

n 2 <enter> +16M 7f00

n 3 <enter> <enter> <enter>

This creates three partitions; two kernel ones and one for the root filesystem. I wanted two kernel partitions to make it easier to tinker with the kernel and have a fallback to a known-good kernel in case the one being tested fails.


Then, create a filesystem on the root partition:

sudo mkfs.ext4 /dev/sdd3

mount /dev/sdd3 somewhere and extract your rootstock filesystem to it: sudo mount /dev/sdd3 /mnt cd /mnt sudo tar xvpf /work/rootstock/armel.tar.gz

Then, since we are going to use the same kernel as we boot Chrome OS with, copy over the contents from /lib/modules and /lib/firmware from your running system into the same location on the SD card (i.e. /mnt/lib/modules /mnt/lib/firmware). I did it by creating a tarball on the Chrome OS machine and scp:ing it over to my PC. I'll leave the details as an exercise for the reader here.

Now the only remaining piece is to put an actual kernel on the kernel partitions of the SD card.

This is something I did on my Chromebook system directly. Be VERY careful here, mmcblk1 and mmcblk0 are very easy to mistype, and you won't like the results from doing it (I nuked my stateful partition by mistake once when I went through this because I dd:d a kernel to mmcblk0p1 instead of mmcblk1p1).

The kernel command line is going to be different from what you use for Chrome OS, so you'll need to repack the kernel blob manually first. This is what I did:

cd /tmp echo "console=tty1 debug verbose root=/dev/mmcblk1p3 rootwait rw" > /tmp/config vbutil_kernel --pack /tmp/newkern --keyblock /usr/share/vboot/devkeys/kernel.keyblock --version 1 --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk --config=/tmp/config --vmlinuz /boot/vmlinuz-3.4.0 --arch arm

Then I moved the SD card to the Chromebook, and wrote out the kernel:

dd if=/tmp/newkern of=/dev/mmcblk1p1 dd if=/tmp/newkern of=/dev/mmcblk1p2

Now, enable boot from "USB" (which includes SD card on these systems): crossystem dev_boot_usb=1

Final step is to mark the partitions on the SD card as known good so that the firmware will try to boot them:

cgpt add -i 1 -S 1 -T 5 -P 10 -l KERN-A /dev/mmcblk1 cgpt add -i 2 -S 1 -T 5 -P 5 -l KERN-B /dev/mmcblk1

I.e. mark both as successful, first partition as priority 10, second as priority 5. I don't think tries are technically needed here since the partition is already marked as successful, but I included it by habit. Same with the label names, they shouldn't be needed.

Then reboot. At the devmode screen, you type ctrl-u to load the kernel and boot from the SD card.

After a few seconds, you'll get the kernel log on the console, followed by (depending on what you have on your root filesystem) a login prompt. I had a very minimal install without X-windows first, so I just got a text login prompt. I later installed ubuntu-desktop, and it will boot up to login prompt and let you login with an UI environment. The trackpad isn't behaving perfectly though, so there's some tuning to be done.

I'm sure there will be others more than happy to carry the flag on getting this going nice and smoothly from here though. I'm also looking forward to getting reports of other distros being functional, so bring them on!