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.
OPSYSID=165
ROOTMIN=7
SWAPMIN=8
OPSYSID=165
ROOTMIN=7
SWAPMIN=8
DISKMIN=`expr $ROOTMIN + $SWAPMIN + 1`
DEFBLOCKING=2
DEFSECT=17
DISKMIN=`expr $ROOTMIN + $SWAPMIN + 1`
DEFBLOCKING=2
DEFSECT=17
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
part_cnt=0
sysid_cnt=0
have_opsys_part=
part_cnt=0
sysid_cnt=0
have_opsys_part=
unused_last_part=
extent_max=0
extent_max_part=
unused_last_part=
extent_max=0
extent_max_part=
- [ "$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
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}] "
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
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
+ [ ! "$have_dos_part" ] &&
mount -v /dev/${drivename}h /mnt/$hname
fi
mount -v /dev/${drivename}h /mnt/$hname
fi
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