1) Install now creates a DOS partition for the first (and only the
authorAndrew Moore <alm@FreeBSD.org>
Sun, 19 Sep 1993 20:45:10 +0000 (20:45 +0000)
committerAndrew Moore <alm@FreeBSD.org>
Sun, 19 Sep 1993 20:45:10 +0000 (20:45 +0000)
first) Primary (un-Extended) DOS partition, providing /dev/xx0h
is available.  It is mounted on /dos by default.  The /etc/fstab
entry omits the dump and fsck fields, i.e.:
/dev/xx0h /dos pcfs rw

The Secondary DOS partition is not used (System ID 0xF2), because I don't
know what that is.

2) Fixed default sizes so that if someone attempts to install BSD on a 24 Mb
partition by accepting defaults, they don't end up with a 1 Mb /usr
partition (up to USRMIN Mb's).  In this case, all space is split between
swap and root.

TODO:
1) Extend load_fd() to support loading distribution files directly from
the DOS partition of the hard disk.

2) Provide translated parameters to the install program (maybe
add an option to fdisk).  Currently, the true geometry is used as
default, which is inappropriate for coexistence with DOS.

3) Support installing on multiple or secondary disks.

etc/etc.i386/inst1.install

index c7b6e63..007098f 100644 (file)
@@ -11,6 +11,7 @@ OPSYSTEM=FreeBSD
 OPSYSID=165
 ROOTMIN=7
 SWAPMIN=8
 OPSYSID=165
 ROOTMIN=7
 SWAPMIN=8
+USRMIN=7
 DISKMIN=`expr $ROOTMIN + $SWAPMIN + 1`
 DEFBLOCKING=2
 DEFSECT=17
 DISKMIN=`expr $ROOTMIN + $SWAPMIN + 1`
 DEFBLOCKING=2
 DEFSECT=17
@@ -18,6 +19,10 @@ DEFHEAD=12
 DEFCYLN=1024
 RUN_FDISK=""
 
 DEFCYLN=1024
 RUN_FDISK=""
 
+DOS1_ID=1
+DOS2_ID=4
+DOS3_ID=6
+
 set_arbitrary_defaults() {
 cyls_per_disk=$DEFCYLN
 tracks_per_cyl=$DEFHEAD
 set_arbitrary_defaults() {
 cyls_per_disk=$DEFCYLN
 tracks_per_cyl=$DEFHEAD
@@ -34,6 +39,7 @@ got_sysid=
 part_cnt=0
 sysid_cnt=0
 have_opsys_part=
 part_cnt=0
 sysid_cnt=0
 have_opsys_part=
+have_dos_part=
 unused_last_part=
 extent_max=0
 extent_max_part=
 unused_last_part=
 extent_max=0
 extent_max_part=
@@ -78,7 +84,12 @@ while read data; do
                        part_id=
                        continue
                fi
                        part_id=
                        continue
                fi
-               [ "$sysid" = "$OPSYSID" ] && have_opsys_part=$part_id
+               if [ "$sysid" = "$OPSYSID" ]; then
+                       have_opsys_part=$part_id
+               elif [ ! "$have_dos_part" -a \( "$sysid" = "$DOS1_ID" -o \
+                   "$sysid" = "$DOS2_ID" -o "$sysid" = "$DOS3_ID" \) ]; then
+                       have_dos_part=$part_id
+               fi
                eval sysid${part_id}=$sysid
                eval sysname${part_id}=\"$sysname\"
                got_sysid=1
                eval sysid${part_id}=$sysid
                eval sysname${part_id}=\"$sysname\"
                got_sysid=1
@@ -591,7 +602,10 @@ echo "as small as $ROOTMIN Mb ($root_cyls_min cylinders)."
 if [ ! "$cyls_per_root" ]; then
        # set default root partition to 15MB
        cyls_per_root=`expr \( 15 \* $mb_sect \) /  $cylindersize`
 if [ ! "$cyls_per_root" ]; then
        # set default root partition to 15MB
        cyls_per_root=`expr \( 15 \* $mb_sect \) /  $cylindersize`
-       [ $cyls_per_root -gt $root_cyls_max ] && cyls_per_root=$root_cyls_max
+       usr_cyls_max=`expr ${root_cyls_max} - ${cyls_per_root}`
+       mb_usr=`expr ${usr_cyls_max} \* $cylindersize / $mb_sect`
+       [ $cyls_per_root -gt $root_cyls_max  -o $mb_usr -lt $USRMIN ] &&
+       cyls_per_root=$root_cyls_max
 fi
 while :; do
        echo -n "Root partition size (in cylinders)? [${cyls_per_root}] "
 fi
 while :; do
        echo -n "Root partition size (in cylinders)? [${cyls_per_root}] "
@@ -735,7 +749,24 @@ while [ $part_used -lt $partition ]; do
                part_used=partition
        fi
 done
                part_used=partition
        fi
 done
-
+if [ "$have_dos_part" -a ! "$hname" ]; then
+       part_name=""
+       echo    "There appears to be a MS-DOS filesystem on disk."
+       while [ "$part_name" = "" ]; do
+               echo -n "On which directory should this filesystem be mounted? [dos] "
+               read resp junk
+               part_name=${resp:-dos}
+               part_name=`expr "$part_name" : '/*\(.*\)'`
+       done
+       hname=$part_name
+       eval offset=\$start${have_dos_part}
+       eval part_size=\$size${have_dos_part}
+       echo -n "       :ph#${part_size}:oh#${offset}" >>/etc/disktab
+       echo ":th=MSDOS:\\" >>/etc/disktab
+       part_used=partition
+else
+       have_dos_part=""
+fi
 echo   "       :pd#${disksize}:od#0:" >>/etc/disktab
 sync
 
 echo   "       :pd#${disksize}:od#0:" >>/etc/disktab
 sync
 
@@ -850,9 +881,14 @@ if [ "$gname" != "" ]; then
 fi
 if [ "$hname" != "" ]; then
        echo
 fi
 if [ "$hname" != "" ]; then
        echo
-       echo    "Initializing $hname filesystem, and mounting..."
-       newfs ${rotdelay} /dev/r${drivename}h $name
+       if [ ! "$have_dos_part" ]; then
+               echo    "Initializing $hname filesystem, and mounting..."
+               newfs ${rotdelay} /dev/r${drivename}h $name
+       else
+               echo    "Initializing $hname filesystem..."
+       fi
        mkdir -p /mnt/$hname
        mkdir -p /mnt/$hname
+       [ ! "$have_dos_part" ] &&
        mount -v /dev/${drivename}h /mnt/$hname
 fi
 
        mount -v /dev/${drivename}h /mnt/$hname
 fi
 
@@ -880,7 +916,11 @@ if [ "$gname" != "" ]; then
        echo "/dev/${drivename}g        /$gname ufs     rw 1 4" >>etc/fstab
 fi
 if [ "$hname" != "" ]; then
        echo "/dev/${drivename}g        /$gname ufs     rw 1 4" >>etc/fstab
 fi
 if [ "$hname" != "" ]; then
-       echo "/dev/${drivename}h        /$hname ufs     rw 1 5" >>etc/fstab
+       if [ ! "$have_dos_part" ]; then
+               echo "/dev/${drivename}h        /$hname ufs     rw 1 5" >>etc/fstab
+       else
+               echo "/dev/${drivename}h        /$hname pcfs    rw" >>etc/fstab
+       fi
 fi
 
 # cat /etc/disktab >etc/disktab.install
 fi
 
 # cat /etc/disktab >etc/disktab.install