Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with tmpfs, /dev/shm does not exist or is not writable, there is no support for shared memory #16

Closed
patryk9200 opened this issue Apr 7, 2016 · 11 comments

Comments

@patryk9200
Copy link

Hi!
It's look like there is no proper support for shared memory.
I'm trying to compile linux Yocto image for Embedded ARM freescale i.mx6 UL based SOM.
When I trying to build image using bitbake it always returns:
/dev/shm does not exist or is not writable

There ins no difference if I run bitbake as root or as sudo user.

Is there in Linux Subsystem for Windows properly implemented tmpfs?
There is no info about tmpfs in fstab.

stat /dev/shm on WLS returns:

stat /dev/shm
File: ‘/dev/shm’ -> ‘/run/shm’
Size: 0 Blocks: 1 IO Block: 512 symbolic link
Device: 0h/0d Inode: 0 Links: 2
Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2016-04-07 11:36:10.539632000 +0000
Modify: 2016-04-07 11:36:10.000000000 +0000
Change: 2016-04-07 11:36:10.000000000 +0000
Birth: -

File: ‘/run/shm’
Size: 0 Blocks: 0 IO Block: 512 regular empty file
Device: 0h/0d Inode: 13510798882223683 Links: 1
Access: (0666/-rw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2016-04-07 11:40:06.680796000 +0000
Modify: 2016-04-07 11:40:06.680796000 +0000
Change: 2016-04-07 11:40:06.680796000 +0000
Birth: -

On linux machine returns:
File: '/dev/shm'
Size: 40 Blocks: 0 IO Block: 4096 directory
Device: 12h/18d Inode: 11798 Links: 2
Access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2016-02-22 14:40:14.096000000 +0000
Modify: 2016-02-22 14:40:14.096000000 +0000
Change: 2016-02-22 14:40:14.096000000 +0000
Birth: -

On linux it is directory with access 17777 but on WLS it is file with access 0666.

System: Windows Insider Preview build 14316.rs1_release

@patryk9200 patryk9200 changed the title Problem with tmpfs, /dev/shm does not exist or is not writable Problem with tmpfs, /dev/shm does not exist or is not writable, there is no support for semaphores Apr 12, 2016
@patryk9200 patryk9200 changed the title Problem with tmpfs, /dev/shm does not exist or is not writable, there is no support for semaphores Problem with tmpfs, /dev/shm does not exist or is not writable, there is no support for shared memory Apr 12, 2016
@stehufntdev
Copy link
Collaborator

Thanks for reporting the issue. We recently added tmpfs mounts for run (e.g. /run, /run/lock, /run/user, and /run/shm) with permissions that match native Ubuntu. This change should be out for insiders soon.

Can you please share out a simplified repro for bitbake so we can check if it is resolved? We can also try out the scenarios in the referenced issues to make sure they are resolved.

@trondhindenes
Copy link

@stehufntdev for an easy test of /dev/shm see #135

@stehufntdev
Copy link
Collaborator

Thanks @trondhindenes I saw that one as well, and will reply off it shortly. Since /dev/shm is just a tmpfs mount I wanted to see if bitbake had different dependencies from python.

@patryk9200
Copy link
Author

patryk9200 commented Apr 18, 2016

@stehufntdev

Thank You for looking into this problem.
Sorry I was unable to replay earlier.

I made a little simplified repro for that issue.

First You need to add not root linux user.

Then You need to install packages:

apt install wget git gcc unzip build-essential intltool gawk git-core diffstat unzip texinfo chrpath libsdl1.2-dev xterm curl qemu git-core gcc-multilib socat autoconf automake libtool libglib2.0-dev libarchive-dev

If all packages are installed execute:

su YOUR_NOT_ROOT_USER
mkdir ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > /bin/repo
PATH=$PATH:
/bin
chmod a+x ~/bin/repo
mkdir fsl-community-bsp
git config --global user.email "YOUR_EMAIL_ADDRESS"
git config --global user.name "YOUR_USER_NAME"
repo init -u https:/Freescale/fsl-community-bsp-platform -b jethro
repo sync
repo start zamel-imx6UL-dev zamel-imx6UL --all
source setup-environment build

Then (failing bitbake):

bitbake -c menuconfig core-image-minimal

That's all.

I allways get:

FATAL: /dev/shm does not exist or is not writable

@stehufntdev
Copy link
Collaborator

Thanks for providing the repro. Just tried this locally and it seems to make it a bit further but reports a failure missing support in inotify:

_test@TEST-6:~/build$ bitbake -c menuconfig core-image-minimal
Traceback (most recent call last):
File "/home/test/sources/poky/bitbake/bin/bitbake", line 45, in
cookerdata.CookerConfiguration()))
File "/home/test/sources/poky/bitbake/lib/bb/main.py", line 395, in bitbake_main
server = start_server(servermodule, configParams, configuration, featureset)
File "/home/test/sources/poky/bitbake/lib/bb/main.py", line 293, in start_server
cooker = bb.cooker.BBCooker(configuration, features)
File "/home/test/sources/poky/bitbake/lib/bb/cooker.py", line 140, in init
self.initConfigurationData()
File "/home/test/sources/poky/bitbake/lib/bb/cooker.py", line 372, in initConfigurationData
self.add_filewatch(self.data.getVar("_base_depends", False), self.configwatcher)
File "/home/test/sources/poky/bitbake/lib/bb/cooker.py", line 216, in add_filewatch
watcher.add_watch(f, self.watchmask, quiet=False)
File "/home/test/sources/poky/bitbake/lib/pyinotify.py", line 1977, in add_watch
raise WatchManagerError(err, ret
)
WatchManagerError: add_watch: cannot watch /home/test/build/conf WD=-1, Errno=Invalid argument (EINVAL)
DEBUG: Removed the following variables from the environment: LANG, LESSCLOSE, NAME, SHLVL, OLDPWD, HOSTTYPE, LESSOPEN, MAIL, LS_COLORS, , BUILDDIR
DEBUG: Found bblayers.conf (/home/test/build/conf/bblayers.conf)
DEBUG: Adding layer /home/test/sources/poky/meta
DEBUG: Adding layer /home/test/sources/poky/meta-yocto
DEBUG: Adding layer /home/test/sources/meta-openembedded/meta-oe
DEBUG: CONF /home/test/sources/meta-openembedded/meta-oe/conf/layer.conf:67: including conf/distro/include/meta_oe_security_flags.inc
DEBUG: Adding layer /home/test/sources/meta-openembedded/meta-multimedia
DEBUG: Adding layer /home/test/sources/meta-fsl-arm
DEBUG: Adding layer /home/test/sources/meta-fsl-arm-extra
DEBUG: Adding layer /home/test/sources/meta-fsl-demos
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:697: including conf/abi_version.conf
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:698: including conf/site.conf
DEBUG: CONF file 'conf/site.conf' not found
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:699: including conf/auto.conf
DEBUG: CONF file 'conf/auto.conf' not found
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:700: including conf/local.conf
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:701: including conf/build/x86_64-linux.conf
DEBUG: CONF file 'conf/build/x86_64-linux.conf' not found
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:702: including conf/target/INVALID-oe-linux.conf
DEBUG: CONF file 'conf/target/INVALID-oe-linux.conf' not found
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:703: including conf/machine/imx6qsabresd.conf
DEBUG: CONF /home/test/sources/meta-fsl-arm/conf/machine/imx6qsabresd.conf:7: including conf/machine/include/imx6sabresd-common.inc
DEBUG: CONF /home/test/sources/meta-fsl-arm/conf/machine/include/imx6sabresd-common.inc:3: including conf/machine/include/imx-base.inc
DEBUG: CONF /home/test/sources/meta-fsl-arm/conf/machine/include/imx-base.inc:3: including conf/machine/include/fsl-default-settings.inc
DEBUG: CONF /home/test/sources/meta-fsl-arm/conf/machine/include/imx-base.inc:4: including conf/machine/include/fsl-default-versions.inc
DEBUG: CONF /home/test/sources/meta-fsl-arm/conf/machine/include/imx-base.inc:6: including conf/machine/include/soc-family.inc
DEBUG: CONF /home/test/sources/meta-fsl-arm/conf/machine/include/imx6sabresd-common.inc:4: including conf/machine/include/tune-cortexa9.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/tune-cortexa9.inc:3: including conf/machine/include/arm/arch-armv7a.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv7a.inc:8: including conf/machine/include/arm/arch-armv6.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv6.inc:8: including conf/machine/include/arm/arch-armv5-dsp.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc:4: including conf/machine/include/arm/arch-armv5.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv5.inc:10: including conf/machine/include/arm/arch-armv4.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv4.inc:15: including conf/machine/include/arm/arch-arm.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv4.inc:16: including conf/machine/include/arm/feature-arm-thumb.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv5.inc:11: including conf/machine/include/arm/feature-arm-vfp.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/machine/include/arm/arch-armv7a.inc:9: including conf/machine/include/arm/feature-arm-neon.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:704: including conf/machine-sdk/${SDKMACHINE}.conf
DEBUG: CONF file 'conf/machine-sdk/${SDKMACHINE}.conf' not found
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:705: including conf/distro/poky.conf
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:706: including conf/distro/defaultsetup.conf
DEBUG: CONF /home/test/sources/poky/meta/conf/distro/defaultsetup.conf:1: including conf/distro/include/default-providers.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/distro/defaultsetup.conf:2: including conf/distro/include/default-versions.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/distro/defaultsetup.conf:3: including conf/distro/include/default-distrovars.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/distro/defaultsetup.conf:4: including conf/distro/include/world-broken.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/distro/defaultsetup.conf:7: including conf/distro/include/tcmode-default.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/distro/include/tcmode-default.inc:74: including conf/distro/include/as-needed.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/distro/defaultsetup.conf:10: including conf/distro/include/tclibc-glibc.inc
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:707: including conf/documentation.conf
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:708: including conf/licenses.conf
DEBUG: CONF /home/test/sources/poky/meta/conf/bitbake.conf:709: including conf/sanity.conf
DEBUG: Inheriting /home/test/sources/poky/meta/classes/base.bbclass (from configuration INHERITs:0)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/patch.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:4)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/terminal.bbclass (from /home/test/sources/poky/meta/classes/patch.bbclass:8)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/staging.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:5)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/mirrors.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:7)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/utils.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:8)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/utility-tasks.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:9)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/metadata_scm.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:10)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/logging.bbclass (from /home/test/sources/poky/meta/classes/base.bbclass:11)
DEBUG: Inheriting /home/test/sources/meta-fsl-arm/classes/fsl-dynamic-packagearch.bbclass (from configuration INHERITs:0)
DEBUG: Inheriting /home/test/sources/poky/meta-yocto/classes/poky-sanity.bbclass (from configuration INHERITs:0)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/package_rpm.bbclass (from configuration INHERITs:0)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/package.bbclass (from /home/test/sources/poky/meta/classes/package_rpm.bbclass:1)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/packagedata.bbclass (from /home/test/sources/poky/meta/classes/package.bbclass:41)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/chrpath.bbclass (from /home/test/sources/poky/meta/classes/package.bbclass:42)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/insane.bbclass (from /home/test/sources/poky/meta/classes/package.bbclass:45)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/buildstats.bbclass (from configuration INHERITs:0)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/image-mklibs.bbclass (from configuration INHERITs:0)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/debian.bbclass (from configuration INHERITs:0)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/devshell.bbclass (from configuration INHERITs:0)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/sstate.bbclass (from configuration INHERITs:0)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/license.bbclass (from configuration INHERITs:0)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/blacklist.bbclass (from configuration INHERITs:0)
DEBUG: Inheriting /home/test/sources/poky/meta/classes/sanity.bbclass (from configuration INHERITs:0)
DEBUG: Clearing SRCREV cache due to cache policy of: clear
DEBUG: Using cache in '/home/test/build/cache/local_file_checksum_cache.dat'
DEBUG: Using cache in '/home/test/build/cache/bb_codeparser.dat'

