Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
189ceeb7e7 | |||
9c6b20fea3 | |||
9a514cc3ca | |||
![]() |
4f3899f6c6 | ||
![]() |
0efd3bdfa9 | ||
![]() |
f5d07a597f | ||
![]() |
c48893ded2 |
19
Makefile
19
Makefile
@@ -17,13 +17,19 @@ RC = \
|
|||||||
data/rc/pacman-init \
|
data/rc/pacman-init \
|
||||||
data/rc/artix-live
|
data/rc/artix-live
|
||||||
|
|
||||||
|
RUNIT_CORE = \
|
||||||
|
data/runit/89-artix-live.sh
|
||||||
|
|
||||||
|
RUNIT_SV = \
|
||||||
|
data/runit/pacman-init.run
|
||||||
|
|
||||||
GRUB_DEFAULT = \
|
GRUB_DEFAULT = \
|
||||||
data/grub2-portable-efi
|
data/grub2-portable-efi
|
||||||
|
|
||||||
GRUB_D = \
|
GRUB_D = \
|
||||||
data/99_zzz-portable-efi
|
data/99_zzz-portable-efi
|
||||||
|
|
||||||
all: $(BIN) $(RC) $(XBIN) ${GRUB_D}
|
all: $(BIN) $(RC) $(RUNIT_SV) $(XBIN) ${GRUB_D}
|
||||||
|
|
||||||
edit = sed -e "s|@datadir[@]|$(DESTDIR)$(PREFIX)/share/artools|g" \
|
edit = sed -e "s|@datadir[@]|$(DESTDIR)$(PREFIX)/share/artools|g" \
|
||||||
-e "s|@sysconfdir[@]|$(DESTDIR)$(SYSCONFDIR)/artools|g" \
|
-e "s|@sysconfdir[@]|$(DESTDIR)$(SYSCONFDIR)/artools|g" \
|
||||||
@@ -53,6 +59,12 @@ install_rc:
|
|||||||
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/init.d
|
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/init.d
|
||||||
install -m0755 ${RC} $(DESTDIR)$(SYSCONFDIR)/init.d
|
install -m0755 ${RC} $(DESTDIR)$(SYSCONFDIR)/init.d
|
||||||
|
|
||||||
|
install_runit:
|
||||||
|
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/runit/core-services
|
||||||
|
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/sv/pacman-init
|
||||||
|
install -m0755 ${RUNIT_CORE} $(DESTDIR)$(SYSCONFDIR)/runit/core-services
|
||||||
|
install -m0755 ${RUNIT_SV} $(DESTDIR)$(SYSCONFDIR)/sv/pacman-init/run
|
||||||
|
|
||||||
install_portable_efi:
|
install_portable_efi:
|
||||||
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/default
|
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/default
|
||||||
install -m0755 $(GRUB_DEFAULT) $(DESTDIR)$(SYSCONFDIR)/default
|
install -m0755 $(GRUB_DEFAULT) $(DESTDIR)$(SYSCONFDIR)/default
|
||||||
@@ -72,9 +84,12 @@ uninstall_portable_efi:
|
|||||||
uninstall_rc:
|
uninstall_rc:
|
||||||
for f in ${RC}; do rm -f $(DESTDIR)$(SYSCONFDIR)/init.d/$$f; done
|
for f in ${RC}; do rm -f $(DESTDIR)$(SYSCONFDIR)/init.d/$$f; done
|
||||||
|
|
||||||
|
uninstall_runit:
|
||||||
|
for f in ${RUNIT_SV}; do rm -f $(DESTDIR)$(SYSCONFDIR)/runit/sv/$$f; done
|
||||||
|
|
||||||
install: install_base install_rc install_portable_efi
|
install: install_base install_rc install_portable_efi
|
||||||
|
|
||||||
uninstall: uninstall_base uninstall_rc uninstall_portable_efi
|
uninstall: uninstall_base uninstall_rc uninstall_runit uninstall_portable_efi
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
git archive --format=tar --prefix=live-services-$(Version)/ $(Version) | gzip -9 > live-services-$(Version).tar.gz
|
git archive --format=tar --prefix=live-services-$(Version)/ $(Version) | gzip -9 > live-services-$(Version).tar.gz
|
||||||
|
@@ -53,6 +53,10 @@ livetimer=$(get_timer_ms)
|
|||||||
configure_displaymanager
|
configure_displaymanager
|
||||||
echo "Configured displaymanager: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
echo "Configured displaymanager: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
||||||
|
|
||||||
|
livetimer=$(get_timer_ms)
|
||||||
|
configure_calamares
|
||||||
|
echo "Configured calamares netinstall ${netinstall} $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
||||||
|
|
||||||
livetimer=$(get_timer_ms)
|
livetimer=$(get_timer_ms)
|
||||||
configure_user_root /
|
configure_user_root /
|
||||||
echo "Configured root user: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
echo "Configured root user: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
||||||
|
2
data/runit/89-artix-live.sh
Normal file
2
data/runit/89-artix-live.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
msg "Initializing artix-live script"
|
||||||
|
artix-live
|
5
data/runit/pacman-init.run
Normal file
5
data/runit/pacman-init.run
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
mount -t tmpfs -o size=10M,mode=0755 tmpfs /etc/pacman.d/gnupg
|
||||||
|
pacman-key --init
|
||||||
|
pacman-key --populate archlinux artix
|
||||||
|
exec pause pacman-init
|
320
lib/util-live.sh
320
lib/util-live.sh
@@ -10,74 +10,76 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
kernel_cmdline(){
|
kernel_cmdline(){
|
||||||
for param in $(cat /proc/cmdline); do
|
for param in $(cat /proc/cmdline); do
|
||||||
case "${param}" in
|
case "${param}" in
|
||||||
$1=*) echo "${param##*=}"; return 0 ;;
|
$1=*) echo "${param##*=}"; return 0 ;;
|
||||||
$1) return 0 ;;
|
$1) return 0 ;;
|
||||||
*) continue ;;
|
*) continue ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
[ -n "${2}" ] && echo "${2}"
|
[ -n "${2}" ] && echo "${2}"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
get_lang(){
|
get_lang(){
|
||||||
echo $(kernel_cmdline lang)
|
echo $(kernel_cmdline lang)
|
||||||
}
|
}
|
||||||
|
|
||||||
get_keytable(){
|
get_keytable(){
|
||||||
echo $(kernel_cmdline keytable)
|
echo $(kernel_cmdline keytable)
|
||||||
}
|
}
|
||||||
|
|
||||||
get_tz(){
|
get_tz(){
|
||||||
echo $(kernel_cmdline tz)
|
echo $(kernel_cmdline tz)
|
||||||
|
}
|
||||||
|
|
||||||
|
get_cal_mode(){
|
||||||
|
echo $(kernel_cmdline netinstall)
|
||||||
}
|
}
|
||||||
|
|
||||||
get_timer_ms(){
|
get_timer_ms(){
|
||||||
echo $(date +%s%3N)
|
echo $(date +%s%3N)
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1: start timer
|
# $1: start timer
|
||||||
elapsed_time_ms(){
|
elapsed_time_ms(){
|
||||||
echo $(echo $1 $(get_timer_ms) | awk '{ printf "%0.3f",($2-$1)/1000 }')
|
echo $(echo $1 $(get_timer_ms) | awk '{ printf "%0.3f",($2-$1)/1000 }')
|
||||||
}
|
}
|
||||||
|
|
||||||
load_live_config(){
|
load_live_config(){
|
||||||
|
|
||||||
[[ -f $1 ]] || return 1
|
[[ -f $1 ]] || return 1
|
||||||
|
|
||||||
live_conf="$1"
|
live_conf="$1"
|
||||||
|
|
||||||
[[ -r ${live_conf} ]] && source ${live_conf}
|
[[ -r ${live_conf} ]] && source ${live_conf}
|
||||||
|
|
||||||
[[ -z ${autologin} ]] && autologin=true
|
[[ -z ${autologin} ]] && autologin=true
|
||||||
|
|
||||||
[[ -z ${username} ]] && username="cromnix"
|
[[ -z ${username} ]] && username="artix"
|
||||||
|
|
||||||
[[ -z ${password} ]] && password="cromnix"
|
[[ -z ${password} ]] && password="artix"
|
||||||
|
|
||||||
[[ -z ${addgroups} ]] && addgroups=""
|
[[ -z ${addgroups} ]] && addgroups="video,power,storage,optical,network,lp,scanner,wheel,users,audio"
|
||||||
|
|
||||||
echo "Loaded ${live_conf}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
echo "Loaded ${live_conf}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
is_valid_de(){
|
is_valid_de(){
|
||||||
if [[ ${default_desktop_executable} != "none" ]] && \
|
if [[ ${default_desktop_executable} != "none" ]] && \
|
||||||
[[ ${default_desktop_file} != "none" ]]; then
|
[[ ${default_desktop_file} != "none" ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
load_desktop_map(){
|
load_desktop_map(){
|
||||||
local _space="s| ||g" _clean=':a;N;$!ba;s/\n/ /g' _com_rm="s|#.*||g" \
|
local _space="s| ||g" _clean=':a;N;$!ba;s/\n/ /g' _com_rm="s|#.*||g" \
|
||||||
file=${DATADIR}/desktop.map
|
file=${DATADIR}/desktop.map
|
||||||
local desktop_map=$(sed "$_com_rm" "$file" \
|
local desktop_map=$(sed "$_com_rm" "$file" | sed "$_space" | sed "$_clean")
|
||||||
| sed "$_space" \
|
|
||||||
| sed "$_clean")
|
|
||||||
echo ${desktop_map}
|
echo ${desktop_map}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,28 +98,28 @@ detect_desktop_env(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
configure_accountsservice(){
|
configure_accountsservice(){
|
||||||
local path=/var/lib/AccountsService/users
|
local path=/var/lib/AccountsService/users
|
||||||
if [ -d "${path}" ] ; then
|
if [ -d "${path}" ] ; then
|
||||||
echo "[User]" > ${path}/$1
|
echo "[User]" > ${path}/$1
|
||||||
echo "XSession=${default_desktop_file}" >> ${path}/$1
|
echo "XSession=${default_desktop_file}" >> ${path}/$1
|
||||||
if [[ -f "/var/lib/AccountsService/icons/$1.png" ]];then
|
if [[ -f "/var/lib/AccountsService/icons/$1.png" ]];then
|
||||||
echo "Icon=/var/lib/AccountsService/icons/$1.png" >> ${path}/$1
|
echo "Icon=/var/lib/AccountsService/icons/$1.png" >> ${path}/$1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
set_lightdm_greeter(){
|
set_lightdm_greeter(){
|
||||||
local greeters=$(ls /usr/share/xgreeters/*greeter.desktop) name
|
local greeters=$(ls /usr/share/xgreeters/*greeter.desktop) name
|
||||||
for g in ${greeters[@]};do
|
for g in ${greeters[@]};do
|
||||||
name=${g##*/}
|
name=${g##*/}
|
||||||
name=${name%%.*}
|
name=${name%%.*}
|
||||||
case ${name} in
|
case ${name} in
|
||||||
lightdm-gtk-greeter) break ;;
|
lightdm-gtk-greeter) break ;;
|
||||||
lightdm-*-greeter)
|
lightdm-*-greeter)
|
||||||
sed -i -e "s/^.*greeter-session=.*/greeter-session=${name}/" /etc/lightdm/lightdm.conf
|
sed -i -e "s/^.*greeter-session=.*/greeter-session=${name}/" /etc/lightdm/lightdm.conf
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
set_lightdm_vt(){
|
set_lightdm_vt(){
|
||||||
@@ -125,117 +127,113 @@ configure_accountsservice(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
configure_displaymanager(){
|
configure_displaymanager(){
|
||||||
# Try to detect desktop environment
|
# Try to detect desktop environment
|
||||||
# Configure display manager
|
# Configure display manager
|
||||||
if [[ -f /usr/bin/lightdm ]];then
|
if [[ -f /usr/bin/lightdm ]];then
|
||||||
groupadd -r autologin
|
groupadd -r autologin
|
||||||
set_lightdm_vt
|
set_lightdm_vt
|
||||||
set_lightdm_greeter
|
set_lightdm_greeter
|
||||||
if $(is_valid_de); then
|
if $(is_valid_de); then
|
||||||
sed -i -e "s/^.*user-session=.*/user-session=$default_desktop_file/" /etc/lightdm/lightdm.conf
|
sed -i -e "s/^.*user-session=.*/user-session=$default_desktop_file/" /etc/lightdm/lightdm.conf
|
||||||
fi
|
fi
|
||||||
if ${autologin};then
|
if ${autologin};then
|
||||||
gpasswd -a ${username} autologin &> /dev/null
|
gpasswd -a ${username} autologin &> /dev/null
|
||||||
sed -i -e "s/^.*autologin-user=.*/autologin-user=${username}/" /etc/lightdm/lightdm.conf
|
sed -i -e "s/^.*autologin-user=.*/autologin-user=${username}/" /etc/lightdm/lightdm.conf
|
||||||
sed -i -e "s/^.*autologin-user-timeout=.*/autologin-user-timeout=0/" /etc/lightdm/lightdm.conf
|
sed -i -e "s/^.*autologin-user-timeout=.*/autologin-user-timeout=0/" /etc/lightdm/lightdm.conf
|
||||||
sed -i -e "s/^.*pam-autologin-service=.*/pam-autologin-service=lightdm-autologin/" /etc/lightdm/lightdm.conf
|
sed -i -e "s/^.*pam-autologin-service=.*/pam-autologin-service=lightdm-autologin/" /etc/lightdm/lightdm.conf
|
||||||
fi
|
fi
|
||||||
elif [[ -f /usr/bin/gdm ]];then
|
elif [[ -f /usr/bin/gdm ]];then
|
||||||
configure_accountsservice "gdm"
|
configure_accountsservice "gdm"
|
||||||
if ${autologin};then
|
if ${autologin};then
|
||||||
sed -i -e "s/\[daemon\]/\[daemon\]\nAutomaticLogin=${username}\nAutomaticLoginEnable=True/" /etc/gdm/custom.conf
|
sed -i -e "s/\[daemon\]/\[daemon\]\nAutomaticLogin=${username}\nAutomaticLoginEnable=True/" /etc/gdm/custom.conf
|
||||||
fi
|
fi
|
||||||
elif [[ -f /usr/bin/mdm ]];then
|
elif [[ -f /usr/bin/sddm ]];then
|
||||||
if $(is_valid_de); then
|
if $(is_valid_de); then
|
||||||
sed -i "s|default.desktop|$default_desktop_file.desktop|g" /etc/mdm/custom.conf
|
sed -i -e "s|^Session=.*|Session=$default_desktop_file.desktop|" /etc/sddm.conf
|
||||||
fi
|
fi
|
||||||
elif [[ -f /usr/bin/sddm ]];then
|
if ${autologin};then
|
||||||
if $(is_valid_de); then
|
sed -i -e "s|^User=.*|User=${username}|" /etc/sddm.conf
|
||||||
sed -i -e "s|^Session=.*|Session=$default_desktop_file.desktop|" /etc/sddm.conf
|
fi
|
||||||
fi
|
elif [[ -f /usr/bin/lxdm ]];then
|
||||||
if ${autologin};then
|
if $(is_valid_de); then
|
||||||
sed -i -e "s|^User=.*|User=${username}|" /etc/sddm.conf
|
sed -i -e "s|^.*session=.*|session=/usr/bin/$default_desktop_executable|" /etc/lxdm/lxdm.conf
|
||||||
fi
|
fi
|
||||||
elif [[ -f /usr/bin/lxdm ]];then
|
if ${autologin};then
|
||||||
if $(is_valid_de); then
|
sed -i -e "s/^.*autologin=.*/autologin=${username}/" /etc/lxdm/lxdm.conf
|
||||||
sed -i -e "s|^.*session=.*|session=/usr/bin/$default_desktop_executable|" /etc/lxdm/lxdm.conf
|
fi
|
||||||
fi
|
fi
|
||||||
if ${autologin};then
|
|
||||||
sed -i -e "s/^.*autologin=.*/autologin=${username}/" /etc/lxdm/lxdm.conf
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gen_pw(){
|
gen_pw(){
|
||||||
echo $(perl -e 'print crypt($ARGV[0], "password")' ${password})
|
echo $(perl -e 'print crypt($ARGV[0], "password")' ${password})
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_user(){
|
configure_user(){
|
||||||
# set up user and password
|
# set up user and password
|
||||||
if [[ -n ${password} ]];then
|
if [[ -n ${password} ]];then
|
||||||
useradd -m -G ${addgroups} -p $(gen_pw) -s /bin/bash ${username}
|
useradd -m -G ${addgroups} -p $(gen_pw) -s /bin/bash ${username}
|
||||||
else
|
else
|
||||||
useradd -m -G ${addgroups} -s /bin/bash ${username}
|
useradd -m -G ${addgroups} -s /bin/bash ${username}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
find_legacy_keymap(){
|
find_legacy_keymap(){
|
||||||
local file="${DATADIR}/kbd-model.map"
|
local file="${DATADIR}/kbd-model.map"
|
||||||
while read -r line || [[ -n $line ]]; do
|
while read -r line || [[ -n $line ]]; do
|
||||||
if [[ -z $line ]] || [[ $line == \#* ]]; then
|
if [[ -z $line ]] || [[ $line == \#* ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mapping=( $line ); # parses columns
|
mapping=( $line ); # parses columns
|
||||||
if [[ ${#mapping[@]} != 5 ]]; then
|
if [[ ${#mapping[@]} != 5 ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${keytable}" != "${mapping[0]}" ]]; then
|
if [[ "${keytable}" != "${mapping[0]}" ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${mapping[3]}" = "-" ]]; then
|
if [[ "${mapping[3]}" = "-" ]]; then
|
||||||
mapping[3]=""
|
mapping[3]=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
X11_LAYOUT=${mapping[1]}
|
X11_LAYOUT=${mapping[1]}
|
||||||
X11_MODEL=${mapping[2]}
|
X11_MODEL=${mapping[2]}
|
||||||
X11_VARIANT=${mapping[3]}
|
X11_VARIANT=${mapping[3]}
|
||||||
x11_OPTIONS=${mapping[4]}
|
x11_OPTIONS=${mapping[4]}
|
||||||
done < $file
|
done < $file
|
||||||
}
|
}
|
||||||
|
|
||||||
write_x11_config(){
|
write_x11_config(){
|
||||||
# find a x11 layout that matches the keymap
|
# find a x11 layout that matches the keymap
|
||||||
# in isolinux if you select a keyboard layout and a language that doesnt match this layout,
|
# in isolinux if you select a keyboard layout and a language that doesnt match this layout,
|
||||||
# it will provide the correct keymap, but not kblayout value
|
# it will provide the correct keymap, but not kblayout value
|
||||||
local X11_LAYOUT=
|
local X11_LAYOUT=
|
||||||
local X11_MODEL="pc105"
|
local X11_MODEL="pc105"
|
||||||
local X11_VARIANT=""
|
local X11_VARIANT=""
|
||||||
local X11_OPTIONS="terminate:ctrl_alt_bksp"
|
local X11_OPTIONS="terminate:ctrl_alt_bksp"
|
||||||
|
|
||||||
find_legacy_keymap
|
find_legacy_keymap
|
||||||
|
|
||||||
# layout not found, use KBLAYOUT
|
# layout not found, use KBLAYOUT
|
||||||
if [[ -z "$X11_LAYOUT" ]]; then
|
if [[ -z "$X11_LAYOUT" ]]; then
|
||||||
X11_LAYOUT="${keytable}"
|
X11_LAYOUT="${keytable}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create X11 keyboard layout config
|
# create X11 keyboard layout config
|
||||||
mkdir -p "/etc/X11/xorg.conf.d"
|
mkdir -p "/etc/X11/xorg.conf.d"
|
||||||
|
|
||||||
local XORGKBLAYOUT="/etc/X11/xorg.conf.d/00-keyboard.conf"
|
local XORGKBLAYOUT="/etc/X11/xorg.conf.d/00-keyboard.conf"
|
||||||
|
|
||||||
echo "" >> "$XORGKBLAYOUT"
|
echo "" >> "$XORGKBLAYOUT"
|
||||||
echo "Section \"InputClass\"" > "$XORGKBLAYOUT"
|
echo "Section \"InputClass\"" > "$XORGKBLAYOUT"
|
||||||
echo " Identifier \"system-keyboard\"" >> "$XORGKBLAYOUT"
|
echo " Identifier \"system-keyboard\"" >> "$XORGKBLAYOUT"
|
||||||
echo " MatchIsKeyboard \"on\"" >> "$XORGKBLAYOUT"
|
echo " MatchIsKeyboard \"on\"" >> "$XORGKBLAYOUT"
|
||||||
echo " Option \"XkbLayout\" \"$X11_LAYOUT\"" >> "$XORGKBLAYOUT"
|
echo " Option \"XkbLayout\" \"$X11_LAYOUT\"" >> "$XORGKBLAYOUT"
|
||||||
echo " Option \"XkbModel\" \"$X11_MODEL\"" >> "$XORGKBLAYOUT"
|
echo " Option \"XkbModel\" \"$X11_MODEL\"" >> "$XORGKBLAYOUT"
|
||||||
echo " Option \"XkbVariant\" \"$X11_VARIANT\"" >> "$XORGKBLAYOUT"
|
echo " Option \"XkbVariant\" \"$X11_VARIANT\"" >> "$XORGKBLAYOUT"
|
||||||
echo " Option \"XkbOptions\" \"$X11_OPTIONS\"" >> "$XORGKBLAYOUT"
|
echo " Option \"XkbOptions\" \"$X11_OPTIONS\"" >> "$XORGKBLAYOUT"
|
||||||
echo "EndSection" >> "$XORGKBLAYOUT"
|
echo "EndSection" >> "$XORGKBLAYOUT"
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_language(){
|
configure_language(){
|
||||||
@@ -269,32 +267,32 @@ configure_language(){
|
|||||||
echo "Configured timezone: ${timezone}" >> "${LOGFILE}"
|
echo "Configured timezone: ${timezone}" >> "${LOGFILE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# configure_machine_id(){
|
configure_calamares(){
|
||||||
# if [ -e "/etc/machine-id" ] ; then
|
if [[ -f /usr/bin/calamares ]];then
|
||||||
# # delete existing machine-id
|
netinstall=$(get_cal_mode)
|
||||||
# echo "Deleting existing machine-id ..." >> "${LOGFILE}"
|
if [[ "${netinstall}" == 'no' ]];then
|
||||||
# rm /etc/machine-id
|
sed -e "/- netinstall/d" \
|
||||||
# fi
|
-e "s|- chrootcfg|- unpackfs|" -i /etc/calamares/settings.conf
|
||||||
# # set unique machine-id
|
|
||||||
# echo "Setting machine-id ..." >> "${LOGFILE}"
|
sed -e '$ d' -i /etc/calamares/modules/welcome.conf
|
||||||
# dbus-uuidgen --ensure=/etc/machine-id
|
fi
|
||||||
# ln -sf /etc/machine-id /var/lib/dbus/machine-id
|
fi
|
||||||
# }
|
}
|
||||||
|
|
||||||
configure_sudoers_d(){
|
configure_sudoers_d(){
|
||||||
echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/g_wheel
|
echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/g_wheel
|
||||||
echo "root ALL=(ALL) ALL" > /etc/sudoers.d/u_root
|
echo "root ALL=(ALL) ALL" > /etc/sudoers.d/u_root
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_swap(){
|
configure_swap(){
|
||||||
local swapdev="$(fdisk -l 2>/dev/null | grep swap | cut -d' ' -f1)"
|
local swapdev="$(fdisk -l 2>/dev/null | grep swap | cut -d' ' -f1)"
|
||||||
if [ -e "${swapdev}" ]; then
|
if [ -e "${swapdev}" ]; then
|
||||||
swapon ${swapdev}
|
swapon ${swapdev}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_user_root(){
|
configure_user_root(){
|
||||||
# set up root password
|
# set up root password
|
||||||
echo "root:${password}" | chroot $1 chpasswd
|
echo "root:${password}" | chroot $1 chpasswd
|
||||||
cp /etc/skel/.{bash_profile,bashrc,bash_logout} /root/
|
cp /etc/skel/.{bash_profile,bashrc,bash_logout} /root/
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user