Index.
02-Jan-2013: initial release.
Finish syslinux setup.
During the installation we created a very basic syslinux menu system for our home server. The system now boots only with the huge kernel. We need to add an entry for the regular generic kernel with a initrd, and make the menu look nicer and add some other possible useful menu entries. For the nicer look, a 640×480 8 bit color png file is used and placed in the /boot/syslinux directory. The syslinux.cfg file is extended with new choices and now looks like this:
# /boot/syslinux/syslinux.cfg.
#
# Comboot modules:
# * menu.c32 - provides a text menu
# * vesamenu.c32 - provides a graphical menu
# * chain.c32 - chainload MBRs, partition boot sectors, Windows bootloaders
# * hdt.c32 - hardware detection tool
# * reboot.c32 - reboots the system
# * poweroff.com - shutdown the system
#
DEFAULT slack
PROMPT 0
TIMEOUT 100
UI vesamenu.c32
# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu
MENU TITLE Slackware at homsrv.wpl.ym
MENU BACKGROUND slacksplash.png
MENU COLOR border 30;44 #40ffffff #a0000000 std
MENU COLOR title 1;36;44 #9033ccff #a0000000 std
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
MENU COLOR unsel 37;44 #50ffffff #a0000000 std
MENU COLOR help 37;40 #c0ffffff #a0000000 std
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
MENU COLOR msg07 37;40 #90ffffff #a0000000 std
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
MENU VSHIFT 12
MENU ROWS 6
MENU TIMEOUTROW 12
MENU TABMSGROW 13
MENU CMDLINEROW 13
MENU HELPMSGROW 15
LABEL slack
MENU LABEL Slackware Generic Kernel
LINUX ../vmlinuz-generic-smp-3.2.29-smp
APPEND vt.default_utf8=0 root=/dev/md1 ro
INITRD ../initrd.gz
LABEL huge
MENU LABEL Slackware Huge Kernel
LINUX ../vmlinuz
APPEND vt.default_utf8=0 root=/dev/md1 ro
LABEL single
MENU LABEL Slackware Single user mode
LINUX ../vmlinuz
APPEND vt.default_utf8=0 root=/dev/md1 ro single
LABEL emergency
MENU LABEL Slackware Emergency mode
LINUX ../vmlinuz
APPEND vt.default_utf8=0 root=/dev/md1 ro emergency
LABEL hdt
MENU LABEL Hardware Detection Tool
COM32 hdt.c32
LABEL off
MENU LABEL Power Off
COMBOOT poweroff.com
The finished boot menu looks like this:
Using a generic kernel.
To create a initrd for the generic kernel that supports raid and LVM do the following:
root@homsrv:~# mkinitrd -c -k 3.2.29-smp -m ext4 -f ext4 -r /dev/md1 -L -R OK: /lib/modules/3.2.29-smp/kernel/fs/mbcache.ko added. OK: /lib/modules/3.2.29-smp/kernel/fs/jbd2/jbd2.ko added. OK: /lib/modules/3.2.29-smp/kernel/fs/ext4/ext4.ko added. 22583 blocks /boot/initrd.gz created. Be sure to run lilo again if you use it. root@homsrv:~#
Profile extension.
To make your life as sysadmin a bit more comfortable, you can add some useful things to the global system profile. Create the file /etc/profile.d/local.sh with the following contents:
#-------------------------------------------------------------
# Automatic setting of $DISPLAY (if not set already)
# This works for linux and solaris - your mileage may vary....
#-------------------------------------------------------------
if [ -z ${DISPLAY:-""} ]; then
DISPLAY=`LANG=en_US.UTF-8 who am i --lookup | awk '{ print $5 }' | tr -d \(
| tr -d \)`
if [ -n "$DISPLAY" ] && [ "$DISPLAY" != ":0.0" ]; then
export DISPLAY=$DISPLAY:0.0
else
export DISPLAY=":0.0" # fallback
fi
fi
#-----------------------
# Greeting, motd etc...
#-----------------------
# Define some colors first:
red='\e[0;31m'
RED='\e[1;31m'
green='\e[0;32m'
GREEN='\e[1;32m'
blue='\e[0;34m'
BLUE='\e[1;34m'
cyan='\e[0;36m'
CYAN='\e[1;36m'
NC='\e[0m' # No Color
# --> Nice. Has the same effect as using "ansi.sys" in DOS.
# Looks best on a black background.....
echo -e "${CYAN}Welcome at ${RED}`hostname -f`${CYAN} - DISPLAY on ${RED}$DISPLA
Y${NC}\n"
date
if [ -x /usr/games/fortune ]; then
/usr/games/fortune -s # makes our day a bit more fun.... :-)
fi
function ii() # get current host related info
{
echo -e "\nYou are logged on ${RED}`hostname`"
echo -e "\nAdditionnal information:$NC " ; uname -a
echo -e "\n${RED}Users logged on:$NC " ; w -h
echo -e "\n${RED}Current date :$NC " ; date
echo -e "\n${RED}Machine stats :$NC " ; uptime
echo -e "\n${RED}Memory stats :$NC " ; free
echo
}
function datetime()
{
if [ -z $1 ]; then
echo ""
echo " Usage: datetime <timestamp>"
echo ""
echo "Timestamp is the integer time in seconds since the epoch"
else
echo `date -d "1970-01-01 $1 sec" +"%d-%m-%Y %T"`
fi
}
#
# Use vim
alias vi='vim'
alias du='du -ch'
alias df='df -khT'
#
# ls
alias ls='ls --color=auto --format=vertical'
alias ll='ls -l'
#
# X Terminals
alias xterm='xterm -ls -bg black -fg white -sb -sl 500 -j -fn 9x15'
alias xterm132='xterm -ls -bg black -fg white -sb -sl 500 -j -fn 9x15 -geometry
160x30'
alias xtermbbs='xterm -ls -bg black -fg white -sb -sl 500 -j -fn 9x18 -geometry
80x30'
alias ansi_xterm='ansi_xterm -ls -fn vga -rv -fg white -bg black'
alias ct='datetime'
# New prompt
if [ "$(id -un)" = "root" ]; then
PS1='\[\033[01;31m\]\u@\h:\[\033[01;34m\]\w\$ \[\033[00m\]'
else
PS1='\[\033[01;32m\]\u@\h:\[\033[01;34m\]\w\$ \[\033[00m\]'
fi
Not everything is useful on a server, but I simply copy the same file to every system I have.
Download.
