add directory study

This commit is contained in:
gohigh
2024-02-19 00:25:23 -05:00
parent b1306b38b1
commit f3774e2f8c
4001 changed files with 2285787 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
case $# in
6) ;;
*) echo "Usage: setup_root device ram_size hd1_size hd2_size hd3_size hd4_size"
exit 1
;;
esac
old_dir=`pwd` # save current directory
if /etc/mount $1 /user
then : # successful mount
else echo "Unable to mount $1. Root file system not created."
exit 1
fi
# Make the directories
cd /user
mkdir bin dev etc lib tmp user usr
chown bin bin dev etc lib tmp user usr
chgrp bin bin dev etc lib tmp user usr
chmod 777 bin dev etc lib tmp user usr
# Make the special files.
cd dev
/etc/mkdev $2 $3 $4 $5 $6
# Copy /bin and /etc
cpdir -m /bin /user/bin
cpdir -m /etc /user/etc
fixbin /user/bin /user/bin >/dev/null 2>&1
chown bin /user/etc/*
chown root /user/etc/*mount
chmod 4755 /user/etc/*mount
cd $old_dir
/etc/umount $1