Alexander Hall wrote:
Jean-Yves Boisiaud wrote:
Hello,

I'm using OpenBSD with a Soekris NET4801.
To make my job easy and more secure to upgrade software,

I have several targets to keep up to date. All partitions are always
read only.

I prepare an image for all of them, and send the new images to the targets.

Then, the target replaces the image of its inactive partition with dd.
When dd is done, the boot process is updated to run the other partition
on the next reboot. Lastly, the target reboots and the inactive
partition becomes the active one.

It is safer because the active partition is never modified during the
upgrade process. So if power goes down, only the upgrade process fails.
Active partition is still in good condition.

I though this process was ok because in the manual page of boot(8) it is
said :

5.   If the file /etc/boot.conf exists on the filesystem boot was loaded
     from, open and parse it.  This file may contain any commands boot
     accepts at the interactive prompt.  Though default settings usually
     suffice, they can be changed here.

If think that boot do not read /etc/boot.conf :

boot> set

OpenBSD/i386 BOOT 3.01

addr     0x0

howto

device   hd0a
tty      pc0

image    /bsd

timeout  0


boot> stty

pc0 speed is 9600

And /etc/boot.conf contains :

set tty com0
stty com0 19200
set timeout 5
set device hd0b
set image /bsd

To be sure, I ran :

# dd if=/dev/zero of=/dev/sd0a

(sd0a because the host compact flash reader is an USB one)

And sd0b desapears...

And when I boot the CF with the Soekris I had the message :
No O/S...

Not even the sequence :

Loading...
probing: pc0 com0 com1 pci mem[639K 127M a20=on]

disk: hd0+

OpenBSD/i386 BOOT 3.01

I would like to have 2 root partitions on the label, one is active at a time and the other will filled with the upgrade by dd.

I do not get how this would make anything easier or safer, but...

I compiled a kernel with, in NET4801 config file, the line :
  config          bsd     swap generic

I installed all my system in partition wd0b. Partition wd0a contains an empty formated UFS partition.

I change the /etc/boot.conf, which now is :
  set tty com0
  stty com0 19200
  set timeout 5
  boot hd0b:/bsd

When I boot the Soekris, the boot loader is found, and I have the following message :

booting hd0a:/bsd: open hd0a:/bsd: No such file or directory
 failed(2). will try /bsd

If I type hd0b:/bsd, the kernel is found and the kernel boot is ok.

How could I resolve my problem ?

Thanks for your help.

The boot loader won't find your /etc/boot.conf at wd0b (searches at wd0a, if I read boot.c, ..., dev_i386.c correctly).

I guess you could patch it, but I'd say you are creating a monster.

I still do not get the point of this exercise, but could not wd0a be the default boot device and wd0b the alternative?

/Alexander

Reply via email to