25 Commits
0.4.1 ... 0.6.4

Author SHA1 Message Date
e5b37014d0 try to fix calamares launcher 2018-10-07 14:05:33 +02:00
96ae6855ac desktop-items: fix konversation 2018-10-06 14:18:40 +02:00
22014421b1 fix konversation typo 2018-10-05 21:42:29 +02:00
ccebe7ecf3 symlink docs to localized desktop dir 2018-10-05 10:01:06 +02:00
7557a84a7d clean up; remove old code 2018-10-05 00:10:04 +02:00
712774d585 create desktop launchers 2018-10-04 23:53:55 +02:00
ef98a333ca rm netinstall 2018-10-02 22:18:26 +02:00
udeved
7727ce662e fix runit live sym 2018-05-14 16:59:29 +00:00
udeved
b841184cb2 fix runit live sym 2018-05-14 16:56:44 +00:00
udeved
528b3091c6 Merge branch 'master' of github.com:artix-linux/live-services 2018-05-14 16:50:45 +00:00
udeved
ffb4f4ba98 update runit live for runit-rc 2018-05-14 16:50:22 +00:00
udeved
64fe174eba update runit live for runit-rc 2018-05-14 16:40:37 +00:00
udeved
dc955770b3 makefile: small fix 2018-04-14 18:40:06 +02:00
udeved
004760e16a mkaefile: fix datadir path 2018-04-14 16:48:18 +02:00
bb1f0fbdc0 reflect the new runit service directory 2018-04-14 08:49:23 +07:00
udeved
f879bf8965 start 0.5 2018-04-11 21:12:10 +02:00
udeved
7e93c77b9a makefile: fix uninstall 2018-04-11 19:24:17 +02:00
8832d21deb change pacman-init directory to reflect new scheme 2018-04-09 10:58:20 +07:00
189ceeb7e7 Move pacman-init to a service on its own 2018-02-17 13:12:39 +07:00
9c6b20fea3 Fix typo 2018-02-17 12:00:58 +07:00
9a514cc3ca Add initial runit support for artix-live 2018-02-15 12:21:20 +07:00
udeved
4f3899f6c6 util-live: fix load_desktop_map() 2017-12-19 16:28:33 +01:00
udeved
0efd3bdfa9 rename unoack to netinstall kernel param; grub now has a selection menu entry 2017-12-19 15:30:46 +01:00
udeved
f5d07a597f util-live: fix unpackfs paths 2017-12-18 13:16:51 +01:00
udeved
c48893ded2 artix-live: add option to configure calamares with a unpack=yes/no kernel parameter 2017-12-14 20:28:10 +01:00
6 changed files with 256 additions and 212 deletions

103
Makefile
View File

