← Back to team overview

ubuntu-phone team mailing list archive

Running a Debian chroot on Ubuntu Phone, was: Re: MUA mutt

 

Hi

On Fri 17-Apr-2015 at 09:24:53AM -0400, Rodney Dawes wrote:
> 
> It is better instead, to create a chroot of Ubuntu in the home directory
> on the phone, and then install whatever console tools one thinks they
> need to run a phone, in that chroot. Please suggest that instead of
> making the root fs writable, as the latter will very quickly result in a
> filled root partition, and depending on what gets installed, may cause
> other issues in the system (which is of course, why it is unsupported),
> for people who think they need to install such packages. :)

I tried this (but with Debian) and got stuck, I'd love to get it working
but I'll probably need some help... this is what I have done so far:

Create a disk:

  fallocate -l 1.5G /home/debian.img
  mkfs.ext4 debian.img

Mount it:

  mkdir /home/debian
  chmod 700 /home/debian
  mount -o remount,exec,dev,suid /home/debian.img /home/debian

Basic system install (note the /debootstrap directory had to be copied
from another computer for some reason):

  apt-get install debian-archive-keyring
  export MY_CHROOT=/home/debian
  debootstrap --arch=armhf --variant=minbase wheezy $MY_CHROOT http://http.debian.net/debian
  for f in dev dev/pts proc sys ; do mount -o bind /$f $MY_CHROOT/$f ; done
  chroot $MY_CHROOT /bin/bash -l
  debootstrap/debootstrap --second-stage

Then I have this script to mount and chroot:

  #!/bin/bash
  
  export ROOT=/home/debian
  export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
  export HOME=/root
  mount /home/debian.img /home/debian
  mount -o remount,rw,exec,dev,suid /home/debian.img /home/debian
  for f in dev dev/pts proc sys ; do mount -o bind /$f $ROOT/$f ; done
  chroot $ROOT /bin/bash -l

But the last command fails if I run it on the phone, with the following
(but it works if I ssh in):

  chroot: failed to run command '/bin/bash': Permission denied

Any hints would be appreciated.

All the best

Chris


-- 
Webarchitects Co-operative
http://webarchitects.coop/
+44 114 276 9709
@webarchcoop


Follow ups

References