├── INSTALL ├── README ├── debootstrap ├── .gitignore ├── Makefile ├── README ├── TODO ├── arch ├── base ├── debian │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── debootstrap.docs │ ├── debootstrap.manpages │ └── rules ├── debootstrap ├── debootstrap.8 ├── debootstrap.log ├── functions ├── pkgdetails ├── required ├── scripts │ ├── breezy │ ├── dapper │ ├── edgy │ ├── etch │ ├── etch-m68k │ ├── feisty │ ├── gutsy │ ├── hardy │ ├── hoary │ ├── hoary.buildd │ ├── intrepid │ ├── jaunty │ ├── karmic │ ├── lenny │ ├── lucid │ ├── maverick │ ├── natty │ ├── potato │ ├── sarge │ ├── sarge.buildd │ ├── sarge.fakechroot │ ├── sid │ ├── squeeze │ ├── stable │ ├── testing │ ├── unstable │ ├── warty │ ├── warty.buildd │ ├── wheezy │ ├── woody │ └── woody.buildd └── suite ├── etc └── init.android │ ├── E10.Linux │ ├── E10.android │ ├── E10.network │ ├── E10.tmpdir │ ├── E30.services │ ├── L75.services │ ├── L95.Linux │ ├── L95.android │ ├── L95.tmpdir │ ├── rc.conf │ ├── rc.enter │ ├── rc.leave │ └── rc.lib ├── install.sh ├── linuxchroot.sh ├── notes ├── pkgdetails.armel ├── pkgdetails.c └── usr └── local └── etc └── init.android ├── rc.conf ├── rc.enter └── rc.leave /INSTALL: -------------------------------------------------------------------------------- 1 | 2 | 0. Choose where to store your chroot. The default is /data/local/Linux, and should work fine for HC+ tablets. 3 | 4 | 1. Execute ./install.sh and follow the prompts. 5 | 6 | If LINUX_CHROOT=./ and you are using a git clone, then it is reccomended that you create a device local branch after installation is complete. For example: 7 | 8 | busybox sh ./install.sh 9 | ./linuxchroot.sh 10 | apt-get install git 11 | cd / 12 | git stash save # if you have any local changes 13 | git checkout -b `hostname`.`git branch | grep '*' | cut -d' ' -f 2` 14 | git stash pop # if you have any local changes 15 | git commit -a # if you have any local changes 16 | 17 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This is a set of scripts designed for using a Linux chroot on Android. 2 | 3 | ## ROAD MAP ## 4 | 5 | install.sh 6 | : installs a Linux chroot on your Android device. See INSTALL file. 7 | 8 | linuxchroot.sh 9 | : chroot's you 10 | 11 | etc/init.android/rc.enter 12 | : Base system script ran when entering the chroot. 13 | 14 | usr/local/etc/init.android/rc.enter 15 | : Local system script ran when entering the chroot. 16 | 17 | etc/init.android/rc.leave 18 | : Base system script ran when leaving the chroot. 19 | 20 | usr/local/etc/init.android/rc.leave 21 | : Local system script ran when leaving the chroot. 22 | 23 | etc/init.android/rc.conf 24 | : Base system configuration file. 25 | 26 | usr/local/etc/init.android/rc.conf 27 | : Local system configuration, overrides anything in etc/init.android/rc.conf. 28 | 29 | ## INIT SYSTEM ## 30 | 31 | The init system is simple, look at the end of linuxchroot.sh! 32 | 33 | - Scripts with filenames matching E* will be run on order before entering the chroot. 34 | - Scripts with filenames matching L* will be run in order when the chrooted shell exits and returns control back to linuxchroot.sh. 35 | 36 | Place scripts for your local system in ${LINUX_CHROOT}/usr/local/etc/init.android. 37 | 38 | If it applies to just about every Android device: place it in ${LINUX_CHROOT}/etc/init.android, commit it, push to GitHub, and send me a pull request explaining the changes. 39 | 40 | 41 | The execution order is as follows: 42 | 43 | linuxchroot.sh -> 44 | etc/init.android/rc.enter -> 45 | etc/init.android/E* 46 | usr/local/etc/init.android/rc.enter -> 47 | usr/local/etc/init.android/E* 48 | chroot $LINUX_CHROOT /bin/login -f root -> 49 | Your initial shell. 50 | etc/init.android/rc.leave -> 51 | etc/init.android/L* 52 | usr/local/etc/init.android/rc.leave -> 53 | usr/local/etc/init.android/L* 54 | 55 | 56 | These scripts are executed after changing directory to the LINUX_CHROOT, but not within it. 57 | -------------------------------------------------------------------------------- /debootstrap/.gitignore: -------------------------------------------------------------------------------- 1 | debootstrap/debootstrap.log 2 | -------------------------------------------------------------------------------- /debootstrap/Makefile: -------------------------------------------------------------------------------- 1 | # avoid dpkg-dev dependency; fish out the version with sed 2 | VERSION := $(shell sed 's/.*(\(.*\)).*/\1/; q' debian/changelog) 3 | 4 | MAKEDEV := /sbin/MAKEDEV 5 | 6 | all: devices.tar.gz 7 | clean: 8 | rm -f devices.tar.gz 9 | rm -rf dev 10 | 11 | DSDIR=$(DESTDIR)/usr/share/debootstrap 12 | install: 13 | mkdir -p $(DSDIR)/scripts 14 | mkdir -p $(DESTDIR)/usr/sbin 15 | 16 | cp -a scripts/* $(DSDIR)/scripts/ 17 | install -o root -g root -m 0644 functions $(DSDIR)/ 18 | 19 | sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)/usr/sbin/debootstrap 20 | chown root:root $(DESTDIR)/usr/sbin/debootstrap 21 | chmod 0755 $(DESTDIR)/usr/sbin/debootstrap 22 | 23 | install -o root -g root -m 0644 devices.tar.gz $(DSDIR)/ 24 | 25 | devices.tar.gz: 26 | rm -rf dev 27 | mkdir -p dev 28 | chown 0:0 dev 29 | chmod 755 dev 30 | (cd dev && $(MAKEDEV) std ptmx fd consoleonly) 31 | tar cf - dev | gzip -9 >devices.tar.gz 32 | @if [ "$$(tar tvf devices.tar.gz | wc -l)" -lt 2 ]; then \ 33 | echo " ** devices.tar.gz is empty!" >&2; \ 34 | exit 1; \ 35 | fi 36 | rm -rf dev 37 | -------------------------------------------------------------------------------- /debootstrap/README: -------------------------------------------------------------------------------- 1 | README for debootstrap 2 | ====================== 3 | 4 | See the manpage for (some) documentation. 5 | 6 | Running debootstrap from source 7 | ------------------------------- 8 | 9 | You can run debootstrap from its source tree without installing it. This 10 | can be useful if you want a quick way to make a Debian chroot on another 11 | system, or if you are testing modifications to debootstrap. 12 | 13 | First, get the source. 14 | 15 | * Either by using subversion: 16 | svn checkout svn://svn.debian.org/d-i/trunk/packages/debootstrap 17 | 18 | * Or by visiting 19 | and downloading the tar.gz file 20 | 21 | Then as root, in the debootstrap source directory: 22 | 23 | make devices.tar.gz 24 | export DEBOOTSTRAP_DIR=`pwd` 25 | debootstrap sid sid 26 | 27 | 28 | Future 29 | ------ 30 | 31 | * Cross-strap support - so you can bootstrap a filesystem to the 32 | point where it will successfully boot, and finish installing itself 33 | without having to be running the target architecture or OS yourself. 34 | This means you should be able to run 35 | 36 | debootstrap --arch powerpc sarge ./sarge-ppc-chroot ... 37 | 38 | on an i386 system, boot a powerpc box with sarge-ppc-chroot as its 39 | root files system, and have it "work". The cross-hurd package does 40 | something similar, and should be replaced by this feature. 41 | 42 | * There should be some (better) way of telling debootstrap what "base" 43 | packages you want to install -- this varies between making a chroot, 44 | doing an install, and doing a buildd. Also, some installs want 45 | different base packages (to setup networking, or kernels, eg) 46 | 47 | 48 | NMUing 49 | ------ 50 | 51 | If there's a problem with debootstrap that you need fixed, feel free to do 52 | an NMU to fix it. Usual rules: try not to break anything, and mail the 53 | patch to the BTS. Don't worry about asking first though. 54 | 55 | However, note that debootstrap is now team maintained. Anyone in d-i can do 56 | a release without the bother of a NMU. 57 | -------------------------------------------------------------------------------- /debootstrap/TODO: -------------------------------------------------------------------------------- 1 | 2 | Features: 3 | ++ second stage via chroot debootstrap/debootstrap 4 | ++ debootstrap/deb file to record deb destinations/information 5 | 6 | -- configuration file 7 | -- versus command line 8 | -- support for sources (vs mirrors) 9 | -- faux-pinning for packages 10 | 11 | ++ merge variants into single script (optionally anyway) 12 | ++ makedev in second stage 13 | ++ awk/perl pkgdetails 14 | ++ granular dpkg progress bar 15 | ++ determine required/base dynamically 16 | ++ store required/base in $T/debootstrap for two-stage installs 17 | 18 | Packages format: 19 | std: Priority: required + Priority: important 20 | buildd: Priority: required + Build-Essential: yes 21 | -------------------------------------------------------------------------------- /debootstrap/arch: -------------------------------------------------------------------------------- 1 | armel 2 | -------------------------------------------------------------------------------- /debootstrap/base: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /debootstrap/debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /debootstrap/debian/control: -------------------------------------------------------------------------------- 1 | Source: debootstrap 2 | Section: admin 3 | Priority: extra 4 | Maintainer: Debian Install System Team 5 | Uploaders: Anthony Towns , Joey Hess , Frans Pop , Junichi Uekawa , Colin Watson 6 | Build-Depends: debhelper (>= 7.0.50), makedev (>= 2.3.1-69) 7 | Standards-Version: 3.9.1 8 | Vcs-Svn: svn://svn.debian.org/d-i/trunk/packages/debootstrap 9 | 10 | Package: debootstrap 11 | Architecture: all 12 | Depends: ${misc:Depends}, wget 13 | Recommends: gnupg 14 | Description: Bootstrap a basic Debian system 15 | debootstrap is used to create a Debian base system from scratch, 16 | without requiring the availability of dpkg or apt. It does this by 17 | downloading .deb files from a mirror site, and carefully unpacking them 18 | into a directory which can eventually be chrooted into. 19 | 20 | Package: debootstrap-udeb 21 | Section: debian-installer 22 | XC-Package-Type: udeb 23 | Architecture: all 24 | Depends: ${misc:Depends}, mounted-partitions 25 | Description: Bootstrap the Debian system 26 | -------------------------------------------------------------------------------- /debootstrap/debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Anthony Towns on 2 | Tue, 30 Jan 2001 10:54:45 +1000. 3 | 4 | It was written from scratch for Debian by Anthony Towns 5 | based loosely on the code for constructing base tarballs as part of the 6 | boot-floppies package. 7 | 8 | The upstream site is http://code.erisian.com.au/Wiki/debootstrap . 9 | 10 | Copyright: 11 | 12 | Copyright (c) 2001-2005 Anthony Towns 13 | 14 | Permission is hereby granted, free of charge, to any person obtaining 15 | a copy of this software and associated documentation files (the 16 | "Software"), to deal in the Software without restriction, including 17 | without limitation the rights to use, copy, modify, merge, publish, 18 | distribute, sublicense, and/or sell copies of the Software, and to 19 | permit persons to whom the Software is furnished to do so, subject to 20 | the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be 23 | included in all copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 26 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 27 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 28 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 29 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 30 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 31 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 32 | 33 | -------------------------------------------------------------------------------- /debootstrap/debian/debootstrap.docs: -------------------------------------------------------------------------------- 1 | README 2 | -------------------------------------------------------------------------------- /debootstrap/debian/debootstrap.manpages: -------------------------------------------------------------------------------- 1 | debootstrap.8 2 | -------------------------------------------------------------------------------- /debootstrap/debian/rules: -------------------------------------------------------------------------------- 1 | #! /usr/bin/make -f 2 | 3 | %: 4 | dh $@ 5 | 6 | # need to be root to make devices, so build is done in install target 7 | override_dh_auto_build: 8 | 9 | override_dh_auto_install: 10 | dh_auto_build 11 | 12 | $(MAKE) install DESTDIR=$(CURDIR)/debian/debootstrap 13 | $(MAKE) install DESTDIR=$(CURDIR)/debian/debootstrap-udeb 14 | 15 | # remove scripts not needed by d-i 16 | -rm -f debian/debootstrap-udeb/usr/share/debootstrap/scripts/potato \ 17 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/woody \ 18 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/sarge \ 19 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/warty \ 20 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/hoary \ 21 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/breezy \ 22 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/dapper \ 23 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/edgy \ 24 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/feisty \ 25 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/*.buildd \ 26 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/*.fakechroot \ 27 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/stable \ 28 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/testing \ 29 | debian/debootstrap-udeb/usr/share/debootstrap/scripts/unstable 30 | -------------------------------------------------------------------------------- /debootstrap/debootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | VERSION='@VERSION@' 4 | 5 | unset TMP TEMP TMPDIR || true 6 | 7 | # might not be exported if we're running from init=/bin/sh or similar 8 | export PATH 9 | 10 | ########################################################################### 11 | 12 | if [ -z "$DEBOOTSTRAP_DIR" ]; then 13 | if [ -x /debootstrap/debootstrap ]; then 14 | DEBOOTSTRAP_DIR=/debootstrap 15 | else 16 | DEBOOTSTRAP_DIR=/usr/share/debootstrap 17 | fi 18 | fi 19 | 20 | DEVICES_TARGZ=$DEBOOTSTRAP_DIR/devices.tar.gz 21 | 22 | . $DEBOOTSTRAP_DIR/functions 23 | exec 4>&1 24 | 25 | LANG=C 26 | USE_COMPONENTS=main 27 | KEYRING="" 28 | VARIANT="" 29 | 30 | DEF_MIRROR="http://ftp.us.debian.org/debian" 31 | 32 | export LANG USE_COMPONENTS 33 | umask 022 34 | 35 | ########################################################################### 36 | 37 | ## phases: 38 | ## finddebs dldebs printdebs first_stage second_stage 39 | 40 | RESOLVE_DEPS=true 41 | 42 | WHAT_TO_DO="finddebs dldebs first_stage second_stage" 43 | am_doing_phase () { 44 | # usage: if am_doing_phase finddebs; then ...; fi 45 | local x; 46 | for x in "$@"; do 47 | if echo " $WHAT_TO_DO " | grep -q " $x "; then return 0; fi 48 | done 49 | return 1 50 | } 51 | 52 | ########################################################################### 53 | 54 | usage_err() 55 | { 56 | info USAGE1 "usage: [OPTION]... [ [