LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 04-30-2023, 10:12 AM   #1
nononono
LQ Newbie
 
Registered: Apr 2023
Posts: 2

Rep: Reputation: 0
Angry linux/init.h not found


Whatever I'm doing, it returns a fatal error. So far, I have tried loading and reloading kernel files. I checked the directory where it's supposed to be, and the file init.h is there. I also tried to write a full path to the directory, but then it suddenly gave me a fatal error that there is no linux/lists.h or something similar. After including it, it gave me another fatal error and so on, until it demanded compiler_types. I added an include with the full path to compiler_types, but every compilation attempt failed because compiler_types was not found (everything was in the linux directory).

I also tried creating a new Ubuntu virtual machine, but the issue persists. Please help. I am really new to Linux and need to finish my coursework by tomorrow

does it have something to do with my kernel version? (i have the newest by now)
 
Old 04-30-2023, 10:27 AM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,973

Rep: Reputation: 271Reputation: 271Reputation: 271
What are you doing? I suspect you're trying to build the kernel.

<>-type includes look in 'the standard system directories'. The errors you report sound as though the compiler disagrees with the system about the standard system directories. It's usually a fool's errand to change all the <>-includes to ""-includes: there are too many. Where is linux/init.h?
 
Old 04-30-2023, 10:35 AM   #3
nononono
LQ Newbie
 
Registered: Apr 2023
Posts: 2

Original Poster
Rep: Reputation: 0
Basically, i tried to change #include <linux/init.h> so it would be
#include </usr/src/linux-headers-5.19.0-41-generic/include/linux/init.h>, but it results in more errors.
I need to make a simple firewall in Linux.
 
Old 04-30-2023, 11:38 AM   #4
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,154
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
https://www.geeksforgeeks.org/c-c-in...with-examples/
 
Old 04-30-2023, 11:44 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,073

Rep: Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364
I don't understand it. If it is a course you got all the required info to make it. But you did not give us any details, so actually we cannot tell you what went wrong.
Using full path in includes is not really suggested. What kind of course is it at all?
From my side I think you missed a command line option somewhere, or mistyped something, but obviously without details it is just a wild guess.
 
Old 04-30-2023, 10:19 PM   #6
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,973

Rep: Reputation: 271Reputation: 271Reputation: 271
How does one know what directories are looked in?
 
Old 05-01-2023, 08:55 AM   #7
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,154
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
Quote:
How does one know what directories are looked in?
find and locate, or any if the graphical search tools.

Also:
Code:
$(gcc -print-prog-name=cc1plus) -v
$(gcc -print-prog-name=cpp) -v

$(gcc -print-prog-name=cc1) -v

echo "#include <stdio.h>" > t.c; gcc -v t.c; rm t.c

gcc -v -E - < /dev/null

gcc -v -E -xc - < /dev/null
Etc.
 
1 members found this post helpful.
Old 05-01-2023, 02:44 PM   #8
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,973

Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by teckk View Post
find and locate
find what?
Code:
find the include directories
? I didn't ask how to know where they were but to know what they were.
Some of your subsequent answers seem to point the answer.

The last few instances of building the kernel have returned a failure to find asm/byteorder.h for both insn.h and orc_types.h. I replace the <> includes with fully-qualified includes, which works. But there are 527 instances of includes of asm/byteorder.h in the source: why does it fail to find only in thoses 2 instances? I've been building my kernel for more than 20 years - it's just happened in the last 3 versions.
 
  


Reply

Tags
firewall, kernel, linux



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble installing Linux kernel version 5.14.12 - kernel panic not syncing no working init found try passing init psrksprasad Linux - Desktop 9 10-18-2021 05:23 AM
[SOLVED] No package 'x11' found No package 'xext' found No package 'xdamage' found No package 'xfixes' found No package 'x11-xcb' found Jigsaw Linux From Scratch 14 02-23-2021 08:35 PM
What is the exact diff between init 1,init S and init s challavijay Linux - Newbie 1 08-05-2010 06:51 AM
Kernel panic - not syncing: No init found. Try passing init= option to kernel ranjithmrk Linux - Newbie 4 08-22-2008 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration