Commit 6042aefa authored by Bernhard Landauer's avatar Bernhard Landauer
parents f1f094c3 681f6117
......@@ -5,7 +5,8 @@ SYSCONFDIR = /etc
BIN = \
bin/manjaro-live \
bin/mhwd-live
bin/mhwd-live \
bin/mhwd-live-net
XBIN = \
bin/desktop-items \
......@@ -29,13 +30,17 @@ RC = \
data/rc/gnupg-mount \
data/rc/manjaro-live \
data/rc/mhwd-live \
data/rc/mhwd-live-net \
data/rc/mirrors-live \
data/rc/mirrors-live-net \
data/rc/pacman-init
SD = \
data/sd/manjaro-live.service \
data/sd/mirrors-live.service \
data/sd/mhwd-live.service
data/sd/mhwd-live.service \
data/sd/mhwd-live-net.service \
data/sd/mirrors-live-net.service
all: $(BIN) $(RC) $(XBIN)
......
......@@ -30,11 +30,7 @@ echo "Activated swap and added to fstab: $(elapsed_time_ms ${livetimer})ms" >> /
livetimer=$(get_timer_ms)
configure_language
echo "Languaged configured: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
livetimer=$(get_timer_ms)
configure_clock
echo "Configured clock: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
echo "Finished localization: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
livetimer=$(get_timer_ms)
configure_user
......@@ -60,14 +56,16 @@ livetimer=$(get_timer_ms)
configure_user_root /
echo "Configured root user: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
livetimer=$(get_timer_ms)
configure_samba
echo "Configured samba: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
if [[ -f /usr/bin/samba ]];then
livetimer=$(get_timer_ms)
configure_samba
echo "Configured samba: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
fi
livetimer=$(get_timer_ms)
# load dm-mod
modprobe dm-mod
echo "Load dm-mod: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
# livetimer=$(get_timer_ms)
# # load dm-mod
# modprobe dm-mod
# echo "Load dm-mod: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
livetimer=$(get_timer_ms)
configure_pulse
......
#!/bin/sh
[[ -r @libdir@/util-live.sh ]] && source @libdir@/util-live.sh
USENONFREE="$(kernel_cmdline nonfree no)"
MODULES_DIR='/etc/calamares/modules'
echo "Setting MHWD nonfree driver: ${USENONFREE} ..." >> /var/log/mhwd-live.log
if [[ "${USENONFREE}" == "yes" ]] || [[ "${USENONFREE}" == "true" ]]; then
sed -e "s|^.*driver:.*|driver: nonfree|" -i "${MODULES_DIR}/mhwdcfg.conf"
else
sed -e "s|^.*driver:.*|driver: free|" -i "${MODULES_DIR}/mhwdcfg.conf"
fi
echo "MHWD DONE" >> /var/log/mhwd-live.log
#!/usr/bin/openrc-run
# Copyright 2014 Aaditya Bagga (aaditya_gnulinux@zoho.com)
# Distributed under the terms of the GNU General Public License v2
depend() {
need manjaro-live
before xdm
after pacman-init
}
start() {
ebegin "Running mhwd-live script"
# run the mhwd script
/usr/bin/mhwd-live-net &> /dev/null
eend $?
}
#!/usr/bin/openrc-run
# Copyright 2016 artoo (artoo@manjaro.org)
# Distributed under the terms of the GNU General Public License v2
description="Pacman mirrors ranking"
depend() {
need net
}
start() {
ebegin "Running mirrors ranking"
/usr/bin/pacman-mirrors -m rank --geoip
eend $?
}
[Unit]
Description=LiveMedia MHWD net Script
Before=systemd-user-sessions.service
[Service]
Type=oneshot
ExecStart=/usr/bin/mhwd-live-net
[Install]
WantedBy=multi-user.target
[Unit]
Description=LiveMedia Pacman mirrors ranking script
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/bin/pacman-mirrors -m rank --geoip
[Install]
WantedBy=multi-user.target
......@@ -21,16 +21,16 @@ kernel_cmdline(){
return 1
}
get_country(){
get_lang(){
echo $(kernel_cmdline lang)
}
get_keyboard(){
get_keytable(){
echo $(kernel_cmdline keytable)
}
get_layout(){
echo $(kernel_cmdline layout)
get_tz(){
echo $(kernel_cmdline tz)
}
get_timer_ms(){
......@@ -113,16 +113,6 @@ configure_accountsservice(){
fi
}
set_sddm_ck(){
local halt='/usr/bin/shutdown -h -P now' \
reboot='/usr/bin/shutdown -r now'
sed -e "s|^.*HaltCommand=.*|HaltCommand=${halt}|" \
-e "s|^.*RebootCommand=.*|RebootCommand=${reboot}|" \
-e "s|^.*MinimumVT=.*|MinimumVT=7|" \
-i "/etc/sddm.conf"
gpasswd -a sddm video &> /dev/null
}
set_lightdm_greeter(){
local greeters=$(ls /usr/share/xgreeters/*greeter.desktop) name
for g in ${greeters[@]};do
......@@ -137,17 +127,24 @@ set_sddm_ck(){
done
}
set_lightdm_ck(){
set_lightdm_vt(){
sed -i -e 's/^.*minimum-vt=.*/minimum-vt=7/' /etc/lightdm/lightdm.conf
sed -i -e 's/pam_systemd.so/pam_ck_connector.so nox11/' /etc/pam.d/lightdm-greeter
}
configure_samba(){
if [[ -f /usr/bin/samba ]];then
local conf=/etc/samba/smb.conf
cp /etc/samba/smb.conf.default $conf
sed -e "s|^.*workgroup =.*|workgroup = ${smb_workgroup}|" -i $conf
fi
# set_sddm_elogind(){
# gpasswd -a sddm video &> /dev/null
# }
set_pam(){
for conf in /etc/pam.d/*;do
sed -e 's|systemd.so|elogind.so|g' -i $conf
done
}
configure_samba(){
local conf=/etc/samba/smb.conf
cp /etc/samba/smb.conf.default $conf
sed -e "s|^.*workgroup =.*|workgroup = ${smb_workgroup}|" -i $conf
}
configure_displaymanager(){
......@@ -155,7 +152,7 @@ configure_displaymanager(){
# Configure display manager
if [[ -f /usr/bin/lightdm ]];then
groupadd -r autologin
[[ -f /usr/bin/openrc ]] && set_lightdm_ck
[[ -d /run/openrc ]] && set_lightdm_vt
set_lightdm_greeter
if $(is_valid_de); then
sed -i -e "s/^.*user-session=.*/user-session=$default_desktop_file/" /etc/lightdm/lightdm.conf
......@@ -176,7 +173,6 @@ configure_displaymanager(){
sed -i "s|default.desktop|$default_desktop_file.desktop|g" /etc/mdm/custom.conf
fi
elif [[ -f /usr/bin/sddm ]];then
[[ -f /usr/bin/openrc ]] && set_sddm_ck
if $(is_valid_de); then
sed -i -e "s|^Session=.*|Session=$default_desktop_file.desktop|" /etc/sddm.conf
fi
......@@ -191,6 +187,7 @@ configure_displaymanager(){
sed -i -e "s/^.*autologin=.*/autologin=${username}/" /etc/lxdm/lxdm.conf
fi
fi
[[ -d /run/openrc ]] && set_pam
}
gen_pw(){
......@@ -246,7 +243,7 @@ write_x11_config(){
# layout not found, use KBLAYOUT
if [[ -z "$X11_LAYOUT" ]]; then
X11_LAYOUT="$KBLAYOUT"
X11_LAYOUT="${keytable}"
fi
# create X11 keyboard layout config
......@@ -266,40 +263,36 @@ write_x11_config(){
}
configure_language(){
# hack to be able to set the locale on bootup
local LOCALE=$(get_country)
local KEYMAP=$(get_keyboard)
local KBLAYOUT=$(get_layout)
# this is needed for efi, it doesn't set any cmdline
[[ -z "$LOCALE" ]] && LOCALE="en_US"
[[ -z "$KEYMAP" ]] && KEYMAP="us"
[[ -z "$KBLAYOUT" ]] && KBLAYOUT="us"
local TLANG=${LOCALE%.*}
sed -i -r "s/#(${TLANG}.*UTF-8)/\1/g" /etc/locale.gen
echo "LANG=${LOCALE}.UTF-8" >> /etc/environment
if [[ -f /usr/bin/openrc ]]; then
sed -i "s/keymap=.*/keymap=\"${KEYMAP}\"/" /etc/conf.d/keymaps
fi
echo "KEYMAP=${KEYMAP}" > /etc/vconsole.conf
echo "LANG=${LOCALE}.UTF-8" > /etc/locale.conf
write_x11_config
# hack to be able to set the locale on bootup
local lang=$(get_lang)
keytable=$(get_keytable)
local timezone=$(get_tz)
# Fallback
#[[ -z "${lang}" ]] && lang="en_US"
#[[ -z "${keytable}" ]] && keytable="us"
#[[ -z "${timezone}" ]] && timezone="Europe/London"
sed -e "s/#${lang}.UTF-8/${lang}.UTF-8/" -i /etc/locale.gen
# echo "LANG=${lang}.UTF-8" >> /etc/environment
if [[ -d /run/openrc ]]; then
sed -i "s/keymap=.*/keymap=\"${keytable}\"/" /etc/conf.d/keymaps
ln -sf /usr/share/zoneinfo/${timezone} /etc/timezone
else
ln -sf /usr/share/zoneinfo/${timezone} /etc/localtime
fi
echo "KEYMAP=${keytable}" > /etc/vconsole.conf
echo "LANG=${lang}.UTF-8" > /etc/locale.conf
loadkeys "${KEYMAP}"
write_x11_config
locale-gen ${TLANG}
}
loadkeys "${keytable}"
configure_clock(){
if [[ -d /run/openrc ]];then
ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
echo "Europe/London" > /etc/timezone
fi
locale-gen ${lang}
echo "Configured language: ${lang}" >> /var/log/manjaro-live.log
echo "Configured keymap: ${keytable}" >> /var/log/manjaro-live.log
echo "Configured timezone: ${timezone}" >> /var/log/manjaro-live.log
}
configure_machine_id(){
......@@ -339,7 +332,7 @@ configure_user_root(){
}
configure_pulse(){
if [[ -f /usr/bin/openrc ]]; then
if [[ -d /run/openrc ]]; then
sed -e "s|autospawn = no|autospawn = yes|" -i /etc/pulse/client.conf
fi
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment