add X support with XFCE desktop and VNC sharing enabled

This commit is contained in:
Tobias Powalowski 2022-05-03 11:01:16 +02:00
parent 644c0abde7
commit 626d18c978
5 changed files with 93 additions and 4 deletions

View file

@ -12,6 +12,7 @@ while [ $# -gt 0 ]; do
-latest|--latest) _L_COMPLETE="1" ;;
-latest-install|--latest-install) _L_INSTALL_COMPLETE="1";;
-latest-image|--latest-image) _G_RELEASE="1" ;;
-launch-xfce|--launch-xfce) _L_XFCE="1" ;;
-h|--h|?) usage ;;
*) usage ;;
esac
@ -74,3 +75,10 @@ if [[ "${_G_RELEASE}" == "1" ]]; then
"archboot-${_RUNNING_ARCH}-release.sh" "${_W_DIR}" >/dev/tty7 2>&1 || exit 1
echo -e "\033[1mFinished:\033[0m New isofiles are located in ${_W_DIR}"
fi
# Launch xfce
if [[ "${_L_XFCE}" == "1" ]]; then
echo -e "\033[1mStep 1/1:\033[0m Preparing XFCE desktop ${_W_DIR} now ..."
echo " This will need some time ..."
_launch_xfce >/dev/tty7 2>&1
fi

View file

@ -57,7 +57,7 @@ _clean_container() {
echo "Clean container, delete not needed files from ${1} ..."
rm -r "${1}"/usr/include
rm -r "${1}"/usr/share/{aclocal,applications,audit,avahi,awk,bash-completion,cmake,common-lisp,cracklib,dhclient,dhcpcd,dict,dnsmasq,emacs,et,fish,gdb,gettext,gettext-0.21,glib-2.0,gnupg,graphite2,gtk-doc,iana-etc,icons,icu,iptables,keyutils,libalpm,libgpg-error,makepkg-template,misc,mkinitcpio,ncat,ntp,p11-kit,pixmaps,pkgconfig,readline,screen,smartmontools,ss,stoken,tabset,texinfo,vala,xml,xtables,zoneinfo-leaps,man,doc,info,perl5,i18n,locale}
rm -r "${1}"/usr/lib/{audit,avahi,awk,bash,binfmt.d,cifs-utils,cmake,coreutils,cryptsetup,cups,dracut,e2fsprogs,engines-1.1,environment.d,gawk,getconf,gettext,girepository-1.0,glib-2.0,gnupg,gssproxy,guile,icu,itcl4.2.2,iwd,krb5,ldb,ldscripts,libnl,libproxy,ntfs-3g,openconnect,openssl-1.0,p11-kit,pcsc,perl5,pkcs11,pkgconfig,python3.10,rsync,samba,sasl2,siconv,tar,tcl8.6,tcl8,tdbc1.1.3,tdbcmysql1.1.3,tdbcodbc1.1.3,tdbcpostgres1.1.3,terminfo,texinfo,thread2.8.7,valgrind,xfsprogs,xplc-0.3.13,xtables}
rm -r "${1}"/usr/lib/{audit,avahi,awk,bash,binfmt.d,cifs-utils,cmake,coreutils,cryptsetup,cups,dracut,e2fsprogs,engines-1.1,environment.d,gawk,getconf,gettext,girepository-1.0,glib-2.0,gnupg,gssproxy,guile,icu,itcl4.2.2,iwd,krb5,ldb,ldscripts,libnl,libproxy,ntfs-3g,openconnect,openssl-1.0,p11-kit,pcsc,perl5,pkgconfig,python3.10,rsync,samba,sasl2,siconv,tar,tcl8.6,tcl8,tdbc1.1.3,tdbcmysql1.1.3,tdbcodbc1.1.3,tdbcpostgres1.1.3,terminfo,texinfo,thread2.8.7,valgrind,xfsprogs,xplc-0.3.13,xtables}
fi
}

View file

