Tartarus changed the topic of #u-boot to: SOURCE MOVED TO https://source.denx.de/u-boot/u-boot.git / U-Boot v2021.07 is OUT / Merge Window is OPEN until 26 July 2021 / Release v2021.10 is scheduled for 04 October 2021 / http://www.denx.de/wiki/U-Boot / Channel archives at https://libera.irclog.whitequark.org/u-boot
maxs has quit [Ping timeout: 246 seconds]
mmu_man has quit [Ping timeout: 245 seconds]
LeSpocky_ has joined #u-boot
LeSpocky has quit [Ping timeout: 248 seconds]
akaWolf has quit [Ping timeout: 248 seconds]
<sjg1> Tartarus: Thanks very much. I'll start with fedora which seems to work OK
<sjg1> Tartarus: I'm fiddling with the bootmethod/bootflow stuff and trying to hook it to distroboot as a starting point
birkoff has joined #u-boot
birkoff has quit [Changing host]
birkoff has joined #u-boot
akaWolf has joined #u-boot
sbach has quit [Read error: Connection reset by peer]
sbach has joined #u-boot
agust has joined #u-boot
alpernebbi has joined #u-boot
<milkylainen_> sjg1: But if I interpreted xypron right, it won't matter if im running in application or payload mode since BLOCK_IO isn't implemented at all? I'm sorry. But I'm rather confused about what works when and how.
indiana-bones has joined #u-boot
redbrain has joined #u-boot
gsz has joined #u-boot
maxs has joined #u-boot
mmu_man has joined #u-boot
akaWolf has quit [Ping timeout: 248 seconds]
akaWolf has joined #u-boot
jwillikers has joined #u-boot
indiana-bones has quit [Quit: Leaving]
gsz has quit [Ping timeout: 268 seconds]
gsz has joined #u-boot
maxs has quit [Quit: Client closed]
<sjg1> milkylainen_: Yes that sounds right. I'm a bit confused too. The EFI payload turns off EFI services before jumping to U-Boot, so you need U-Boot drivers for all block devices. See efi_main() in efi_stub.c
<sjg1> milkylainen_: I suppose we could delay disabling boot services until later, so that a block driver could work
<milkylainen_> But what would be the differences if I ran u-boot in app mode?
<milkylainen_> For U-boot that is.
<sjg1> milkylainen_: Well in app mode it doesn't turn off boot services, so you could write a block driver
<milkylainen_> Downsides of running in app mode?
<sjg1> milkylainen_: You can't really take over the machine, since EFI is still there. Also U-Boot returns to EFI later. It is just an app that runs and then returns
<sjg1> milkylainen_: I suppose it would be possible to boot a kernel from the app, since grub does it. I'm not sure what that would entail though
<sjg1> milkylainen_: So maybe the stub is the easiest way
<milkylainen_> So you can't turn off EFI from inside APP mode?
<sjg1> milkylainen_: Search for efi_get_sys_table() to find drivers that use EFI...there is only serial
<sjg1> milkylainen_: Well you could, but we are blurring the line between stub and app here
<milkylainen_> sjg1: Does it matter to the user? Why would you run u-boot as an app and return to EFI? Isn't the purpose always to boot something else?
<sjg1> I think updating the stub makes more sense if you are trying to do everything in U-Boot. If you want to write another version of grub :-) then perhaps the app
<sjg1> milkylainen_: The app is mostly for testing. It might be worth experimenting with the stub to see where you get to
<sjg1> or the app
<milkylainen_> Mmm.
<milkylainen_> I think it would be a boon to have EFI services available. That way U-boot could cover more hardware solutions without native drivers.
<milkylainen_> Like my ACPI eMMC controller.
<sjg1> milkylainen_: Sounds reasonable to me. But I wonder why your controller doesn't work?
<milkylainen_> sjg1: Does U-boot know anything about acpi-presented devices?
<sjg1> milkylainen_: Not at present. It generates ACPI tables but SFAIK doesn't parse them
<sjg1> As a workaround you could add the info statically to the U-Boot devicetree
<milkylainen_> sjg1: hmm?
<milkylainen_> Who would pick that up?
<sjg1> I mean put it in the payload .dts file and see if the driver will come up
<sjg1> milkylainen_: ^
gsz has quit [Ping timeout: 248 seconds]
<sjg1> milkylainen_: Re using EFI block devices, I thought that was supported and have a project that could perhaps use it, so I may take a look. Need to finish the v1 bootflow stuff first though
redbrain has quit [Ping timeout: 248 seconds]
Danilo82 has joined #u-boot
<Danilo82> hello can someone help me make a cript to boot uboot into a shell?
<Danilo82> i got the idea right but there is something about a 24 bits footer crc32 things that i just don't understand
gsz has joined #u-boot
<marex> Danilo82: like setenv bootdelay -1 ; saveenv ?
<marex> or just hold spacebar on boot ?
<Danilo82> i got a little linux box fot hdtv conversor, i found out it is using a uboot script to update the system, the script can be set to do anything, my idea is to tell the script to set /bin/sh as the init, the problem i have noticed with some help is that it check the crc of the file
<Danilo82> i don't know how to work this crc32 stuff
<Danilo82> and its mstar, fork of uboot
<marex> look at mkimage -T script then
<marex> that generates you the uImage header around a text script and spits out the boot.scr or whatever you need
<Danilo82> so i just make the script and the mkimage will do the thing?
<marex> Danilo82: sounds about right
<Danilo82> what mkimage are you talking about?
<marex> Danilo82: the one in u-boot source /tools dir
<marex> or u-boot-tools package in debian
<marex> u-boot-tools: /usr/bin/mkimage
<marex> u-boot-tools: /usr/share/man/man1/mkimage.1.gz
<marex> other distros have it packaged too I'm sure
<Danilo82> its a mips cpu do i have to specify it?
<marex> probably you need to use some mkimage -T script -C none -A mips ... I guess
<marex> doc/board/emulation/qemu-x86.rst: mkimage -T script -C none -n "Boot script" -d boot.txt /boot/boot.scr
<Danilo82> at -T do i write the commands i want it to execute or a text file?
<marex> the -T is type (see mkimage --help) , -T script == type script
<Danilo82> so, -d is where i set the script right?
<Danilo82> no
<marex> -T=type -C=compression -n=name -d=datafile
<marex> see above ... boot.txt is the input, boot.scr is the output
<marex> you might also need -A mips (maybe, probably)
<Danilo82> does the script needs to end with a %?
<marex> Danilo82: why % ?
<marex> Danilo82: the script is just a list of u-boot environment entries, i.e. key=value pairs
<marex> like
<Danilo82> this is the last line of the original script "% <- this is end of script symbol"
<marex> bootcmd=hello world
<marex> foo=bar baz
<marex> Danilo82: uh ... the input script is just ^ that, like of key=value pairs, so no
<milkylainen_> sjg1: Ack. Would be real nice. Will gladly test / help out if you come around to start looking at it.
<Danilo82> not quite what i need
<Danilo82> or maybe i'm doing it wrong
<marex> Danilo82: do you know in which context that script is executed ? Can you dump the entire u-boot environment ?
<marex> Danilo82: I guess you can have your script do "printenv" and see what comes out of it
<marex> Danilo82: oh wait, you want the script to patch bootargs only ?
<Danilo82> no
<Danilo82> let me show you
<marex> that's probably better, yeah
<Danilo82> this is the original script
<Danilo82> at the top of the firmware file
<Danilo82> i want to make a cript like that but to tell Mstar/uboot to send me to a shell
<marex> setenv bootargs quiet console=ttyS0,115200 $(MS_RFS) $(MS_MEM) $(mtdparts) norandmaps SAR5=ON #set_config_rescue
<marex> that ^ is what you want to change
<marex> bootargs is the value that is passed to the kernel as kernel command line, see cat /proc/cmdline in running Linux system, it should match that
<marex> so add init=/bin/sh rdinit=/bin/sh there (rdinit is for ramdisk, in case you use that)
<Danilo82> but i need to change everything, i don't want to run anything else
<marex> Danilo82: then make it a two-line script, one line is setenv bootargs ... , the other would be 'run bootcmd' (to start the boot process)
<Danilo82> i want to make a bin file or something to tell mstar/uboot to boot into a shell, the problem is that the boot verifies the crc32
<Danilo82> i really don't know how this works
<marex> Danilo82: that is where the mkimage comes into play
<Danilo82> so i make a text file with the commands i need and mkimage will do it?
<marex> yep
<marex> mkimage will add that header with crc32 and stuff
alpernebbi has quit [Quit: alpernebbi]
<Danilo82> this then?
<marex> Danilo82: yes, looks OKish, try it
<Danilo82> ok are there any other tricks i should try? you mentioned booting uboot holding the space key
<marex> if you have serial console access, press key to drop into u-boot shell and test your stuff there
<Danilo82> serial console? you mean the 6 pins thing?
<marex> yes, of which you need only three, RX/TX/GND
<Danilo82> ah yeah, i don't have the tools yet, so i'm trying to find any other breach
<Danilo82> is there any way to make a diy seria cosole?
<Danilo82> :')
<marex> buying the right cable might be eaiser
<marex> *easier
<Danilo82> yeah the image failed, not sure what went wrong, is there any way to make the script output a file or something to debug the problem?
<marex> (sure, you can build one, search engine is your friend)
<marex> Danilo82: echo "hello"
<marex> that prints on u-boot console
<marex> and really, check the u-boot console, it will tell you what's going on
<Danilo82> i can't get on the console yet, my plan is to lie to the update tool to be trown into a console
<Danilo82> a script might be able to do it
<Danilo82> because the firmware tool is just a uboot script
<marex> Danilo82: well ... the update tool does set bootargs, so why dont you start with that ?
<marex> Danilo82: patch the bootargs in the updater script, add that init=/bin/sh rdinit=/bin/sh and see if that drops you into Linux console
<marex> it should
<Danilo82> i don't know how to do that
<marex> Danilo82: edit the script, add those two bits to the end of bootargs line, then run mkimage on the script
<Danilo82> it isn't a script
<Danilo82> its the head of the file
<Danilo82> this is the original firmware
<marex> Danilo82: https://source.denx.de/u-boot/u-boot/-/blob/master/include/image.h#L321 that's how the script header looks like, no ?
<Danilo82> run "head -n 126 MstarUpgrade.bin"
<Danilo82> in the MstarUpgrade.bin file
<marex> Danilo82: can you pastebin the output of some hexdump -vC upgrade.bin | head -n 50 or so ?
<marex> its probably gonna be faster
<marex> Danilo82: so where is that crc32 ?
<Danilo82> at the last 24 bits of the file
<marex> hmmm, that might be some non-standard script format, maybe for some downstream u-boot fork
<marex> crc32 is 32bits btw
<marex> you can always try to strip the last four bytes of the script, run 'crc32' from linux command line on the result and see if it matches that crc32 that was in the script
<Danilo82> yeah its a u-boot fork
<marex> if so, you know how to recalculate that crc and generate custom script
jwillikers has quit [Remote host closed the connection]
<milkylainen_> You don't need arch for a script. Afaik.
<marex> milkylainen_: I am not entirely sure, the arch value is encoded in the script header after all
<Danilo82> i guess so
<Danilo82> i'll try to make a diy connection to the seria port by hand
<Danilo82> will take 3 months to get here if i buy the tools
<Danilo82> but damn, this looks so possible, i just don't know what is going on
redbrain has joined #u-boot
<marex> well, if you had serial console, that would tell you what is going on
<marex> that is the easiest option
smurray has quit [Ping timeout: 245 seconds]
iopaniuk has quit [Ping timeout: 240 seconds]
ldts has quit [Read error: Connection reset by peer]
sjg1 has quit [Ping timeout: 258 seconds]
dgilmore has quit [Read error: Connection reset by peer]
lvrp16 has quit [Read error: Connection reset by peer]
behanw has quit [Ping timeout: 258 seconds]
ezequielg has quit [Ping timeout: 276 seconds]
mithro has quit [Read error: Connection reset by peer]
paulbarker has quit [Ping timeout: 258 seconds]
NishanthMenon_ has quit [Ping timeout: 240 seconds]
ccaione has quit [Ping timeout: 240 seconds]
robher has quit [Ping timeout: 276 seconds]
Crofton has quit [Ping timeout: 240 seconds]
elvishjerricco has quit [Read error: Connection reset by peer]
Tartarus has quit [Ping timeout: 256 seconds]
vigneshr has quit [Ping timeout: 240 seconds]
robher has joined #u-boot
ullbeking has quit [Ping timeout: 258 seconds]
mithro has joined #u-boot
elvishjerricco has joined #u-boot
ezequielg has joined #u-boot
drewfustini has quit [Ping timeout: 258 seconds]
vigneshr has joined #u-boot
behanw has joined #u-boot
sjg1 has joined #u-boot
ullbeking has joined #u-boot
drewfustini has joined #u-boot
Crofton has joined #u-boot
Tartarus has joined #u-boot
NishanthMenon_ has joined #u-boot
ccaione has joined #u-boot
dgilmore has joined #u-boot
paulbarker has joined #u-boot
iopaniuk has joined #u-boot
ldts has joined #u-boot
lvrp16 has joined #u-boot
Danilo82 has quit [Quit: Client closed]
smurray has joined #u-boot
gsz has quit [Quit: leaving]
jwillikers has joined #u-boot
agust has quit [Quit: Leaving.]
jwillikers has quit [Quit: jwillikers]
jwillikers has joined #u-boot
redbrain has quit [Ping timeout: 268 seconds]
flyback has quit [Remote host closed the connection]
flyback has joined #u-boot
flyback has quit [Quit: Leaving]
flyback has joined #u-boot
Jaanes has joined #u-boot
jwillikers has quit [Remote host closed the connection]