Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7843033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:27:18+00:00 2026-06-02T16:27:18+00:00

I’m working on building kexec as an external kernel module, using the Android NDK.

  • 0

I’m working on building kexec as an external kernel module, using the Android NDK. I know I have all my environment variables set correctly.

The module is based on code from an android forum, which is based on the kexec.c that linux normally would build into the kernel. The eventual goal is to bypass the locked bootloader by loading a second kernel after the initial one.

I’m running into multiple errors, most likely all related to stuff in the .h file. My C skills are really rusty, but here are the top several errors:

make -C /media/disk/android/kernel/omap3 M=/media/disk/android/kexec modules
make[1]: Entering directory `/media/disk/android/kernel/omap3'
  CC [M]  /media/disk/android/kexec/kexec.o
/media/disk/android/kexec/kexec.c:52: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/media/disk/android/kexec/kexec.c:55: error: 'VMCOREINFO_BYTES' undeclared here (not in a function)
/media/disk/android/kexec/kexec.c:56: error: 'VMCOREINFO_NOTE_SIZE' undeclared here (not in a function)
/media/disk/android/kexec/kexec.c:115: warning: 'struct kimage' declared inside parameter list
/media/disk/android/kexec/kexec.c:115: warning: its scope is only this definition or declaration, 
    which is probably not what you want
/media/disk/android/kexec/kexec.c:118: warning: 'struct kimage' declared inside parameter list
/media/disk/android/kexec/kexec.c:122: warning: 'struct kimage' declared inside parameter list
/media/disk/android/kexec/kexec.c: In function 'do_kimage_alloc':
/media/disk/android/kexec/kexec.c:131: error: dereferencing pointer to incomplete type

Anyway, the offending snippet is below, and there are also the following links to the pastebined full source of kexec.c and kexec.h.

  • complete error log: http://pastebin.com/bf5XTEmS
  • kexec.c http://pastebin.com/zqbbSfLk
  • kexec.h http://pastebin.com/M1Mpp6YX

Thanks!

MODULE_LICENSE("GPL");

/* Syscall table */
void **sys_call_table;

/* original and new reboot syscall */
asmlinkage long (*original_reboot)(int magic1, int magic2, unsigned int cmd, void __user *arg);
extern asmlinkage long reboot(int magic1, int magic2, unsigned int cmd, void __user *arg);

/* Per cpu memory for storing cpu states in case of system crash. */
note_buf_t *crash_notes;

/* vmcoreinfo stuff */
unsigned char vmcoreinfo_data[VMCOREINFO_BYTES];
u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
size_t vmcoreinfo_size;
size_t vmcoreinfo_max_size = sizeof(vmcoreinfo_data);

/* Location of the reserved area for the crash kernel */
struct resource crashk_res = {
    .name  = "Crash kernel",
    .start = 0,
    .end   = 0,
    .flags = IORESOURCE_BUSY | IORESOURCE_MEM
};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:27:19+00:00Added an answer on June 2, 2026 at 4:27 pm

    Try defining CONFIG_KEXEC. Without this define all relevant defintions in kexec.h are not included, which then in turn leads to at least some of the error messages you get.

    To do so you might add -DCONFIG_KEXEC to CFLAGS or any approriate enviroment variable, or just edit the Makefile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.