Skip to content

Kobo v5 support#12401

Open
NerdyProjects wants to merge 12 commits into
koreader:masterfrom
NerdyProjects:kobo_v5
Open

Kobo v5 support#12401
NerdyProjects wants to merge 12 commits into
koreader:masterfrom
NerdyProjects:kobo_v5

Conversation

@NerdyProjects

@NerdyProjects NerdyProjects commented Aug 24, 2024

Copy link
Copy Markdown

This adds basic support for the recent v5 line of Kobo firmwares.

It is not production ready and I also did not yet include a generator for update.tar.

Should the kobo target just output two files?

Also see #12047 and NiLuJe/kfmon#11

ToDo

  • proper solution for wpa_supplicant parameters - use -s on older readers
  • generate update.tar
  • update toolchain with new target for kobo_v5
  • fix nickel.sh (currently: reader reboots)
  • fix nickel.sh again :-)
  • fix sshd (libcrypt.so.1 missing; might be fixed with new toolchain)

maybe todos

  • fix USBMS (currently: needs right environment set which works via updated kfmon)

This change is Reviewable

@NiLuJe

NiLuJe commented Aug 24, 2024

Copy link
Copy Markdown
Member

Should the kobo target just output two files?

No, I'll ultimately be creating a new TC for it, which means a new target, so said new target can simply use the new packaging method without affecting anything else.

@NiLuJe

NiLuJe commented Aug 24, 2024

Copy link
Copy Markdown
Member
  • proper solution for wpa_supplicant parameters - use -s on older readers

Feel free to steal the branching from my nickel-v5 branch and just change the args in the "new" branch ;).

@Frenzie Frenzie added the Kobo label Aug 24, 2024
@NerdyProjects

Copy link
Copy Markdown
Author

Regarding dropbear: v5 firmware includes an updated libcrypt. Copying libcrypt-2.11.1.so from older device and running ldconfig makes it work.
3 options:

  • package libcrypt-2.11.1.so
  • compile dropbear statically (as done on android already)
  • update dropbear, looks like newer version doesn't depend on libcrypt anymore

@NiLuJe

NiLuJe commented Aug 25, 2024

Copy link
Copy Markdown
Member

Option 4 is the new TC, which should mean we'll build against the new libxcrypt automagically ;).

