lfs-buildscripts/CH04.01-systemprep.sh

34 lines
534 B
Bash
Raw Normal View History

2024-10-02 04:38:19 +08:00
#!/bin/bash
2024-10-03 11:34:21 +08:00
LFS=/mnt/newlfs
2024-10-02 04:38:19 +08:00
function myfail {
echo "$1"
exit 1
}
if [ "`whoami`" != "root" ]; then
myfail "Must run this script as r00t"
fi
2024-10-06 10:03:27 +08:00
mkdir -p ${LFS}/{etc,var} ${LFS}/usr/{bin,lib,sbin}
2024-10-02 04:38:19 +08:00
for i in bin lib sbin; do
2024-10-06 10:03:27 +08:00
ln -s usr/$i ${LFS}/$i
2024-10-02 04:38:19 +08:00
done
2024-10-06 10:03:27 +08:00
mkdir -p ${LFS}/lib64
2024-10-02 04:38:19 +08:00
2024-10-06 10:03:27 +08:00
mkdir -p ${LFS}/tools
2024-10-02 04:38:19 +08:00
groupadd lfs
useradd -s /bin/bash -g lfs -m -k /dev/null lfs
2024-10-06 10:03:27 +08:00
chown lfs ${LFS}/{usr{,/*},lib,var,etc,bin,sbin,tools}
chown lfs ${LFS}/lib64
2024-10-02 04:38:19 +08:00
echo "Please set a password for the lfs user account"
echo ""
echo " passwd lfs"