summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-01-18 23:12:41 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-01-18 23:12:41 +0000
commit201843413dd7ed16316ddc5d6ac4907a687f8318 (patch)
treee41ede7d77a703dcfab2383090de0a3e20c93078
parenteb3e87242c3293d3634f09344d4b6b7cfeecb8c4 (diff)
let's try enabling autologin for the live session
-rwxr-xr-xredcorelive-openrc.sh37
1 files changed, 20 insertions, 17 deletions
diff --git a/redcorelive-openrc.sh b/redcorelive-openrc.sh
index 0cee802..7ae3ba0 100755
--- a/redcorelive-openrc.sh
+++ b/redcorelive-openrc.sh
@@ -1,37 +1,39 @@
#!/usr/bin/env bash
export local liveuser="redcore"
-export local livepasswd="redcore_live"
-checkroot() {
+checkRoot() {
if [[ "$(whoami)" != root ]] ; then
- echo "No root, no play! Bye bye!"
exit 1
fi
}
-redcore_is_live() {
+checkLive() {
if [[ ! -L "/dev/mapper/live-rw" ]] ; then
- echo "The system is not running in live mode, aborting!"
exit 1
fi
}
-redcore_add_live_user() {
+addLive() {
/usr/sbin/useradd -u 1000 -g 100 -o -m -s /bin/bash "$liveuser" > /dev/null 2>&1
}
-redcore_live_user_groups() {
+liveGroups() {
for group in tty disk lp lpadmin wheel uucp console audio cdrom input tape games video cdrw usb plugdev messagebus portage smbshare ; do
/usr/bin/gpasswd -a "$liveuser" "$group" > /dev/null 2>&1
done
}
-redcore_live_user_password() {
- echo "$liveuser":"$livepasswd" | /usr/sbin/chpasswd > /dev/null 2>&1
+livePasswd() {
+ passwd -d "$liveuser" > /dev/null 2>&1
}
-redcore_live_locale_switch() {
+liveLogin() {
+ sed -e "0,/User=/s//User=redcore/" -e "0,/Session=/s//Session=plasma/" /etc/sddm.conf | tee /etc/sddm.conf.live > /dev/null 2>&1
+ mv /etc/sddm.conf.live /etc/sddm.conf > /dev/null 2>&1
+}
+
+liveLocales() {
export local keymap_toset="$(cat /proc/cmdline | cut -d " " -f5 | cut -d "=" -f2)"
export local lang_toset="$(cat /proc/cmdline | cut -d " " -f6 | cut -d "=" -f2)"
if [[ "$lang_toset" != "en_US.utf8" ]] || [[ "$keymap_toset" != "us" ]] ; then
@@ -45,19 +47,20 @@ redcore_live_locale_switch() {
fi
}
-redcore_live_installer_desktop() {
+liveInstaller() {
cp "/usr/share/applications/calamares.desktop" "/home/"$liveuser"/Desktop"
sed -i "s/"Name=Calamares"/"Name=Redcore\ Installer"/g" "/home/"$liveuser"/Desktop/calamares.desktop"
chmod 755 "/home/"$liveuser"/Desktop/calamares.desktop"
}
main() {
- if checkroot && redcore_is_live ; then
- redcore_add_live_user
- redcore_live_user_groups
- redcore_live_user_password
- redcore_live_installer_desktop
- redcore_live_locale_switch
+ if checkRoot && checkLive ; then
+ addLive
+ liveGroups
+ livePasswd
+ liveLogin
+ liveLocales
+ liveInstaller
fi
}