WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Re: Tiny Core v17.0 upgrade issues  (Read 8367 times)

Offline Stefann

  • Wiki Author
  • Full Member
  • *****
  • Posts: 195
Re: Tiny Core v17.0 upgrade issues
« Reply #120 on: May 15, 2026, 11:17:54 AM »
Question...

Brainwave....
I don't feel I can recompile the kernel

However..
- I succesfully unsquased usb-serial-6.18.2-tinycore.tcz (TC17)
- I could also unsquase usb-serial-6.12.11-tinycore.tcz (from TC16) or usb-serial-6.6.8-tinycore.tcz  (TC15)
- I could replace the TC17 usbserial.ko.gz and/or ftdi.ko.gz by the TC15 or TC16 version
- Than squase and create a custom .tcz kext for TC17.

Would that have any change to succeed??

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1562
Re: Re: Tiny Core v17.0 upgrade issues
« Reply #121 on: May 15, 2026, 11:27:06 AM »
No you cannot use old kernel modules.    I do agree, there is nothing in the specific drivers that has changed that might be related.   Getting a crash/log message is about the only thing that is going to provide any real insight as to what might be going wrong.

However a real option is to just use the improved version of your code that uses non-blocking methods......and move on.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 841
Re: Tiny Core v17.0 upgrade issues
« Reply #122 on: May 15, 2026, 11:33:57 AM »
Like @Rich says, you can't take some modules from one kernel version to another.
The modules have to come from the same compiling/building.

I think i have a old thread on this forum, let me search for it how to extract and build a new tcz so you don't need to load them all.

Here you are:
https://forum.tinycorelinux.net/index.php/topic,18858.msg129216.html#msg129216
https://forum.tinycorelinux.net/index.php/topic,20195.msg129372.html#msg129372

And you can also read lots of things in the wiki(lets promote that):
https://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions
 

Offline Stefann

  • Wiki Author
  • Full Member
  • *****
  • Posts: 195
Re: Tiny Core v17.0 upgrade issues
« Reply #123 on: May 15, 2026, 11:34:37 AM »
@paul_123,
Yes.. using nonblocking read seems to be a solution for me.
It’s just that “kernel crashing” is a real bad thing. It’s very likely to happen at some place at the world as well. So “finding the rootcause” is the honorable thing to do in this open source community.

Anyway… it’s running… screensaver is disabled… I now know how to get into terminal-mode from the gui… so “maybe” I get some messages at next crash. (My hopes are low as it seems to “just stall”).

Offline Stefann

  • Wiki Author
  • Full Member
  • *****
  • Posts: 195
Re: Tiny Core v17.0 upgrade issues
« Reply #124 on: May 15, 2026, 11:38:57 AM »
Like @Rich says, you can't take some modules from one kernel version to another.
The modules have to come from the same compiling/building.

I think i have a old thread on this forum, let me search for it how to extract and build a new tcz so you don't need to load them all.

Here you are:
https://forum.tinycorelinux.net/index.php/topic,18858.msg129216.html#msg129216
https://forum.tinycorelinux.net/index.php/topic,20195.msg129372.html#msg129372

And you can also read lots of things in the wiki(lets promote that):
https://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions
Thanks.
Yes.. I know how to make an extension. So that part is covered
My trouble is to recompile/rebuilt the usb-serial kext with updated usb-serial.c code.
I will read and act on your posts but that will be tomorrow. Day is ending here in Europe.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1562
Re: Re: Tiny Core v17.0 upgrade issues
« Reply #125 on: May 15, 2026, 11:54:13 AM »
What change do you want to make to the kernel module code?

Rebuilding a single in tree module, requires it to match the current kernel, which can be done. With the files from the source directory.

But let’s start with what you want to change?

Offline Stefann

  • Wiki Author
  • Full Member
  • *****
  • Posts: 195
Re: Re: Tiny Core v17.0 upgrade issues
« Reply #126 on: May 15, 2026, 01:56:17 PM »
What change do you want to make to the kernel module code?

Rebuilding a single in tree module, requires it to match the current kernel, which can be done. With the files from the source directory.

