First I have Mint Debian Betsy (http://www.linuxmint.com/download_lmde.php) running under vmware fusion.
To get pbuilder installed I followed this blog (https://jodal.no/2015/03/08/building-arm-debs-with-pbuilder/). So first you create .pbuilderrc and put it in the home directory. One challenge I found is that sudo would require that .pbuilderrc in /root as well. So put it in both or I read to just put it in /etc/pbuilderrc. I simplified the file since I only care about arm:
#!/bin/sh set -e if [ "$OS" == "debian" ]; then MIRRORSITE="http://ftp.debian.org/debian/" COMPONENTS="main contrib non-free" DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg") : ${DIST:="jessie"} : ${ARCH:="armhf"} else echo "Unknown OS: $OS" exit 1 fi if [ "$DIST" == "" ]; then echo "DIST is not set" exit 1 fi if [ "$ARCH" == "" ]; then echo "ARCH is not set" exit 1 fi NAME="$OS-$DIST-$ARCH" if [ "$ARCH" == "armel" ] && [ "$(dpkg --print-architecture)" != "armel" ]; then DEBOOTSTRAP="qemu-debootstrap" fi if [ "$ARCH" == "armhf" ] && [ "$(dpkg --print-architecture)" != "armhf" ]; then DEBOOTSTRAP="qemu-debootstrap" fi DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--arch=$ARCH") BASETGZ="/var/cache/pbuilder/$NAME-base.tgz" DISTRIBUTION="$DIST" BUILDRESULT="/var/cache/pbuilder/$NAME/result/" APTCACHE="/var/cache/pbuilder/$NAME/aptcache/" BUILDPLACE="/var/cache/pbuilder/build" #HOOKDIR="/var/cache/pbuilder/hook.d/"With that in place, install the required debian packages:
apt-get install pbuilder qemu-user-staticAnd I only need the debian keyring:
apt-get install debian-archive-keyringWhich is installed here:
/usr/share/keyrings/I also ran the following to get the bluez dependencies:
apt-get build-dep bluezNow create the virtual image:
OS=debian DIST=jessie ARCH=armhf pbuilder --createThe image is created here:
/var/cache/pbuilderWith pbuilder ready I can now prepare bluez by first grabbing the latest git (will create a bluez folder in the current directory):
git clone git://git.kernel.org/pub/scm/bluetooth/bluez.gitWe want to get the 5.37 release so we checkout as follows:
git checkout tags/5.37Now some debian package pieces are needed and can be retrieved from http://http.debian.net/debian/pool/main/b/bluez/:
wget http://http.debian.net/debian/pool/main/b/bluez/bluez_5.36.orig.tar.xz
wget http://http.debian.net/debian/pool/main/b/bluez/bluez_5.36-1.dsc
wget http://http.debian.net/debian/pool/main/b/bluez/bluez_5.36-1.debian.tar.xznow uncompress the debian folder and place in the bluez folder
tar xJvf bluez_5.36-1.debian.tar.xz -C ./bluezNow we want to create a new number for our purposes, which we be 5.37. To get pbuilder to work, change the version of the downloaded files from 5.36 to 5.37:
cp bluez_5.36.orig.tar.xz bluez_5.37.orig.tar.xz cp bluez_5.36-1.dsc bluez_5.37-1.dscNow use an editor (like vim) to modify the changelog in bluez/debian to a new version.
vim ./debian/changelogIt is important that the change match the previous entries and there is no leading spaces. Something like this will suffice:
bluez (5.37-1) unstable; urgency=medium * Update to 5.37. -- Name email Sat, 07 Jan 2016 11:47:02 +0900The changes made in the latest bluez have to be made into a patch, quilt is the tool to do this properly. However, for a quick and dirty method just run the build (want to be in the bluez folder when running this command):
cd bluez OS=debian DIST=jessie ARCH=armhf pdebuild --debbuildopts "-j4 -b -uc -us"Which results in an error similar to the following:
dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/bluez_5.37-1.diff.XW1beT dpkg-source: info: you can integrate the local changes with dpkg-source --commit dpkg-buildpackage: error: dpkg-source -b bluez gave error exit status 2So copy the differences into a patch and add it to patch series file as follows:
cp /tmp/bluez_5.37-1.diff.XW1beT debian/patches/latestmods.patch echo latestmods.patch >> debian/patches/seriesNow run the command again and wait:
OS=debian DIST=jessie ARCH=armhf pdebuild --debbuildopts "-j4 -b -uc -us"The end result will be the creation of a bunch of debian bluez packages in /var/cache/pbuilder/debian-jessie-armhf/result:
bluetooth_5.37-1_all.deb bluez-cups_5.37-1_armhf.deb bluez-dbg_5.37-1_armhf.deb bluez-hcidump_5.37-1_armhf.deb bluez-obexd_5.37-1_armhf.deb bluez-test-scripts_5.37-1_all.deb bluez_5.37-1_armhf.deb libbluetooth-dev_5.37-1_armhf.deb libbluetooth3-dbg_5.37-1_armhf.deb libbluetooth3_5.37-1_armhf.deb