(I'm planning on working on this next week, FWIW).

@NiLuJe

NiLuJe commented Aug 25, 2024

Copy link
Copy Markdown
Member

fix USBMS (currently: doesn't work, reboots after 90s)

I'm curious as to why, exactly, as I don't think I noticed anything different in the FW on that front.

Can you post the syslog (logread) captured before the reboot? (And, if it went that far, the content of /usr/local/KoboUSBMS.log).

@NerdyProjects

NerdyProjects commented Aug 25, 2024

Copy link
Copy Markdown
Author

Ah, usbMS detects the wrong platform.

Aug 25 21:18:19 usbms[1177]: Battery status: Charging
Aug 25 21:18:19 usbms[1177]: Device is now plugged in
Aug 25 21:18:19 usbms[1177]: Checking charger type
Aug 25 21:18:19 usbms[1177]: SDP PC (Standard Downstream Port, 500mA) charger detected
Aug 25 21:18:19 usbms[1177]: Starting USBMS session…
Aug 25 21:18:19 usbms[1177]: [get_frontlight_intensity:456] sysfs says frontlight intensity is at 19%
Aug 25 21:18:19 usbms[1177]: Frontlight intensity is currently set to 19%
Aug 25 21:18:20 kernel: [  745.984446] .(0)[1195:start-usbms.sh]start-usbms.sh (1195): drop_caches: 3
Aug 25 21:18:20 start-usbms.sh[1195]: Could not load arcotg_udc.ko (it might be built-in on your device)
Aug 25 21:18:22 usbms[1177]: Could not start the USBMS session (script exited with status 1)!
Aug 25 21:18:22 usbms[1177]: Check `/usr/local/KoboUSBMS.log` for more details
Aug 25 21:18:22 usbms[1177]: Bye!
Aug 25 21:18:22 koreader.sh[893]: USBMS session failed (1), shutting down in 90 sec!
Aug 25 21:18:25 kernel: [  751.510993] -(0)[0:swapper/0][wlan] In HIF ISR.
Aug 25 21:18:25 kernel: [  751.512553] -(0)[803:main_thread][wlan][803]wlanDumpBssStatistics:(SW4 INFO) LLS BSS[0] BE: T[000549] R[000000] T_D[000000] T_F[000000]
Aug 25 21:18:25 kernel: [  751.512577] -(0)[803:main_thread][wlan][803]wlanDumpBssStatistics:(SW4 INFO) LLS BSS[0] BK: T[000000] R[000000] T_D[000000] T_F[000000]
Aug 25 21:18:25 kernel: [  751.512589] -(0)[803:main_thread][wlan][803]wlanDumpBssStatistics:(SW4 INFO) LLS BSS[0] VI: T[000000] R[000000] T_D[000000] T_F[000000]
Aug 25 21:18:25 kernel: [  751.512600] -(0)[803:main_thread][wlan][803]wlanDumpBssStatistics:(SW4 INFO) LLS BSS[0] VO: T[000001] R[000000] T_D[000000] T_F[000000]
Aug 25 21:18:25 kernel: [  751.512744] .(0)[804:hif_thread]padding for alignment
root@ereader:~# cat /usr/local/KoboUSBMS.log 
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
+ '[' true = true ']'
+ set -o pipefail
++ basename /mnt/usbms/scripts/start-usbms.sh
+ SCRIPT_NAME=start-usbms.sh
+ grep -q -e '^g_file_storage ' -e '^g_mass_storage ' /proc/modules
+ USB_VENDOR_ID=0x2237
+ VERSION_TAG=/mnt/onboard/.kobo/version
+ '[' -f /mnt/onboard/.kobo/version ']'
++ cut -f1 -d, /mnt/onboard/.kobo/version
+ SERIAL_NUMBER=<redacted>
++ cut -f3 -d, /mnt/onboard/.kobo/version
+ FW_VERSION=5.2.190625
+ DISK=/dev/mmcblk
+ PARTITIONS=/dev/mmcblk0p3
+ '[' -e /dev/mmcblk1p1 ']'
+ sync
+ echo 3
+ for mountpoint in sd onboard
+ DIR=/mnt/sd
+ grep -q ' /mnt/sd ' /proc/mounts
+ for mountpoint in sd onboard
+ DIR=/mnt/onboard
+ grep -q ' /mnt/onboard ' /proc/mounts
+ umount /mnt/onboard
+ MODULES_PATH=/drivers/freescale
+ GADGETS_PATH=/drivers/freescale/usb/gadget
+ case "${PLATFORM}" in
+ legacy_usb
+ '[' -e /drivers/freescale/g_mass_storage.ko ']'
+ '[' freescale = mx6sll-ntx ']'
+ '[' freescale = mx6ull-ntx ']'
+ PARAMS='vendor=0x2237 product=0x4237 vendor_id=Kobo product_id=eReader-5.2.190625 SN=T302440111395'
+ '[' freescale '!=' mx6sl-ntx ']'
+ checked_insmod /drivers/freescale/usb/gadget/arcotg_udc.ko
+ insmod /drivers/freescale/usb/gadget/arcotg_udc.ko
insmod: ERROR: could not load module /drivers/freescale/usb/gadget/arcotg_udc.ko: No such file or directory
++ basename /drivers/freescale/usb/gadget/arcotg_udc.ko
+ logger -p DAEMON.NOTICE -t 'start-usbms.sh[1195]' 'Could not load arcotg_udc.ko (it might be built-in on your device)'
+ sleep 2
+ insmod /drivers/freescale/usb/gadget/g_file_storage.ko file=/dev/mmcblk0p3 stall=0 removable=1 vendor=0x2237 product=0x4237 vendor_id=Kobo product_id=eReader-5.2.190625 SN=T302440111395
insmod: ERROR: could not load module /drivers/freescale/usb/gadget/g_file_storage.ko: No such file or directory

I also wrote a small tool for myself to disable charging above 85% to prolongue battery life. Unfortunately, usbms uses the charging flag of the charger to detect a USB connection :-( Do you have the sources for the usbMS tool? I didn't find them in the repo but it says your toolchain built it :D

@NiLuJe

NiLuJe commented Aug 25, 2024

Copy link
Copy Markdown
Member

Unfortunately, usbms uses the charging flag of the charger to detect a USB connection :-(

Yep, the NTX "Am I plugged in?" ioctl will horribly implode the kernel on MTK, so beggars can't be choosers ;p.

usbMS detects the wrong platform.

It relies on PLATFORM being set in the env, which... it should? :D.

Which reminds me, most of the fuckery in the startup script about that sort of stuff can just rely on /usr/libexec/platform/nickel-env.sh instead on v5 ;).

Do you have the sources for the usbMS tool?

Yup, it's hosted under the koreader org: https://github.com/koreader/KoboUSBMS

@NiLuJe

NiLuJe commented Aug 25, 2024

Copy link
Copy Markdown
Member

Note that the syslog snippet is clipped, so I'm not entirely sure the device detection went all that well in C-land either ;).

@NiLuJe

NiLuJe commented Aug 25, 2024

Copy link
Copy Markdown
Member

It relies on PLATFORM being set in the env, which... it should? :D.

Oh, yeah, no, it isn't, because we attempt to pull it from udevd, which no longer has it set. At a quick glance, only nickel & dbus will have it set.

So, yeah, probably just source /usr/libexec/platform/nickel-env.sh if it exists instead of the whole song and dance for all the env vars ;).

EDIT: Except for LD_LIBRARY_PATH, we don't want nickel's stinky libs ;p.

@NiLuJe

NiLuJe commented Aug 25, 2024

Copy link
Copy Markdown
Member

we attempt to pull it from udevd

And it's a fallback because we actually expect it to be set via the launcher, because kfmon and/or nickel were guaranteed to have it given how they were launched (via rcS) on v4 ;).

(Same for PRODUCT).

@NerdyProjects

Copy link
Copy Markdown
Author

Ah, the missing syslog follows, but there is no more useful information. I really need to be doing something else right now, thanks for all your work, I'll follow up here in the next days :)

Aug 25 21:18:02 usbms[1177]: Initializing USBMS v1.4.0-10-gcf994cc (2024-08-03 21:29:07 +0200)
Aug 25 21:18:02 launch-klogd.sh[1178]: klogd is already running
Aug 25 21:18:02 usbms[1177]: [FBInk] Detected a Tolino Shine B&W (691 => Spa Tolino BW @ Mark 12)
Aug 25 21:18:02 usbms[1177]: [FBInk] This device does not support HW inversion
Aug 25 21:18:02 usbms[1177]: [FBInk] Enabled MediaTek quirks
Aug 25 21:18:02 usbms[1177]: [FBInk] Clock tick frequency appears to be 100 Hz
Aug 25 21:18:02 usbms[1177]: [FBInk] Screen density set to 300 dpi
Aug 25 21:18:02 usbms[1177]: [FBInk] Variable fb info: 1072x1448, 8bpp @ rotation: 3 (Counter Clockwise, 270°)
Aug 25 21:18:02 usbms[1177]: [FBInk] Fixed fb info: ID is "hwtcon", length of fb mem: 6243328 bytes & line length: 1072 bytes
Aug 25 21:18:02 usbms[1177]: [FBInk] Canonical rotation: 0 (Upright, 0°)
Aug 25 21:18:02 usbms[1177]: [FBInk] Fontsize set to 24x24 (IBM (Default) base glyph size: 8x8)
Aug 25 21:18:02 usbms[1177]: [FBInk] Line length: 44 cols, Page size: 60 rows
Aug 25 21:18:02 usbms[1177]: [FBInk] Vertical fit isn't perfect, shifting rows down by 4 pixels
Aug 25 21:18:02 usbms[1177]: [FBInk] Framebuffer pixel format: Y8
Aug 25 21:18:02 usbms[1177]: [FBInk] Pen colors set to #000000 for the foreground and #FFFFFF for the background
Aug 25 21:18:02 usbms[1177]: Initialized FBInk 48ba071
Aug 25 21:18:02 usbms[1177]: [setup_usb_ids:153] USB product ID: 0x4237
Aug 25 21:18:02 usbms[1177]: [FBInk] /dev/input/event0: `gpio-keys` = KEY | SLEEP_COVER | ROTATION_EVENT
Aug 25 21:18:02 usbms[1177]: [FBInk] /dev/input/event1: `cyttsp5_mt` = TOUCHSCREEN | TABLET | KEY | POWER_BUTTON
Aug 25 21:18:02 usbms[1177]: [FBInk] /dev/input/event2: `bd71828-pwrkey` = KEY | POWER_BUTTON | ROTATION_EVENT
Aug 25 21:18:02 usbms[1177]: Using the MTK battery status sysfs entry to handle cable sensing
Aug 25 21:18:02 usbms[1177]: Initialized libue v1.4.0
Aug 25 21:18:02 usbms[1177]: Initialized libevdev v1.13.2 for device `bd71828-pwrkey`
Aug 25 21:18:02 usbms[1177]: [FBInk] Font `/mnt/usbms/resources/fonts/CaskaydiaCove_NF.ttf` loaded for style 'Regular'
Aug 25 21:18:02 usbms[1177]: Battery status: Discharging
Aug 25 21:18:02 usbms[1177]: Checking MTK USB gadget state
Aug 25 21:18:02 usbms[1177]: Internal storage partition wasn't busy, it's been successfully marked as expired.
Aug 25 21:18:02 usbms[1177]: External storage device not available.
Aug 25 21:18:02 usbms[1177]: Starting USBMS shenanigans
Aug 25 21:18:02 usbms[1177]: Battery status: Discharging
Aug 25 21:18:02 usbms[1177]: Waiting for a plug in event or a power button press…
Aug 25 21:18:04 kernel: [  730.094393] -(0)[0:swapper/0]mtk_axi_interrupt: 5 callbacks suppressed
Aug 25 21:18:04 kernel: [  730.094404] -(0)[0:swapper/0][wlan] In HIF ISR.
Aug 25 21:18:06 kernel: [  732.277002] -(0)[0:swapper/0]mtk_axi_interrupt: 39 callbacks suppressed
Aug 25 21:18:06 kernel: [  732.277011] -(0)[0:swapper/0][wlan] In HIF ISR.
Aug 25 21:18:08 kernel: [  734.529789] -(0)[0:swapper/0]mtk_axi_interrupt: 28 callbacks suppressed
Aug 25 21:18:08 kernel: [  734.529798] -(0)[0:swapper/0][wlan] In HIF ISR.
Aug 25 21:18:08 kernel: [  734.567941] .(0)[42:kworker/0:1]bd71827-power bd_work_callback():soc(c=97,v=97,clamp_soc=97),vbat(stat=(32,1),v=4141100,vmin=4134600),vsys(v=4513500,vmin=4513000),curr=290729(avg=-921),cc=100899930,dcap=1581,fcap=1580
Aug 25 21:18:13 kernel: [  739.533693] .(0)[100:irq/90-bd71828_]bd71827-power bd71827-power.4.auto: 
Aug 25 21:18:13 kernel: [  739.533693] ~~~DCIN removed
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=change`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/extcon_iddig/extcon/extcon0`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=extcon`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `NAME=extcon_iddig`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `STATE=USB=0 USB_HOST=0`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `DEVTYPE=extcon0`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1668`
Aug 25 21:18:14 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:14 kernel: [  740.041453] .(0)[42:kworker/0:1]usb_work_callback()-[3261] mt_usb_disconnect!
Aug 25 21:18:14 kernel: [  740.042405] -(0)[42:kworker/0:1]mtu3 11211000.usb: mailbox state(3)
Aug 25 21:18:14 kernel: [  740.043376] .(0)[42:kworker/0:1]bd71827-power bd71827-power.4.auto: Change battery discharge rsense setting
Aug 25 21:18:14 kernel: [  740.044260] .(0)[42:kworker/0:1]bd71827-power bd71827-power.4.auto: Adjust Coulomb Counter by SW at Charge state change
Aug 25 21:18:14 kernel: [  740.045654] .(0)[42:kworker/0:1]bd71827-power bd71827-power.4.auto: CC_CCNTD = 105906176
Aug 25 21:18:14 kernel: [  740.047012] .(0)[42:kworker/0:1]bd71827-power bd71827-power.4.auto: Change battery charge current
Aug 25 21:18:14 kernel: [  740.047023] .(0)[42:kworker/0:1]bd71827-power bd71827-power.4.auto: setCurrentLimit() set current limit 50 mA
Aug 25 21:18:14 kernel: [  740.048565] .(0)[42:kworker/0:1]bd71827-power bd71827-power.4.auto: setChargeCurrent() set charge current 100 mA
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=remove`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/usb_host`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=platform`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `DRIVER=usb_plug`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `OF_NAME=usb_plug`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `OF_FULLNAME=/usb_plug`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `OF_COMPATIBLE_0=usb_plug`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `OF_COMPATIBLE_N=1`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `MODALIAS=of:Nusb_plugT<NULL>Cusb_plug`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1669`
Aug 25 21:18:14 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:14 kernel: [  740.151715] .(0)[42:kworker/0:1]usb unplugged
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=change`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/10019000.i2c/i2c-1/1-004b/bd71827-power.4.auto/power_supply/bd71827_bat`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=power_supply`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_NAME=bd71827_bat`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_STATUS=Charging`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_HEALTH=Good`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CHARGE_TYPE=Fast`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_ONLINE=1`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_VOLTAGE_NOW=4141100`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CAPACITY=97`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_HEALTH=Good`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_PRESENT=1`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_TECHNOLOGY=Li-ion`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CHARGE_NOW=1327000`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CHARGE_FULL_DESIGN=1363000`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CHARGE_FULL=1363000`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CURRENT_AVG=-921`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CURRENT_NOW=290729`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_TEMP=300`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_VOLTAGE_MAX=4200000`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_VOLTAGE_MIN=3600000`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CURRENT_MAX=890000`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1670`
Aug 25 21:18:14 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:14 kernel: [  740.577091] .(0)[42:kworker/0:1]bd71827-power bd_work_callback():soc(c=97,v=97,clamp_soc=97),vbat(stat=(32,2),v=4113000,vmin=4113000),vsys(v=4104000,vmin=4104000),curr=-66976(avg=-966),cc=105904814,dcap=1658,fcap=1657
Aug 25 21:18:14 usbms[1177]: Caught a discharge tick
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=change`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/10019000.i2c/i2c-1/1-004b/bd71827-power.4.auto/power_supply/bd71827_ac`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=power_supply`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_NAME=bd71827_ac`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_ONLINE=0`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_VOLTAGE_NOW=565000`
Aug 25 21:18:14 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1671`
Aug 25 21:18:14 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:14 usbms[1177]: Caught a discharge tick
Aug 25 21:18:16 kernel: [  742.018767] .(0)[100:irq/90-bd71828_]bd71827-power bd71827-power.4.auto: 
Aug 25 21:18:16 kernel: [  742.018767] ~~~DCIN inserted
Aug 25 21:18:16 kernel: [  742.722157] -(0)[0:swapper/0]mtk_axi_interrupt: 14 callbacks suppressed
Aug 25 21:18:16 kernel: [  742.722174] -(0)[0:swapper/0][wlan] In HIF ISR.
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=change`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/extcon_iddig/extcon/extcon0`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=extcon`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `NAME=extcon_iddig`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `STATE=USB=1 USB_HOST=0`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVTYPE=extcon0`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1672`
Aug 25 21:18:17 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:17 kernel: [  743.041912] -(0)[1148:kworker/0:0]mtu3 11211000.usb: mailbox state(4)
Aug 25 21:18:17 kernel: [  743.046024] .(0)[111:kworker/u2:2]mtu3 11211000.usb: gadget (high-speed) pullup D-
Aug 25 21:18:17 kernel: [  743.050255] .(0)[42:kworker/0:1]bd71827-power bd_work_callback():soc(c=97,v=97,clamp_soc=97),vbat(stat=(32,1),v=4119000,vmin=4111000),vsys(v=4090000,vmin=4090000),curr=-156814(avg=-966),cc=105898138,dcap=1658,fcap=1657
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=change`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/10019000.i2c/i2c-1/1-004b/bd71827-power.4.auto/power_supply/bd71827_bat`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=power_supply`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_NAME=bd71827_bat`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_STATUS=Charging`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_HEALTH=Good`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CHARGE_TYPE=Fast`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_ONLINE=1`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_VOLTAGE_NOW=4119000`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CAPACITY=97`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_HEALTH=Good`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_PRESENT=1`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_TECHNOLOGY=Li-ion`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CHARGE_NOW=1393000`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CHARGE_FULL_DESIGN=1430000`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CHARGE_FULL=1429000`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CURRENT_AVG=-966`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CURRENT_NOW=-156814`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_TEMP=300`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_VOLTAGE_MAX=4200000`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_VOLTAGE_MIN=3600000`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_CURRENT_MAX=890000`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1673`
Aug 25 21:18:17 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:17 kernel: [  743.094340] .(0)[1148:kworker/0:0]Mass Storage Function, version: 2009/09/11
Aug 25 21:18:17 kernel: [  743.094356] .(0)[1148:kworker/0:0]LUN: removable file: (no medium)
Aug 25 21:18:17 kernel: [  743.094452] .(0)[1148:kworker/0:0]LUN: removable file: (no medium)
Aug 25 21:18:17 kernel: [  743.094457] .(0)[1148:kworker/0:0]Number of LUNs=1
Aug 25 21:18:17 kernel: [  743.094466] .(0)[1148:kworker/0:0]usb_get_function usb_function_driver name=mass_storage
Aug 25 21:18:17 kernel: [  743.094472] .(0)[1148:kworker/0:0]usb_get_function usb_function name=Mass Storage Function
Aug 25 21:18:17 kernel: [  743.094482] .(0)[1148:kworker/0:0]chargedetect gadget: adding 'Mass Storage Function'/c9097000 to config 'Linux File-Backed Storage'/c0dd0de8
Aug 25 21:18:17 kernel: [  743.102184] .(0)[1148:kworker/0:0]chargedetect gadget: Mass Storage Gadget, version: 2009/09/11
Aug 25 21:18:17 kernel: [  743.102199] .(0)[1148:kworker/0:0]chargedetect gadget: chargedetect ready
Aug 25 21:18:17 kernel: [  743.102213] -(0)[1148:kworker/0:0]mtu3 11211000.usb: gadget (high-speed) pullup D+
Aug 25 21:18:17 usbms[1177]: Caught a discharge tick
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=change`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/10019000.i2c/i2c-1/1-004b/bd71827-power.4.auto/power_supply/bd71827_ac`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=power_supply`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_NAME=bd71827_ac`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_ONLINE=0`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `POWER_SUPPLY_VOLTAGE_NOW=5080000`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1674`
Aug 25 21:18:17 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:17 usbms[1177]: Caught a discharge tick
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=change`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/11211000.usb/udc/11211000.usb`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=udc`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DRIVER=chargedetect`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `USB_UDC_NAME=mtu3`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `USB_UDC_DRIVER=chargedetect`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1675`
Aug 25 21:18:17 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=change`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/11211000.usb/udc/11211000.usb`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=udc`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DRIVER=chargedetect`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `USB_UDC_NAME=mtu3`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `USB_UDC_DRIVER=chargedetect`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1676`
Aug 25 21:18:17 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:17 kernel: [  743.392689] -(0)[1148:kworker/0:0]mtu3 11211000.usb: gadget (high-speed) pullup D-
Aug 25 21:18:17 kernel: [  743.392729] .(0)[1148:kworker/0:0]usb_put_function_instance fd name=mass_storage
Aug 25 21:18:17 kernel: [  743.492917] -(0)[1148:kworker/0:0]mtu3 11211000.usb: mailbox state(3)
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=change`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/extcon_iddig/extcon/extcon0`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=extcon`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `NAME=extcon_iddig`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `STATE=USB=0 USB_HOST=0`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVTYPE=extcon0`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1677`
Aug 25 21:18:17 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=change`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/extcon_iddig/extcon/extcon0`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=extcon`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `NAME=extcon_iddig`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `STATE=USB=1 USB_HOST=0`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVTYPE=extcon0`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1678`
Aug 25 21:18:17 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:17 kernel: [  743.494444] .(0)[1148:kworker/0:0]usb_work_callback()-[3256] mt_usb_connect!
Aug 25 21:18:17 kernel: [  743.495385] -(0)[1148:kworker/0:0]mtu3 11211000.usb: mailbox state(4)
Aug 25 21:18:17 kernel: [  743.496075] .(0)[111:kworker/u2:2]mtu3 11211000.usb: gadget (high-speed) pullup D-
Aug 25 21:18:17 kernel: [  743.496818] .(0)[1148:kworker/0:0]bd71827-power bd71827-power.4.auto: Change battery charge rsense setting
Aug 25 21:18:17 kernel: [  743.497776] .(0)[1148:kworker/0:0]bd71827-power bd71827-power.4.auto: Adjust Coulomb Counter by SW at Charge state change
Aug 25 21:18:17 kernel: [  743.499191] .(0)[1148:kworker/0:0]bd71827-power bd71827-power.4.auto: CC_CCNTD = 100925440
Aug 25 21:18:17 kernel: [  743.500260] .(0)[1148:kworker/0:0]bd71827-power bd71827-power.4.auto: Change battery charge current
Aug 25 21:18:17 kernel: [  743.500268] .(0)[1148:kworker/0:0]bd71827-power bd71827-power.4.auto: setCurrentLimit() set current limit 500 mA
Aug 25 21:18:17 kernel: [  743.500381] .(0)[1148:kworker/0:0]bd71827-power bd71827-power.4.auto: setChargeCurrent() set charge current 500 mA
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=move`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/usb_host`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=platform`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH_OLD=/devices/platform/usb_state`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DRIVER=usb_plug`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `OF_NAME=usb_plug`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `OF_FULLNAME=/usb_plug`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `OF_COMPATIBLE_0=usb_plug`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `OF_COMPATIBLE_N=1`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `MODALIAS=of:Nusb_plugT<NULL>Cusb_plug`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1679`
Aug 25 21:18:17 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `ACTION=add`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DEVPATH=/devices/platform/usb_host`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SUBSYSTEM=platform`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `DRIVER=usb_plug`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `OF_NAME=usb_plug`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `OF_FULLNAME=/usb_plug`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `OF_COMPATIBLE_0=usb_plug`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `OF_COMPATIBLE_N=1`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `MODALIAS=of:Nusb_plugT<NULL>Cusb_plug`
Aug 25 21:18:17 usbms[1177]: [ue_parse_event_msg:141] line: `SEQNUM=1680`
Aug 25 21:18:17 usbms[1177]: [handle_uevent:885] uevent successfully parsed
Aug 25 21:18:17 usbms[1177]: Caught a plug in event (to a USB host)
Aug 25 21:18:17 kernel: [  743.603031] .(0)[1148:kworker/0:0]usb plugged 0x1
Aug 25 21:18:19 kernel: [  745.179403] -(0)[1193:sh]mtk_axi_interrupt: 13 callbacks suppressed
Aug 25 21:18:19 kernel: [  745.179419] -(0)[1193:sh][wlan] In HIF ISR.

@NiLuJe

NiLuJe commented Aug 25, 2024

Copy link
Copy Markdown
Member

So, yeah, probably just source /usr/libexec/platform/nickel-env.sh if it exists instead of the whole song and dance for all the env vars ;).

Actually, doing that in KFMon sort of makes more sense, so, NiLuJe/kfmon@29180ab should have taken care of it ;).

