Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
2
answers
3860
views
VBox Guest Additions installation can't find headers for Kali kernal 4.14.0-kali1-amd64
I have installed Kali in VirtualBox and now trying to install Guest Additions to get full screen view. I updated and installed my packages and installed dkms. When I try to install linux-headers I get the following: # apt-get install linux-headers-$(uname -r) Reading package lists... Done Building d...
I have installed Kali in VirtualBox and now trying to install Guest Additions to get full screen view.
I updated and installed my packages and installed dkms. When I try to install linux-headers I get the following:
# apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-headers-4.14.0-kali1-amd64 is already the newest version (4.14.2-1kali1).
0 upgraded, 0 newly installed, 0 to remove and 86 not upgraded.
The headers installed are as follows:
# dpkg --get-selections | grep linux-headers
linux-headers-4.14.0-kali1-amd64 install
linux-headers-4.14.0-kali1-common install
linux-headers-amd64 install
When I try to run the Guest Additions CD I get the following:
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.0.40 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 5.0.40 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
update-initramfs: Generating /boot/initrd.img-4.13.0-kali1-amd64
update-initramfs: Generating /boot/initrd.img-4.14.0-kali1-amd64
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
Building the main Guest Additions module ...fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions ...done.
Press Return to close this window...
It appears to me that the correct linux headers for the kernal are installed. Why is VBox not able to find them?
Tried updating to VBox 5.2.2 but after removing existing version and installing 5.2.2 I was unable to launch Kali-Linux - screenshot attached
.

