Jump to content











Photo

Run Debian or Ubuntu GNU/Linux on Android

sdcard booting nexus 10 debian android 4.4 init initramfs microusb switch_root busybox

  • Please log in to reply
6 replies to this topic

#1 Marietto

Marietto

    Frequent Member

  • Advanced user
  • 267 posts
  • Location:Italy
  • Interests:Computers,movies,read/write,talking about philosophy and religion.
  •  
    Italy

Posted 03 February 2015 - 06:13 PM

I'm trying to install Debian on the Android 4.4 (modded with cyanogenmod) that's installed on my nexus 10 to one external sd card. I'm reading this tutorial :
 
http://whiteboard.pi.../Android/Debian
 
I've attached the Leef microSD microUSB Connector with a 64GB sd card inside to the mini usb port of my nexus 10 as you can see here :
 
kem7a.jpg
 
The tutorial talks about the The ASUS Transformer TF101 and the instructions are based on this tablet. Instead I have a tablet nexus 10,that's equipped with an internal sd card where I have installed android 4.4 + cyanogenmod. For this reason I need to know how to change some part of the tutorial to adapt it to my situation. Anyway on my desktop computer I have partitioned the sd card in this way :

Disk /dev/sdf: 64.0 GB, 64021856256 bytes
255 heads, 63 sectors/track, 7783 cylinders, total 125042688 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004504c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1            2048    32767999    16382976    b  W95 FAT32
/dev/sdf2        32768000   125042687    46137344   83  Linux

My nexus 10 recognizes the sd card as sda2. According with the tutorial I have issued the following commands,but something did not work :

mount -o rw,remount / 
mkdir /mnt/deb
mount -t ext4 /dev/block/sda2 /mnt/deb
/mnt/deb/busybox sh
/mnt/deb/busybox mount -t proc none /mnt/deb/proc
/mnt/deb/busybox mount -t sysfs none /mnt/deb/sys
/mnt/deb/busybox mount -t tmpfs none /mnt/deb/dev
/mnt/deb/busybox mdev -s
exec /mnt/deb/busybox switch_root /mnt/deb /init


BusyBox v1.21.1 (2013-07-08 10:07:37 CDT) multi-call binary.

Usage: switch_root [-c /dev/console] NEW_ROOT NEW_INIT [ARGS]

Free initramfs and switch to another root fs:
chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /,
execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint.

        -c DEV  Reopen stdio to DEV after switch

where is the error ?


  • Nuno Brito likes this

#2 Zoso

Zoso

    Silver Member

  • Advanced user
  • 640 posts
  •  
    Isle of Man

Posted 03 February 2015 - 06:46 PM

hi Marietto,

sorry that I can not be of much help but this looks very interesting so I want to say thanks for the link & info.

why using usb adaptor? does your device have an sdcard slot? did you check:

Common mistakes

Make sure you set execute permissions for busybox, init scripts etc.
Make sure all mount points are there.
Make sure /dev is a mount point and not populated with device nodes.


also mentions custom mkbootimg on at least one device. this is where I ran into problems trying to get a dualboot setup on my rockchip device. the bootloader was encrypted and I could not find a way to unencrypt it.


hope that can help in some way, please keep us updated on your progress.

#3 Marietto

Marietto

    Frequent Member

  • Advanced user
  • 267 posts
  • Location:Italy
  • Interests:Computers,movies,read/write,talking about philosophy and religion.
  •  
    Italy

Posted 03 February 2015 - 07:33 PM

the nexus 10 has only one internal sd card that can't be upgraded or changed. I don't want to make modifications on the android that's installed there. Instead I want to install debian on the external sd card as host os and android as guest os inside the chroot. the tutorial explains how to do this with the ASUS Transformer TF101. If I want to do the same with the nexus 10 I need to modify the tutorial instructions. I saw that when I give the command "/mnt/deb/busybox mdev -s",the folder /mnt/deb/dev does not populate. As the tutorial explains,I have to use the busybox executable provided by the author of the tutorial,because the one installed on the tablet has not been compiled with mdev.



#4 Zoso

Zoso

    Silver Member

  • Advanced user
  • 640 posts
  •  
    Isle of Man

Posted 04 February 2015 - 03:06 AM

seems like you are close.

NEW_ROOT must be a mountpoint.


think this is problem. dont know how to remap mountpoint but that is probably what you neeed to do. yours might be more complicated because using USB for this instead of ext.SD but cant say for certain.


I read in full the tutorial and I want to try this too and I also run cyanogenmod but I have minimal experience with linux and this would take me alot of time so I think I cant try this anytime soon.

first thing that comes to mind in your case is the partition layout. did you have to change that when you installed cyanogen? ifso then there is where you need to make some changes I think.


good luck, keep us updated!

#5 slothman

slothman

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 04 February 2015 - 07:03 AM

Wow that tutorial looks unnecessarily complicated.

 

You used to have to do that kinda stuff for linux on android in the past, but no longer.

 

I used the app linux deploy from the play store and it does everything for you (almost).

 

I just had to configure some settings, it sets it up, and everything works very well after that.

 

You just need to setup the sdcard so cyanogen can access it properly.



#6 Marietto

Marietto

    Frequent Member

  • Advanced user
  • 267 posts
  • Location:Italy
  • Interests:Computers,movies,read/write,talking about philosophy and religion.
  •  
    Italy

Posted 04 February 2015 - 08:25 AM

"linux deploy" installs ubuntu inside chroot. the tutorial explains how to install debian as primary os and android inside the chroot. It does the inverse operation. This is more interesting since I think that linux is a safer and robust os than android.



#7 slothman

slothman

    Newbie

  • Members
  • 26 posts
  •  
    United States

Posted 06 February 2015 - 11:16 PM

Sorry, i saw the topic and assumed you were trying to use an old way to run Linux on android.

I still feel that Linux on android is a better way to go, though.

Both Android and Linux have the exact same kernel, just the rest of the system is different.

With selinux and AppOps, you can be very secure on android.

You can also compile kernel modules that add tons of functionality to android.

Sane and cups can be run directly on Android which allow you to scan or print on any supported device.

Edited by slothman, 06 February 2015 - 11:18 PM.






Also tagged with one or more of these keywords: sdcard booting, nexus 10, debian, android 4.4, init, initramfs, microusb, switch_root, busybox

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users