Initial Debian/Ubuntu arm64 bootstrap
This page is now largely of historical interest. The current state of the port is documented on Arm64Port.
The initial port was done entirely as cross-build using Ubuntu raring packages as multiarch and the cross-toolchains were more advanced there than in Debian. The resulting image and updates were then used to natively build most of saucy once real hardware that worked was available. Then that image was used (in Qemu) to natively build a Debian buildd image.
Raring rootfs for Foundation model
Here is an older (512MB) basic configured image to download for use in the model (or on real hardware should you have some).
You will need the ARM Foundation Model to run it on which is proprietary, but cost-free, and available from http://www.arm.com/products/tools/models/fast-models/foundation-model.php (you will need to get an account).
Download that and unpack it (it will make a dir called Foundation_v8pkg).
All the other files you needs are available here
Get the arm64 disk image (last updated 2013-03-12 16:30):
wget http://people.debian.org/~wookey/bootstrap/rootfs/raring.img.gz gunzip raring.img.gz
Now has networking, apt, build-essential and debhelper and thus can be used for native building.
Alternatively you can use the Ubuntu Core base system tarball built from Ubuntu 13.10's binaries (Ubuntu builds arm64 as of 13.10).
Get the kernel+bootwrapper:
This is a kernel and also contains the kernel command line. There are two, linux-system-foundation.axf, which runs init=/bin/sh, and linux-system-foundation-upstart-verbose.axf which runs init=upstart --verbose
wget http://people.debian.org/~wookey/bootstrap/rootfs/linux-system-foundation.axf wget http://people.debian.org/~wookey/bootstrap/rootfs/linux-system-foundation-upstart-verbose.axf
Now you can run the model/image with:
Foundation_v8pkg/Foundation_v8 --image linux-system-foundation-upstart-verbose.axf --block-device raring.img --network=nat
That's it. It uses 2G of memory, and on my machine takes about 35 seconds to show the 'serial console' window, then another 1.5 mins or so to boot to a prompt, with a long pause whilst it mounts, displaying nothing new. Have patience!
log in as 'root', no password
Networking should work automatically. If not see what :
ifup eth0
does. You should get an outward-only network connection if a dhcp server is visible. See https://fedoraproject.org/wiki/Architectures/ARM/AArch64/FoundationModel_Networking for more networking details.
Building your own rootfs image
You can build an image as above very easily. The image the models take are a simple ext4fs block device. makeimg is a handy script to make a blank device, format it, then run multistrap with a suitable config to download and unpack debs, plus install a few config files to set things up.
Currently thats: add an upstart job for the serial console, set a root password to nothing (care!), set PERL5LIB to work round the fact that it's currently incomplete in the multiarch perl package, turn off recommends, and set up /etc/fstab, and /etc/networkin/interfaces
Download the makeimg script and the multistrap config files:
wget http://people.debian.org/~wookey/bootstrap/rootfs/arm64-makeimage.tgz tar -xzvf arm64-makeimage.tgz
Build an image with:
./makeimg
Which will ask for sudo password. You need to be in the makeimg dir. And note that this is the sort of script that can accidentally format your hard drive if things go wrong. It has some checks to try and avoid disaster, but take a bit of care and don't blame me if it all goes badly.
That image now has unpacked deps in it, but they need their configure scripts (and in some cases preinsts) running natively to make it properly bootable.
Run the model with the 'init=/bin/sh' kernel:
Foundation_v8pkg/Foundation_v8 --image linux-system-foundation.axf --block-device raring.img
Assuming you get a prompt run the config script to do some fixups and the second-stage bootstrap
./config.sh
A few packages will still fail to configure as they depend on upstart having started.
Look inside config.sh to see what it does and do manual fixups if needed (a different package set may need this).
One possible problem is:
Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
This can be fixed by diverting /sbin/initctl :
dpkg-divert --local --rename --add /sbin/initctl ln -s /bin/true /sbin/initctl ./config.sh
See https://www.nesono.com/node/368
If you need to type anything more than a line then run bash (after export PATH) . It's _much_ nicer.
Reboot with upstart running:
Foundation_v8pkg/Foundation_v8 --image linux-system-foundation-upstart-verbose.axf --block-device raring.img --network=nat
It should either get to a prompt you can log in at as root (no password), or offer a maintenance shell.
bash dpkg --configure -a
Should get everything set up.
Chroot bodges needed
The perl package in this chroot has a bug so you need to set: PERL5LIB=/usr/lib/aarch64-linux-gnu/perl/5.14.2 before using it.
Best thing to do is create a /etc/environment file containing:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" PERL5LIB=/usr/lib/aarch64-linux-gnu/perl/5.14.2
Toolchain Bootstrap Issues
Quantal bootstrap
The initial arm64 packaged toolchain was done in Ubuntu Quantal, as the first release where multiarch crossbuilding basically worked. The details of this are documented on toolchain/BootstrapIssues#Quantal.
Raring bootstrap
Easier than quantal as all the base porting has already been done. However not quite as easy as one might like. arm64-cross-toolchain-base was updated with some fixes/updates from the armhf/armel-c-t-b packages. Binutils and linux-libc-dev headers were straightforward.
But gcc stage1 build fell over first with bugs in gcc-4.7.2-12ubuntu2 (patches that didn't apply, missing arm64 symbols-files). Then with missing bits/predefs.h header when building libgcc. This turned out to be 1091823.
Then the build completed but there was a libgconv.a packaging error for some reason. Updating to gcc-4.7-2-14ubuntu2 seemed to fix that.
Building packages
The initial (quantal) version of the cross-toolchain only searched the old dpkg-cross library paths by default so you need this in /etc/dpkg/buildflags too:
DEB_LDFLAGS_APPEND="-L/usr/lib/aarch64-linux-gnu -L/lib/aarch64-linux-gnu -L/usr/lib -Wl,-rpath-link=/usr/lib/aarch64-linux-gnu:/lib/aarch64-linux-gnu:/usr/lib"
This is not an issue from gcc-4.7-14 onwards, so the above is not needed in raring or unstable. This is good because it breaks packages that need to build both BUILD_ARCH _and_ HOST_ARCH stuff.
Packages that are (cross) built for raring
- eglibc (stage1, stage2 to avoid libselinux)
- pcre3
- attr
- acl
- zlib
- hostname
- libsepol
- gpm
- ifupdown
- insserv
- module-init-tools
- python-defaults
- libselinux (stage1 to avoid swig and rub2deb)
- ncurses
- bash
- libpng
- slang (needs chrpath 0.14)
- base-files
- mawk
- makedev
- make
- xz-utils
- libpciaccess
- dpkg
- time
- manpages
- libxau
- libxdmcp
- libpthread-stubs
- diffutils
- tar
- cpio
- diffutils
- gmp
- gdbm
- sed
- tzdata
- base-passwd
- coreutils
- findutils
- libnfnetlink
- libffi
- iptables
- libelf
- debconf
- debianutils
- ucf
- xtrans
- x11proto-kb
- x11proto-input
- x11proto-render
- x11proto-xf86bigfont
- x11proto-core
- expat
- net-tools
- tcl8.5
- tcp-wrappers
- ubuntu-keyring
- scowl
- postgresql-common
- openslp-dfsg
- procps
- psmisc
- phpmyadmin
- libusb
- mcrypt
- pixman
- libice
- bzip2
- flex
- db4.8
- dash
- iptables
- keyutils
- less
- sysvinit
- nano
- db-defaults
- grep
- dbconfig-comon
- linux-atm
- util-linux
- e2fsprogs
- ustr
- kmod
- dbus (stage1)
- libsm
- cunit
- glib2.0 (stage1)
- udev (stage1)
- libnih (stage1)
- json-c
- openssl
- initramfs-tools
- libgcrypt11
- libidn
- wget
- sysfsutils
- iputils
- ppl
- binutils
- busybox
- libtasn1-3
- libfribidi
- libjson0
- upstart
- tcl8.5
- sqlite3
- db (stage1)
- cracklib2 (stage1)
- pam (stage1)
- libcap2
- libsemanage (stage1)
- shadow
- iproute
- ppl
- cloog-ppl
- libbsd
- libedit
- dbus
- libgpg-error
- popt
- p11-kit
- gnutls26
- libxau
- check
- libxcb1
- libx11
- libfreetype
- libfontconfig
- libxrender
- libxext
- libxt
- lzo2
- cairo
- libdatrie
- libthai
- libxft
- pango1.0 (stage1)
- libdrm
- plymouth (stage1)
- perl
- libjpeg-turbo
- initramfs-tools (-A)
- debconf (-A)
- lsb (-A)
- tzdata (-A)
- makedev (-A)
- pam (-A)
- mountall
- readline (-A)
- cron
- glib2.0 (-A)
- nspr
- klibc
- nano
- less
- gcc-4.7
Packages that needed fixes
libgcrypt11 Compiler ICE: 1078967 Fixed in raring toolchain
- linux-atm Tries to link native tool against -lf and fails because dpkg-buildflags have nobbled link path for aarch64. Need to either wrap compiler and get rid of LDFLAGS buildflags or fix cross toolchain default path. Fixed in raring toolchain
libnih 1101977
db 1105368
- eglibc 2.16 has a bug with error retun codes (breaks scp at least). Need to use 2.17.
Build-dependencies that need(ed) fixes
Mostly things need multiarchifying.
- chrpath (0.14, earlier versions are not 32/64/endian aware)
xz-utils builds fine if its cross build-deps are installed, but apt-get build-dep -aarm64 xz-utils fails saying that perl is not available. It doesn't matter if multiarch perl is already installed or not. xz-utils has a perl:any build-dep. This should now be a perl-base:any build-dep. This tested in quantal. Needs checking in unstable and raring.
Current list of things needed for debootstrap which have missing build-deps:
- db : default-jdk:arm64 (fixed in bootstrap repo)
- dbus : libdbus-glib-1-dev:arm64 (fixed in bootstrap repo)
- console-setup: bdfresize
- e2fsprogs : libblkid-dev:arm64 (fixed in bootstrap repo)
- gnupg : libldap2-dev:arm64
- openssl: bc (fixed in bootstrap repo)
- cracklib2: python-2.7-dev python-3-dev (fixed in bootstrap repo)
Packages that still need cross-building, but do have satisfiable cross-build deps (analysis done in quantal-bootstrap using dose-debbuildcheck):
acl attr base-passwd bc bison bluez boost1.49 bsdmainutils bzip2 cairo chrpath consolekit coreutils cpio cracklib2 cups curl cyrus-sasl2 datefudge db-defaults dbus-glib docbook-to-man doxygen ed elfutils fastjar fftw3 file flac fontconfig freeglut freetds freetype gcc-4.7 gcj-4.7 gconf gdk-pixbuf ghostscript giflib git glib2.0 gnutls26 gobject-introspection graphviz groff heimdal hesiod icu ifupdown ijs iproute iptables jackd2 jasper java-atk-wrapper java-common jbig2dec jbigkit json-c keyutils krb5 lcms lcms2 libasyncns libcap-ng libcroco libdatrie libdrm libedit libevent libffibinutils libfontenc libgcrypt11 libgd2 libglu libgpg-error libhdate libice libidn libjpeg-turbo libjpeg8-empty libmng libnfnetlink libnih libnl3 libogg libpaper libsamplerate libsndfile libthai libtool libunistring libusbx libverto libvorbis libx11 libxau libxaw libxcb libxcomposite libxcursor libxdamage libxdmcp libxext libxfixes libxfont libxi libxinerama libxml2 libxmu libxpm libxrandr libxrender libxslt libxt libxtst libxv libxxf86vm linux lirc lynx-cur m4 mawk mesa mscgen mysql-5.5 nas netpbm-free nspr nss openjade1.3 openjdk-7 openldap openslp-dfsg opensp openssh orc oss4 p11-kit pam pango1.0 patch pcsc-lite perl pixman pkg-config plymouth pmake policykit-1 postgresql-9.1 procps pulseaudio python-defaults python2.7 qt4-x11 rtmpdump shadow source-highlight speex swig2.0 sysvinit tdb texinfo tiff unixodbc upstart wayland xfonts-utils xft xmlstarlet xmlto
Packages that still need cross-building but don't have satisfiable build-deps (analysis done in quantal-bootstrap using dose-debbuildcheck):
binutils eglibc gawk gcc-4.7 libxml2 linux man-db mpfr4 perl fontconfig freetype gcj-4.7 gdk-pixbuf git gobject-introspection gtk+2.0 libidn libxcb lynx-cur openjdk-7 openldap pango1.0 python2.7 gconf ghostscript ijs jackd2 jbig2dec libtool libxslt lirc mysql-5.5 postgresql-9.1 bison fftw3 gst-plugins-base0.10 gstreamer0.10 boost1.49 elfutils graphviz libgd2 policykit-1 source-highlight