yashsingh1/xdaforums huggingface dataset:
[Galaxy Note 10.1 General] X-Stranger:
Sorry, I didn't try to run Ubuntu yet, only my ArchLinux.

The note below is about emmc resizing and moving Linux onto new emmc partition. Not sure it is easy to follow: for most people image file and loop-device usage it good solution to use. But if you still want this - read below.

The first thing I've done is moved arch.img to sdcard and fixed initrd.img to boot from it. It is simple: just change partition you mount as looproot host and disable fsck hook (or include fsck.vfat into initrd files). Next, boot to your Linux (yes, now it works not so nice - sdcard is slow) and create backup of "data" partition just in case:

mkdir -p /mnt/extSdCard
mount /dev/mmcblk1p1 /mnt/extSdCard
mount /dev/mmcblk0p12 /srv
cd /srv
tar -czpf /mnt/extSdCard/data.tgz ./
umount /srv
umount /mnt/extSdCard

For sure, this partition must contains at least a few gigabytes of free disk space - the same amount as your Linux takes at least.

Next make sure your Linux has resize2fs, parted and gptfdisk packages installed. Once it is done, do this:

# example if you want to have 7G data partition and the rest for Linux

# resize filesystem with a size smaller than the desired size
resize2fs /dev/mmcblk0p12 6G

# delete the partition and create it again with the desired size -
# a little bigger than the filesystem!!
gdisk /dev/mmcblk0
...
# I'm using gdisk because it is easier to control partition parameters -
# make sure you have set the same partition code and start sector as it was before

# fix partition name with cgdisk, create new partition mmcblk0p13 for Linux
cgdisk /dev/mmcblk0
...

# now extend data partition filesystem to fit new size
resize2fs /dev/mmcblk0p12

# reload partition table
partprobe

# create new filesystem on new partition
mkfs.ext4 /dev/mmcblk0p13 -LLINUX
tune2fs -r 5000 /dev/mmcblk0p13

Next mount this new partition and copy your Linux onto it, fix kernel boot parameters and generate default initrd without looproot hook, update recovery, reboot. You should also change LinuxDeploy application settings to ask it to mount new partition instead of image file.
[Galaxy Note 10.1 General] X-Stranger:
ADB from Linux

Have found good solution to do not reboot every time to LinuxDeploy when something goes wrong and your Linux stops responding on the network and GUI is not started - we just need ADB! E.g. run adbd service from Linux and connect to shell via USB cable as usual.

For that purpose I've used adbd file from recovery and set a few settings in /sys. If you want the same - download attached file, unpack its content to the root of your filesystem, and make sure /system/bin/adb_service is running on boot (e.g. add a call to that file to your /etc/rc.local)
[Galaxy Note 10.1 General] mateuszwon94:
Kernel

Could you make link to your's compiled kernel? :)
[Galaxy Note 10.1 General] vanquss:
Kernel

It will be great if you upload this kernel. I've got troubles with making it.
[Galaxy Note 10.1 General] X-Stranger:
Okay, attached is my kernel to boot from loop0 and modules for it (rename kernel to "zImage" after downloading, modules to be put into /lib/modules). Not sure if it is useful for you, so I've also prepared ArchLinux and Recovery images for you. Going to share very soon.
[Galaxy Note 10.1 General] X-Stranger:
Posting the links to ArchLinux and Recovery images as promised:

http://d-h.st/uJ8 - Recovery image, you need to unpack it and write over /dev/block/mmcblk0p6 using dd or similar tool (your device should be rooted)

http://d-h.st/VwL - ArchLinux image, unpack it and upload it to your device to /sdcard/ folder (e.g. it will be /sdcard/linux.img).

As soon as you upload image and rewrite recovery partition - reboot to recovery mode. You should see Linux booting and LXDM display manager starting. After 5 seconds of timeout you'll be autologged into XFCE desktop environment. Touchscreen/S-Pen/Sound - all works. There is also onscreen keyboard Florence and Chromium browser, etc. Image also contains tools for recovery image manipulation and emmc repartitioning (if you are experienced enough and can follow my notes above). In case something went wrong this Linux image has ADB service installed - just connect device to your computer via cable and run "adb shell" (sudo works from this session too). The default user is "android" with password "changeme" (you can login via SSH for example). And also don't forget to fix /etc/rc.local and /etc/wpa_supplicant/wpa_supplicant.conf files to connect to your WiFi hotspot.

And many thanks to exception13 for help with wifi/sound/bluetooth/kernel-config and advices!
[Galaxy Note 10.1 General] vanquss:
THX!

Huge thanks to you and exception13 :)
[Galaxy Note 10.1 General] vanquss:
Battery indicator?

Is there a way to make battery indicator to show current battery level?
[Galaxy Note 10.1 General] X-Stranger:
This is a little bit out of topic - generally you should look XFCE forums. But I think it is indicator setting dependent. Or you might want to install other battery indicator. Or even another desktop environment - but without acceleration requirements for now (we still have no support for it).

Don't forget to press "Thanks" button for me and exception13 if you really like it :)
[Galaxy Note 10.1 General] quinman22:
Thanks for all this work! I have an N8013 and was going to compile the kernel myself but ran into some trouble. I figured I'd try your uploaded recovery and image. I put the image at /sdcard and used "dd if=/sdcard/Download/recover.img of=/dev/block/mmcblk0p6" but when I reboot, it never get's past the Galaxy Note 10.1 screen, both when I try getting into recovery and when I try getting into android. I rebooted into recovery by using the command from android and not holding the buttons, so maybe that affects why I can't get back into android. An important bit of information is that I'm using CM10.1. Hopefully this won't affect being able to dual boot into android. Thanks.

Edit: The cause for CM10.1 not booting up anymore must have been that I sent the message to boot into recovery from the shutdown menu, because it booted successfully back into cm10.1. I still can't seem to get into linux though.
[Galaxy Note 10.1 General] X-Stranger:
Can you please try to power off your tablet, then try to boot into recovery holding appropriate buttons? Please let me know the result
[Galaxy Note 10.1 General] quinman22:
Alright, from Android, I shut down. Then I held power and volume-up until I saw galaxy note 10.1 (after which if I kept holding it it would turn back off) It then just hangs on the note 10.1 screen forever. I thought maybe it was because I didn't unpack linux.img.gz so I did that to no avail.
[Galaxy Note 10.1 General] X-Stranger:
All you needed is just recovery.img unpacked and written to mmcblk0p6 and linux.img unpacked to /sdcard/.

Well, I suspest that 8013 is a bit more different from 8000 than I've expected, or (some crazy idea) CM10.1 is doing something wrong with device that it won't boot as expected. Need to think and check..

Any positive experience with N8000?
[Galaxy Note 10.1 General] juvenile43:
Re: Debian GNU/Linux@N80XX

Can I just rename the recovery.img to mmcblk.... and replace the existing file or what is dd? That I have to use to "write" to it? Ohh and I have a 8013 and was gonna see if I have better luck thsn the last guy

---------- Post added at 06:31 PM ---------- Previous post was at 05:31 PM ----------

sorry i did a little research (what i shoulda done in the first place) and figured it out but it fails at boot up gonna try to download again to see if it was just corrupt. will post back. looks promising so far. what should the unzipped file size be?
[Galaxy Note 10.1 General] quinman22:
When you say fails at boot up, what does it do?

@X-Stranger I can't imagine CM does anything to recovery, but maybe. Also, I unpacked linux.img.gz to linux.img, do I need to unpack it further?
[Galaxy Note 10.1 General] juvenile43:
Re: Debian GNU/Linux@N80XX

Its running now I just redownloaded it but im lost with the wireless settings. Going back to his older post im not sure if the firmware is included and im trying to edit the wpa supplicant conf but there is no text editor. Damn I want this to work so bad but im just not that educated on anythjng outside a gui with linux.
[Galaxy Note 10.1 General] quinman22:
Re: Debian GNU/Linux@N80XX

Well I feel silly now, apparently I just renamed recovery.img.gz to recovery.img and copied that over, no wonder I didn't see any boot stuff. Now I've got boot messages, but they're all errors pretty much. I get Memory Manager init failed and losetup: /dev/loop0/ no such file and the rest is probably related to not finding my loop back device. I can be more specific on the errors tomorrow.

Edit: So I am able to use Linux deploy and vncviewer or connect bot to get into the prebuilt IMG, so its working, but it must have something to do with cm10.1s change in file layout. I'm not positive how it all works, but in android 4.2 emulated storage was added to support multiple users. What used to be /sdcard for me is now /storage/emulated/0

Edit2: and therein lies my problem. If I open terminal emulator from the other user profile and do cd /sdcard I see the contents of /storage/emulated/10 so it really is emulated. It makes it tough to know where things will be when I try to boot into Linux. I suppose my options are going back to stock or changing my Linux.img to a different path and making my own recovery.img based on X-Stranger's.
[Galaxy Note 10.1 General] quinman22:
Re: Debian GNU/Linux@N80XX

OK I got it working by booting into twrp and using the file manager in recovery to put it in the REAL /sdcard. Thanks for the help. This is way faster than I thought it would be!

For future CM10.1 users, the real root of the sdcard can be found through the cm file manager at /mnt/shell/emulated
[Galaxy Note 10.1 General] juvenile43:
Re: Debian GNU/Linux@N80XX

Can somebody please give me an idea of how to enable the wifi then once I get that hopefully I can tackle the bluetooth. Once I have wifi can I install a metwork manager to make it easier t I switch between networks.
[Galaxy Note 10.1 General] quinman22:
Re: Debian GNU/Linux@N80XX

Are you using the Linux.img posted earlier? If so, WiFi and Bluetooth modules are already included and the setup is mostly done. You just need to edit wpa-supplicant.conf which I believe is in /etc to your network specs. Its explained a few pages back, but you can skip most of the instructions if you're using the image. I installed network-manager, but I have no idea how to set that up, so I stuck to the manual way until I look that up.

@X-Stranger I was trying to resize the image to 4gb, and I was able to do it from android using dd, but android doesn't have resize2fs I don't think to resize the contained filesystem. Any tricks?

To users, is anyone else experiencing weird things with the virtual keyboard? I try to type anything, for example, sudo, and would get ssudooo. I'm wondering if this is related to the driver or the virtual keyboard.
[Galaxy Note 10.1 General] _bambam:
Re: Debian GNU/Linux@N80XX

You need to change /etc/wpa_supplicant/wpa_supplicant.conf and as well /etc/rc.local . X-Stranger also posted something about WiFi some pages ago.
[Galaxy Note 10.1 General] X-Stranger:
First of all you can run terminal program and use any text editor, for example "mcedit", to fix wireless settings.

Well, you can also try using "adb shell", as soon as my Linux image contains ADB enabled: connect the device to the computer with Android platform and Samsung driver installed, make sure "adb" is in path and device was detected my OS, then run "adb devices" to make sure it is visible by ADB. After that you should be able to run "adb shell" at least to go inside the Linux, or might try to run "adb pull" / "adb push" too (hopefully it works, but I did not test).

---------- Post added at 10:13 AM ---------- Previous post was at 10:07 AM ----------

In my image it is only required to fix hotspot settings in wpa_supplicant.conf file and ip/gateway settings in /etc/rc.local file (or replace them with run of dhcpcd client). NetworkManager does not work as expected - this was mentioned by exception13. For some reason it won't always scan for wireless networks.

resize2fs can work online, e.g. boot into Linux and run resize2fs on root filesystem

Yes, "florence" can be buggy sometimes. You might want to replace it with "onboard" for example.
[Galaxy Note 10.1 General] diga1001:
Thanks for the nice tutorial...one questin ist left...i've changed extSdcard with sdcard trough an init.d script...do i have to change anything to make it work with the files you posted?
[Galaxy Note 10.1 General] X-Stranger:
Well, your change is just logical, e.g. physically the partition schema should be the same. So I guess you should put linux.img to extSdCard in that case.

P.S. Actually physical path is (mmcblk0p12)/media/linux.img - you can mount that partition as you like and put file to the path.
[Galaxy Note 10.1 General] diga1001:
I'm realy sorry to ask you again for help :(

I am totaly confused, cause i thought i flash a kernel via odin...that does not work for me. Also i am confused if i have to put the modules in the android folder or in the folder of the arch linux after i booted into it.

So to get clear:

I need to dd the recovery.img to the mentioned path right? that seemed to work in the terminal emulator

then i need to but the linux.img to the internal sd card

but what do i do with the zimage?
[Galaxy Note 10.1 General] X-Stranger:
Did you read the whole thread attentively? :) If you want to run my Linux image, you don't need to touch zImage and/or modules. It is only for those who want to build their own Linux systems based on my kernel. So you only need Recovery and Linux images: the first one to write over your recovery with dd (or flash_image probably) and the second to put to internal sdcard.
[Galaxy Note 10.1 General] diga1001:
Oh it seems that i did not understand the part where you mentioned it....cause i'm not native english speaker especialy such technical terms are difficult to me ;)
[Galaxy Note 10.1 General] mdalacu:
@X-Stranger: Can you start a new thread in witch you provide a fool proof way to flash Arch or Ubuntu image on the tablet, but also a way to revert all the changes. Can you make it to boot from a file (loop back) device on a external SD card? What if the card is formated as exFat, can you make it work (i have working exFat in Ubuntu and it is very stable)?

Thank you very much.
[Galaxy Note 10.1 General] juvenile43:
Re: Debian GNU/Linux@N80XX

I tried to use a usb flash drive to copy the file over and it says its write protected is there any way to get around it. I tried "su" in trrminal hoping to get full control but using the password changeme is says access denied. I dont know how to get a text editor installed and having adb issues probly because of windows 8. I know this probly seems so simple to you but I am a rookie when it comes to linux ill try to learn more on my own but its a pita to not have internet to help load some applications. Also now that youve came this far will you someday be able to release a flashable zip all set up. I realize it wouldnt be dual boot but that wouldnt bother me. Thank you for your help hopefully this will encourage me to learn more on my own
[Galaxy Note 10.1 General] nicoveraz:
To set a new password in terminal use the "passwd" command, you'll be asked for the current "changeme" and then for a new one that shoud work fine. To edit the files needed to get wifi working in xfce terminal you can use "sudo su" and then "nano /etc/rc.local" and "nano /etc/wpa_supplicant/wpa_supplicant.conf" (nano is an included text editor)
[Galaxy Note 10.1 General] exception13:
open source implementation of exFat support in most gnu/linux distributives is not official and use fuse. official exFat lkm is proprietary, closed source and NDA.
[Galaxy Note 10.1 General] juvenile43:
Re: Debian GNU/Linux@N80XX

Thank you nico I know its gotta be kinda frustrating when people ask questions without dojng their own research but I am trying and ive read this thread front to back plenty of times. Cant wait to get home to try this.
[Galaxy Note 10.1 General] mdalacu:
Re: Debian GNU/Linux@N80XX

I know that but the an open source driver implementation it is available. What are the implications that it is a fuse driver? Thanks.
[Galaxy Note 10.1 General] diga1001:
So finally I was able to boot your arch image and also set a new root password. I even got so far to be able to edit the /etc/wpa_supplicant/wpa_supplicant.conf and as well /etc/rc.local and have entered the apropriate things for my wifi but it still does not work....what do i need todo with the rc.locas? and how can i use this img as recovery for android? the filesystem of the tab is not mounted and i wasn't able to do so

bzw: is the samsung usb conector not working? tried it with an usb drive and a keyboard but none worked
[Galaxy Note 10.1 General] juvenile43:
Re: Debian GNU/Linux@N80XX

Thats odd digi mine r3cognized 2 diff usb sticks. Didnt try a keyboard
[Galaxy Note 10.1 General] psx2pal:
Hello, i have played a little bit with arch linux on my tablet. I tried to install gnome, but can't get it to work, not enough space. But it installed a new tool, i think it was (pacman -S gnome-extras). With this Tool Bluetooth starts every time and i can pairing my devices.
[Galaxy Note 10.1 General] juvenile43:
Re: Debian GNU/Linux@N80XX

Strange I come home today confident im gonna get my wifi working and now it wont boot. I changed absokutly nothing since last night. It says have to run fsdsk manually and freezes
[Galaxy Note 10.1 General] quinman22:
@ X-Stranger: I know you haven't done anything with Ubuntu, but I was hoping you could help regardless. I was able to successfully compile a kernel and moved zImage and the modules to the proper place. The only thing I'm hung up on is initrd.img. I've executed

sudo mkinitramfs 3.0.31 -o /boot/initrd.img

But I keep getting the error

gerp: /boot/config-3.0.31: No such file or directory

Running the command with the -v flag gives a string of errors saying

FATAL: Could not load /lib/modules/3.0.31-CM-gf9b5ada/modules.dep: No such file or directory

I feel like I'm so close, and I could swear I got the command to work last night, but since I accidentally forgot an x in linux.img and put a random s in one of my config files, I had to fix and rerun mkinitramfs. That's when I started to get this error I think. Thanks in advance.

---------- Post added at 12:05 PM ---------- Previous post was at 12:03 PM ----------

Does it say run "fschk" I got that once and ran that function on linux.img from inside android to get it working again. If you have an external sd card, I'd recommend zipping the img to that as a backup every once in a while in case things get messy.
[Galaxy Note 10.1 General] _bambam:
to get rid of the first error, copy your <kernel-root>/.config to /boot/config-3.0.31

on the other hand if you are planing to boot ubuntu from an image-file located on the sdcard, it is possible that you need to change your comand line entry in the kernel config to something like:

root=/dev/loop0 looproot=/dev/mmcblk0p12:ubuntu.img ...
[Galaxy Note 10.1 General] exception13:
with FUSE you can use rw access but only with userspace daemon and it may be not fully stable like fs lkm and you can't boot from this fs.
[Galaxy Note 10.1 General] juvenile43:
Re: Debian GNU/Linux@N80XX

I cant believe this isnt getting more notice. Maybe should be in the dev section.
[Galaxy Note 10.1 General] diga1001:
May someone be so kind to help me with my final problems?

-I've read that I have to edit two files to make wifi work. I have already managed to open these files as root user so that i have write permission. but WHAT do I need to edit in the rc.locale? perhaps it helps to tell you that I live in Germany.

-How am I able to mount the tablet's filesystem including the sd cards? I always get an error that it is already mounted but i cant enter to it.

-Is it possible to make the .img file bigger? read something about resize2fs but it did not work for me

Thanks again for all the work to this project and to all who helped me solving my probs.
[Galaxy Note 10.1 General] quinman22:
sudo wifi-setup is the easiest way I've found to setup wifi. It does all the work, including asking for necessary passwords.

sudo mkdir /mnt/extSdCard (or some name you like)
sudo mount /dev/mmcblk1p1 /mnt/extSdCard
sudo mkdir /mnt/intSdCard (or something much cooler)
sudo mount /dev/mmcblk0p12 /mnt/intSdCard

The first two will setup external and the second two internal. Your internal SDcard will be through some folders though, I'm not sure which offhand, so you'll have to go exploring with ls and cd.

Nothing I've done has successfully resized the filesystem. Everytime I resize the image with dd and try resize2fs, I get a message that I must run the error checker, which then removes all the added space.
[Galaxy Note 10.1 General] diga1001:
I managed to mount the img file in my ubuntu and I was also able to copy the whole content to a new img file with the size of 4096 mb. The only error I got was that lost+found cant't be copied but that should not be important cuz it is for the filesystem. It even booted from this img but I am stuck at the login screen because autologin seems brocken. Any advice how to fix it?
[Galaxy Note 10.1 General] exception13:
you copy from superuser with preserve all attributes?
[Galaxy Note 10.1 General] diga1001:
No perhaps that was the mistake... I chowned all the folders and then copy and pasted them into the img...will try later to do it as root by leaving the attributes untouched
[Galaxy Note 10.1 General] exception13:
About power consumption. in work mode my note 10.1 consumes 5-10% per hour in sleep mode 1% per hour. What are your results?

result for 1 week

https://www.dropbox.com/s/rmpk0o4waqsdyfl/Снимок экрана от 2013-02-08 14:47:42.png

result for 6 hours

https://www.dropbox.com/s/1mt73sdwcvuf7tm/Снимок экрана от 2013-02-08 14:47:56.png

P.S. today/tomorow i make power consumption test with software decoded video playpack
[Galaxy Note 10.1 General] exception13:
power consumption with video playback (pure software decoding and rendering) ~10% per hour

https://www.dropbox.com/s/zgjg13mvof1o71g/Снимок экрана от 2013-02-09 23:40:07.png
[Galaxy Note 10.1 General] exception13:
i make small patch for Florence on-screen keyboard it's add haptic feedback (via vibrator) support. waiting for accept or reject this patch from Florence author.
[Galaxy Note 10.1 General] exception13:
hardkernel release exynos mali driver for Xorg. i'm backport mali_drm, mali and ump from odroid kernel to our n8000 kernel, make small hack to Xorg mali driver. it's start and provide EXA basic acceleration to Xorg but have trouble with EGL. work in progress.
[Galaxy Note 10.1 General] Bene2k11:
Im going to try this out soon, very nice work guys!
[Galaxy Note 10.1 General] exception13:
EPIC WIN!!!11 success run gnome-shell. EGL now work.
[Galaxy Note 10.1 General] driekus33:
I would love to see this put together into a guide. I am personally not too fussed if it is Ubuntu, Debian or Arch.

Exception13 : There is some great work here
[Galaxy Note 10.1 General] X-Stranger:
I'm going to prepare new image with EGL enabled as soon as me and exception13 get this working more or less stable. However yes, 270 FPS we've already seen.
[Galaxy Note 10.1 General] JSale:
I don't mean to sound stupid, but would this work with zorin too?

Regards

Jack
[Galaxy Note 10.1 General] exception13:
zorin-os? it's have armhf port?
[Galaxy Note 10.1 General] thermatk:
A Debian or Ubuntu image? I do believe that in repos of wheezy some packets are too old for this fast changing world :)

That would be great to have Gnome Shell! I'd love to see the image and a guide, if I can help with anything... :confused:
[Galaxy Note 10.1 General] JSale:
Zorin-os and I'm not sure, how do I check?

Regards

Jack