NetBSD-Bugs archive

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

Re: kern/55814: setroot(9) doesn't show "root on xxNa" if RB_ASKNAME is specified



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

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: mlelstv%netbsd.org@localhost, tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: kern/55814: setroot(9) doesn't show "root on xxNa" if RB_ASKNAME
	 is specified
Date: Mon, 23 Nov 2020 01:56:30 +0900

 >  >When a kernel is boot with RB_ASKNAME (or no bootinfo),
 >  >setroot(9) longer show "root on wd0a" etc.
 >  >but only show " dumps on wd0b" etc.
 >  
 >  I've committed a fix, please verify.
 
 Works as expected at least on patched NetBSD/i386 9.1 with "boot -as":
 ---
 [     6.056051] boot device: sd0
 [     6.056051] root device (default sd0a): 
 [     6.640756] dump device (default sd0b): 
 [     6.879593] file system (default generic): 
 [     6.905757] root on sd0a dumps on sd0b
 [     6.911814] root file system type: ffs
 [     6.911814] kern.module.path=/stand/i386/9.1/modules
 ---
 
 However duplicating printf lines after "refactoring" doesn't seem
 so good, IMO.
 
 ---
 static void
 setroot_ask(device_t bootdv, int bootpartition)
 {
 [snip]
 
 	switch (device_class(rootdv)) {
 	case DV_IFNET:
 	case DV_DISK:
 		aprint_normal("root on %s", device_xname(rootdv));
 		if (DEV_USES_PARTITIONS(rootdv))
 			aprint_normal("%c", (int)DISKPART(rootdev) + 'a');
 		break;
 	default:
 		printf("can't determine root device\n");
 		return;
 	}
 
 	root_device = rootdv;
 	setroot_dump(rootdv, dumpdv);
 }
 
 ---
 
 static void
 setroot_root(device_t bootdv, int bootpartition)
 {
 [snip]
 
 haveroot:
 	switch (device_class(rootdv)) {
 	case DV_IFNET:
 	case DV_DISK:
 		aprint_normal("root on %s", device_xname(rootdv));
 		if (DEV_USES_PARTITIONS(rootdv))
 			aprint_normal("%c", (int)DISKPART(rootdev) + 'a');
 		break;
 	default:
 		printf("can't determine root device\n");
 		return;
 	}
 
 	root_device = rootdv;
 	setroot_dump(rootdv, NULL);
 }
 
 ---
 Izumi Tsutsui
 


Home | Main Index | Thread Index | Old Index