Into chapter 10, updating notes.

This commit is contained in:
Shaun Setlock
2025-01-20 21:55:13 -05:00
parent d1a14a34c6
commit 7cb9acf7fe
4 changed files with 314 additions and 3 deletions

View File

@@ -0,0 +1,210 @@
# Chapter 9 - System Configuration
## Sections 9.1 - System V Init
This section describes the system init that LFS, the tasks it makes to complete the boot process, and various run levels.
## Section 9.2 - LFS Init Scripts
LFS comes with some pre-configured scripts that work with this init process at boot time.
> Installed scripts:
> checkfs, cleanfs, console, functions, halt, ifdown, ifup, localnet, modules, mountfs, mountvirtfs, network, rc, reboot, sendsignals, setclock, ipv4-static, swap, sysctl, sysklogd, template, udev, and udev_retry
> Installed directories:
> /etc/rc.d, /etc/init.d (symbolic link), /etc/sysconfig, /lib/services, /lib/lsb (symbolic link)
This has its own sources, and is installed with `make`.
```
make install
```
## Section 9.3 - Device and Kernel Modules
Just light reading ...
## Section 9.4 - Setting Up for Devices
Create rules for naming network devices.
```
bash /usr/lib/udev/init-net-rules.sh
```
## Section 9.5 - General Network Configuration
We need to setup the anticipated network interface.
```
cd /etc/sysconfig/
cat > ifconfig.eth0 << "EOF"
ONBOOT=yes
IFACE=eth0
SERVICE=ipv4-static
IP=192.168.2.250
GATEWAY=192.168.2.1
PREFIX=24
BROADCAST=192.168.2.255
EOF
```
Create our `resolve.conf` file,
```
cat > /etc/resolv.conf << "EOF"
# Begin /etc/resolv.conf
domain home.lan
nameserver 192.168.2.22
nameserver 192.168.2.1
# End /etc/resolv.conf
EOF
```
our hostname,
```
echo lfs > /etc/hostname
```
and also our `hosts` file,
```
cat > /etc/hosts << "EOF"
# Begin /etc/hosts
127.0.0.1 localhost.localdomain localhost
127.0.1.1 lfs.home.lan lfs
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
# End /etc/hosts
EOF
```
## Section 9.6 - Bootscript Usage and Configuration
We need to configure SysVinit
```
cat > /etc/inittab << "EOF"
# Begin /etc/inittab
id:3:initdefault:
si::sysinit:/etc/rc.d/init.d/rc S
l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
su:S06:once:/sbin/sulogin
s1:1:respawn:/sbin/sulogin
1:2345:respawn:/sbin/agetty --noclear tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600
# End /etc/inittab
EOF
```
setting the system clock,
```
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
```
and configuring the console.
```
cat > /etc/sysconfig/console << "EOF"
# Begin /etc/sysconfig/console
UNICODE="1"
FONT="Lat2-Terminus16"
# End /etc/sysconfig/console
EOF
```
## Section 9.7 - Configuring Locale
This locale stuff seems really annoying .. but it's necessary. These commands use glibc to determine locale information.
```
LC_ALL=en_US locale language
LC_ALL=en_US locale charmap
LC_ALL=en_US locale int_curr_symbol
LC_ALL=en_US locale int_prefix
```
Which can be used in our bash profile,
```
cat > /etc/profile << "EOF"
# Begin /etc/profile
for i in $(locale); do
unset ${i%=*}
done
if [[ "$TERM" = linux ]]; then
export LANG=C.UTF-8
else
export LANG=en_US.ISO-8859-1
fi
# End /etc/profile
EOF
```
## Section 9.8 - Readline's `etc/inputrc/ File
This file is needed to support shells, such as `bash`, interpret keyboard input.
```
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 8-bit 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
```
## Seciton 9.9 - Set Options for Shells
This shells available on the system must be identified.
```
cat > /etc/shells << "EOF"
# Begin /etc/shells
/bin/sh
/bin/bash
# End /etc/shells
EOF
```