@NerdyProjects

NerdyProjects commented Aug 26, 2024

Copy link
Copy Markdown
Author

Can confirm USBMS working with that change. We might still want a workaround inside usbms?

I notice that we have three more processes we might want to kill:

root       539  0.0  1.5  56596  6756 ?        Sl   12:06   0:00 /usr/local/Kobo/memorylogger
root       556  0.1 10.7 194096 48104 ?        S    12:06   0:00 /usr/libexec/QtWebEngineProcess --type=zygote --no-zygote-sandbox --no-sandbox --application-name=Kobo%20eReader --webengine-schemes=epublishing:;qrc:sV --lang=en
root       557  0.1 10.7 194096 48116 ?        S    12:06   0:00 /usr/libexec/QtWebEngineProcess --type=zygote --no-sandbox --application-name=Kobo%20eReader --webengine-schemes=epublishing:;qrc:sV --lang=en

memorylogger dumps mem stats to usb storage in regular intervals, I guess QtWebEngine is the underlying engine for the new nickel?

@NiLuJe

NiLuJe commented Aug 26, 2024

Copy link
Copy Markdown
Member

I notice that we have three more processes we might want to kill:

Sounds good to me!

On a related note, I guess it probably makes more sense to actually call /init.d/z-nickel-hardware-status & /etc/rc.local rather than reinvent the wheel for the tail end of nickel.sh.