@ -16,8 +16,8 @@ _ZRAM_SIZE=${_ZRAM_SIZE:-"3G"}
[[ "${_RUNNING_ARCH}" == "aarch64" ]] && VMLINUZ="Image"
usage () {
echo -e "\033[1mUpdate installer, launch latest environment or create latest image files:\033[0m"
echo -e "\033[1m-------------------------------------------------------------------------\033[0m"
echo -e "\033[1mUpdate installer, launch environments or create latest image files:\033[0m"
echo -e "\033[1m-------------------------------------------------------------------\033[0m"
echo -e "\033[1mPARAMETERS:\033[0m"
echo -e " \033[1m-u\033[0m Update scripts: setup, quickinst, tz, km and helpers."
echo -e ""
@ -31,6 +31,9 @@ usage () {
echo -e " \033[1m-latest-image\033[0m Generate latest image files in /archboot directory"
echo -e " This operation needs at least \033[1m3.5 GB RAM\033[0m."
echo ""
echo -e " \033[1m-launch-xfce\033[0m Launch X with XFCE desktop with VNC sharing enabled."
echo -e " This operation needs at least \033[1m3.0 GB RAM\033[0m."
echo ""
echo -e " \033[1m-h\033[0m This message."
exit 0
}
@ -222,3 +225,80 @@ _kexec() {
sleep 1
done
}
_launch_xfce() {
X_PACKAGES="xorg xfce4 libtiff glib2 chromium libcups gcc-libs glibc harfbuzz avahi nss breeze-icons tigervnc perl"
pacman -Sy ${X_PACKAGES} --noconfirm
rm -r /usr/share/{locale,man,info,doc,gtk-doc,ibus}
rm -r /usr/include
# fix chromium startup
cat << EOF >/etc/chromium-flags.conf
--no-sandbox
--test-type
wiki.archlinux.org/title/Archboot
EOF
# fix xfce4 defaults
# breeze icons
sed -i -e 's#<property name="IconThemeName" type="string" value="Adwaita"/>#<property name="IconThemeName" type="string" value="breeze"/>#g' \
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
sed -i -e '/xfce4-run.desktop/i <Filename>archboot.desktop</Filename>' /etc/xdg/menus/xfce-applications.menu
sed -i -e 's#firefox#chromium#g' /etc/xdg/xfce4/helpers.rc
# background image
cat << EOF >/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-desktop" version="1.0">
<property name="backdrop" type="empty">
<property name="screen0" type="empty">
<property name="monitor0" type="empty">
<property name="image-path" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
<property name="last-single-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
<property name="image-show" type="bool" value="true"/>
<property name="image-style" type="int" value="0"/>
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="3"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
</property>
</property>
<property name="monitorVNC-0" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="3"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
</property>
</property>
<property name="monitorHDMI1" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="3"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
</property>
</property>
</property>
</property>
EOF
# autostart setup
cat << EOF > /etc/xdg/autostart/archboot.desktop
[Desktop Entry]
Type=Application
Name=Archboot Setup
Exec=xfce4-terminal -x /usr/bin/setup
Icon=system-software-install
Categories=X-Xfce-Toplevel;
EOF
# autostart tigervnc
cat << EOF > /etc/xdg/autostart/tigervnc.desktop
[Desktop Entry]
Type=Application
Name=Tigervnc
Exec=x0vncserver -SecurityTypes=None
EOF
cp /etc/xdg/autostart/archboot.desktop /usr/share/applications/archboot.desktop
# hide menu entries
for i in xfce4-mail-reader qv4l2 qvidcap bssh bvnc avahi-discover; do
echo 'NoDisplay=true' >> /usr/share/applications/$i.desktop
done
startxfce4
}

View file

@ -141,7 +141,7 @@ build ()
ca_dir="/etc/ca-certificates/extracted"
cert_dir="/etc/ssl"
cert2_dir="/etc/ssl/certs"
map add_full_dir "$ca_dir" "$cert2_dir"
map add_full_dir "$ca_dir" "$cert2_dir" /usr/lib/p11-kit /usr/lib/pkcs11
add_symlink "${cert_dir}/${cert}" "../ca-certificates/extracted/$cafile"
add_symlink "${cert2_dir}/${cert2}" "../../ca-certificates/extracted/$cafile"
add_file /usr/share/ca-certificates/trust-source/mozilla.trust.p11-kit

View file

@ -13,6 +13,7 @@ build ()
add_file "/usr/bin/archboot-restore-usbstick.sh" "/usr/bin/restore-usbstick.sh"
add_full_dir "/usr/lib/archboot/installer"
add_file "/etc/archboot/defaults"
add_file "/usr/share/archboot/grub/archboot-background.png"
}
help ()