NetBSD-Bugs archive

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

Re: port-arm/54640: Wrong RAW_PART in MAKEDEV(8) for hpcarm and zaurus



The following reply was made to PR port-arm/54640; 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: port-arm/54640: Wrong RAW_PART in MAKEDEV(8) for hpcarm and zaurus
Date: Sat, 2 Nov 2019 08:21:45 +0900

 quote from port-zaurus:
 
 ---
 The problem is not in kernels but MAKEDEV.awk script,
 so I think someone[TM] can easily fix it.
 
 ---
 	while (1) {
 		inc = top "arch/" incdir "/include/disklabel.h"
 		if (system("test -f '" inc "'") != 0) {
 			print "ERROR: can't find kernel include file '" inc "'" > "/dev/stderr"
 			exit 1
 		}
 		incdir = 0
 		while (getline < inc) {
 			if ($1 == "#define" && $2 == "MAXPARTITIONS")
 				diskpartitions = $3
 			else if ($1 == "#define" && $2 == "OLDMAXPARTITIONS")
 				diskbackcompat = $3
 			else if ($1 == "#define" && $2 == "RAW_PART")
 				RAWDISK_OFF = $3
 			else if ($1 == "#include" && 
 				 $2 ~ "<.*/disklabel.h>" &&
 				 $2 !~ ".*nbinclude.*")
 			{
 				# wrapper, switch to the right file
 				incdir = substr($2, 2)
 				sub("/.*", "", incdir)
 				break;
 			}
 ---
 
 It checks arch/zaurus/include/disklabel.h so it will find
 > #define RAW_PART	3
 line in it. However zaurus/include/disklabel.h also includes
 <arm/disklabel.h> and it also has the following definition:
 ---
 #ifndef RAW_PART
 #define RAW_PART		2	/* raw partition: XX?c */
 #endif
 ---
 
 The problem is MAKEDEV.awk cannot parse "#ifndef RAW_PART", isn't it?
 ---
 


Home | Main Index | Thread Index | Old Index