From 0b8814d156d827a97ceafb6b46c882aae15bbf50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= Date: Sun, 30 Jul 2023 10:13:51 +0200 Subject: [PATCH] main/devicepkg-utils: install default /etc/deviceinfo (MR 4283) Previously, every device package would package its own /etc/deviceinfo file, generating a conflict with every other device package. In a previous commit we have moved the path to /usr/share/deviceinfo, but we still want to install a sample "/etc/deviceinfo" file to guide users on how to use the new features. This has the additional benefit that there is only one of those files in the whole distro. However, there is no dependency ordering between the device packages and devicepkg-utils, so there's no warranty of which will be installed first. Therefore, to avoid a conflict on most likely every user upgrade, we use postmarketos-mvcfg. --- main/devicepkg-utils/APKBUILD | 13 +++++++++++-- main/devicepkg-utils/devicepkg-utils.pre-upgrade | 5 +++++ main/devicepkg-utils/etc-deviceinfo | 8 ++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 main/devicepkg-utils/devicepkg-utils.pre-upgrade create mode 100644 main/devicepkg-utils/etc-deviceinfo diff --git a/main/devicepkg-utils/APKBUILD b/main/devicepkg-utils/APKBUILD index 14573a7f5..2035d3ed1 100644 --- a/main/devicepkg-utils/APKBUILD +++ b/main/devicepkg-utils/APKBUILD @@ -1,16 +1,25 @@ pkgname=devicepkg-utils pkgver=0.2.0 -pkgrel=0 +pkgrel=1 pkgdesc="Utilities for interacting with device packages" url="https://postmarketos.org" arch="noarch" license="MIT" -source="source_deviceinfo" +depends="postmarketos-mvcfg" +install="$pkgname.pre-upgrade" +source=" + etc-deviceinfo + source_deviceinfo +" options="!check" package() { install -Dm644 "$srcdir"/source_deviceinfo -t "$pkgdir"/usr/share/misc + + install -Dm644 "$srcdir"/etc-deviceinfo "$pkgdir"/etc/deviceinfo + postmarketos-mvcfg-package "$pkgdir" "$pkgname" } sha512sums=" +ef2181d7072b4ef62c11d3f50677fcd455e50cf89a3110e67fcaa6058ea695f101ded48b1442758494e3d23a97cdd93df6669656f329037020ba715af4341b55 etc-deviceinfo a6e4f57280bed21fe3ac480eaa582c14fa8337d77386ff92c3e271818b5a028cac2a4f557ecfe9f7432e23a6dadd33bdc6b429a0e5e29cce2602b2a6e58a8bdd source_deviceinfo " diff --git a/main/devicepkg-utils/devicepkg-utils.pre-upgrade b/main/devicepkg-utils/devicepkg-utils.pre-upgrade new file mode 100644 index 000000000..dbc9ed94a --- /dev/null +++ b/main/devicepkg-utils/devicepkg-utils.pre-upgrade @@ -0,0 +1,5 @@ +#!/bin/sh + +postmarketos-mvcfg-pre-upgrade \ + devicepkg-utils \ + /etc/deviceinfo diff --git a/main/devicepkg-utils/etc-deviceinfo b/main/devicepkg-utils/etc-deviceinfo new file mode 100644 index 000000000..89b88e400 --- /dev/null +++ b/main/devicepkg-utils/etc-deviceinfo @@ -0,0 +1,8 @@ +# Override settings from /usr/share/deviceinfo/deviceinfo with this file. +# After modifying: Some settings require running "mkinitfs" as root and/or +# a reboot to apply. +# Reference: https://postmarketos.org/deviceinfo + +# Examples: +# deviceinfo_kernel_cmdline_append=" PMOS_NOSPLASH" +# deviceinfo_usb_network_function="ncm.usb0"