You are not logged in.

#1 2009-03-21 21:01:31

markp1989
Member
Registered: 2008-10-05
Posts: 431

looking to shave a few more secons from my boot time.

im trying to get as fast a boot from my system as possible. are there  any tweaks i can make to the following files to get more speed.

here is my bootchart
bootchart-9.png


here is my rc.multi

#!/bin/bash
#
# /etc/rc.multi
#

. /etc/rc.conf
. /etc/rc.d/functions

# Load sysctl variables if sysctl.conf is present
[ -r /etc/sysctl.conf ] && /sbin/sysctl -q -p &>/dev/null

# Start daemons
#for daemon in "${DAEMONS[@]}"; do
#    if [ "$daemon" = "${daemon#!}" ]; then
#        if [ "$daemon" = "${daemon#@}" ]; then
#            start_daemon $daemon
#        else
#            start_daemon_bkgd ${daemon:1}
#        fi
#    fi
#done

dhcpcd eth0 &>/dev/null 2>&1
alsactl restore &
echo 2 > /sys/module/hid_apple/parameters/fnmode &
(sleep 20 && /etc/rc.d/sensors start &>/dev/null 2>&1) & 
(sleep 20 && /etc/rc.d/mpd start) & 
(sleep 120 && /etc/rc.d/portmap start &>/dev/null 2>&1) & 
(sleep 120 && /etc/rc.d/nfslock start &>/dev/null 2>&1) & 
(sleep 200 && mount 192.168.1.99:/media/torrents /media/downloads/ ) & 
#if [ -x /etc/rc.local ]; then
#    /etc/rc.local
#fi

# vim: set ts=2 noet:

and here is my rc.sysinit

 #!/bin/bash
#
# /etc/rc.sysinit
#
. /etc/rc.conf
. /etc/rc.d/functions
#source_functions
# mount /proc, /sys and our RAM /dev
/bin/mount -n -t ramfs none /dev 
/bin/mount -n -t proc none /proc
/bin/mount -n -t sysfs none /sys
# Create our default nodes that minilogd may need
/bin/mknod /dev/null c 1 3
/bin/mknod /dev/zero c 1 5
/bin/mknod /dev/console c 5 1
# More initial /dev setup that udev doesn't do
#/bin/ln -snf /proc/self/fd /dev/fd
#/bin/ln -snf /proc/self/fd/0 /dev/stdin
#/bin/ln -snf /proc/self/fd/1 /dev/stdout
#/bin/ln -snf /proc/self/fd/2 /dev/stderr
/bin/ln -snf /proc/kcore /dev/core
/bin/mkdir /dev/pts
/bin/mkdir /dev/shm

echo > /proc/sys/kernel/hotplug
# Starting udev daemon
if [ -x /sbin/udevadm -a -d /sys/block ]; then
    # We have udev and /sys appears to be mounted, use UDev
    #status "Starting UDev Daemon" /etc/start_udev init
    stat_busy "Starting UDev Daemon"
    /sbin/udevd --daemon
    stat_done
else
    # Static /dev, our last resort
    status "Using static /dev filesystem" true
fi
# run udev uevents
if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
    #status "Loading UDev uevents" /etc/start_udev uevents
    stat_busy "Loading UDev uevents"
    udevstart="$(/bin/date +%s%0N)"
    /sbin/udevadm trigger
    /sbin/udevadm settle
    stat_done
    udevend="$(/bin/date +%s%0N)"
    printhl "   UDev uevent processing time: $((($udevend-$udevstart)/1000000))ms"
fi

##loading modules
stat_busy "Loading Modules"
/sbin/modprobe ohci_hcd >/dev/null 2>&1
/sbin/modprobe ehci-hcd >/dev/null 2>&1
/sbin/modprobe nvidia >/dev/null 2>&1 
/sbin/modprobe psmouse >/dev/null 2>&1
/sbin/modprobe r8169 >/dev/null 2>&1
/sbin/modprobe slhc >/dev/null 2>&1
#/sbin/modprobe  pcspkr >/dev/null 2>&1
#/sbin/modprobe  snd_pcsp >/dev/null 2>&1
stat_done

##loading acpi modules
stat_busy "Loading standard ACPI modules"
/sbin/modprobe thermal >/dev/null 2>&1
/sbin/modprobe processor >/dev/null 2>&1
/sbin/modprobe button  >/dev/null 2>&1
/sbin/modprobe battery >/dev/null 2>&1
/sbin/modprobe ac >/dev/null 2>&1
stat_done


# bring up the loopback interface
if [ -d /sys/class/net/lo ]; then
    stat_busy "Bringing up loopback interface"
    /sbin/ifconfig lo 127.0.0.1 up
    if [ $? -ne 0 ]; then
        stat_fail
    else
        stat_done
    fi
fi

FORCEFSCK=
[ -f /forcefsck ] && FORCEFSCK="-- -f"
NETFS="nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,noshfs,nofuse,nofuseblk"

