#!/bin/sh # Initially written by George Vlahavas # as a package. # Modified by Didier Spaier and included in Slint's installer as a post- # installation script called by setup. ( cd /mnt # This symlink lads in / during installation, no idea why. # Anyway, fix that (from installation of the tesseract-data package). mv eng.traineddata usr/share/tessdata/ # Somehow this doesn't seem to work from # /var/log/setup/setup.htmlview rm -f usr/bin/htmlview cat << EOF > usr/bin/htmlview #!/bin/sh exec xdg-open "\$@" EOF chmod 0755 usr/bin/htmlview # Make gamin use kernel notifications for file updates instead of # polling Cf. https://people.gnome.org/~veillard/gamin/config.html if [ -f etc/gamin/gaminrc ]; then sed -i "s/poll 15/kernel/" etc/gamin/gaminrc fi # This fixes problems with dialup connect time ( cd etc/ppp ln -sf ../resolv.conf resolv.conf ) # Enable ntp servers sed -i "s/^#server \(.*\) iburst/server \1 iburst/" etc/ntp.conf # Set default running Slint system services after installation of # the packages. Some of these settings can be changed during the # configuration step of a Slint installation. # Initially written for Salix then modified for Slint. # Some of these settings are redundant because they have been made # during packages' installation. But that will serve as a reminder. # When we use the default value we mark it like that: (D) When we # change it we mark it like that: (!D). Here "default" means # "resulting of package's installation". # We need to have the acpid daemon running for acpi to work (D) if [ -r etc/rc.d/rc.acpid ]; then chmod 0755 etc/rc.d/rc.acpid fi # Provide default sound settings or restore those saved (!D) if [ -r etc/rc.d/rc.alsa ]; then chmod 0755 etc/rc.d/rc.alsa fi # Do not load ALSA OSS kernel modules (D) if [ -r etc/rc.d/rc.alsa-oss ]; then chmod 0644 etc/rc.d/rc.alsa-oss fi # Netatalk allows Unix-like operating systems to serve as file, # print and time servers for Macintosh computers. (from Wikipedia). # Not everyone needs that. (D) if [ -r etc/rc.d/rc.atalk ]; then chmod 0644 etc/rc.d/rc.atalk fi # autofs is a kernel-based auto mounter for Linux. (D) if [ -r etc/rc.d/rc.autofs ]; then chmod 0644 etc/rc.d/rc.autofs fi # Name server. Most users will rely on a remote one. (D) if [ -r etc/rc.d/rc.bind ]; then chmod 0644 etc/rc.d/rc.bind fi # Many people need to communicate with bluetooth devices. (D) if [ -r etc/rc.d/rc.bluetooth ]; then chmod 0755 etc/rc.d/rc.bluetooth fi # We don't know if a braille device was used during installation, so # let's start a brltty daemon by default. According to Dave Mielke # this doesn't put a significant stress on resources and anyway # the user who don't need it can make rc.brltty non executable. # Edit from Slint64-14.2.1.3 onward we ask the during installation, # so don't override this choice. #if [ -r etc/rc.d/rc.brltty ]; then # chmod +x etc/rc.d/rc.brltty #fi # cgroups (abbreviation of control groups) is a Linux kernel feature # that limits, accounts for, and isolates the resource usage (CPU, # memory, disk I/O, network, etc.) of a collection of processes. # (from Wikipedia) # Enable configuration of cgroups in the linux kernel (D) if [ -r etc/rc.d/rc.cgconfig ]; then chmod 0755 etc/rc.d/rc.cgconfig fi # We do not want cgmanager to be started at boot, cf. # http://www.linuxquestions.org/questions/slackware-14/%5Brequest-for-comments%5D-do-we-still-need-cgmanager-4175599676/ # (!D) if [ -r etc/rc.d/rc.cgmanager ]; then chmod 0644 etc/rc.d/rc.cgmanager fi # We do not want cgmanager to be started at boot, cf. # http://www.linuxquestions.org/questions/slackware-14/%5Brequest-for-comments%5D-do-we-still-need-cgmanager-4175599676/ # Thus we won't start rc.cgproxy at boot either. (!D) if [ -r etc/rc.d/rc.cgproxy ]; then chmod 0644 etc/rc.d/rc.cgproxy fi # Enable the cgroup rules engine. if [ -r etc/rc.d/rc.cgred ]; then chmod 0755 etc/rc.d/rc.cgred fi # Polkit (formerly Policy Kit) is a component for controlling # system-wide privileges in Unix-like operating systems. It provides # an organized way for non-privileged processes to communicate with # privileged ones. from Wikipedia) # We need that executable e.g. to allow auto mount of removable # devices not listed in /etc/fstab by a regular users through a # file manager I guess, and to allow regular users to halt/restart # the system through a GUI (D). if [ -r etc/rc.d/rc.consolekit ]; then chmod 0755 etc/rc.d/rc.consolekit fi # Most users will want to be able to change the policy for setting # the CPU frequency if possible (D). if [ -r etc/rc.d/rc.cpufreq ]; then chmod 0755 etc/rc.d/rc.cpufreq fi # Most users expect printing to work out of the box, I assume. (!D). if [ -r etc/rc.d/rc.cups ]; then chmod 0755 etc/rc.d/rc.cups fi # Few users need to make remote CUPS printers available locally (D). if [ -r etc/rc.d/rc.cups-browsed ]; then chmod 0644 etc/rc.d/rc.cups-browsed fi # Most users won't need to run a small DNS/DHCP server that needs to # be configured first anyway (D). if [ -r etc/rc.d/rc.dnsmasq ]; then chmod 0644 etc/rc.d/rc.dnsmasq fi # If speech was used during installation, espeakup will be needed to # have speech on the console. if [ -r etc/rc.d/rc.espeakup ] && [ ! -f /tmp/noespeakup ]; then chmod 0755 etc/rc.d/rc.espeakup else chmod 0644 etc/rc.d/rc.espeakup fi # We don't want that speechd-up be started after installation. if [ -r etc/rc.d/rc.speechd-up ]; then chmod 0644 etc/rc.d/rc.speechd-up fi # We don't want that fenrir be started after installation. if [ -r etc/rc.d/rc.fenrir ]; then chmod 0644 etc/rc.d/rc.fenrir fi # We want to always create a block device for swap in zram (D) if [ -r etc/rc.d/rc.swapinzram ]; then chmod 0755 etc/rc.d/rc.swapinzram fi # rc.font will have been made executable during installation # No need to take care of that here (D). # if [ -r etc/rc.d/rc.font ]; then # chmod +x etc/rc.d/rc.font # fi # We need fuse control file system for a lot of stuff (D). if [ -r etc/rc.d/rc.fuse ]; then chmod 0755 etc/rc.d/rc.fuse fi # rc.gpm is created during configuration after installation, thus # does not exist yet. # Most users won't need to run an Apache server that needs to be # configured first anyway (D). if [ -r etc/rc.d/rc.httpd ]; then chmod 0644 etc/rc.d/rc.httpd fi # rc.inet1 brings up various system interfaces (D). if [ -r etc/rc.d/rc.inet1 ]; then chmod 0755 etc/rc.d/rc.inet1 fi # rc.inet2 boots up the entire network system (D). if [ -r etc/rc.d/rc.inet2 ]; then chmod 0755 etc/rc.d/rc.inet2 fi # rc.inetd is the BSD "super-server" daemon (D). The user needs # to edit /etc/inetd.conf for the services to be actually used. if [ -r etc/rc.d/rc.inetd ]; then chmod 0755 etc/rc.d/rc.inetd fi # rc.ip_forward allows the box to act acts as a router (D). if [ -r etc/rc.d/rc.ip_forward ]; then chmod 0755 etc/rc.d/rc.ip_forward fi # rc.keymap sets the kernel keyboard map (D). if [ -r etc/rc.d/rc.keymap ]; then chmod 0755 etc/rc.d/rc.keymap fi # rc.local allows to run custom commands at start up (D). if [ -r etc/rc.d/rc.local ]; then chmod 0644 etc/rc.d/rc.local fi # rc.loop loads the loop device kernel module if [ -r etc/rc.d/rc.loop ]; then chmod 0755 etc/rc.d/rc.loop fi # LXC (Linux Containers) is an operating-system-level virtualization # method for running multiple isolated Linux systems (containers) on # a control host using a single Linux kernel. # LXC combines kernel's cgroups and support for isolated namespaces # to provide an isolated environment for applications. (Wikipedia) # (D) if [ -r etc/rc.d/rc.lxc ]; then chmod 0644 etc/rc.d/rc.lxc fi # rc.mcelog starts the mcelog hardware error logging, that logs and # handles CPU hardware errors on x86 systems. (D) if [ -r etc/rc.d/rc.mcelog ]; then chmod 0755 etc/rc.d/rc.mcelog fi # rc.messagebus starts the dbus daemon that broadcast notifications # of system events and associated messages (D). if [ -r etc/rc.d/rc.messagebus ]; then chmod 0755 etc/rc.d/rc.messagebus fi # rc.modules updates the kernel dependencies then runs rc.local, and # rc.modules-$(uname-r) if created by the admin (D). if [ -r etc/rc.d/rc.modules ]; then chmod 0755 etc/rc.d/rc.modules fi # rc.modules.local can load a few modules not automatically loaded # case occurring if adapted in that aim by the admin, as possibly # rc.modules-$(uname-r) (D). if [ -r etc/rc.d/rc.modules.local ]; then chmod 0755 etc/rc.d/rc.modules.local fi # rc.mysqld starts the database engine MariaDB (D). if [ -r etc/rc.d/rc.mysqld ]; then chmod 0644 etc/rc.d/rc.mysqld fi # rc.networkmanager starts a daemon for automatically switching # network connections to the best available (D). # Most users will use that, but the script will then be made # executable during configuration post-installation. # Edit: from Slint64-14.2.1.3 onwards, done by bmconfig #if [ -r etc/rc.d/rc.networkmanager ]; then # chmod -x etc/rc.d/rc.networkmanager #fi # rc.nfsd starts the NFS (Network File System) server (D). if [ -r etc/rc.d/rc.nfsd ]; then chmod 0644 etc/rc.d/rc.ntpd fi # The Network Time Protocol daemon (ntpd) is an operating system # program that maintains the system time in synchronization with # time servers using the Network Time Protocol (NTP). I set it # executable because this is needed if we want clocksetup be able to # set the synchronization and George Vlahavas told me that this is # safe and I trust him (!D). if [ -r etc/rc.d/rc.ntpd ]; then chmod 0755 etc/rc.d/rc.ntpd fi # rc.pcmcia starts the pcmcia services, and configure wireless # pcmcia cards. Few recent machines have pcmcia slots (D). if [ -r etc/rc.d/rc.pcmcia ]; then chmod 0644 etc/rc.d/rc.pcmcia fi # rc.php-fpm starts the PHP FastCGI Process Manager daemon. # Only useful if you run a web server that uses this (D). if [ -r etc/rc.d/rc.php-fpm ]; then chmod 0644 etc/rc.d/rc.php-fpm fi # In most use cases there is no need to start pulseaudio system # wide and this is unadvised by upstream if [ -r etc/rc.d/rc.pulseaudio ]; then chmod 0644 etc/rc.d/rc.pulseaudio fi # rc.rpc starts the RPC damen needed to use NFS (D). if [ -r etc/rc.d/rc.rpc ]; then chmod 0644 etc/rc.d/rc.rpc fi # rc.samba starts the Samba SMB file/print server (D). if [ -r etc/rc.d/rc.samba ]; then chmod 0644 etc/rc.d/rc.samba fi # The saslauthd daemon handles plain text authentication requests on # behalf of the SASL (Simple Authentication and Security Layer) # library. It is mostly used to authenticate to mail servers (D). if [ -r etc/rc.d/rc.saslauthd ]; then chmod 06444 etc/rc.d/rc.saslauthd fi # rc.sendmail starts the sendmail mail server. if [ -r etc/rc.d/rc.sendmail ]; then chmod 0644 etc/rc.d/rc.sendmail fi # rc.serial initializes the serial ports of the system. Serial ports # are less frequently provided on recent boxes (D). if [ -r etc/rc.d/rc.serial ]; then chmod 0644 etc/rc.d/rc.serial fi # rc.snmpd tarts the net-snmp SNMP daemon. SNMP stands for Simple # Network Management Protocol (D). if [ -r etc/rc.d/rc.snmpd ]; then chmod 0644 etc/rc.d/rc.snmpd fi # rc.sshd starts the SSH (secure shell) daemon. This is necessary to # manage a remote system as soon as installed and running. It is # safe as won't provide any access by default (D). if [ -r etc/rc.d/rc.sshd ]; then chmod 0755 etc/rc.d/rc.sshd fi # rc.syslog starts the system logging daemons (D). if [ -r etc/rc.d/rc.syslog ]; then chmod 0755 etc/rc.d/rc.syslog fi # rc.sysstat resets the system activity logs (D). if [ -r etc/rc.d/rc.sysstat ]; then chmod 0644 etc/rc.d/rc.sysstat fi # rc.sysvinit provides basic compatibility with SystemV style # startup method often used by commercial software. (D). if [ -r etc/rc.d/rc.sysvinit ]; then chmod 0755 etc/rc.d/rc.sysvinit fi # rc.udev initializes udev, which populates the /dev/directory with # nodes, scans for devices, load the appropriate kernel modules # and configure the devices (D). if [ -r etc/rc.d/rc.udev ]; then chmod 0755 etc/rc.d/rc.udev fi # ulogd is a userspace logging daemon for netfilter/iptables daemon, # thus used with firewalls (D). if [ -r etc/rc.d/rc.ulogd ]; then chmod 0755 etc/rc.d/rc.ulogd fi # rc.wireless sets up PCI, USB, and 32-bit Cardbus wireless devices # but not 16-bit PCMCIA cards, configured by rc.pcmcia (D). if [ -r etc/rc.d/rc.wireless ]; then chmod 0755 etc/rc.d/rc.wireless fi # rc.yp starts the NIS (Netwok Information Service) (D). if [ -r etc/rc.d/rc.yp ]; then chmod 0644 etc/rc.d/rc.yp fi # Get rid of the symlink etc/X11/xinit/xinitrc that was written # installing the xinit Slackware package, as we don't want that kde # be the WM proposed by default by xwmconfig during installation. # Edit: instead, symlink to xinitrc.mate in Slint64-4.2.1.3 in the' auto # script and we don't run xwmconfig during installation anymore. # rm -f etc/X11/xinit/xinitrc # The root menu for windowmaker installed by slint-user-settings # assumes that the Preferences sub-menu is: # /usr/lib64/GNUstep/applications/WPreofs.app/WPrefs, but for 64-bit # instead it is: # /usr/lib64/GNUstep/applications/WPrefs.app/WPrefs if [ ! -f usr/lib64/GNUstep/Applications/WPrefs.app/WPrefs ] \ && [ -d etc/skel/GNUstep/Defaults ]; then ( cd etc/skel/GNUstep/Defaults sed s/lib64/lib/ WMRootMenu > dummy mv dummy WMRootMenu ) fi # In case chgrp failed when installing brltty: chroot /mnt /bin/chgrp braille /etc/brlapi.key # If speech was used during installation, assume that lightdm should # speak in the installed system as well as gdm if [ ! -f /tmp/noespeakup ]; then echo "yes" > etc/dm-speak # This is for gdm else # lightdm speaks by default. Mute it. ( cd etc/lightdm sed /orca/d lightdm-gtk-greeter.conf > dummy mv dummy lightdm-gtk-greeter.conf ) fi # set gdm as default display manager in runlevel 4 cat <<-"EOF" > etc/rc.d/rc.4.local #gdm if [ -x /usr/sbin/gdm ]; then exec /usr/sbin/gdm -nodaemon fi EOF chmod 755 etc/rc.d/rc.4.local # We don't want that the hplip applet be in the tray by default if [ -f etc/xdg/autostart/hplip-systray.desktop ]; then sed -i "/Hidden/d" etc/xdg/autostart/hplip-systray.desktop echo "Hidden=true" >> etc/xdg/autostart/hplip-systray.desktop fi # We don't want a login getty in runlevel 4 on tty1 sed -i '/c1/s,.*,c1:1235:respawn:/sbin/agetty --noclear 38400 tty1 linux,' etc/inittab # If a sound card was chosen and speech was used, set as default # this card's id for espeakup. if [ ! -f /tmp/nosound ] && [ -f /tmp/alsacard ]; then ( cd etc ALSA_CARD=$(cat /tmp/alsacard) sed "/^#ALSA_CARD=/s@.*@ALSA_CARD=$ALSA_CARD@" espeakup.conf > reallydummy mv reallydummy espeakup.conf ) fi # Edit the .desktop files to display relevant application menu entries # ==================================================================== if [ -d usr/share/applications/kde4 ]; then ( cd usr/share/applications/kde4 # We want apps that need to start akonadi only shown in # KDE's application menu if [ ! "$(ls ../../../../var/log/packages/kdepim* 2>/dev/null)" = "" ]; then for kde_app in \ $(grep "\.desktop" ../../../../var/log/packages/kdepim* \ | grep applications \ | sed "s,.*/,,"); do if [ -f $kde_app ]; then sed -i '/OnlyShow/d' $kde_app echo 'OnlyShowIn=KDE;' >> $kde_app fi done fi # There is no point showing in other menus KDE applications # that are shown in KDE's menus. for hide in kdeconnect.desktop kdesystemsettings.desktop; do if [ -f $hide ]; then sed -i '/Hidden/d' $hide echo 'Hidden=true' >> $hide fi done ) fi if [ -d usr/share/applications ]; then ( cd usr/share/applications if [ -f geany.desktop ]; then sed -i '/Categories/d' geany.desktop echo 'Categories=Utility;TextEditor' >> geany.desktop fi if [ -f gvim.desktop ]; then sed -i '/Categories/d' gvim.desktop echo 'Categories=Utility;TextEditor' >> gvim.desktop fi for xfce in \ Thunar-bulk-rename.desktop \ Thunar-folder-handler.desktop \ Thunar.desktop \ thunar-settings.desktop \ thunar-volman-settings.desktop \ xfce4-power-manager-settings.desktop \ xfce4-taskmanager.desktop; do if [ -f $xfce ]; then sed -i '/OnlyShow/d' $xfce echo 'OnlyShowIn=XFCE;' >> $xfce fi done for lxde in \ lxappearance.desktop \ lxrandr.desktop \ lxsession-edit.desktop \ lxtask.desktop; do if [ -f $lxde ]; then sed -i '/OnlyShow/d' $lxde echo 'OnlyShowIn=LXDE;' >> $lxde fi done for mate in \ mate-disk-usage-analyzer.desktop \ mate-power-preferences.desktop; do if [ -f $mate ]; then sed -i '/OnlyShow/d' $mate echo 'OnlyShowIn=MATE;' >> $mate fi done for many in pcmanfm-desktop-pref.desktop pcmanfm.desktop; do if [ -f $many ]; then sed -i '/NotShow/d' $many echo 'NotShowIn=MATE;XFCE;KDE;' >> $many fi done for everywhere in \ exo-file-manager.desktop \ exo-mail-reader.desktop \ exo-terminal-emulator.desktop \ exo-web-browser.desktop; do if [ -f $everywhere ] && grep -q "OnlyShow" $everywhere; then sed -i '/OnlyShow/d' $everywhere fi done if [ -f nm-connection-editor.desktop ]; then sed -i '/NotShow/d' nm-connection-editor.desktop echo 'NotShowIn=KDE;' >> \ nm-connection-editor.desktop fi if [ -f nm-applet.desktop ]; then sed -i '/NotShow/d' nm-applet.desktop echo 'NotShowIn=KDE;' >> \ nm-applet.desktop fi # We' don't use pkexec in Slint64-4.2.1.1 if [ -f /usr/share/gdm/applications/gdmsetup.desktop ]; then sed -i "s,^Exec.*,Exec=ktsuss /usr/sbin/gdmsetup," \ /usr/share/gdm/applications/gdmsetup.desktop fi if [ -f /usr/share/applications/lightdm-gtk-greeter-settings.desktop ]; then sed -i "s/^Exec.*/Exec=ktsuss lightdm-gtk-greeter-settings/" \ /usr/share/applications/lightdm-gtk-greeter-settings.desktop fi # Add a MimeType to mozilla-thunderbird.desktop so it be proposed as # default application for links to mail if [ -f usr/share/applications/mozilla-thunderbird.desktop ]; then if ! grep -wq MimeType usr/share/applications/mozilla-thunderbird.desktop; then echo 'MimeType=x-scheme-handler/mailto;' >> \ usr/share/applications/mozilla-thunderbird.desktop fi fi ) fi # For now, disable xdm. It needs some rework in Slint and we already # ship lxdm, lightdm, and kdm if the KDE packages are installed. chmod 644 usr/bin/xdm usr/X11R6/bin/xdm # Edit: Not needed, done by update-all during installation. # Just in case some package installing schemas didn't compile them: chroot /mnt glib-compile-schemas /usr/share/glib-2.0/schemas/ 2>/dev/null # Update slint-version if need be echo "Slint 14.2.1" > etc/slint-version # Fix /etc/issue without repackaging etc echo "Welcome to \S \s \r on \l" > etc/issue # fix ownership if udev didn't do it right chown root:tty dev/tty1 chown root:tty dev/tty2 chown root:tty dev/tty3 chown root:tty dev/tty4 )