FORUMS
Remove All Ads from XDA
H10 Turbo

Ubuntu for N80xx

163 posts
Thanks Meter: 205
 
By X-Stranger, Senior Member on 4th December 2013, 12:34 PM
Post Reply Email Thread


In addition to GNU/Linux@N80XX topic, this one is a separate for Ubuntu users. Read below if you want to have native Ubuntu 13.10 wih Gnome/LDXE/XFCE at your Galaxy Note 10.1 device (2012 models only).

Screenshots:
Click image for larger version

Name:	1.jpg
Views:	6948
Size:	71.6 KB
ID:	2432486 Click image for larger version

Name:	2.jpg
Views:	6892
Size:	91.2 KB
ID:	2432487 Click image for larger version

Name:	3.jpg
Views:	7419
Size:	94.6 KB
ID:	2432488

Please be aware, that stuff I share with you is experimental, it does not work 100% correctly and there are some lags and bugs.

Some technical details:
The approach is based on using custom recovery (e.g. custom kernel and initrd image) which boots into Linux. All Linux files are stored at data partition (it is mmcblk0p12 when using standard firmware, which also is internal sdcard) in a separate folder. Initrd script mounts data partition and looks for the special file /media/rootdev - this file contains the path to the Linux root folder. Script sets the Linux root device to be this folder specified and invokes /sbin/init. You see Linux booting - Ubuntu in our case.

However I've also prepared the second folder with native recovery files. E.g. if you change rootdev content to point to recovery files folder, you will boot into recovery. Generally, you can boot any other recovery or Linux distro using this approach. And hosting it at sdcard in a folder much easier than re-partitioning tablet or using loop-device in a file. Free space for your Linux depends only of free space you have at data partition.


Prerequisites:
  • Rooted GT-N80xx device
  • Busybox tools installed
  • Desktop computer with ADB tools
  • Custom recovery image (with or without menu), native recovery, Ubuntu image files downloaded (see downloads section)
  • Understanding of what are you doing

