DISKLABEL PROGRAM REQUIRED ACTIVE PARTITION
authorGary A. Browning <gab10@griffcd.amdahl.com>
Fri, 18 Sep 1992 00:00:00 +0000 (00:00 +0000)
committerGary A. Browning <gab10@griffcd.amdahl.com>
Fri, 18 Sep 1992 00:00:00 +0000 (00:00 +0000)
It turns out that if you have not set an active partition on the SECOND
drive, the disklabel program thinks that the DOS partition table is invalid
and promptly, and without warning, assumes it owns the whole disk.  It then
writes it's label over the DOS partition table.  I am not sure what it even
means to have an active partition on the second drive since DOS will not
boot from there anyway.

A valid DOS parition no longer must have exactly one active partition.  This
is certainly not a required patch.  The workaround is to always remember to
have an active partition on each disk.

AUTHOR: Gary A. Browning (gab10@griffcd.amdahl.com)
386BSD-Patchkit: patch00034

usr/src/sbin/disklabel/disklabel.c

index 0db6967..af840b5 100644 (file)
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
+ *
+ * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
+ * --------------------         -----   ----------------------
+ * CURRENT PATCH LEVEL:         1       00034
+ * --------------------         -----   ----------------------
+ *
+ * 18 Sep 92   Gary A Browning         Fix expectation of active partition
  */
 
 #ifndef lint
  */
 
 #ifndef lint
@@ -524,7 +531,8 @@ readmbr(f)
        }
 
        /* valid partition table? */
        }
 
        /* valid partition table? */
-       if (nboot != 1 || npart == 0 || njunk)
+       if (npart == 0 || njunk)                        /* 18 Sep 92*/
+/* was:        if (nboot != 1 || npart == 0 || njunk)*/
                return (0);
        /* if no bsd partition, pass back first one */
        if (!bsdp) {
                return (0);
        /* if no bsd partition, pass back first one */
        if (!bsdp) {