commit 75ca0cb2e71d3aa092bb445e56df424302ab09c0 Author: Adam Boardman Date: Tue Mar 5 12:39:41 2019 +0000 First commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..b3fa885 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Gemian Android System Image + +Update the postinst script with a new checksum each time we update the system.img diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..a136b46 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +gemian-system (0.1) stretch; urgency=low + + * Initial release + + -- Adam Boardman Tue, 5 Mar 2019 11:41:00 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..06c10e4 --- /dev/null +++ b/debian/control @@ -0,0 +1,13 @@ +Source: gemian-system +Section: kernel +Priority: extra +Maintainer: Adam Boardman +Build-Depends: +Standards-Version: 3.9.8 +Vcs-Git: https://github.com/gemian/gemian-system.git + +Package: gemian-system +Architecture: all +Depends: xz-utils, curl +Description: Gemini Android System Image + Contains the Android System that is run inside an lxc container diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..cfcf2f6 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,29 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: gemian-system +Source: https://github.com/gemian/gemian-system + +Files: * +Copyright: Various +License: Various + +Files: debian/* +Copyright: Adam Boardman +License: LGPL-3 + + +License: LGPL-3 + This package is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this package. If not, see . + . + On Debian systems, the complete text of the GNU Lesser General + Public License can be found in "/usr/share/common-licenses/LGPL-3". diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..d05886d --- /dev/null +++ b/debian/postinst @@ -0,0 +1,40 @@ +#!/bin/bash -e + +action="$1" +oldversion="$2" + +if [ "$action" != configure ]; then + exit 0 +fi + +target_checksum="c977d21306553913ae35b830f9711c03681c7d6c" +echo "Target checksum $target_checksum" + +echo "Checking /data/system.img" + +current_checksum="$(sha1sum /data/system.img | cut -d' ' -f1)" + +echo "Checksum $current_checksum" + +if [ "$target_checksum" == "$current_checksum" ]; +then + echo "Android system image upto date" + exit 0 +else + tempfile="$(mktemp)" + rm $tempfile + echo "Downloading new Android system image" + curl https://gemian.thinkglobally.org/system/system.$target_checksum.img.xz --output $tempfile.xz + xz -d $tempfile.xz + downloaded_checksum="$(sha1sum $tempfile | cut -d' ' -f1)" + if [ "$target_checksum" == "$downloaded_checksum" ]; + then + echo "Moving new system image into place, please reboot to activate" + mv $tempfile /data/system.img + exit 0 + else + echo "Downloaded checksum fail - check your internet for random errors or man in the middle attacks and retry" + exit 1 + fi +fi + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..b813074 --- /dev/null +++ b/debian/rules @@ -0,0 +1,34 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# keep lintian happy: +build: build-arch build-indep +build-arch: build-stamp +build-indep: + +build-stamp: + +clean: checkdir + +binary-arch: + +binary-indep: + -rm -rf debian/tmp + install -p -d -o root -g root -m 755 debian/tmp + install -p -d -o root -g root -m 755 debian/tmp/DEBIAN + install -p -o root -g root -m 755 debian/postinst debian/tmp/DEBIAN/ + dpkg-gencontrol + dpkg --build debian/tmp .. + +binary: binary-arch binary-indep + +checkdir: + @test -f debian/rules + +checkroot: checkdir + @test 0 = `id -u` || { echo "Error: not super-user"; exit 1; } + +.PHONY: binary binary-arch binary-indep clean checkroot checkdir build build-arch build-indep diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..d3827e7 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +1.0 diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..7c3f776 --- /dev/null +++ b/debian/source/options @@ -0,0 +1,2 @@ +tar-ignore=.git +tar-ignore=.gitignore