Re: Netra T5220

2018-11-16 Thread Don NetBSD

On 11/16/2018 12:05 AM, Sad Clouds wrote:

On Thu, 15 Nov 2018 22:10:26 -0700
Don NetBSD  wrote:


This may well be the killer.  Someone appears to have flashed a
custom OFW image -- which I'll have to rid the machine of before I
can do ANYTHING with it.


If someone put the latest firmware version there, then keep it. There
is probably a way to reset passwords without flashing firmware, could
be a jumper on the mainboard.


The banner says:
U-Boot 1.1.1


custom Sun Microsystems U-Boot 1.3
^^

And, autoboots a Linux 2.4.22 kernel (which must reside on internal FLASH
as it boots even with the drives pulled!)

I am hoping to make some time to play with this over the weekend
(or, over the holiday).  Right now, its just "in the way"  :-/


Re: Netra T5220

2018-11-16 Thread Sad Clouds
On Thu, 15 Nov 2018 22:10:26 -0700
Don NetBSD  wrote:

> This may well be the killer.  Someone appears to have flashed a
> custom OFW image -- which I'll have to rid the machine of before I
> can do ANYTHING with it.

If someone put the latest firmware version there, then keep it. There
is probably a way to reset passwords without flashing firmware, could
be a jumper on the mainboard.



Re: Netra T5220

2018-11-16 Thread Sad Clouds
On Fri, 16 Nov 2018 01:01:18 -0700
Don NetBSD  wrote:

> The banner says:
> U-Boot 1.1.1
> 
> 
> custom Sun Microsystems U-Boot 1.3
> ^^
> 
> And, autoboots a Linux 2.4.22 kernel (which must reside on internal
> FLASH as it boots even with the drives pulled!)
> 
> I am hoping to make some time to play with this over the weekend
> (or, over the holiday).  Right now, its just "in the way"  :-/

Not sure about your case specifically, but on my system there is an
ILOM SP (service processor), this is separate from UltraSPARC T2
processor.

They use embedded Linux that boots into SP, which is what you see on
the banner. This allows you to ssh into the system when it is not
running and configure/upgrade firmware, start/stop OS, etc. By default,
ILOM uses DHCP to acquire IP address and the default login/password is
root/changeme. There is a special management port that you need to plug
to the rest of your network. Alternatively you can use serial-to-usb
cable, which I guess is what you're doing since you can see SP boot
messages.

I think the SP is some kind of embedded IBM Power processor.

https://docs.oracle.com/cd/E19350-01/820-3010-12/820-3010-12.pdf



Re: /var on tmpfs

2018-11-16 Thread Jeremy C. Reed
On Thu, 15 Nov 2018, Don NetBSD wrote:

> I've a box with a DoM.  I'd like to mount / as ro and create a
> tmpfs for /var (and /tmp).  I don't think anything else NEEDS to
> be rw (the infrequent changes to /etc can be made by unlocking /
> to make those changes).
> 
> I imagine I can just make a tarball of a skeletal /var and
> unpack this over /var, once mounted?
> 
> Is there a preexisting mechanism for this sort of thing?
> Or, do I roll my own?

Have a look at the /etc/mtree/ specifications. Many /var/ entries in 
there.  You could use it to create your own spec file for your required 
files and directories with correct ownership and permissions and then 
run mtree to generate them.

