Difference between revisions of "Angstrom on Touchpad"
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | Booting Angstrom on the TouchPad is actually fairly easy. | + | Booting Angstrom on the TouchPad is actually fairly easy. Here are the steps to get it going. |
− | =What to boot= | + | == What to boot == |
− | For this we will have a beagleboard of Angstrom located in an LVM on the touchpad named ext2fs. | + | For this, we will have a beagleboard of Angstrom located in an LVM on the touchpad named ext2fs. This is un-tested with an ext3 filesystem, but it will likely work. The Angstrom rootfs needs to be right in the base of the LVM, not in a sub-folder. |
− | We are going to be creating a multi-file uImage. | + | We are going to be creating a multi-file uImage. It will be one file with both a uImage kernel as well as an initrd. |
− | =Gather required bits= | + | == Gather required bits == |
First novaterm into the TouchPad and run the following commands | First novaterm into the TouchPad and run the following commands | ||
Line 20: | Line 20: | ||
novacom get file:///var/home/root/boot.tgz > boot.tgz | novacom get file:///var/home/root/boot.tgz > boot.tgz | ||
− | This will have everything you need to create the multi-file uImage using whatever kernel is currently installed on your TouchPad. | + | This will have everything you need to create the multi-file uImage using whatever kernel is currently installed on your TouchPad. I would recommend using either UberKernel or F15, something that gives console output on bootup. |
− | =initrd= | + | == initrd == |
− | ==Build the initrd== | + | === Build the initrd === |
− | First we need to make an empty file that will be used for our initrd. | + | First we need to make an empty file that will be used for our initrd. We will be starting off with an 8 MiB initrd. |
dd if=/dev/zero of=ramdisk bs=1M count=8 | dd if=/dev/zero of=ramdisk bs=1M count=8 | ||
Line 31: | Line 31: | ||
mount -o loop ramdisk initrd | mount -o loop ramdisk initrd | ||
− | Now we have an empty initrd ramdisk file and it is mounted as a loopback so that we can put things into it. | + | Now, we have an empty initrd ramdisk file and it is mounted as a loopback so that we can put things into it. |
− | ==Fill the initrd== | + | === Fill the initrd === |
− | This one is pretty simple. | + | This one is pretty simple. We are going to fill the initrd with the contents of the boot.tgz EXCEPT for the kernel. |
mkdir boottemp | mkdir boottemp | ||
Line 43: | Line 43: | ||
mv boottemp/* initrd | mv boottemp/* initrd | ||
− | ==Change the pivot_root== | + | === Change the pivot_root === |
− | You need to edit the file /sbin/init within the initrd to alter what rootfs is loaded at bootup | + | You need to edit the file <code>/sbin/init</code> within the initrd to alter what rootfs is loaded at bootup. |
vi initrd/sbin/init | vi initrd/sbin/init | ||
− | + | Find these lines: | |
lvm.static lvchange -ay --ignorelockingfailure /dev/mapper/store-root | lvm.static lvchange -ay --ignorelockingfailure /dev/mapper/store-root | ||
Line 56: | Line 56: | ||
mount -o ro /dev/mapper/store-root /realroot | mount -o ro /dev/mapper/store-root /realroot | ||
− | + | ... and change them to: | |
lvm.static lvchange -ay --ignorelockingfailure /dev/mapper/store-ext2fs | lvm.static lvchange -ay --ignorelockingfailure /dev/mapper/store-ext2fs | ||
Line 63: | Line 63: | ||
mount -o ro /dev/mapper/store-ext2fs /realroot | mount -o ro /dev/mapper/store-ext2fs /realroot | ||
− | + | Now, you are done with creating the initrd. You can umount initrd now if you like, or leave it mounted if you are going to be making changes and testing them. | |
− | =Build the multi-file uImage= | + | == Build the multi-file uImage == |
− | You will need the package uboot-mkimage (at least on Ubuntu) installed to do this | + | You will need the package uboot-mkimage (at least on Ubuntu) installed to do this. |
− | ==Cheater | + | == Cheater script == |
I have worked up a script that runs the needed commands for you. | I have worked up a script that runs the needed commands for you. | ||
Line 78: | Line 78: | ||
mkimage -a 0 -e 0 -A arm -O linux -T multi -C none -d uImage-2.6.35-palm-tenderloin:uRamdisk uMulti | mkimage -a 0 -e 0 -A arm -O linux -T multi -C none -d uImage-2.6.35-palm-tenderloin:uRamdisk uMulti | ||
− | Just name the file something like spin-kernel.sh and give it execute permission. | + | Just name the file something like <code>spin-kernel.sh</code> and give it execute permission. It should be inside of the uImage folder we made earlier, then give it a run. |
− | =Update Angstrom= | + | == Update Angstrom == |
− | You will need to chroot into the angstrom rootfs on the | + | You will need to chroot into the angstrom rootfs on the TouchPad over a novaterm session and install lvm with the command: |
opkg install lvm2 | opkg install lvm2 | ||
− | Also, one thing that I have found is that the checkroot script was not running early enough so it was halting the boot due to the rootfs still being read-only. To fix this go to /etc/rcS.d within your angstrom rootfs. | + | Also, one thing that I have found is that the checkroot script was not running early enough so it was halting the boot due to the rootfs still being read-only. To fix this go to /etc/rcS.d within your angstrom rootfs. Find the symlink that points to <code>../init.d/checkroot</code> and rename it to <code>S01checkroot</code>. |
− | =Boot Angstrom= | + | == Boot Angstrom == |
− | To do this, just put the | + | To do this, just put the TouchPad into recovery mode and memboot the multi-file uImage we made earlier. Because we are membooting it, if something goes wrong and if the TouchPad doesn't boot properly, you can force a reboot by holding Home+Power for 10 seconds, and it will safely reboot into webOS. |
+ | |||
+ | [[Category:HP Touchpad]] |
Latest revision as of 07:40, 30 September 2011
Booting Angstrom on the TouchPad is actually fairly easy. Here are the steps to get it going.
What to boot
For this, we will have a beagleboard of Angstrom located in an LVM on the touchpad named ext2fs. This is un-tested with an ext3 filesystem, but it will likely work. The Angstrom rootfs needs to be right in the base of the LVM, not in a sub-folder.
We are going to be creating a multi-file uImage. It will be one file with both a uImage kernel as well as an initrd.
Gather required bits
First novaterm into the TouchPad and run the following commands
cd /var/home/root tar czvf boot.tgz -C /boot/ .
Then exit out of novaterm and back on your PC run the following
mkdir -p uImage/initrd cd uImage novacom get file:///var/home/root/boot.tgz > boot.tgz
This will have everything you need to create the multi-file uImage using whatever kernel is currently installed on your TouchPad. I would recommend using either UberKernel or F15, something that gives console output on bootup.
initrd
Build the initrd
First we need to make an empty file that will be used for our initrd. We will be starting off with an 8 MiB initrd.
dd if=/dev/zero of=ramdisk bs=1M count=8 mke2fs -Fvm0 ramdisk mount -o loop ramdisk initrd
Now, we have an empty initrd ramdisk file and it is mounted as a loopback so that we can put things into it.
Fill the initrd
This one is pretty simple. We are going to fill the initrd with the contents of the boot.tgz EXCEPT for the kernel.
mkdir boottemp tar xzvf boot.tgz -C boottemp rm boottemp/uImage mv boottemp/uImage-2.6.35-palm-tenderloin mv boottemp/* initrd
Change the pivot_root
You need to edit the file /sbin/init
within the initrd to alter what rootfs is loaded at bootup.
vi initrd/sbin/init
Find these lines:
lvm.static lvchange -ay --ignorelockingfailure /dev/mapper/store-root # May need to say "don't update mtab" option below mount -o ro /dev/mapper/store-root /realroot
... and change them to:
lvm.static lvchange -ay --ignorelockingfailure /dev/mapper/store-ext2fs # May need to say "don't update mtab" option below mount -o ro /dev/mapper/store-ext2fs /realroot
Now, you are done with creating the initrd. You can umount initrd now if you like, or leave it mounted if you are going to be making changes and testing them.
Build the multi-file uImage
You will need the package uboot-mkimage (at least on Ubuntu) installed to do this.
Cheater script
I have worked up a script that runs the needed commands for you.
#!/bin/bash rm uMulti uRamdisk mkimage -A arm -O linux -T ramdisk -C none -d ramdisk uRamdisk mkimage -a 0 -e 0 -A arm -O linux -T multi -C none -d uImage-2.6.35-palm-tenderloin:uRamdisk uMulti
Just name the file something like spin-kernel.sh
and give it execute permission. It should be inside of the uImage folder we made earlier, then give it a run.
Update Angstrom
You will need to chroot into the angstrom rootfs on the TouchPad over a novaterm session and install lvm with the command:
opkg install lvm2
Also, one thing that I have found is that the checkroot script was not running early enough so it was halting the boot due to the rootfs still being read-only. To fix this go to /etc/rcS.d within your angstrom rootfs. Find the symlink that points to ../init.d/checkroot
and rename it to S01checkroot
.
Boot Angstrom
To do this, just put the TouchPad into recovery mode and memboot the multi-file uImage we made earlier. Because we are membooting it, if something goes wrong and if the TouchPad doesn't boot properly, you can force a reboot by holding Home+Power for 10 seconds, and it will safely reboot into webOS.