Example bootstrap to get minimal set of packages for build-essential:
This example worked on quantal
Get the set of binary packages:
sudo sbuild-createchroot --components=main,universe quantal /srv/chroots/quantal http://archive.ubuntu.com/ubuntu/
then grep ".deb" /srv/chroot/quantal-cross/var/log/bootstrap.log | grep Unpacking | awk '{print $2}' to get list of binary packages
Which is:
base-files base-passwd libc6 perl-base mawk adduser bash bsdutils busybox-initramfs coreutils cpio dash debconf debianutils diffutils e2fslibs e2fsprogs findutils gcc-4.7-base grep gzip hostname ifupdown initramfs-tools initramfs-tools-bin initscripts insserv iproute klibc-utils libacl1 libattr1 libblkid1 libbz2-1.0 libc-bin libcomerr2 libdb5.1 libdbus-1-3 libdrm-intel1 libdrm-nouveau1a libdrm-radeon1 libdrm2 libffi6 libgcc1 libglib2.0-0 libklibc libkms1 liblzma5 libmount1 libncurses5 libncursesw5 libnih-dbus1 libnih1 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpciaccess0 libpcre3 libplymouth2 libpng12-0 libprocps0 libselinux1 libslang2 libss2 libssl1.0.0 libtinfo5 libudev0 libuuid1 locales login lsb-base makedev module-init-tools mount mountall multiarch-support ncurses-base ncurses-bin passwd plymouth procps python-minimal python2.7-minimal sed sensible-utils sysv-rc sysvinit-utils tar tzdata udev upstart util-linux zlib1g apt binutils build-essential bzip2 cpp cpp-4.7 dpkg-dev fakeroot g++ g++-4.7 gcc gcc-4.7 gnupg gpgv libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libapt-pkg4.12:amd64 libc-dev-bin libc6-dev libclass-isa-perl libdpkg-perl libfile-fcntllock-perl libgc1c2 libgdbm3 libgmp10 libgomp1 libitm1 libmpc2 libmpfr4 libquadmath0 libreadline6 libstdc++6 libstdc++6-4.7-dev libswitch-perl libtimedate-perl libusb-0.1-4 linux-libc-dev make manpages manpages-dev netbase patch perl perl-modules readline-common ubuntu-keyring xz-utils debfoster
debfoster is something sbuild puts in which you don't really need, but do need debhelper for any practical work.
The set of source packages that generate these binaries is generated with:
here=`pwd` usage() { echo "usage: $@ <inputfile> <outputfile>" echo "inputfile contains a list of packages, binaries, or source" echo "output file will contain a sorted, de-duped list of corresponding source packages" exit 1 } if [ -z "$1" ] || [ -z "$2" ]; then usage; fi rm -f $2 for package in `cat $1` do sourcepackage=`grep-aptavail -X -FSource -FPackage $package -s Source:Package | awk '{ print $2 }' | sort | uniq` if [ -z "${sourcepackage}" ]; then echo "No source found for $package"; else echo ${sourcepackage} >> $2 fi done
save that as /usr/local/bin/listsources (this isn't at all efficient, in fact it's damn slow, but it does work
then do listsources packages.list sources.list; cat sources.list | sort | uniq on above to get:
acl adduser apt attr base-files base-passwd bash binutils build-essential busybox bzip2 coreutils cpio dash db dbus debconf debfoster debianutils diffutils dpkg e2fsprogs eglibc fakeroot findutils gcc-4.7 gcc-defaults gdbm glib2.0 gmp gnupg grep gzip hostname ifupdown initramfs-tools insserv iproute klibc langpack-locales libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libclass-isa-perl libdrm libffi libfile-fcntllock-perl libgc libnih libpciaccess libpng libselinux libswitch-perl libtimedate-perl libusb linux lsb makedev make-dfsg manpages mawk module-init-tools mountall mpclib mpfr4 ncurses netbase openssl pam patch pcre3 perl plymouth procps python2.7 python-defaults readline6 sed sensible-utils shadow slang2 sysvinit tar tzdata ubuntu-keyring udev upstart util-linux xz-utils zlib
Get a cross-toolchain and start building things:
Run dose-builddebcheck to get a list of things that are buildable without any extra build-dependencies: attr base-files base-passwd busybox bzip2 cpio dash debconf debianutils diffutils findutils gdbm gmp hostname ifupdown insserv langpack-locales libalgorithm-diff-perl libalgorithm-merge-perl libclass-isa-perl libffi libsepol libswitch-perl libtimedate-perl libusb make-dfsg makedev manpages mawk module-init-tools netbase pcre3 python-defaults sensible-utils tar tzdata ubuntu-keyring zlib
Then start building.
attr OK pcre3 OK