1. LFS‎ > ‎

7. Bootscripts

created : 2010-01-31   updated : 2010-01-31
 
LFS-Bootscripts-20090812
The LFS-Bootscripts package contains a set of scripts to start/stop the LFS system at bootup/shutdown.

Approximate build time: less than 0.1 SBU
Required disk space: 468 KB

Unpack source :
 
cd /sources
tar -jxvf lfs-bootscripts-20090812.tar.bz2
cd lfs-bootscripts-20090812
 
Install :
make install
 
Configuring the setclock Script
Create a new file /etc/sysconfig/clock by running the following:
cat > /etc/sysconfig/clock << "EOF"
# Begin /etc/sysconfig/clock
UTC=1
# Set this to any options you might need to give to hwclock,
# such as machine hardware clock type for Alphas.
CLOCKPARAMS=
# End /etc/sysconfig/clock
EOF
 
 
/etc/inputrc
cat > /etc/inputrc << "EOF"
# Begin /etc/inputrc
# Modified by Chris Lynn <roryo@roryo.dynup.net>
# Allow the command prompt to wrap to the next line
set horizontal-scroll-mode Off
# Enable 8bit input
set meta-flag On
set input-meta On
# Turns off 8th bit stripping
set convert-meta Off
# Keep the 8th bit for display
set output-meta On
# none, visible or audible
set bell-style none
# All of the following map the escape sequence of the value
# contained in the 1st argument to the readline specific functions
"\eOd": backward-word
"\eOc": forward-word
# for linux console
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert
# for xterm
"\eOH": beginning-of-line
"\eOF": end-of-line
# for Konsole
"\e[H": beginning-of-line
"\e[F": end-of-line
# End /etc/inputrc
EOF
 
 
Bash startup script : /etc/profile  and ~/.bash_profile
cat > /etc/profile << "EOF"
# Begin /etc/profile
#export LANG=<ll>_<CC>.<charmap><@modifiers>
export LANG=en_US.utf8
# End /etc/profile
EOF
 
/etc/sysconfig/network
echo "HOSTNAME=ivan-lfs" > /etc/sysconfig/network
 
/etc/hosts
cat > /etc/hosts << "EOF"
# Begin /etc/hosts (network card version)
127.0.0.1 localhost
#192.168.1.1 HOSTNAME.example.org [alias1] [alias2 ...]
# End /etc/hosts (network card version)
EOF
 
 
Create stable name for network interfaces (eth0, eth1...)
for NIC in /sys/class/net/* ; do
INTERFACE=${NIC##*/} udevadm test --action=add $NIC
done
 
Configure IP address
cd /etc/sysconfig/network-devices
mkdir -v ifconfig.eth0
cat > ifconfig.eth0/ipv4 << "EOF"
ONBOOT=yes
SERVICE=ipv4-static
IP=192.168.1.101
GATEWAY=192.168.1.1
PREFIX=24
BROADCAST=192.168.1.255
EOF
 
/etc/resolv.conf
sample :
cat > /etc/resolv.conf << "EOF"
# Begin /etc/resolv.conf
domain <Your Domain Name>
nameserver <IP address of your primary nameserver>
nameserver <IP address of your secondary nameserver>
# End /etc/resolv.conf
EOF
 
What I did : just copy from host
mkdir /tmp/host
mount /dev/sda1 /tmp/host
cp /tmp/host/etc/resolv.conf /etc/resolv.conf
 
 
End
Comments