**** BEGIN LOGGING AT Mon Nov 02 02:59:57 2020 Nov 02 03:19:26 Hello. After lots of trial and error I have finally made the (surprisingly) tiny patches that are needed to support a comfast cf-e538 (ramips board). It builds by selecting the device in menuconfig + make defconfig. While I am very happy, I really would like to submit that. BUT it seems that there is another steep learning curve involved. I am Nov 02 03:19:26 running a bit out of energy at this point and am looking for some hand-holding and then follow https://openwrt.org/submitting-patches Nov 02 03:23:22 hello.I send a patch about fixing memory leak on usrteam-ssl project to openwrt-devel@lists.openwrt.org。where I can Tracking process。。 Nov 02 03:25:02 @panchen : "Patches sent to the Development mailing list can be followed on Patchwork at ​https://patchwork.ozlabs.org/project/openwrt/list/. " does that help? Nov 02 03:28:24 FirstTimer_NoTim Thanks, I find it. Nov 02 03:58:52 I'm currently working on porting OpenWRT to a mpc8544ds based Synology NAS, and so far have got gdb remote debugging via JTAG, but I am having issues getting the kernel started. As far as I can see in the BT, it is failing around the TLB init process, but that's not my area of expertise. does anyone know how to debug TLB issues with PowerPC ? Nov 02 04:00:41 i can't get the breakpoints to stop at useful places, though have managed to step through __early_start, but it's pretty low level stuff Nov 02 04:04:17 anyone have any good ideas? :) Nov 02 04:05:38 @Tusker - I can't help, but it might be useful to provide more background. Which version of OpenWRT are you compiling? What options do you use? It seems that there is support for the board mpc8544ds - so I would have assumed that you should be able to get it to boot further than you describe Nov 02 04:08:29 FirstTimer_NoTim: you'd think that it would be simply just turning on the mpc8544ds support and it would boot, but it doesn't seemt to want to. I am compiling with trunk, and it is pretty much the default options for mpc85xx. I have previously attempted to boot using the standard DTS, and have tried to create a custom one to get it to boot. Nov 02 04:10:50 I found that I could extract the DTS from the firmware for my device using binwalk and then a hexeditor (DTB magic number is D0 0D) then using dtc to convert it back Nov 02 04:11:14 yeah, I did that too, it doesn't boot with the old DTS either Nov 02 04:11:58 tbh, I only got mine to boot when I tried another devices DTS - even though I was certain I did translate all of the original DTS correctly Nov 02 04:12:17 But yours is failing much too early Nov 02 04:12:59 I found working with openWRT is a steep learning curve + you have to navigate all the outdated information Nov 02 04:13:52 yeah, it is pretty tough getting your head around it all sometimes Nov 02 04:17:37 I spent days (and my device already ran on a modified openWRT in the first place) on getting the DTS right. I would probably be quicker now with a second device from that company, but it was a slow, frustrating and not very rewarding experience Nov 02 04:18:19 yeah, big time, having JTAG debugging support via gdb is very useful though, at least I can see where the failure is Nov 02 04:18:38 before I had the JTAG support, it was such trial and error Nov 02 04:18:54 failed == "something is wrong" Nov 02 04:19:57 taught me quite a bit about the kernel internals though, trying to step through it Nov 02 04:32:55 @tusker I wish you all the best of luck getting it to boot. Nov 02 04:34:19 thanks :) Nov 02 05:15:34 Tusker: is there some log boot log? could you provide a detail about uboot environment (printenv ?)? what are other commands available (help command) you might be able to extract uboot device tree in some cases? there might be dts inside uboot too but shouldn't differ too much against one firmware have. Nov 02 05:16:21 > at least I can see where the failure is Nov 02 05:16:25 where does it fail though? Nov 02 06:14:07 damex: no boot log at all, it stops before console is setup in the kernel Nov 02 06:14:50 Tusker: what about bootlog before that? Nov 02 06:15:07 you have uart/jtag access and can see uboot boot log and etc? Nov 02 06:15:12 I have extracted the factory DTS already, but it doesn't work either (it is from 2.6.x so pretty old) Nov 02 06:15:25 i have uart and jtag access and can see the bootlog from uboot only Nov 02 06:15:35 can you show it? Nov 02 06:15:51 and please show the kernel config you did for it Nov 02 06:16:01 sure, hang on Nov 02 06:17:38 https://termbin.com/uqv23 Nov 02 06:18:20 factory dmesg - https://termbin.com/c0vj Nov 02 06:18:42 factory dts - https://termbin.com/qunq Nov 02 06:19:03 uboot printenv - https://termbin.com/bdei Nov 02 06:21:42 Tusker: how did you assemble the kernel ? did you strip anything or patch it? Nov 02 06:22:15 i.e. for octeons there was long needed workaround for stripping notes or kernel won't boot Nov 02 06:23:22 Tusker: can you do factory full boot log? Nov 02 06:23:45 modified DTS - https://termbin.com/nei4 Nov 02 06:24:21 sure, hang on Nov 02 06:25:04 > clock-frequency = < 0x00 >; Nov 02 06:25:56 that's what the facctory has in it's DTS, so I just copied Nov 02 06:26:52 https://termbin.com/30ug for the full boot log Nov 02 06:26:55 for factory Nov 02 06:26:58 To chime in - I saw uboot source that had the comment that this is to be set by uboot Nov 02 06:27:09 (clock-frequency that is) Nov 02 06:27:37 (for your specific board) Nov 02 06:28:21 uboot from 2008 :> Nov 02 06:33:56 maybe in kernel 2.6, it sets it manually, but in 5.4.x it doesn't ? Nov 02 06:37:29 is that clock-frequency setting available in /proc somewhere ? /proc/cpuinfo shows clock : 1066.560000MHz Nov 02 06:38:03 it is cpu frequency, not serial Nov 02 06:42:32 yeah, /proc/cpuinfo shows that frequency Nov 02 06:53:33 Tusker: i can't find info who handles the interrupts. interrupt-parent = < 0x01 >; no phandle like that Nov 02 06:53:56 lots of entries use that Nov 02 06:54:16 but when i check upstream device trees they don't specify interrupt parrent at'all Nov 02 06:56:01 but clock-frequency for serial in upstream dts is 0 so should be fine Nov 02 06:56:12 https://github.com/torvalds/linux/blob/master/arch/powerpc/boot/dts/fsl/pq3-duart-0.dtsi that one is included Nov 02 06:56:47 so you think rebuild without interrupt-parent ? Nov 02 06:57:15 you can try, it does not hurt to try. Nov 02 07:05:13 looks like interrupt-parent = <&mpic>; and interrupt-parent = <&i8259>; are used in some of the includes, so 0x1 should refer to &mpic I imagine ? Nov 02 07:07:29 linux,phandle = < 0x01 >; Nov 02 07:17:05 Tusker: yeah Nov 02 07:17:22 it is easier to understand when you use labels :) Nov 02 07:17:46 OK, no change on the boot console, still blank Nov 02 07:18:30 let me try again with memory reg = <0x00 0x00> and see whether uboot actually fills it out Nov 02 07:21:26 Tusker: maybe try to add chosen {} node with stdout-path to &serial0 or which one is actually exposed Nov 02 07:26:49 Tusker: offsets are different between stock and owrt you boot. stock booting kernel from a different offset Nov 02 07:27:12 might be irrelevant Nov 02 08:00:33 damex: yeah, i saw it booting from 0xa vs 0xc Nov 02 08:03:19 I will try with 0xa Nov 02 08:10:47 no difference with 0xa, let me try and trace with jtag Nov 02 08:16:50 CONFIG_KERNEL_START and CONFIG_PAGE_OFFSET ? Nov 02 08:29:31 well, it actually still boots with 0xc, something in the openwrt build system is setting back to 0xc Nov 02 11:25:04 aparcar[m]: FYI https://bugs.openwrt.org/index.php?do=details&task_id=3424 Nov 02 11:41:50 ynezz: also ran into this issue. any thoughts about reverting this for now? Nov 02 12:25:46 https://twitter.com/samykamkar/status/1322671073893126144 Nov 02 12:27:58 stintel: Just don't let the system load NAT helpers automatically. ;) Nov 02 12:32:03 And a "2.6.36.4brcmarm+" kernel is not only long in the tooth, but also heavily modified, for sure. Wake me up when it's reproduced in vanilla upstream. Nov 02 13:09:21 rsalvaterra, not to mention it's an ancient kernel, 2.6 Nov 02 13:10:34 i checked the nearest 3.x broadcom image and didn't find the offending module so Nov 02 13:10:35 there's that Nov 02 13:25:54 >KGB-0< https://tests.reproducible-builds.org/openwrt/openwrt_mediatek.html has been updated. (100.0% images and 100.0% packages reproducible in our current test framework.) Nov 02 13:31:14 am I correct in understanding that 'wifi down' and 'wifi up' actually modify the config, i.e. write to permanent storage when invoked? Nov 02 13:32:19 f00b4r0: I don't see what actual settings those 2 commands would change Nov 02 13:37:31 olmari: the set_wifi_*() functions confused me. But I see now they appear to be deadcode Nov 02 13:41:31 sry for the noob question. how do write the uci get and set commands for the option ipaddr in network -> config interface 'lan' -> option ipaddr? Nov 02 13:43:14 try `uci show network` to see what the syntax is elmo26 Nov 02 13:43:35 oh Nov 02 13:43:40 thanks :D Nov 02 14:34:50 is there any config knob to change teh timestamp that files are written as? Nov 02 14:35:02 trying to cause a bigger jump in time when ntp syncs just after boot, Nov 02 14:37:07 blocktrron, ynezz: i'm lookig at the opkg issue. it's non-trivial to revert as IB now depends on that change (which was supposed to address a bug which previously broke kmod feeds) Nov 02 14:40:51 alternatively, anyone know where the timestamp on the rootfs is set? I know it gets set to ~build time, somewhere, but not sure where? I've looked for any use of touch -r, but not seeint anything obvious Nov 02 14:43:33 * karlp resets his pc clock and rebuilds. Nov 02 14:47:17 I vaguely remember this is linked to the last git commit Nov 02 15:58:19 yes, it's the date of the latest git commit IIRC Nov 02 16:01:09 setting my desktop clock backwards was a trainwreck. I'm currerntly rebuilding with export SOURCE_DATE_EPOCH="somethign" and hoping it "does the right thing", but not finding much about it :) Nov 02 16:02:47 karlp: looks like this is done in scripts/get_source_date_epoch.sh Nov 02 16:03:27 oh look, a version.date file Nov 02 16:03:59 I love finding undocumented features. :) Nov 02 16:04:40 and, is that actually ignoring the env var if it's already set? Nov 02 16:04:46 anyone looking into the opkg regression? Nov 02 16:05:08 apparently someone managed to break the one thing it is supposed to do - installing dependencies Nov 02 16:05:41 nvm, just read backlog Nov 02 16:10:19 dangole: if you look into fixing the opkg issue, please try removing the multi-pass parsing (SF_NEED_DETAIL related code) Nov 02 16:11:47 jow: still on it. opkg is incredibly messy, i wouldn't have ever touched that voluntarily. apparently that pkg_hash_fetch_unsatisfied_dependencies() is consuming some parts of the pkg_t which has been passed to it :( duplicating that is also non-trivial as it's a cascade of (partially recursive) pointers... Nov 02 16:13:00 yes, the solver code is hard to understand, partly due to the extremely verbose code dealing with pkg_t collections Nov 02 16:13:11 vectors in their lingo Nov 02 16:13:36 jow: once i find a way that checking for unresolvable dependencies would not destroy the pkt_t we'd have liked it to check... Nov 02 16:13:58 iirc you can simply iterate it with a for loop Nov 02 16:14:12 whrre does it consume it? Nov 02 16:14:47 pkg_hash_fetch_unsatisfied_dependencies() ? Nov 02 16:17:31 i think i figured it out Nov 02 16:18:03 pkg_hash_fetch_unsatisfied_dependencies marks packages once it checked them to avoid redundant checks. we got to clear those marks after calling it Nov 02 16:18:41 yep Nov 02 16:20:50 hm, seems we can also save some more memory by collapsing some abstract_pkg struct members into bit fields Nov 02 16:21:13 dependencies_checked uses an int type to save a bool Nov 02 16:21:45 state_status and state_flag use an enum each while they only need two or three bits Nov 02 16:22:49 jow: if i'd start to take a general look at 'things to improve' in opkg, it'd end up being a complete rewite Nov 02 16:23:31 https://pastebin.com/W6PNJh3K Nov 02 16:25:33 ok, adding bit lengths to the field in that struct is not a lot of effort while (hopefully) significantly reducing memory resource needs... Nov 02 16:26:20 should reduce it from 12 (28) byte to just two Nov 02 16:26:30 *24 Nov 02 16:27:01 but gcc specific due to type mixture Nov 02 16:40:33 jow: ok, i think i fixed that dependency issue. clearing those check-marks after pkg_hash_fetch_unsatisfied_dependencies() did the trick. Nov 02 16:42:38 jow: now trying with the bitlength of those fields in abstract_pkg reduced like you suggested Nov 02 16:47:21 jow: i guess we'd need __attribute__((__packed__)) as well for the size reduction to take effect, right? Nov 02 16:47:57 (on the cost of increased CPU consumption for unaligned access, at least on some platforms in my understanding) Nov 02 16:54:12 we need help with someone else reviewing the PR/MR https://github.com/openwrt/openwrt/pull/3531 two people reviwed it and two people tested it. it does not seem to be enough to add a new device? Nov 02 17:03:23 jow, ynezz, blocktrron: push a fix to opkg.git Nov 02 17:07:42 Thanks for fixing this Nov 02 17:16:39 >KGB-0< https://tests.reproducible-builds.org/openwrt/openwrt_kirkwood.html has been updated. (100.0% images and 100.0% packages reproducible in our current test framework.) Nov 02 17:17:47 dangole: hm yes, possible that packed attribute is needed Nov 02 17:26:21 dangole: ISTR some archs will spew console messages on unaligned accesses Nov 02 17:28:28 bitwise ops on struct bitfields shouldn't require __packed__ if the bitfield is defined within the struct, iirc Nov 02 17:28:49 not that I have any idea what code you're touching, I know better than to dig into opkg ;> Nov 02 18:04:40 damex: If you've corrected anything that was mentioned, ask what else needs to be done. adrianschmutzler understands not ever device has a large test base :) Esp the mips64/octeon line :D Nov 02 18:05:02 Grommish: everything is fixed. we just need one more reviewer Nov 02 18:06:14 Eh? I mean.. I can build it out, but I can't test it.. Why does x number of reviewers need to be for the unpopular targets ;p Nov 02 18:06:53 damex: I want to have a serious conversation with you about building Ubiquiti targets Nov 02 18:07:25 everything that adrianschmutzler asked for - is fixed. we also fixed all the cosmetic issues we could and compatibility issues that might have been there. everything looks great from mine and lemmi point of view. that build is also being used daily. Nov 02 18:07:26 damex: How flexible are you with the Ubiquiti line? Nov 02 18:09:45 Grommish: what exactly do you want to know? i am using their switches in office/datacenters for management and also routers sometime is being used in office ;) Nov 02 18:10:00 Check the dm Nov 02 18:25:09 dangole: I marked my OWE patch as accepted and delegated to you, since you applied it. I'm not sure if it's the correct procedure, though. Nov 02 20:06:56 jow, f00b4r0: please have a look at this: https://termbin.com/cdmv Nov 02 20:07:51 dangole: I'm not sure I would code it that way, but it's possible the compiler will be smart enough Nov 02 20:08:25 typically I'd union within the struct say an int and the desired bitfield. This way you shouldn't face alignment issues, and you shouldn't need the __packed__ which I'm pretty sure will cause problems Nov 02 20:08:41 adrianschmutzler: Do you have an idea for a minimal list of required metadata information for newly added devices? Nov 02 20:13:09 dangole: without looking at the type definitions and how this is used throughout the code, it's hard to make smart suggestions tbh. Grouping members by type (e.g. pointers together) would avoid extra padding already Nov 02 20:15:46 did some sizeof() testing. without any changes sizeof(struct abstract_pkg) == 56. when adding the field lengths like jow suggested it becomes 48 bytes. with __attribute(__packed__) it is further reduced to 42 bytes. Nov 02 20:16:01 (on 64-bit systems) Nov 02 20:16:45 the extra 4 bytes are probably padding between the bitfield and the next pointer Nov 02 20:17:11 6 bytes Nov 02 20:17:13 gee I'm tried Nov 02 20:17:18 tired :/ Nov 02 20:18:04 if my assumption is correct, I would move the bitfield at the end of the struct Nov 02 20:18:14 having unaligned pointers is going to be a disaster on several platforms Nov 02 20:18:53 f00b4r0: good point Nov 02 20:19:44 something like this https://pastebin.com/KvM51dS5 Nov 02 20:20:05 assuming of course the last pointer isn't used for variable space allocation Nov 02 20:20:51 if pkg_state_status_t and pkg_state_flag_t don't expand to some integer type, the compiler will probably choke Nov 02 20:22:39 also note that if this structure is used in an array of sorts, you'll definitely want to preserve the padding anyway Nov 02 20:23:08 f00b4r0: i guess that 6 bytes savings with __packed__ will always screw up platforms if we have an array of that which is then not sizeof(void*) aligned... Nov 02 20:23:26 f00b4r0: you just said it :) Nov 02 20:23:44 yup :) Nov 02 20:25:38 f00b4r0: thanks for lending your eyes for this, pushed it now Nov 02 20:25:45 *your tired eyes ;) Nov 02 20:27:44 yw :) Nov 02 20:28:04 i'll be signing off now. ttyl Nov 02 21:07:56 are there DTS entries for RTCs? Nov 02 21:15:43 aparcar[m]: yes, RTCs (both in-SoC as well as I2C-connected ones) are represented in DTS. Nov 02 21:16:54 dangole: thanks Nov 03 02:37:56 >KGB-1< https://tests.reproducible-builds.org/openwrt/openwrt_ar71xx.html has been updated. (99.1% images and 100.0% packages reproducible in our current test framework.) **** ENDING LOGGING AT Tue Nov 03 03:00:33 2020