But let’s start with what you want to change?
It's definitely a gamble,
But my 1st idea would be:
- replace  drivers/usb/serial/usb-serial.c from TC17 by the TC15 version
- recompile/rebuilt usb-serial-6.18.2-tinycore.tcz

Rationale:
- under TC15 my application was running multiple month without crash
- under TC17 it consistently crashes within 24h, mostly around 15hr
- when I replaced the blocking read() from data from 'serial-over-usb' port by a nonblocking read() it ran for 7days after which I manually stopped it for further investigation.

It is surely a kernel issue. System crashes and freezes completely. Not just the application,.... everything. Nothing graceful, no kernel debug-level syslog.
I would expect it to be a mishandled exception or race condition.

diff on usb-serial.c from TC15 to TC17 shows 2 suspicious changes:
- a port-closure that was protected by a "port-exist test" in TC15 towards a port-closure without that test in TC17.
- a change form spin_lock() in TC15 to guard(mutex)() in TC17 but 2x spin_unlock() in TC15 that disappear without clear TC17 alternative.
« Last Edit: May 15, 2026, 01:59:03 PM by Stefann »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12762
Re: Tiny Core v17.0 upgrade issues
« Reply #127 on: May 15, 2026, 02:58:40 PM »
Hi Stefann
... but 2x spin_unlock() in TC15 ...
Code inside a spin_lock should be brief and not take long to execute.
It's likely the code can take one of two possible paths, so each path
has a spin_unlock included.

Offline Stefann

  • Wiki Author
  • Full Member
  • *****
  • Posts: 195
Re: Tiny Core v17.0 upgrade issues
« Reply #128 on: May 16, 2026, 02:35:13 AM »
Hi Stefann
... but 2x spin_unlock() in TC15 ...
Code inside a spin_lock should be brief and not take long to execute.
It's likely the code can take one of two possible paths, so each path
has a spin_unlock included.
You are right.
- I checked the code, indeed the 2 spin_unlocks are alternative exist of the same lock
- but... I was surprised that the guard(mutex) in TC17 did not have any "unguard" call. However... after checking how guard(mutex) is supposed to work I found that it apparently automatically unlocks when it leaves the scope: https://www.marcusfolkesson.se/blog/mutex-guards-in-the-linux-kernel/
>>>> so... this TC15/TC17 difference is less likely to be the trouble maker

Than still I find suspect in usb-serial.c:
Code: [Select]
% diff TC17_drivers_usb_serial/usb-serial.c TC15_drivers_usb_serial/usb-serial.c
1193c1196,1200
< tty_port_tty_vhangup(&port->port);
---
> tty = tty_port_tty_get(&port->port);
> if (tty) {
> tty_vhangup(tty);
> tty_kref_put(tty);
> }
TC15 has a check on tty not being NULL before hangup while TC17 is missing that.

On the one hand: "maybe this is not a problem",
but on the other hand: "up to TC15 I never had a kernel crash since 2009 and now I have a kernel crash every 24hrs".
So..... at least "something" is causing this.
« Last Edit: May 16, 2026, 02:37:05 AM by Stefann »

Offline Stefann

  • Wiki Author
  • Full Member
  • *****
  • Posts: 195
Re: Re: Tiny Core v17.0 upgrade issues
« Reply #129 on: May 16, 2026, 02:58:23 AM »
What change do you want to make to the kernel module code?

Rebuilding a single in tree module, requires it to match the current kernel, which can be done. With the files from the source directory.

But let’s start with what you want to change?
Some help would be appreciated....
I did read, reread, rereread and thought about "create custom kernel": https://wiki.tinycorelinux.net/doku.php?id=wiki:custom_kernel

On the one hand... this still feels miles above my skill-level.
On the other hand... "I could try"...

step1-5:
Completed, I have the full release source and patched usb-serial.c
Let's call the toplevel directory ./.

step6:
I do not understand what config file to move where.
It says "kernel config file" but I do not see that.
There is a ./kernel/configs directory which has tiny.config and tiny-base.config. Should I use those?
And where to move? to ./kernel/.config? or to ./.config?

