X-Git-Url: http://git.steven-mcdonald.id.au/?p=www.git;a=blobdiff_plain;f=tutorials%2Fdebian_on_samsung_galaxy.shtml;h=8cf176c72be542ae80d279b39deb0bee09d2c09c;hp=746530c44aeff7b10666ef6fdd85ce74c210c1f5;hb=e722002673f3438ca78dd41bfb8c3e12ff9a178b;hpb=99edfbfb5066c5c283ede2b0b09ab5e39e1402aa 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.
$ 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.
+$ tar xzOf data.tar.gz ./usr/bin/cdebootstrap-static | ssh root@$PHONE 'cat >/data/local/bin/cdebootstrap'
+
++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. +
+ ++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. +
+ ++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. ;)