aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2017-01-19 15:10:01 +0100
committerKarel Kočí <karel.koci@nic.cz>2017-01-19 15:10:01 +0100
commitb3966853d6c336bc66d304b448ac65280bce7957 (patch)
tree3c86596d2fd2cd114c60f66a1063dcd913d87f2e
downloadturris-myrepo-b3966853d6c336bc66d304b448ac65280bce7957.tar.gz
turris-myrepo-b3966853d6c336bc66d304b448ac65280bce7957.tar.bz2
turris-myrepo-b3966853d6c336bc66d304b448ac65280bce7957.zip
Initial commit
-rw-r--r--.gitignore2
-rwxr-xr-xbuild_repo.sh61
-rw-r--r--myrepo-cert/Makefile33
-rw-r--r--myrepo-cert/files/key.pub2
-rw-r--r--myrepo-cert/files/key.sec2
-rw-r--r--omnia.lua7
6 files changed, 107 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9ea0f13
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.*
+!.gitignore
diff --git a/build_repo.sh b/build_repo.sh
new file mode 100755
index 0000000..dd7f6bc
--- /dev/null
+++ b/build_repo.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+set -e
+#set -x
+
+cd `dirname $0`
+
+BOARD=omnia
+if [ "$1" = "omnia" ] || [ "$1" = "turris" ] || [ "$1" = "all" ]; then
+ BOARD=$1
+ shift
+fi
+
+# remove previous build
+rm -rf .omnia-sdk
+rm -rf .turris-sdk
+
+if [ "$BOARD" = "omnia" ] || [ "$BOARD" = "all" ]; then
+ echo "Getting current SDK for omnia"
+ curl "https://repo.turris.cz/omnia/OpenWrt-SDK-mvebu_gcc-4.8-linaro_musl-1.1.15_eabi.Linux-x86_64.tar.bz2" \
+ | tar -xjf -
+ mv OpenWrt-SDK-mvebu_* .omnia-sdk
+fi
+if [ "$BOARD" = "turris" ] || [ "$BOARD" = "all" ]; then
+ echo "Getting current SDK for turris"
+ wget "https://repo.turris.cz/turris/OpenWrt-SDK-mpc85xx-p2020-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2" \
+ | tar -xjf -
+ mv OpenWrt-SDK-mpc85xx* .turris-sdk
+fi
+
+echo "Copy packages"
+for d in *; do
+ [ -f $d/Makefile ] || continue
+ [ -d .omnia-sdk ] && cp -r $d .omnia-sdk/package/
+ [ -d .turris-sdk ] && cp -r $d .turris-sdk/package/
+done
+
+if [ "$BOARD" = "omnia" ] || [ "$BOARD" = "all" ]; then
+ echo "Building omnia"
+ (cd .omnia-sdk; make $@)
+fi
+if [ "$BOARD" = "turris" ] || [ "$BOARD" = "all" ]; then
+ echo "Building turris"
+ (cd .turris-sdk; make $@)
+fi
+
+deploy() {
+ echo "Sign and deploy $1"
+ SEC=$PWD/myrepo-cert/files/key.sec
+ pushd .$1-sdk
+ staging_dir/host/bin/usign -S -s $SEC -m bin/mvebu-musl/packages/base/Packages
+ scp bin/mvebu-musl/packages/base/* freebsd@cynerd.cz:/usr/local/www/data/myrepo/$1/
+ popd
+ scp $1.lua freebsd@cynerd.cz:/usr/local/www/data/myrepo/$1.lua
+}
+
+if [ "$BOARD" = "omnia" ] || [ "$BOARD" = "all" ]; then
+ deploy omnia
+fi
+if [ "$BOARD" = "turris" ] || [ "$BOARD" = "all" ]; then
+ deploy turris
+fi
diff --git a/myrepo-cert/Makefile b/myrepo-cert/Makefile
new file mode 100644
index 0000000..99f47fe
--- /dev/null
+++ b/myrepo-cert/Makefile
@@ -0,0 +1,33 @@
+#
+## Copyright (C) 2016 CZ.NIC z.s.p.o. (http://www.nic.cz/)
+#
+## This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+# #
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=myrepo-cert
+PKG_VERSION:=1
+PKG_MAINTAINER:=Karel Koci
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/myrepo-cert
+ TITLE:=myrepo-cert
+endef
+
+define Build/Compile
+ true
+endef
+
+define Package/myrepo-cert/install
+ $(INSTALL_DIR) $(1)/etc/opkg/keys
+ $(INSTALL_DIR) $(1)/etc/updater/keys
+
+ cp ./files/key.pub $(1)/etc/opkg/keys/cfb977a0d53c5424
+ cp ./files/key.pub $(1)/etc/updater/keys/myrepo.pub
+endef
+
+$(eval $(call BuildPackage,myrepo-cert))
diff --git a/myrepo-cert/files/key.pub b/myrepo-cert/files/key.pub
new file mode 100644
index 0000000..4173ed5
--- /dev/null
+++ b/myrepo-cert/files/key.pub
@@ -0,0 +1,2 @@
+untrusted comment: private key cfb977a0d53c5424
+RWTPuXeg1TxUJC6EOmawdomx+1cuPaBx5g6B1A2nq0TI6Gf8mbRoU2w6
diff --git a/myrepo-cert/files/key.sec b/myrepo-cert/files/key.sec
new file mode 100644
index 0000000..5731869
--- /dev/null
+++ b/myrepo-cert/files/key.sec
@@ -0,0 +1,2 @@
+untrusted comment: public key cfb977a0d53c5424
+RWRCSwAAAAC/rGfdjaQn9ZWPHvtqQrzm9dkd/bHNF4XPuXeg1TxUJCiZuBFQLxqoolLnufYHIHHGvgFbJpjnT1v8X2W831l+LoQ6ZrB2ibH7Vy49oHHmDoHUDaerRMjoZ/yZtGhTbDo=
diff --git a/omnia.lua b/omnia.lua
new file mode 100644
index 0000000..8e864e9
--- /dev/null
+++ b/omnia.lua
@@ -0,0 +1,7 @@
+-- This is myrepo omnia configuration
+INFO("Using myrepo")
+Repository "myrepo" "http://cynerd.cz/myrepo/omnia/" {
+ priority = 70, pubkey = "file:///etc/updater/keys/myrepo.pub"
+}
+
+Install "myrepo-cert" {critical=true}