Difference between revisions of "UbuntuChroot"

From WebOS Internals
Jump to navigation Jump to search
Line 16: Line 16:
 
It is possible to use a disk image instead of creating a partition. However, this comes with a few caveats, such as slower speed, disk size restriction (mounting a disk image in cryptofs may limit you to < 2GB) or breaking USB connectivity (on /media/internal). Do this at your own risk. '''Partitioning with Meta Doctor is the faster and slightly stabler method.'''
 
It is possible to use a disk image instead of creating a partition. However, this comes with a few caveats, such as slower speed, disk size restriction (mounting a disk image in cryptofs may limit you to < 2GB) or breaking USB connectivity (on /media/internal). Do this at your own risk. '''Partitioning with Meta Doctor is the faster and slightly stabler method.'''
  
With those caveats in mind, if you decide to go ahead and create an image file, you can download a basic image file(debsmall.img.bz2) here [http://www.public.iastate.edu/~7Emdklein/debsmall.img.bz2]
+
If you do not want to re-doctor your phone, this is how to do it with an image file:
 +
First, open a terminal (XServer >XTerm - everything is done on device).
  
Extract debsmall.img from debsmall.img.bz2 (use 7zip in windows or the bunzip2 from command line in linux) and copy it to your device. You can use WOSQI to send the file to /media/cryptofs. Using /media/cryptofs instead of /media/internal will avoid breaking USB connectivity.
+
1048576 (KB) means 1 GB, you can replace that (used in two commands).
  
Then using the WOSQI command line, resize the file: “resize2fs /media/cryptofs/debsmall.img 2000M” (must be less than 2048M).
+
cd /media/cryptofs
 +
dd if=/dev/zero of=ubuntu.img bs=1024 count=1048576
 +
mkfs.ext3 -F -b 1024 ubuntu.img 1048576
  
Next, you must mount the new image file. Since, when using an image file, you may have to mount it again each time you do a full restart of the device (the image will stay mounted after a luna restart), you may want to create a script:
 
  
Using a text editor copy the following into a file and copy it to the device as, e.g., "/media/internal/mountscr.sh". (note that when using a program such as windows notepad, your line breaks may not stay in place correctly.)
+
mkdir /media/ext3fs
  
#!/bin/sh
 
mount -o loop /media/cryptofs/debsmall.img /media/ext3fs
 
mount --bind /dev /media/ext3fs/dev
 
mount -t devpts none /media/ext3fs/dev/pts
 
mount -t proc none /media/ext3fs/proc
 
mount -o bind /tmp /media/ext3fs/tmp
 
  
Then, from the WOSQI command line, type "sh /media/internal/mountscr.sh".
+
Next, you must mount the new image file.
 +
 
 +
mount -o loop /media/cryptofs/ubuntu.img /media/ext3fs
 +
 
  
 
Now you can install Ubuntu 11.04 Chroot from Preware and it will populate the image file.
 
Now you can install Ubuntu 11.04 Chroot from Preware and it will populate the image file.

Revision as of 21:15, 14 August 2011

You need a large-enough ext3fs partition created with Meta-Doctor mounted at /media/ext3fs (instruction how to create partition is available here Chrooting). Note that the latest optware bootstrap package will also use this if it exists. If you have not already done so you should setup the ext3fs partition to mount at bootup. (Failure to do so will cause you to run out of disk space) Instructions can be found on the Meta Doctor page.

Make sure you have the WebOS Internals Testing Feeds enabled.

Using Preware, install Xecutah and Ubuntu 11.04 Chroot.

Hit the relevant buttons on Xecutah to run the XServer and the Ubuntu 11.04 Chroot.

Run XServer first, which will open an Xserver window, then return to Xecutah and tap Ubuntu 11.04 Chroot. When you return to the Xserver card, you should see a Ubuntu command prompt.

Use "apt-get install" to install whatever apps you like from Ubuntu. Then run in the Ubuntu chroot and render on the XServer.

Don't forget the donation link on the Main Page, and please install the Preware Homebrew Documentation app from the official app catalog to learn how to install Preware on your device.

NOTE ABOUT DISK IMAGES

It is possible to use a disk image instead of creating a partition. However, this comes with a few caveats, such as slower speed, disk size restriction (mounting a disk image in cryptofs may limit you to < 2GB) or breaking USB connectivity (on /media/internal). Do this at your own risk. Partitioning with Meta Doctor is the faster and slightly stabler method.

If you do not want to re-doctor your phone, this is how to do it with an image file: First, open a terminal (XServer >XTerm - everything is done on device).

1048576 (KB) means 1 GB, you can replace that (used in two commands).

cd /media/cryptofs
dd if=/dev/zero of=ubuntu.img bs=1024 count=1048576
mkfs.ext3 -F -b 1024 ubuntu.img 1048576


mkdir /media/ext3fs


Next, you must mount the new image file.

mount -o loop /media/cryptofs/ubuntu.img /media/ext3fs


Now you can install Ubuntu 11.04 Chroot from Preware and it will populate the image file.