daodaozai_ has quit [Remote host closed the connection]
cmonroe has joined #openwrt-devel
n3ph_ has quit [Ping timeout: 480 seconds]
rz_ has joined #openwrt-devel
rz has quit [Ping timeout: 480 seconds]
<soxrok2212>
the device im working on has a bootloader that validates os (and likely the bootrom validates the bootloader too, so i dont think i can patch the bootloader). however, i can still boot arbitrary images by reading from flash and using bootm. is it "acceptable" upstream to muck up the bootloader to support this functionality? e.g. each upgrade i would update a bootloader arg with the size of the sysupgrade image, load from f
<soxrok2212>
then boot it
<soxrok2212>
i'd also have to change the default bootargs
<soxrok2212>
sorry, default bootcmd
<soxrok2212>
Ansuel: this may be for you, its the w1700k
<KanjiMonster>
soxrok2212: there are worse device, for some you need to replace the full bootloader, so just changing the bootcmd is mild compared to that
<soxrok2212>
ok cool. ty
<KanjiMonster>
soxrok2212: though you shouldn't need to update the bootloader arg each time; just copy a large enough chunk to contain the kernel and some, and bootm will just read and boot the kernel, any additional data is normally ignored
<soxrok2212>
that was the other option.. ill try that
<KanjiMonster>
the default bootcmd of many device is copy x MiB from start of image to loaddr, then bootm from there
<KanjiMonster>
with x often not enough for modern kernels
<soxrok2212>
KanjiMonster: one more question. the bootloader doesnt support ubi, so i must use a separate kernel+rootfs and overlay. my kernel+rootfs starts fine, but i must be missing something to get my overlay working right
<soxrok2212>
is there somewhere i should be setting the partition to ubi?
lucascastro has quit [Remote host closed the connection]
<soxrok2212>
how big of a deal is it though if the rootfs is raw? its not like it'll be written any more than the kernel
lucascastro has joined #openwrt-devel
<KanjiMonster>
most flash filesystems can't cope with bad blocks
torv has quit [Remote host closed the connection]
<soxrok2212>
ah, fair
<soxrok2212>
can you sysupgrade a factory image
<soxrok2212>
that that the standard method to install from an initramfs
<soxrok2212>
then just sysupgrade for the rest
<KanjiMonster>
not sure, but I think you can
<KanjiMonster>
though in that case you could also skip the factory image and directly format the ubi partition and then let sysupgrade do the rest or so
<KanjiMonster>
not sure if it doesn't even support that, haven't checked in a while
torv has joined #openwrt-devel
<soxrok2212>
yeah that's the part im lost on
<soxrok2212>
theres no documentation for that lmao
Nilsro has joined #openwrt-devel
Nilsro_ has quit [Ping timeout: 480 seconds]
torv has quit [Remote host closed the connection]
Piraty_ has quit []
Piraty has joined #openwrt-devel
torv has joined #openwrt-devel
<KanjiMonster>
soxrok2212: there is actually nothing you need to do: the default nand sysupgrade path tries to attach the ubi, and if it can't formats it, and then continues on with a normal sysupgrade installation
<soxrok2212>
so then the whole procedure should be flash a factory image like the linksys kirkwood, then just sysupgrade from there on out?
<KanjiMonster>
just boot initramfs and then sysupgrade a sysupgrade-tar
<KanjiMonster>
no need for any factory images
<soxrok2212>
so im in the case where im changing the factory partitions since they were wasting so much space with a/b and not actually using the whole flash. is the device tree responsible for saying which partition is ubi?
<KanjiMonster>
yes
<KanjiMonster>
or maybe the kernel commandline
<KanjiMonster>
but that's also part of the dts
lucascastro has quit [Ping timeout: 480 seconds]
<soxrok2212>
reg = <… …>;
<soxrok2212>
label = "ubi";
<soxrok2212>
compatible = "linux,ubi";
<soxrok2212>
is sufficient?
<KanjiMonster>
should be
lucascastro has joined #openwrt-devel
<KanjiMonster>
though you also might need to set the partition name (label) in your Device section so it gets encoded in the sysupgrade-tar
<KanjiMonster>
the compatible is so that the ubi gets attached by the kernel automatically so it can load a rootfs from it
<soxrok2212>
i have
<soxrok2212>
partition@600000 {
<soxrok2212>
reg = <0x00600000 0x01000000>;
<soxrok2212>
label = "kernel";
<soxrok2212>
};
<soxrok2212>
partition@1600000 {
<soxrok2212>
label = "ubi";
<soxrok2212>
reg = <0x01600000 0x1e800000>;
<soxrok2212>
compatible = "linux,ubi";
<soxrok2212>
};
<soxrok2212>
you mean that label?
<KanjiMonster>
yepp, something like that
<soxrok2212>
ok so then next im not sure my image makefile will be right
<soxrok2212>
is there something specific i need to package the kernel separate from rootfs+overlay
<KanjiMonster>
you will also want to have a uboot and a env partition, so you can update the fw env
<soxrok2212>
yeah i have thouse
<soxrok2212>
those*
torv has quit [Remote host closed the connection]
<KanjiMonster>
no, just a normal uImage is fine
<KanjiMonster>
whatever the bootloader accepts
<soxrok2212>
ok. lzma kernel it is
<soxrok2212>
sysupgrade should just be a sysupgrade-tar?
torv has joined #openwrt-devel
lucascastro has quit [Ping timeout: 480 seconds]
<soxrok2212>
KanjiMonster: [ 21.149444] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005a0004: 0x0001 instead
<KanjiMonster>
yes
<soxrok2212>
spamming the console
<KanjiMonster>
there should be no jffs2 happening
<soxrok2212>
jffs2 is for sure happening somehow
<soxrok2212>
ah you know what
<soxrok2212>
i think my sysupgrade failed
<soxrok2212>
yep, fixed. it works! this is beautiful, thank you for the help!
<soxrok2212>
i'll just need to flash back to stock and write out the entire flash instructions