8b7adeddf3
Do not change config files in post-install scripts anymore (with sed
commands or by other means). Instead, ship the files inside the packages
and use "replaces", so apk allows the package to overwrite files from
other packages:
https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#replaces
Notes on specific files:
* /etc/elogind/logind.conf: original file only consists of commented out
compile defaults. Copy them over for now. In the future we should be
able to install our own config into a .d directory, without all the
comments: 8358fc5950
* /etc/fstab: original file only has /dev/cdrom and /dev/usbdisk
entries, which are not useful for postmarketOS:
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/alpine-baselayout/APKBUILD
* /etc/motd: reformat the text, add link to the chat
* /etc/conf.d/syslog: original file only contained 'SYSLOGD_OPTS="-t"',
make the override file as if the sed statement from post-install was
executed
* /etc/wpa_supplicant/wpa_supplicant.conf: post-install script touches
this file. We probably added it back in 2017 in relation to enabling
D-Bus (though the PR does not mention it explicity), but at least with
the current init.d script of NetworkManager, we can simply have '-u' in
wpa_supplicant_args:
https://github.com/postmarketOS/pmbootstrap/pull/578
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/wpa_supplicant/wpa_supplicant.initd
* /etc/sudoers: base on original /etc/sudoers, but remove all the
commented out stuff except for the visudo note at the top. We could
also put a file in /etc/sudoers.d, but since the wheel line is present
in the original /etc/sudoers and only commented out, it would be kind
of unexpected to enable it in a file in /etc/sudoers.d. I prefer this
stripped down version of the file, that is easy to read.
26 lines
711 B
Bash
26 lines
711 B
Bash
#!/bin/sh -e
|
|
|
|
# Enable udev OpenRC services and runlevels
|
|
# https://github.com/alpinelinux/aports/blob/master/main/eudev/setup-udev
|
|
setup-udev -n
|
|
|
|
# Enable other OpenRC services
|
|
for service in devfs dmesg devmappings; do
|
|
rc-update -q add $service sysinit
|
|
done
|
|
for service in hwclock modules sysctl hostname bootmisc syslog; do
|
|
rc-update -q add $service boot
|
|
done
|
|
for service in dbus haveged sshd swapfile wpa_supplicant chronyd local networkmanager rfkill; do
|
|
rc-update -q add $service default
|
|
done
|
|
for service in mount-ro killprocs savecache; do
|
|
rc-update -q add $service shutdown
|
|
done
|
|
|
|
# Prime swclock with a reasonable date/time on first boot
|
|
mkdir -p /run/openrc
|
|
touch /run/openrc/shutdowntime
|
|
|
|
exit 0
|
|
|