NetBSD-Bugs archive

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

Re: port-arm/57324: NetBSD 10.99.2 -current fails to detect root wedge using name on Raspberry Pi 3 official image



The following reply was made to PR port-arm/57324; it has been noted by GNATS.

From: sc.dying%gmail.com@localhost
To: gnats-bugs%netbsd.org@localhost, mrg%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
 bbartlomiej.mail%gmail.com@localhost
Cc: 
Subject: Re: port-arm/57324: NetBSD 10.99.2 -current fails to detect root
 wedge using name on Raspberry Pi 3 official image
Date: Sat, 28 Oct 2023 11:34:23 +0000

 On 2023/10/28 9:15, Michael van Elst wrote:
 > The following reply was made to PR port-arm/57324; it has been noted by GNATS.
 > 
 > From: mlelstv%serpens.de@localhost (Michael van Elst)
 > To: gnats-bugs%netbsd.org@localhost
 > Cc: 
 > Subject: Re: port-arm/57324: NetBSD 10.99.2 -current fails to detect root wedge using name on Raspberry Pi 3 official image
 > Date: Sat, 28 Oct 2023 09:09:52 -0000 (UTC)
 > 
 >  sc.dying%gmail.com@localhost writes:
 >  
 >  >>  if i come up with some diag printfs() to help figure this out,
 >  >>  can you build/run them to see?
 >  
 >  >It's good idea to know where what happens.
 >  
 >  What happens is that bcm283x uses ld0 a default booted_device
 >  and the change prevents set_root_device from overriding it from
 >  the command line parameter.
 >  
 >  In fact, the change always prevents set_root_device from overriding
 >  the booted_device which is nonsense.
 
 exactly.
 set_root_device quits early as booted_device != NULL.
 
 [   3.0115346] uhub0: illegal enable change, port 1
 [   3.0215336] swwdog0: software watchdog initialized
 [   3.0315397] WARNING: 3 errors while detecting hardware; check system log.
 [   3.0415360] cpu_rootconf: 1: dev ld0 part 0 bootspec <null>
 [   3.0415360] cpu_bootconf: 1: dev ld0 part 0 bootspec <null>
 [   3.0515385] set_root_device: 1: dev ld0 part 0 bootspec <null>
 [   3.0615385] cpu_bootconf: 2: dev ld0 part 0 bootspec <null>
 [   3.0615385] cpu_bootconf: 3: dev ld0 part 0 bootspec <null>
 [   3.0715401] cpu_rootconf: 2: dev ld0 part 0 bootspec <null>
 [   3.0715401] boot device: ld0
 [   3.0715401] cpu_rootconf: 3: dev ld0 part 0 bootspec <null>
 [   3.0815399] root on ld0a dumps on ld0b
 [   3.0815399] vfs_mountroot: can't open root device
 [   3.0915430] cannot mount root, error = 16
 [   3.0915430] root device (default ld0a): ?
 [   6.3219702] use one of: dk0 dk1 ld0[a-p] bwfm0 usmsc0 wedge:EFI wedge:netbsd-root ddb halt reboot
 [   6.3319714] root device (default ld0a): wedge:netbsd-root
 [  17.2834297] dump device:
 [  19.1036724] file system (default generic):
 [  19.5337299] root on dk1
 [  19.5437314] root file system type: ffs
 [  19.5437314] kern.module.path=/stand/evbarm/10.99.10/modules
 [  19.5537334] WARNING: no TOD clock present
 [  19.5537334] WARNING: using filesystem time
 [  19.5638388] WARNING: CHECK AND RESET THE DATE!
 
 
 --- src/sys/arch/evbarm/evbarm/autoconf.c.orig	2023-02-06 22:45:33.074426928 +0000
 +++ src/sys/arch/evbarm/evbarm/autoconf.c	2023-10-28 11:18:24.582331475 +0000
 @@ -54,6 +54,15 @@ void	(*evbarm_cpu_rootconf)(void);
  
  extern struct cfdata cfdata[];
  
 +#define PRINT_BOOTDEV(_msg) do {		\
 +	printf("%s: %s: dev %s part %d bootspec %s\n",	\
 +	    __func__, _msg, booted_device	\
 +	     ? device_xname(booted_device)	\
 +	     : "<unknown>",			\
 +	    booted_partition,			\
 +	    bootspec ? bootspec : "<null>");	\
 +	} while(0)
 +
  #ifndef MEMORY_DISK_IS_ROOT
  static int get_device(char *name, device_t *, int *);
  static void set_root_device(void);
 @@ -108,15 +117,19 @@ set_root_device(void)
  	char *ptr, *end, *buf;
  	size_t len;
  
 +	PRINT_BOOTDEV("1");
  	if (booted_device)
  		return;
  
 +	PRINT_BOOTDEV("2");
  	if (boot_args == NULL)
  		return;
  
 +	PRINT_BOOTDEV("3");
  	if (!get_bootconf_option(boot_args, "root", BOOTOPT_TYPE_STRING, &ptr))
  		return;
  
 +	PRINT_BOOTDEV("4");
  	if (get_device(ptr, &booted_device, &booted_partition))
  		return;
  
 @@ -126,6 +139,7 @@ set_root_device(void)
  			break;
  		}
  	}
 +	PRINT_BOOTDEV("5");
  
  	if (end == ptr)
  		return;
 @@ -143,6 +157,7 @@ set_root_device(void)
  	bootspec_buflen = len;
  
  	bootspec = bootspec_buf;
 +	PRINT_BOOTDEV("6");
  }
  #endif
  
 @@ -156,18 +171,24 @@ void
  cpu_bootconf(void)
  {
  #ifndef MEMORY_DISK_IS_ROOT
 +	PRINT_BOOTDEV("1");
  	set_root_device();
 +	PRINT_BOOTDEV("2");
  	if (evbarm_cpu_rootconf)
  		(*evbarm_cpu_rootconf)();
 +	PRINT_BOOTDEV("3");
  #endif
  }
  
  void
  cpu_rootconf(void)
  {
 +	PRINT_BOOTDEV("1");
  	cpu_bootconf();
 +	PRINT_BOOTDEV("2");
  	aprint_normal("boot device: %s\n",
  	    booted_device != NULL ? device_xname(booted_device) : "<unknown>");
 +	PRINT_BOOTDEV("3");
  	rootconf();
  }
  
 


Home | Main Index | Thread Index | Old Index