Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: christully on December 28, 2018, 12:19:18 PM
-
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?
-
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.
-
Why do you need overlayfs to edit those files? It's an in-memory thing, with the underlying filesystems being normal ext*/etc, no?
-
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.
-
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?"
-
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
-
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?
-
Using this config change:
<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.
-
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?
-
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
-
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!
-
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.
-
...
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
-
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.
-
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.
-
There is a "make modules_install MOD_INSTALL_PATH=/path/to/where/you/want/them" that you will need to run also, but follow the instructions in the sorter.sh file from github to make the canonical module extensions. Otherwise you can add modules to the existing rootfs initrd or make your own modules initrd, which is probably what you want anyway.
-
Thank you Andy,
I will check into this tomorrow
-
And more question. I am not familiar with the GitHub repo that has sorter.sh. I’ll do a search tomorrow but that is such a short name that I anticipate lots of hits and not necessarily finding the one you have in mind.
-
Hi christully
I think this might be it:
https://github.com/tinycorelinux/sorter
-
Sorter.sh: https://github.com/tinycorelinux/sorter/blob/master/sorter.sh (https://github.com/tinycorelinux/sorter/blob/master/sorter.sh). If you haven't already discovered, the initrd images are in cpio format, so you will need to create a temporary directory and cd to it, zcat /path/to/existing/rootfs.gz | sudo cpio -i, add the files, then "sudo find . | sudo cpio -o -H newc | gzip > /path/to/new/initrd.gz" file and add it to extlinux.conf.
-
Andy,
Thanks for all of your help!!!
I think I would have twigged to the Clio bit fairly quickly but thanks for the heads up.
And thanks for the link.
Chris
-
"Continuously reboots back to syslinux screen" - at what point does it reboot? If it reboots before you see TC messages (the colored ones saying version 6, running udev, etc etc), then your issue is not the lack of modules. In that case it would be an incompatibility with the hw, and their kernel is probably modified to support their hw better.
-
I have 3 options on my boot menu. If I pick the one pointing to my new kernel, I never see any messages. It just redisplays the boot menu and restarts the countdown timer.
I have it set to wait 30 seconds and then automatically pick a profile that points to the PCEngines supplied kernel and a user level login.
-
Correction!
I see two messages:
Loading vmlinuz.new... ok
loading core.gz...
And then it goes back to the boot menu.
-
I tried to edit my last post but it seems I waited too long... Scrolling through my console history I noticed I left off one line of output:
Loading vmlinuz.new... ok
Loading core.gz...ok
Booting kernel failed: Invalid argument
-
As I have learned more and more about Linux while trying to figure out how to compile TC for my APU, I have discovered that doing so is not necessary.
I have a file on the APU named "overlay" which i mistakenly assumed was an overlayfs file. I have discovered with the help of a colleague and using the file command that it is an ext4 filesystem and have successfully mounted and edited it on my working copy of TC 6.4!
Thanks to all for your help here - I have learned a lot in this process and that has helped me get where I am today with my project!
Chris