Fscheck for vfat

Hello,

Our SD card in a mangoh red gets corrupted from time to time.
We would like to run fsck, but the system reports that fsck.vfat is missing.
Since fsck is within busybox, I guess that we need to update busybox by updating yocto??

Any idea?
Thanks

  1. download the yocto source code
  2. open ./meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image.inc and add the following line:

IMAGE_INSTALL_append = " dosfstools"

  1. make the yocto image

4.download and upgrade the yocto image of module

root@fx30:~# find / -name “fsck*”
find: /proc/1721: No such file or directory
/sbin/fsck
/sbin/fsck.minix
/usr/lib/opkg/alternatives/fsck
/usr/lib/opkg/alternatives/fsck.minix
/usr/sbin/fsck.fat
/usr/sbin/fsck.msdos
/usr/sbin/fsck.vfat

Thanks a lot for the tip.
I was expecting this as yocto cannot be upgraded in a modular way.

If you allow the question, how does the leaf environment incorporate that modified yocto?
We are running a mangoh red wp76xx with version 0.6.0.

Thanks a lot.

For me, leaf environment is more for legato app.
You can download yocto.cwe without incorporate with leaf.

If you don’t want to upgrade yocto.cwe, you might take another method to run the fsck.vfat in RAM.

The fsck.vfat binary is as follows on the linux PC:

