WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] TC3.8_4 Real Time Upgrade  (Read 55869 times)

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
[Solved] TC3.8_4 Real Time Upgrade
« on: April 16, 2021, 04:32:18 PM »
Hi everyone,

With an amazing amount of help, almost all from Rich, I've been able to properly install TC3_8.4 (2.6.33.3), build and install an ADC driver for my fancy A-D card, and have it auto-load at boot time, installed a nice little clock, and most recently, got gpsd and chrony working to synchronize system time to GPS NMEA and PPS sources to ~ 1 us.

Unfortunately though, for my data-acquisition program to work properly, I need to use a real-time kernel.

I downloaded the real-time patch from;

https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/2.6.33/

I think I should leave my existing (very nice) install alone, and start all over again for the real time case, with a new thumb drive ?

To start with, I'll follow the same procedure Rich sent me before (see attached), booting up TC from one pen drive, and installing to a new fresh pen drive.

After that, I'm pretty much in the dark, I need to apply the patch and "re-master" modules ?

Is the general process as outlined by Rich on page 2 of the following post ?

http://forum.tinycorelinux.net/index.php/topic,23797.0.html

After I can hopefully get the rt patch applied, I can re-install the ADC driver, gpsd, chrony, etc, and then I can finally try to get the data acquisition program going !

Thanks,

David
« Last Edit: December 05, 2021, 09:22:34 AM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: TC3.8_4 Real Time Upgrade
« Reply #1 on: April 16, 2021, 06:14:17 PM »
Hi MTCAT
... I think I should leave my existing (very nice) install alone, and start all over again for the real time case, with a new thumb drive ? ...
That's what I would do.

Quote
... Is the general process as outlined by Rich on page 2 of the following post ? ...
If you mean this one, yes:
http://forum.tinycorelinux.net/index.php/topic,23797.msg149402.html#msg149402

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #2 on: April 17, 2021, 08:00:05 AM »
Thanks Rich, I'll start going on this today hopefully !

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #3 on: April 17, 2021, 11:13:44 AM »
Hi Rich,

Would this be the right path to the standard 2.6.33.3 config file ?

http://www.tinycorelinux.net/3.x/release/src/kernel/config-2.6.33.3-tinycore

First step in your big process is to "wget" the original config file.

Thanks,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: TC3.8_4 Real Time Upgrade
« Reply #4 on: April 17, 2021, 02:00:19 PM »
Hi MTCAT
Yes, that's the correct config file.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #5 on: April 17, 2021, 02:45:07 PM »
Hi Rich,

So far so good,  I just ran the "make -j 2 bzImage" command and all is well (I think), but, the next command in your list is;

cp arch/x86/boot/bzImage  /mnt/sdg1/Linux/vmlinuzASUS64rev1

In my case, I'm installing to sdb1 but, I don't have the directory structure "/mnt/sdb1/Linux/.." In /mnt/sdb1 I have the following directories
"./"
"../"
"boot"
"lost+found"
"tce"

Do I need to copy bzImage to one of these directories ?

Thanks,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: TC3.8_4 Real Time Upgrade
« Reply #6 on: April 17, 2021, 05:30:54 PM »
Hi MTCAT
Do this:
Code: [Select]
cp arch/x86/boot/bzImage  /mnt/sdb1/boot/vmlinuzRT1This way you don't overwrite the kernel that's already there.

If you look at  /mnt/sdg1/boot/extlinux/extlinux.conf  you should find something similar to this:
Code: [Select]
DEFAULT core
LABEL core
KERNEL /boot/vmlinuz
APPEND initrd=/boot/core.gz quiet home=UUID="9764a623-4226-4cc2-b777-35f1c7446202" opt=UUID="9764a623-4226-4cc2-b777-35f1c7446202" waitusb=5:UUID="9764a623-4226-4cc2-b777-35f1c7446202" tce=UUID="9764a623-4226-4cc2-b777-35f1c7446202"

Change it to this:
See attached file.

This should boot to your real time kernel but still allow you to boot to the stock kernel if you have a problem.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #7 on: April 17, 2021, 06:48:08 PM »
Hi Rich,

Thanks a lot, that sounds good (to be able to boot either one), does it matter if I keep the "bzImage" naming convention though ?

My original kernel is called "bzImage", does it matter if I call the real-time kernel "bzImageRT1" instead of "vmlinuzRT1" ?

Also, will I need a new initrd file for the real time as well ? My original is called "tinycore.gz", so the real time could be called "tinycore-rt.gz" maybe ?

Thanks,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: TC3.8_4 Real Time Upgrade
« Reply #8 on: April 17, 2021, 07:05:46 PM »
Hi MTCAT
I forgot they still called it bzimage in the older kernels. You can call it anything you want. Just make sure you use the
same name in you extlinux.conf file.

... Also, will I need a new initrd file for the real time as well ? ...
I don't know. That depends on what the real time patch changed. Go with this one for now.


Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #9 on: April 18, 2021, 11:07:17 AM »
Hi Rich,

