Closed AnrDaemon closed 2 years ago
You need to install linux libc headers (in linux-libc-dev matching your kernel) to get linux/btrfs_tree.h.
I have full kernel headers installed, but it's not there, apparently?
I have only Ubuntu's own version linux-libc-dev 4.4.0-210.242
Where can I find it?
If it isn't in the linux-headers package, then you can use any version of linux-libc-dev after 4.7, ideally 4.19 or later.
# find / -xdev -type f -iname 'btrfs_tree.h'
/usr/src/linux-headers-4.15.0-140/include/uapi/linux/btrfs_tree.h
/usr/src/linux-headers-4.15.0-142/include/uapi/linux/btrfs_tree.h
/usr/src/linux-headers-4.19.248-0419248/include/uapi/linux/btrfs_tree.h
# head /usr/src/linux-headers-4.19.248-0419248/include/uapi/linux/btrfs_tree.h
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _BTRFS_CTREE_H_
#define _BTRFS_CTREE_H_
#include <linux/btrfs.h>
#include <linux/types.h>
/*
* This header contains the structure definitions and constants used
* by file system objects that can be retrieved using
Double checked. It's there. What next? Any way to debug it?
It will need to be located at /usr/include/linux/btrfs_tree.h
. Try dpkg -S /usr/include/linux/btrfs.h
and then find a newer version of the package listed.
Doesn't make much sense. It is a kernel header. Look in kernel sources?
(And yes, it IS there.)
It's a uapi
header, so it's technically the portion of libc userspace headers that is supplied from the kernel, and not part of either libc or kernel header packages. On the Venn diagram of libc and kernel headers, it's the part of the circles that intersect.
Normally you can use any version of linux-libc-dev
that's within a few years old; however, yours is from kernel 4.4. It's more than 6 years old. btrfs_tree.h
was introduced in kernel 4.7, 3 months after Ubuntu 16.04 was released.
The kernel-headers packages will contain a copy of this header, but it will not be installed at the correct path to build applications. The kernel-headers packages are for building kernel modules, and include a lot of non-userspace headers as well as the uapi
headers. You can manually add -I/usr/src/.../include/uapi
to CCFLAGS
in makeflags
if you just want to work around this issue without upgrading thelinux-libc-dev
package.
http://us.archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_4.15.0-189.200_amd64.deb looks like the closest match to what you already have installed.
Once you resolve that issue, I expect you'll have some new problem due to the age of your C++ compiler.
From reading into your installation instructions, Ubuntu 16.04 is supported. Took the libs from https://packages.debian.org/buster/linux-libc-dev
Compiled, looks okay. make.log
But… you don't really need uuidparse, do you? You do not make case conversion on argument, do not support absence of dashes and presence of brackets. You already have the
if [ ! -b "/dev/disk/by-uuid/$UUID" ]; then
ERRO "Missing disk: /dev/disk/by-uuid/$UUID"
fi
test. What's more? It's one more dependency you force upon the user without necessity. The essence of that function could be easily replaced by
uuid_valid(){
test ${#1} = 36
}
Ok, there's multiple small issues with current daemon script. I'll prepare MR.
BTW, it's fun to watch bees working. I'm already down from 230 to 217 gig available. :) Wonder what's next. Judging from the log, it is trying to de-deduplicate snapshot with VirtualBox disk images against the subvolume it was created from. Pure fun.
Ubuntu 16.04, kernel 4.19.248
c++ --version
c++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609