(Plus dealing with the boot anim being animator.sh /etc/images/${PRODUCT}-on-*.raw.gz & now instead of on-animator.sh).

Keep in mind that having Nickel hot-restart sanely has been sort of a dark art in the past, so I'm not even sure it'll actually work ;).

@NiLuJe

NiLuJe commented Aug 26, 2024

Copy link
Copy Markdown
Member

We might still want a workaround inside usbms?

Nah, it was pretty much built under the assumption the env would be sane, I didn't want to have to maintain the same brittle stuff in a gajillion different places ;).

@NerdyProjects

Copy link
Copy Markdown
Author

Okay, restart of nickel is straight forward -> Working :)

Comment thread platform/kobo/nickel.sh Outdated
@NerdyProjects

Copy link
Copy Markdown
Author

I am still using this as a daily driver and it works flawlessly. Once, I had a battery drain of 60% in 2 days of non-usage, but it was in my bag and maybe some sensor stuff was happening...
What's the status with the toolchain update @NiLuJe ? I wonder if it is reasonable to make this merge-able if the new target takes longer...

@NiLuJe

NiLuJe commented Sep 10, 2024

Copy link
Copy Markdown
Member

I'm hoping to get to it sometime in the next two weeks, but, yeah, definitely don't hold out on my account, building with the old TC works perfectly fine if you forget SSH (which you should, the plugin is unmaintained and the dropbear version is horrendously old) ;).