@@ -1,7 +1,23 @@
Version=0.1
VERSION = 0.5
PKG = live-services
TOOLS = artools
PREFIX = /usr/local
SYSCONFDIR = /etc
ifdef PREFIX
PREFIX = /usr/local
endif
BINDIR = $(PREFIX)/bin
LIBDIR = $(PREFIX)/lib
DATADIR = $(PREFIX)/share
FMODE = -m0644
DMODE = -dm0755
BMODE = -m0755
RM = rm -f
M4 = m4 -P
CHAW = chmod a-w
CHX = chmod +x
BIN = \
bin/artix-live
@@ -17,67 +33,76 @@ RC = \
data/rc/pacman-init \
data/rc/artix-live
RUNIT_SVD = \
data/runit/live
RUNIT_SV = \
data/runit/pacman-init.run
GRUB_DEFAULT = \
data/grub2-portable-efi
GRUB_D = \
data/99_zzz-portable-efi
all: $(BIN) $(RC) $(XBIN) ${GRUB_D}
XDG = $(wildcard data/*.desktop)
edit = sed -e "s|@datadir[@]|$(DESTDIR)$(PREFIX)/share/artools|g" \
-e "s|@sysconfdir[@]|$(DESTDIR)$(SYSCONFDIR)/artools|g" \
-e "s|@libdir[@]|$(DESTDIR)$(PREFIX)/lib/artools|g"
XBIN = bin/desktop-items
all: $(BIN) $(RC) $(RUNIT_SV) $(XBIN) $(GRUB_D)
EDIT = sed -e "s|@datadir[@]|$(DATADIR)/$(TOOLS)|g" \
-e "s|@sysconfdir[@]|$(SYSCONFDIR)/$(TOOLS)|g" \
-e "s|@libdir[@]|$(LIBDIR)/$(TOOLS)|g"
%: %.in Makefile
@echo "GEN $@"
@$(RM) "$@"
@m4 -P $@.in | $(edit) >$@
@chmod a-w "$@"
@chmod +x "$@"
@$(M4) $@.in | $(EDIT) >$@
@$(CHAW) "$@"
@$(CHX) "$@"
clean:
rm -f $(BIN) $(RC) ${GRUB_D}
$(RM) $(BIN) $(RC) $(GRUB_D)
install_base:
install -dm0755 $(DESTDIR)$(PREFIX)/bin
install -m0755 ${BIN} $(DESTDIR)$(PREFIX)/bin
install $(DMODE) $(DESTDIR)$(BINDIR)
install $(BMODE) $(BIN) $(DESTDIR)$(BINDIR)
install -dm0755 $(DESTDIR)$(PREFIX)/lib/artools
install -m0644 ${LIBS} $(DESTDIR)$(PREFIX)/lib/artools
install $(DMODE) $(DESTDIR)$(LIBDIR)/$(TOOLS)
install $(FMODE) $(LIBS) $(DESTDIR)$(LIBDIR)/$(TOOLS)
install -dm0755 $(DESTDIR)$(PREFIX)/share/artools
install -m0644 ${SHARED} $(DESTDIR)$(PREFIX)/share/artools
install $(DMODE) $(DESTDIR)$(DATADIR)/$(TOOLS)
install $(FMODE) $(SHARED) $(DESTDIR)$(DATADIR)/$(TOOLS)
install_rc:
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/init.d
install -m0755 ${RC} $(DESTDIR)$(SYSCONFDIR)/init.d
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/init.d
install $(BMODE) $(RC) $(DESTDIR)$(SYSCONFDIR)/init.d
install_runit:
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/rc/sysinit
install $(DMODE) $(DESTDIR)$(LIBDIR)/rc/sv.d
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/runit/sv/pacman-init
install $(BMODE) $(RUNIT_SVD) $(DESTDIR)$(LIBDIR)/rc/sv.d
ln -sf $(LIBDIR)/rc/sv.d/live $(DESTDIR)$(SYSCONFDIR)/rc/sysinit/98-live
install $(BMODE) $(RUNIT_SV) $(DESTDIR)$(SYSCONFDIR)/runit/sv/pacman-init/run
install_portable_efi:
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/default
install -m0755 $(GRUB_DEFAULT) $(DESTDIR)$(SYSCONFDIR)/default
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/default
install $(BMODE) $(GRUB_DEFAULT) $(DESTDIR)$(SYSCONFDIR)/default
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/grub.d
install -m0755 $(GRUB_D) $(DESTDIR)$(SYSCONFDIR)/grub.d
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/grub.d
install $(BMODE) $(GRUB_D) $(DESTDIR)$(SYSCONFDIR)/grub.d
uninstall_base:
for f in ${BIN}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
for f in ${SHARED}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/$$f; done
for f in ${LIBS}; do rm -f $(DESTDIR)$(PREFIX)/lib/artools/$$f; done
install_xdg:
install -dm0755 $(DESTDIR)$(PREFIX)/bin
install -m0755 ${XBIN} $(DESTDIR)$(PREFIX)/bin
uninstall_portable_efi:
for f in ${GRUB_DEFAULT}; do rm -f $(DESTDIR)$(SYSCONFDIR)/default/$$f; done
for f in ${GRUB_D}; do rm -f $(DESTDIR)$(SYSCONFDIR)/grub.d/$$f; done
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/skel/.config/autostart
install -m0755 ${XDG} $(DESTDIR)$(SYSCONFDIR)/skel/.config/autostart
uninstall_rc:
for f in ${RC}; do rm -f $(DESTDIR)$(SYSCONFDIR)/init.d/$$f; done
install: install_base install_rc install_portable_efi
uninstall: uninstall_base uninstall_rc uninstall_portable_efi
dist:
git archive --format=tar --prefix=live-services-$(Version)/ $(Version) | gzip -9 > live-services-$(Version).tar.gz
gpg --detach-sign --use-agent live-services-$(Version).tar.gz
install: install_base install_rc install_portable_efi install_xdg
.PHONY: all clean install uninstall dist

View File

@@ -37,14 +37,6 @@ livetimer=$(get_timer_ms)
configure_user
echo "Created user ${username} with password ${password}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
livetimer=$(get_timer_ms)
configure_sudoers_d
echo "Configured sudoers: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
# livetimer=$(get_timer_ms)
# configure_machine_id
# echo "Configured machine-id: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
livetimer=$(get_timer_ms)
configure_accountsservice "${username}"
echo "Configured accountsservice: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"

26
bin/desktop-items.in Normal file
View File

@@ -0,0 +1,26 @@
#!/bin/sh
xdg=$(xdg-user-dir DESKTOP)
src=/usr/share/applications
if [[ -f $src/org.kde.konversation ]]; then
cp $src/org.kde.konversation \
$xdg/konversation-artix-help.desktop
fi
if [[ -f /usr/bin/calamares ]]; then
cp $src/calamares.desktop \
$xdg/calamares.desktop
fi
docs=/usr/share/doc/artix
for f in {Configuration,Installation,Migration,Troubleshooting}.pdf;do
ln -s $docs/$f $xdg/$f
done
if [[ -d /run/openrc ]];then
ln -s $docs/OpenRC.pdf $xdg/OpenRC.pdf
else
ln -s $docs/Runit.pdf $xdg/Runit.pdf
fi

15
data/runit/live Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
. /usr/lib/rc/functions
case "$1" in
start)
stat_busy "Initializing artix live system"
artix-live #|| stat_die
add_daemon live
stat_done
;;
*)
echo "usage: $0 {start}"
;;
esac

View File

@@ -0,0 +1,5 @@
#!/bin/sh
mount -t tmpfs -o size=10M,mode=0755 tmpfs /etc/pacman.d/gnupg
pacman-key --init 1>&2
pacman-key --populate archlinux artix 1>&2
exec chpst -b pacman-init pause

View File

@@ -10,74 +10,76 @@
# GNU General Public License for more details.
kernel_cmdline(){
for param in $(cat /proc/cmdline); do
case "${param}" in
$1=*) echo "${param##*=}"; return 0 ;;
$1) return 0 ;;
*) continue ;;
esac
done
[ -n "${2}" ] && echo "${2}"
return 1
for param in $(cat /proc/cmdline); do
case "${param}" in
$1=*) echo "${param##*=}"; return 0 ;;
$1) return 0 ;;
*) continue ;;
esac
done
[ -n "${2}" ] && echo "${2}"
return 1
}
get_lang(){
echo $(kernel_cmdline lang)
echo $(kernel_cmdline lang)
}
get_keytable(){
echo $(kernel_cmdline keytable)
echo $(kernel_cmdline keytable)
}
get_tz(){
echo $(kernel_cmdline tz)
echo $(kernel_cmdline tz)
}
get_cal_mode(){
echo $(kernel_cmdline netinstall)
}
get_timer_ms(){
echo $(date +%s%3N)
echo $(date +%s%3N)
}
# $1: start timer
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(){
[[ -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(){
if [[ ${default_desktop_executable} != "none" ]] && \
[[ ${default_desktop_file} != "none" ]]; then
return 0
else
return 1
fi
if [[ ${default_desktop_executable} != "none" ]] && \
[[ ${default_desktop_file} != "none" ]]; then
return 0
else
return 1
fi
}
load_desktop_map(){
local _space="s| ||g" _clean=':a;N;$!ba;s/\n/ /g' _com_rm="s|#.*||g" \
file=${DATADIR}/desktop.map
local desktop_map=$(sed "$_com_rm" "$file" \
| sed "$_space" \
| sed "$_clean")
local desktop_map=$(sed "$_com_rm" "$file" | sed "$_space" | sed "$_clean")
echo ${desktop_map}
}
@@ -96,28 +98,28 @@ detect_desktop_env(){
}
configure_accountsservice(){
local path=/var/lib/AccountsService/users
if [ -d "${path}" ] ; then
echo "[User]" > ${path}/$1
echo "XSession=${default_desktop_file}" >> ${path}/$1
if [[ -f "/var/lib/AccountsService/icons/$1.png" ]];then
echo "Icon=/var/lib/AccountsService/icons/$1.png" >> ${path}/$1
fi
fi
local path=/var/lib/AccountsService/users
if [ -d "${path}" ] ; then
echo "[User]" > ${path}/$1
echo "XSession=${default_desktop_file}" >> ${path}/$1
if [[ -f "/var/lib/AccountsService/icons/$1.png" ]];then
echo "Icon=/var/lib/AccountsService/icons/$1.png" >> ${path}/$1
fi
fi
}
set_lightdm_greeter(){
local greeters=$(ls /usr/share/xgreeters/*greeter.desktop) name
for g in ${greeters[@]};do
name=${g##*/}
name=${name%%.*}
case ${name} in
lightdm-gtk-greeter) break ;;
lightdm-*-greeter)
sed -i -e "s/^.*greeter-session=.*/greeter-session=${name}/" /etc/lightdm/lightdm.conf
;;
esac
done
local greeters=$(ls /usr/share/xgreeters/*greeter.desktop) name
for g in ${greeters[@]};do
name=${g##*/}
name=${name%%.*}
case ${name} in
lightdm-gtk-greeter) break ;;
lightdm-*-greeter)
sed -i -e "s/^.*greeter-session=.*/greeter-session=${name}/" /etc/lightdm/lightdm.conf
;;
esac
done
}
set_lightdm_vt(){
@@ -125,117 +127,113 @@ configure_accountsservice(){
}
configure_displaymanager(){
# Try to detect desktop environment
# Configure display manager
if [[ -f /usr/bin/lightdm ]];then
groupadd -r autologin
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
fi
if ${autologin};then
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-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
fi
elif [[ -f /usr/bin/gdm ]];then
configure_accountsservice "gdm"
if ${autologin};then
sed -i -e "s/\[daemon\]/\[daemon\]\nAutomaticLogin=${username}\nAutomaticLoginEnable=True/" /etc/gdm/custom.conf
fi
elif [[ -f /usr/bin/mdm ]];then
if $(is_valid_de); then
sed -i "s|default.desktop|$default_desktop_file.desktop|g" /etc/mdm/custom.conf
fi
elif [[ -f /usr/bin/sddm ]];then
if $(is_valid_de); then
sed -i -e "s|^Session=.*|Session=$default_desktop_file.desktop|" /etc/sddm.conf
fi
if ${autologin};then
sed -i -e "s|^User=.*|User=${username}|" /etc/sddm.conf
fi
elif [[ -f /usr/bin/lxdm ]];then
if $(is_valid_de); then
sed -i -e "s|^.*session=.*|session=/usr/bin/$default_desktop_executable|" /etc/lxdm/lxdm.conf
fi
if ${autologin};then
sed -i -e "s/^.*autologin=.*/autologin=${username}/" /etc/lxdm/lxdm.conf
fi
fi
# Try to detect desktop environment
# Configure display manager
if [[ -f /usr/bin/lightdm ]];then
groupadd -r autologin
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
fi
if ${autologin};then
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-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
fi
elif [[ -f /usr/bin/gdm ]];then
configure_accountsservice "gdm"
if ${autologin};then
sed -i -e "s/\[daemon\]/\[daemon\]\nAutomaticLogin=${username}\nAutomaticLoginEnable=True/" /etc/gdm/custom.conf
fi
elif [[ -f /usr/bin/sddm ]];then
if $(is_valid_de); then
sed -i -e "s|^Session=.*|Session=$default_desktop_file.desktop|" /etc/sddm.conf
fi
if ${autologin};then
sed -i -e "s|^User=.*|User=${username}|" /etc/sddm.conf
fi
elif [[ -f /usr/bin/lxdm ]];then
if $(is_valid_de); then
sed -i -e "s|^.*session=.*|session=/usr/bin/$default_desktop_executable|" /etc/lxdm/lxdm.conf
fi
if ${autologin};then
sed -i -e "s/^.*autologin=.*/autologin=${username}/" /etc/lxdm/lxdm.conf
fi
fi
}
gen_pw(){
echo $(perl -e 'print crypt($ARGV[0], "password")' ${password})
echo $(perl -e 'print crypt($ARGV[0], "password")' ${password})
}
configure_user(){
# set up user and password
if [[ -n ${password} ]];then
useradd -m -G ${addgroups} -p $(gen_pw) -s /bin/bash ${username}
else
useradd -m -G ${addgroups} -s /bin/bash ${username}
fi
# set up user and password
if [[ -n ${password} ]];then
useradd -m -G ${addgroups} -p $(gen_pw) -s /bin/bash ${username}
else
useradd -m -G ${addgroups} -s /bin/bash ${username}
fi
}
find_legacy_keymap(){
local file="${DATADIR}/kbd-model.map"
while read -r line || [[ -n $line ]]; do
if [[ -z $line ]] || [[ $line == \#* ]]; then
continue
fi
local file="${DATADIR}/kbd-model.map"
while read -r line || [[ -n $line ]]; do
if [[ -z $line ]] || [[ $line == \#* ]]; then
continue
fi
mapping=( $line ); # parses columns
if [[ ${#mapping[@]} != 5 ]]; then
continue
fi
mapping=( $line ); # parses columns
if [[ ${#mapping[@]} != 5 ]]; then
continue
fi
if [[ "${keytable}" != "${mapping[0]}" ]]; then
continue
fi
if [[ "${keytable}" != "${mapping[0]}" ]]; then
continue
fi
if [[ "${mapping[3]}" = "-" ]]; then
mapping[3]=""
fi
if [[ "${mapping[3]}" = "-" ]]; then
mapping[3]=""
fi
X11_LAYOUT=${mapping[1]}
X11_MODEL=${mapping[2]}
X11_VARIANT=${mapping[3]}
x11_OPTIONS=${mapping[4]}
done < $file
X11_LAYOUT=${mapping[1]}
X11_MODEL=${mapping[2]}
X11_VARIANT=${mapping[3]}
x11_OPTIONS=${mapping[4]}
done < $file
}
write_x11_config(){
# find a x11 layout that matches the keymap
# 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
local X11_LAYOUT=
local X11_MODEL="pc105"
local X11_VARIANT=""
local X11_OPTIONS="terminate:ctrl_alt_bksp"
# find a x11 layout that matches the keymap
# 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
local X11_LAYOUT=
local X11_MODEL="pc105"
local X11_VARIANT=""
local X11_OPTIONS="terminate:ctrl_alt_bksp"
find_legacy_keymap
find_legacy_keymap
# layout not found, use KBLAYOUT
if [[ -z "$X11_LAYOUT" ]]; then
X11_LAYOUT="${keytable}"
fi
# layout not found, use KBLAYOUT
if [[ -z "$X11_LAYOUT" ]]; then
X11_LAYOUT="${keytable}"
fi
# create X11 keyboard layout config
mkdir -p "/etc/X11/xorg.conf.d"
# create X11 keyboard layout config
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 "Section \"InputClass\"" > "$XORGKBLAYOUT"
echo " Identifier \"system-keyboard\"" >> "$XORGKBLAYOUT"
echo " MatchIsKeyboard \"on\"" >> "$XORGKBLAYOUT"
echo " Option \"XkbLayout\" \"$X11_LAYOUT\"" >> "$XORGKBLAYOUT"
echo " Option \"XkbModel\" \"$X11_MODEL\"" >> "$XORGKBLAYOUT"
echo " Option \"XkbVariant\" \"$X11_VARIANT\"" >> "$XORGKBLAYOUT"
echo " Option \"XkbOptions\" \"$X11_OPTIONS\"" >> "$XORGKBLAYOUT"
echo "EndSection" >> "$XORGKBLAYOUT"
echo "" >> "$XORGKBLAYOUT"
echo "Section \"InputClass\"" > "$XORGKBLAYOUT"
echo " Identifier \"system-keyboard\"" >> "$XORGKBLAYOUT"
echo " MatchIsKeyboard \"on\"" >> "$XORGKBLAYOUT"
echo " Option \"XkbLayout\" \"$X11_LAYOUT\"" >> "$XORGKBLAYOUT"
echo " Option \"XkbModel\" \"$X11_MODEL\"" >> "$XORGKBLAYOUT"
echo " Option \"XkbVariant\" \"$X11_VARIANT\"" >> "$XORGKBLAYOUT"
echo " Option \"XkbOptions\" \"$X11_OPTIONS\"" >> "$XORGKBLAYOUT"
echo "EndSection" >> "$XORGKBLAYOUT"
}
configure_language(){
@@ -269,32 +267,15 @@ configure_language(){
echo "Configured timezone: ${timezone}" >> "${LOGFILE}"
}
# configure_machine_id(){
# if [ -e "/etc/machine-id" ] ; then
# # delete existing machine-id
# echo "Deleting existing machine-id ..." >> "${LOGFILE}"
# rm /etc/machine-id
# fi
# # set unique machine-id
# echo "Setting machine-id ..." >> "${LOGFILE}"
# dbus-uuidgen --ensure=/etc/machine-id
# ln -sf /etc/machine-id /var/lib/dbus/machine-id
# }
configure_sudoers_d(){
echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/g_wheel
echo "root ALL=(ALL) ALL" > /etc/sudoers.d/u_root
}
configure_swap(){
local swapdev="$(fdisk -l 2>/dev/null | grep swap | cut -d' ' -f1)"
if [ -e "${swapdev}" ]; then
swapon ${swapdev}
fi
local swapdev="$(fdisk -l 2>/dev/null | grep swap | cut -d' ' -f1)"
if [ -e "${swapdev}" ]; then
swapon ${swapdev}
fi
}
configure_user_root(){
# set up root password
echo "root:${password}" | chroot $1 chpasswd
cp /etc/skel/.{bash_profile,bashrc,bash_logout} /root/
# set up root password
echo "root:${password}" | chroot $1 chpasswd
cp /etc/skel/.{bash_profile,bashrc,bash_logout} /root/
}