From e722002673f3438ca78dd41bfb8c3e12ff9a178b Mon Sep 17 00:00:00 2001 From: Steven McDonald Date: Fri, 25 Nov 2011 21:34:54 +1100 Subject: [PATCH] write moar --- tutorials/debian_on_samsung_galaxy.shtml | 112 ++++++++++++++++++++++- 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/tutorials/debian_on_samsung_galaxy.shtml b/tutorials/debian_on_samsung_galaxy.shtml index 746530c..8cf176c 100644 --- a/tutorials/debian_on_samsung_galaxy.shtml +++ b/tutorials/debian_on_samsung_galaxy.shtml @@ -43,6 +43,12 @@ You have an Android smartphone with access to a root shell via SSH. I run II, but any Android system with root SSH access will do.
  • +You have a reasonably fast and high-capacity Internet connection +available on your Android phone. I will not be held responsible for any +excess usage charges you incur on your mobile Internet package while +downloading Debian onto your phone. ;) +
  • +
  • You have a basic understanding of Debian and its packaging system. This procedure does require manual invocation of dpkg if you run into problems -- if you don't know what dpkg is or how to use it, @@ -90,10 +96,19 @@ extract it on the phone. I'm going to put it into $ mkdir /tmp/cdebootstrap && cd /tmp/cdebootstrap
    $ ar x /path/to/cdebootstrap-static_0.5.8+b1_armhf.deb data.tar.gz
    -$ tar xzOf data.tar.gz ./usr/lib/cdebootstrap/cdebootstrap_0.5.8+b1_armhf.tar.gz | ssh root@$PHONE 'tar xz -C /data/local/bin/' +$ tar xzOf data.tar.gz ./usr/lib/cdebootstrap/cdebootstrap_0.5.8+b1_armhf.tar.gz | ssh root@$PHONE 'tar xzC /data/local/bin/'
    Obviously, replace $PHONE with the hostname of your phone.
  • +
  • +Unfortunately, the version of cdebootstrap included in the +tarball appears to segfault on Android systems. I don't know why this +happens, but replacing it with the binary provided in the package seems +to fix this issue: + +$ tar xzOf data.tar.gz ./usr/bin/cdebootstrap-static | ssh root@$PHONE 'cat >/data/local/bin/cdebootstrap' + +
  • Bootstrapping the Debian system

    @@ -133,7 +148,102 @@ So, ssh to your phone, and run the following commands:

    +One last thing you need to do before setting up Debian: +cdebootstrap expects the system shell to be at /bin/sh +and fails without telling you why if it isn't. Since Android's system +shell is /system/bin/sh, you have to appease +cdebootstrap like so: +

    + + +# mkdir /bin && ln -s /system/bin/sh /bin/sh + + +

    +Now comes the fun bit, where we actually set up a Debian system. Still on +your phone, run cdebootstrap to set up a file system tree in +/debian. You may want to tweak the options below; I'm using +ftp.debian-ports.org as my mirror because (at the time of +writing) the armhf architecture is not yet fully integrated into the +official archive. If you're using armel, or if you happen to live in the +future, you can use your normal Debian mirror for this. Obviously, feel +free to replace unstable with whichever suite you want to +install. +

    + + +# cdebootstrap --allow-unauthenticated -c/data/local/bin/cdebootstrap-support/ unstable /debian http://ftp.debian-ports.org/debian/ + + +

    +We have to use --allow-unauthenticated because gpgv +isn't available to authenticate signatures on Android. This command can +take a while to complete, so go and have a coffee or something while you +wait for Debian to download and install. +

    + +

    Fixing broken packages

    + +

    +It was the case for me that some packages failed to install from +cdebootstrap. Fortunately, it had at least progressed to the +point where a shell and dpkg were installed and usable in the +chroot, so now we can leave cdebootstrap behind and work in +Debian: +

    + + +# chroot /debian /bin/bash
    +# cd /var/cache/bootstrap
    +# dpkg -i *.deb +
    + +

    +At this point, dpkg may run into some problems. As the package +archive changes over time and different people install different suites, +your problems will very likely not be the same as mine, so here's where +your familiarity with the Debian package tools comes in. ;) +

    + +

    +The main issue I ran into here was circular dependencies. These can be +fixed by the use of the --force-depends option to dpkg, +to allow it to install and configure one of the packages in the +dependency loop, so that you can then install the others normally. For +example, I found that libc6 depends on libgcc1, which +pre-depends on multiarch-support, which depends on +libc6. After running: +

    + + +# dpkg --force-depends --configure multiarch-support + +

    +this circular dependency was no longer a problem, although there were +other remaining circular dependencies that could be fixed in a similar +way. +

    + +

    Installing a standard Debian package set

    + +

    +cdebootstrap will only install packages with a priority of +required or important. While this will give you a +powerful Unix-like base system, it doesn't include many utilities that +you would get with a standard Debian system. Once all of your package +dependency issues have been resolved, and everything in +/var/cache/bootstrap/ is installed, you can use +aptitude to install a standard Debian system: +

    + + +# aptitude install '~prequired|~pimportant|~pstandard' + + +

    +What you choose to install beyond this depends on your wants and needs, +and how you like your Debian. ;)

    -- 2.30.2