aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-04-13 13:18:39 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-04-13 13:18:39 -0500
commit455f626a494bbdc20d30c0a4c91876b46303b6aa (patch)
treec7a2100f092e8a6aee720f57857dc78ff3103a6e
parent137dd3cbadb9dad004cc1610dcea136b347d0015 (diff)
parent12cd3ceafb35ec95a834f3a2a1ec0a7f701e5699 (diff)
Merge branch 'chapter9'
-rw-r--r--chapter9/bashprofile.sh9
-rw-r--r--chapter9/bootscriptconf.sh51
-rw-r--r--chapter9/inputrc.sh45
-rw-r--r--chapter9/lfs-bootscripts.sh3
-rw-r--r--chapter9/network.sh38
-rw-r--r--chapter9/shells.sh10
-rw-r--r--insidechroot.sh25
-rwxr-xr-xlfs.sh3
8 files changed, 183 insertions, 1 deletions
diff --git a/chapter9/bashprofile.sh b/chapter9/bashprofile.sh
new file mode 100644
index 0000000..9636b3a
--- /dev/null
+++ b/chapter9/bashprofile.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+cat > /etc/profile << "EOF"
+# Begin /etc/profile
+
+export LANG=en_US
+
+# End /etc/profile
+EOF
diff --git a/chapter9/bootscriptconf.sh b/chapter9/bootscriptconf.sh
new file mode 100644
index 0000000..3c00024
--- /dev/null
+++ b/chapter9/bootscriptconf.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+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:S016:once:/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
+
+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
+
+#cat > /etc/sysconfig/console << "EOF"
+# Begin /etc/sysconfig/console
+
+#KEYMAP="pl2"
+#FONT="lat2a-16 -m 8859-2"
+
+# End /etc/sysconfig/console
+#EOF
diff --git a/chapter9/inputrc.sh b/chapter9/inputrc.sh
new file mode 100644
index 0000000..bab2a35
--- /dev/null
+++ b/chapter9/inputrc.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+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
diff --git a/chapter9/lfs-bootscripts.sh b/chapter9/lfs-bootscripts.sh
new file mode 100644
index 0000000..db9dad4
--- /dev/null
+++ b/chapter9/lfs-bootscripts.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+make -j1 install
diff --git a/chapter9/network.sh b/chapter9/network.sh
new file mode 100644
index 0000000..e1386a4
--- /dev/null
+++ b/chapter9/network.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+pushd /etc/sysconfig/ >/dev/null || exit 1
+cat > ifconfig.eth0 << "EOF"
+ONBOOT=yes
+IFACE=eth0
+SERVICE=ipv4-static
+IP=192.168.1.196
+GATEWAY=192.168.1.1
+PREFIX=24
+BROADCAST=192.168.1.255
+EOF
+popd >/dev/null || exit 1
+
+cat > /etc/resolv.conf << "EOF"
+# Begin /etc/resolv.conf
+
+nameserver 192.168.1.10
+domain berzerkula.org
+search berzerkula.org
+
+# End /etc/resolv.conf
+EOF
+
+echo "lfs" > /etc/hostname
+
+cat > /etc/hosts << "EOF"
+# Begin /etc/hosts
+
+127.0.0.1 localhost.localdomain localhost
+127.0.1.1 lfs.berzerkula.org lfs
+192.168.1.196 lfs.berzerkula.org lfs
+::1 localhost ip6-localhost ip6-loopback
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+
+# End /etc/hosts
+EOF
diff --git a/chapter9/shells.sh b/chapter9/shells.sh
new file mode 100644
index 0000000..d94254c
--- /dev/null
+++ b/chapter9/shells.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+cat > /etc/shells << "EOF"
+# Begin /etc/shells
+
+/bin/sh
+/bin/bash
+
+# End /etc/shells
+EOF
diff --git a/insidechroot.sh b/insidechroot.sh
index 08eada0..35cc244 100644
--- a/insidechroot.sh
+++ b/insidechroot.sh
@@ -39,6 +39,29 @@ elif [[ "${CHAPTER}" -eq 8 ]]; then
fi
done
+elif [[ "${CHAPTER}" -eq 9 ]]; then
+
+ # Chapter 9
+ printf "%b" "\n${IWHT}============ ${IGRN}Building ${IYLW}Chapter 9${IWHT} \
+============${RST}\n"
+
+ source packageinstall.sh 9 lfs-bootscripts
+ retval=$?
+ if [[ "${retval}" -ne 0 ]]; then
+ exit 1
+ fi
+
+ printf "%b" "${GRN}Configuring network related files${RST}\n"
+ source chapter9/network.sh
+ printf "%b" "${GRN}Configuring bootscript related files${RST}\n"
+ source chapter9/bootscriptconf.sh
+ printf "%b" "${GRN}Configuring locale settings${RST}\n"
+ source chapter9/bashprofile.sh
+ printf "%b" "${GRN}Configuring inputrc${RST}\n"
+ source chapter9/inputrc.sh
+ printf "%b" "${GRN}Configuring system shells${RST}\n"
+ source chapter9/shells.sh
+
else
- printf "%b" "Do Chapter 9 and 10 stuff here.\n"
+ printf "%b" "Do Chapter 10 stuff here.\n"
fi
diff --git a/lfs.sh b/lfs.sh
index dc83800..a6b2abc 100755
--- a/lfs.sh
+++ b/lfs.sh
@@ -226,6 +226,9 @@ source mountvirtfs.sh
printf "%b" "\n${CYN}ENTERING ${RED}CHROOT${CYN} ENVIRONMENT...${RST}\n"
sleep 3
+# Create chapter9 log directory as non root user
+mkdir -p "${LFS}"/sources/log/chapter9
+
# Enter CHROOT for chapter 9,10
sudo chroot "${LFS}" /usr/bin/env -i \
HOME=/root \