diff options
author | Carlo Landmeter <clandmeter@alpinelinux.org> | 2018-06-28 19:34:34 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@alpinelinux.org> | 2018-06-28 19:34:34 +0000 |
commit | d56680f9b8a739795428e350f8bae1e7536936b3 (patch) | |
tree | cb0c66fe32ca1c0f697ae4bbac0352eee7db54b5 /main | |
parent | cfd49c0ec7fdfbf734f35919f0a277a85efdbdb5 (diff) | |
download | aports-d56680f9b8a739795428e350f8bae1e7536936b3.tar.bz2 aports-d56680f9b8a739795428e350f8bae1e7536936b3.tar.xz |
main/mkinitfs: use swclock when no rtc is found
Diffstat (limited to 'main')
-rw-r--r-- | main/mkinitfs/0001-init-use-swclock-when-no-rtc-is-found.patch | 53 | ||||
-rw-r--r-- | main/mkinitfs/APKBUILD | 8 |
2 files changed, 58 insertions, 3 deletions
diff --git a/main/mkinitfs/0001-init-use-swclock-when-no-rtc-is-found.patch b/main/mkinitfs/0001-init-use-swclock-when-no-rtc-is-found.patch new file mode 100644 index 0000000000..b2885ab8f9 --- /dev/null +++ b/main/mkinitfs/0001-init-use-swclock-when-no-rtc-is-found.patch @@ -0,0 +1,53 @@ +From 2e1b258ad16da7bb825a70038eb91564fdf33a8d Mon Sep 17 00:00:00 2001 +From: Carlo Landmeter <clandmeter@alpinelinux.org> +Date: Thu, 28 Jun 2018 19:14:20 +0000 +Subject: [PATCH] init: use swclock when no rtc is found + +--- + initramfs-init.in | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/initramfs-init.in b/initramfs-init.in +index d6f90a2..8233af4 100755 +--- a/initramfs-init.in ++++ b/initramfs-init.in +@@ -269,6 +269,14 @@ setup_nbd() { + [ "$n" != 0 ] || return 1 + } + ++rtc_exists() { ++ local rtc= ++ for rtc in /dev/rtc /dev/rtc[0-9]*; do ++ [ -e "$rtc" ] && break ++ done ++ [ -e "$rtc" ] ++} ++ + # read the kernel options. we need surve things like: + # acpi_osi="!Windows 2006" xen-pciback.hide=(01:00.0) + set -- $(cat /proc/cmdline) +@@ -541,7 +549,6 @@ if [ -f "$sysroot/etc/.default_boot_services" -o ! -f "$ovl" ]; then + rc_add hwdrivers sysinit + rc_add modloop sysinit + +- rc_add hwclock boot + rc_add modules boot + rc_add sysctl boot + rc_add hostname boot +@@ -642,6 +649,13 @@ if [ -n "$KOPT_ssh_key" ]; then + rc_add sshd default + fi + ++# use swclock if no RTC is found ++if rtc_exists; then ++ rc_add hwclock boot ++else ++ rc_add swclock boot ++fi ++ + apkflags="--initramfs-diskless-boot --progress" + if [ -z "$ALPINE_REPO" ]; then + apkflags="$apkflags --no-network" +-- +2.18.0 + diff --git a/main/mkinitfs/APKBUILD b/main/mkinitfs/APKBUILD index 5be902c012..935187bb5a 100644 --- a/main/mkinitfs/APKBUILD +++ b/main/mkinitfs/APKBUILD @@ -2,7 +2,7 @@ pkgname=mkinitfs pkgver=3.3.0 _ver=${pkgver%_git*} -pkgrel=1 +pkgrel=2 pkgdesc="Tool to generate initramfs images for Alpine" url="https://git.alpinelinux.org/cgit/mkinitfs" arch="all" @@ -16,7 +16,8 @@ depends="busybox>=1.28.2-r1 apk-tools>=2.9.1 lddtree>=1.25" install="$pkgname.pre-upgrade $pkgname.post-install $pkgname.post-upgrade" triggers="$pkgname.trigger=/usr/share/kernel/*" source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$_ver.tar.xz - 0001-features-add-vc4-to-kms-for-rpi.patch" + 0001-features-add-vc4-to-kms-for-rpi.patch + 0001-init-use-swclock-when-no-rtc-is-found.patch" builddir="$srcdir/$pkgname-$_ver" build() { @@ -30,4 +31,5 @@ package() { } sha512sums="dbbb97fda1c2febe5fc226072232ffeb69c03fb9173c0434d5cecc6e4fda2e62a1f725a3083d1bedc2397cbf3b95ce28628788d70b4440902ee3648db738c2c9 mkinitfs-3.3.0.tar.xz -f1f5de4b5825ab221f7f929bf36e121217f34f36cfdec153ceb829f0fad6f63ea057239aa84690792f6d701d350d2dca375fcf91e05862394f8aaa0181a1ed58 0001-features-add-vc4-to-kms-for-rpi.patch" +f1f5de4b5825ab221f7f929bf36e121217f34f36cfdec153ceb829f0fad6f63ea057239aa84690792f6d701d350d2dca375fcf91e05862394f8aaa0181a1ed58 0001-features-add-vc4-to-kms-for-rpi.patch +8b915a381f6cf6d8a751ed89b43004ce3e4861556c9753c7f05cb8fa561b744acd51cda0a7c6228cd916e350ee493cc2fa8818593faa2d0eb2d06f400c571154 0001-init-use-swclock-when-no-rtc-is-found.patch" |