Or (looking at my notes from 2002), I used a /var.copy directory 
pre-populated as needed and after the /var was mounted and "cp -R -p 
/var.copy/* /var" into it.



Re: Netra T5220

2018-11-16 Thread Don NetBSD

On 11/16/2018 1:56 PM, Brett Lymn wrote:

On Fri, Nov 16, 2018 at 01:22:19PM -0700, Don NetBSD wrote:

Version 3.0.10.4 r61032

Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

Warning: password is set to factory default.

-> version
SP firmware 3.0.10.4
SP firmware build number: 61032
SP firmware date: Tue Dec  6 10:59:21 PST 2011
SP filesystem version: 0.1.22

->


ok, that is the SP prompt. Get a console using:

start /HOST/console


Yes, but what's the prompt BEFORE that (u-boot>)?  And, where do I
find the capabilities, there, documented?

[I'm sure that a console won't let me into whatever OS is installed
as I've no idea what the root password is likely to be]

BTW, examining some of the logs suggest it is (was?) running
Solaris 5.10



Re: /var on tmpfs

2018-11-16 Thread Don NetBSD

On 11/16/2018 12:35 PM, Rhialto wrote:

I once made a little script to make a bootable ISO9660 live file system,
given the distribution tarballs. It has to be able to live on a
read-only medium, hence it uses a tmpfs for /var. For initializing it,
it installs a script in /etc/rc.d. I basically used trial and error;
everything that produced an error message while booting was reason for
adding an extra directory or empty file.

https://www.falu.nl/~rhialto/mkiso

I just gave it a quick try, and qemu seemed a looot slower than
previously (when I last tried was under 7.0.2 I think)...


Thanks, I'll have a look.


Re: /var on tmpfs

2018-11-16 Thread Rhialto
I once made a little script to make a bootable ISO9660 live file system,
given the distribution tarballs. It has to be able to live on a
read-only medium, hence it uses a tmpfs for /var. For initializing it,
it installs a script in /etc/rc.d. I basically used trial and error;
everything that produced an error message while booting was reason for
adding an extra directory or empty file.

https://www.falu.nl/~rhialto/mkiso

I just gave it a quick try, and qemu seemed a looot slower than
previously (when I last tried was under 7.0.2 I think)...

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- "What good is a Ring of Power
\X/ rhialto/at/falu.nl  -- if you're unable...to Speak." - Agent Elrond


signature.asc
Description: PGP signature


Re: Netra T5220

2018-11-16 Thread Brett Lymn
On Fri, Nov 16, 2018 at 01:22:19PM -0700, Don NetBSD wrote:
> Version 3.0.10.4 r61032
> 
> Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
> 
> Warning: password is set to factory default.
> 
> -> version
> SP firmware 3.0.10.4
> SP firmware build number: 61032
> SP firmware date: Tue Dec  6 10:59:21 PST 2011
> SP filesystem version: 0.1.22
> 
> ->

ok, that is the SP prompt. Get a console using:

start /HOST/console


-- 
Brett Lymn
Let go, or be dragged - Zen proverb.


Re: Netra T5220

2018-11-16 Thread Don NetBSD

On 11/16/2018 2:53 PM, Sad Clouds wrote:

On Fri, 16 Nov 2018 13:22:19 -0700
Don NetBSD  wrote:


So, it seems like there are a boat load of prompts -- "u-boot>",
"->", "ok" ...  And, nothing that seems to summarize ALL of
the pertinent environments in which you can be interacting with
the box.


You're getting confused between various consoles. This is what I do to
log in

I have a Linux laptop connected to T5220 via serial cable


Here I use 'cu' to initiate connection:

# chmod 666 /dev/ttyUSB0
# cu -l /dev/ttyUSB0


Fine, I use tip(1)...


First login takes me to service processor console:

SUNSP00212824CA7D login: root
Password:
Waiting for daemons to initialize...

Daemons ready

Sun(TM) Integrated Lights Out Manager

Version 2.0.4.27.g

Warning: password is set to factory default.


This is where we differ.  I get a U-Boot banner (actually, TWO of them)
followed by a "u-boot>" prompt.  If I issue the "boot" command at that
prompt, the service processor boots (lots of diagnostic output before
finally offering up the "->" prompt)

Once at the SP prompt, I can progress to a console, as below.  I just
have this "extra step" BEFORE the SP prompt is available.

And, am unsure of what I can do, there (e.g., I was able to reset
the password for the SP using commands from the "u-boot>" prompt)


The following command takes me to system console. After I type 'y' and
hit Enter key, Solaris login prompt appears:

-> start /SP/console
Are you sure you want to start /SP/console (y/n)? y

Serial console started.  To stop, type #.

t5220 console login:




I don't know if your system is bootable and if it has Solaris running.
If not, then download ISO, burn to DVD and try booting from that.


The system boots (5.10) -- if I want to go that far.  Right now, I want
to sort out how to get the box into a configuration that I can at least
document.  Then, figure out how I might want to CHANGE that to suit my
specific needs.

Starting at the "u-boot level" seems the most prudent...



Re: /var on tmpfs

2018-11-16 Thread Staffan Thomén

Don NetBSD wrote:

I've a box with a DoM.  I'd like to mount / as ro and create a
tmpfs for /var (and /tmp). I don't think anything else NEEDS to
be rw (the infrequent changes to /etc can be made by unlocking /
to make those changes).

I imagine I can just make a tarball of a skeletal /var and
unpack this over /var, once mounted?

Is there a preexisting mechanism for this sort of thing?
Or, do I roll my own?


How about using union mounts? I don't think you can do that for /, but for 
/var it should let you have your cake and eat it too.


Just a thought.

Staffan


Re: /var on tmpfs

2018-11-16 Thread Don NetBSD

On 11/16/2018 11:12 AM, Jeremy C. Reed wrote:

On Thu, 15 Nov 2018, Don NetBSD wrote:


I've a box with a DoM.  I'd like to mount / as ro and create a
tmpfs for /var (and /tmp).  I don't think anything else NEEDS to
be rw (the infrequent changes to /etc can be made by unlocking /
to make those changes).

I imagine I can just make a tarball of a skeletal /var and
unpack this over /var, once mounted?

Is there a preexisting mechanism for this sort of thing?
Or, do I roll my own?


Have a look at the /etc/mtree/ specifications. Many /var/ entries in
there.  You could use it to create your own spec file for your required
files and directories with correct ownership and permissions and then
run mtree to generate them.


Ah, that would be a clever approach -- and, add little/nothing to the
image size as the entries would already exist in the existing specs
(I'd just be "moving" them into another spec).

But, it won't let me create *files*.

So, if I wanted to symlink all or part of /etc to, for example, /var/etc
(to eliminate the need for creating a second tmpfs -- and incurring a
second "overhead"), I'd still need a mechanism to instantiate those
files under /var.


Or (looking at my notes from 2002), I used a /var.copy directory
pre-populated as needed and after the /var was mounted and "cp -R -p
/var.copy/* /var" into it.


I'd thought:

# mount_tmpfs tmpfs /var

-- populate /var, as needed

# mount -u /
# tar czpf /somewhere/var.tgz /var

Then, just unpack the tarball onto the newly mounted /var in rc(5).

But, regardless, the point is that there is no preexisting mechanism
in place for this sort of thing?  E.g., FBSD had an rc.diskless
(a bit of overkill) that could be modified to achieve these sorts of
results.


Re: Netra T5220

2018-11-16 Thread Don NetBSD

On 11/16/2018 1:27 AM, Sad Clouds wrote:

On Fri, 16 Nov 2018 01:01:18 -0700
Don NetBSD  wrote:


[probably best to take this off list?]


I am hoping to make some time to play with this over the weekend
(or, over the holiday).  Right now, its just "in the way"  :-/


Not sure about your case specifically, but on my system there is an
ILOM SP (service processor), this is separate from UltraSPARC T2
processor.


Yes, this was my first source of confusion (I was expecting the OFW
to more resemble my Voyager/U60/SB2000).


They use embedded Linux that boots into SP, which is what you see on
the banner. This allows you to ssh into the system when it is not
running and configure/upgrade firmware, start/stop OS, etc. By default,
ILOM uses DHCP to acquire IP address and the default login/password is
root/changeme. There is a special management port that you need to plug
to the rest of your network. Alternatively you can use serial-to-usb
cable, which I guess is what you're doing since you can see SP boot
messages.


I'm using tip(1) over a regular serial port.


I think the SP is some kind of embedded IBM Power processor.

https://docs.oracle.com/cd/E19350-01/820-3010-12/820-3010-12.pdf


Note, however, that neither "U-Boot" (which is part of the banner)
NOR "u-boot>" (which is the prompt that appears) exists anywhere in
this text!

So, it seems like there are a boat load of prompts -- "u-boot>",
"->", "ok" ...  And, nothing that seems to summarize ALL of
the pertinent environments in which you can be interacting with
the box.

Note, for example, the different responses to the "version" command
(no doubt, this is "old" -- but HOW old?  Which versions of Slowaris
might it support -- without a firmware upgrade?):
---
U-Boot 1.1.1

custom Sun Microsystems U-Boot 1.3 (Dec  6 2011 - 11:01:09) r61032

CPU:   MPC885ZPnn at 133 MHz: 8 kB I-Cache 8 kB D-Cache FEC present
Board: SPARC885
   Watchdog enabled
I2C:   ready
DRAM:
trying 128 MBytes
(128 MB SDRAM) 128 MB
Memory Tests: DA A1 A2 00 FF 55 AA T2 T3 T4
POST memory PASSED
FLASH: 32 MB
In:serial
Out:   serial
Err:   serial
Net:   FEC ETHERNET
POST i2c  c  d 14 18 2a 2d 2e 30 40 43 46 51 53 54 56 59 68 69 6a 6b 70 71 
PASSED
POST cpu PASSED
POST ethernet PASSED
Booting linux in 30 seconds...

(*** abort boot ***)

u-boot> version

U-Boot 1.1.1

custom Sun Microsystems U-Boot 1.3 (Dec  6 2011 - 11:01:09) r61032
u-boot> boot
## Booting image at fe08 ...
   Image Name:   Linux-2.4.22
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:815088 Bytes = 796 kB
   Load Address: 
   Entry Point:  
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
do_bootm_linux():
  argv[0]=bootm
  argv[1]=0xfe08
## Current stack ends at 0x07D388B8 => set upper limit to 0x0080
No initrd
## cmdline at 0x007FFF00 ... 0x007FFF80
...yada yada yada

login: root
Password: changeme
Waiting for daemons to initialize...
.
Timed out waiting for daemons to start
sccd daemon has shutdown

Oracle(R) Integrated Lights Out Manager

Version 3.0.10.4 r61032

Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

Warning: password is set to factory default.

-> version
SP firmware 3.0.10.4
SP firmware build number: 61032
SP firmware date: Tue Dec  6 10:59:21 PST 2011
SP filesystem version: 0.1.22

->


Re: apm command netbsd 8

2018-11-16 Thread Michael Jensen

On Fri, 16 Nov 2018, m...@netbsd.org wrote:


Date: Fri, 16 Nov 2018 05:02:05 +
From: m...@netbsd.org
To: Michael Jensen 
Cc: netbsd-users@NetBSD.org
Subject: Re: apm command netbsd 8

On Sat, Nov 10, 2018 at 07:22:04AM -0600, Michael Jensen wrote:


Has the old apm command been removed in NetBSD 8? If not what do I need to
get it back. Also the apm api is needed for asbatt in pkgsrc can this be
made to work with newer versions?


envstat gives battery information for ACPI and others. Not sure what
asbatt is.  Is it really APM and not ACPI?




asbatt is a X11 battery monitir. I'm aware of envstat the old apm was much 
simpler. I've been working writing a replacement X battery monitor that 
uses the far more convoluted acpi api. APM wasmuch easier to deal with as 
it pretty much just returned a struct from it's ioctl.



[]-[]-[] SDF Public Access UNIX System
 |[]-[]-[]   http://sdf.org
 |rednight@};-


Re: /var on tmpfs

2018-11-16 Thread David Young
On Thu, Nov 15, 2018 at 10:28:56PM -0700, Don NetBSD wrote:
> I've a box with a DoM.  I'd like to mount / as ro and create a
> tmpfs for /var (and /tmp).  I don't think anything else NEEDS to
> be rw (the infrequent changes to /etc can be made by unlocking /
> to make those changes).
> 
> I imagine I can just make a tarball of a skeletal /var and
> unpack this over /var, once mounted?
> 
> Is there a preexisting mechanism for this sort of thing?
> Or, do I roll my own?

I have done this before.

I added an rc script for copying filesystems on non-volatile (NV)
storage to memory filesystems and then null-mount the memory
filesystems on top of the NV directories.  See attachment.

I added a line to /etc/fstab,

swap /mfs tmpfs rw,-s8M 0 0

I modified my rc.conf to 1) indicate that /etc, /var, temporary and
home directories should be on (ephemeral!) memory filesystems, and 2)
ensure that the prerequisite filesystems (/usr) were mounted before
mountcritmem ran.

# When /usr is on a different filesystem than /, I mount it
# before the memory filesystems so that pax can run programs
# from it.
#
critical_filesystems_beforemem="/usr"

# Do not mount /var, it's a memory fs. Superfluous, since NetBSD
# will not mount /var a second time, anyway.
#
# critical_filesystems_local=""

# Don't mount /usr, it comes with / on the CD-ROM.
#
critical_filesystems_remote=""

# Don't mount /usr, it comes with / on the CD-ROM.
#
critical_filesystems_memory="/etc /home /root /tmp /var"

If this works for you, too, maybe mountcritmem should go into the base
system.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981
#!/bin/sh
#
# $NetBSD$
# $Id: mountcritmem 4133 2006-08-26 06:10:29Z dyoung $
#

# PROVIDE: mountcritmem
# REQUIRE: root
# BEFORE: mountcritlocal

$_rc_subr_loaded . /etc/rc.subr

name="mountcritmem"
required_dirs="/mfs /permanent $critical_filesystems_memory"

for _d in $critical_filesystems_memory; do
d=${_d#/}
required_dirs="$required_dirs /permanent/$d"
done

start_cmd="mountcritmem_start"
stop_cmd="mountcritmem_stop"

#
# Example /etc/fstab
#
# /dev/wd0a / ffs ro 0 0
# swap /mfs mfs rw,-s=10880k,-i=256 0 0

abort_mountcritmem()
{
if [ "$autoboot" = yes ]; then
echo "ERROR: ABORTING BOOT (sending SIGTERM to parent)!"
kill -TERM $$
exit 1
fi
}

mountcritmem_start()
{
if [ "${critical_filesystems_memory:-}" = "" ]; then
return 0
fi

echo "Mounting critical memory filesystems"
_fs_list=
for _d in $critical_filesystems_memory; do
d=${_d#/}
_fs_list="$_fs_list $d"
done
for d in $_fs_list; do
if [ ! -d /permanent/$d ]; then
echo "ERROR: missing /permanent/$d"
abort_mountcritmem
return 1
fi
done

for d in $_fs_list; do
if ! mount /mfs; then
echo "ERROR: cannot mount /mfs"
abort_mountcritmem
return 1
fi
break
done

for d in $_fs_list; do
if ! mkdir /mfs/$d; then
echo "ERROR: cannot mkdir /mfs/$d"
abort_mountcritmem
return 1
fi
done

for d in $_fs_list; do
if ! mount -t null /$d /permanent/$d; then
echo "ERROR: cannot mount /permanent/$d"
abort_mountcritmem
return 1
fi
done

for d in $_fs_list; do
cd /permanent/$d
if ! mount -t null /mfs/$d /$d; then
echo "ERROR: cannot mount /mfs/$d"
abort_mountcritmem
return 1
fi
if ! pax -pe -rw . /$d ; then
echo "ERROR: cannot populate /mfs/$d"
abort_mountcritmem
return 1
fi
cd -
done
}

mountcritmem_stop()
{
if [ "${critical_filesystems_memory:-}" = "" ]; then
return 0
fi

_rev_fs_list=
for _d in $critical_filesystems_memory; do
d=${_d#/}
_rev_fs_list="$d $_rev_fs_list"
done
for d in $_rev_fs_list; do
umount /mfs/$d
umount /permanent/$d
done
for d in $_rev_fs_list; do
umount /mfs
break
done
}

load_rc_config $name
run_rc_command "$1"