Chris Fgl
(19 rep)
Dec 18, 2017, 09:25 AM
• Last activity: May 22, 2025, 05:04 AM
0
votes
3
answers
16142
views
Curl : Read headers from a file and use them in a cURL command
I have a bash script with the following curl command : curl -v -X GET https://example.com -H ~/Desktop/headers.txt -o ~/Desktop/file.txt When i run the bash script i am getting unothorized 401. Obviously i am not reading the header file correctly. My header file looks like that "Authorization: Beare...
I have a bash script with the following curl command :
curl -v -X GET https://example.com -H ~/Desktop/headers.txt -o ~/Desktop/file.txt
When i run the bash script i am getting unothorized 401. Obviously i am not reading the header file correctly. My header file looks like that "Authorization: Bearer 40bsafsdgds34234....". My curl version is 7.26
Thanos M
(183 rep)
Sep 28, 2018, 01:38 PM
• Last activity: Apr 22, 2025, 03:34 PM
0
votes
0
answers
30
views
Failed to run 'splint' to check code in embedded project
I am working on an embedded Linux system (kernel-5.10.24) on an SOC platform. Now I am trying to use splint to do code analysis, but I hit parse errors. I am using GNU toolchains for the SOC (mips), and the command line of splint is as follows, ``` splint -Iout/buildroot/usr/include/ -I/home/dev/mip...
I am working on an embedded Linux system (kernel-5.10.24) on an SOC platform. Now I am trying to use splint to do code analysis, but I hit parse errors.
I am using GNU toolchains for the SOC (mips), and the command line of splint is as follows,
splint -Iout/buildroot/usr/include/ -I/home/dev/mips-gcc/mips-linux-gnu/libc/usr/include/ -preproc -nestcomment -skipposixheaders -skipisoheaders +
trytorecover +posixlib test_project/src/*.c
And I got following error,
Splint 3.1.2 --- 20 Feb 2018
Command Line: Setting -skipposixheaders redundant with current value
out/buildroot/usr/include/bits/types.h:145:24: Parse Error: Non-function declaration:
__STD_TYPE : int. Attempting to continue.
out/buildroot/usr/include/bits/types.h:149:34: Cannot recover from parse error.
*** Cannot continue.
I checked the types.h
, and got,
141 #include /* Defines __*_T_TYPE macros. */
142 #include /* Defines __TIME*_T_TYPE macros. */
143
144
145 __STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */
146 __STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */
147 __STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */
148 __STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */
149 __STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/
150 __STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */
151 __STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */
152 __STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */
I don't know how to fix this issue, and run splint to check my embedded projects.
wangt13
(631 rep)
Sep 26, 2024, 12:38 AM
• Last activity: Sep 26, 2024, 04:39 AM
7
votes
2
answers
1704
views
Detached LUKS-header on Debian-based GNU/Linux
There is scattered information on how to set up a detached header for a LUKS-encrypted disk on Stack Exchange.  And by searching the web using Google, I found limited information.  Some of the best information I found is linked to at the bottom of the question.  Some of it was he...
There is scattered information on how to set up a detached header
for a LUKS-encrypted disk on Stack Exchange.
And by searching the web using Google, I found limited information.
Some of the best information I found
is linked to at the bottom of the question.
Some of it was helpful, even to a newbie like me.
But some seemed incomplete and I was therefore motivated to write this.
Please see if you can help with the question below,
to make it complete and working.
I assume the reader has used
lsblk
to find that the drive of header that should be detached is sdb
, and stored on some other drive sda
.
----------
*Method 1: Making a header into a partition*
1) Find out the size of the header, and make a partition the correct size.
The following command will give you a lot of information.
Take note of the number next to offset
under Data segments:
$ cryptsetup luksDump /dev/sdb
...
Data segments:
0: crypt
offset: 16777216 [bytes]
length: (whole device)
cipher: aes-xts-plain64
sector: 512 [bytes]
...
Execute fdisk
(install it if you do not have it)
with $ fdisk /dev/sda
.
Give it the command n
and press Enter.
Make a primary partition with the default partition number; say it is *X*.
Choose and take note of the value of the default first sector
(say it is the number *M*).
It will prompt you for the last sector; let's call it *K*.
To find a suitable number *K* to enter (and assuming that the size of a sector is 512 bytes), calculate *K* = *M* + *offset*/512; where *offset* is the number you found above using the luksDump
command of cryptsetup
.
It will make a partition that is exactly the size of the luks-header. Finally, write the changes with w
. Now export the luks-header to ~/some/file/path/header.img
and write it to the partition that you made:
$ cryptsetup luksHeaderBackup /dev/sdb --header-backup-file ~/some/file/path/header.img $ dd if=~/some/file/path/header.img of=/dev/sdaX count=offset/512 bs=512 status=progresswhere *X* and *K* are the numbers that were chosen with
fdisk
above.
Now the header is stored on sdaX
, and for fun, if you open (and if necessary install) the gparted
program, you will see that gparted thinks sdaX
is a tiny LUKS-encrypted partition!
You will see with lsblk -f
that the UUID of /dev/sdaX
is the same as that of /dev/sdb
. So you have to generate a new UUID (search Google for a 'uuid generator'). Suppose the newly generated UUID is *newuuid*; then change it by
$ cryptsetup luksUUID --uuid newuuid /dev/sdaX2) Now we have to enter this information into
/etc/crypttab
.
Open the file with your text editor, and find the line that refers to sdb
.
In the fourth column add the option header=/dev/sdaX
.
**See the answer of frostschutz for how to do this much better by setting header=/dev/disk/by-uuid/UUID.
Be sure to make this modification and upvote their answer.**
Then write $ update-initramfs -u -k all
.
If there were no errors, then I think you are good.
----------
*Method 2 : Letting the header be a file on a file system*
The documentation and other sources say that it should be possible to just copy the header to a file system on sda
and refer to it from there. Say we say that the file system of the partition sda1
has
UUID=###########-############-####-########
And relative to sda1
, the header is in /some/path/header.img
.
Then crypttab(5) says that in the fourth column of /etc/crypttab
I should write
header=/some/path/header.img:UUID=###########-############-####-########
But if I do that, update-initramfs
complains that the header isn't found.
**QUESTION: CAN YOU PLEASE HAVE A LOOK AND QUOTE WHAT TO WRITE.
MY INSTALL OF DEBIAN IS FRESH, AND I CAN'T GET IT TO WORK UNFORTUNATELY.**
----------
In closing; you can erase the information in the existing header with cryptsetup luksErase /dev/sdb
. If you ever want to apply cryptsetup to access information about the encrypted partition, you will now have to pass it the --header /dev/sdax
-option. I have done my best to make sure everything is correct and detailed. But there could be a bug. Please feel free to edit. Of course, there is no warranty in case you lose your data or break something.
Sources/other reading:
- cryptsetup, detach header on existing volume (on Super User)
- Detached LUKS header (on USB) for an existing full-disk encryption device with Ubuntu
- How to use LUKS with a detached header (on LinuxConfig.org)
- crypttab(5) on Debian Manpages
- crypttab(5) on man7.org
Mikkel Rev
(253 rep)
Oct 7, 2022, 08:56 PM
• Last activity: Jun 14, 2024, 12:54 PM
0
votes
0
answers
562
views
Missing header files for linux development
I am new to linux development and I want to develop a linux module, but I am running into an issue. Some header files, notably ` `, are missing (/not found) I am currently using Visual Studio 2022 on my Windows desktop and am building my project through SSH on my Raspberry Pi 5. I successfully conne...
I am new to linux development and I want to develop a linux module, but I am running into an issue.
Some header files, notably ``, are missing (/not found)
I am currently using Visual Studio 2022 on my Windows desktop and am building my project through SSH on my Raspberry Pi 5.
I successfully connected my Raspberry Pi 5 to Visual Studio and see that most header files are being synced (ie:
kernel.h
and module.h
).
Also double checked at C:\Users\op\AppData\Local\Microsoft\Linux\HeaderCache\1.0
.
That being said, as mentioned above, I am missing init.h
After looking at other prior posts from different people, I have double checked that linux-headers-generic is installed
, which it is:
op@raspberrypi:~ $ sudo apt-get install linux-headers-generic
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'linux-headers-arm64' instead of 'linux-headers-generic'
linux-headers-arm64 is already the newest version (6.1.90-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
and
op@raspberrypi:~ $ sudo apt-get -y install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-headers-6.6.28+rpt-rpi-2712 is already the newest version (1:6.6.28-1+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
So I am kind of lost at this point, any help is appreciated.
**EDIT**:
When running find, the init.h
header is found...
op@raspberrypi:~ $ sudo find /usr -name init.h
/usr/src/linux-headers-6.6.28+rpt-common-rpi/include/trace/stages/init.h
/usr/src/linux-headers-6.6.28+rpt-common-rpi/include/linux/init.h
/usr/src/linux-headers-6.6.28+rpt-common-rpi/include/linux/sched/init.h
/usr/src/linux-headers-6.1.0-rpi4-common-rpi/include/trace/stages/init.h
/usr/src/linux-headers-6.1.0-rpi4-common-rpi/include/linux/init.h
/usr/src/linux-headers-6.1.0-rpi4-common-rpi/include/linux/sched/init.h
/usr/src/linux-headers-6.1.0-21-common/include/trace/stages/init.h
/usr/src/linux-headers-6.1.0-21-common/include/linux/init.h
/usr/src/linux-headers-6.1.0-21-common/include/linux/sched/init.h
/usr/src/linux-headers-6.1.0-21-common/arch/x86/include/asm/init.h
Which does correspond to my kernel version:
op@raspberrypi:~ $ uname -r
6.6.28+rpt-rpi-2712
Dennis Solomon
(51 rep)
May 11, 2024, 06:27 PM
0
votes
1
answers
485
views
How to defer kernel updates until the corresponding "linux-headers" package is available?
I'm using Debian 12 Bookworm, and currently, when I run ```uname -a```, it shows: ``` Linux pctxd 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux ``` The package linux-image-6.1.0-21-amd64 and related packages are ready to install. However, the corresponding linux...
I'm using Debian 12 Bookworm, and currently, when I run
-a
, it shows:
Linux pctxd 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux
The package linux-image-6.1.0-21-amd64 and related packages are ready to install. However, the corresponding linux-headers-6.1.0-21-amd64 package is not available. Without these headers, the Nvidia drivers can't be compiled, rendering the graphical user interface non-functional—something I learned the hard way during the last upgrade to 6.1.85-1.
Running aptitude show yields:
Package: linux-image-6.1.0-21-amd64
Version: 6.1.90-1
New: yes
State: not installed
Priority: optional
Section: kernel
Maintainer: Debian Kernel Team
Architecture: amd64
Uncompressed Size: 408 M
Depends: kmod, linux-base (>= 4.3~), initramfs-tools (>= 0.120+deb8u2) | linux-initramfs-tool
Recommends: firmware-linux-free, apparmor
Suggests: linux-doc-6.1, debian-kernel-handbook, grub-pc | grub-efi-amd64 | extlinux
Conflicts: linux-image-6.1.0-21-amd64-unsigned
Breaks: fwupdate (< 12-7), initramfs-tools (< 0.120+deb8u2), wireless-regdb (< 2019.06.03-1~)
Replaces: linux-image-6.1.0-21-amd64-unsigned
Provides: $kernel (= 6.1.90-1)
Just now, web page Package: linux-headers-6.1.0-21-amd64 seems to describe the missing package, but clicking the “list of files” button results in a error page with the information “No such package in this suite on this architecture.”
Currently, there is another Security update (regarding libglib2.0) waiting. So, the time lag between the kernel security update and the linux header files necessary for my graphic UI is a increasing risk.
For future updates: Is there a way to automatically defer the kernel update until the linux-headers package is available but process the security updates of other packages?
gh57.at
(13 rep)
May 8, 2024, 11:03 AM
• Last activity: May 8, 2024, 12:28 PM
2
votes
2
answers
186
views
Does GRUB 2.12 now support detached headers?
In [GRUB's project status update, at FOSDEM 2022][1], they talked about adding detached headers support in GRUB 2.12 (for decryption) : > Add cryptodisk detached headers and key files support, Denis 'GNUtoo' Carikli, Glenn Washburn,Patrick Steinhardt GRUB 2.12 was released in December 2023, but I co...
In GRUB's project status update, at FOSDEM 2022 , they talked about adding detached headers support in GRUB 2.12 (for decryption) :
> Add cryptodisk detached headers and key files support, Denis 'GNUtoo' Carikli, Glenn Washburn,Patrick Steinhardt
GRUB 2.12 was released in December 2023, but I couldn't find any mention of that feature in its
NEWS
file .
Does anybody know if 2.12 now supports detached headers, as initially planned ?
ChennyStar
(1969 rep)
Feb 23, 2024, 05:36 AM
• Last activity: Feb 23, 2024, 09:05 AM
4
votes
2
answers
24928
views
mpi.h not found
I tried to compile the Hello World program in C, inside Eclipse PTP, but it gives me an error related to `mpi.h`. I have included `/usr/local/include` and `/usr/local/lib` in my paths, and also tried running a search with `find / -name mpi.h`. I still get a *No such file or directory* error. I tried...
I tried to compile the Hello World program in C, inside Eclipse PTP, but it gives me an error related to
mpi.h
.
I have included /usr/local/include
and /usr/local/lib
in my paths, and also tried running a search with find / -name mpi.h
. I still get a *No such file or directory* error.
I tried to install mpich2
, but still couldn't find mpi.h
.
Also:
- There is no folder inside the include
directory, why is that?
- I can find mpicc
at /usr/bin/mpicc
The same problem occurs when trying to compile the project as C++ code. What should I do?
Dalia Shouman
(57 rep)
Oct 21, 2015, 02:40 PM
• Last activity: Nov 18, 2023, 11:47 AM
1
votes
1
answers
532
views
Why should copying luks headers with dd cause errors on the drive I am reading?
**Summary of the problem.** I want to use a detached luks header for a luks-encrypted block device, `/dev/nvme0n1p1`, by making it into a USB flash drive partition, and afterwards erasing the keys that are on the header of the block device. I have [limited details][1] on how to do it, but my plan is...
**Summary of the problem.** I want to use a detached luks header for a luks-encrypted block device,
/dev/nvme0n1p1
, by making it into a USB flash drive partition, and afterwards erasing the keys that are on the header of the block device. I have limited details on how to do it, but my plan is to (1) set the size of the flash drive partition, /dev/sda3
, to exactly the size of the header. Then (2) use dd if=/dev/nvme0n1p1 of=/dev/sda3 bs=4096 count=4096
to overwrite the space on the new partition with the header information. (3) Enter the header into the options of /etc/crypttab
and generate new initramfs. I hoped this would work. But after I ran the dd
-command (without yet editing crypttab) I tried to rebuild initramfs, but received the following error:
$ update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-5.10.0-18-amd64
cryptsetup: ERROR: nvme0n1p1_crypt: Source mismatch
update-initramfs: Generating /boot/initrd.img-5.10.0-9-amd64
cryptsetup: ERROR: nvme0n1p1_crypt: Source mismatc
My questions are: (1) Why am I getting these errors? I don't understand why copying data should cause an error on the file system from which I am reading. (2) What's the right way to write the header to flash drive, if it is not with dd
.
**Details and any research.**
I have searched google and stack exchange, and the seemingly most relevant thing was this . When I ran the command, I received the following information.
$ dmsetup info -c --noheadings -o devnos_used -- "nvme0n1p1_crypt"
259:1
Also this guide that I linked to above (in my opinion) seems to suggest that I should do it in this way.
Mikkel Rev
(253 rep)
Oct 3, 2022, 12:33 AM
• Last activity: Nov 27, 2022, 03:04 PM
0
votes
1
answers
309
views
Missing EXTERN.h file when installing claws-mail on Fedora 37
I've trying to compile Claws-mail but got error: ``` perl_plugin.c:54:10: fatal error: EXTERN.h: No such file or directory 54 | #include ``` I've installed perl-core perl-devel was already installed. I can run perl -v ``` # perl -v | grep built This is perl 5, version 36, subversion 0 (v5.36.0) buil...
I've trying to compile Claws-mail but got error:
perl_plugin.c:54:10: fatal error: EXTERN.h: No such file or directory
54 | #include
I've installed perl-core perl-devel was already installed.
I can run perl -v
# perl -v | grep built
This is perl 5, version 36, subversion 0 (v5.36.0) built for x86_64-linux-thread-multi
but the problem is that there is no /usr/lib/perl5
directory. I've found that the file is in /usr/lib64/perl/CORE/
but I have no idea how the compile the application, the author of Claws-mail said that something is wrong with my system and he can't help me.
I've tried to add
export INCLUDE="/usr/lib64/perl/CORE/"
but the error remains. I'm not able to compile the application.
What's weird is that [list of package files](https://fedora.pkgs.org/37/fedora-updates-testing-x86_64/perl-devel-5.36.0-492.fc37.i686.rpm.html) shows that the path should be /usr/lib/
not /usr/lib64
.
My system was upgraded from I think Fedora 35.
jcubic
(10310 rep)
Nov 21, 2022, 09:56 AM
• Last activity: Nov 21, 2022, 03:57 PM
9
votes
2
answers
1282
views
Why is there no WORD_BIT in limits.h on Linux?
From the manpage `man limits.h`: ``` {WORD_BIT} Number of bits in an object of type int. Minimum Acceptable Value: 32 ``` However if I run a simple program: ``` #include #include int main() { printf("%d\n", WORD_BIT); return 0; } ``` However when trying to compile with gcc (`gcc file.c -o file`) I g...
From the manpage
man limits.h
:
{WORD_BIT}
Number of bits in an object of type int.
Minimum Acceptable Value: 32
However if I run a simple program:
#include
#include
int main() {
printf("%d\n", WORD_BIT);
return 0;
}
However when trying to compile with gcc (gcc file.c -o file
) I get the following:
error: ‘WORD_BIT’ undeclared (first use in this function)
How come this is not defined on my system, and where else can I find this information (in a C program)?
My system:
* Fedora 36 (Silverblue)
* gcc version 12.2.1 20220819 (Red Hat 12.2.1-1) (GCC)
* ldd (GNU libc) 2.35
rahmu
(20511 rep)
Sep 1, 2022, 11:17 AM
• Last activity: Sep 2, 2022, 11:10 AM
0
votes
1
answers
539
views
How to make a path available for the entire system in Ubuntu
My tflite directory is as follows: ``` /home/me/tensorflow_src/tensorflow/lite/ ``` However, I fail to import it in my C++ project: ``` #include "tensorflow/lite/interpreter.h" // getting a not found error ``` How can I add resolve this error? My assumption is that I'd need to add the tflite to my b...
My tflite directory is as follows:
/home/me/tensorflow_src/tensorflow/lite/
However, I fail to import it in my C++ project:
#include "tensorflow/lite/interpreter.h" // getting a not found error
How can I add resolve this error? My assumption is that I'd need to add the tflite to my bash to make it available for all of my projects. How can I add tflite to the bash file?
This is my CMAKE file:
cmake_minimum_required(VERSION 3.22)
project(mediafile_device_crossverification)
set(CMAKE_CXX_STANDARD 17)
set(OpenCV FOUND 1)
find_package(OpenCV REQUIRED)
include_directories( ${OpenCV_INCLUDE_DIRS} )
add_executable(mediafile_device_crossverification main.cpp src/VideoProcessing.cpp src/VideoProcessing.h)
Levent Ozbek
(163 rep)
Jun 17, 2022, 08:18 AM
• Last activity: Jun 17, 2022, 08:03 PM
0
votes
1
answers
4442
views
How to find all possible locations for libraries and header files on any distro?
I found that the location of libraries and header files are very different on different distributions. For Example on Fedora you have `/usr/lib64/libbfd.a` while on Ubuntu you have `/usr/lib/x86_64-linux-gnu/libbfd.a`. Or on Fedora you have `/usr/lib/gcc/x86_64-redhat-linux/10/include/stdatomic.h` w...
I found that the location of libraries and header files are very different on different distributions. For Example on Fedora you have
/usr/lib64/libbfd.a
while on Ubuntu you have /usr/lib/x86_64-linux-gnu/libbfd.a
.
Or on Fedora you have /usr/lib/gcc/x86_64-redhat-linux/10/include/stdatomic.h
while on Ubuntu you have /usr/lib/gcc/x86_64-linux-gnu/10/include/stdatomic.h
Is there a way to know in which locations you have to look without maintaining a list of locations for every distribution?
Forivin
(1193 rep)
Sep 13, 2021, 03:13 PM
• Last activity: Sep 13, 2021, 03:20 PM
3
votes
1
answers
4569
views
Detached LUKS header (on USB) for an existing full-disk encryption device with Ubuntu
I already have a `/boot` partition on a USB stick and a LUKS partition on my computer, which correspond to a fulldisk encryption scheme with Ubuntu 21 I want to put the header of my LUKS partition onto the USB (either on the `/boot` partition or on another new partition on my USB) I have put the hea...
I already have a
/boot
partition on a USB stick and a LUKS partition on my computer, which correspond to a fulldisk encryption scheme with Ubuntu 21
I want to put the header of my LUKS partition onto the USB (either on the /boot
partition or on another new partition on my USB)
I have put the header (with cryptsetup luksHeaderBackup
) in boot_header.luks
on my boot partition (let say on device /dev/sda3
) then in the crypttab
file with the option header=
I tried the following :
- /boot/boot_header.luks
- /dev/sda3/boot_header.luks
- /dev/sda3:/boot_header.luks
and also /boot_header.luks:/dev/sda3
(to be sure)
and the same with the uuid of /dev/sda3
and also with /dev/disk/by-uuid/[uuid]
So I though the device sda3
wasn't mounted as it should be according to the doc of crypttab (if I understand it correctly)
> Optionally, the path [of the file containing the header] may be followed by ":" and an /etc/fstab
device specification (e.g. starting with "UUID=" or similar);
in which case, the path is relative to the device file system
root. The device gets mounted automatically for LUKS device
activation duration only.
So I looked for mounting the boot partition before the execution of the *cryptroot* script with a custom script in local-bottom
and init-bottom
. And also as suggested here I tried to incorporate the header in the initramfs following this answer
But the result at boot time is always the same :
> wrong value for 'header' option
I found that it was quite feasible with arch but is there a way to do the same with Ubuntu (without modifying an existing script like cryptroot) ?
Ben W
(113 rep)
Aug 14, 2021, 10:29 PM
• Last activity: Aug 23, 2021, 10:03 PM
0
votes
1
answers
349
views
How to tell 'find' command to jump to a position and search?
I'm preparing headers for a C++ project and I decided to use `find` to get include option to other header files. To list the right path, I need to use ```cd``` with it, like: cd 'PATH/TO/HEADER/FILE' find ../../../ And only this way I can get the list of header directory to copy-paste to the header...
I'm preparing headers for a C++ project and I decided to use
find
to get include option to other header files. To list the right path, I need to use
with it, like:
cd 'PATH/TO/HEADER/FILE'
find ../../../
And only this way I can get the list of header directory to copy-paste to the header file. After that, I had to:
cd 'PATH/TO/MY/PROJECT'
To switch back to project path.
It's inconvenient to use
often, so, can I tell find
command to automatically 'jump' to the directory and search? I read through the man page and can't figure it out.
find PATH/TO/HEADER/FILE
is not a solution because I deliberately want pathnames to start with ../../../
.
ArchBug
(15 rep)
Jun 27, 2021, 07:52 AM
• Last activity: Jun 27, 2021, 11:44 AM
8
votes
1
answers
11122
views
How to create Linux Kernel Headers from Linux Kernel Source?
I'm working with Tiny Core Linux and attempting to install Vmware Tools, which of course needs the Kernel Headers :-). It does not appear they have the Kernel Headers readily available in a package, but they do have the kernel source. As a result I downloaded that source, and I'm attempting to creat...
I'm working with Tiny Core Linux and attempting to install Vmware Tools, which of course needs the Kernel Headers :-).
It does not appear they have the Kernel Headers readily available in a package, but they do have the kernel source. As a result I downloaded that source, and I'm attempting to create headers from it, but I have no clue what I'm doing.
In the googling I ran into, it sounded like:
make headers_install
Might do what I need it to do, and this is in fact a proper make target, but it errors out on me with the following:
tc@box:/usr/src/linux-3.16.6$ make headers_install
CHK include/generated/uapi/linux/version.h
HOSTCC arch/x86/tools/relocs_32.o
In file included from arch/x86/tools/relocs_32.c:1:0:
arch/x86/tools/relocs.h:17:32: fatal error: tools/le_byteshift.h: No such file or directory
#include
^
compilation terminated.
scripts/Makefile.host:134: recipe for target 'arch/x86/tools/relocs_32.o' failed
make: *** [arch/x86/tools/relocs_32.o] Error 1
arch/x86/Makefile:181: recipe for target 'archscripts' failed
make: *** [archscripts] Error 2
Am I on the right track here, and I'm just missing a dependency or something, or am I completely on the wrong track?
Any pointers someone can give me on how to proceed next? It looks like "tools/le_byteshift.h" is somehow missing, but I'm not sure where to begin isolating what package that is even from to get this to work properly.
How does one make the kernel headers from the source? Any pointers greatly appreciated!
Doug
(459 rep)
May 26, 2015, 02:30 AM
• Last activity: Jun 11, 2021, 02:04 AM
1
votes
0
answers
416
views
squashed then re-squashed give different size?
I extracted a `firmware.bin` using fmk mod kit and gave me 3 files: `header.img , rootfs.img and footer.img` now whenever I cat and repack all the files together in `firmware2.bin` again, it works and it upgrades the router. but when I unsquash the `rootfs.img` using this command `unsquashfs rootfs....
I extracted a
firmware.bin
using fmk mod kit and gave me 3 files: header.img , rootfs.img and footer.img
now whenever I cat and repack all the files together in firmware2.bin
again, it works and it upgrades the router. but when I unsquash the rootfs.img
using this command unsquashfs rootfs.img
into squashfs-root/
then I squash it again using mksquashfs rootfs-root/ squash_new.img -comp lzma -b 131072
"which it by the way the same compression method and block size as the original rootfs.img
" but it gives me a less size comparing to the rootfs.img
and the router gives me upgrade failed
here are the sizes of the 2 files
> squash_new.img (9,945,088 bytes)
>
> rootfs.img (9,945,232 bytes)
is there a problem with unsquashfs
or mksquashfs
?
because when I used a hex editor software, I noticed some entries are different although I have not changed anything.
**EDIT** someone suggested that the header.img
file could contain the information about the rootfs.img
file and any change could cause an upgrade failed issue unless I match it with the info inside the header.img
, how would I edit the header.img
file, I can't unsquash it, only view it as hex and all the text inside is rubbish.
Abrahim Hussein
(11 rep)
May 29, 2021, 09:19 PM
11
votes
2
answers
11638
views
Which header defines the macro that specifies the machine architecture?
_Shorter version of question:_ Which C header contains the macro that corresponds to the machine architecture of the system (e.g., `__x86_64__`, `__ia64__`, `__mips__`?) _Longer version of question:_ I'd like to run the [ganglia](http://ganglia.info/) monitoring tools on a [Tilera](http://tilera.com...
_Shorter version of question:_
Which C header contains the macro that corresponds to the machine architecture of the system (e.g.,
__x86_64__
, __ia64__
, __mips__
?)
_Longer version of question:_
I'd like to run the [ganglia](http://ganglia.info/) monitoring tools on a [Tilera](http://tilera.com/)-based system that runs Linux.
Ganglia doesn't currently have support for Tilera. To get this to work, I ned to modify a C function called [machine_type_func](http://sourceforge.net/apps/trac/ganglia/browser/trunk/monitor-core/libmetrics/linux/metrics.c#L523) that returns the machine architecture. The body of this function is determined at compile-time, it looks like this:
g_val_t
machine_type_func ( void )
{
g_val_t val;
#ifdef __i386__
snprintf(val.str, MAX_G_STRING_SIZE, "x86");
#endif
#ifdef __x86_64__
snprintf(val.str, MAX_G_STRING_SIZE, "x86_64");
#endif
...
return val;
}
I need to add the appropriate line for Tilera, but I don't know the name of the macro that specifies a Tilera-based system. I'm guessing this macro is defined in one of the standard Linux headers, but I don't know which one to look in.
Lorin Hochstein
(8605 rep)
Aug 29, 2011, 01:04 AM
• Last activity: Jan 27, 2021, 08:04 AM
2
votes
1
answers
666
views
Can you use LXC through C?
I want to use LXC to 'container' plugins my application is loading. Am I able to do this through C? I have been Googling a lot about it, but there don't seem to be any headers, only scripts that can be called through the terminal. I know I can execute the scripts inside C, but I'd rather use the hea...
I want to use LXC to 'container' plugins my application is loading. Am I able to do this through C? I have been Googling a lot about it, but there don't seem to be any headers, only scripts that can be called through the terminal.
I know I can execute the scripts inside C, but I'd rather use the headers if there are any.
Jeroen
(827 rep)
Feb 28, 2014, 07:44 PM
• Last activity: Nov 30, 2020, 03:27 PM
0
votes
1
answers
502
views
How are conflicts avoided in Linux Headers?
I'm trying to understand how Linux works and how to build modules. So far I saw that Linux headers are stored in `/usr/include` and that the compiled implementation of these interfaces are located in `/usr/lib/x86_64-linux-gnu`. I have a few questions: 1. How does Linux or any C program know where t...
I'm trying to understand how Linux works and how to build modules.
So far I saw that Linux headers are stored in
/usr/include
and that the compiled implementation of these interfaces are located in /usr/lib/x86_64-linux-gnu
. I have a few questions:
1. How does Linux or any C program know where to look for the headers and the .so files? Is there a file where this is defined? Is it possible to modify these references in case I wanted to add another default sources or headers folder (just to horse around)?
2. How are conflicts avoided? For example, in the libprocps-dev
there is a header file /usr/include/proc/numa.h
with the definition void numa_uninit (void);
. The implementation of this file is in /usr/lib/x86_64-linux-gnu/libprocps.so
. What if someone also compiled another .so file with the same function definition but with another implementation (or code) and added it to /usr/lib/x86_64-linux-gnu
? How would the Linker know which is the proper .so file that has to be linked to that header definition?
Thanks.
AFP_555
(311 rep)
Nov 25, 2020, 04:51 PM
• Last activity: Nov 25, 2020, 05:41 PM
Showing page 1 of 20 total questions