Is executable code stored uniquely in tmpfs copied to another part of RAM when run?
Your question appears to have been answered in a post on the Linux Kernel Mailing List in 2007
(As tmps is a scheme for storing in the filesystem cache code, with no backing storage, the mentioned buffer cache should I believe be the "original")
Phillip Susi asked:
The question is, when you execute a binary on tmpfs, does its code segment get
mapped directly where it's at in the buffer cache, or does it get copied to
another page for the executing process? At least, assuming this is possible
due to the vma and file offsets of the segment being aligned.
And Hugh Dickens replied
Its pages are mapped directly into the executing process, without copying.
You might want to read the full thread - a note is made that this depends on having a system with an MMU, and then the discussion veers into tmpfs's non-persistence.
Linux's copy-on-write behavior would I believe mean that any data page you write to would get a unique copy created for your process at the time of the first writing.
Initramfs built into custom Linux kernel is not running
I figured it out. I will post the answer in case anyone else has this issue.
I was missing a console device, this line was the clue:
Warning: unable to open an initial console.
After adding printk's so that I better understood the startup sequence, I realized that console device is opened prior to running the init script. Therefore, the console device must be in the initramfs filesystem directly, and we cannot rely on the devtmpfs mount to create that.
I think when the init script ran the shell was trying to open the console and failed, that's why the kernel was outputting:
Kernel panic - not syncing: Attempted to kill init!
Executing the folowing commands from within the /dev directory of initramfs on the kernel build machine will generate the required device nodes:
mknod -m 622 console c 5 1
mknod -m 622 tty0 c 4 0
After re-CPIO archiving the filesystem and rebuilding the kernel, I finally have a working filesystem in initramfs that the kernel will boot.
Linux initramfs switch_root unable to find console which kernel uses
Finally I found the solution (and the mistake I made)!
The console device was created with the wrong major/minor numbers.
Creating it with the same as the kernel assigns to ttymxc* it works:
mknod -m 644 ${ROOT}/dev/${CONSOLE} c 207 17
Related Topics
How to Copy The Top 10 Most Recent Files from One Directory to Another
Splitting Bulk Text File Every N Line
How to Manually Install The Eclipse-Cdt Plugin from an Archive/Zip on Ubuntu
Find Files Modified Over 1 Hour Ago But Less Than 3 Days
What's The Meaning of 'Blacklisted' on Gstreamer
How to Find Sample Source Files for Linux Device Drivers, Third Edition
How to Convert Fixed Size Dimension to Unlimited in a Netcdf File
Linux: How to Put a Load on System Memory
Redirecting Apache Logs to Stdout
Mongo Daemon Doesn't Run by Service Mongod Start
How to Compile Intel MAC Binaries on Linux
How to Use Gpg Signing Key on a Remote Server
How to Take Advantage of The Vdso Object with Your Own Programming Language
Linux Kernel - How to Get Physical Address (Memory Management)
How to Store Output from Printf with Formatting in a Variable
Can't Access Publicly Exposed Docker Container Port from External Machine, Only from Localhost