File config.sh of Package fedora-minimalX-live
#!/bin/bash
#================
# FILE : config.sh
#----------------
# PROJECT : OpenSuSE KIWI Image System
# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
# :
# AUTHOR : Marcus Schaefer <ms@suse.de>
# :
# BELONGS TO : Operating System images
# :
# DESCRIPTION : configuration script for SUSE based
# : operating systems
# :
# :
# STATUS : BETA
#----------------
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
#======================================
# Greeting...
#--------------------------------------
echo "Configure image: [$kiwi_iname]..."
#======================================
# Activate services
#--------------------------------------
baseInsertService dbus-broker
baseInsertService NetworkManager
baseInsertService sddm
#aseInsertService nodm
#======================================
# Setup default target, multi-user
#--------------------------------------
baseSetRunlevel 5
#======================================
# Generate system locale and configure it
#--------------------------------------
LOCALE=ru_RU.UTF-8
echo "LANG=$LOCALE" > /etc/locale.conf
#=======================================
# Setup system keymap
#---------------------------------------
[ -f /etc/vconsole.conf ] && cp /etc/vconsole.conf /etc/vconsole.conf.orig
cat > /etc/vconsole.conf <<-EOF
KEYMAP=ruwin_alt-UTF-8
FONT=UniCyr_8x16.psf
FONT_MAP=
FONT_UNIMAP=
XKBLAYOUT=us,ru
XKBMODEL=pc105
XKBVARIANT=,winkeys
XKBOPTIONS=terminate:ctrl_alt_bksp,grp:ctrl_shift_toggle,grp_led:scroll
EOF
#======================================
# Create Live session user
#--------------------------------------
# groups: liveuser,...
# mkpasswd <password> -m md5 -S `pwgen -s1n 8`
LIVEUSER=liveuser
/usr/sbin/useradd -m -u 1000 $LIVEUSER -c 'Live System User' -p '' -d /home/$LIVEUSER \
-s /bin/bash -G wheel
sed -i '/NOPASSWD/!s/^# %wheel/%wheel/' /etc/sudoers
#======================================
# Hostname
#--------------------------------------
echo "fedora-live" > /etc/hostname
#======================================
# SDDM
#--------------------------------------
# Enable virtual keyboard
#--------------------------------------
cat > /etc/sddm.conf.d/virtualkbd.conf <<-EOF
[General]
InputMethod=qtvirtualkeyboard
EOF
#--------------------------------------
# Theme
#--------------------------------------
CURSOR="Breeze_Light"
sed -i 's/#\(Session=\).*/\1plasma.desktop/' /etc/sddm.conf
sed -i "s/#\(User=\).*/\1$LIVEUSER/" /etc/sddm.conf
#ed -i 's/\(Current=\).*/\1=breeze/' /usr/lib/sddm/sddm.conf.d/kde_settings.conf
sed -i "s/\(CursorTheme=\).*/\1$CURSOR/" /usr/lib/sddm/sddm.conf.d/kde_settings.conf
#======================================
# Cursor
#--------------------------------------
cat > /etc/xdg/kcminputrc <<-EOF
[Mouse]
cursorTheme=$CURSOR
EOF
sed -i "s/breeze_cursors/$CURSOR/" /usr/share/plasma/look-and-feel/org.fedoraproject.fedora.desktop/contents/defaults
cat > /etc/xdg/plasmarc <<-EOF
[Theme]
name=BreezeLight
EOF
sed -i 's/\(name=\).*/\1BreezeLight/' /usr/share/plasma/look-and-feel/org.fedoraproject.fedora.desktop/contents/defaults
#======================================
# Wallpaper
#--------------------------------------
WALLPAPER="Altai"
sed -i "s/\(Image=\).*/\1$WALLPAPER/" /usr/share/plasma/look-and-feel/org.fedoraproject.fedora.desktop/contents/defaults
#ed -i "s/Next/$WALLPAPER/" /usr/share/sddm/themes/breeze/theme.conf
sed -i "s|\(background=\).*|\1/usr/share/wallpapers/$WALLPAPER/contents/images/5120x2880.png|" \
/usr/share/sddm/themes/01-breeze-fedora/theme.conf
rpm -qa | grep -q icewm-data && \
sed -i "s|/usr/share/backgrounds/default.png|/usr/share/wallpapers/$WALLPAPER/contents/images/5120x2880.png|" \
/usr/share/icewm/themes/IceAdwaita-Medium/default.theme
#======================================
# Decompress kernel modules
#--------------------------------------
find /lib/modules/*/kernel -name '*.ko.xz' -exec xz -d {} +
depmod $(basename /lib/modules/*)
#======================================
# Remove large/irrelevant firmwares
#--------------------------------------
rm -rf /usr/lib/firmware/{bnx2x,cxgb4,cypress,dpaa2,liquidio,mellanox,mrvl/prestera,netronome,qcom,qed}
#======================================
# Remove some large locales to save space
#--------------------------------------
#rm -rf /usr/share/locale/{ca,cs,da,de,es,fr,it,ja,nl,pl,pt_BR,sv,uk,vi,zh_CN}
find /usr/share/locale/* -maxdepth 0 -type d -not -name 'ru' -not -name 'ru_RU' | xargs rm -rf
#find /usr/share/help/* -maxdepth 0 -type d -not -name 'C' -not -name 'ru' -not -name 'ru_RU' | xargs rm -rf
#======================================
# Save some more space by removing
# large & unnecessary files
#--------------------------------------
rm -rf /usr/share/doc/*
rm -rf /usr/share/licenses/*
rm -rf /usr/include/*
rm -f /lib/modules/*/vmlinuz
find /usr/lib* -type f,l -name '*.a' -or -name '*.la' -delete
rm -rf /var/cache/libdnf5/*
#======================================
# nodm
#--------------------------------------
cat > /root/.xinitrc <<-EOF
exec /usr/bin/icewm-session
EOF
chmod 755 /root/.xinitrc
#ed -i 's/^#\(NODM_USER=\).*/\1root/' /etc/nodm.conf
#ed -i 's/^#\(NODM_X_OPTIONS=\).*/\1\"vt7 -nolisten tcp\"/' /etc/nodm.conf
#ed -i '/^NODM_XSESSION=/s|=.*|=/root/.xinitrc|' /etc/nodm.conf
#ed -i '/^NODM_MIN_SESSION_TIME=/s/=.*/=60/' /etc/nodm.conf
#n -sf xserver /etc/pam.d/nodm
#======================================
# icewm startup
#--------------------------------------
mkdir -p /root/.icewm/
cat > /root/.icewm/startup <<-EOF
#!/bin/sh
nm-applet &
EOF
chmod 755 /root/.icewm/startup
#======================================
# xterm
#--------------------------------------
cat > /root/.Xdefaults <<-EOF
xterm*faceName: Droid Sans Mono
xterm*faceSize: 11
xterm*rightScrollBar: true
EOF
exit 0