This works as a new reference package and can be built from the
Makefile with "make rpm". It will work for virtually all RPM distributions.
Signed-off-by: Neal Gompa <neal@gompa.dev>
install_dkms currently patches the absolute path of DKMSDIR into
trace.h, but this is fragile. For instance, if the DKMSDIR path
contains the word "linux", then the __stringify in define_trace.h
replaces it with its macro expansion "1" and breaks the path. It's
better to just keep it relative.
@koverstreet will have to figure out how to merge the libbcachefs part
of this correctly.
We probably won't ever need this, since we've steadily been doing more
and more self healing.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Since commit 3666da87f249b23b2c1f506e0d4157fd56c543e2
the Makefile fully replaced RUSTFLAGS which users might want
to modify e.g. to use other linkers via -Clinker=*
When this environment variable is set, e.g. for some cross compile
setups, the target dir is nested a little further.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Currently, when "BCACHEFS_FUSE=1" is set, fusemount subcommand
still cannot be identified. Change RUSTFLAGS in Makefile to fix
this problem.
Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
By default, rustc passes -nodefaultlibs to the linker. In some cases,
this can cause compiler builtins (e.g. __cpu_model, used by
__builtin_cpu_supports) not to be linked in:
= note: /nix/store/s2cjhni3s6shh0n35ay1hpj8d85k44qk-x86_64-unknown-linux-musl-binutils-2.43.1/bin/x86_64-unknown-linux-musl-ld: ./libbcachefs.a(tools-util.o): in function `resolve_crc32c':
/build/source/c_src/tools-util.c:457:(.text+0x1023): undefined reference to `__cpu_model'
collect2: error: ld returned 1 exit status
I saw this with static musl GCC builds, and others have reported it with
Clang.
Link: https://github.com/koverstreet/bcachefs-tools/issues/300
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
libudev.pc is the pkg-config file for the udev libraries. udev.pc is
just there to define the directory that rules etc. should be installed
into. It therefore doesn't need to be included in the list of libraries
passed to pkg-config --cflags or pkg-config --libs.
At least one implementation of the libudev API, libudev-zero, does not
provide a udev.pc file, because it does not implement the udev rules
language, just the library API. With this change, it's possible to
build bcachefs-tools against libudev-zero by pointing PKGCONFIG_UDEVDIR
somewhere on the make command line.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
New on disk forat feature - per member 64 bit bitmap of regions with
btree nodes, to accelerate recovering by scanning for btree nodes.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This resolves build warnings and failures for architectures where the
Linux userspace `asm/types.h` header defines 64-bit types (u64, s64) as
`long` instead of `long long`.
By defining `__SANE_USERSPACE_TYPES__`, these types are defined as
`long long` instead.
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Now that the bcachefs tool unconditionally includes the mount parts
(or more correctly, you cannot build it at all if you don't have Rust),
we can call copy_exec on mount.bcachefs, to get the symlink installed.
In particular, this helps with mounting UUID mounts as /.
See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1060411
for the remaining parts needed in initramfs-tools itself.
I spent some minutes pestering Kent about weird counters issues, when, actually, `make clean`
was keeping this artifact on my filesystem.
Signed-off-by: Ryan Lahfa <bcachefs@lahfa.xyz>
This moves the Rust sources out of rust_src/ and into the top level.
Running the bcachefs executable out of the development tree is now:
$ ./target/release/bcachefs command
or
$ cargo run --profile release -- command
instead of "./bcachefs command".
Building and installing is still:
$ make && make install
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This moves the main() function from C to Rust. It also updates the name
of the Rust package from "bcachefs-rust" to "bcachefs-tools".
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>