summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorgraysky2018-12-21 11:38:30 -0500
committergraysky2018-12-21 11:38:30 -0500
commitd029ee732fd853a50c9d4c302bf1f72709ce624f (patch)
treeaf5f0d3738e51707efe54be7119a6748655d3b80
downloadaur-d029ee732fd853a50c9d4c302bf1f72709ce624f.tar.gz
initial commit
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD23
-rw-r--r--odroid-c2-rtc.install31
3 files changed, 68 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..7dd8bb93f2f1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,14 @@
+pkgbase = odroid-c2-rtc
+ pkgdesc = Use and automate kernel updates for the PCF8563 RTC Shield on the ODROID-C2
+ pkgver = 1.20
+ pkgrel = 1
+ url = https://github.com/graysky2/odroid-c2-rtc
+ install = odroid-c2-rtc.install
+ arch = aarch64
+ license = MIT
+ depends = dtc
+ source = odroid-c2-rtc-1.20.tar.gz::https://github.com/graysky2/odroid-c2-rtc/archive/v1.20.tar.gz
+ md5sums = 52002d49bf97676c67882176f1f55d56
+
+pkgname = odroid-c2-rtc
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..429da5827869
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,23 @@
+# Maintainer: graysky <graysky AT archlinux DOT us>
+pkgname=odroid-c2-rtc
+pkgver=1.20
+pkgrel=1
+pkgdesc="Use and automate kernel updates for the PCF8563 RTC Shield on the ODROID-C2"
+arch=('aarch64')
+url="https://github.com/graysky2/odroid-c2-rtc"
+license=('MIT')
+depends=('dtc')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/graysky2/$pkgname/archive/v$pkgver.tar.gz")
+md5sums=('52002d49bf97676c67882176f1f55d56')
+install=$pkgname.install
+
+build() {
+ cd "$pkgname-$pkgver"
+ make
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+ install -Dm644 MIT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
diff --git a/odroid-c2-rtc.install b/odroid-c2-rtc.install
new file mode 100644
index 000000000000..cb3603ff2926
--- /dev/null
+++ b/odroid-c2-rtc.install
@@ -0,0 +1,31 @@
+post_install() {
+ echo '--> Edit the MODULES array in /etc/mkinitcpio.conf to contain:'
+ echo '--> MODULES=( aml_i2c rtc_pcf8563 ... )'
+ echo '--> Then regenerate the boot image with: mkinitcpio -p linux-odroid-c2'
+
+ # first time setup
+
+ if lsmod | grep -q sx865x; then
+ rmmod sx865x
+ fi
+
+ # even if loaded execute this has it is harmless and will exit with 0
+ modprobe -a aml_i2c rtc_pcf8563
+
+ # first time setup of device tree
+ if [[ -f /boot/dtbs/meson64_odroidc2.dtb ]]; then
+ fdtput -t s /boot/dtbs/meson64_odroidc2.dtb /i2c@c1108500/pcf8563@51 status "okay"
+ # save the current time we assume is correct to the RTC chip
+ hwclock -w
+ else
+ echo '--> ERROR: cannot locate meson64_odroidc2.dtb so quitting!'
+ exit 1
+ fi
+
+}
+
+post_remove() {
+ echo '--> Optionally edit the MODULES array in /etc/mkinitcpio.conf'
+ echo '--> to remove both aml_i2c and rtc_pcf8563'
+ echo '--> Do not forget to regenerate the boot image with: mkinitcpio -p linux-odroid-c2'
+}