Bug 7238

Summary: Missing /dev/loop* devices make some ltp cases failed
Product: [Build System, Metadata & Runtime] BSPs Reporter: Yi Zhao <yi.zhao>
Component: bsps-meta-yoctoAssignee: Saul Wold <sgw>
Status: VERIFIED FIXED QA Contact: Yi Zhao <yi.zhao>
Severity: normal    
Priority: Medium+ CC: alexandru.c.georgescu, bruce.ashfield, dvhart, ke.zou, kexin.hao, richard.purdie, yi.zhao, zhangle.yang
Version: 1.8   
Target Milestone: 1.8 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: No (bug/feature does not impact docs)

Description Yi Zhao 2015-01-23 08:38:26 UTC
Image location: http://autobuilder.yoctoproject.org/pub/releases/yocto-1.8_M2.rc1
Git rev: master/d9d5b8b499af3ae01a1e33d0d3969c54c2d4ab1b

Some ltp cases need /dev/loop device, but now there is no such device in beaglebone, mpc8315e-rdb, and edgerouter. 

################
root@beaglebone:~# ls /dev/loop*
ls: cannot access /dev/loop*: No such file or directory
root@beaglebone:~# 
root@beaglebone:~# 
root@beaglebone:~# dd if=/dev/zero of=/opt/test.img bs=1M count=256
tilcdc 4830e000.lcdc: timeout waiting for framedone
256+0 records in
256+0 records out
268435456 bytes (268 MB) copied, 22.2859 s, 12.0 MB/s
root@beaglebone:~# 
root@beaglebone:~# losetup -f
/dev/loop0
root@beaglebone:~# 
root@beaglebone:~# losetup /dev/loop0 /opt/test.img 
losetup: /dev/loop0: failed to set up loop device: No such file or directory
root@beaglebone:~# 
##################

These devices exist in 1.8 M1 build.
Comment 1 Saul Wold 2015-01-27 19:06:33 UTC
Have you installed the modules into that system?  Which Image exactly are you 
testing with?  Can you verify if you have a 
/lib/modules/3.14.19-yocto-standar/kernel/drivers/block/loop.ko module 
installed?  Kernel name may be slightly different, but I don;t think so.
Comment 2 Yi Zhao 2015-01-28 04:33:27 UTC
(In reply to comment #1)
> Have you installed the modules into that system?  Which Image exactly are
> you 
> testing with?  Can you verify if you have a 
> /lib/modules/3.14.19-yocto-standar/kernel/drivers/block/loop.ko module 
> installed?  Kernel name may be slightly different, but I don;t think so.

I think the root cause is the modules.dep file is empty:
#################
root@beaglebone:~# ls -l /lib/modules/3.14.19-yocto-standard/modules.dep
-rw-r--r-- 1 root root 0 Jan 18 08:04 /lib/modules/3.14.19-yocto-standard/modules.dep
root@beaglebone:~# 
#################

So the modprobe can not work correctly and no modules are loaded when system up. 
#################
root@beaglebone:~# modprobe loop
modprobe: FATAL: Module loop not found.
root@beaglebone:~#
root@beaglebone:~# lsmod
Module                  Size  Used by
root@beaglebone:~#  
#################

After ran "depmod -a" manually. 
##################
root@beaglebone:~# modprobe loop
loop: module loaded
root@beaglebone:~# lsmod
Module                  Size  Used by
loop                   17190  0 
root@beaglebone:~# 
root@beaglebone:~# 
##################

Then reboot the system, some modules are loaded automatically:
###################
root@beaglebone:~# lsmod
Module                  Size  Used by
nls_iso8859_1           3676  1 
nls_cp437               5342  1 
musb_dsps               6762  0 
musb_hdrc              57504  1 musb_dsps
snd_soc_omap            3286  0 
snd_pcm_dmaengine       4789  1 snd_soc_omap
snd_soc_core          157290  1 snd_soc_omap
snd_compress            8065  1 snd_soc_core
regmap_spi              2152  1 snd_soc_core
snd_pcm                83288  3 snd_soc_core,snd_soc_omap,snd_pcm_dmaengine
snd_timer              20042  1 snd_pcm
snd                    49713  4 snd_soc_core,snd_timer,snd_pcm,snd_compress
soundcore               1194  1 snd
omap_rng                5100  0 
rng_core                4307  1 omap_rng
musb_am335x             1416  0 
root@beaglebone:~# 
########################

For a quick check, extract the core-image-sato-sdk tarball for beaglebone, edgerouter or mpc8315e, you could see the modules.dep file is empty in lib/modules/3.14.19-yocto-standard/

BTW: bug 7212 is also caused by the same issue.
Comment 3 Yi Zhao 2015-01-28 05:40:15 UTC
Looks like the bug 7228 also related with this issue. Please see bug 7228 comment 2
Comment 4 Yi Zhao 2015-02-02 09:25:59 UTC
Re-test on 20150201 build: http://autobuilder.yoctoproject.org/pub/nightly/20150201-1/

The modules.dep is not empty. The loop module can modprboe without problem.
Comment 5 Richard Purdie 2015-02-02 13:46:07 UTC
Resolved by fixes ending with http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=3f15d8a807edb02825e32c4d8c924b4465ca5098
Comment 6 Yi Zhao 2015-02-04 08:00:09 UTC
Verified with 1.8 M2 rc2 build.
Git rev: master/22c38e2d8a058619e3d05534b5e830b750aa4241