from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites: www.linuxhowtos.org
toolsntoys.linuxhowtos.org



Last additions:
How to make X listen on port 6000

How to make X listen on port 6000

words:

34

views:

85340

userrating:

average rating: 1.2 (52 votes) (1=very good 6=terrible)


May, 25th 2007:
April, 26th 2007:
Apr, 10th. 2007:
Druckversion . pdf icon
You are here: Misc

Speeding up the boot process (next generation)

The idea is to preload the useful files into kernel buffer cache before they are needed. Since I/O can happen parallel to the other CPU intensive tasks during bootup, this leads to faster bootup and faster startup time for your chosen applications. Other projects use static lists to preload the files.

This tutorial uses an automated process of generating the "useful" prefetch database.

This is /etc/init.d/my-readahead.
Code:

#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {
        before syslog-ng
}

start() {
        ebegin "Starting readahead ROYALE"
        cat /etc/conf.d/* > /dev/null 2>&1 &
        cat /usr/lib/gconv/gconv-modules.cache > /dev/null 2>&1 &
        cat /usr/share/icons/gnome/icon-theme.cache > /dev/null 2>&1 &
        cat /usr/share/icons/hicolor/icon-theme.cache > /dev/null 2>&1 &
        cat `cat /etc/conf.d/sofile-list.load` > /dev/null 2>&1 &
        if [ -f /forcesampler ];then
                /usr/sbin/sample-init-process /etc/conf.d/sofile-list.load &
                rm -f /forcesampler
        fi 
        eend 0
}

stop() {
        eend 0
}

The executable shell script /usr/sbin/sample-init-process:
Code:

 #!/bin/bash
final_db="$1"

# total number of lists to keep in /etc/conf.d/
total_to_keep=4

# total number of samples to make in /forcesampler boot.
# It will take twice this amount of seconds to finish sampling.
total_samples_per_boot=200

# touch empty file if not there
[ ! -f "$final_db" ] && touch "$final_db"

let i=0
while [ "$i" -ne "$total_to_keep" ] ; do
        if [ ! -f "$final_db$i" ] ; then
                break;
        else
                j=$((i+1))
                if [ "$j" = "$total_to_keep" ] ;then
                        j=0
                fi
                if [ -f "$final_db$j" -a "$final_db$i" -nt "$final_db$j" ];then
                        i=$((j))
                        break;
                fi
        fi
        i=$((i+1))
done
if [ "$i" = "$total_to_keep" ] ;then
        i=0
fi

slot="$i"
cp "$final_db" "$final_db$i"

function collect_sample()
{
        lsof | awk '{if ($5=="REG") {if (match($9,".so") || match($9,".conf") \
        || match($9,"/bin/") || match($9,"ttf") || match($9,"libexec")) \
        print $9}}' | sort | uniq >> $1
}

collect_sample /tmp/init_sample1

i=0 
while [ "$i" -ne "$total_samples_per_boot" ] ; do
        collect_sample /tmp/init_sample2
        cat /tmp/init_sample1 /tmp/init_sample2 | sort | uniq > /tmp/init_sample3
        mv /tmp/init_sample3 /tmp/init_sample1
        sleep 1
        i=$((i+1))
done

cat /tmp/init_sample1 "$final_db$slot" | sort | uniq > "$final_db"

rm -f /tmp/init_sample[123]
And then do this:
Code:
chmod +x /usr/sbin/sample-init-process
rc-update add my-readahead default
touch /forcesampler

What you have done is asked my-readahead to create a sampler process which samples what files (fonts, binaries, libraries, configs) are in use, every second. It collects 200 samples (will be busy for at least 10 minutes after boot) and keeps updating the database with a list of useful files.

Once you boot after this the first time, you will probably see a slow down because its collecting samples for use on the next and subsequent boots. Use your system as you normally would. Open firefox, gaim, OO or whatever. Once the sampler script has finished ('ps -aef|grep sample-init-process' will tell you if its running), reboot. Now this and all subsequent boots will be much faster.

If it takes too long for the sample-init-process to finish, reduce the total_samples_per_boot variable in the sampler script to 100 and try again by touching /forcesampler.

In future, whenever you feel like updating the prefetch database, just 'touch /forcesampler' and database will be updated on next reboot.

based on http://forums.gentoo.org/viewtopic-t-478491.html, some script modifications done.

back



Support us on Content Nation

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2026-05-24
akonadi-config - 1
Ebuild name:

kde-apps/akonadi-config-1

Description

Default Akonadi storage backend configuration

Added to portage

2026-05-24

bazelisk - 1.29.0
Ebuild name:

dev-build/bazelisk-1.29.0

Description

A user-friendly launcher for Bazel written in Go

Added to portage

2026-05-24

closure-compiler-bin - 20260520
Ebuild name:

dev-lang/closure-compiler-bin-20260520

Description

JavaScript optimizing compiler

Added to portage

2026-05-24

duration - 0.3.1
Ebuild name:

dev-ml/duration-0.3.1

Description

Duration - conversions to various time units

Added to portage

2026-05-24

gentoo-kernel - 5.10.257
Ebuild name:

sys-kernel/gentoo-kernel-5.10.257

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel - 5.15.208
Ebuild name:

sys-kernel/gentoo-kernel-5.15.208

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel - 6.1.174
Ebuild name:

sys-kernel/gentoo-kernel-6.1.174

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel - 6.12.91
Ebuild name:

sys-kernel/gentoo-kernel-6.12.91

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel - 6.18.33
Ebuild name:

sys-kernel/gentoo-kernel-6.18.33

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel - 6.6.141
Ebuild name:

sys-kernel/gentoo-kernel-6.6.141

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel - 7.0.10
Ebuild name:

sys-kernel/gentoo-kernel-7.0.10

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 5.10.257
Ebuild name:

sys-kernel/gentoo-kernel-bin-5.10.257

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 5.15.208
Ebuild name:

sys-kernel/gentoo-kernel-bin-5.15.208

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 6.1.174
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.1.174

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 6.12.91
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.91

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 6.18.33
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.33

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 6.6.141
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.6.141

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 7.0.10
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.0.10

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-sources - 5.10.257
Ebuild name:

sys-kernel/gentoo-sources-5.10.257

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gentoo-sources - 5.15.208
Ebuild name:

sys-kernel/gentoo-sources-5.15.208

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gentoo-sources - 6.1.174
Ebuild name:

sys-kernel/gentoo-sources-6.1.174

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gentoo-sources - 6.12.91
Ebuild name:

sys-kernel/gentoo-sources-6.12.91

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gentoo-sources - 6.18.33
Ebuild name:

sys-kernel/gentoo-sources-6.18.33

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gentoo-sources - 6.6.141
Ebuild name:

sys-kernel/gentoo-sources-6.6.141

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gentoo-sources - 7.0.10
Ebuild name:

sys-kernel/gentoo-sources-7.0.10

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gns3-gui - 2.2.59
Ebuild name:

net-misc/gns3-gui-2.2.59

Description

Graphical Network Simulator

Added to portage

2026-05-24

gns3-server - 2.2.59
Ebuild name:

net-misc/gns3-server-2.2.59

Description

GNS3 server to asynchronously manage emulators

Added to portage

2026-05-24

lambda-term - 3.4.0
Ebuild name:

dev-ml/lambda-term-3.4.0

Description

Terminal manipulation library for OCaml

Added to portage

2026-05-24

modus-themes - 9999
Ebuild name:

app-emacs/modus-themes-9999

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-05-24

mpg123-el - 1.65
Ebuild name:

app-emacs/mpg123-el-1.65

Description

Emacs front-end to mpg123 audio player and OggVorbis audio player

Added to portage

2026-05-24

mu-cite - 8.1_p202011031127
Ebuild name:

app-emacs/mu-cite-8.1_p202011031127

Description

Message citation utilities for emacsen

Added to portage

2026-05-24

nim - 2.2.10
Ebuild name:

dev-lang/nim-2.2.10

Description

Compiled, garbage-collected systems programming language

Added to portage

2026-05-24

nvc - 1.21.0
Ebuild name:

sci-electronics/nvc-1.21.0

Description

NVC is a VHDL compiler and simulator

Added to portage

2026-05-24

openrazer - 3.12.3
Ebuild name:

sys-apps/openrazer-3.12.3

Description

Drivers and user-space daemon to control Razer devices on GNU/Linux

Added to portage

2026-05-24

pwsh - 7.6.2
Ebuild name:

app-shells/pwsh-7.6.2

Description

Cross-platform automation and configuration tool

Added to portage

2026-05-24

pwsh-bin - 7.6.2
Ebuild name:

app-shells/pwsh-bin-7.6.2

Description

Cross-platform automation and configuration tool (binary package)

Added to portage

2026-05-24

rclone - 1.74.2
Ebuild name:

net-misc/rclone-1.74.2

Description

A program to sync files to and from various cloud storage providers

Added to portage

2026-05-24

sdbus-c++ - 2.3.1
Ebuild name:

dev-cpp/sdbus-c++-2.3.1

Description

High-level C++ D-Bus library

Added to portage

2026-05-24

selinux-needrestart - 2.20250618_p1
Ebuild name:

sec-policy/selinux-needrestart-2.20250618_p1

Description

SELinux policy for needrestart

Added to portage

2026-05-24

selinux-needrestart - 2.20260312_p1
Ebuild name:

sec-policy/selinux-needrestart-2.20260312_p1

Description

SELinux policy for needrestart

Added to portage

2026-05-24

selinux-needrestart - 9999
Ebuild name:

sec-policy/selinux-needrestart-9999

Description

SELinux policy for needrestart

Added to portage

2026-05-24

selinux-tpm2 - 2.20250618_p1
Ebuild name:

sec-policy/selinux-tpm2-2.20250618_p1

Description

SELinux policy for tpm2

Added to portage

2026-05-24

selinux-tpm2 - 2.20260312_p1
Ebuild name:

sec-policy/selinux-tpm2-2.20260312_p1

Description

SELinux policy for tpm2

Added to portage

2026-05-24

selinux-tpm2 - 9999
Ebuild name:

sec-policy/selinux-tpm2-9999

Description

SELinux policy for tpm2

Added to portage

2026-05-24

tea - 0.14.1
Ebuild name:

dev-util/tea-0.14.1

Description

Command line tool to interact with Gitea server

Added to portage

2026-05-24

utop - 2.17.0
Ebuild name:

dev-ml/utop-2.17.0

Description

Universal toplevel for OCaml

Added to portage

2026-05-24

vanilla-kernel - 5.10.257
Ebuild name:

sys-kernel/vanilla-kernel-5.10.257

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-05-24

vanilla-kernel - 5.15.208
Ebuild name:

sys-kernel/vanilla-kernel-5.15.208

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-05-24

vanilla-kernel - 6.1.174
Ebuild name:

sys-kernel/vanilla-kernel-6.1.174

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-05-24

xwaylandvideobridge - 0.5.0
Ebuild name:

gui-apps/xwaylandvideobridge-0.5.0

Description

Screenshare Wayland windows to XWayland apps

Added to portage

2026-05-24

2026-05-23
awscli - 1.45.14
Ebuild name:

app-admin/awscli-1.45.14

Description

Universal Command Line Environment for AWS

Added to portage

2026-05-23

blessed - 1.42.0
Ebuild name:

dev-python/blessed-1.42.0

Description

Library for making terminal apps using colors, keyboard input and positio

Added to portage

2026-05-23

boto3 - 1.43.14
Ebuild name:

dev-python/boto3-1.43.14

Description

The AWS SDK for Python

Added to portage

2026-05-23

botocore - 1.43.14
Ebuild name:

dev-python/botocore-1.43.14

Description

Low-level, data-driven core of boto 3

Added to portage

2026-05-23

c2ffi - 21.1.0.20260104
Ebuild name:

dev-lisp/c2ffi-21.1.0.20260104

Description

Clang-based FFI wrapper generator for Common Lisp

Added to portage

2026-05-23

click - 8.4.1
Ebuild name:

dev-python/click-8.4.1

Description

A Python package for creating beautiful command line interfaces

Added to portage

2026-05-23

crossdev - 20260501-r1
Ebuild name:

sys-devel/crossdev-20260501-r1

Description

Gentoo Cross-toolchain generator

Added to portage

2026-05-23

cucumber-expressions - 19.0.1
Ebuild name:

dev-python/cucumber-expressions-19.0.1

Description

Human friendly alternative to Regular Expressions

Added to portage

2026-05-23

deno-bin - 2.8.0
Ebuild name:

dev-lang/deno-bin-2.8.0

Description

Modern runtime for JavaScript and TypeScript

Added to portage

2026-05-23

faker - 40.19.1
Ebuild name:

dev-python/faker-40.19.1

Description

A Python package that generates fake data for you

Added to portage

2026-05-23

gentoo-sources - 7.0.9-r5
Ebuild name:

sys-kernel/gentoo-sources-7.0.9-r5

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-23

gnome-settings-daemon - 49.1-r1
Ebuild name:

gnome-base/gnome-settings-daemon-49.1-r1

Description

Gnome Settings Daemon

Added to portage

2026-05-23

gr-rds - 0.0_p20250404-r1
Ebuild name:

net-wireless/gr-rds-0.0_p20250404-r1

Description

GNU Radio FM RDS Receiver

Added to portage

2026-05-23

graph-tool - 2.98
Ebuild name:

dev-python/graph-tool-2.98

Description

An efficient python module for manipulation and statistical analysis of

Added to portage

2026-05-23

griddataformats - 1.2.0
Ebuild name:

dev-python/griddataformats-1.2.0

Description

Reading and writing of data on regular grids in Python

Added to portage

2026-05-23

icalendar - 7.1.2
Ebuild name:

dev-python/icalendar-7.1.2

Description

RFC 5545 compatible parser and generator of iCalendar files

Added to portage

2026-05-23

jellyfin-bin - 10.11.9
Ebuild name:

www-apps/jellyfin-bin-10.11.9

Description

Jellyfin puts you in control of managing and streaming your media

Added to portage

2026-05-23

jinxed - 2.0.1
Ebuild name:

dev-python/jinxed-2.0.1

Description

A pure-Python implementation of a subset of the Python curses library

Added to portage

2026-05-23

jwt-cpp - 0.7.2-r1
Ebuild name:

dev-cpp/jwt-cpp-0.7.2-r1

Description

header only library for creating and validating JSON Web Tokens in C++11

Added to portage

2026-05-23

libgit2 - 1.9.4
Ebuild name:

dev-libs/libgit2-1.9.4

Description

A linkable library for Git

Added to portage

2026-05-23

liblms7002m - 0.0_p20200518-r3
Ebuild name:

net-wireless/liblms7002m-0.0_p20200518-r3

Description

Compact LMS7002M library suitable for resource-limited MC

Added to portage

2026-05-23

lmod - 9.2.2
Ebuild name:

sys-cluster/lmod-9.2.2

Description

Environment Module System based on Lua

Added to portage

2026-05-23

more-itertools - 11.1.0
Ebuild name:

dev-python/more-itertools-11.1.0

Description

More routines for operating on iterables, beyond itertools

Added to portage

2026-05-23

multi-term - 1.4-r1
Ebuild name:

app-emacs/multi-term-1.4-r1

Description

Manage multiple terminal buffers in Emacs

Added to portage

2026-05-23

nginx - 1.30.2
Ebuild name:

www-servers/nginx-1.30.2

Description

Added to portage

2026-05-23

nvidia-drivers - 595.44.09
Ebuild name:

x11-drivers/nvidia-drivers-595.44.09

Description

NVIDIA Accelerated Graphics Driver

Added to portage

2026-05-23

pika - 1.4.1
Ebuild name:

dev-python/pika-1.4.1

Description

Pure-Python implementation of the AMQP

Added to portage

2026-05-23

portage - 3.0.79
Ebuild name:

sys-apps/portage-3.0.79

Description

The package management and distribution system for Gentoo

Added to portage

2026-05-23

pypdf - 6.12.1
Ebuild name:

dev-python/pypdf-6.12.1

Description

Python library to work with PDF files

Added to portage

2026-05-23

pytest-rerunfailures - 16.3
Ebuild name:

dev-python/pytest-rerunfailures-16.3

Description

pytest plugin to re-run tests to eliminate flaky failures

Added to portage

2026-05-23

qtdeclarative - 6.11.1-r1
Ebuild name:

dev-qt/qtdeclarative-6.11.1-r1

Description

Qt Declarative (Quick 2)

Added to portage

2026-05-23

qtile - 0.36.0
Ebuild name:

x11-wm/qtile-0.36.0

Description

A full-featured, hackable tiling window manager written in Python

Added to portage

2026-05-23

raspberrypi-firmware - 1.20260521
Ebuild name:

sys-boot/raspberrypi-firmware-1.20260521

Description

Raspberry Pi (all versions) bootloader and GPU firmware

Added to portage

2026-05-23

raspberrypi-image - 6.18.32_p20260521
Ebuild name:

sys-kernel/raspberrypi-image-6.18.32_p20260521

Description

Raspberry Pi (all versions) kernel and modules

Added to portage

2026-05-23

raspberrypi-sources - 6.18.32_p20260521
Ebuild name:

sys-kernel/raspberrypi-sources-6.18.32_p20260521

Description

Raspberry Pi kernel sources

Added to portage

2026-05-23

snapd-glib - 1.72
Ebuild name:

sys-libs/snapd-glib-1.72

Description

glib library for communicating with snapd

Added to portage

2026-05-23

sunshine - 2026.516.143833
Ebuild name:

net-misc/sunshine-2026.516.143833

Description

Self-hosted game stream host for Moonlight

Added to portage

2026-05-23

superlu_mt - 4.0.2
Ebuild name:

sci-libs/superlu_mt-4.0.2

Description

Multithreaded sparse LU factorization library

Added to portage

2026-05-23

trove-classifiers - 2026.5.22.10
Ebuild name:

dev-python/trove-classifiers-2026.5.22.10

Description

Canonical source for classifiers on PyPI (pypi.org)

Added to portage

2026-05-23

virt-firmware - 26.5.4
Ebuild name:

app-emulation/virt-firmware-26.5.4

Description

Tools for ovmf/armvirt firmware volumes

Added to portage

2026-05-23

vpl-gpu-rt - 26.2.0
Ebuild name:

media-libs/vpl-gpu-rt-26.2.0

Description

Intel Video Processing Library GPU Runtime

Added to portage

2026-05-23

wrapt - 2.2.1
Ebuild name:

dev-python/wrapt-2.2.1

Description

Module for decorators, wrappers and monkey patching

Added to portage

2026-05-23

yle-dl - 20260520
Ebuild name:

media-video/yle-dl-20260520

Description

Download media files from Yle Areena

Added to portage

2026-05-23

zotero-bin - 9.0.4
Ebuild name:

app-text/zotero-bin-9.0.4

Description

Helps you collect, organize, cite, and share your research sources

Added to portage

2026-05-23

rdf newsfeed | rss newsfeed | Atom newsfeed
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
- Copyright and legal notices -
Time to create this page: 54.8 ms