I ran the sorter.sh script, (but I had to get it from http://tinycorelinux.net/3.x/release/src/kernel/sorter,sh-----> the github link didn't work for me---> I got this sorter.sh with "wget", and then did a "chmod 775 sorter.sh" and then ran it--->seemed to be okay), so that was the last thing I did in your big list (I didn't make an initrd or anything), on power down I made a backup, and now tried to re-boot.

On boot-up, I wasn't given a choice between the old kernel and the real-time kernel, I just saw a little "boot: " prompt echoed to screen, and then eventually, off it went with the real-time kernel.

But, during boot-up, I did see an error,

modprobe: chdir (2.6.33.3-rt19-tinycore): No such file or directory
Failed to open /dev/ramzswap0: No such file or directory
swapon: can't stat '/dev/ramzswap0': No such file or directory

And then the boot-up process continued momentarily, but then hung-up on "Loading Extensions", by hung up, I mean it just gets stuck there, and doesn't go any further.

Any ideas what I did wrong ? I used the "bzImageRT1" naming convention for the kernel and am using the "regular" initrd (tinycore.gz) for both the "regular" and "real-time" kernels.

Thanks,

David


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: TC3.8_4 Real Time Upgrade
« Reply #10 on: April 18, 2021, 08:34:40 PM »
Hi MTCAT
... modprobe: chdir (2.6.33.3-rt19-tinycore): No such file or directory ...
I think you need to rebuild the initrd. Your kernel version  string changed from  2.6.33.3-tinycore  to  2.6.33.3-rt19-tinycore.

The sorter script created a bunch of kernel related extensions (filesystems-$KERNEL.tcz, alsa-modules-$KERNEL, etc.).
The $KERNEL part of those extension names should be 2.6.33.3-rt19-tinycore. Copy all of them to your  tce/optional  directory.
Code: [Select]
cp *-2.6.33.3-rt19-tinycore.tcz /mnt/sdb1/tce/optional
The sorter script also created base_modules.tgz. Copy that file into your home directory (/home/tc/).
Then continue with the instructions in the attached file. Pay close attention to syntax, especially those single periods like
the one after the  find  command and near the  depmod  command.

When you've finished with the attached file, you will have a  tinycoreRT1.gz  file in your  boot  directory. Make sure you
adjust the real time entry in your  extlinux.conf  file to point to  tinycoreRT1.gz.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #11 on: April 19, 2021, 01:10:34 PM »
Hi Rich,

Do you know where all the *-2.6.33.3-rt19-tinycore.tcz files will be located ? And the base_modules.tgz too ?

I made a directory in home called linux-2.6.33.3 or something like that, and the new real-time kernel got built in there.

Would it be possible to do all this by booting up my old non-RT kernel, and then modifying the files on the pen drive which contains the RT kernel ? Or, should I just not be lazy and start all over, right from scratch, install TC3.8.4, apply the patch, build the kernel, make the modules (which took forever !), etc.

Thanks,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: TC3.8_4 Real Time Upgrade
« Reply #12 on: April 19, 2021, 02:36:57 PM »
Hi MTCAT
Do you know where all the *-2.6.33.3-rt19-tinycore.tcz files will be located ? And the base_modules.tgz too ? ...
They should wind up in the same directory as the  sorter.sh  script.

Quote
... Would it be possible to do all this by booting up my old non-RT kernel, and then modifying the files on the pen drive which contains the RT kernel ? ...
I don't see why not. You may have to modify some of the instructions in the attachment. The  /mnt/sdb1/  parts come
to mind. Those should be adjusted to point to the drive with the RT kernel.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #13 on: April 20, 2021, 01:35:44 PM »
Hi Rich,

Fired up the VDX3 running off the old non-RT kernel (sdb1), I plugged in the pen drive with the RT kernel on it, mounted it as sdc1, cd to /mnt/sdc1 and I don't have home directory there ! I guess extlinux is not set up yet for persistent home and opt ? I did make a backup though with the RT kernel (on sdc1) when I powered down some time ago, there's a big file called "mydata.tgz" in /mnt/sdc1/tce, I assume that's the backup.

What do you think, could we make use of the backup, or maybe I should just start over from scratch ? It wasn't too bad except the modules took quite long to build, couple hours maybe.

Thanks,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: TC3.8_4 Real Time Upgrade
« Reply #14 on: April 20, 2021, 01:53:32 PM »
Hi MTCAT
Edit the  extlinux.conf  file on the  RT  thumb drive and change  DEFAULT  back to  core.
Boot the  RT  thumb drive.
Follow the instructions for persistent /home and /opt directories here like you did last time:
http://forum.tinycorelinux.net/index.php/topic,24813.msg157808.html#msg157808
Then follow the instructions in Reply #39:
http://forum.tinycorelinux.net/index.php/topic,24813.msg157840.html#msg157840

Make the changes to both sections of the  extlinux.conf  file (core  and  realtime).