NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: install/55187: sysinst partition editor fails on x68k/9.0



The following reply was made to PR install/55187; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: install/55187: sysinst partition editor fails on x68k/9.0
Date: Sat, 13 Jun 2020 08:51:41 +0900

 This seems to work around the problem.
 
 Index: disklabel.c
 ===================================================================
 RCS file: /cvsroot/src/usr.sbin/sysinst/disklabel.c,v
 retrieving revision 1.10.2.9
 diff -u -p -d -r1.10.2.9 disklabel.c
 --- disklabel.c	10 Feb 2020 21:39:37 -0000	1.10.2.9
 +++ disklabel.c	12 Jun 2020 23:22:10 -0000
 @@ -265,6 +265,19 @@ disklabel_parts_read(const char *disk, d
  		    && parts->l.d_partitions[part].p_size == 0)
  			continue;
  
 +		/*
 +		 * Some traditional MD readdisklabel(9) implementation
 +		 * could set p_size = 0x1fffffff for partition a
 +		 * if there is no valid disklabel.
 +		 * Ignore and reset such a bogus partition size.
 +		 */
 +		if (parts->l.d_partitions[part].p_fstype == FS_UNUSED &&
 +		    (parts->l.d_partitions[part].p_size >
 +		     parts->l.d_partitions[RAW_PART].p_size)) {
 +			parts->l.d_partitions[part].p_size = 0;
 +			continue;
 +		}
 +
  		parts->dp.num_part++;
  		if (parts->l.d_partitions[part].p_fstype == FS_UNUSED)
  			continue;
 
 ---
 
 c.f.
  http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/i386/i386/Attic/disksubr.c?annotate=1.4
 
 ---
 % grep '\[0\].*0x1fffffff' sys/arch/*/*/disksubr.c 
 sys/arch/pmax/pmax/disksubr.c:		lp->d_partitions[0].p_size = 0x1fffffff;
 sys/arch/x68k/x68k/disksubr.c:		lp->d_partitions[0].p_size = 0x1fffffff;
 ---
 
 Maybe we should also check explicit (p_size == 0x1fffffff)
 for possible larger disks?
 
 Note size of swap partition is set to zero due to
 PR/55375 because size of the target disk is
 512MB (smaller than DEFUSRSIZE (1024MB)).
 
 ---
 Izumi Tsutsui
 


Home | Main Index | Thread Index | Old Index