Faster Boot for antiX Linux 23

Forum Forums General Tips and Tricks Faster Boot for antiX Linux 23

  • This topic has 61 replies, 13 voices, and was last updated Oct 8-7:11 pm by olsztyn.
Viewing 15 posts - 16 through 30 (of 62 total)
  • Author
    Posts
  • #117039
    Member
    abc-nix

      on an installed antiX23 b3 system

      dpkg: warning: downgrading runit-core-services-antix from 0.2.0 to 0.1.8.1

      dpkg: warning: downgrading runit-full-core-services-antix from 0.1.4 to 0.1.3.2

      antiX 23 beta3 is a heavily modified runit implementation that no longer brings sysvinit compatibility, so stage 2 improvements included in this update will not take effect (because there is no /etc/rc2.d/ folder). This edition cannot use sysvinit services automatically, so sysvinit-compat is useless here.
      Also, shutdown will be much slower because the original b3 doesn’t include the scripts to stop processes and unmount filesystems, which this update does. You could remove them from /etc/runit-core/shutdown.d (Starting from 20* forward, remove them all).

      For this 23b3 release, it would have been great to compare exact stage times by installing only runit-antix, runit-init and getty-run, without modifying the runit-core scripts. If you then enable logging, as described in my previous comment, you would be able to measure exactly how long stage 1 takes. After 4 or 5 boots, you could calculate the average time it takes the system to run stage 1 (and maybe even stage 2), and then compare it with installing the updated runit-core packages. This would be ideal, as it would be much better for comparing between previous and provided runit-core script update. Also, you would be able to measure how long each of the runit-core scripts takes each time and find possible errors during boot.

      For me the main feature is logging boot messages (and measuring stage time).

      As I showed in my second article, slimski to desktop can take more or less depending on when it starts (runit services start with no order). On my system live, it can take from 3.28 seconds to 4.19. You can check how long by comparing the times
      start-t slimski
      and
      start-t icewm
      and see if they change each time you boot.

      • This reply was modified 10 months ago by abc-nix.
      #117045
      Member
      abc-nix

        I just tested installing only the 3 packages I mentioned on a live antiX 23 b3.

        $ sudo apt install /home/demo/Live-usb-storage/runit-test/getty-run_2.1.2-54.1alpha1_all.deb /home/demo/Live-usb-storage/runit-test/runit-antix_2.1.2-54.1alpha1_amd64.deb /home/demo/Live-usb-storage/runit-test/runit-init-antix_2.1.2-54.1alpha1_all.deb                                                                   [sudo] password for demo: 
        Reading package lists... Done
        Building dependency tree... Done
        Reading state information... Done
        Note, selecting 'getty-run' instead of '/home/demo/Live-usb-storage/runit-test/getty-run_2.1.2-54.1alpha1_all.deb'
        Note, selecting 'runit-antix' instead of '/home/demo/Live-usb-storage/runit-test/runit-antix_2.1.2-54.1alpha1_amd64.deb'
        Note, selecting 'runit-init-antix' instead of '/home/demo/Live-usb-storage/runit-test/runit-init-antix_2.1.2-54.1alpha1_all.deb'
        Suggested packages:
          fgetty socklog
        The following packages will be upgraded:
          getty-run runit-antix runit-init-antix
        3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
        Need to get 0 B/152 kB of archives.
        After this operation, 24.6 kB disk space will be freed.
        Get:1 /home/demo/Live-usb-storage/runit-test/getty-run_2.1.2-54.1alpha1_all.deb getty-run all 2.1.2-54.1alpha1 [11.5 kB]
        Get:2 /home/demo/Live-usb-storage/runit-test/runit-antix_2.1.2-54.1alpha1_amd64.deb runit-antix amd64 2.1.2-54.1alpha1 [122 kB]
        Get:3 /home/demo/Live-usb-storage/runit-test/runit-init-antix_2.1.2-54.1alpha1_all.deb runit-init-antix all 2.1.2-54.1alpha1 [19.3 kB]
        (Reading database ... 174170 files and directories currently installed.)
        Preparing to unpack .../getty-run_2.1.2-54.1alpha1_all.deb ...
        Unpacking getty-run (2.1.2-54.1alpha1) over (2.1.2-43.0antix3) ...
        dpkg: warning: unable to delete old directory '/etc/sv/getty-ttyS0/supervise': Directory not empty
        Preparing to unpack .../runit-antix_2.1.2-54.1alpha1_amd64.deb ...
        runit: switching /etc/service to current... done
        Unpacking runit-antix (2.1.2-54.1alpha1) over (2.1.2-43.0antix3) ...
        Preparing to unpack .../runit-init-antix_2.1.2-54.1alpha1_all.deb ...
        Unpacking runit-init-antix (2.1.2-54.1alpha1) over (2.1.2-43.0antix3) ...
        Setting up runit-antix (2.1.2-54.1alpha1) ...
        Installing new version of config file /etc/default/runit-antix ...
        Installing new version of config file /etc/runit/1 ...
        Installing new version of config file /etc/runit/2 ...
        Installing new version of config file /etc/runit/3 ...
        Copying sysvinit-compat service to /etc/sv
        Setting up getty-run (2.1.2-54.1alpha1) ...
        ok: run: getty-ttyS0: (pid 6947) 8s
        Setting up runit-init-antix (2.1.2-54.1alpha1) ...
        Processing triggers for man-db (2.11.2-2) ...
        N: Download is performed unsandboxed as root as file '/home/demo/Live-usb-storage/runit-test/getty-run_2.1.2-54.1alpha1_all.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

        It shutdown properly for me, even saving persistance changes.

        And this is a log example. I got this after enabling VERBOSE and DEBUG in the runit-antix default file:

        Sun, 17 Sep 2023 17:48:50 +0200
        [8.52000000]: Start stage 1
        [8.52000000]: DEPRECATED: starting scripts in /etc/runit-core/
        Setting up console font and keymap
        Starting hot-plug events dispatcher: udevd.
        Synthesizing the initial hotplug events (subsystems)...done.
        Synthesizing the initial hotplug events (devices)...done.
        Waiting for /dev to be fully populated...done.
        Setting up keyboard layout
        Activating swap...done.
        Cleaning up temporary files... /tmp.
        Loading kernel module lp.
        Loading kernel module ppdev.
        Loading kernel module parport_pc.
        Starting NFS common utilities: statd
        Not starting: portmapper is not running ... (warning).
        Starting remaining crypto disks...done.
        Checking file systems...fsck: No such file or directory
        fsck exited with status code 1
        done.
        Mounting local filesystems...done.
        Activating swapfile swap, if any...done.
        Cleaning up temporary files....
        Setting up resolvconf...done.
        Configuring network interfaces...done.
        Cleaning up temporary files....
        Setting up ALSA...warning: 'alsactl -E HOME=/run/alsa -E XDG_RUNTIME_DIR= restore' failed with error message 'alsa-lib parser.c:2783:(load_toplevel_config) Unable to find the top-level configuration file '/usr/share/alsa/ucm2/ucm.conf'.
        alsa-lib main.c:1541:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2
        alsa-lib parser.c:2783:(load_toplevel_config) Unable to find the top-level configuration file '/usr/share/alsa/ucm2/ucm.conf'.
        alsa-lib main.c:1541:(snd_use_case_mgr_open) error: failed to import hw:1 use case configuration -2'...done.
        Setting sensors limits...Setting up X socket directories... /tmp/.X11-unix /tmp/.ICE-unix.
        [13.1300000]: Exit stage 1
        [13.1400000]: Start stage 2
        [13.1400000]: Service directory changed to default
        [13.1500000]: Running rc.local as fallback for missing sysvinit compatibility
        live-restore-services: restoring service links
        live-usb-save: Restore state information
        [13.2800000]: Starting runit services in /etc/service...

        With this, I see how long the first two stages take:

        • stage 1: 13.13 – 8.52 = 4.61 seconds (probably one of my record times).
        • stage 2: 13.28 – 13.14 = 0.14 seconds (it is fast, but with sysvinit-compat it would become 0.01 senconds)

        But wait. What is this I see?

        [...]
        Checking file systems...fsck: No such file or directory
        fsck exited with status code 1
        [...]
        Setting up ALSA...warning: 'alsactl -E HOME=/run/alsa -E XDG_RUNTIME_DIR= restore' failed with error message 'alsa-lib parser.c:2783:(load_toplevel_config) Unable to find the top-level configuration file '/usr/share/alsa/ucm2/ucm.conf'.
        alsa-lib main.c:1541:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2
        alsa-lib parser.c:2783:(load_toplevel_config) Unable to find the top-level configuration file '/usr/share/alsa/ucm2/ucm.conf'.
        alsa-lib main.c:1541:(snd_use_case_mgr_open) error: failed to import hw:1 use case configuration -2'...done.

        I can now clearly see errors during bootup that I previously didn’t know existed.

        The first error is relate to an issue with fsck, which the newer runit-core scripts haven’t fixed yet. For some reason, on live-usb, PATH is ignored and the fsck binary cannot be found. I am not sure if this is related to busybox or what, but the only way I got it fixed was by using the exact path to the fsck binary. Strangely, this is not needed when antiX is installed (fsck works properly), but on live I need to use the exact path to fsck for it to run. Maybe someone smarter can figure out the issue and send a fix to the runit-core source git repo.

        The second error was discussed in the beta3 thread, and was already fixed by anticapitalista in the final release.

        Probably this beta3 release will always have the fastest runit-core scripts, as some of the newer ones are missing, but if you don’t need them, don’t update them. The other improvements should work well and be welcomed.

        #117565
        Member
        blur13

          Avoiding a login manager is an even faster option. Using xinit and startx has a similar complexity to setting up greetd, and achieves similar times.

          This is interesting. I always autologin to icewm using slimski. I’m the only user of the system. I never switch window manager. It would seem that slimski is not strictly necessary. If you have the time, could you do a quick write-up on how to implement xinit/startx in antiX 23 sysvinit?

          #117584
          Member
          kernelpanic

            @abc-nix: many thanks for your interesting tutorial!

            my setup is similar to blur13 (autologin, only user), so I would also appreciate a “how to” to “bypass” a login-manager via xinit and startx :-)

            a question to your section of handling/improving Xorg:
            after installation of antiX23 to a hard disk Xorg went into a loop and did not start at all.
            the reason for it was a file named xorg.conf.in (could not find out the meaning of the “.in”-extension) that was created in /etc/X11 during install.
            just renaming/deleting it solved the problem, so obviously there was an erroneous entry in it.
            I know Xorg does NOT need (as in earlier days) a xorg.conf anymore and “auto-configures” itself every time the system is booted.
            this appears not really efficient to me (wasting time to just scan through available monitors, sync rates, drivers and so on?), so my question is:
            would a manually created xorg.conf (defining certain “sections” like device, monitor, screen …) speed up the start of X significantly?

            #117588
            Member
            abc-nix

              could you do a quick write-up on how to implement xinit/startx in antiX 23 sysvinit?

              I will write a small tutorial for greetd + startx. I find this the easiest method. The other option is setting up xinit and a separate service or an intruction in /etc/rc.local, which I haven’t tested myself.

              I know Xorg does NOT need (as in earlier days) a xorg.conf anymore and “auto-configures” itself every time the system is booted.
              this appears not really efficient to me (wasting time to just scan through available monitors, sync rates, drivers and so on?), so my question is:
              would a manually created xorg.conf (defining certain “sections” like device, monitor, screen …) speed up the start of X significantly?

              I don’t think it will make much a difference in loading time, but you could try the experiment and measure the time difference between using and not using a .conf file.
              You can generate a conf file for xorg with X -configure. See the Xorg article in the arch wiki.

              #117604
              Member
              blur13

                I think I found the way, it seems to work.

                sudo sysv-rc-conf

                disable slimski (runlevels 2 and 5)

                edit /etc/inittab

                change
                1:2345:respawn:/sbin/getty --noclear 38400 tty1

                to

                1:2345:respawn:/sbin/getty --autologin your-user-name --noclear 38400 tty1

                create ~/.bash_login with

                if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
                   exec startx /usr/local/bin/desktop-session icewm
                fi

                could change icewm to zzz-icewm if you prefer that, or any other desktop code, rox-icewm, etc.

                Its probably a few split seconds of a split second faster booting up, and you save 5 MiB of memory, or whatever Slimski was using. Mean and lean.

                • This reply was modified 10 months ago by blur13.
                • This reply was modified 10 months ago by blur13.
                #117608
                Member
                abc-nix

                  Thanks, blur13! Very interesting how easy it really was. I was too obsessed with having PAM modules loaded, but for basic window managers this is not needed.

                  This saves me from writing the greetd article. I can leave it for later in the future.

                  #117610
                  Member
                  olsztyn

                    I think I found the way, it seems to work.

                    Thanks @blur13…
                    Perhaps there is a chance to develop this methodology for runit… I will try something equivalet to what you just posted…

                    • This reply was modified 10 months ago by olsztyn.

                    Live antiX Boot Options (Previously posted by Xecure):
                    http://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

                    #117616
                    Member
                    blur13

                      You do spawn a few other processes that are not present when using slimski (using ps_mem)

                      236.0 KiB +  37.5 KiB = 273.5 KiB startx
                      252.0 KiB + 195.5 KiB = 447.5 KiB xinit
                      584.0 KiB + 206.5 KiB = 790.5 KiB login

                      On the other hand you spawn one less getty (five instead of six) so that saves you another 200 KiB. Compared to Slimski (5 MiB) its still a net positive. The getty thing got me thinking that its a bit redundant to have so many of them. Usually only one is needed. If xorg gets stuck its nice to be able to switch to another one, so maybe two would be ideal. Thats another 1 MiB saved.

                      #117634
                      Member
                      anti-apXos

                        Perhaps there is a chance to develop this methodology for runit…

                        On runit systems, you can remove the ‘slimski’ symlink in /etc/runit/runsvdir/default (it can be recreated later from /etc/sv/slimski to go back to using slimski) and edit the /etc/sv/getty-tty1/run script to include the –autologin option on the exec line.

                        In my case, I had the problem described in this topic and the solution there worked. I think this issue might be specific to certain hardware or something because I don’t remember having any problem when I disabled slimski on a different laptop a while ago.

                        #117789
                        Member
                        blur13

                          I tried removing slimski on two laptops and in both cases the keyboard worked, but the touchpad didnt. The solution suggested above (install xserver-xorg-legacy and needs_root_rights=yes in etc/X11/Xwrapper.config) didnt work. I’m not sure what it is slimski is launching thats needed to enable touchpad support. Anyone got a clue?

                          The mouse is working in the console. Its only after launching xorg it stops to work.

                          #117794
                          Forum Admin
                          anticapitalista

                            I tried removing slimski on two laptops and in both cases the keyboard worked, but the touchpad didnt. The solution suggested above (install xserver-xorg-legacy and needs_root_rights=yes in etc/X11/Xwrapper.config) didnt work. I’m not sure what it is slimski is launching thats needed to enable touchpad support. Anyone got a clue?

                            The mouse is working in the console. Its only after launching xorg it stops to work.

                            I had to remove xserver-xorg-input-synaptics and reboot on my Lenovo Thinkpad L412

                            Make sure xserver-xorg-input-libinput is installed.

                            Philosophers have interpreted the world in many ways; the point is to change it.

                            antiX with runit - leaner and meaner.

                            #117810
                            Member
                            blur13

                              Thank you, that worked!

                              #117818
                              Member
                              anti-apXos

                                @anticapitalista I think this is also what I discovered last night, but I did it by deleting /etc/X11/xorg.conf.d/synaptics.conf. Apparently X will default to libinput for trackpads if it’s not told to use synaptics.

                                You might also need to install xinput if you want to change the default trackpad behavior since synclient won’t work anymore. You can set up a new conf file in /etc/X11/xorg.conf.d to set the libinput trackpad behavior without xinput, but I don’t know if there’s a way to get the list of supported properties without using xinput.

                                The libinput touchpad driver does not support kinetic scrolling/coasting at all, though, which may be enough to get me to keep using xserver-xorg-legacy…or maybe just stick with slimski, eh? Well, at least it makes sense now.

                                #117842
                                Member
                                abc-nix

                                  If possible, let us move the xorg discussion to Xorg and non-root startx?, as it is more relevant there.

                                  I still hope I can get more users to test the runit changes proposed in the second post and that can be downloaded from this post. If there is no interest, I will let it go and look into improving some other part of the runit implementation.

                                Viewing 15 posts - 16 through 30 (of 62 total)
                                • You must be logged in to reply to this topic.