Port-zaurus archive

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

Re: NetBSD/zaurus 8.1 problems and possible fixes



abs@ wrote:

> Apologies for asking a possibly dumb question :) - assuming someone
> has not used partition c, then would the upgrade fix be to run a new
> MAKEDEV, or are there further steps required?

I'm afraid userland binaries (like fdisk(8) and disklabel(8))
with the changed new kernel could fail to open rawpartition.

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?

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index