36 lines
775 B
Plaintext
36 lines
775 B
Plaintext
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
|