diff --git a/apt.sources/README.md b/apt.sources/README.md new file mode 100644 index 0000000..7969572 --- /dev/null +++ b/apt.sources/README.md @@ -0,0 +1,2 @@ +This directory contains files to define the settings needed for each +upstream dpkg repository. diff --git a/apt.sources/armbian.conf b/apt.sources/armbian.conf new file mode 100644 index 0000000..142e3d5 --- /dev/null +++ b/apt.sources/armbian.conf @@ -0,0 +1,9 @@ +# +# The definitions needed to download packages from the armbian repo +# +# TODO +# - split this file into a real sources.list and a key file + +REPO_KEY=https://apt.armbian.com/armbian.key +REPO_SRC="deb http://apt.armbian.com jessie main" + diff --git a/apt.sources/cjdns.conf b/apt.sources/cjdns.conf new file mode 100644 index 0000000..54af008 --- /dev/null +++ b/apt.sources/cjdns.conf @@ -0,0 +1,9 @@ +# +# The definitions needed to download packages from the armbian repo +# +# TODO +# - split this file into a real sources.list and a key file + +REPO_KEY=https://ban.ai/raspbian/brrpi.pubkey +REPO_SRC="deb https://ban.ai/raspbian/ cjdns cjdns" + diff --git a/apt.sources/raspbian.conf b/apt.sources/raspbian.conf new file mode 100644 index 0000000..433f0a6 --- /dev/null +++ b/apt.sources/raspbian.conf @@ -0,0 +1,9 @@ +# +# The definitions needed to download packages from the raspbian repo +# +# TODO +# - split this file into a real sources.list and a key file + +REPO_KEY=https://archive.raspberrypi.org/debian/raspberrypi.gpg.key +REPO_SRC="deb http://archive.raspberrypi.org/debian/ jessie main" + diff --git a/boards/raspberrypi2/Makefile b/boards/raspberrypi2/Makefile index 5cd12be..dbbc68d 100644 --- a/boards/raspberrypi2/Makefile +++ b/boards/raspberrypi2/Makefile @@ -32,7 +32,6 @@ all: image include $(TOP_DIR)/mk/common.mk include $(TOP_DIR)/boards/common-partitions.mk include $(TOP_DIR)/boards/common-firmware-raspbian.mk -include $(TOP_DIR)/mk/common-raspbian.mk include $(TOP_DIR)/boards/common-cjdns-hack.mk include $(TOP_DIR)/boards/common-initrd.mk @@ -48,7 +47,7 @@ test: false $(TAG)/raspberrypi: - $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) $(RASPBIAN_KEY) $(RASPBIAN_REPO) $(RASPBERRYPI) $(RASPBIAN_BOOT_PKG) $(RASPBIAN_KERNEL_PKG) + $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) raspbian $(RASPBERRYPI) $(RASPBIAN_BOOT_PKG) $(RASPBIAN_KERNEL_PKG) $(call tag,raspberrypi) # Add the kernel specific binaries to this cpio file diff --git a/boards/sun4i-a10-cubieboard/Makefile b/boards/sun4i-a10-cubieboard/Makefile index 17b2d76..1c830e0 100644 --- a/boards/sun4i-a10-cubieboard/Makefile +++ b/boards/sun4i-a10-cubieboard/Makefile @@ -31,7 +31,6 @@ include $(TOP_DIR)/boards/common-partitions.mk include $(TOP_DIR)/boards/common-allwinner.mk include $(TOP_DIR)/boards/common-kernel-local.mk include $(TOP_DIR)/boards/common-firmware-armbian.mk -include $(TOP_DIR)/mk/common-armbian.mk include $(TOP_DIR)/boards/common-cjdns-hack.mk include $(TOP_DIR)/boards/common-initrd.mk @@ -42,7 +41,7 @@ test: # Everything below this line is HW specific Armbian u-Boot startup code $(TAG)/armbian: - $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) $(ARMBIAN_KEY) $(ARMBIAN_REPO) $(ARMBIAN) $(ARMBIAN_UBOOT_PKG) + $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) armbian $(ARMBIAN) $(ARMBIAN_UBOOT_PKG) $(call tag,armbian) $(BOOT): $(TAG)/boot diff --git a/boards/sun7i-a20-bananapi/Makefile b/boards/sun7i-a20-bananapi/Makefile index efd69f3..f2b9147 100644 --- a/boards/sun7i-a20-bananapi/Makefile +++ b/boards/sun7i-a20-bananapi/Makefile @@ -31,7 +31,6 @@ include $(TOP_DIR)/boards/common-partitions.mk include $(TOP_DIR)/boards/common-allwinner.mk include $(TOP_DIR)/boards/common-kernel-local.mk include $(TOP_DIR)/boards/common-firmware-armbian.mk -include $(TOP_DIR)/mk/common-armbian.mk include $(TOP_DIR)/boards/common-cjdns-hack.mk include $(TOP_DIR)/boards/common-initrd.mk @@ -42,7 +41,7 @@ test: # Everything below this line is HW specific Armbian u-Boot startup code $(TAG)/armbian: - $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) $(ARMBIAN_KEY) $(ARMBIAN_REPO) $(ARMBIAN) $(ARMBIAN_UBOOT_PKG) + $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) armbian $(ARMBIAN) $(ARMBIAN_UBOOT_PKG) $(call tag,armbian) $(BOOT): $(TAG)/boot diff --git a/boards/sun8i-h2-plus-orangepi-zero/Makefile b/boards/sun8i-h2-plus-orangepi-zero/Makefile index 5017ff2..bfaec52 100644 --- a/boards/sun8i-h2-plus-orangepi-zero/Makefile +++ b/boards/sun8i-h2-plus-orangepi-zero/Makefile @@ -31,7 +31,6 @@ include $(TOP_DIR)/boards/common-partitions.mk include $(TOP_DIR)/boards/common-allwinner.mk include $(TOP_DIR)/boards/common-kernel-local.mk include $(TOP_DIR)/boards/common-firmware-armbian.mk -include $(TOP_DIR)/mk/common-armbian.mk include $(TOP_DIR)/boards/common-cjdns-hack.mk include $(TOP_DIR)/boards/common-initrd.mk @@ -42,7 +41,7 @@ test: # Everything below this line is HW specific u-Boot startup code $(TAG)/armbian: - $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) $(ARMBIAN_KEY) $(ARMBIAN_REPO) $(ARMBIAN) $(ARMBIAN_UBOOT_PKG) + $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) armbian $(ARMBIAN) $(ARMBIAN_UBOOT_PKG) $(call tag,armbian) $(BOOT): $(TAG)/boot diff --git a/boards/sun8i-h3-orangepi-lite/Makefile b/boards/sun8i-h3-orangepi-lite/Makefile index 1bae2fc..40ac1cc 100644 --- a/boards/sun8i-h3-orangepi-lite/Makefile +++ b/boards/sun8i-h3-orangepi-lite/Makefile @@ -37,7 +37,6 @@ include $(TOP_DIR)/mk/common.mk include $(TOP_DIR)/boards/common-partitions.mk include $(TOP_DIR)/boards/common-allwinner.mk include $(TOP_DIR)/boards/common-firmware-armbian.mk -include $(TOP_DIR)/mk/common-armbian.mk include $(TOP_DIR)/boards/common-cjdns-hack.mk include $(TOP_DIR)/boards/common-initrd.mk @@ -48,7 +47,7 @@ test: # Everything below this line is HW specific Armbian u-Boot startup code $(TAG)/armbian: - $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) $(ARMBIAN_KEY) $(ARMBIAN_REPO) $(ARMBIAN) $(ARMBIAN_UBOOT_PKG) $(ARMBIAN_KERNEL_PKG) + $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) armbian $(ARMBIAN) $(ARMBIAN_UBOOT_PKG) $(ARMBIAN_KERNEL_PKG) $(call tag,armbian) # Add the kernel specific binaries to this cpio file diff --git a/cjdns/hack/Makefile b/cjdns/hack/Makefile index 6508fd4..0d959fa 100644 --- a/cjdns/hack/Makefile +++ b/cjdns/hack/Makefile @@ -17,9 +17,6 @@ endif BUILD_DEPENDS = \ apt-transport-https -REPOKEY = https://ban.ai/raspbian/brrpi.pubkey -REPO = "deb https://ban.ai/raspbian/ cjdns cjdns" - PKG = cjdns # Directories @@ -39,7 +36,7 @@ build-depends: Makefile cjdns: $(CJDNS).cpio $(CJDNS): - $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) $(REPOKEY) $(REPO) $@ $(PKG) + $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) cjdns $@ $(PKG) $(CJDNS).cpio: $(CJDNS) ( \ diff --git a/firmware/Makefile b/firmware/Makefile index 66a97ae..6e75a45 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -25,13 +25,11 @@ export TOP_DIR all: firmware include $(TOP_DIR)/mk/common.mk -include $(TOP_DIR)/mk/common-armbian.mk -include $(TOP_DIR)/mk/common-raspbian.mk firmware: $(BUILD)/firmware-raspbian.cpio $(BUILD)/firmware-armbian.cpio $(TAG)/armbian: - $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) $(ARMBIAN_KEY) $(ARMBIAN_REPO) $(ARMBIAN) $(ARMBIAN_FIRMWARE_PKG) + $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) armbian $(ARMBIAN) $(ARMBIAN_FIRMWARE_PKG) $(call tag,armbian) # Add the kernel specific binaries to this cpio file @@ -45,7 +43,7 @@ CLEAN_FILES += $(ARMBIAN) $(BUILD)/firmware-armbian.cpio $(BUILD)/firmware-armbi $(TAG)/raspbian: - $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) $(RASPBIAN_KEY) $(RASPBIAN_REPO) $(RASPBIAN) $(RASPBIAN_FIRMWARE_PKG) + $(TOP_DIR)/scripts/get_deb $(DEBIAN_ARCH) raspbian $(RASPBIAN) $(RASPBIAN_FIRMWARE_PKG) $(call tag,raspbian) # Add the kernel specific binaries to this cpio file diff --git a/mk/common-armbian.mk b/mk/common-armbian.mk deleted file mode 100644 index 8687d61..0000000 --- a/mk/common-armbian.mk +++ /dev/null @@ -1,7 +0,0 @@ -# -# The definitions needed to download packages from the armbian repo -# - -ARMBIAN_KEY = https://apt.armbian.com/armbian.key -ARMBIAN_REPO = "deb http://apt.armbian.com jessie main" - diff --git a/mk/common-raspbian.mk b/mk/common-raspbian.mk deleted file mode 100644 index 50bd6c4..0000000 --- a/mk/common-raspbian.mk +++ /dev/null @@ -1,7 +0,0 @@ -# -# The definitions needed to download packages from the raspbian repo -# - -RASPBIAN_KEY = https://archive.raspberrypi.org/debian/raspberrypi.gpg.key -RASPBIAN_REPO = "deb http://archive.raspberrypi.org/debian/ jessie main" - diff --git a/scripts/get_deb b/scripts/get_deb index 26b206b..5fde201 100755 --- a/scripts/get_deb +++ b/scripts/get_deb @@ -8,17 +8,14 @@ set -e ARCH="$1" shift -REPO_KEY="$1" -shift - -REPO_SRC="$1" +REPO="$1" shift OUTDIR="$1" shift -if [ -z "$ARCH" -o -z "$REPO_KEY" -o -z "$REPO_SRC" -o -z "$OUTDIR" -o -z "$1" ]; then - echo "Usage: $0 arch repo_key repo_sources unpackdir pkg..." +if [ -z "$ARCH" -o -z "$REPO" -o -z "$OUTDIR" -o -z "$1" ]; then + echo "Usage: $0 arch repo unpackdir pkg..." exit 1 fi @@ -27,6 +24,17 @@ if [ -z "$TOP_DIR" ]; then exit 1 fi +if [ ! -r "$TOP_DIR/apt.sources/$REPO.conf" ]; then + echo "No definition found for repo called $REPO" + exit 1 +fi + +. "$TOP_DIR/apt.sources/$REPO.conf" +if [ -z "$REPO_KEY" -o -z "$REPO_SRC" ]; then + echo "repo definition file did not define correct vars" + exit 1 +fi + mkdir -p "$OUTDIR" cd "$OUTDIR"