don't use systemd commands, since they don't work afterall on systems that are not booted

This commit is contained in:
Dan Johansen 2019-10-29 14:14:21 +01:00
parent afbee68e4a
commit 606e020d20
1 changed files with 17 additions and 17 deletions

View File

@ -28,6 +28,7 @@ SDDEV=""
DEV_NAME="" DEV_NAME=""
TIMEZONE="" TIMEZONE=""
LOCALE="" LOCALE=""
HOSTNAME=""
# check if root # check if root
if [ "$EUID" -ne 0 ]; then if [ "$EUID" -ne 0 ]; then
@ -159,6 +160,13 @@ create_install() {
info "Applying overlay for $EDITION..." info "Applying overlay for $EDITION..."
cp -ap $TMPDIR/arm-profiles/overlays/$EDITION/* $TMPDIR/root/ cp -ap $TMPDIR/arm-profiles/overlays/$EDITION/* $TMPDIR/root/
info "Enabling user services..."
if [[ "$EDITION" = "minimal" ]] || [[ "$EDITION" = "server" ]]; then
echo "No user services for $EDITION edition"
else
$NSPAWN $TMPDIR/root --user $(cat $TMPDIR/user) systemctl --user enable pulseaudio.service 1> /dev/null 2>&1
fi
info "Setting up users..." info "Setting up users..."
#setup users #setup users
echo "$USER" > $TMPDIR/user echo "$USER" > $TMPDIR/user
@ -173,13 +181,6 @@ create_install() {
$NSPAWN $TMPDIR/root usermod -aG $USERGROUPS $(cat $TMPDIR/user) 1> /dev/null 2>&1 $NSPAWN $TMPDIR/root usermod -aG $USERGROUPS $(cat $TMPDIR/user) 1> /dev/null 2>&1
$NSPAWN $TMPDIR/root chfn -f "$FULLNAME" $(cat $TMPDIR/user) 1> /dev/null 2>&1 $NSPAWN $TMPDIR/root chfn -f "$FULLNAME" $(cat $TMPDIR/user) 1> /dev/null 2>&1
info "Enabling user services..."
if [[ "$EDITION" = "minimal" ]] || [[ "$EDITION" = "server" ]]; then
msg "No user services for $EDITION edition"
else
$NSPAWN $TMPDIR/root --user $(cat $TMPDIR/user) systemctl --user enable pulseaudio.service 1> /dev/null 2>&1
fi
info "Setting up system settings..." info "Setting up system settings..."
#system setup #system setup
$NSPAWN $TMPDIR/root chmod u+s /usr/bin/ping 1> /dev/null 2>&1 $NSPAWN $TMPDIR/root chmod u+s /usr/bin/ping 1> /dev/null 2>&1
@ -187,15 +188,14 @@ create_install() {
rm -f $TMPDIR/root/etc/ca-certificates/extracted/tls-ca-bundle.pem rm -f $TMPDIR/root/etc/ca-certificates/extracted/tls-ca-bundle.pem
cp -a /etc/ssl/certs/ca-certificates.crt $TMPDIR/root/etc/ssl/certs/ cp -a /etc/ssl/certs/ca-certificates.crt $TMPDIR/root/etc/ssl/certs/
cp -a /etc/ca-certificates/extracted/tls-ca-bundle.pem $TMPDIR/root/etc/ca-certificates/extracted/ cp -a /etc/ca-certificates/extracted/tls-ca-bundle.pem $TMPDIR/root/etc/ca-certificates/extracted/
$NSPAWN $TMPDIR/root timedatectl set-timezone $TIMEZONE 1> /dev/null 2>&1 $NSPAWN $TMPDIR/root ln -sf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime 1> /dev/null 2>&1
$NSPAWN $TMPDIR/root timedatectl set-ntp true 1> /dev/null 2>&1
$NSPAWN $TMPDIR/root sed -i s/"#$LOCALE"/"$LOCALE"/g /etc/locale.gen 1> /dev/null 2>&1 $NSPAWN $TMPDIR/root sed -i s/"#$LOCALE"/"$LOCALE"/g /etc/locale.gen 1> /dev/null 2>&1
$NSPAWN $TMPDIR/root locale-gen 1> /dev/null 2>&1 echo "LANG=$LOCALE" | tee --append $TMPDIR/root/etc/locale.conf 1> /dev/null 2>&1
$NSPAWN $TMPDIR/root localectl set-locale $LOCALE 1> /dev/null 2>&1 $NSPAWN $TMPDIR/root locale-gen
if [[ "$SYSTEM" != "Pinebook" ]]; then echo "KEYMAP=$KEYMAP" | tee --append $TMPDIR/root/etc/vconsole.conf 1> /dev/null 2>&1
$NSPAWN $TMPDIR/root localectl set-keymap $KEYMAP 1> /dev/null 2>&1 $NSPAWN $TMPDIR/root localectl set-x11-keymap $KEYMAP 1> /dev/null 2>&1
fi echo "$HOSTNAME" | tee --append $TMPDIR/root/etc/hostname 1> /dev/null 2>&1
$NSPAWN $TMPDIR/root hostnamectl set-hostname $HOSTNAME 1> /dev/null 2>&1
chown -R root:root $TMPDIR/root/etc 1> /dev/null 2>&1 chown -R root:root $TMPDIR/root/etc 1> /dev/null 2>&1
if [[ "$EDITION" != "minimal" && "$EDITION" != "server" ]]; then if [[ "$EDITION" != "minimal" && "$EDITION" != "server" ]]; then
chown root:polkitd $TMPDIR/root/etc/polkit-1/rules.d 1> /dev/null 2>&1 chown root:polkitd $TMPDIR/root/etc/polkit-1/rules.d 1> /dev/null 2>&1