aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-04-12 15:21:47 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-04-12 15:21:47 -0500
commitbd6f662dfb7d293b8143785a7b28c9bfeccd0ee2 (patch)
tree7dc0e09c16606322d2cfa686d2a7ee2bc92b3341
parent7215575834db88849e6ba78de8d179b4a80bdeb6 (diff)
Add bash profile, boot script configuration, inputrc and shell configuration to chapter9.
-rw-r--r--chapter9/bashprofile.sh9
-rw-r--r--chapter9/bootscriptconf.sh51
-rw-r--r--chapter9/inputrc.sh45
-rw-r--r--chapter9/shells.sh10
-rw-r--r--insidechroot.sh8
5 files changed, 123 insertions, 0 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/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 197658c..35cc244 100644
--- a/insidechroot.sh
+++ b/insidechroot.sh
@@ -53,6 +53,14 @@ elif [[ "${CHAPTER}" -eq 9 ]]; then
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 10 stuff here.\n"