WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Building kernel with TinyCore patches  (Read 10232 times)

Offline christully

  • Newbie
  • *
  • Posts: 28
Building kernel with TinyCore patches
« on: December 28, 2018, 09:19:18 AM »
Ok, I'm trying to use TinyCore as a USB boot stick to mount the drives of a Debian based router and edit some of the files. I have run into a snag that TinyCore is built with the '# CONFIG_OVERLAY_FS is not set' option turned off. I believe that this is because Rob et al determined that overlayfs is unstable/buggy and they didn't want to mess with it.

I have taken the step of downloading the linux-4.19.10-patched and config-4.19.10-tinycore64 files from ftp://distro.ibiblio.org/tinycorelinux/10.x/x86_64/release/src/kernel/

I have also installed (tce-load -wi) compiletc and ncurses-dev.

After doing a 'make mrproper' I copied the config-4.19.10-tinycore64 file to linux-4.19.10/.config and the typed 'make all'

I get the following error messages:

arch/x86/Makefile:227 *** You are building kernel with non-retpoline compiler, please update your compiler.. Stop.

Given that I cretaed the VM I am using for this project yesterday from the a freshly downloaded v10 core-current.iso file and did tce-load -wi compiletc this morning I don't think I can get much more current. Googling the error above reveals that GCC introduced retpoline support in v 7.3 and gcc -v on my VM shows version 7.2.0.

What can I do to work around this issue?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Building kernel with TinyCore patches
« Reply #1 on: December 28, 2018, 09:40:47 AM »
Hi christully
V10 was just recently released as an alpha release. Maybe try starting with V9. There is a post on compiling the kernel here:
http://forum.tinycorelinux.net/index.php/topic,21079.msg136147.html#msg136147
The thread was about V8 but the linked post refers to V9.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10960
Re: Building kernel with TinyCore patches
« Reply #2 on: December 28, 2018, 09:52:38 AM »
Why do you need overlayfs to edit those files? It's an in-memory thing, with the underlying filesystems being normal ext*/etc, no?
The only barriers that can stop you are the ones you create yourself.

Offline christully

  • Newbie
  • *
  • Posts: 28
Re: Building kernel with TinyCore patches
« Reply #3 on: December 28, 2018, 10:17:26 AM »
Rich,

Thanks for the link to the forum for building.  I had already started downloading v9 before checking my post so I guess we are on the same page...

curaga,

I am working with a configuration built by another company and reverse engineering their work to do my own work. The file system on the router I'm working with is composed of squashfs.filesystem file that I can mount when booting from a TinyCore USB stick. But none of the customizations we have made to the router exist in the squashfs.filesystem file. There exists another file named ovrelay. Using strings I have found the customizations I need to adjust in that file. I cannot mount overlay in TinyCore and based on my searches I believe this to because TinyCore is built without support for overlayfs and that the overlay file is an overlayfs file.

Offline andyj

  • Hero Member
  • *****
  • Posts: 1021
Re: Building kernel with TinyCore patches
« Reply #4 on: December 28, 2018, 12:01:27 PM »
I built a custom TC 10.x kernel with PAE support using gcc 8.2 so I know it can be done. I didn't need to do 'make mrproper' nor 'make all', just 'make bzImage modules' after I did a 'make menuconfig'. Overlayfs is a way to make a read-only-disk-based distro look writable. With TC being memory-based that isn't usually necessary. Overlayfs requires several directories to get it to work, and any image you have which you think might be an overlay should be mountable as a filesystem by itself. I think the question everyone is asking is "what are you trying to do that makes overlayfs the best solution?"

Offline christully

  • Newbie
  • *
  • Posts: 28
Re: Building kernel with TinyCore patches
« Reply #5 on: December 28, 2018, 12:10:08 PM »
andyj,

As I said in my first response, I am reverse engineering a system built by someone else.  They made the decision to use overlayfs. Since I want to be able to modify the files that are part of the overlay file system, I need the kernel to recognize overlayfs.

The choice to use overlayfs was not mine but it is one I have to live with.

Chris

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14535
Re: Building kernel with TinyCore patches
« Reply #6 on: December 28, 2018, 08:06:30 PM »
arch/x86/Makefile:227 *** You are building kernel with non-retpoline compiler, please update your compiler.. Stop.

Given that I cretaed the VM I am using for this project yesterday from the a freshly downloaded v10 core-current.iso file and did tce-load -wi compiletc this morning I don't think I can get much more current. Googling the error above reveals that GCC introduced retpoline support in v 7.3 and gcc -v on my VM shows version 7.2.0.

