From caf386d8ec81365eabf28ded49e1211ddcb97981 Mon Sep 17 00:00:00 2001 From: clayton craft Date: Mon, 9 Oct 2017 19:10:28 +0000 Subject: [PATCH] Set swclock to use recent date/time on first boot (#723) --- main/postmarketos-base/APKBUILD | 4 ++-- main/postmarketos-base/postmarketos-base.post-install | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/main/postmarketos-base/APKBUILD b/main/postmarketos-base/APKBUILD index eb25a6091..d789aa1dc 100644 --- a/main/postmarketos-base/APKBUILD +++ b/main/postmarketos-base/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-base pkgver=3 -pkgrel=6 +pkgrel=7 pkgdesc="Meta package for minimal postmarketOS base" url="https://github.com/postmarketOS" arch="noarch" @@ -71,4 +71,4 @@ sha512sums="c6de3b44bc45b9f9c641a7e34c69a481ee39b99ac0251cd28f2b3aae49c1a8d1ca44 3ceeee37f558e7c95ad973692b6a437f997e6b46c3d1c2257ddfb1529a5633477373aa123c7f08164e818daae50acb203d151379f27ca11bd458809e6a0d4de7 swapfile f5cc0f1265955d2646e5f099dd4b5d4c287945bfc18c16044db57670d456f55c678fc11cc59e6dab3fa340832ce869d516302a3a35c13518539ed0cedca51819 swapfile.init e0d2d48b82a03239a4c0a00acaf83e00d397c23a8d7c71053d4e2a383357c22dcedef9e81b0e12a1d7514e1fdbe0bb3eb82613d18b29034a7ce5447f13c84a53 swapfile.conf -a0f1c7a301056bff8bfad78375ceff07adf6e8520cfebe4dd8dd37571ba6f0315e4554ed0c3aaf944affcac45b4920d886575201ccb884e28569cf071cf97d2f postmarketos-base.post-install" +8b022c5b45d02cbce64137e085838e7d7748b2f3c563faa1a1b02f91472cef96ad254f3f5ee35d80c982d80bd5959ceab0f8127534f7742134ca07a3d595be34 postmarketos-base.post-install" diff --git a/main/postmarketos-base/postmarketos-base.post-install b/main/postmarketos-base/postmarketos-base.post-install index e852de9a4..05edfc975 100644 --- a/main/postmarketos-base/postmarketos-base.post-install +++ b/main/postmarketos-base/postmarketos-base.post-install @@ -23,6 +23,10 @@ if [ "${deviceinfo_msm_refresher}" = "true" ]; then rc-update -q add msm-fb-refresher boot fi +# Prime swclock with a reasonable date/time on first boot +mkdir -p /run/openrc +touch /run/openrc/shutdowntime + write_unless_modified() { # Redirect the stdin to the file unless it has been modified # $1: file path