From fc1ef6f13c0687b5cdeac9b8fa646eca653cc6b5 Mon Sep 17 00:00:00 2001 From: Aditya Date: Tue, 10 Jan 2023 10:18:20 +0530 Subject: [PATCH] Add 7.5 - create directories --- scripts/chapter7/7.5-create-dirs.sh | 22 ++++++++++++++++++++++ scripts/main.sh | 12 ++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 scripts/chapter7/7.5-create-dirs.sh diff --git a/scripts/chapter7/7.5-create-dirs.sh b/scripts/chapter7/7.5-create-dirs.sh new file mode 100644 index 0000000..fe7cdd6 --- /dev/null +++ b/scripts/chapter7/7.5-create-dirs.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +mkdir -pv /{boot,home,mnt,opt,srv} + +mkdir -pv /etc/{opt,sysconfig} +mkdir -pv /lib/firmware +mkdir -pv /media/{floppy,cdrom} +mkdir -pv /usr/{,local/}{include,src} +mkdir -pv /usr/local/{bin,lib,sbin} +mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man} +mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo} +mkdir -pv /usr/{,local/}share/man/man{1..8} +mkdir -pv /var/{cache,local,log,mail,opt,spool} +mkdir -pv /var/lib/{color,misc,locate} + +ln -sfv /run /var/run +ln -sfv /run/lock /var/lock + +install -dv -m 0750 /root +install -dv -m 1777 /tmp /var/tmp + + diff --git a/scripts/main.sh b/scripts/main.sh index 8e1bfe9..61c80a9 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -432,3 +432,15 @@ then stop_script "chapter7/7.4-enter-chroot.sh" fi +# Chapter 7.5 +# =========== +echo "Creating Directories" +su -c "bash $PWD/chapter7/7.5-create-dirs.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter7/7.5-create-dirs.sh" +fi +