if [ -x /sbin/fsck ]; then
    stat_busy "Checking Filesystems"
    if /bin/grep -qw quiet /proc/cmdline; then
        /sbin/fsck -A -T -C -a -t $NETFS $FORCEFSCK >/dev/null 2>&1
    else
        /sbin/fsck -A -T -C -a -t $NETFS $FORCEFSCK 2>/dev/null
    fi
    fsckret=$?
    if [ ${fsckret} -gt 1 ]; then
        stat_fail
        if [ $((${fsckret}&2)) -eq 2 ]; then
            echo
            echo "********************** REBOOT REQUIRED *********************"
            echo "*                                                          *"
            echo "* The system will be rebooted automatically in 5 seconds. *"
            echo "*                                                          *"
            echo "************************************************************"
            echo
            /bin/sleep 5
        else
            echo
            echo "*****************  FILESYSTEM CHECK FAILED  ****************"
            echo "*                                                          *"
            echo "*  Please repair manually and reboot. Note that the root   *"
            echo "*  file system is currently mounted read-only. To remount  *"
            echo "*  it read-write type: mount -n -o remount,rw /            *"
            echo "*  When you exit the maintenance shell the system will     *"
            echo "*  reboot automatically.                                   *"
            echo "*                                                          *"
            echo "************************************************************"
            echo
            /sbin/sulogin -p
        fi
        echo "Automatic reboot in progress..."
        /bin/umount -a
        /bin/mount -n -o remount,ro /
        /sbin/reboot -f
        exit 0
    fi
    stat_done
fi

stat_busy "Mounting Local Filesystems"
/bin/mount -n -o remount,rw /
/bin/rm -f /etc/mtab*
# make sure / gets written to /etc/mtab
/bin/mount -o remount,rw /
# Write /proc, /sys and /dev to /etc/mtab
if [ -e /proc/mounts ]; then
    /bin/grep -e "/proc " -e "/sys " -e "/dev " /proc/mounts >> /etc/mtab
fi
# now mount all the local filesystems
/bin/mount -a -t $NETFS
stat_done

if [ -f /var/run/random-seed ]; then
    stat_busy "Initializing Random Seed"
    /bin/cat /var/run/random-seed >/dev/urandom
    stat_done
fi

stat_busy "Removing Leftover Files"
/bin/rm -f /etc/nologin &>/dev/null
/bin/rm -f /etc/shutdownpid &>/dev/null
/bin/rm -f /var/lock/* &>/dev/null
/bin/rm -rf /tmp/* /tmp/.* &>/dev/null
/bin/rm -f /forcefsck &>/dev/null
(cd /var/run && /usr/bin/find . ! -type d -exec /bin/rm -f -- {} \; )
: > /var/run/utmp
stat_done


if [ "$HOSTNAME" != "" ]; then
    status "Setting Hostname: $HOSTNAME" /bin/hostname $HOSTNAME
fi


status "Updating Module Dependencies" /sbin/depmod -A

# Save our dmesg output from this boot
if [ -f /var/log/dmesg.log ]; then
    /bin/rm /var/log/dmesg.log
fi
/bin/dmesg > /var/log/dmesg.log

# End of file
# vim: set ts=2 noet:

and here is my inittab

#
# /etc/inittab
#

#  Runlevels:
#    0    Halt
#    1(S)    Single-user
#    2    Not used
#    3    Multi-user
#    4    Not used
#    5    X11
#    6    Reboot

## Only one of the following two lines can be uncommented!
# Boot to console
id:3:initdefault:
# Boot to X11
#id:5:initdefault:

rc::sysinit:/etc/rc.sysinit
rs:S1:once:/etc/rc.single
rm:2345:once:/etc/rc.multi
rh:06:once:/etc/rc.shutdown
su:S:once:/sbin/sulogin -p

# -8 options fixes umlauts problem on login
#c1:2345:respawn:/sbin/agetty -8 38400 vc/1 linux
c1:2345:respawn:/bin/login -f mark vc/1 </dev/vc/1 >/dev/vc/1 2>&1
c2:2345:respawn:/sbin/agetty -8 38400 vc/2 linux
c3:2345:respawn:/sbin/agetty -8 38400 vc/3 linux
#c4:2345:respawn:/sbin/agetty -8 38400 vc/4 linux
#c5:2345:respawn:/sbin/agetty -8 38400 vc/5 linux
#c6:2345:respawn:/sbin/agetty -8 38400 vc/6 linux

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# Example lines for starting a login manager
x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >& /dev/null

# End of file

Last edited by markp1989 (2009-03-21 21:02:07)


Desktop: E8400@4ghz - DFI Lanparty JR P45-T2RS - 4gb ddr2 800 - 30gb OCZ Vertex - Geforce 8800 GTS - 2*19" LCD
Server/Media Zotac GeForce 9300-ITX I-E - E5200 - 4gb Ram - 2* ecogreen F2 1.5tb - 1* wd green 500gb - PicoPSU 150xt - rtorrent - xbmc - ipazzport remote - 42" LCD

Offline

#2 2009-03-22 00:56:08

my0pic
Member
From: Melbourne, Australia
Registered: 2008-05-23
Posts: 206

Re: looking to shave a few more secons from my boot time.

have a look at this wiki page http://wiki.archlinux.org/index.php/Twe … _boot_time
and Duologics forum post that led to the page's creation http://bbs.archlinux.org/viewtopic.php?id=62518.

Offline

Board footer

Powered by FluxBB