Patch for install64.octeon : EdgeRouter 6 info

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch for install64.octeon : EdgeRouter 6 info

Chris McGee
Hi:

  I would like to add some info for Edgerouter 6
(and presumably ER4, and maybe also ER12?) to install64.octeon.
The document is great but it won't get a new user booting on the new
4-core machines with MMC drives.

I tried to make it as brief as possible while pointing the user in the right
direction, so for example it mentions that you're going to need to drop
bsd.mp into the msdos kernel loader partition but doesn't explain how
to do that. Seemed to be the right level of detail for this document.

Here is a diff with my additions. Diff is from
/OpenBSD/6.4/INSTALL.octeon.

me@box> diff INSTALL.octeon INSTALL.octeon.er6
690a691,692
> For the EdgeRouter Lite:
>
702a705,710
> For the EdgeRouter 6, installing to the internal MMC drive:
>
>       # setenv bootcmd 'fatload mmc 0 ${loadaddr} bsd;bootoctlinux coremask=0xf rootdev=/dev/sd0'
>       # setenv bootdelay 5
>       # saveenv
>
707c715
< On multi-core systems, the numcores parameter enables the secondary CPUs.
---
> On multi-core systems, the numcores parameter enables multiple cores.
708a717,719
> Note that this boot command does not actually put a multiprocessor kernel in
> place; you will also need to copy the bsd.mp kernel to the octeon MS-DOS
> partition (disklabel i by default) on your boot drive for multicore support.
709a721
> Example booting from USB on the Edgerouter Lite:
711a724,726
> Example booting from USB on the EdgeRouter 6:
>   fatload usb 0 ${loadaddr} bsd; bootoctlinux rootdev=sd0 numcores=4
>
716a732,736
> If you installed from a USB stick to the MMC on an EdgeRouter 4/6/8:
> The machine assigns sd0 to USB first if present, then to MMC if present.
> If you leave the USB install stick in, the machine will try to boot it.
> Removing the USB device will cause sd0 to be assigned to mmc0 next boot,
> allowing the machine to boot your newly-installed OpenBSD drive.

Reply | Threaded
Open this post in threaded view
|

Re: Patch for install64.octeon : EdgeRouter 6 info

Stefan Sperling-5
On Mon, Dec 17, 2018 at 11:22:40PM -0500, Chris McGee wrote:
> so for example it mentions that you're going to need to drop
> bsd.mp into the msdos kernel loader partition but doesn't explain how
> to do that. Seemed to be the right level of detail for this document.

The installer is supposed to put the right kernel on the FAT partition,
isn't it? If that doesn't work on these machines the install script
should be fixed. I don't see harm in updating the docs but we shouldn't
be documenting broken behaviour.

> me@box> diff INSTALL.octeon INSTALL.octeon.er6
> 690a691,692
> > For the EdgeRouter Lite:

Please send patches in unidiff format (diff -u)

Reply | Threaded
Open this post in threaded view
|

Re: Patch for install64.octeon : EdgeRouter 6 info

Visa Hankala-2
In reply to this post by Chris McGee
On Mon, Dec 17, 2018 at 11:22:40PM -0500, Chris McGee wrote:

