First commit

This commit is contained in:
Adam Boardman 2019-03-05 12:39:41 +00:00
commit 75ca0cb2e7
9 changed files with 128 additions and 0 deletions

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# Gemian Android System Image
Update the postinst script with a new checksum each time we update the system.img

5
debian/changelog vendored Normal file
View file

@ -0,0 +1,5 @@
gemian-system (0.1) stretch; urgency=low
* Initial release
-- Adam Boardman <adamboardman@gmail.com> Tue, 5 Mar 2019 11:41:00 +0000

1
debian/compat vendored Normal file
View file

@ -0,0 +1 @@
10

13
debian/control vendored Normal file
View file

@ -0,0 +1,13 @@
Source: gemian-system
Section: kernel
Priority: extra
Maintainer: Adam Boardman <adamboardman@gmail.com>
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

29
debian/copyright vendored Normal file
View file

@ -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 <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU Lesser General
Public License can be found in "/usr/share/common-licenses/LGPL-3".

40
debian/postinst vendored Executable file
View file

@ -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

34
debian/rules vendored Executable file
View file

@ -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

1
debian/source/format vendored Normal file
View file

@ -0,0 +1 @@
1.0

2
debian/source/options vendored Normal file
View file

@ -0,0 +1,2 @@
tar-ignore=.git
tar-ignore=.gitignore