@NiLuJe

NiLuJe commented Sep 27, 2024

Copy link
Copy Markdown
Member

The TC is alive (and extremely untested).

x-tools/arm-kobov5-linux-gnueabihf/arm-kobov5-linux-gnueabihf/sysroot/usr/lib/libcrypt.so.2.0.0

;p.

I'll be building the full set during the night to double check that I didn't break anything when fixing other things along the way, and run some actual tests on a full KOReader build tomorrow.

c.f., https://github.com/NiLuJe/koxtoolchain (where the GH action might actually yield some binaries if I didn't break anything).

Comment thread frontend/device.lua Outdated
NiLuJe added a commit to NiLuJe/koreader that referenced this pull request Sep 28, 2024
kobov4 exists solely because there's a dedicated TC for it,
but we don't distribute binaries for it (it doesn't differ enough from
kobo, and experience has taught us that this kind of split was not a
great idea (e.g., kindle5 vs. kindlepw2)).

kobov5 targets a massively updated userland, and requires further
changes, including to the delivery mechanism, so it very much warrants a
dedicated package (re: koreader#12401)
NiLuJe added a commit to NiLuJe/koreader that referenced this pull request Oct 1, 2024
kobov4 exists solely because there's a dedicated TC for it,
but we don't distribute binaries for it (it doesn't differ enough from
kobo, and experience has taught us that this kind of split was not a
great idea (e.g., kindle5 vs. kindlepw2)).

