2017-05-26 20:26:25 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-07-21 19:46:40 +00:00
|
|
|
. /etc/deviceinfo
|
|
|
|
|
2017-09-29 16:10:09 +00:00
|
|
|
# Enable udev OpenRC services and runlevels
|
|
|
|
# https://github.com/alpinelinux/aports/blob/master/main/eudev/setup-udev
|
|
|
|
setup-udev -n
|
|
|
|
|
|
|
|
# Enable other OpenRC services
|
2017-05-26 20:26:25 +00:00
|
|
|
for service in devfs dmesg; do
|
|
|
|
rc-update -q add $service sysinit
|
|
|
|
done
|
2017-07-30 13:19:43 +00:00
|
|
|
for service in hwclock modules sysctl hostname bootmisc syslog; do
|
2017-05-26 20:26:25 +00:00
|
|
|
rc-update -q add $service boot
|
|
|
|
done
|
2017-09-29 16:10:09 +00:00
|
|
|
for service in dbus haveged sshd swapfile wpa_supplicant; do
|
2017-05-26 20:26:25 +00:00
|
|
|
rc-update -q add $service default
|
|
|
|
done
|
|
|
|
for service in mount-ro killprocs savecache; do
|
|
|
|
rc-update -q add $service shutdown
|
|
|
|
done
|
2017-09-18 19:17:30 +00:00
|
|
|
if [ "${deviceinfo_msm_refresher}" = "true" ]; then
|
|
|
|
rc-update -q add msm-fb-refresher boot
|
|
|
|
fi
|
2017-05-26 20:26:25 +00:00
|
|
|
|
|
|
|
# Add user account
|
|
|
|
adduser -u 1000 -D -h /home/user -G users user 2>/dev/null
|
|
|
|
|
2017-07-05 18:52:37 +00:00
|
|
|
# Adjust welcome messages /etc (unless the files have been modified)
|
|
|
|
if ! apk audit /etc | grep -q etc/issue; then
|
|
|
|
{
|
|
|
|
echo 'Welcome to postmarketOS'
|
|
|
|
echo 'Kernel \r on an \m (\l)'
|
|
|
|
} >/etc/issue
|
|
|
|
fi
|
|
|
|
if ! apk audit /etc | grep -q etc/motd; then
|
|
|
|
{
|
|
|
|
echo 'Welcome to postmarketOS!'
|
|
|
|
echo ''
|
|
|
|
echo 'This distribution is based on Alpine Linux.'
|
|
|
|
echo 'Read both our wikis to find a large amount of how-to guides and'
|
|
|
|
echo 'general information about administrating and development.'
|
2017-09-21 19:56:59 +00:00
|
|
|
echo 'See <https://wiki.postmarketos.org> and <https://wiki.alpinelinux.org>.'
|
2017-07-05 18:52:37 +00:00
|
|
|
echo ''
|
|
|
|
echo 'You may change this message by editing /etc/motd.'
|
|
|
|
echo ''
|
|
|
|
} >/etc/motd
|
|
|
|
fi
|
2017-07-25 05:02:51 +00:00
|
|
|
|
|
|
|
# Enable syslog to SHM. Note: size is 4048KiB, which *should* be More Than Enough(TM) for all but the most chattiest of devices.
|
|
|
|
sed s/=\"/=\""-C4048 "/ -i /etc/conf.d/syslog
|
2017-09-15 17:44:50 +00:00
|
|
|
|
|
|
|
# Enable wext, nl80211 & dbus control for wpa_supplicant
|
|
|
|
if ! grep -q Dwext /etc/conf.d/wpa_supplicant; then
|
2017-09-16 00:01:25 +00:00
|
|
|
sed -i 's/wpa_supplicant_args=\"/wpa_supplicant_args=\" -u -Dwext,nl80211/' /etc/conf.d/wpa_supplicant
|
2017-09-15 17:44:50 +00:00
|
|
|
fi
|
|
|
|
touch /etc/wpa_supplicant/wpa_supplicant.conf
|
|
|
|
|