fstrim: FITRIM: Invalid argument v1.30.1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fstrim: FITRIM: Invalid argument v1.30.1

Jump to solution
1,438 Views
jiye
Contributor V

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 

pastedImage_1.png

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> "
Labels (2)
Tags (1)
0 Kudos
1 Solution
1,290 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to patch util-linux: Add fstrim utility (616e5de8) · Commits · yocto / poky · GitLab 

to add "util-linux-fstrim" package containing /sbin/fstrim.

View solution in original post

3 Replies
1,290 Views
yipingwang
NXP TechSupport
NXP TechSupport

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".

0 Kudos
1,290 Views
jiye
Contributor V

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

0 Kudos
1,291 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to patch util-linux: Add fstrim utility (616e5de8) · Commits · yocto / poky · GitLab 

to add "util-linux-fstrim" package containing /sbin/fstrim.