step7-8:
In what directory should I run the make? in ./.? or ./kernel?

step 9:
I probably do not need to make the kernel itself. Do I?
well... reading step11... I probably endup with a kernel that has kext included, than I need this I guess.

step 10:
Will this than make usb-serial-6.18.2-tinycore.tcz? or will it only compile to ./usr/local/libl/modules/........?
reading step 11, I guess only compile.

step11:
Associated... or wil this create the usb-serial-6.18.2-tinycore.tcz?
mmmhh.. maybe if I understand well I endup with a kernel; that has the modules integrated... not sure about that..

---
And after that...
I have a core.gz? and vmlinuz?


Offline mocore

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 778
  • ~.~
Re: Re: Tiny Core v17.0 upgrade issues
« Reply #130 on: May 16, 2026, 06:36:48 AM »
On the other hand... "I could try"...

*thumbs up emoji*


step6:
I do not understand what config file to move where.
It says "kernel config file" but I do not see that.

i scaned only this post , so i might be way off

how ever i imagine 
this
http://tinycorelinux.net/17.x/x86/release/src/kernel/linux-6.18.28/config-6.18.28-tinycore

or one on/in a similar path:17.x/x86/release/src/kernel/ ( remember to match the kernel versions )
might be what the guide is referring to

afaik ( and tbh i know very little :s ) the above link is/should be what the core 17.x kernel was built with !

good luck!
it can be tricky fishing for the relevant details , esp when they are vaguely referenced and not explicitly stated  ...imho



Offline Stefann

  • Wiki Author
  • Full Member
  • *****
  • Posts: 195
Re: Re: Tiny Core v17.0 upgrade issues
« Reply #131 on: May 17, 2026, 06:49:08 AM »


how ever i imagine 
this
http://tinycorelinux.net/17.x/x86/release/src/kernel/linux-6.18.28/config-6.18.28-tinycore

or one on/in a similar path:17.x/x86/release/src/kernel/ ( remember to match the kernel versions )
might be what the guide is referring to

afaik ( and tbh i know very little :s ) the above link is/should be what the core 17.x kernel was built with !

good luck!
it can be tricky fishing for the relevant details , esp when they are vaguely referenced and not explicitly stated  ...imho
THANKS... alike you said vaguely referenced and not explicitly stated made the above not enough for me....
Still.. every attempt to help is greatly appreciated. so thanks!

However I found this: https://www.parkytowers.me.uk/thin/Linux/TinycoreCK.shtml
An AMAZING complete and detailed description creating own kernel --> I will try with that guidance.

====
With that said... status....

I started my apply action again 2 days ago on TC17. Nothing special. I expected it to crash within 24hrs but after 2 days it's still running. So... still no error messages yet.
I Suspect that the "keep running" results form lower system load. I have almost everything in original state EXCEPT that I disabled de modbus readout from my solar system to reduce load on the solar system as I'm monitoring that now from my 2nd system.
==> so, today restart with modes Enabled. And full blocking read. That "should crash".

I again tried TC16. For some reason TC16 does not boot. TC15 works. TC17 works. But TC16 does not boot. I tried the iso form the download area of 16.0, 16.1 and 16.2 but none of them works. I don't know why. But I leave it. It would have been nice to see whether things break from 15->16 to 16->17 but I do not want to spent time on it anymore.

Offline Stefann

  • Wiki Author
  • Full Member
  • *****
  • Posts: 195
Re: Tiny Core v17.0 upgrade issues
« Reply #132 on: May 17, 2026, 01:05:19 PM »
small update....

wow.......... I succeeded to compile and built a kernel from source....
I will test it tomorrow (day is ending here in Europe),
or bit later as I want current run to crash.

I'm a bit in shock

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 841
Re: Tiny Core v17.0 upgrade issues
« Reply #133 on: May 17, 2026, 01:10:49 PM »
wow.......... I succeeded to compile and built a kernel from source....

I'm a bit in shock

Welcome
Now you are a real Linux user.