What can I do to work around this issue?
tc-10.x uses gcc-8.2, it looks like you have a mixture of extensions from 9.x and 10.x?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14535
Re: Building kernel with TinyCore patches
« Reply #7 on: December 29, 2018, 02:37:25 AM »
Using this config change:
Code: [Select]
<M> Overlay filesystem support
[*]   Overlayfs: turn on redirect directory feature by default
[*]   Overlayfs: follow redirects even if redirects are turned off (NEW)
[*]   Overlayfs: turn on inodes index feature by default
[*]     Overlayfs: turn on NFS export feature by default
[*]   Overlayfs: auto enable inode number mapping
[ ]   Overlayfs: turn on metadata only copy up feature by default

..the tc-10.x kernel compiles without error.

Offline christully

  • Newbie
  • *
  • Posts: 28
Re: Building kernel with TinyCore patches
« Reply #8 on: December 29, 2018, 07:17:31 AM »
OK, I am currently running TC 6.4 as my starting point (what I was given). I have wiped out my tce/ directory clean and rebooted, so I no longer have any extensions of any flavor.

I have both the latest 9.x and 10.x sources downloaded. and neither has successfully built.

I can't find a gcc 8.3 tzc file anywhere so I can't manually install it and I'll have to reproduce the errors I get when building the 9.x code.

I'm at a crossroad point. Do I update TC and try again? If so which flavor? Since tce-load -wi compiletc seems to give me gcc 7.2 should I stick with the 9.x code?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14535
Re: Building kernel with TinyCore patches
« Reply #9 on: December 29, 2018, 07:22:56 AM »
Your original post stated that you need at least gcc-7.3.0.

The only version of tinycore that fulfils this criteria is tinycore-10.x, which uses gcc-8.2.0

Offline christully

  • Newbie
  • *
  • Posts: 28
Re: Building kernel with TinyCore patches
« Reply #10 on: December 29, 2018, 07:39:59 AM »
OK. My guess at needing gcc 7.3 was based on the error message I got trying to build TC 10 and the info I turned up searching for retpoline.

I'll update me running version to TC 10 and then try building the custom kernel I need.

Thanks again for helping a newbie!
« Last Edit: December 29, 2018, 07:42:10 AM by christully »

Offline christully

  • Newbie
  • *
  • Posts: 28
Re: Building kernel with TinyCore patches
« Reply #11 on: December 31, 2018, 02:27:16 PM »
Thanks to the comments here and on the other thread I have started, I have TinyCore successfully (I think) building on my APU and on my Debian 8 VM.  Yes I run Debian in a VM because in their infinite wisdom the IT department at work gave me a Windows laptop running Windows 7, even though most of my assigned tasks involve developing and testing code for linux...

I run Debian in a VM to avoid ruffling feathers with IT but if they really do lock our computers down like they have said they will in the new year I'll probably either wipe the machine and put Debian on it as my primary OS or build a TinyCore 9.x boot stick and run TC.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Building kernel with TinyCore patches
« Reply #12 on: January 01, 2019, 12:19:54 AM »
...
Yes I run Debian in a VM because in their infinite wisdom the IT department at work gave me a Windows laptop running Windows 7, even though most of my assigned tasks involve developing and testing code for linux...

I run Debian in a VM to avoid ruffling feathers with IT but if they really do lock our computers down like they have said they will in the new year I'll probably either wipe the machine and put Debian on it as my primary OS or build a TinyCore 9.x boot stick and run TC.
Get a large and fast USB 3.0 thumb drive and install TC on it.   Then tell the IT department they can have the HDD, take it out and wrap it up
[emoji12]



Sent from my iPhone using Tapatalk

Offline andyj

  • Hero Member
  • *****
  • Posts: 1021
Re: Building kernel with TinyCore patches
« Reply #13 on: January 01, 2019, 08:02:46 AM »
If it's anything like IT in my previous life, they used TPM so the only way to get it to boot was from the internal hard drive. I just didn't turn in my old laptop and kept using it for actual work, the new one for email only.

Offline christully

  • Newbie
  • *
  • Posts: 28
Re: Building kernel with TinyCore patches
« Reply #14 on: January 02, 2019, 02:20:58 PM »
Back to my initial intent in this thread...

I have finally gotten my dependencies worked out and cleaned up. I have built the TC 6.x kernel both in TC on the apu (this took hours) and on my Debian VM. Both new kernels are almost double the size of the one PCEngines posts on their website, so I’m obviously not using the same config that they have. But size is not really an issue for me since I’m working with a 16 GB usb stick. So I put both new kernels in place (copied them to the same location as the original kernel with a different name and added an entry in my syslinux.cfg file for them).

When I Boot to the new kernels the system just continuously reboots back the the syslinux menu screen.

I suspect that this is my lack of knowledge on building the Linux kernel. I did as Andyj mentioned above “make bzImage modules” but all I copied from my build directory to the usb stick was the vmlinux file. I suspect I need to copy the modules but do not know where they are.