Linux From Scratch / 14. インストール 8



cat > /etc/sysconfig/clock << "EOF"
# Begin /etc/sysconfig/clock

UTC=false

# End /etc/sysconfig/clock
EOF
echo "HOSTNAME=lfs" > /etc/sysconfig/network
cat > /etc/hosts << "EOF"
# Begin /etc/hosts (network card version)

127.0.0.1 localhost
192.168.1.1 <value of HOSTNAME>.example.org <value of HOSTNAME>

# End /etc/hosts (network card version)
EOF
cat >> /etc/sysconfig/network << "EOF"
GATEWAY=192.168.1.2
GATEWAY_IF=eth0
EOF
cat > /etc/sysconfig/network-devices/ifconfig.eth0 << "EOF"
ONBOOT=yes
IP=192.168.1.1
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
EOF
cat > /etc/resolv.conf << "EOF"
# Begin /etc/resolv.conf

nameserver <IP address of your nameserver>

# End /etc/resolv.conf
EOF
cat > /etc/fstab << "EOF"
# Begin /etc/fstab

# file system  mount-point  fs-type  options         dump  fsck-order

/dev/xxx      /            fff      defaults        1     1
/dev/yyy      swap         swap     pri=1           0     0
proc          /proc        proc     defaults        0     0
devpts        /dev/pts     devpts   gid=4,mode=620  0     0
shm           /dev/shm     tmpfs    defaults        0     0

# End /etc/fstab
EOF
cd /usr/src/linux
make mrproper
make menuconfig
make dep
make bzImage
make modules
make modules_install
make mandocs
cp -a Documentation/man /usr/share/man/man9
cp arch/i386/boot/bzImage /boot/lfskernel
cp System.map /boot
cp .config /boot/config-lfskernel
grub
root (hd0,3)
setup (hd0)
quit
cat > /boot/grub/menu.lst << "EOF"
# Begin /boot/grub/menu.lst

# By default boot the first menu entry.
default 0

# Allow 30 seconds before booting the default.
timeout 30

# Use prettier colors.
color green/black light-green/black

# The first entry is for LFS.
title LFS 5.1
root (hd0,3)
kernel --no-mem-option /boot/lfskernel root=/dev/hda4
EOF
logout
chroot $LFS /tools/bin/env -i \
   HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
   PATH=/bin:/usr/bin:/sbin:/usr/sbin \
   /tools/bin/bash --login
/tools/bin/find /{,usr/,usr/local/}{bin,sbin,lib} -type f \
  -exec /tools/bin/strip --strip-debug '{}' ';'
echo 5.1-pre1 > /etc/lfs-release
umount /proc
umount /dev/pts
logout
umount $LFS
/sbin/shutdown -r now