Jump to content

Recommended Posts

Posted (edited)

hello!

 

I need to create my own initial ramdisk during the armbian build process by supplying a value to this kernel tag:-

 

grep CONFIG_INITRAMFS_SOURCE /home/andrew/armbian/build/cache/sources/linux-kernel-worktree/6.18__sunxi__armhf/.config
CONFIG_INITRAMFS_SOURCE="usr/sideinitrd.cpio"

 

my build runs under docker, and no matter where i place the CPIO file, i get this error:

 

[🐳|🔨]   make[3]: *** No rule to make target 'usr/sideinitrd.cpio', needed by 'usr/initramfs_inc_data'.  Stop.
[🐳|🔨]   make[2]: *** [scripts/Makefile.build:556: usr] Error 2
[🐳|🔨]   make[2]: *** Waiting for unfinished jobs....

 

just speculating, but maybe the armbian build cannot find my CPIO file in my compile tree known to docker:-

 

pwd
/home/andrew/armbian/build
andrew@my-vps:~/armbian/build$ ls
CONTRIBUTING.md  Dockerfile  README.md  action.yml         buildarmbian2.txt  compile.sh  extensions  output    patch             shell.nix  userpatches
CREDITS.md       LICENSE     VERSION    buildarmbian1.txt  cache              config      lib         packages  requirements.txt  tools
 

chatGPT and gemini have wasted days on bogus suggestions on where to place it relative to my compile tree.  i have tried many locations without success.

 

EXPLANATION FROM GEMINI:-

Armbian’s build process is designed to be "clean." When you run it inside Docker, it follows a strict sequence:

    Step A: It prepares the environment.
    Step B: It runs a "cleanup" on the kernel source to ensure no "junk" from previous builds exists (this deletes your .cpio file).
    Step 😄 It checks your .config and starts the make command.

Because Step B happens every time you start the build, any file you manually copy into the kernel tree gets deleted seconds before the compiler actually looks for it. That is why you kept seeing No rule to make target.

 

i am wondering if anyone has already done this before and how they got it going?   latest log attached.

 

help!

 

andrew. 

buildarmbian2.txt.gz

Edited by Andrew Routley
Posted (edited)

I don't know about customizing the initrd during the armbian build process.

 

But this is the way to customize it AFTER you get armbian running in your board

 

https://forum.armbian.com/topic/53568-how-to-add-a-specific-single-file-in-the-initrdimg-ideally-automatically-with-update-initramfs/#comment-221767

 

I know it is not YOUR OWN INITRD, but maybe you can work with it.

 

Large language models are more useful when the answer exists somewhere in a popular website.

 

If no human has written about it, ChatGPT or Gemini will not give you the answer.

 

Have you tried replacing the uImage file in the /boot folder, with your own initrd, converted to uinitrd?

Edited by robertoj
Posted

Thanks @robertoj as a matter of fact this is my own custom initial ramdisk.  I've been running it as a standalone file for some time and it works great but now I want to integrate it inside the kernel itself.

 

for this I need to set CONFIG_INITRAMFS_SOURCE during the make process.

Posted

I see that this configuration is a kernel build feature, not an armbian-developed function:

 

https://cateee.net/lkddb/web-lkddb/INITRAMFS_SOURCE.html

https://unix.stackexchange.com/questions/479415/how-does-linux-know-where-the-rootfs-is

 

So, you can post your question in many more linux discussion places. I hope you get the answer :) (and share here).

 

Have you ever got this INITRAMFS_SOURCE configuration work, outside of Armbian... for example building the kernel from source by itself?

Posted

yes i have CONFIG_INITRAMFS_SOURCE working on my server no drama.  i was hoping to be able to roll my own initrd on armbian as well.

 

LONG ANSWER:  the problem is that the armbian build system does housecleaning before the kernel make starts.  part of this is to delete any folder thats not part of the source tree.  so the questions are:  1)  where do i put it so its visible to the make?  2)  how do i stop the build from deleting it? 

 

chatgpt+gemini have given lots of ideas like patches, hooks, extensions but none of them work. (grrrrrr!).

Posted

I suggest to try kernel-patch build command. Your changes then are compiled into a patch which is then applied to the kernel source before building.

Posted

Yep Already tried that:-

 

"chatgpt+gemini have given lots of ideas like patches, hooks, extensions but none of them work. (grrrrrr!)."

 

Didn't work probably because the source is not an ASCII text file but a large CPIO binary.

 

But....I am just running a make right now which looks like it might work..... don't want to jinx it....

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines