Skip to content

Commit

Permalink
Extract all repo definitions into one common place
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishcoleman committed Apr 2, 2018
1 parent 1d4e821 commit 430118b
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 38 deletions.
2 changes: 2 additions & 0 deletions apt.sources/README.md
@@ -0,0 +1,2 @@
This directory contains files to define the settings needed for each
upstream dpkg repository.
9 changes: 9 additions & 0 deletions 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"

9 changes: 9 additions & 0 deletions 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"

9 changes: 9 additions & 0 deletions 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"

3 changes: 1 addition & 2 deletions boards/raspberrypi2/Makefile
Expand Up @@ -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

Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions boards/sun4i-a10-cubieboard/Makefile
Expand Up @@ -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

Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions boards/sun7i-a20-bananapi/Makefile
Expand Up @@ -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

Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions boards/sun8i-h2-plus-orangepi-zero/Makefile
Expand Up @@ -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

Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions boards/sun8i-h3-orangepi-lite/Makefile
Expand Up @@ -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

Expand All @@ -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
Expand Down
5 changes: 1 addition & 4 deletions cjdns/hack/Makefile
Expand Up @@ -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
Expand All @@ -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)
( \
Expand Down
6 changes: 2 additions & 4 deletions firmware/Makefile
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 0 additions & 7 deletions mk/common-armbian.mk

This file was deleted.

7 changes: 0 additions & 7 deletions mk/common-raspbian.mk

This file was deleted.

20 changes: 14 additions & 6 deletions scripts/get_deb
Expand Up @@ -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

Expand All @@ -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"

Expand Down

0 comments on commit 430118b

Please sign in to comment.