> Hi:
>
>   I would like to add some info for Edgerouter 6
> (and presumably ER4, and maybe also ER12?) to install64.octeon.
> The document is great but it won't get a new user booting on the new
> 4-core machines with MMC drives.
>
> I tried to make it as brief as possible while pointing the user in the right
> direction, so for example it mentions that you're going to need to drop
> bsd.mp into the msdos kernel loader partition but doesn't explain how
> to do that. Seemed to be the right level of detail for this document.
>
> Here is a diff with my additions. Diff is from
> /OpenBSD/6.4/INSTALL.octeon.
>
> me@box> diff INSTALL.octeon INSTALL.octeon.er6
> 690a691,692
> > For the EdgeRouter Lite:
> >
> 702a705,710
> > For the EdgeRouter 6, installing to the internal MMC drive:
> >
> >       # setenv bootcmd 'fatload mmc 0 ${loadaddr} bsd;bootoctlinux coremask=0xf rootdev=/dev/sd0'
> >       # setenv bootdelay 5
> >       # saveenv
> >
> 707c715
> < On multi-core systems, the numcores parameter enables the secondary CPUs.
> ---
> > On multi-core systems, the numcores parameter enables multiple cores.
> 708a717,719
> > Note that this boot command does not actually put a multiprocessor kernel in
> > place; you will also need to copy the bsd.mp kernel to the octeon MS-DOS
> > partition (disklabel i by default) on your boot drive for multicore support.
> 709a721
> > Example booting from USB on the Edgerouter Lite:
> 711a724,726
> > Example booting from USB on the EdgeRouter 6:
> >   fatload usb 0 ${loadaddr} bsd; bootoctlinux rootdev=sd0 numcores=4
> >
> 716a732,736
> > If you installed from a USB stick to the MMC on an EdgeRouter 4/6/8:
> > The machine assigns sd0 to USB first if present, then to MMC if present.
> > If you leave the USB install stick in, the machine will try to boot it.
> > Removing the USB device will cause sd0 to be assigned to mmc0 next boot,
> > allowing the machine to boot your newly-installed OpenBSD drive.

Good points. However, I would like to keep the text general and avoid
listing machine specifics if possible. Does the patch below make the
text any clearer?

In principle, the installer could show an example bootoctlinux command
with the correct parameters for the system.

Future snapshots built after today should handle the copying of bsd.mp
automatically.

Index: notes/octeon/install
===================================================================
RCS file: src/distrib/notes/octeon/install,v
retrieving revision 1.16
diff -u -p -r1.16 install
--- notes/octeon/install 30 Nov 2017 15:25:37 -0000 1.16
+++ notes/octeon/install 18 Dec 2018 16:21:22 -0000
@@ -56,8 +56,8 @@ restore it later if needed:
 
 ${bootcmd} is run by U-Boot when ${autoload} is enabled. Now create a new
 ${bootcmd} which will load an ELF file called 'bsd' from the first active FAT
-partition on the first CF card or USB device. The FAT partition has been created
-by the installer.
+partition on the first CF card. The FAT partition has been created by the
+installer.
 
  # setenv bootcmd 'fatload ide 0:1 ${loadaddr} bsd;bootoctlinux rootdev=/dev/octcf0'
  # setenv bootdelay 5
@@ -71,9 +71,19 @@ by the installer.
  Protected 1 sectors
  #
 
-If you have installed onto USB use the following bootcmd instead:
+If you have installed onto eMMC, SATA or USB, use the following
+bootcmd instead:
 
-  fatload usb 0 ${loadaddr} bsd; bootoctlinux rootdev=sd0
+  fatload <bootdev> 0 ${loadaddr} bsd; bootoctlinux rootdev=sd0
+
+where you replace ``<bootdev>'' with ``mmc'', ``sata'' or ``usb''.
+
+For stable root disk selection, you can specify the disk
+by disklabel(8) UID (DUID):
+
+  fatload usb 0 ${loadaddr} bsd; bootoctlinux rootdev=<duid>
+
+where ``<duid>'' is the DUID of your root disk.
 
 On multi-core systems, the numcores parameter enables the secondary CPUs.
 Use the total number of cores on your system as the value of the parameter.

Reply | Threaded
Open this post in threaded view
|

Re: Patch for install64.octeon : EdgeRouter 6 info

Chris McGee
That looks much better to me, though it does get machine-specific

I feel like it would be more clear if the examples uniformly used your
new variable
convention, as some do and some do not. This allows us to eliminate one example
too. (I assume the ER Lite does OK if you specify numcores=1 ? )

I left in the ER Lite machine-specific example about resetting the USB
controller.
I only booted my new ER6 from USB a few times before switching to MMC,
but it did not seem to have any issues detecting the USB controller or devices.
(It WAS picky about what USB sticks it would work correctly with.)

This is a diff from -current's /usr/src/distrib/notes/octeon/install

me@box> diff -u install install.ori
--- install     Thu Dec 20 19:17:00 2018
+++ install.ori Thu Dec 20 19:04:07 2018
@@ -56,8 +56,8 @@

 ${bootcmd} is run by U-Boot when ${autoload} is enabled. Now create a new
 ${bootcmd} which will load an ELF file called 'bsd' from the first active FAT
-partition on the first CF card. The FAT partition has been created by the
-installer.
+partition on the first CF card or USB device. The FAT partition has
been created
+by the installer.

        # setenv bootcmd 'fatload ide 0:1 ${loadaddr} bsd;bootoctlinux
rootdev=/dev/octcf0'
        # setenv bootdelay 5
@@ -71,24 +71,19 @@
        Protected 1 sectors
        #

-In the following bootcmd examples, replace:
-<duid> with the disklabel(8) UID (DUID) of your root disk.
-<bootdev> with ``mmc'', ``sata'' or ``usb'' as appropriate.
-<nc> with the number of CPU cores your machine has.
+If you have installed onto USB use the following bootcmd instead:

-If you have installed onto eMMC, SATA or USB, use the following
-bootcmd instead:
+  fatload usb 0 ${loadaddr} bsd; bootoctlinux rootdev=sd0

-  fatload <bootdev> 0 ${loadaddr} bsd; bootoctlinux rootdev=sd0 numcores=<nc>
+On multi-core systems, the numcores parameter enables the secondary CPUs.
+Use the total number of cores on your system as the value of the parameter.

-For stable root disk selection, you can specify the disk by disklabel(8) UID:
+  fatload usb 0 ${loadaddr} bsd; bootoctlinux rootdev=sd0 numcores=2

-  fatload <bootdev> 0 ${loadaddr} bsd; bootoctlinux rootdev=<duid>
numcores=<nc>
-
 On the EdgeRouter Lite, bootcmd may also reset the USB controller for
 more reliable USB device detection:

-  usb reset; fatload usb 0 ${loadaddr} bsd; bootoctlinux rootdev=sd0
numcores=<nc>
+  usb reset; fatload usb 0 ${loadaddr} bsd; bootoctlinux rootdev=sd0 numcores=2

 OpenBSDCongratulations







On Tue, Dec 18, 2018 at 11:40 AM Visa Hankala <[hidden email]> wrote:

