From cf2cc6b93b8869cfcceb1e8efaab7aaa19d770fe Mon Sep 17 00:00:00 2001 From: YellowJacketLinux Date: Thu, 10 Oct 2024 14:50:01 -0700 Subject: [PATCH] start of configuration --- CH9Config/00-Generic.sh | 66 ++++++++++++++++++++++++++++++++++++++++ CH9Config/01-USBFlash.sh | 44 +++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 CH9Config/00-Generic.sh create mode 100644 CH9Config/01-USBFlash.sh diff --git a/CH9Config/00-Generic.sh b/CH9Config/00-Generic.sh new file mode 100644 index 0000000..8b29d75 --- /dev/null +++ b/CH9Config/00-Generic.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# hostname + +echo "localhost" > /etc/hostname + +# system locale + +echo FONT=Lat2-Terminus16 > /etc/vconsole.conf + +# /etc/inputrc + +cat > /etc/inputrc << "EOF" +# Begin /etc/inputrc +# Modified by Chris Lynn + +# 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 + +# /etc/shells + +cat > /etc/shells << "EOF" +# Begin /etc/shells + +/bin/sh +/bin/bash + +# End /etc/shells +EOF diff --git a/CH9Config/01-USBFlash.sh b/CH9Config/01-USBFlash.sh new file mode 100644 index 0000000..bcfc1ac --- /dev/null +++ b/CH9Config/01-USBFlash.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# Do not try to bring up the network when booted from a thumb drive + +systemctl disable systemd-networkd-wait-online + +# hostname + +echo "lfsusb" > /etc/hostname + +# LFS user + +groupadd lfs +useradd -d /home/lfs -s /bin/bash -g lfs -m -k /dev/null lfs + +# fix permissions +chown -R lfs:lfs /home/lfs + +# login scripts +cat > /home/lfs/.bash_profile << "EOF" +exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash +EOF +chown lfs:lfs /home/lfs/.bash_profile + +cat > /home/lfs/.bashrc << "EOF" +set +h +umask 022 +LFS=/mnt/newlfs +LC_ALL=POSIX +LFS_TGT=x86_64-lfs-linux-gnu +PATH=/usr/bin +if [ ! -L /bin ]; then PATH=/bin:$PATH; fi +PATH=$LFS/tools/bin:$PATH +CONFIG_SITE=$LFS/usr/share/config.site +export LFS LC_ALL LFS_TGT PATH CONFIG_SITE + +# below is conservative but safe +export MAKEFLAGS=-j8 +EOF + +echo "Please set the password for the lfs user:" +echo " passwd lfs" +echo +