-ETC=/etc
-USRETC=/usr/etc
+ETC=/etc/
+USRETC=/usr/etc/
FILES1=fstab group hostname.file inet.conf motd mtab passwd profile protocols rc services termcap ttytab utmp
FILES2=shadow
FILES3=daily dhcptags.conf rc
install::
@echo "Installing /etc and /usr/etc.."
mkdir -p $(ETC)
- for f in $(FILES1); do if [ -f $(ETC)/$$f ]; then echo $$f exists; else cp $$f $(ETC); fi; done
+ for f in $(FILES1); do if [ -f $(ETC)/$$f ]; then echo $$f exists; else cp $$f $(ETC); chmod 755 $(ETC)/$$f; fi; done
for f in $(FILES2); do if [ -f $(ETC)/$$f ]; then echo $$f exists; else cp $$f $(ETC); chmod 600 $(ETC)/$$f; fi; done
- for f in $(FILES3); do if [ -f $(USRETC)/$$f ]; then echo $$f exists; else cp usr/$$f $(USRETC); chmod 755 $(USRETC)/$$f; fi; done
@echo "Making hierarchy.."
./mtree.sh mtree/minix.tree
+ for f in $(FILES3); do if [ -f $(USRETC)/$$f ]; then echo $$f exists; else cp usr/$$f $(USRETC); chmod 755 $(USRETC)/$$f; fi; done
cd /dev && /usr/src/commands/scripts/MAKEDEV.sh std
- (cd ast && tar cf - . ) | (cd /usr/ast && tar xf - )
+ (cd ast && tar cf - .* ) | (cd /usr/ast && tar xf - )
# Any swapspace on a device?
test "$swap" : '/dev/' && mount -s $swap
+ # Are we booting from CD?
+ bootcd="`/bin/sysenv bootcd`"
+ ramname="`/bin/sysenv ramname`"
+
+ # If booting from CD, /usr has to be mounted readonly.
+ # Also, $usr won't be specified correctly in the
+ # fstab (the CD could be anywhere), so we decide
+ # where it is.
+ if [ "$bootcd" = 1 ]
+ then
+ usr_roflag="-r"
+ usr="/dev/${ramname}p2"
+ echo "Setting /usr to mount readonly from cd: $ramname -> $usr"
+ fi
+
# Mount the /usr partition unless this is a single floppy Minix.
if [ ! -d /usr/bin ]
then
echo "usr=/dev/$usr" >/tmp/usr'
. /tmp/usr
fi
- mount $usr /usr || {
+ mount $usr_roflag $usr /usr || {
echo "\
Please try to mount something else as /usr, then hit CTRL-D to continue startup.
Mount $usr /usr failed -- Single user."
# Any swapspace on a file?
test -n "$swap" -a ! "$swap" : '/dev/' && mount -s $swap
- case "`printroot -r`" in
- /dev/ram)
- # Remove boot-only things to make space.
- rm -rf /boot /minix
+
+ case "`printroot -r`":$bootcd in
+ /dev/ram:)
+ # Remove boot-only things to make space,
+ # unless booting from CD, in which case we need them.
+ rm -rf /boot
esac
# Things should be alright now.
set -- `ls -lT $timestamp`
test "$6 $7 $9" = "$(date '+%b %d %Y')" && exit
fi
->$timestamp
+>$timestamp 2>/dev/null # Makes for errors when booting from CD
# Remove three day old files from various tmp dirs.
cleantmp -3 /tmp /usr/tmp /usr/preserve /usr/spool/lpd /usr/spool/at/past