mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Frank Wunderlich <frank-w@public-files.de>
To: Sascha Hauer <sha@pengutronix.de>
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>, barebox@lists.infradead.org
Subject: Aw: Re: Re: Re: Re: barebox extending boot-scripts
Date: Sat, 15 Jan 2022 14:47:42 +0100	[thread overview]
Message-ID: <trinity-dcf71a1e-4856-486b-a9a5-74ed6a82fd34-1642254462656@3c-app-gmx-bap71> (raw)
In-Reply-To: <20220110094214.GG6003@pengutronix.de>

Hi,

i have now created a new barebox board as copy from evb. i can load it from tftp with

bootm /mnt/tftp/barebox-rk3568-r2pro.img

i can create a bootmenu with entries of loader/entries and boot it:

boot -m sd.1

my bootscripts are also there, but they are not listed in $global.boot.default

$ grep defaultenv arch/arm/boards/bananapi-r2-pro/Makefile
bbenv-y += defaultenv-rk3568
$ grep defaultenv arch/arm/boards/bananapi-r2-pro/board.c
	defaultenv_append_directory(defaultenv_rk3568);
$ cat arch/arm/boards/bananapi-r2-pro/defaultenv-rk3568/nv/boot.default
net list-images mmc-linux tftp-linux

so it looks like the env is load, but the nv is not updated

regards Frank


> Gesendet: Montag, 10. Januar 2022 um 10:42 Uhr
> Von: "Sascha Hauer" <sha@pengutronix.de>
> An: "Frank Wunderlich" <frank-w@public-files.de>
> Cc: "Ahmad Fatoum" <a.fatoum@pengutronix.de>, barebox@lists.infradead.org
> Betreff: Re: Re: Re: Re: barebox extending boot-scripts
>
> On Fri, Jan 07, 2022 at 05:42:22PM +0100, Frank Wunderlich wrote:
> > Hi
> >
> > missed the defaultenv_append_directory(defaultenv_rk3568); in board-file...after adding that it seems to work
> >
> > > Gesendet: Freitag, 07. Januar 2022 um 14:07 Uhr
> > > Von: "Sascha Hauer" <sha@pengutronix.de>
> > >
> > > Yes. Furthermore you have to add to the board code:
> > >
> > > 	defaultenv_append_directory(defaultenv_rk3568);
> >
> > maybe this is the part i've missed. i thought it were 2 ways...either link via makefile or add to boards code
> >
> > > > > > > Boot scripts for publicly available evaluation kits are often not good candidates
> > > > > > > for upstreaming, because everybody using the EVKs has different thoughts on how to
> > > > > > > boot. The best way would be to use bootloader spec. It's one or more files you
> > > > > > > place at a known location that describe where your kernel and device tree are and
> > > > > > > what command line arguments to use and barebox can then automatically generate
> > > > > > > boot entries from all available bootloader spec files.
> > > >
> > > > is extlinux (i used in uboot and conf-file is already present) supported here?
> > > >
> > > > > > > See https://elinux.org/images/9/9d/Barebox-bells-n-whistles.pdf for an example
> > > > > > > of how to set this up. This is what I'd recommend instead of writing your own
> > > > > > > scripts.
> > > >
> > > > i do not fully understand the bootloader spec in the pdf as config file seems to be
> > > >
> > > > /mnt/mmc0.4/loader/entries/stm32mp157c-dk2.conf
> > > >
> > > > and then
> > > > boot -d mmc0.4
> > > >
> > > > is run...so the path (loader/entries) seems to be fixed and all files there will be processed (which order)?
> > >
> > > Yes. No particular order, I guess it would be the order it is on the
> > > filesystem.
> > >
> > > > how is root appended (/dev/mmcblkXpY|uuid|...) when linux-appendroot is set to true?
> > >
> > > When root is appended it is assumed to be the same fs that also has the
> > > bootloader spec file, so the rootfs also has the entry and the kernel.
> >
> > ok, then this is not usable for me, as i have a boot-partition
> > (bootloader+kernel+dtb) and separate rootfs-partition
> >
> > > > this is for testing multiple kernels with changing filenames (very
> > > > dynamic process, e.g. using 1 kernel binary with multiple dtb) and to
> > > > avoid adding a bootmenu entry everytime....this is not for end-user :)
> > >
> > > In that case you could also use bootm directly.
> >
> > yes but my approach is to list the available kernels before and ask to
> > enter the filename to not everytime look for correct commands ;)
> >
> > > > and here scripting is imho the best way...this allows me to add extra
> > > > params to cmdline too (like debug level,dumping offsets) without
> > > > changing a distroboot config
> > >
> > > Not sure if you know already, but barebox concatenates all variables in
> > > the "global.linux.bootargs." namespace to the kernel command line, so
> > > you can easily add or remove a variable to add/remove kernel options
> > > without affecting unrelated options.
> >
> > i know some options from documentation like this i've used to get a earlycon for tftp
> >
> > global linux.bootargs.debug="earlycon=uart8250,mmio32,0xfe660000 earlyprintk"
> >
> > > > for fixed kernels i have defined an extlinux.conf for uboot, but i'm
> > > > unsure if barebox can use this file too. have not found anything about
> > > > extlinux/syslinux in barebox yet.
> > >
> > > No, not yet.
> >
> > ok, i created a bootloader-config like described in the pdf:
> >
> > cat /mnt/sd.1/loader/entries/linux-gz.conf
> > title Linux GZip
> > version 5.16
> > options earlycon=uart8250,mmio32,0xfe660000 console=ttyS2,1500000n8
> > linux /extlinux/Image_5.16.gz
> > devicetree /extlinux/dtb_5.16
> > initrd /rootfs.cpio.lz4
> >
> > but on starting it is skipped due to devicetree mismatch
> >
> > boot -d sd.1
> > blspec: ignoring entry with incompatible devicetree "rockchip,rk3568-bpi-r2pro"
> > blspec: ignoring entry with incompatible devicetree "rockchip,rk3568-bpi-r2pro"
> > Nothing bootable found on 'sd.1'
> > Nothing bootable found
> >
> > in barebox i use the evb whereas in linux i already have a separate
> > dts. Can i override the compatible for the bootloader or do i need to
> > add my board (as copy of evb first)?
>
> You can overwrite the compatible using the of_property command. However,
> I really recommend to add a separate barebox board for your board.
> Sooner or later you'll have to do this anyway and it's the only way to
> properly add quirks for your board.

have now added a new barebox-board, and now this seems to work, but it's booting the first entry and do not display a menu of all configs in loader/entries, is this possible?

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2022-01-15 13:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 15:20 Frank Wunderlich
2022-01-05 16:07 ` Ahmad Fatoum
2022-01-05 18:13   ` Aw: " Frank Wunderlich
2022-01-06  8:08     ` Sascha Hauer
2022-01-06 12:41       ` Aw: " Frank Wunderlich
2022-01-07 13:07         ` Sascha Hauer
2022-01-07 16:42           ` Aw: " Frank Wunderlich
2022-01-10  9:42             ` Sascha Hauer
2022-01-15 13:47               ` Frank Wunderlich [this message]
2022-01-17  8:59                 ` Sascha Hauer
2022-01-29 10:40       ` Aw: " Frank Wunderlich
2022-01-31 11:03         ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-dcf71a1e-4856-486b-a9a5-74ed6a82fd34-1642254462656@3c-app-gmx-bap71 \
    --to=frank-w@public-files.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=sha@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox