From 58ae4df2ef583ec7d95e40e72f24a2113eed2d85 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 6 Jul 2020 15:32:57 +0200 Subject: [PATCH] main/postmarketos-base: rm write_unless_modified (MR 1398) Get rid of the "write_unless_modified" code, which was supposed to only change /etc/fstab, /etc/issue, /etc/motd if the user did not modify it. This is nice in theory, but we have a bug report where the code did not do what it should (apk audit possibly failed due to a qemu bug?), and then it lead to strange bugs related to not having the expected /etc/fstab installed. Fixes: #661, #258 --- main/postmarketos-base/APKBUILD | 2 +- .../postmarketos-base.post-install | 23 +++++-------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/main/postmarketos-base/APKBUILD b/main/postmarketos-base/APKBUILD index 6ec07f7eb..5de9dedfb 100644 --- a/main/postmarketos-base/APKBUILD +++ b/main/postmarketos-base/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-base pkgver=3 -pkgrel=34 +pkgrel=35 pkgdesc="Meta package for minimal postmarketOS base" url="https://postmarketos.org" arch="noarch" diff --git a/main/postmarketos-base/postmarketos-base.post-install b/main/postmarketos-base/postmarketos-base.post-install index 54b764a4d..eabb75135 100644 --- a/main/postmarketos-base/postmarketos-base.post-install +++ b/main/postmarketos-base/postmarketos-base.post-install @@ -22,36 +22,25 @@ done mkdir -p /run/openrc touch /run/openrc/shutdowntime -# Replace a config file from stock Alpine, unless apk reports that the user has -# modified it (note that this does not allow properly updating these configs -# when postmarketos-base gets updated yet, see issue pmaports#258). -write_unless_modified() { - # Redirect the stdin to the file unless it has been modified - # $1: file path - if apk audit "$(dirname "$1")" | grep -q "${1:1}"; then - echo "- NOT modifying (file was changed before): $1" - else - echo "- Modifying: $1" - cat > "$1" - fi -} - # Install /etc/fstab +echo "- Modifying: /etc/fstab" { echo '# ' echo 'LABEL="pmOS_root" / ext4 relatime,data=ordered 0 1' echo 'LABEL="pmOS_boot" /boot auto defaults 0 2' -} | write_unless_modified /etc/fstab +} >/etc/fstab # Set /etc/issue +echo "- Modifying: /etc/issue" { echo 'Welcome to postmarketOS' echo 'Kernel \r on an \m (\l)' # setterm -powersave on -blank 5 echo -ne "\033[9;5]" -} | write_unless_modified /etc/issue +} >/etc/issue # Set /etc/motd +echo "- Modifying: /etc/motd" { echo 'Welcome to postmarketOS!' echo '' @@ -62,7 +51,7 @@ write_unless_modified() { echo '' echo 'You may change this message by editing /etc/motd.' echo '' -} | write_unless_modified /etc/motd +} >/etc/motd # Enable syslog to SHM. Note: size is 4048KiB, which *should* be More Than Enough(TM) for all but the most chattiest of devices. echo "- Modifying: /etc/conf.d/syslog"