owner@owner-ThinkPad-X220:~/Yocto/WP77/R9.1/yocto$ ls ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/dosfstools/4.0-r0/image/usr/sbin/* 
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/dosfstools/4.0-r0/image/usr/sbin/dosfsck
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/dosfstools/4.0-r0/image/usr/sbin/dosfslabel
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/dosfstools/4.0-r0/image/usr/sbin/fatlabel
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/dosfstools/4.0-r0/image/usr/sbin/fsck.fat
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/dosfstools/4.0-r0/image/usr/sbin/fsck.msdos
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/dosfstools/4.0-r0/image/usr/sbin/fsck.vfat
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/dosfstools/4.0-r0/image/usr/sbin/mkdosfs
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/dosfstools/4.0-r0/image/usr/sbin/mkfs.fat
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/dosfstools/4.0-r0/image/usr/sbin/mkfs.msdos
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/dosfstools/4.0-r0/image/usr/sbin/mkfs.vfat

Create a folder by “mkdir /tmp/fsck.vfat”.
You can transfer those fsck files to this /tmp/fsck.vfat folder via WINSCP, after that you can directly run it:

root@fx30:~# chmod -R 777 /tmp/fsck.vfat/*
root@fx30:~#
root@fx30:~# /tmp/fsck.vfat/fsck.vfat
CP437: Invalid argument
usage: /tmp/fsck.vfat/fsck.vfat [-aAbflrtvVwy] [-d path -d ...] [-u path -u ...]
               device
  -a       automatically repair the filesystem
  -A       toggle Atari filesystem format
  -b       make read-only boot sector check
  -c N     use DOS codepage N to decode short file names (default: 437)
  -d path  drop that file
  -f       salvage unused chains to files
  -l       list path names
  -n       no-op, check non-interactively without changing
  -p       same as -a, for compat with other *fsck
  -r       interactively repair the filesystem (default)
  -t       test for bad clusters
  -u path  try to undelete that (non-directory) file
  -v       verbose mode
  -V       perform a verification pass
  -w       write changes to disk immediately
  -y       same as -a, for compat with other *fsck

download the yocto source code
make the yocto image

Could somebody elaborate on this step. The web page for the download links to the yocto web page and their instructions are not adequate for generating a WPxxxx system. Thank you.

Didn’t there is a link below?

http://downloads.sierrawireless.com/AirPrime/WP77xx/Release13/Legato-Dist-Source-mdm9x06-SWI9X06Y_02.35.02.00.tar.bz2

Sorry if I was not clear, I already have the download OK, the problem is making the image for the WP77xx. For example, following the instructions on the yocto web page “quick build” link on a fresh download, I get:

paul@paul-ThinkCentre-M72e:~/yocto$ cd poky
paul@paul-ThinkCentre-M72e:~/yocto/poky$ source oe-init-build-env
Error: The build directory (BUILDDIR) must be set!
paul@paul-ThinkCentre-M72e:~/yocto/poky$ bitbake core-image-minimal
ERROR: Unable to find conf/bblayers.conf or conf/bitbake.conf. BBAPTH is unset and/or not in a build directory?
paul@paul-ThinkCentre-M72e:~/yocto/poky$ 

As well this defaults to qemu, it’s not clear what changes are needed for a WP77xx build.

Hi Paul,
We did not got time to go into this yet. We will try to follow your path early next week.
We will trylly appreciate if you could share your results and we will do the same.
Are you depolying a WP77 on a mangoh red? In our case we are using a wp76 on red.
We will post here our results.
Regards,
Enric

Thanks for your help, have a nice weekend. :biking_man:

How about a full build by typing “make” in yocto folder?

FYI, I don’t see problem to compile the yocto source with “make” command:

owner@owner-ThinkPad-X220:~/Yocto/WP77/R13/yocto$ ls ./build_bin/tmp/deploy/images/swi-mdm9x28-wp/yocto_wp77xx.4k.cwe -l
-rw-r–r-- 1 owner owner 34126368 Sep 7 14:18 ./build_bin/tmp/deploy/images/swi-mdm9x28-wp/yocto_wp77xx.4k.cwe

Hello,
I’ve been able to reproduce the process you suggested.
It worked. I got the binaries which I copied to the mangoh red.
Thanks a lot for your support.

We will now see if the fsck solves our problems with the SD.

Here is what I did:

(did fresh extract of yocto from Legato-Dist-Source-mdm9x06-SWI9X06Y_02.35.02.00.tar.bz2)

paul@paul-ThinkCentre-M72e:~$ cd yocto
paul@paul-ThinkCentre-M72e:~/yocto$ make
Makefile:71: "Legato: build disabled since '/home/paul/yocto/legato/' does not exist"
"meta-swi/build.sh" -p poky/ -o meta-openembedded/ -l meta-swi -x "kernel" -j 9 -t 9           -a LK_REPO_DIR="/home/paul/yocto" -a LK_REPO_NAME="lk" -a LK_REPO="file://lk" -m swi-mdm9x28 -P wp  -b build_bin -q
Poky dir: /home/paul/yocto/poky
OE meta: /home/paul/yocto/meta-openembedded
SWI meta dir: /home/paul/yocto/meta-swi
Linux repo dir: /home/paul/yocto/kernel
Number of make threads 9
Number of bitbake tasks 9
Extra options added -  LK_REPO_DIR=/home/paul/yocto
Extra options added -  LK_REPO_NAME=lk
Extra options added -  LK_REPO=file://lk
SWI machine: swi-mdm9x28
SWI product: wp
Build dir: /home/paul/yocto/build_bin
Enable Qualcomm Proprietary bin
Error: The build directory (BUILDDIR) must be set!
+ layer: meta-oe
grep: /home/paul/yocto/build_bin/conf/bblayers.conf: No such file or directory
         -> /home/paul/yocto/meta-openembedded/meta-oe
sed: can't read /home/paul/yocto/build_bin/conf/bblayers.conf: No such file or directory
  error inserting layer meta-oe
Makefile:300: recipe for target 'image_bin' failed
make: *** [image_bin] Error 1
paul@paul-ThinkCentre-M72e:~/yocto$ 

Maybe there are some bash variables that you have defined, but I don’t have?

Have you done a “make clean” before make???

Hello,
In our case it worked perfectly.
Which version are you trying to compile? wp77xx?
If you let me know I can compile it for you and post the result here with a link to the stuff you need.
Let me know.

“make clean” makes no difference.

As I said I am using
Legato-Dist-Source-mdm9x06-SWI9X06Y_02.35.02.00.tar.bz2
which is the download from
https://source.sierrawireless.com/resources/airprime/software/wp77xx/wp77xx-firmware-latest-release-components/#sthash.s1hOaslR.dpbs

Both before and after build attempt:

paul@paul-ThinkCentre-M72e:~/yocto$ ls
kernel  lk  Makefile  meta-gplv2  meta-openembedded  meta-swi  meta-swi-extras  poky  sierra

Note that build_bin was not created. It still looks like missing environment variables to me, but there are no instructions as to what is needed.

I’m compiling and it seems it works… Will let you know when ends up.
Maybe you have something wrong in the compiler setup…

icarus@icarusMSI:~/Sources/yocto$ make
Makefile:71: "Legato: build disabled since '/home/icarus/Sources/yocto/legato/' does not exist"
"meta-swi/build.sh" -p poky/ -o meta-openembedded/ -l meta-swi -x "kernel" -j 9 -t 9           -a LK_REPO_DIR="/home/icarus/Sources/yocto" -a LK_REPO_NAME="lk" -a LK_REPO="file://lk" -m swi-mdm9x28 -P wp  -b build_bin -q
Poky dir: /home/icarus/Sources/yocto/poky
OE meta: /home/icarus/Sources/yocto/meta-openembedded
SWI meta dir: /home/icarus/Sources/yocto/meta-swi
Linux repo dir: /home/icarus/Sources/yocto/kernel
Number of make threads 9
Number of bitbake tasks 9
Extra options added -  LK_REPO_DIR=/home/icarus/Sources/yocto
Extra options added -  LK_REPO_NAME=lk
Extra options added -  LK_REPO=file://lk
SWI machine: swi-mdm9x28
SWI product: wp
Build dir: /home/icarus/Sources/yocto/build_bin
Enable Qualcomm Proprietary bin
You had no conf/local.conf file. This configuration file has therefore been
created for you with some default values. You may wish to edit it to, for
example, select a different MACHINE (target hardware). See conf/local.conf
for more information as common configuration options are commented.

You had no conf/bblayers.conf file. This configuration file has therefore been
created for you with some default values. To add additional metadata layers
into your configuration please add entries to conf/bblayers.conf.

The Yocto Project has extensive documentation about OE including a reference
manual which can be found at:
    http://yoctoproject.org/documentation

For more information about OpenEmbedded see their website:
    http://www.openembedded.org/


### Shell environment set up for builds. ###

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-ide-support

The following seems to be working. Note the error message which appears to be bogus. This threw me off previously. Your environment must have been set up in a similar way somehow.

paul@paul-ThinkCentre-M72e:~/yocto$ cd poky
paul@paul-ThinkCentre-M72e:~/yocto/poky$ source oe-init-build-env
Error: The build directory (BUILDDIR) must be set!
paul@paul-ThinkCentre-M72e:~/yocto/poky$ cd ..
paul@paul-ThinkCentre-M72e:~/yocto$ make
Makefile:71: "Legato: build disabled since '/home/paul/yocto/legato/' does not exist"
"meta-swi/build.sh" -p poky/ -o meta-openembedded/ -l meta-swi -x "kernel" -j 9 -t 9           -a LK_REPO_DIR="/home/paul/yocto" -a LK_REPO_NAME="lk" -a LK_REPO="file://lk" -m swi-mdm9x28 -P wp  -b build_bin -q
Poky dir: /home/paul/yocto/poky
OE meta: /home/paul/yocto/meta-openembedded
SWI meta dir: /home/paul/yocto/meta-swi
Linux repo dir: /home/paul/yocto/kernel
Number of make threads 9
Number of bitbake tasks 9
Extra options added -  LK_REPO_DIR=/home/paul/yocto
Extra options added -  LK_REPO_NAME=lk
Extra options added -  LK_REPO=file://lk
SWI machine: swi-mdm9x28
SWI product: wp
Build dir: /home/paul/yocto/build_bin
.... more ....

Good. just let me know. I have the compiled stuff here in case you need it.

Thanks for the help. interestingly the “~/yocto/poky$ source oe-init-build-env” step only has to be done the first time. After that it will build exactly the way you do it. But that first time was tricky. :slight_smile: