X-Stranger

Senior Member
Sep 2, 2008
163
203
0
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:
Code:
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:
Code:
# 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.
 

X-Stranger

Senior Member
Sep 2, 2008
163
203
0
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)
 

Attachments

  • Like
Reactions: j dee

X-Stranger

Senior Member
Sep 2, 2008
163
203
0
It will be great if you upload this kernel. I've got troubles with making it.
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.
 

Attachments

X-Stranger

Senior Member
Sep 2, 2008
163
203
0
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!
 

Attachments

vanquss

Member
Nov 14, 2012
8
0
0
THX!

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!
Huge thanks to you and exception13 :)
 

X-Stranger

Senior Member
Sep 2, 2008
163
203
0
Is there a way to make battery indicator to show current battery level?
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).

Huge thanks to you and exception13 :)
Don't forget to press "Thanks" button for me and exception13 if you really like it :)
 

quinman22

Senior Member
Mar 1, 2010
63
16
0
Posting the links to ArchLinux and Recovery images as promised:
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.
 
Last edited:

quinman22

Senior Member
Mar 1, 2010
63
16
0
Can you please try to power off your tablet, then try to boot into recovery holding appropriate buttons? Please let me know the result
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.
 

X-Stranger

Senior Member
Sep 2, 2008
163
203
0
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?
 
  • Like
Reactions: damz37

juvenile43

Senior Member
Jan 8, 2009
187
23
48
Bay City, MI
Re: Debian GNU/[email protected]

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

Sent from my SAMSUNG-SGH-I317 using xda premium

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

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

Sent from my SAMSUNG-SGH-I317 using xda premium
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?
 

quinman22

Senior Member
Mar 1, 2010
63
16
0
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?
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?
 

juvenile43

Senior Member
Jan 8, 2009
187
23
48
Bay City, MI
Re: Debian GNU/[email protected]

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.
Sent from my SAMSUNG-SGH-I317 using xda premium
 

quinman22

Senior Member
Mar 1, 2010
63
16
0
Re: Debian GNU/[email protected]

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.
Sent from my GT-N8013 using xda app-developers app
 
Last edited:

quinman22

Senior Member
Mar 1, 2010
63
16
0
Re: Debian GNU/[email protected]

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

Sent from my GT-N8013 using xda app-developers app
 
Last edited:

juvenile43

Senior Member
Jan 8, 2009
187
23
48
Bay City, MI
Re: Debian GNU/[email protected]

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.

Sent from my SAMSUNG-SGH-I317 using xda premium
 

quinman22

Senior Member
Mar 1, 2010
63
16
0
Re: Debian GNU/[email protected]

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.

Sent from my GT-N8013 using xda app-developers app