From the strace:

12183 inotify_add_watch(7, "/home/test/build/conf", IN_MODIFY|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF) = -1 EINVAL (Invalid argument)

If it looks like this is still broken, can you please add it to our [UserVoice](https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/category/161892-bash page) page so we can prioritize? Thanks again for trying out WSL!

@patryk9200
Copy link
Author

patryk9200 commented Apr 18, 2016

@stehufntdev Thank You for checking this issue.
I think that someone else reported here that inotify is not implemented.
I will definietly add it to UserVoice.
Thanks.

Edit: found it:
#216

@patryk9200
Copy link
Author

@benhillis
Copy link
Member

Closing since this is fixed.

@jaydcarlson
Copy link

Are we certain this has been addressed?

I've tried Yocto (bitbake) on computers running both Insider Fast and Anniversary Update, and in both cases, it fails with
WatchManagerError: add_watch: cannot watch /home/jay/yocto/build/conf WD=-1, Errno=Invalid argument (EINVAL)

Getting Yocto to work on Services for Linux would be huge -- I'm sure there are a ton of embedded programmers like me who keep a Linux VM around for the sole purpose of building embedded Linux images...

@Tragetaschen
Copy link

You are seeing #216. Also, some even have a dedicated machine just for Yocto...

@aseering
Copy link
Contributor

aseering commented Aug 3, 2016

@jaydcarlson -- the way the folks at Microsoft are judging how huge a thing is, is (in part) by how many people have indicated that it's important to them. The way they've asked people to do that is through the UserVoice page. So if there's a community out there that this matters a lot to, y'all should go make some noise over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants