mirror of
https://git.adityakumar.xyz/lfs-scripts.git
synced 2024-11-12 16:29:44 +00:00
Add 7.6 - creating essential files and symlinks
This commit is contained in:
parent
fc1ef6f13c
commit
264c7d6f65
2 changed files with 69 additions and 0 deletions
57
scripts/chapter7/7.6-create-files-and-symlinks.sh
Normal file
57
scripts/chapter7/7.6-create-files-and-symlinks.sh
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
ln -sv /proc/self/mounts /etc/mtab
|
||||||
|
|
||||||
|
cat > /etc/hosts << EOF
|
||||||
|
127.0.0.1 localhost $(hostname)
|
||||||
|
::1 localhost
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat > /etc/passwd << "EOF"
|
||||||
|
root:x:0:0:root:/root:/bin/bash
|
||||||
|
bin:x:1:1:bin:/dev/null:/usr/bin/false
|
||||||
|
daemon:x:6:6:Daemon User:/dev/null:/usr/bin/false
|
||||||
|
messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/usr/bin/false
|
||||||
|
uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/usr/bin/false
|
||||||
|
nobody:x:65534:65534:Unprivileged User:/dev/null:/usr/bin/false
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat > /etc/group << "EOF"
|
||||||
|
root:x:0:
|
||||||
|
bin:x:1:daemon
|
||||||
|
sys:x:2:
|
||||||
|
kmem:x:3:
|
||||||
|
tape:x:4:
|
||||||
|
tty:x:5:
|
||||||
|
daemon:x:6:
|
||||||
|
floppy:x:7:
|
||||||
|
disk:x:8:
|
||||||
|
lp:x:9:
|
||||||
|
dialout:x:10:
|
||||||
|
audio:x:11:
|
||||||
|
video:x:12:
|
||||||
|
utmp:x:13:
|
||||||
|
usb:x:14:
|
||||||
|
cdrom:x:15:
|
||||||
|
adm:x:16:
|
||||||
|
messagebus:x:18:
|
||||||
|
input:x:24:
|
||||||
|
mail:x:34:
|
||||||
|
kvm:x:61:
|
||||||
|
uuidd:x:80:
|
||||||
|
wheel:x:97:
|
||||||
|
users:x:999:
|
||||||
|
nogroup:x:65534:
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "tester:x:101:101::/home/tester:/bin/bash" >> /etc/passwd
|
||||||
|
echo "tester:x:101:" >> /etc/group
|
||||||
|
install -o tester -d /home/tester
|
||||||
|
|
||||||
|
exec /usr/bin/bash --login
|
||||||
|
|
||||||
|
touch /var/log/{btmp,lastlog,faillog,wtmp}
|
||||||
|
chgrp -v utmp /var/log/lastlog
|
||||||
|
chmod -v 664 /var/log/lastlog
|
||||||
|
chmod -v 600 /var/log/btmp
|
||||||
|
|
|
@ -444,3 +444,15 @@ then
|
||||||
stop_script "chapter7/7.5-create-dirs.sh"
|
stop_script "chapter7/7.5-create-dirs.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Chapter 7.6
|
||||||
|
# ===========
|
||||||
|
echo "Creating Essential Files and Symlinks"
|
||||||
|
su -c "bash $PWD/chapter7/7.6-create-files-and-symlinks.sh"
|
||||||
|
|
||||||
|
# Exit on error
|
||||||
|
check_exit_code
|
||||||
|
if [ $exit_status -ne 0 ]
|
||||||
|
then
|
||||||
|
stop_script "chapter7/7.6-create-files-and-symlinks.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue