Thus, let's imagine that we have a binary that depends on the QtCore library, once we have executed prelink on it, it will first search in the space designated by prelink, and in the event that it does not find it (an update, for example) it will search for it in the traditional way.
Prelink works on any POSIX compliant system, like GNU / linux or the BSDs.
How to apply prelink
Optimizing the system with prelink is quite simple, we can optimize a binary using (as root):
prelink binario
But to optimize the entire system we must perform:
prelink -amvR
You will see something like this:
Here is a detailed explanation of the meaning of the parameters:
- a: equals –all, makes it apply to the whole system
- m: equivalent to –conserve-memory, the explanation of how it works is complex, but saves space
- v: equivalent to –verbose, it allows us to know which are the pre-linked libraries
- A: Equivalent to –random, increase security by making a value random. I do not know the details of its operation
To un-pre-link (unlink) a binary
prelink -u
The whole system:
prelink -au
# Skype -b / usr / lib32 / skype / skype -b / usr / lib / skype / skype # Flash Player Plugin -b /usr/lib/mozilla/plugins/libflashplayer.so # NVIDIA -b / usr / lib / libGL .so * -b /usr/lib32/libGL.so* -b //usr/lib/libOpenCL.so* -b //usr/lib32/libOpenCL.so* -b / usr / lib32 / vdpau / -b / usr / lib / vdpau / -b /usr/lib/xorg/modules/drivers/nvidia_drv.so -b /usr/lib/xorg/modules/extensions/libglx.so* -b / usr / lib / libnvidia- * - b / usr / lib32 / libnvidia- * # Catalyst -b / usr / lib / libati * -b / usr / lib / fglrx * -b / usr / lib / libAMDXvBA * -b /usr/lib/libGL.so* - b / usr / lib / libfglrx * -b /usr/lib/xorg/modules/dri/fglrx_dri.so -b /usr/lib/xorg/modules/drivers/fglrx_drv.so -b / usr / lib / xorg / modules / extensions / fglrx / -b /usr/lib/xorg/modules/linux/libfglrxdrm.so -b /usr/lib/xorg/modules/extensions/libglx.so
Optimize KDE
What is promised is debt. If you had already pre-linked your system you probably didn't notice any difference in KDE loading times. This is so because KDE serves as a utility called kdeinit to load all the necessary libraries. To avoid using this tool we must let KDE know that it is pre-linked. To do this we must (as root) create a variable file:
nano /etc/profile.d/kde-prelink.sh
In which we paste the following line
export KDE_IS_PRELINKED=1
And we give it the proper permissions (we don't want any naughty to add rm-rf /)
chmod 755 /etc/profile.d/kde-prelink.sh
And if you don't believe me, here is a video of KDE booting up on my system:
- HDD at 7200 RPM
- Gentoo
- XFS
- Ksplash disabled (cause of video black screen
Cron and prelink
If you use a system like Archlinux, in which updates are very frequent, it might be interesting to add a cron that runs prelink every day.
Thus, we open the cron file with nano (as root):
nano /etc/cron.daily/prelink
And we paste the following:
#! / Bin / bash [[-x / usr / bin / prelink]] && / usr / bin / prelink -amR &> / dev / null
Then we give it the appropriate permissions (I already mentioned that nobody wants someone to add malicious code):
chmod 755 /etc/cron.daily/prelink
A good habit when reading an article is to research what exactly the script does. A good habit when writing it is to explain what it is for. Here the breakdown
- The first line is used to tell the system what a bash script is and the location of the interpreter.
- The second one makes bash execute a subshell in debug mode, I don't know why, but it is recommended, it can be eliminated without risk. The && means that when the command finishes, run the following.
- Execute prelink with some parameters already explained, the &> / dev / null redirects any output to / dev / null, that is, it discards it
With the "strike" you gave to [ENTER], the little dwarfs that the pc has got scared and started working at double the speed of before, you say use PRELINK, but your system is based on terror ... hahaha!
Greetings and Excellent post
Thanks for sharing.
Umm, with the noise it makes I wouldn't be surprised if there was a mine on my XD computer.
Epic the joke, it is true that he was eager to enter, hehe.
I would like to comment that a while ago I benchmarked this, and I could see that the differences were almost nil (use as tests I think and sink the firefox and nautilus bits).
If there are interested I will publish the file (I did not publish it at the time for laziness).
Umm, not all files can be seen to improve, but at the very least the system tends to boot faster.
There was a time when I used the e4rat and it improved the startup for a few seconds, because it is a hdd it starts too fast from what I see, currently I have a small ssd with kaos and in xfs and when I saw the startup time I could not believe it.
http://i.imgur.com/ds6WqIT.png
I demand to know the desktop theme you are using and the icon set (in good vibes)
I'd swear the theme is helium.
The plasma theme and icons are called Dynamo and the Next thin window.
http://sta.sh/02ful04ags1
http://hombremaledicto.deviantart.com/art/Dynamo-Plasma-beta-473014317
http://kde-look.org/content/show.php?content=164722
Sorry to the author of the song for the off 🙂
What is that app launcher called? 🙂
I think it is one called simple qml launcher.
As roader says, it is the QML
Thanks
Very good tip, although KDE runs wonders on Arch and Slackware (I've tried them and they really look amazing).
Great thank you very much. I tried it on my Arch, I made a general prelink and I must say that the improvement is quite good and I feel very comfortable hehe
I don't know if it's me…. but I don't notice any difference and with systemd-analyze it still takes longer to start ...
Well, there must be some problem in your OS, you know, prelink -au and everything is solved.
As far as I know (from my own experience), at least in Gentoo you don't need to create a new file to pass the value of the KDE_IS_PRELINKED variable. Just uncomment the line KDE_IS_PRELINKED = 1 in /etc/env.d/43kdepaths (I'm not sure if that's the exact path, since I don't have my machine at the moment).
Every time KDE is completely compiled, you have to review that file, because some of the packages it installs will overwrite the file I mentioned.
And it probably is in many distributions. but doing it the way I have done it I guarantee that this configuration is not changed.
Excellent post, Congratulations
I suggest you create a tutorial to install Gentoo
I'll keep it in mind . Thank you
very good utility, although it does not serve me, because I have: disgusting to KDE
Will dolphin speed up? It has always seemed slow to start
It should, I don't know, I always use it by default. I use gentoo, portage, if it detects that prelink is installed, it automatically prelinks the binaries, so, no idea.
Interesting, thanks!
PD- Library = Library, not library 😉
Well, the desktop is called Plasma Desktop, not KDE. Ok, I stop xD
In computer jargon it is an accepted failure, after all, languages are pragmatic, especially in translations.
https://es.wikipedia.org/wiki/Librería_(desambiguación)
good. I was about to test it in ArchLinux KDE (base, not the complete DE) and it gives me "Error saving '/etc/cron.daily/ Error saving' /etc/cron.daily/prelink ': Prelink file or directory does not exist' : The file or directory does not exist ». I don't have "cron" installed and on the wiki [1] they talk about cronie, fcron and other variants. What do I need to install or do to complete the tutorial?
[1] https://wiki.archlinux.org/index.php/cron#Installation