From 789343b8c72e405fbfd47eea8c1b45e8b63dd550 Mon Sep 17 00:00:00 2001 From: "Sicelo A. Mhlongo" Date: Tue, 25 Oct 2022 06:51:20 +0200 Subject: [PATCH] device-nokia-n900: enable use of rtc time at boot (MR 3586) Since N900 rtc works fine, remove swclock from boot as it causes time to be set wrong. Additionally, rtc device is set correctly in kernel, so remove old, adjusted hwclock config. Partially reverts pmaports 0e502a513972afbff30d52ed99c6ab11adb3ca96 [ci:skip-build]: already built successfully in CI --- device/community/device-nokia-n900/APKBUILD | 6 ++++-- .../device-nokia-n900/device-nokia-n900.post-install | 9 ++------- .../device-nokia-n900/device-nokia-n900.pre-upgrade | 6 ++++++ 3 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 device/community/device-nokia-n900/device-nokia-n900.pre-upgrade diff --git a/device/community/device-nokia-n900/APKBUILD b/device/community/device-nokia-n900/APKBUILD index 4d3415344..04fee82a9 100644 --- a/device/community/device-nokia-n900/APKBUILD +++ b/device/community/device-nokia-n900/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Sicelo # Co-Maintainer: Danct12 pkgname=device-nokia-n900 -pkgver=8.2 +pkgver=8.3 pkgrel=1 pkgdesc="Nokia N900" url="https://postmarketos.org" @@ -10,7 +10,7 @@ arch="armv7" license="MIT" depends="postmarketos-base linux-nokia-n900 u-boot-tools kbd kbd-bkeymaps ofono alsa-utils" makedepends="devicepkg-dev u-boot-tools kbd kbd-bkeymaps" -install="$pkgname.post-install" +install="$pkgname.pre-upgrade $pkgname.post-install" subpackages=" $pkgname-x11 $pkgname-xkeyboard-config:xkeyboard_config @@ -112,6 +112,8 @@ package() { "$pkgdir"/usr/share/bkeymaps/fi/rx51_fi.bmap.gz install -D -m644 "$srcdir"/keymaps/rx51_se.bmap.gz \ "$pkgdir"/usr/share/bkeymaps/se/rx51_se.bmap.gz + + postmarketos-mvcfg-package "$pkgdir" "$pkgname" } x11() { diff --git a/device/community/device-nokia-n900/device-nokia-n900.post-install b/device/community/device-nokia-n900/device-nokia-n900.post-install index a74aea199..5a3cc2ee1 100644 --- a/device/community/device-nokia-n900/device-nokia-n900.post-install +++ b/device/community/device-nokia-n900/device-nokia-n900.post-install @@ -11,8 +11,8 @@ rc-update add acpid default rc-update add hwdrivers boot # Enable ofono rc-update add ofono default -# Enable swclock -rc-update -q add swclock boot +# Disable swclock because rtc is working +rc-update -q del swclock boot # Load nokia-modem module on boot NMC=/etc/modules-load.d/nokia-modem.conf @@ -20,9 +20,4 @@ if [ ! -f $NMC ] || [ -z "$(grep nokia-modem $NMC)" ]; then echo "nokia-modem" >> /etc/modules-load.d/nokia-modem.conf fi -# Set RTC device for hwclock -if [ -z "$(grep /dev/rtc0 /etc/conf.d/hwclock)" ]; then - sed -i 's/clock_args=\"/clock_args=\" -f \/dev\/rtc/' /etc/conf.d/hwclock -fi - exit 0 diff --git a/device/community/device-nokia-n900/device-nokia-n900.pre-upgrade b/device/community/device-nokia-n900/device-nokia-n900.pre-upgrade new file mode 100644 index 000000000..f7f8588f1 --- /dev/null +++ b/device/community/device-nokia-n900/device-nokia-n900.pre-upgrade @@ -0,0 +1,6 @@ +#!/bin/sh + +postmarketos-mvcfg-pre-upgrade \ + device-nokia-n900 \ + /etc/conf.d/hwclock +