Downloads:
Steps:
  1. Connect your device to the desktop computer with USB cable. Make sure your device is visible when you run "adb devices"
  2. Rename downloaded recovery image to "recovery.img"
  3. Upload downloaded files to the internal memory:
    Code:
    adb push recovery.img /sdcard/
    adb push recovery.tar.gz /sdcard/
    adb push ubuntu.tar.gz /sdcard/
  4. Now you need to get into device, so run "adb shell", then type the next commands (the lines beginning from # are the comments, you don't need to type it ):
Code:
# 4. become root user
su -
# 5. go to the internal sdcard real path, where you uploaded files
cd /data/media

# 6. write custom recovery to the special partition, by default it is mmcblk0p6
dd if=./recovery.img of=/dev/block/mmcblk0p6

# 7. unpack native recovery files, the "recovery" folder will be created
gunzip -c ./recovery.tar.gz | tar -x

# 8. unpack Ubuntu files, the "ubuntu" folder will be created
gunzip -c ./ubuntu.tar.gz | tar -x

# 9.1. Now, if you downloaded custom recovery without menu - set what to 
#      boot, in our case it is Ubuntu, and go to step #10
echo "/media/ubuntu" > ./rootdev

# 9.2. OR, if you downloaded custom recovery with menu - add menu entries
echo "Ubuntu=/media/ubuntu" > ./rootdev
echo "Recovery=/media/recovery" >> ./rootdev
echo "Reboot=reboot" >> ./rootdev

# 10. remove files that we don't need anymore and quit
rm ./recovery.img ./recovery.tar.gz ./ubuntu.tar.gz
exit
exit
Now you should reboot your device to recovery mode. If you did all correctly (and I did not miss anything in steps) you should see Linux booting (and menu if you are using custom recovery with menu).
Please use your S-Pen as mouse, button on the pen works as "right-click".
The password for root user and android user is "q" (small q-letter without quotes).

Notes:
  • The Ubuntu image I shared with you is v13.10 and Gnome-based (Unity does not work due to Compiz issues).
  • Regular Gnome session works at most, but have some bugs, due to 3D acceleration support issues. For example, window dragging does not work and the session hangs (sorry, I have not found why, please fix if you can and share your workaround with us).
  • Gnome Fallback works better, but might not start properly from the first time. E.g. you should boot to regular Gnome session, then log out and login to Fallback (also have no idea why it works like this, please help if have experience).
  • Due to the issues with Gnome, I've also installed LXDE and XFCE, so you could try login to it. However I would recommend booting to regular Gnome session at least to configure your Wi-Fi connection.
  • Internal and external sdcards are mounted to /mnt/intSdCard and /mnt/extSdCard paths.

Important notes:
  • The Ubuntu image has ADB installed. E.g. if something goes wrong at the screen and you are not able to manage your device, connect it to the desktop with USB cable, run "adb shell", then "sudo su -" and you become root user. To restart graphical session you need to invoke "service gdm restart" command.
  • If you are using custom recovery without menu and want to boot native recovery instead of Ubuntu, edit "rootdev" file at internal sdcard to contain "/media/recovery" path (without quotes). You can do that via ADB shell, using any Android text editor, or directly from Linux.
The last thing to know:
Not all is working from Ubuntu. Currently there is no 3G support and some other things. All of them are discussed in the parent thread

Please let me know if I have missed something and my steps do not work for you. Any other feedback will also be appreciated
The Following 25 Users Say Thank You to X-Stranger For This Useful Post: [ View ] Gift X-Stranger Ad-Free
 
 
4th December 2013, 02:17 PM |#2  
Senior Member
Thanks Meter: 18
 
More
downloading right now... just one question! can i do all this with terminal emulator on android?

edit: forget about that last question, tried from terminal emulator and it worked.
4th December 2013, 02:54 PM |#3  
Senior Member
Thanks Meter: 310
 
More
Quote:
Originally Posted by X-Stranger



In addition to GNU/Linux@N80XX topic, this one is a separate for Ubuntu users. Read below if you want to have native Ubuntu 13.10 wih Gnome/LDXE/XFCE at your Galaxy Note 10.1 device (2012 models only).

Screenshots:
Attachment 2432486 Attachment 2432487 Attachment 2432488

Please be aware, that stuff I share with you is experimental, it does not work 100% correctly and there are some lags and bugs.

Some technical details:
The approach is based on using custom recovery (e.g. custom kernel and initrd image) which boots into Linux. All Linux files are stored at data partition (it is mmcblk0p12 when using standard firmware, which also is internal sdcard) in a separate folder. Initrd script mounts data partition and looks for the special file /media/rootdev - this file contains the path to the Linux root folder. Script sets the Linux root device to be this folder specified and invokes /sbin/init. You see Linux booting - Ubuntu in our case.

However I've also prepared the second folder with native recovery files. E.g. if you change rootdev content to point to recovery files folder, you will boot into recovery. Generally, you can boot any other recovery or Linux distro using this approach. And hosting it at sdcard in a folder much easier than re-partitioning tablet or using loop-device in a file. Free space for your Linux depends only of free space you have at data partition.


Prerequisites:
  • Rooted GT-N80xx device
  • Busybox tools installed
  • Desktop computer with ADB tools
  • 3 files downloaded (see downloads section)
  • Understanding of what are you doing

Downloads:
Steps:
  1. Connect your device to the desktop computer with USB cable. Make sure your device is visible when you run "adb devices"
  2. Upload downloaded files to the internal memory:
    Code:
    adb push recovery.img /sdcard/
    adb push recovery.tar.gz /sdcard/
    adb push ubuntu.tar.gz /sdcard/
  3. Now you need to get into device, so run "adb shell", then type the next commands (the lines beginning from # are the comments, you don't need to type it ):
Code:
# 4. become root user
su -
# 5. go to the internal sdcard real path, where you uploaded files
cd /data/media

# 6. write custom recovery to the special partition, by default it is mmcblk0p6
dd if=./recovery.img of=/dev/block/mmcblk0p6

# 7. unpack native recovery files, the "recovery" folder will be created
gunzip -c ./recovery.tar.gz | tar -x

# 8. unpack Ubuntu files, the "ubuntu" folder will be created
gunzip -c ./ubuntu.tar.gz | tar -x

# 9. set what to boot, we want Ubuntu
echo "/media/ubuntu" > ./rootdev

# 10. remove files that we don't need anymore and quit
rm ./recovery.img ./recovery.tar.gz ./ubuntu.tar.gz
exit
exit
Now you should reboot your device to recovery mode. If you did all correctly (and I did not miss anything in steps) you should see Linux booting.
Please use your S-Pen as mouse, button on the pen works as "right-click".
The password for root user and android user is "q" (small q-letter without quotes).

Notes:
  • The Ubuntu image I shared with you is v13.10 and Gnome-based (Unity does not work due to Compiz issues).
  • Regular Gnome session works at most, but have some bugs, due to 3D acceleration support issues. For example, window dragging does not work and the session hangs (sorry, I have not found why, please fix if you can and share your workaround with us).
  • Gnome Fallback works better, but might not start properly from the first time. E.g. you should boot to regular Gnome session, then log out and login to Fallback (also have no idea why it works like this, please help if have experience).
  • Due to the issues with Gnome, I've also installed LXDE and XFCE, so you could try login to it. However I would recommend booting to regular Gnome session at least to configure your Wi-Fi connection.
  • Internal and external sdcards are mounted to /mnt/intSdCard and /mnt/extSdCard paths.

Important notes:
  • The Ubuntu image has ADB installed. E.g. if something goes wrong at the screen and you are not able to manage your device, connect it to the desktop with USB cable, run "adb shell", then "sudo su -" and you become root user. To restart graphical session you need to invoke "service gdm restart" command.
  • If you want to boot native recovery instead of Ubuntu, edit "rootdev" file at internal sdcard to contain "/media/recovery" path (without quotes). You can do that via ADB shell, using any Android text editor, or directly from Linux.
The last thing to know:
Not all is working from Ubuntu. Currently there is no 3G support and some other things. All of them are discussed in the parent thread

Please let me know if I have missed something and my steps do not work for you. Any other feedback will also be appreciated

Hi! What about the Source Code for your custom recovery and stuff?
The Following 2 Users Say Thank You to Simon94 For This Useful Post: [ View ] Gift Simon94 Ad-Free
5th December 2013, 03:08 AM |#4  
Junior Member
Thanks Meter: 14
 
More
Quote:
Originally Posted by Simon94

Hi! What about the Source Code for your custom recovery

In ubuntu or debian:

Code:
apt-get install abootimg
abootimg -x recovery-1.img
After this you will have a folder with all the contents of the img. Some of which you can edit the scripts. You can extract the initrd and kernel even further with abootimg-unpack-initrd
5th December 2013, 11:37 AM |#5  
Senior Member
Thanks Meter: 18
 
More
i must say this is pretty awesome very few bugs, and xfce works perfect
6th December 2013, 01:58 AM |#6  
Liquidmetal6's Avatar
Senior Member
Maryland
Thanks Meter: 5
 
More
Can't risk ruining my tablet until after the semester ends but as soon as it does I'll be trying this! Sounds awesome...
6th December 2013, 06:09 AM |#7  
Senior Member
Flag Chicago
Thanks Meter: 38
 
More
THANK YOU, and THANK YOU for returning! Note 10.1 is currently in hands of Samsung for repairs. Hopefully I can have some fun with this once it is back.

Please check drivers here: http://forum.xda-developers.com/show...7#post45340017

I think the driver for Mali acceleration may be possible (you are using Hardkernel from ODROID, correct?).
6th December 2013, 09:38 AM |#8  
X-Stranger's Avatar
OP Senior Member
Thanks Meter: 205
 
Donate to Me
More
Quote:
Originally Posted by Simon94

Hi! What about the Source Code for your custom recovery and stuff?

My latest kernel sources (arch branch) and toolchain (in the toolchain branch): https://github.com/X-Stranger/N8000
Kernel sources, patched video driver and other stuff: https://code.google.com/p/opensgn/
Recovery can be unpacked/fixed/repacked using abootimg tools as mentioned
The Following User Says Thank You to X-Stranger For This Useful Post: [ View ] Gift X-Stranger Ad-Free
6th December 2013, 09:42 AM |#9  
X-Stranger's Avatar
OP Senior Member
Thanks Meter: 205
 
Donate to Me
More
Quote:
Originally Posted by dwegiel

THANK YOU, and THANK YOU for returning!

Don't forget to press "thanks" button (or even "donate to me" )

Quote:
Originally Posted by dwegiel

Note 10.1 is currently in hands of Samsung for repairs. Hopefully I can have some fun with this once it is back.

Please check drivers here: http://forum.xda-developers.com/show...7#post45340017

I think the driver for Mali acceleration may be possible (you are using Hardkernel from ODROID, correct?).

Yes, I'm using Mali acceleration in my Ubuntu image. It is still not 100% working though, that is what I'm talking about, when describe Gnome issues. If you can fix that - please do and share your experience, I'll update the image then.

I would also like someone to help with migration to the latest kernel, which has support for our Exynos board. Exception13 was going to do that, but looks like he is very busy person (and I can understand that).
The Following 2 Users Say Thank You to X-Stranger For This Useful Post: [ View ] Gift X-Stranger Ad-Free
6th December 2013, 01:00 PM |#10  
X-Stranger's Avatar
OP Senior Member
Thanks Meter: 205
 
Donate to Me
More
Lightbulb
Have composed a small menu program and added it to custom initrd. Now it is possible to select what to boot (see screenshot), e.g. don't need to edit rootdev file every time, only when adding new menu entry.

Click image for larger version

Name:	menu.png
Views:	1164
Size:	1.3 KB
ID:	2436305

Updated first post of this topic with instructions how to get this.
The Following 4 Users Say Thank You to X-Stranger For This Useful Post: [ View ] Gift X-Stranger Ad-Free
6th December 2013, 08:41 PM |#11  
Junior Member
Thanks Meter: 14
 
More
Quote:
Originally Posted by X-Stranger

Have composed a small menu program and added it to custom initrd. Now it is possible to select what to boot (see screenshot), e.g. don't need to edit rootdev file every time, only when adding new menu entry.

Attachment 2436305

Updated first post of this topic with instructions how to get this.

This is fantastic news for Note 10 owners out-there. I never read about another tablet with a bootmenu to native linux and recovery, so Y'all are lucky to have X-Stranger on the case =] because also now the Ubuntu flavor is on the go.

For all you Note 8 owners out-there I am trying to port the images over with as few changes as possible but my skill level at this type of task is 1/10 that of X-Stranger, so bare with me! (Or you can try and get a package together faster than me =] ).

My process so far is to use the initrd from X-Stranger's recovery_menu.img, and use a zImage from CWM, TWRP, and stock. All that they do is loop back to the note's defalt splash screen. I used X-Stranger's entire recovery_menu.img too and it boots to just a black screen on the Note 8. So my WIP conclusion thus far is that I or someone (volunteer required) has to compile a kernel with some patches just like X-Stranger did on page 3 of the previous thread.

Enjoy Ubuntu all the Note 10 owners....
Post Reply Subscribe to Thread

Tags
galaxy, linux, n8000, note, ubuntu

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes