| Summary: | init-live.sh should clean up temporary mounts | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Marc Ferland <marc.ferland> |
| Component: | core | Assignee: | Chen Qi <Qi.Chen> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | Medium | CC: | liezhi.yang, meta.mr.watcher, meta.watcher, Qi.Chen, sgw, yi.zhao, zhenfeng.zhao |
| Version: | 1.2.1 | ||
| Target Milestone: | 1.4 M2 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
|
Description
Marc Ferland
2012-09-21 14:27:18 UTC
This would get rid of the duplicate /proc and /sys mounts. The thing I'm not sure is if something else would depend on these mounts... After looking at this a little closer, I found out that switch_root already moves the /proc and /sys file systems. It is actually the init-boot.sh script that unconditionally remounts the /proc and /sys file systems even if there already mounted. Based on this, the solution would be to at least check if these two file systems are already mounted. BTW, the sysfs.sh script in recipe-core/initscripts also tries to mount /sys and proc... this might be a little redundant with the content of init-boot.sh. (In reply to comment #2) > After looking at this a little closer, I found out that switch_root already > moves the /proc and /sys file systems. Actually busybox's switch_root does _not_ move /proc and /sys but util-linux's one does. This means init-live.sh should manually move them. Sorry for the confusion. (In reply to comment #3) > (In reply to comment #2) > > After looking at this a little closer, I found out that switch_root already > > moves the /proc and /sys file systems. > > Actually busybox's switch_root does _not_ move /proc and /sys but > util-linux's one does. This means init-live.sh should manually move them. > Sorry for the confusion. Hi Marc: It seems that currently Yocto only supports the "live" feature for core-image-mininal and only for x86 archs. I searched in current project and the result is as following. ~/poky$ grep -R COMPATIBLE_HOST meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb # on the COMPATIBLE_HOST below, which needs to take precedence COMPATIBLE_HOST = "(i.86|x86_64).*-linux" ~/poky$ find meta* -name *image*.bb | grep init meta/recipes-core/images/core-image-minimal-initramfs.bb Is it right? Or maybe I missed something? Hi Chen, I realize the problem description could have been a little bit clearer! Sorry about that! Let me re-explain the problem. When I boot a machine that uses the poky/meta/recipes-core/initrdscripts/files/init-live.sh script to perform a live bootup I see duplicated /proc and /sys in mounted filesystems (look at the bug description for an example). This is caused by a missing 'mount -n --move' inside the boot_live_root function (from init-live.sh). So the problem could be fixed by adding something like: # Move virtual filesystems over to the real filesystem mount -n --move /sys $ROOT_MOUNT/sys mount -n --move /proc $ROOT_MOUNT/proc just before calling switch_root. One other thing that surprised me, is that busybox's implementation of switch_root does _not_ move /proc and /sys _but_ the util-linux's one does. Guess we should be careful which version we package along with this script. Hope this helps! Thanks Marc! BTW, I'm wondering whether there's any way to boot an iso image with runqemu? I just built an image: core-image-minimal-qemux86-20121107085353.iso, but I can't boot it up. Any suggestion? (In reply to comment #6) > Thanks Marc! > > BTW, I'm wondering whether there's any way to boot an iso image with runqemu? > I just built an image: core-image-minimal-qemux86-20121107085353.iso, but I > can't boot it up. Any suggestion? I usually just use ext3 files with runqemu. I know it is possible to boot from an iso using straight qemu but I've never tried with runqemu. Problem reproduced, and the patch will be sent in a day or two. merged in poky/master: 14649c003550ee08b73b1d8dbf51343087295e7b http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/live-image Verified with master branch: 27c8af1e3a9092caa19bd813c4dd0747de766dc5 Steps: ########### 1. Add line IMAGE_FSTYPES = "live" to conf/local.conf 2. Build the qemux86 minimal image 3. Run command: runqemu qemux86 iso ########### ################ root@qemux86:~# mount rootfs on / type rootfs (rw) proc on /proc type proc (rw,relatime) sysfs on /sys type sysfs (rw,relatime) none on /dev type devtmpfs (rw,relatime,size=55400k,nr_inodes=13850,mode=755) /dev/hdc on /media/realroot type iso9660 (ro,relatime) /dev/loop0 on / type ext3 (ro,noatime,nodiratime,barrier=1,data=ordered) debugfs on /sys/kernel/debug type debugfs (rw,relatime) tmpfs on /var/volatile type tmpfs (rw,relatime) tmpfs on /media/ram type tmpfs (rw,relatime) devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620) ################# |