>
> On Mon, Dec 17, 2018 at 11:22:40PM -0500, Chris McGee wrote:
> > Hi:
> >
> >   I would like to add some info for Edgerouter 6
> > (and presumably ER4, and maybe also ER12?) to install64.octeon.
> > The document is great but it won't get a new user booting on the new
> > 4-core machines with MMC drives.
> >
> > I tried to make it as brief as possible while pointing the user in the right
> > direction, so for example it mentions that you're going to need to drop
> > bsd.mp into the msdos kernel loader partition but doesn't explain how
> > to do that. Seemed to be the right level of detail for this document.
> >
> > Here is a diff with my additions. Diff is from
> > /OpenBSD/6.4/INSTALL.octeon.
> >
> > me@box> diff INSTALL.octeon INSTALL.octeon.er6
> > 690a691,692
> > > For the EdgeRouter Lite:
> > >
> > 702a705,710
> > > For the EdgeRouter 6, installing to the internal MMC drive:
> > >
> > >       # setenv bootcmd 'fatload mmc 0 ${loadaddr} bsd;bootoctlinux coremask=0xf rootdev=/dev/sd0'
> > >       # setenv bootdelay 5
> > >       # saveenv
> > >
> > 707c715
> > < On multi-core systems, the numcores parameter enables the secondary CPUs.
> > ---
> > > On multi-core systems, the numcores parameter enables multiple cores.
> > 708a717,719
> > > Note that this boot command does not actually put a multiprocessor kernel in
> > > place; you will also need to copy the bsd.mp kernel to the octeon MS-DOS
> > > partition (disklabel i by default) on your boot drive for multicore support.
> > 709a721
> > > Example booting from USB on the Edgerouter Lite:
> > 711a724,726
> > > Example booting from USB on the EdgeRouter 6:
> > >   fatload usb 0 ${loadaddr} bsd; bootoctlinux rootdev=sd0 numcores=4
> > >
> > 716a732,736
> > > If you installed from a USB stick to the MMC on an EdgeRouter 4/6/8:
> > > The machine assigns sd0 to USB first if present, then to MMC if present.
> > > If you leave the USB install stick in, the machine will try to boot it.
> > > Removing the USB device will cause sd0 to be assigned to mmc0 next boot,
> > > allowing the machine to boot your newly-installed OpenBSD drive.
>
> Good points. However, I would like to keep the text general and avoid
> listing machine specifics if possible. Does the patch below make the
> text any clearer?
>
> In principle, the installer could show an example bootoctlinux command
> with the correct parameters for the system.
>
> Future snapshots built after today should handle the copying of bsd.mp
> automatically.
>
> Index: notes/octeon/install
> ===================================================================
> RCS file: src/distrib/notes/octeon/install,v
> retrieving revision 1.16
> diff -u -p -r1.16 install
> --- notes/octeon/install        30 Nov 2017 15:25:37 -0000      1.16
> +++ notes/octeon/install        18 Dec 2018 16:21:22 -0000
> @@ -56,8 +56,8 @@ restore it later if needed:
>
>  ${bootcmd} is run by U-Boot when ${autoload} is enabled. Now create a new
>  ${bootcmd} which will load an ELF file called 'bsd' from the first active FAT
> -partition on the first CF card or USB device. The FAT partition has been created
> -by the installer.
> +partition on the first CF card. The FAT partition has been created by the
> +installer.
>
>         # setenv bootcmd 'fatload ide 0:1 ${loadaddr} bsd;bootoctlinux rootdev=/dev/octcf0'
>         # setenv bootdelay 5
> @@ -71,9 +71,19 @@ by the installer.
>         Protected 1 sectors
>         #
>
> -If you have installed onto USB use the following bootcmd instead:
> +If you have installed onto eMMC, SATA or USB, use the following
> +bootcmd instead:
>
> -  fatload usb 0 ${loadaddr} bsd; bootoctlinux rootdev=sd0
> +  fatload <bootdev> 0 ${loadaddr} bsd; bootoctlinux rootdev=sd0
> +
> +where you replace ``<bootdev>'' with ``mmc'', ``sata'' or ``usb''.
> +
> +For stable root disk selection, you can specify the disk
> +by disklabel(8) UID (DUID):
> +
> +  fatload usb 0 ${loadaddr} bsd; bootoctlinux rootdev=<duid>
> +
> +where ``<duid>'' is the DUID of your root disk.
>
>  On multi-core systems, the numcores parameter enables the secondary CPUs.
>  Use the total number of cores on your system as the value of the parameter.

Reply | Threaded
Open this post in threaded view
|

Re: Patch for install64.octeon : EdgeRouter 6 info

Janne Johansson-3
Den fre 21 dec. 2018 kl 01:40 skrev Chris McGee <[hidden email]>:
>
> I feel like it would be more clear if the examples uniformly used your
> new variable
> convention, as some do and some do not. This allows us to eliminate one example
> too. (I assume the ER Lite does OK if you specify numcores=1 ? )

"does ok" == runs only on one core, but runs.

--
May the most significant bit of your life be positive.

Reply | Threaded
Open this post in threaded view
|

Re: Patch for install64.octeon : EdgeRouter 6 info

Visa Hankala-2
In reply to this post by Chris McGee
On Thu, Dec 20, 2018 at 07:39:44PM -0500, Chris McGee wrote:

> That looks much better to me, though it does get machine-specific
>
> I feel like it would be more clear if the examples uniformly used your
> new variable
> convention, as some do and some do not. This allows us to eliminate one example
> too. (I assume the ER Lite does OK if you specify numcores=1 ? )
>
> I left in the ER Lite machine-specific example about resetting the USB
> controller.
> I only booted my new ER6 from USB a few times before switching to MMC,
> but it did not seem to have any issues detecting the USB controller or devices.
> (It WAS picky about what USB sticks it would work correctly with.)
>
> This is a diff from -current's /usr/src/distrib/notes/octeon/install
>
> me@box> diff -u install install.ori

Please use cvs to generate diffs, so that the output would be applicable
to the source code tree in the version control system.

I have committed an adapted version of the patch.