(Add details about how to backup your Tab before starting to hack!) |
|||
| (31 intermediate revisions not shown) | |||
| Line 19: | Line 19: | ||
== Build == | == Build == | ||
| - | *Use the procedure here to generate an ext2 image, and copy it to linux/rootfs.ext2 on the internal memory of the Nexus S. | + | *Use the procedure here to generate an ext2 image, and copy it to linux/rootfs.ext2 on the internal memory of the Nexus S. [[ARM/Meego_on_Beagleboard_from_scratch#Build_the_rootfs]] |
I have my boot.img (kernel + ramdisk) and a MeeGo kickstart file at http://blog.steventroughtonsmith.com/2011/01/nexus-s-meego.html; you can use fastboot to boot the image, or flash it to the recovery partition to dual boot. The actual MeeGo rootfs is run from a rootfs.ext2 file you can drop onto the Nexus S using Mass Storage mode - no need for messy flashing or the like, you can thank me later). | I have my boot.img (kernel + ramdisk) and a MeeGo kickstart file at http://blog.steventroughtonsmith.com/2011/01/nexus-s-meego.html; you can use fastboot to boot the image, or flash it to the recovery partition to dual boot. The actual MeeGo rootfs is run from a rootfs.ext2 file you can drop onto the Nexus S using Mass Storage mode - no need for messy flashing or the like, you can thank me later). | ||
| Line 56: | Line 56: | ||
* Wifi working (so you can login) | * Wifi working (so you can login) | ||
* Tab kb dock working (so you can login) | * Tab kb dock working (so you can login) | ||
| + | * Basic unaccelerated X on the framebuffer. (Requires small kernel patch) - kernel patch not necessary now, just "echo 1 > /sys/class/lcd/s5p_lcd/lcd_power" after you start Xorg to switch display on. | ||
| + | * Basic audio playback (The soundcard acts funny unless you feed it 32kHz audio, and on playback you need to run (amixer sset "Playback Path" "SPK") to actually enable sound) | ||
| + | * Touch screen - Basic single touch working, using the mtev driver. | ||
| - | + | In progress: | |
| - | * | + | * PowerVR accelerated UI - We have the source for the Android kernel driver (look on the Samsung opensource site for the Galaxy S (I9000) source). It appears to still have the XOrg code in place, but the build infrastructure is gone. I've been playing around with merging it in from the PandaBoard SGX drivers, and have gotten something to compile and load on the Tab - but that's about it. (From my understanding, there are two parts to the SGX drivers, the closed source userland - which we can steal from the PandaBoard - and the open source kernel driver. The open source kernel driver has two modes, Android and XOrg / DRI. It also requires a specific driver for the LCD and BC (bufferclass?), which we have as s3c_lcd and s3c_bc.) |
| - | + | ||
| - | + | ||
Not tried yet: | Not tried yet: | ||
| - | |||
* Bluetooth | * Bluetooth | ||
* Modem | * Modem | ||
* GPS | * GPS | ||
* Camera | * Camera | ||
| - | * | + | * DSP acceleration |
| - | * | + | * Sensors (compass, accelerometers) |
| - | + | ||
| Line 85: | Line 84: | ||
With Android devices, there is normally a hardware key you can press at boot time to specify whether you want to enter flashing mode or recovery mode (and no keypress indicates a normal startup.) On the Tab the flashing key is the volume down button and the recovery button is the volume up button. | With Android devices, there is normally a hardware key you can press at boot time to specify whether you want to enter flashing mode or recovery mode (and no keypress indicates a normal startup.) On the Tab the flashing key is the volume down button and the recovery button is the volume up button. | ||
| - | With most Android devices the normal and recovery boots load different kernels (located on different partitions.) This is nice as it means one does not need to modify the normal Android kernel at all, but can still mess about with other kernels in the recovery kernel partition (e.g. to try booting Meego, at the expense of no recovery mode, which is not a big problem.) But, in their infinite wisdom, Samsung decided that both normal and recovery modes would use the same kernel on the Tab. Rather than booting a completely separate kernel, the Tab boots the same kernel and the Android-specific init somehow recognises which mode was selected at boot time. It then proceeds to process either init.rc or recovery.rc. | + | With most Android devices the normal and recovery boots load different kernels (located on different partitions.) This is nice as it means one does not need to modify the normal Android kernel at all, but can still mess about with other kernels in the recovery kernel partition (e.g. to try booting Meego, at the expense of no recovery mode, which is not a big problem.) But, in their infinite wisdom, Samsung decided that both normal and recovery modes would use the same kernel on the Tab. Rather than booting a completely separate kernel, the Tab boots the same kernel and the Android-specific init somehow recognises which mode was selected at boot time. It then proceeds to process either init.rc or recovery.rc. (the init binary looks for bootmode=* that gets added to the kernel command line --lilstevie) |
| - | Now this would give us an option of modifying the boot process, but the major problem is that while the Android init should support an exec command, this is not implemented in the version we have, and therefore even if we modify the recovery.rc file to try to start our own script to switch_root, etc., it won't work. The Android init used in the Tab is not stock Google code and there is no source available for the modifications. | + | Now this would give us an option of modifying the boot process, but the major problem is that while the Android init should support an exec command, this is not implemented in the version we have, and therefore even if we modify the recovery.rc file to try to start our own script to switch_root, etc., it won't work. The Android init used in the Tab is not stock Google code and there is no source available for the modifications. (gingerbread samsung init supports exec, fingers crossed it is released soon --lilstevie) |
Therefore I've renamed the Android init and replaced with it an init script which searches for Meego installations (btrfs partitions on the external SD card, or loop images) and if these are not found exec's the renamed Android init, which goes on its merry way and starts Android just like normal. | Therefore I've renamed the Android init and replaced with it an init script which searches for Meego installations (btrfs partitions on the external SD card, or loop images) and if these are not found exec's the renamed Android init, which goes on its merry way and starts Android just like normal. | ||
| Line 93: | Line 92: | ||
=== Getting Going === | === Getting Going === | ||
| - | + | Work in progress! | |
| - | + | ==== Backing up the existing Android installation with dd ==== | |
| - | + | ||
| + | We only actually alter the kernel, so this is the only one you need to backup, but you may as well do the whole lot just in case. Note that you need to "root" your Tab to be able to use these commands. Also note that this assumes you know how to use adb. | ||
| + | |||
| + | From here: http://forum.xda-developers.com/showthread.php?t=850359 | ||
| + | |||
| + | Chose a location to create the backups, e.g. /sdcard | ||
mkdir backup | mkdir backup | ||
| Line 124: | Line 127: | ||
adb pull /sdcard/pit.pit . | adb pull /sdcard/pit.pit . | ||
adb pull /sdcard/data.tar.gz . | adb pull /sdcard/data.tar.gz . | ||
| + | |||
| + | ==== Kernel Compilation ==== | ||
Grab the kernel source code from http://opensource.samsung.com/ | Grab the kernel source code from http://opensource.samsung.com/ | ||
Follow: Mobile > Mobile Phone > GT-P1000 > GT-P1000_OpenSource.zip. There is a new GT-P1000_OpenSource_Update1.zip but I've not tried that, please do tell if it works or works better ;) | Follow: Mobile > Mobile Phone > GT-P1000 > GT-P1000_OpenSource.zip. There is a new GT-P1000_OpenSource_Update1.zip but I've not tried that, please do tell if it works or works better ;) | ||
| + | |||
| + | ---- | ||
| + | [GERO@LIKEMAG] Please note that the GT-P1000_OpenSource_Update1.zip has been updated at least '''twice''' on the Samsung server. I got the newest version today. They included some more drivers and fixed some minor bugs '''but removed the TinyFSR config option (by accident?)''' - You have to manually modify Kbuild and Makefile in drivers to get TinyFSR!!! | ||
| + | ---- | ||
* Link to kernel source (http://opensource.samsung.com/ search for "gt-p1000", select "GT-P1000_OpenSource.zip") | * Link to kernel source (http://opensource.samsung.com/ search for "gt-p1000", select "GT-P1000_OpenSource.zip") | ||
| Line 143: | Line 152: | ||
Note that we could try enabling kexec if we find that keeping compatibility with the Android kernel is too limiting and then kexec away to our less constrained kernel. Need to test this. | Note that we could try enabling kexec if we find that keeping compatibility with the Android kernel is too limiting and then kexec away to our less constrained kernel. Need to test this. | ||
| - | |||
* link to scripts to extract and rebuild initramfs (http://people.bath.ac.uk/enpsgp/Tab/initramfs/) | * link to scripts to extract and rebuild initramfs (http://people.bath.ac.uk/enpsgp/Tab/initramfs/) | ||
| + | |||
| + | ==== Pre-built kernel ==== | ||
| + | |||
| + | * link to zImage - for those who don't want to do any building (http://people.bath.ac.uk/enpsgp/Tab/kernel/zImage) | ||
| + | |||
| + | ==== Flashing the kernel ==== | ||
* instructions for flashing kernel using heimdall (install heimdall: http://www.glassechidna.com.au/products/heimdall/ then: "heimdall flash --kernel zImage") | * instructions for flashing kernel using heimdall (install heimdall: http://www.glassechidna.com.au/products/heimdall/ then: "heimdall flash --kernel zImage") | ||
| - | * | + | ==== Building the Meego rootfs image ==== |
| + | |||
| + | * A sample kickstart file can be found [http://people.bath.ac.uk/enpsgp/Tab/meego-handset-armv7l-galaxy-tab-1.1.80.15.20110118.5.ks here] | ||
| + | |||
| + | ''Steph added the following line to the beginning of the %post section to create the modules directory: i.e. <tt>mkdir -p $INSTALL_ROOT/lib/modules/2.6.32.9/kernel/</tt> | ||
| + | |||
| + | The kickstart has a bunch of configuration changes versus a typical N900 one, largely pertaining to the touchscreen and virtual keyboard behaviour. The other major change is the inclusion of several files into the image from both the Android initramfs and Galaxy Tab filesystem. These need to be prepared before building the image with MIC2 (We could extract these at runtime, but currently are setup for them to be pre-extracted and added to the Meego partition. Make some notes about location of these files and alternative methods of extracting at runtime.) | ||
| + | |||
| + | |||
| + | The adbd daemon, wireless driver blob and configuration must be pulled from the Tab with adb (the following assumes that the 'extras' directory is in the the directory from where you're going to be launching mic-image-creator): | ||
| + | |||
| + | <pre> | ||
| + | mkdir -p extras/wifi | ||
| + | adb pull /sbin/adbd extras/ | ||
| + | adb pull /system/etc/wifi/bcm4329_sta.bin extras/wifi/ | ||
| + | adb pull /system/etc/wifi/nvram_mfg.txt extras/wifi/ | ||
| + | </pre> | ||
| + | |||
| + | The following must be pulled from the initramfs, itself extracted from the Galaxy Tab /zImage. <tt>initramfs_extractor.sh</tt> was retrieved from [http://people.bath.ac.uk/enpsgp/Tab/initramfs/initramfs_extractor.sh here]: | ||
| + | |||
| + | <pre> | ||
| + | adb pull /zImage . | ||
| + | ./initramfs_extractor.sh zImage | ||
| + | mkdir exploded && cd exploded | ||
| + | # This throws an error but seems to get far enough for what we need | ||
| + | cpio --no-absolute-filenames -ivd < ../initramfs.cpio | ||
| + | cd ../ | ||
| + | |||
| + | # Got two sets of modules here, we need both? | ||
| + | mkdir extras/modules | ||
| + | cp -R exploded/modules/* extras/modules/ | ||
| + | cp -R exploded/lib/modules/* extras/modules/ | ||
| + | </pre> | ||
| + | |||
| + | ''Where does rc.local come from? is it also the one from the initramfs or is it lardman's from [http://people.bath.ac.uk/enpsgp/Tab/kernel/rc.local here] (Steph suspects the latter?)'' | ||
| + | |||
| + | Once that is all done build the image. The pre-requisites for MIC2 can be be found [http://wiki.meego.com/Image_Creation#Installation here] and specifics for building ARM images are [http://wiki.meego.com/ARM/Creating_ARM_image_using_MeeGo_Image_Creator here] but basically boil down to: | ||
| + | |||
| + | <pre>sudo mic-image-creator --run-mode=0 \ | ||
| + | --cache=/home/simon/development/meego/build/mycachedir/ \ | ||
| + | --format=raw \ | ||
| + | --arch=armv7l \ | ||
| + | --config=./meego-handset-armv7l-galaxy-tab-1.1.80.15.20110118.5.ks | ||
| + | </pre> | ||
| - | + | Once the image has been built, copy it to the microSD card: | |
| - | + | <pre> | |
| - | + | dd if=<image name> of=/dev/<sd card device> bs=4M | |
| + | </pre> | ||
=== Setup notes === | === Setup notes === | ||
| Line 171: | Line 229: | ||
* Android will not start up unless you pass the standard bootloader cmdline arguments to the kernel, so if you want to add more arguments you need to either combine them or reproduce them at compile time. Either way you need a kernel patch as otherwise the bootloader cmdline overrides and replaces whatever you specified at compile-time. | * Android will not start up unless you pass the standard bootloader cmdline arguments to the kernel, so if you want to add more arguments you need to either combine them or reproduce them at compile time. Either way you need a kernel patch as otherwise the bootloader cmdline overrides and replaces whatever you specified at compile-time. | ||
| - | * While adding console=tty0 to the kernel command line means you see the boot-time output, it prevents the Tab kb dock from functioning! | + | * While adding console=tty0 to the kernel command line means you see the boot-time output, it prevents the Tab kb dock from functioning! This is because the P1 keyboard driver measures the boot time in jiffies. If the time difference is either below or above a specific threshold, then it is assumed that the keyboard dock is there/not there :-) You have to modify the threshold because an activated console consumes more time during the boot process. |
== Ubuntu == | == Ubuntu == | ||
| + | ===Current Status=== | ||
| + | |||
| + | Working: | ||
| + | |||
| + | * Boot Ubuntu (ext4 partition off the internal or external SD Card). | ||
| + | * WIFI ( SSH in for interactivity), There are wifi connectivity issues in Natty Narwhal but that is a natty issue as far as I can see so far -lilstevie. | ||
| + | * GPIO hardware power button (So you can do a proper shutdown only while Xorg is running). | ||
| + | * oneNAND. | ||
| + | * Touchscreen. | ||
| + | * USB - Requires proprietary modules fsr, fsr_stl, j4fs, and param to be loaded | ||
| + | |||
| + | Partial Working: | ||
| + | |||
| + | * Audio - Output can be attained, but is not scanned by pulseaudio and is not set and forget. | ||
| + | * Bluetooth - Loads HCD (firmware) with patched brcm_patchram_plus (from the HD2 ubuntu project) bluez and hcitools can detect, attach and connect to a device although HID devices (all that I have tried so far) do not work. --lilstevie | ||
| + | * Button Strip - Input is detected, Xorg processes it, but does not enact the button command until the next touch of the screen. | ||
| + | * Framebuffer - Unaccelerated framebuffer. | ||
| + | |||
| + | |||
| + | Not Working: | ||
| + | |||
| + | * Cellular Data - This will require the reimplementation of librild to interface with onedram mailbox, post the firmware and nvram and toggle the baseband boot gpio. | ||
| + | |||
| + | Not Yet Tested: | ||
| + | |||
| + | * Everything else. | ||
| + | |||
| + | ===Setup Instructions=== | ||
| + | |||
| + | ====Root FileSystem==== | ||
| + | |||
| + | The 2 options for RootFS are Download a prebuilt image or generate your own. | ||
| + | |||
| + | =====Generate your own rootfs===== | ||
| + | |||
| + | Prerequisites: | ||
| + | |||
| + | # Ubuntu install that has internet access (can be in a VM). | ||
| + | # A little bit of command line knowledge. | ||
| + | # Rootstock (can be obtained through aptitude). | ||
| + | # Some time. | ||
| + | |||
| + | =====Creating your Image===== | ||
| + | |||
| + | # Elevate your terminal to root permissions (sudo -s). | ||
| + | # Install rootstock if you haven't already done so (apt-get install rootstock -y). | ||
| + | # Run rootstock with the following syntax (you may change the hostname/default user/pass as they are not essential to following these directions) | ||
| + | #:<code>rootstock --fqdn GalaxyTab --login ubuntu --password ubuntu --imagesize 5G --seed netbook-launcher-efl,onboard,ubuntu-netbook-efl-default-settings,wicd,wicd-curses,wicd-cli</code> | ||
| + | ##You will need to add gdm, xorg and openssh-server to the list above. Can someone confirm. --lardman | ||
| + | # Have a coffee and hope it builds. | ||
| + | |||
| + | After following these steps you will have your own generated rootfs.tgz ready to be extracted in to your Galaxy tab, A pre-prepared image will be available for download soon. | ||
| + | |||
| + | Before Continuing any further please follow the steps provided above in the tutorial above about backing up your system, The install process is destructive to /data so backing it up if you want to go back to android is a good idea. | ||
| + | |||
| + | ====Install image to your device==== | ||
| + | |||
| + | |||
| + | =====Install to internal SD card===== | ||
| + | |||
| + | This step is done in recovery and requires running some commands via ADB, if you are not comfortable with this DO NOT PROCEED. | ||
| + | This part of the install will have a script to help the install some time in the future. | ||
| + | |||
| + | # Boot into recovery. | ||
| + | # Mount /system, and make sure that /Data is not mounted. | ||
| + | # Make sure you have backed up your android install before going any further. | ||
| + | #* If you are installing to internal SD replace $SD with "mmcblk0" and $P with p3 in the following instructions. | ||
| + | #* If you are installing to external SD replace $SD with "mmcblk1" and $P with p1 in the following instructions. | ||
| + | # Run "parted /dev/block/$SD" and delete all partitions (this is why you made a backup). | ||
| + | # Create new partitions and do mkfs after creation to the following specifications. | ||
| + | #*Internal SD; 3 partitions, Partition 1 type vfat and size of your choice(this is internal SD in android and /media/SD in ubuntu if you set up the SD mount); Partition 2 type vfat and size of 1.5GB (you will restore the data backup to here); Partition 3 type ext2 and rest of disk (this is ubuntu install so make sure you leave enough room). | ||
| + | #* External SD; 1 or 2 Partitions, Partition 1 ext2 as big as you want your ubuntu partition to be; Partition 2 vfat if there is any space left unpartitioned to be used as a normal SD card. | ||
| + | # Run "tune2fs –O dir_index,uninit_bg,has_journal $SD$P" | ||
| + | # Run "e2fsck -pf /dev/block/$SD$P" | ||
| + | # Run "mount /dev/block/$SD$P /sdcard" | ||
| + | # Use adb to push rootfs.tgz to /sdcard as rootfs.tar.gz (eg: adb push rootfs.tgz /sdcard/root.tar.gz). | ||
| + | # Run "gunzip rootfs.tar.gz && tar xvf rootfs.tar" | ||
| + | # Put all the modules (some will need to come from make modules from the kernel some can come from your android image) and wifi firmware & nvram (located in /system/etc/wifi) in their appropriate places. | ||
| + | # In a chroot environment run "moddep -v && update-initramfs -c -v -k 2.6.32.9" | ||
| + | # Add the rootfs to fstab. | ||
| + | # Add mtev touch screen driver and udev rule. | ||
| + | # Pull initramfs from /sdcard/boot as you will need that for the kernel. | ||
| + | |||
| + | =====Install to external SD card===== | ||
| + | |||
| + | # Format your uSD card in your desktop Linux box using (ADD COMMAND, ADD NOTE ON SUPPORTED FORMATS - ext4 works for certain) | ||
| + | # If you don't have a Linux box, you can use a LiveCD, or format using the Tab itself (ADD INSTRUCTIONS) | ||
| + | # Extract the rootfs.tar.gz (generated by rootstock above) to your pre-formatted SD card | ||
| + | # Put all the modules (some will need to come from make modules from the kernel some can come from your android image) and wifi firmware & nvram (located in /system/etc/wifi) in their appropriate places. (ADD SOME MORE DETAIL ABOUT HOW TO EXTRACT THESE) | ||
| + | # In a chroot environment run "moddep -v && update-initramfs -c -v -k 2.6.32.9" (ADD DETAIL ABOUT CHROOT'ing AND WHAT YOU NEED INSTALLED) | ||
| + | # Add the rootfs to fstab. | ||
| + | # Add mtev touch screen driver and udev rule. (THIS WILL PROBABLY BE CHANGED NOW WITH THE NEW DRIVER) | ||
| + | # Pull initramfs from /sdcard/boot as you will need that for the kernel. (CUSTOM INITRAMFS MAY BE REQUIRED FOR EXTERNAL SD, NEED TO CHECK) | ||
| + | |||
| + | Adding more info today as I do a new build (to help me remember the steps!) - lardman 9th April 2011 | ||
| + | |||
| + | ====Preparing the kernel==== | ||
| + | |||
| + | This assumes that you have experience building your own kernel. | ||
| + | |||
| + | # Find and apply Lardmans kernel command line patch. | ||
| + | # Patch s3cfb_lms700jf.c to prevent LCD poweroffs (I couldn't find the right place to do the sysfs tweak I outlined above for the Meego install so looks like kernel patch is the way for Ubuntu --lardman) | ||
| + | # Edit the kernel config to allow udev to work (set CONFIG_DEVTMPFS=y and CONFIG_DEVTMPFS_MOUNT=y). | ||
| + | # edit the console command line. | ||
| + | #* For verbose boot "console=tty0". (recommended to see what's going on) | ||
| + | #* For an install to internal SD Card add "root=/dev/mmcblk0p3" | ||
| + | #* For an install to external SD Card add "root=/dev/mmcblk1p1" | ||
| + | #* I will upload a few param.lfs later on today that use different configurations, this also removes the need for the setup.c kernel patch. --lilstevie | ||
| + | # Extract initramfs you generated in the chroot above. (we should just give a direct download of this) | ||
| + | # Set extracted initramfs as initramfs in kernel config. | ||
| + | # Compile and flash kernel. | ||
| + | |||
| + | |||
| + | These instructions are by no means complete at this time, more concise instructions will come soon, as well as prebuilt images to make installation slightly easier (Prebuilt combined with install scripts should be easier than all of this ever could be) | ||
= Related Wiki Pages = | = Related Wiki Pages = | ||
| Line 184: | Line 356: | ||
* Simon Pickering / lardman - Galaxy Tab (Meego) | * Simon Pickering / lardman - Galaxy Tab (Meego) | ||
* lilstevie - Galaxy Tab (Ubuntu) & ?? | * lilstevie - Galaxy Tab (Ubuntu) & ?? | ||
| + | * cb22 - Galaxy Tab | ||
[[Category:Hardware]] | [[Category:Hardware]] | ||
Contents |
So, I have a barebones version of MeeGo (barely) running on the Nexus S. I can't really do much with it on my own, but I'm posting the info here so you can build it and try it for yourself.
I have my boot.img (kernel + ramdisk) and a MeeGo kickstart file at http://blog.steventroughtonsmith.com/2011/01/nexus-s-meego.html; you can use fastboot to boot the image, or flash it to the recovery partition to dual boot. The actual MeeGo rootfs is run from a rootfs.ext2 file you can drop onto the Nexus S using Mass Storage mode - no need for messy flashing or the like, you can thank me later).
There's not much else I can do on my own right now, so if you want to see anything become of this do get involved!
My kernel is Samsung stock; you will need to modify it to get X11 to run:
The only change was modifying the .config file to turn on CONFIG_VT (needed for X11, unless we recompile X11 without VT support).
Will add this to a newer kickstart, but for the time being, you can bring the brightness to full by doing:
dmesg output is available on Talk:ARM/Hummingbird.
WORK IN PROGRESS, I'M STILL ADDING INFO! - 16/2/2011 If you're in a desperate hurry then feel free to catch me (lardman) on #meego-arm and pick my brain/add info/make changes here/etc. :)
Working:
In progress:
Not tried yet:
If you would like to help, have questions, ideas, etc., please catch me (lardman) in #meego-arm
The idea here is to boot Meego from the external SD card (similar to the N900 Meego boot process.)
Currently this requires that you flash a new, slightly modified, kernel to your Tab.
The Tab kernel contains an initramfs which contains an Android version of init which brings the system up.
With Android devices, there is normally a hardware key you can press at boot time to specify whether you want to enter flashing mode or recovery mode (and no keypress indicates a normal startup.) On the Tab the flashing key is the volume down button and the recovery button is the volume up button.
With most Android devices the normal and recovery boots load different kernels (located on different partitions.) This is nice as it means one does not need to modify the normal Android kernel at all, but can still mess about with other kernels in the recovery kernel partition (e.g. to try booting Meego, at the expense of no recovery mode, which is not a big problem.) But, in their infinite wisdom, Samsung decided that both normal and recovery modes would use the same kernel on the Tab. Rather than booting a completely separate kernel, the Tab boots the same kernel and the Android-specific init somehow recognises which mode was selected at boot time. It then proceeds to process either init.rc or recovery.rc. (the init binary looks for bootmode=* that gets added to the kernel command line --lilstevie)
Now this would give us an option of modifying the boot process, but the major problem is that while the Android init should support an exec command, this is not implemented in the version we have, and therefore even if we modify the recovery.rc file to try to start our own script to switch_root, etc., it won't work. The Android init used in the Tab is not stock Google code and there is no source available for the modifications. (gingerbread samsung init supports exec, fingers crossed it is released soon --lilstevie)
Therefore I've renamed the Android init and replaced with it an init script which searches for Meego installations (btrfs partitions on the external SD card, or loop images) and if these are not found exec's the renamed Android init, which goes on its merry way and starts Android just like normal.
Work in progress!
We only actually alter the kernel, so this is the only one you need to backup, but you may as well do the whole lot just in case. Note that you need to "root" your Tab to be able to use these commands. Also note that this assumes you know how to use adb.
From here: http://forum.xda-developers.com/showthread.php?t=850359
Chose a location to create the backups, e.g. /sdcard
mkdir backup cd backup adb shell su -c "dd if=/dev/block/bml1 of=/sdcard/boot.bin bs=4096" adb shell su -c "dd if=/dev/block/bml2 of=/sdcard/pit.pit bs=4096" adb shell su -c "dd if=/dev/block/stl3 of=/sdcard/efs.rfs bs=4096" adb shell su -c "dd if=/dev/block/bml4 of=/sdcard/Sbl.bin bs=4096" adb shell su -c "dd if=/dev/block/stl6 of=/sdcard/param.lfs bs=4096" adb shell su -c "dd if=/dev/block/bml7 of=/sdcard/zImage bs=4096" adb shell su -c "dd if=/dev/block/stl9 of=/sdcard/factoryfs.rfs bs=4096" adb shell su -c "dd if=/dev/block/stl10 of=/sdcard/dbdata.rfs bs=4096" adb shell su -c "dd if=/dev/block/stl11 of=/sdcard/cache.rfs bs=4096" adb shell su -c "dd if=/dev/block/bml12 of=/sdcard/modem.bin bs=4096" adb shell su -c "tar -czvf /sdcard/data.tar.gz /data" adb pull /sdcard/param.lfs . adb pull /sdcard/zImage . adb pull /sdcard/factoryfs.rfs . adb pull /sdcard/dbdata.rfs . adb pull /sdcard/cache.rfs . adb pull /sdcard/modem.bin . adb pull /sdcard/efs.rfs . adb pull /sdcard/boot.bin . adb pull /sdcard/Sbl.bin . adb pull /sdcard/pit.pit . adb pull /sdcard/data.tar.gz .
Grab the kernel source code from http://opensource.samsung.com/ Follow: Mobile > Mobile Phone > GT-P1000 > GT-P1000_OpenSource.zip. There is a new GT-P1000_OpenSource_Update1.zip but I've not tried that, please do tell if it works or works better ;)
[GERO@LIKEMAG] Please note that the GT-P1000_OpenSource_Update1.zip has been updated at least twice on the Samsung server. I got the newest version today. They included some more drivers and fixed some minor bugs but removed the TinyFSR config option (by accident?) - You have to manually modify Kbuild and Makefile in drivers to get TinyFSR!!!
Extract the source, follow the instructions in the readme.txt to grab the cross-compiler and edit the relevant settings in the build_kernel.sh script.
Note that we use the same source and toolchain so that the PVR kernel modules will still work (as we're dual booting Android)
Try compiling to see if it all works. It should do. If you get the following warning "WARNING: modpost: Found 13 section mismatch(es).", don't worry, that appears to be normal (!)
Note that we could try enabling kexec if we find that keeping compatibility with the Android kernel is too limiting and then kexec away to our less constrained kernel. Need to test this.
Steph added the following line to the beginning of the %post section to create the modules directory: i.e. mkdir -p $INSTALL_ROOT/lib/modules/2.6.32.9/kernel/
The kickstart has a bunch of configuration changes versus a typical N900 one, largely pertaining to the touchscreen and virtual keyboard behaviour. The other major change is the inclusion of several files into the image from both the Android initramfs and Galaxy Tab filesystem. These need to be prepared before building the image with MIC2 (We could extract these at runtime, but currently are setup for them to be pre-extracted and added to the Meego partition. Make some notes about location of these files and alternative methods of extracting at runtime.)
The adbd daemon, wireless driver blob and configuration must be pulled from the Tab with adb (the following assumes that the 'extras' directory is in the the directory from where you're going to be launching mic-image-creator):
mkdir -p extras/wifi adb pull /sbin/adbd extras/ adb pull /system/etc/wifi/bcm4329_sta.bin extras/wifi/ adb pull /system/etc/wifi/nvram_mfg.txt extras/wifi/
The following must be pulled from the initramfs, itself extracted from the Galaxy Tab /zImage. initramfs_extractor.sh was retrieved from here:
adb pull /zImage . ./initramfs_extractor.sh zImage mkdir exploded && cd exploded # This throws an error but seems to get far enough for what we need cpio --no-absolute-filenames -ivd < ../initramfs.cpio cd ../ # Got two sets of modules here, we need both? mkdir extras/modules cp -R exploded/modules/* extras/modules/ cp -R exploded/lib/modules/* extras/modules/
Where does rc.local come from? is it also the one from the initramfs or is it lardman's from here (Steph suspects the latter?)
Once that is all done build the image. The pre-requisites for MIC2 can be be found here and specifics for building ARM images are here but basically boil down to:
sudo mic-image-creator --run-mode=0 \ --cache=/home/simon/development/meego/build/mycachedir/ \ --format=raw \ --arch=armv7l \ --config=./meego-handset-armv7l-galaxy-tab-1.1.80.15.20110118.5.ks
Once the image has been built, copy it to the microSD card:
dd if=<image name> of=/dev/<sd card device> bs=4M
Working:
Partial Working:
Not Working:
Not Yet Tested:
The 2 options for RootFS are Download a prebuilt image or generate your own.
Prerequisites:
rootstock --fqdn GalaxyTab --login ubuntu --password ubuntu --imagesize 5G --seed netbook-launcher-efl,onboard,ubuntu-netbook-efl-default-settings,wicd,wicd-curses,wicd-cli
After following these steps you will have your own generated rootfs.tgz ready to be extracted in to your Galaxy tab, A pre-prepared image will be available for download soon.
Before Continuing any further please follow the steps provided above in the tutorial above about backing up your system, The install process is destructive to /data so backing it up if you want to go back to android is a good idea.
This step is done in recovery and requires running some commands via ADB, if you are not comfortable with this DO NOT PROCEED. This part of the install will have a script to help the install some time in the future.
Adding more info today as I do a new build (to help me remember the steps!) - lardman 9th April 2011
This assumes that you have experience building your own kernel.
These instructions are by no means complete at this time, more concise instructions will come soon, as well as prebuilt images to make installation slightly easier (Prebuilt combined with install scripts should be easier than all of this ever could be)
MeeGo on ARM/Snapdragon (MSM/QSD)