Subject: Re: /dev/random apparently not configured (long-ish)
To: None <port-sparc@NetBSD.org>
From: Barrie Bremner <netbsd@barriebremner.com>
List: port-sparc
Date: 12/09/2005 00:46:42
>>>>> "Valeriy" == Valeriy E Ushakov <uwe@ptc.spbu.ru> writes:

    Valeriy> On Tue, Dec 06, 2005 at 23:43:48 +0000, Barrie Bremner
    Valeriy> wrote:
    >> >> I've tried removing /dev/console from a netbsd-3.0_rc5
    >> setup, >> and although the larger MFS /dev is created
    >> successfully, I'm >> still seeing the device not configured
    >> errors from /dev/random.
    >> 
    Valeriy> Strange.  Does
    >>
    Valeriy> nm /dev/ksyms | grep rnd_cdevsw
    >>
    Valeriy> show that it's really there?
    >> Anyway, on the setup that started this all (2.0.x), nfs mounted
    >> /dev:
    >> 
    >> root@sparc:~> nm /dev/ksyms | grep rnd_cdevsw f02451d8 A
    >> rnd_cdevsw
    >> 
    >> 
    >> On the 3.0rc5 setup, with MFS mounted /dev:
    >> 
    sparc> cat /dev/ksyms > ksyms /usr/bin/nm ksyms | grep rnd_cdevsw
    >> f02d697c A rnd_cdevsw

    Valeriy> Dunno...  Try enabling RND_VERBOSE in sys/dev/rnd.c

    Valeriy> rnd(4) only returns ENXIO if it's not inited or the minor
    Valeriy> is wrong.

What does init'ing /dev/random entail? The silly user in me just
expects something as /dev/random to magically work ;-)

Please don't rule out that fact that I may have done something
unbelievably stupid when configuring the machine - I'm relatively new
to NetBSD (although a long time Linux user).

An update:

I've upgraded the machine to NetBSD-2.1, with up-to-date sources as of
a few hours ago, in order to generally update the machine, but also to
get the fixed init(8) to allow me to mount an MFS /dev.

Still no joy on the /dev/random front:


  root@sparc:~> dd if=/dev/random bs=8 count=8
  dd: /dev/random: Device not configured

But the symbols (and my kernel config file) say pseudo-device rnd is
there:

  root@sparc:~> nm /dev/ksyms | grep rnd_cdevsw
  f0221300 A rnd_cdevsw


I've compiled a fresh kernel with RND_VERBOSE defined in
sys/dev/rnd.c, a chunk of boot messages follow (missing sections shown
as ...). Note the low entropy messages and the messages from named (BIND 9.3.1):



NetBSD 2.1_STABLE (BAZ.MP) #1: Fri Dec  9 00:20:30 GMT 2005
...
total memory = 64752 KB
avail memory = 59960 KB
rnd: initialised (4096)
...
le0 at ledma0 slot 15 offset 0xc00000 level 6: address 08:00:20:81:7e:32
le0: 8 receive buffers, 2 transmit buffers
rnd: le0 attached as an entropy source (off)
...
hme0 at sbus0 slot 1 offset 0x8c00000 level 4 (ipl 7): Sun Happy Meal Ethernet (SUNW,qfe)
...
OUI 0x0006b8 model 0x000c rev 1 at hme0 phy 1 not configured
rnd: hme0 attached as an entropy source (off)
hme1 at sbus0 slot 1 offset 0x8c10000 level 4 (ipl 7): Sun Happy Meal Ethernet (SUNW,qfe)
...
OUI 0x0006b8 model 0x000c rev 1 at hme1 phy 1 not configured
rnd: hme1 attached as an entropy source (off)
hme2 at sbus0 slot 1 offset 0x8c20000 level 4 (ipl 7): Sun Happy Meal Ethernet (SUNW,qfe)
...
OUI 0x0006b8 model 0x000c rev 1 at hme2 phy 1 not configured
rnd: hme2 attached as an entropy source (off)
hme3 at sbus0 slot 1 offset 0x8c30000 level 4 (ipl 7): Sun Happy Meal Ethernet (SUNW,qfe)
...
OUI 0x0006b8 model 0x000c rev 1 at hme3 phy 1 not configured
rnd: hme3 attached as an entropy source (off)
nell0 at sbus0 slot 2 offset 0x0 level 4 (ipl 7) level 7 (ipl 13): rev 1
pcmcia0 at nell0 socket 0
wi0 at pcmcia0 function 0: Lucent Technologies, WaveLAN/IEEE, Version 01.01
...
wi0: Lucent Firmware: Station (8.72.1)
rnd: WARNING! initial entropy low (5).
rnd: WARNING! initial entropy low (6).
...
cd0 at scsibus0 target 6 lun 0: <TOSHIBA, XM5701TASUN12XCD, 0997> cdrom removable
rnd: cd0 attached as an entropy source (collecting)
...
root on hme0
nfs_boot: trying DHCP/BOOTP
...
root on 192.168.0.1:/export/sparc/root
cpu0: booting secondary processors: cpu1
warning: no /dev/console
rnd: WARNING! initial entropy low (2).
init: Creating mfs /dev (408 blocks, 1024 inodes)
Fri Dec  9 00:33:38 GMT 2005
Checking for botched superblock upgrades: done.
Starting file system checks:
rnd: WARNING! initial entropy low (0).
Setting tty flags.
Enabling ipfilter.
Setting sysctl variables:
net.inet.ip.forwarding: 1 -> 1
Starting network.
Hostname: sparc
rnd: WARNING! initial entropy low (0).
rnd: WARNING! initial entropy low (1).
IPv6 mode: host
Configuring network interfaces: wi0.
...
Adding interface aliases:
rnd: WARNING! initial entropy low (0).
...
Starting named.
Dec  9 00:33:50 sparc named[1747]: errno2result.c:109: unexpected error:
Dec  9 00:33:50 sparc named[1747]: unable to convert errno to isc_result: 6: Device not configured
rnd: WARNING! initial entropy low (0).
Mounting all filesystems...
rnd: WARNING! initial entropy low (0).
rnd: WARNING! initial entropy low (0).
Clearing /tmp.
Creating a.out runtime link editor directory cache.
Checking quotas: done.
Setting securelevel: kern.securelevel: 0 -> 1
rnd: WARNING! initial entropy low (0).
...
Starting ntpd.
rnd: WARNING! initial entropy low (0).
Starting sshd.
rnd: WARNING! initial entropy low (0).
rnd: WARNING! initial entropy low (0).
Starting sendmail.
rnd: WARNING! initial entropy low (0).
Starting cron.
Fri Dec  9 00:34:01 UTC 2005

NetBSD/sparc (sparc) (console)

login:


-- 
Barrie J. Bremner
netbsd [at] barriebremner.com     http://barriebremner.com/