Hi,
I am trying to use fstrim -a in my linux distro, when comes to this a command it says
fstrim: FITRIM: Invalid argument
Then I checked the source code of the busybox fstrim.c
here says
it seems like doest no provide this -a option
Question:
How am I able to add linux version of fstrim binary into my rootfs I want to replace it with the one from busybox.
The linux version of fstrim has many header files which I dont have on the target system how am i able to add those dependencies as well such as :
#include "nls.h" #include "strutils.h" #include "c.h" #include "closestream.h" #include "pathnames.h" #include "sysfs.h" #include "exitcodes.h" #include <libmount.h> "
Solved! Go to Solution.
Please refer to patch util-linux: Add fstrim utility (616e5de8) · Commits · yocto / poky · GitLab
to add "util-linux-fstrim" package containing /sbin/fstrim.
Do you use Yocto build environment?
You could use "merge-files" to add fstrim binary into rootfs.
Please refer to meta-freescale/recipes-extended/merge-files/merge-files/merge/README
Please modify MERGED_DST variable in meta-freescale/recipes-extended/merge-files/merge-files_1.0.bb to "/usr/bin" or "/user/sbin".
Yes, I am using Yocto build environment.
The thing I don't understand for example the fstrim.c of the util-linux is located under
/build/tmp/work/armv7ahf-neon-vfpv4-picoos-linux-musleabi/busybox/1.30.1-r0/busybox-1.30.1/util-linux/fstrim.c,
everything under /build/tmp should not be the right approach to change it, this must be determined by the busybox recipe
I dont have this merge files
or is there way to debug the busy box version of fstrim.c
the source code is from this
https://elixir.bootlin.com/busybox/latest/source/util-linux/fstrim.c
Please refer to patch util-linux: Add fstrim utility (616e5de8) · Commits · yocto / poky · GitLab
to add "util-linux-fstrim" package containing /sbin/fstrim.