Change password and add livesys script

Change password to fedora_rocks! and add livesys script (based on
fedora-live-base.ks)

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
This commit is contained in:
David Abdurachmanov 2019-10-30 18:42:05 +02:00
parent 792fbaa6d4
commit 8389944248
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
1 changed files with 28 additions and 4 deletions

View File

@ -9,7 +9,7 @@ lang en_US.UTF-8
keyboard us
# short hostname still allows DHCP to assign domain name
network --bootproto dhcp --device=link --hostname=fedora-riscv
rootpw --plaintext fedora_riscv
rootpw --plaintext fedora_rocks!
firewall --enabled --ssh
timezone --utc America/New_York
selinux --disabled
@ -230,6 +230,10 @@ dejavu-serif-fonts
-grubby
grubby-deprecated
# no longer in @core since 2018-10, but needed for livesys script
initscripts
chkconfig
%end
%post
@ -248,10 +252,30 @@ sed -i 's|noatime|noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=
# Fedora 31
# https://fedoraproject.org/wiki/Changes/DisableRootPasswordLoginInSshd
cat > /etc/rc.d/init.d/livesys << EOF
#!/bin/bash
#
# live: Init script for live image
#
# chkconfig: 345 00 99
# description: Init script for live image.
### BEGIN INIT INFO
# X-Start-Before: display-manager chronyd
### END INIT INFO
. /etc/rc.d/init.d/functions
useradd -c "Fedora RISCV User" riscv
echo fedora_riscv | passwd --stdin riscv > /dev/null
echo fedora_rocks! | passwd --stdin riscv > /dev/null
usermod -aG wheel riscv > /dev/null
exit 0
EOF
chmod 755 /etc/rc.d/init.d/livesys
/sbin/restorecon /etc/rc.d/init.d/livesys
/sbin/chkconfig --add livesys
# Create Fedora RISC-V repo
cat << EOF > /etc/yum.repos.d/fedora-riscv.repo
[fedora-riscv]
@ -301,9 +325,9 @@ Build date: $(date --utc)
Kernel \r on an \m (\l)
The root password is 'fedora_riscv'.
The root password is 'fedora_rocks!'.
root password logins are disabled in SSH starting Fedora 31.
User 'riscv' with password 'fedora_riscv' in 'wheel' group is provided.
User 'riscv' with password 'fedora_rocks!' in 'wheel' group is provided.
To install new packages use 'dnf install ...'