Re: The root partition inside a slice.

2014-05-19 Thread Ilia Zykov
Hello.

Maybe, anybody can add to the boot.cfg(5) a one more sample.

menu=Boot from / on hd0e and /var on hd0a:rndseed /db/entropy-file;dev 
hd0e:; boot

Ilia.



Re: The root partition inside a slice.

2014-05-19 Thread Ilia Zykov
 
 You can also specify a disklabel partition prefix in the rndseed file
 specification. So, in your case this might also work:
 
   menu=Boot from / on hd0e and /var on hd0a:rndseed
 hd0a:/db/entropy-file;dev hd0e:;boot
 
 Also, I noticed that there is a space before 'boot' in your case. IIRC,
 that caused me boot issues in the past.
 
 Cheers,
 Toby
 

Thanks.




Re: The root partition inside a slice.

2014-05-19 Thread Toby Karyadi

On 2014-05-19 09:59, Ilia Zykov wrote:

Hello.

Maybe, anybody can add to the boot.cfg(5) a one more sample.

menu=Boot from / on hd0e and /var on hd0a:rndseed
/db/entropy-file;dev hd0e:; boot

Ilia.


You can also specify a disklabel partition prefix in the rndseed file 
specification. So, in your case this might also work:


  menu=Boot from / on hd0e and /var on hd0a:rndseed 
hd0a:/db/entropy-file;dev hd0e:;boot


Also, I noticed that there is a space before 'boot' in your case. IIRC, 
that caused me boot issues in the past.


Cheers,
Toby



The root partition inside a slice.

2014-05-16 Thread Ilia Zykov
Hello.
Tell me please.
Why now NetBSD can has the root partition only on beginning of a slice?
For instance: 
boot hd0e:netbsd can't find the root if the hd0e is inside a slice and
hasn't a dos partition twin.
For effectively and flexibility it's not handy.
Perfunctory the code inspection has given only this, but
I am sure it is not really reason.
Maybe it is a issue inside the wedges' code or it is must be so.

init_main.c
static void
rootconf_handle_wedges(void)
{
...
dev = dkwedge_find_partition(dev, startblk, nblks);
if (dev != NULL) {
booted_device = dev;
booted_partition = 0;
}
...
}

P.S.
I don't mean the bootloader.
Bootloader must be on the first(beginning of a slice) partition.

Thank you.
Ilia.


Re: The root partition inside a slice.

2014-05-16 Thread Martin Husemann
On Fri, May 16, 2014 at 02:21:39PM +0400, Ilia Zykov wrote:
 Why now NetBSD can has the root partition only on beginning of a slice?
 For instance: 
 boot hd0e:netbsd can't find the root if the hd0e is inside a slice and
 hasn't a dos partition twin.

I don't quite understand - please give us a bit more information.

The boot process and partition rules are a bit different between 
architectures, so let us start with the machine you are using - probably
i386 or amd64?

Since you talked about DOS partitions, you are not using GPT, I presume.

Please show the output of fdisk and disklabel for the disk you are
booting from, and also (assuming some x86 machine) of sysctl machdep.diskinfo.

   dev = dkwedge_find_partition(dev, startblk, nblks);
   if (dev != NULL) {
   booted_device = dev;
   booted_partition = 0;
   }

This is only a fallback if the wedge does not match anything, should not
happen with bootable disks and wedge autoconfiguration.

Martin


Re: The root partition inside a slice.

2014-05-16 Thread Ilia Zykov

 boot hd0e:netbsd can't find the root if the hd0e is inside a slice and
 hasn't a dos partition twin.
 I mean the GENERIC kernel.
A config's option(config netbsd root on wd0e type ffs) works normal.




Re: The root partition inside a slice.

2014-05-16 Thread Izumi Tsutsui
 Why now NetBSD can has the root partition only on beginning of a slice?
 For instance: 
 boot hd0e:netbsd can't find the root if the hd0e is inside a slice and
 hasn't a dos partition twin.

Which NetBSD version?

NetBSD x86 6.1.4 can't handle it and you need the following change
(which I'm using for my custom 6.1.4 amd64 kernel):
http://www.nerv.org/~ryo/netbsd/netbsd/?q=id:20130428T143256Z.b623c8487cf2235d829e0daff70cca59b1b79df8

6.2 will include this fix.

---
Izumi Tsutsui


Re: The root partition inside a slice.

2014-05-16 Thread Ilia Zykov

 
 NetBSD x86 6.1.4 can't handle it and you need the following change
 (which I'm using for my custom 6.1.4 amd64 kernel):
 http://www.nerv.org/~ryo/netbsd/netbsd/?q=id:20130428T143256Z.b623c8487cf2235d829e0daff70cca59b1b79df8
 
 6.2 will include this fix.
 
 ---
 Izumi Tsutsui
 

I will be trying this.
Thank you.





Re: The root partition inside a slice.

2014-05-16 Thread Ilia Zykov
 
 NetBSD x86 6.1.4 can't handle it and you need the following change
 (which I'm using for my custom 6.1.4 amd64 kernel):
 http://www.nerv.org/~ryo/netbsd/netbsd/?q=id:20130428T143256Z.b623c8487cf2235d829e0daff70cca59b1b79df8
 
 6.2 will include this fix.
 

I have tried the current(69940) i386 kernel.
It's not helped.
I have the root partition on ld0e and bootloader on ld0a.
See the attachment hd0e_root_4.PNG.
I have got this info with the help of boot.iso after:

mount /dev/ld0e /mnt
mount /dev/ld0a /mnt/var
chroot /mnt




Re: The root partition inside a slice.

2014-05-16 Thread Izumi Tsutsui
 I have tried the current(69940) i386 kernel.
 It's not helped.
 I have the root partition on ld0e and bootloader on ld0a.

Can you also show your boot.cfg?
Does it have rndseed /var/db/entropy-file; boot hd0e:netbsd ?
If so, probably you have to remove rndseed command from it.

IIRC, the current x86 bootloader has a bug:
 - rndseed (and modules) always tries to open the partition a
 - once the partition a is opened the bootloader sets it as a root partition
   into bootinfo even if it isn't opened for loading a kernel
http://nxr.netbsd.org/xref/src/sys/arch/i386/stand/lib/biosdisk.c?r=1.43#781

---
Izumi Tsutsui