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

Overlayfs not available on older kernels #226

Closed
ahyattdev opened this issue Jan 8, 2017 · 11 comments
Closed

Overlayfs not available on older kernels #226

ahyattdev opened this issue Jan 8, 2017 · 11 comments
Labels
Container The emulation container is configured incorrectly Won't Fix For issues that we have decided not to fix

Comments

@ahyattdev
Copy link
Member

ahyattdev commented Jan 8, 2017

andrewhyatt@debian-vm:~$ darling shell
Cannot mount overlay: No such device
Cannot spawn a child process: Cannot allocate memory

Tried on a fresh install in a VM.

@ahyattdev ahyattdev added Bug Darling emulation behaves unexpectedly Container The emulation container is configured incorrectly labels Jan 8, 2017
@ahyattdev
Copy link
Member Author

execve("/usr/local/bin/darling", ["darling"], [/* 16 vars */]) = 0
brk(0)                                  = 0x2188000
fcntl(0, F_GETFD)                       = 0
fcntl(1, F_GETFD)                       = 0
fcntl(2, F_GETFD)                       = 0
access("/etc/suid-debug", F_OK)         = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0958129000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/usr/local/lib//darling/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib//darling/tls/x86_64", 0x7ffcc63c1c30) = -1 ENOENT (No such file or directory)
open("/usr/local/lib//darling/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib//darling/tls", 0x7ffcc63c1c30) = -1 ENOENT (No such file or directory)
open("/usr/local/lib//darling/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib//darling/x86_64", 0x7ffcc63c1c30) = -1 ENOENT (No such file or directory)
open("/usr/local/lib//darling/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib//darling", {st_mode=S_IFDIR|S_ISGID|0755, st_size=4096, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=96263, ...}) = 0
mmap(NULL, 96263, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0958111000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\34\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1738176, ...}) = 0
mmap(NULL, 3844640, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0957b60000
mprotect(0x7f0957d01000, 2097152, PROT_NONE) = 0
mmap(0x7f0957f01000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a1000) = 0x7f0957f01000
mmap(0x7f0957f07000, 14880, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0957f07000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0958110000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f095810f000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f095810e000
arch_prctl(ARCH_SET_FS, 0x7f095810f700) = 0
mprotect(0x7f0957f01000, 16384, PROT_READ) = 0
mprotect(0x7f095812b000, 4096, PROT_READ) = 0
munmap(0x7f0958111000, 96263)           = 0
write(2, "This is Darling, translation lay"..., 56This is Darling, translation layer for macOS software.

) = 56
write(2, "Copyright (C) 2012-2016 Lubos Do"..., 39Copyright (C) 2012-2016 Lubos Dolezel

) = 39
write(2, "Usage:\n", 7Usage:
)                 = 7
write(2, "\tdarling program-path [arguments"..., 37	darling program-path [arguments...]
) = 37
write(2, "\tdarling shell [arguments...]\n", 30	darling shell [arguments...]
) = 30
write(2, "\n", 1
)                       = 1
write(2, "Environment variables:\nDPREFIX -"..., 98Environment variables:
DPREFIX - specifies the location of Darling prefix, defaults to ~/.darling
) = 98
exit_group(1)                           = ?
+++ exited with 1 +++

@bugaevc
Copy link
Member

bugaevc commented Jan 9, 2017

Cannot mount overlay: No such device

Overlayfs is available since Linux kernel 3.18, but Debian Stable still uses an older version (please confirm).
If supporting old kernels is important for us (think about Android), we may want to use mergerfs or something — but I'm concerned about its performance if all the file operations need to go through it.

Cc @LubosD

By the way, your log only shows outputting usage info because you forgot to add "shell".

@bugaevc bugaevc changed the title darling shell fails on Debian Stable Overlayfs not available on older kernels Jan 9, 2017
@bugaevc bugaevc removed the Bug Darling emulation behaves unexpectedly label Jan 9, 2017
@vlad-ivanov-name
Copy link

think about Android

About 60% of Android devices run Linux kernel 3.18 or newer (https://developer.android.com/about/dashboards/index.html, https://android.stackexchange.com/questions/51651/which-android-runs-which-linux-kernel)

@bugaevc
Copy link
Member

bugaevc commented Jan 9, 2017

@resetnow unfortunately, that's not how it works, as the comments point out:

Also, when a device is released with specific android version and kernel, and later the android version is updated by manufacturer, the kernel version is mostly kept at initial version with patches.

For example, I have 3.10 on my Nexus 5X running the latest 7.1 Nougat.

On the other hand, Darling clearly can't be run as an app under Android -- it requires the kernel module at the very least -- so general statistics are irrelevant, and we should count custom ROMs instead -- and since they are based on AOSP, the situation may be better.

@stek29
Copy link
Contributor

stek29 commented Jan 9, 2017

we should count custom ROMs instead -- and since they are based on AOSP, the situation may be better.

It's usually not. Custom ROMs rarely update the manufacturers' kernel version, because a lot of stuff may break.

P.S. I also have 3.10 on my device running CM14.1 (Nougat 7.1 based)

@vlad-ivanov-name
Copy link

vlad-ivanov-name commented Jan 9, 2017

Good to know, I have 3.18 (Android 7) on a chinese phone with mtk cpu, so I assumed others have similar versions too. I guess > 3.18 users are a minority.

@TheTumultuousUnicornOfDarkness
Copy link
Contributor

What about KitKat? I have Linux 3.4 on mine, haha.
If overlayfs is not available, why not copy the entire prefix (like Wine does)?

@LubosD
Copy link
Member

LubosD commented Jan 9, 2017

Guys, I think Android devices will have sufficiently fresh kernels by the time we have anything truly useful on iOS emu ;-)

@msva
Copy link

msva commented Jan 10, 2017 via email

@bugaevc
Copy link
Member

bugaevc commented Apr 14, 2017

See #291

@ahyattdev ahyattdev added the Won't Fix For issues that we have decided not to fix label Aug 4, 2017
@ahyattdev
Copy link
Member Author

As time goes on, this will become less and less of an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Container The emulation container is configured incorrectly Won't Fix For issues that we have decided not to fix
Projects
None yet
Development

No branches or pull requests

7 participants