kobov5 targets a massively updated userland, and requires further
changes, including to the delivery mechanism, so it very much warrants a
dedicated package (re: koreader#12401)
NiLuJe added a commit to NiLuJe/koreader that referenced this pull request Oct 1, 2024
kobov4 exists solely because there's a dedicated TC for it,
but we don't distribute binaries for it (it doesn't differ enough from
kobo, and experience has taught us that this kind of split was not a
great idea (e.g., kindle5 vs. kindlepw2)).

kobov5 targets a massively updated userland, and requires further
changes, including to the delivery mechanism, so it very much warrants a
dedicated package (re: koreader#12401)
NiLuJe added a commit that referenced this pull request Oct 1, 2024
kobov4 exists solely because there's a dedicated TC for it,
but we don't distribute binaries for it (it doesn't differ enough from
kobo, and experience has taught us that this kind of split was not a
great idea (e.g., kindle5 vs. kindlepw2)).

kobov5 targets a massively updated userland, and requires further
changes, including to the delivery mechanism, so it very much warrants a
dedicated package (re: #12401)
@NerdyProjects

Copy link
Copy Markdown
Author

Okay, we need to find a way to rerun the init code from /etc/init.d/usb_gadget after USBMS. I can work something out. Restarting the UDC makes usb work again in nickel.

@gua-jostkleigrewe

Copy link
Copy Markdown

@Frenzie @vzsze
Thanks for your help, i have ad tried both projects,
BT is not properly working (real Kobos and Tolinos with Kobo-Firmware seam to have different Bluetooth stack names)
The other thing is that the Tolino-Flip gives events which are not directly keymappable events. (no typical hid events) therefore the same.

@vzsze

vzsze commented Mar 6, 2026

Copy link
Copy Markdown

@PeeK1e & @wkornewald running your build container does not result in build artifacts. Could you check? I'd like to test the latest build with my shiny new tolino ;)

The @PeeK1e build system seems to work here. I used it yesterday evening and double checked again today.

@NerdyProjects

Copy link
Copy Markdown
Author

Also can someone point me on how to include this in CI build? looks like CI builds the kobo target-- it should build kobov4 and also kobov5.

@benoit-pierre

Copy link
Copy Markdown
Member

The CI does not build all targets. The nightly builder on gitlab (https://gitlab.com/koreader/nightly-builds) does.

@PeeK1e

PeeK1e commented Mar 6, 2026

Copy link
Copy Markdown

@PeeK1e & @wkornewald running your build container does not result in build artifacts. Could you check? I'd like to test the latest build with my shiny new tolino ;)

@Jogai If you were looking for the artifacts on GitLab, it seems I have forgotten to add a "no-expiry" on those.
That should be fixed now. Though if this PR is accepted I'll archive the project anyways. :P

The old builds are gone but I triggered a new build and it's available on my gitlab artifact storage again.

The current patches also seem to work on my Tolino and exiting Koreader no longer crashes the UI :)
Thank you @NerdyProjects for the work 😄

Comment thread platform/kobo/koreader.sh
# A SIGTERM does not break anything, it'll just prevent automatic lease renewal until the time
# KOReader actually sets the if up itself (i.e., it'll do)...
killall -q -TERM nickel hindenburg sickel fickel strickel fontickel adobehost foxitpdf iink dhcpcd-dbus dhcpcd bluealsa bluetoothd fmon nanoclock.lua
killall -q -TERM nickel hindenburg sickel fickel strickel fontickel adobehost foxitpdf iink dhcpcd-dbus dhcpcd bluealsa bluetoothd fmon nanoclock.lua memorylogger QtWebEngineProcess

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the relevance of this memorylogger process? The name sounds fairly innocuous.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We restart that when we exit (via rc.local). it is a process that monitors system and esp. nickel memory usage and logs it to the /mnt/onboard storage.

@NerdyProjects

Copy link
Copy Markdown
Author

I would wait until we get the USBMS patches (koreader/KoboUSBMS#7) in, so mass storage handling is done properly. Then, we would need another commit in koreader-base referencing that one and another one (here?) referencing the updated base. Alternatively, if that is supposed to be different MRs, this one doesn't need to wait.

The nightly build process to me looks like I cannot really support getting it for kobov4+kobov5 as it needs an additional docker image with the right toolchain? That should all work - tell me if there is something I can do.

@Frenzie Frenzie added this to the 2026.04 milestone Mar 6, 2026
@Frenzie

Frenzie commented Mar 6, 2026

Copy link
Copy Markdown
Member

I think there were some unresolved comments by @NiLuJe but let me stick a target on it to apply some pressure. ;-)

@benoit-pierre

Copy link
Copy Markdown
Member

Our kokobo docker image includes both kobo and kobov5 toolchains. I think kobov4 is for legacy kobo platforms?

@NerdyProjects

Copy link
Copy Markdown
Author

Our kokobo docker image includes both kobo and kobov5 toolchains. I think kobov4 is for legacy kobo platforms?

I think (didn't check) kobo is what is currently used and is only for v4 targets but has been renamed to v4 for clarity. I guess we can get rid of kobo and have v4 + v5? Alternatively, leave kobo and just add v5.

@benoit-pierre

benoit-pierre commented Mar 6, 2026

Copy link
Copy Markdown
Member

Our kokobo docker image includes both kobo and kobov5 toolchains. I think kobov4 is for legacy kobo platforms?

I think (didn't check) kobo is what is currently used and is only for v4 targets but has been renamed to v4 for clarity. I guess we can get rid of kobo and have v4 + v5? Alternatively, leave kobo and just add v5.

Actually, the kobo & kobov4 targets of the build system target different glibc versions:

  • kobo: <= 2.15
  • kobov4: <= 2.19

So the kobo toolchain supports older legacy platforms.

@NerdyProjects

Copy link
Copy Markdown
Author

Hm, so we might want 3 kobo builds? afaik @NiLuJe might have a better understanding about the topic and can give some insight :-)

@benoit-pierre

Copy link
Copy Markdown
Member

I think all platforms supported by kobov4 are a subset of kobo, and we should keep kobo & kobov5. When at some point, support for older platforms only supported by kobo is dropped, we'll switch to building kobov4 and kobov5 only.

@NiLuJe

NiLuJe commented Mar 7, 2026

Copy link
Copy Markdown
Member

IIRC, we don't use kobov4 for KOReader, as we want to keep supporting old FW versions (for our good old kobo/"v4" packages).

(It was created for stuff that will only ever care about supporting 4.6+ or whatever the glibc cutoff was ;p).

Likewise, we could use the kobo TC to build for v5, but since we have access to both and we need a different package anyway, it's trivial to "silently" upgrade to kobov5 for those, as they wouldn't run on v4 anyway (I'm assuming swapping a Tolino to "kobo mode" wipes the userstore, so we don't care about supporting that use-case. I don't even know if that keeps the tolino or the kobo glibc, so this point may be moot anyway).

@NiLuJe

NiLuJe commented Mar 7, 2026

Copy link
Copy Markdown
Member

TL;DR: Yeah, basically what @benoit-pierre just said ;p.

@NerdyProjects

Copy link
Copy Markdown
Author

IIRC, we don't use kobov4 for KOReader, as we want to keep supporting old FW versions (for our good old kobo/"v4" packages).

(It was created for stuff that will only ever care about supporting 4.6+ or whatever the glibc cutoff was ;p).

Likewise, we could use the kobo TC to build for v5, but since we have access to both and we need a different package anyway, it's trivial to "silently" upgrade to kobov5 for those, as they wouldn't run on v4 anyway (I'm assuming swapping a Tolino to "kobo mode" wipes the userstore, so we don't care about supporting that use-case. I don't even know if that keeps the tolino or the kobo glibc, so this point may be moot anyway).

The "modern" tolinos have exactly the same firmware for tolino and kobo, i expect no changes in glibc versions, all strings are runtime hw check results...

I remember as written above that v5 needs the upgraded libcrypto at least for dropbear that only comes with the new toolchain, so I don't think we can build with older toolchains.

There is still some review comments from you that are partly quite old - can you please comment on the relevant or close the irrelevant ones? I have some motivation to finally get this merged :D

@NiLuJe

NiLuJe commented Mar 7, 2026

Copy link
Copy Markdown
Member

Right, I'd forgotten about the libcrypto thing ;).

@benoit-pierre

Copy link
Copy Markdown
Member

I remember as written above that v5 needs the upgraded libcrypto at least for dropbear that only comes with the new toolchain, so I don't think we can build with older toolchains.

koreader/koreader-base#2243 should have taken care of the libcrypto issue, no?

@benoit-pierre

Copy link
Copy Markdown
Member

I remember as written above that v5 needs the upgraded libcrypto at least for dropbear that only comes with the new toolchain, so I don't think we can build with older toolchains.

koreader/koreader-base#2243 should have taken care of the libcrypto issue, no?

Sorry, brainfart… That's for pocketbook, but we can do the same on Kobo.

@NerdyProjects

Copy link
Copy Markdown
Author

I added the dropbear static linking fix also for the kobo target, recompiled everything with the kobo toolchain (prebuild 2025-05, because i cannot compile it on archlinux, there is more to fix for GCC15 than in the kobov5 toolchain), wiped my koreader installation on the ereader and put this one. It works as well.

Feels a bit "sad" to not use the more modern CPU target arch, but i didn't do performance analysis.
If we decide to go that way: currently, on a v5 fw we set self.ota_model = "kobov5" - that would need to be changed to just kobo then as well.

How to proceed?

@NiLuJe

NiLuJe commented Mar 9, 2026

Copy link
Copy Markdown
Member

We have the toolchain and everything, so I don't really see any downside in using the kobov5 TC here, I just wanted to note for DIYers that you could technically use the "older" TC ;).

@vzsze

vzsze commented May 4, 2026

Copy link
Copy Markdown

It's working with firmware version 5.15.253009. I had to reinstall Kfmon, like after every firmware update.

0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
kobov4 exists solely because there's a dedicated TC for it,
but we don't distribute binaries for it (it doesn't differ enough from
kobo, and experience has taught us that this kind of split was not a
great idea (e.g., kindle5 vs. kindlepw2)).

kobov5 targets a massively updated userland, and requires further
changes, including to the delivery mechanism, so it very much warrants a
dedicated package (re: koreader#12401)
@fuero

fuero commented Jun 9, 2026

Copy link
Copy Markdown

On 5.15.253009 (938d08ad9c, 4/27/26), USBMS doesn't work. Its screen shows "please disable your custom usb gadget manually".

Looking at logread, I get:

Jun  9 01:53:57 usbms[1191]: Initializing USBMS  (2025-05-06 22:48:17 +0200)
Jun  9 01:53:57 launch-klogd.sh[1192]: klogd is already running
Jun  9 01:53:57 usbms[1191]: [FBInk] Detected a Tolino Vision Color (690 => Monza Tolino @ Mark 13)
Jun  9 01:53:57 usbms[1191]: [FBInk] This device does not support HW inversion
Jun  9 01:53:57 usbms[1191]: [FBInk] Enabled MediaTek quirks
Jun  9 01:53:57 usbms[1191]: [FBInk] Clock tick frequency appears to be 100 Hz
Jun  9 01:53:57 usbms[1191]: [FBInk] Screen density set to 300 dpi
Jun  9 01:53:57 usbms[1191]: [FBInk] Variable fb info: 1264x1680, 32bpp @ rotation: 1 (Clockwise, 90°)
Jun  9 01:53:57 usbms[1191]: [FBInk] Fixed fb info: ID is "hwtcon", length of fb mem: 8494080 bytes & line length: 5056 bytes
Jun  9 01:53:57 usbms[1191]: [FBInk] Canonical rotation: 0 (Upright, 0°)
Jun  9 01:53:57 usbms[1191]: [FBInk] Fontsize set to 32x32 (IBM (Default) base glyph size: 8x8)
Jun  9 01:53:57 usbms[1191]: [FBInk] Line length: 39 cols, Page size: 52 rows
Jun  9 01:53:57 usbms[1191]: [FBInk] Vertical fit isn't perfect, shifting rows down by 8 pixels
Jun  9 01:53:57 usbms[1191]: [FBInk] Framebuffer pixel format: RGBA
Jun  9 01:53:57 usbms[1191]: [FBInk] Pen colors set to #000000 for the foreground and #FFFFFF for the background
Jun  9 01:53:57 usbms[1191]: Initialized FBInk 8ce07a0
Jun  9 01:53:57 usbms[1191]: [setup_usb_ids:163] USB product ID: 0x5237
Jun  9 01:53:57 usbms[1191]: [FBInk] /dev/input/event0: `gpio-keys` = KEY | SLEEP_COVER | PAGINATION_BUTTONS | ROTATION_EVENT
Jun  9 01:53:57 usbms[1191]: [FBInk] /dev/input/event1: `Elan Touchscreen` = TOUCHSCREEN | TABLET | KEY | SCALED_TABLET
Jun  9 01:53:58 usbms[1191]: [FBInk] /dev/input/event2: `kx122-accel` = ACCELEROMETER
Jun  9 01:53:58 usbms[1191]: [FBInk] /dev/input/event3: `bd71828-pwrkey` = KEY | POWER_BUTTON | ROTATION_EVENT
Jun  9 01:53:58 usbms[1191]: Using the MTK battery status sysfs entry to handle cable sensing
Jun  9 01:53:58 usbms[1191]: Initialized libue v1.4.0
Jun  9 01:53:58 usbms[1191]: Initialized libevdev v1.13.4 for device `bd71828-pwrkey`
Jun  9 01:53:58 usbms[1191]: [FBInk] Font `/mnt/usbms/resources/fonts/CaskaydiaCove_NF.ttf` loaded for style 'Regular'
Jun  9 01:53:58 usbms[1191]: Battery status: Discharging
Jun  9 01:53:58 usbms[1191]: Checking MTK USB gadget state
Jun  9 01:53:58 usbms[1191]: Device has a custom usb gadget setup (`kobo`), aborting
Jun  9 01:53:58 usbms[1191]: Waiting for a power button press…

And sure, there's a gadget set up in sysfs. Please let me know if you need more info.

@Frenzie

Frenzie commented Jul 8, 2026

Copy link
Copy Markdown
Member

@NerdyProjects Was this ready to merge? I'm not sure if I quite understand the todo list in the OP with things scratched out. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.