Difference between revisions of "UbuntuChroot"

From WebOS Internals
Jump to navigation Jump to search
m (Added section for recommended power user utilities)
 
(23 intermediate revisions by 11 users not shown)
Line 1: Line 1:
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 [[Application:MetaDoctor#How_to_get_the_optional_ext3fs_partition_mounted_at_device_boot|Meta Doctor]] page.
+
You need a large-enough ext3fs partition created with Meta-Doctor mounted at /media/ext3fs (instructions for how to create a partition are available below). 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 [[Application:MetaDoctor#How_to_get_the_optional_ext3fs_partition_mounted_at_device_boot|Meta Doctor]] page.
  
Make sure you have the WebOS Internals Testing Feeds enabled.
+
Please support the project with a [[WebOS_Internals:Site_support|Donation]], and install the Preware Homebrew Documentation app from the official app catalog to learn how to install Preware on your device.
 
 
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.
 
 
 
<center>'''NOTE ABOUT DISK IMAGES'''</center>
 
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). NOTE: You can not create an image file in /media/cryptofs larger than 2GB.
 
 
 
cd /media/cryptofs
 
dd if=/dev/zero of=ubuntu.img bs=1024 count=1048576
 
mkfs.ext3 -F -b 1024 ubuntu.img 1048576
 
 
 
rootfs_open -t
 
mkdir /media/ext3fs
 
 
 
Next, you must mount the new image file.
 
 
 
mount -o loop /media/cryptofs/ubuntu.img /media/ext3fs
 
 
 
To make this mount at boot, you need to add an entry to the fstab:
 
 
 
echo "/media/cryptofs/ubuntu.img /media/ext3fs ext3 loop 0 0" >> /etc/fstab
 
mount -a
 
 
 
Now you can install Ubuntu 11.04 Chroot from Preware and it will populate the image file.
 
  
  
Line 48: Line 12:
 
Both credit and Props go to WebOS Internals for making this possible and putting in all the hard work they have to make it as easy as it is.
 
Both credit and Props go to WebOS Internals for making this possible and putting in all the hard work they have to make it as easy as it is.
  
* '''Warnings: WebOS Internals takes no responsibility over what may happen to your device. If you follow these instructions it 'should' work perfectly. If you do endup messing something up you 'should' be able to just doctor the device using the stock WebOS Doctor from HP.'''
+
* '''Warnings: WebOS Internals takes no responsibility over what may happen to your device. If you follow these instructions it 'should' work perfectly. If you do end up messing something up you 'should' be able to just doctor the device using the stock WebOS Doctor from HP.'''
 
**'''You my want to backup app data and the like using Save/Restore in Preware as you will lose all your data buy installing a WebOS Doctor. Please do so!'''
 
**'''You my want to backup app data and the like using Save/Restore in Preware as you will lose all your data buy installing a WebOS Doctor. Please do so!'''
 +
**'''You must remove Optware before beginning this process.  Failure to do so will most likely cause you issues!'''
  
 
===Step 1: Creating a WebOS Doctor===
 
===Step 1: Creating a WebOS Doctor===
 
* We will be using the Meta Doctor to create a special WebOS Doctor that will create a 2GB (or more if you wish to do so) partition in /media/ext3fs/ were Ubuntu will be.
 
* We will be using the Meta Doctor to create a special WebOS Doctor that will create a 2GB (or more if you wish to do so) partition in /media/ext3fs/ were Ubuntu will be.
* Use the WebOS Internals Guide to installing and running the Meta Doctor.
+
* Use the WebOS Internals Guide to installing and running the Meta Doctor (the link below)
* Make sure you uncomment the correct setting in the Makefile to actually create the ext3fs partition.
+
**[[Application:MetaDoctor#Step_1:_Setting_up_Meta-Doctor Step 1: |Application:MetaDoctor - Setting up Meta-Doctor Step 1:]]
* In Step 2'6, if you are using a Wifi Only TouchPad you will be using the last one which has touchpad for device and WiFi all for the carrier.
+
* Make sure you uncomment the correct setting in the Makefile to actually create the ext3fs partition. Which will be a little ways down in the file were it says "# EXT3FS_PARTITION_SIZE = 2GB". Delete that # before it to make it readable to the program and if you desire to you may change the 2GB to the size you wish to have for Ubuntu. '''BUT BE AWARE THAT THIS TAKES AWAY THE MEMORY FROM THE USB PARTITION AND ADDS IT TO UBUNTU.''' Now save the file still with no file extension.  
 +
*If you are using a Wifi Only TouchPad you will be using the last one which has touchpad for device and WiFi all for the carrier.
 
* Once the Meta Doctor is done, run the WebOS Doctor it created under the 'builds' folder. And setup your device.
 
* Once the Meta Doctor is done, run the WebOS Doctor it created under the 'builds' folder. And setup your device.
 +
 +
===Alternative Step 1: Re-partitioning by hand===
 +
If you do not want to run the doctor, but do want to do the right thing and give your Ubuntu a partition of its own, here's, roughly, how: [note: [[User:Habbie|Habbie]] 08:10, 17 September 2011 (UTC) writing this from memory. somebody should try it and update the details.]:
 +
[[User:Midnite|Midnite]] 26 September 2011 confirmed, below works correctly.
 +
 +
# connect with novaterm (not via quicklaunch as you can't see dialogs)
 +
First determine how much actual space is being used by /media/internal (not whats allocated to it)
 +
#<code> df -h | grep internal</code>
 +
Remember this as you will need to keep that in mind when you resize
 +
Disconnect cryptofs:
 +
# <code>pkill -SIGUSR1 cryptofs</code>
 +
Unmount /media/internal:
 +
# <code>umount /media/internal</code>
 +
verify you have a clean filesystem *before* you resize it:
 +
# <code>/usr/sbin/fsck.vfat /dev/mapper/store-media</code>
 +
Then verify how much space /media/internal is using
 +
#<code> lvscan | grep media</code>
 +
For a 16GB TP you should only reduce the size by 4GB and for a 32GB TP you can safely reduce by 8GB
 +
So this means if the size is 23GB on a 32GB TP your final space that you would resize to is ie: 23GB-8GB=15GB
 +
# <code>resizefat /dev/mapper/store-media {size you determined it to be}G</code> - I picked 4G to leave about 9G for my Ubuntu. Decide for yourself. This operation will delete your data if you make it too small.
 +
# <code>lvresize -L 4G /dev/mapper/store-media</code>
 +
# now, remount /media/internal and /media/cryptofs. I decided to just reboot but you could do the remount/reboot later. rwhitby advises <code>pkill -SIGUSR2 cryptofs</code> here.
 +
# <code> lvcreate -l 100%FREE -n ext3fs store </code>
 +
# <code>mkfs.ext3 /dev/mapper/store-ext3fs</code>
 +
# <code>mount -o remount,rw /</code>
 +
# <code>echo "/dev/mapper/store-ext3fs /media/ext3fs auto noatime 0 0" >> /etc/fstab</code>
 +
# check to make sure nothing already exists under mount point: <code>ls -l /media/ext3fs</code>
 +
## If above shows files/dirs under /media/ext3fs, you will need to copy it and then move it back after mounting:
 +
## <code>cd /media/ext3fs; tar -cf /tmp/ext3fs-files.tar .</code>
 +
## and then <code>rm -rf /media/ext3fs</code>
 +
# <code>mkdir /media/ext3fs</code>
 +
# <code>mount -o remount,ro /</code>
 +
# <code>mount -a</code> or <code>reboot</code>
 +
# If files existed under /media/ext3fs before mounting, recreate them with:
 +
## <code>cd /media/ext3fs ; tar xvf /tmp/ext3fs-files.tar ; rm /tmp/ext3fs-files.tar</code>
 +
 +
Skip the next step (Step 2: Mounting the ext3fs partition) - we have already done this above in step 10.
  
 
===Step 2: Mounting the ext3fs partition===
 
===Step 2: Mounting the ext3fs partition===
 
*Follow the intructions of the Chrooting wiki page.
 
*Follow the intructions of the Chrooting wiki page.
**http://www.webos-internals.org/wiki/Application:MetaDoctor#How_to_get_the_optional_ext3fs_partition_mounted_at_device_boot
+
**[[Application:MetaDoctor#How_to_get_the_optional_ext3fs_partition_mounted_at_device_boot |Application:MetaDoctor - How to get the optional ext3fs partition mounted at device boot]]
 
 
===Step 3: Adding Testing Feeds===
 
*Follow the instructions on the Testing Feeds wiki page. Please understand the risks noted.
 
**http://www.webos-internals.org/wiki/Testing_Feeds
 
  
===Step 4: Installing UbuntuChroot, Xecutah, and XServer===
+
===Step 3: Installing UbuntuChroot, Xecutah, and XServer===
 
* Open up Preware and tap List Of Everything.
 
* Open up Preware and tap List Of Everything.
 
* Search for and install the following: UbuntuChroot, Xecutah, and XServer
 
* Search for and install the following: UbuntuChroot, Xecutah, and XServer
Line 73: Line 72:
 
* Now you should have the Ubuntu terminal. Done. It should have a few 'mount' commands and then the @Touchpad:
 
* Now you should have the Ubuntu terminal. Done. It should have a few 'mount' commands and then the @Touchpad:
  
===Step 5: What's Next?===
+
===Step 4: What's Next?===
 
* Now to have some fun after all that work you put in!
 
* Now to have some fun after all that work you put in!
 
* Take a look at the auto configuration script that will install and setup most of the what is in the next bullet for you in just a few steps.
 
* Take a look at the auto configuration script that will install and setup most of the what is in the next bullet for you in just a few steps.
**http://forums.precentral.net/webos-development/295909-easy-autoconfiguration-ubuntu.html
+
**[http://forums.precentral.net/webos-development/295909-easy-autoconfiguration-ubuntu.html Easy Autoconfiguration for Ubuntu]
 
* Type the below and it will update the program lists.
 
* Type the below and it will update the program lists.
 
<pre>apt-get update</pre>
 
<pre>apt-get update</pre>
Line 94: Line 93:
 
/***type the below for LXDE
 
/***type the below for LXDE
 
apt-get install lxde</pre>
 
apt-get install lxde</pre>
 +
 +
==== Power User Utilities ====
 +
As a power user, you may wish to install the following packages.
 +
<pre>
 +
/***Adds add-apt-repository command, for adding ppas and other alternative package sources.
 +
apt-get install python-software-properties
 +
</pre>
 +
 +
==== Upgrading Ubuntu ====
 +
If you'll be relying on binary packages in your Ubuntu chroot, it can be beneficial to upgrade to the latest distribution. This is actually a fairly easy process, and should be familiar to anyone who has upgraded their Ubuntu servers before.
 +
 +
The first step is to install the "update-manager-core" package, which will handle all of the dependencies of upgrading for you.
 +
<pre>apt-get install update-manager-core</pre>
 +
 +
Then, simply run the updater.
 +
<pre>do-release-upgrade -d</pre>
 +
 +
Follow any instructions it gives you along the way.
  
 
== How to remove the ext3fs partition ==
 
== How to remove the ext3fs partition ==
  
[[Application:MetaDoctor#How_to_remove_the_ext3fs_partition]]
+
*[[Application:MetaDoctor#How_to_remove_the_ext3fs_partition |Application:MetaDoctor - How to remove the ext3fs partition ]]

Latest revision as of 23:29, 20 February 2012

You need a large-enough ext3fs partition created with Meta-Doctor mounted at /media/ext3fs (instructions for how to create a partition are available below). 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.

Please support the project with a Donation, and install the Preware Homebrew Documentation app from the official app catalog to learn how to install Preware on your device.


Instructions

Intro: What you need to know

UbuntuChroot is the raw Ubuntu terminal without the familiar GNOME graphical interface that all have come to think of Ubuntu. With this installed, you will be able to install ubuntu programs and launch them with in the terminal card. However, you can install a GUI windows manager such as LXDE which will let you use it as you would a normal computer. To do this, the basic rundown will be making a new WebOS Doctor that has a separete partition of memory for Ubuntu to run with in. Then we will install it on your TouchPad and mount that partition so it will be able to be used after a reboot of the device. Lastly, we will install Xecutah, XServer, and UbuntuChroot from Preware and boot up Ubuntu on your TouchPad. Both credit and Props go to WebOS Internals for making this possible and putting in all the hard work they have to make it as easy as it is.

  • Warnings: WebOS Internals takes no responsibility over what may happen to your device. If you follow these instructions it 'should' work perfectly. If you do end up messing something up you 'should' be able to just doctor the device using the stock WebOS Doctor from HP.
    • You my want to backup app data and the like using Save/Restore in Preware as you will lose all your data buy installing a WebOS Doctor. Please do so!
    • You must remove Optware before beginning this process. Failure to do so will most likely cause you issues!

Step 1: Creating a WebOS Doctor

  • We will be using the Meta Doctor to create a special WebOS Doctor that will create a 2GB (or more if you wish to do so) partition in /media/ext3fs/ were Ubuntu will be.
  • Use the WebOS Internals Guide to installing and running the Meta Doctor (the link below)
  • Make sure you uncomment the correct setting in the Makefile to actually create the ext3fs partition. Which will be a little ways down in the file were it says "# EXT3FS_PARTITION_SIZE = 2GB". Delete that # before it to make it readable to the program and if you desire to you may change the 2GB to the size you wish to have for Ubuntu. BUT BE AWARE THAT THIS TAKES AWAY THE MEMORY FROM THE USB PARTITION AND ADDS IT TO UBUNTU. Now save the file still with no file extension.
  • If you are using a Wifi Only TouchPad you will be using the last one which has touchpad for device and WiFi all for the carrier.
  • Once the Meta Doctor is done, run the WebOS Doctor it created under the 'builds' folder. And setup your device.

Alternative Step 1: Re-partitioning by hand

If you do not want to run the doctor, but do want to do the right thing and give your Ubuntu a partition of its own, here's, roughly, how: [note: Habbie 08:10, 17 September 2011 (UTC) writing this from memory. somebody should try it and update the details.]: Midnite 26 September 2011 confirmed, below works correctly.

  1. connect with novaterm (not via quicklaunch as you can't see dialogs)

First determine how much actual space is being used by /media/internal (not whats allocated to it)

  1. df -h | grep internal

Remember this as you will need to keep that in mind when you resize Disconnect cryptofs:

  1. pkill -SIGUSR1 cryptofs

Unmount /media/internal:

  1. umount /media/internal

verify you have a clean filesystem *before* you resize it:

  1. /usr/sbin/fsck.vfat /dev/mapper/store-media

Then verify how much space /media/internal is using

  1. lvscan | grep media

For a 16GB TP you should only reduce the size by 4GB and for a 32GB TP you can safely reduce by 8GB So this means if the size is 23GB on a 32GB TP your final space that you would resize to is ie: 23GB-8GB=15GB

  1. resizefat /dev/mapper/store-media {size you determined it to be}G - I picked 4G to leave about 9G for my Ubuntu. Decide for yourself. This operation will delete your data if you make it too small.
  2. lvresize -L 4G /dev/mapper/store-media
  3. now, remount /media/internal and /media/cryptofs. I decided to just reboot but you could do the remount/reboot later. rwhitby advises pkill -SIGUSR2 cryptofs here.
  4. lvcreate -l 100%FREE -n ext3fs store
  5. mkfs.ext3 /dev/mapper/store-ext3fs
  6. mount -o remount,rw /
  7. echo "/dev/mapper/store-ext3fs /media/ext3fs auto noatime 0 0" >> /etc/fstab
  8. check to make sure nothing already exists under mount point: ls -l /media/ext3fs
    1. If above shows files/dirs under /media/ext3fs, you will need to copy it and then move it back after mounting:
    2. cd /media/ext3fs; tar -cf /tmp/ext3fs-files.tar .
    3. and then rm -rf /media/ext3fs
  9. mkdir /media/ext3fs
  10. mount -o remount,ro /
  11. mount -a or reboot
  12. If files existed under /media/ext3fs before mounting, recreate them with:
    1. cd /media/ext3fs ; tar xvf /tmp/ext3fs-files.tar ; rm /tmp/ext3fs-files.tar

Skip the next step (Step 2: Mounting the ext3fs partition) - we have already done this above in step 10.

Step 2: Mounting the ext3fs partition

Step 3: Installing UbuntuChroot, Xecutah, and XServer

  • Open up Preware and tap List Of Everything.
  • Search for and install the following: UbuntuChroot, Xecutah, and XServer
  • Now opened Xecutah and tap XServer and a new card will come up.
  • Go back to Xecutah and tap UbuntuChroot. Then swipe back to the new card that came up.
  • Now you should have the Ubuntu terminal. Done. It should have a few 'mount' commands and then the @Touchpad:

Step 4: What's Next?

  • Now to have some fun after all that work you put in!
  • Take a look at the auto configuration script that will install and setup most of the what is in the next bullet for you in just a few steps.
  • Type the below and it will update the program lists.
apt-get update
  • Now type the following in the box to install what ever you wish!
/***type the below for LibreOffice
apt-get install LibreOffice

/***type the below for the Chromium Browser
apt-get install chromium-browser

/***type the below for GIMP
apt-get install gimp

/***type the below for Eclipse
apt-get install eclipse

/***type the below for LXDE
apt-get install lxde

Power User Utilities

As a power user, you may wish to install the following packages.

/***Adds add-apt-repository command, for adding ppas and other alternative package sources.
apt-get install python-software-properties

Upgrading Ubuntu

If you'll be relying on binary packages in your Ubuntu chroot, it can be beneficial to upgrade to the latest distribution. This is actually a fairly easy process, and should be familiar to anyone who has upgraded their Ubuntu servers before.

The first step is to install the "update-manager-core" package, which will handle all of the dependencies of upgrading for you.

apt-get install update-manager-core

Then, simply run the updater.

do-release-upgrade -d

Follow any instructions it gives you along the way.

How to remove the ext3fs partition