Skip to content

Instantly share code, notes, and snippets.

@waja
Created November 25, 2013 09:55
Show Gist options
  • Save waja/7639011 to your computer and use it in GitHub Desktop.
Save waja/7639011 to your computer and use it in GitHub Desktop.
Patching mk-sbuild to (maybe) add another keyring for building arch armhf (on default /usr/share/keyrings/${DISTRO}-archive-keyring.gpg is used, but we want use /usr/share/keyrings/raspbian-archive-keyring.gpg for example)
--- /usr/bin/mk-sbuild 2013-10-14 22:02:00.000000000 +0200
+++ /tmp/mk-sbuild 2013-11-24 22:56:49.000000000 +0100
@@ -618,7 +618,11 @@
sudo mkdir -p -m 0700 "$MNT"/root/.gnupg
# debootstrap the chroot
-sudo ${proxy:+"http_proxy=${proxy}"} "$DEBOOTSTRAP_COMMAND" --arch="$CHROOT_ARCH" $variant_opt $debootstrap_opts "$RELEASE" "$MNT" "${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu}"
+if [ "$CHROOT_ARCH" = "armhf" ]; then
+ sudo ${proxy:+"http_proxy=${proxy}"} "$DEBOOTSTRAP_COMMAND" --arch="$CHROOT_ARCH" $variant_opt $debootstrap_opts "$RELEASE" "$MNT" "${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu}" "${DEBOOTSTRAP_KEYRING}"
+else
+ sudo ${proxy:+"http_proxy=${proxy}"} "$DEBOOTSTRAP_COMMAND" --arch="$CHROOT_ARCH" $variant_opt $debootstrap_opts "$RELEASE" "$MNT" "${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu}"
+fi
# Update the package sources
TEMP_SOURCES=`mktemp -t sources-XXXXXX`
Copy link

ghost commented Jan 13, 2014

I wonder if it's possible to make a more generic version of this script and send it upstream. So the if test would be checking if $DEBOOTSTRAP_KEYRING is set rather than the arch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment