Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Arrow How to execute a static program from the kernel.


    I am coding on the 2.6.11 linux kernel.
    I need to run my program when the kernel is booting up.
    I checked in init/main.c

    run_init_process(execute_command) where
    execute_command = "/init" seems to be running
    from the initrd image. I checked there is no init in /

    If I comment this code and add my own init to /init or /sbin/init
    and run it by calling execve("/init") or execve("/sbin/init")
    the kernel builds fine, but does not boot up
    and issues kernel panic : init not found...pass init= to kernel.

    How can we add our own version of init and run it
    instead of the kernel loading the init from its initrd image?

    Please help.

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    St. Petersburg, FL
    Just change the execute_command argument to "/sbin/init" or wherever your custom init is located.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts