Date: Fri, 25 Aug 2023 15:23:45 +0900 From: Tatsuki Makino <tatsuki_makino@hotmail.com> To: ports@freebsd.org Subject: Re: Building a Linuxulator userland from source Message-ID: <SI2PR01MB5036B1DACFB67D15FD39539DFAE3A@SI2PR01MB5036.apcprd01.prod.exchangelabs.com> In-Reply-To: <ycunrmdtcbpudkpvklm4mty2udi2jlx75akpfc3qfpi7xhwx65@ln4asxaakt3n> References: <xcztahm3vu3bjghjqqxuoy2xabyjmyfq22jw6mkaaaqo7wa36s@fdq7dlvpuhlk> <i3kr2kukjwgw2xvjlzgshwe72bjpnln4lvl7prhk77nelzidm6@2g56zi3ku7ec> <SI2PR01MB5036EAB6EE2D224BBDAF86B0FA19A@SI2PR01MB5036.apcprd01.prod.exchangelabs.com> <SI2PR01MB50366A01896746D4DAFC18F7FA1EA@SI2PR01MB5036.apcprd01.prod.exchangelabs.com> <cnbxytnfqoh4dr6clz3qdhygeehjh7e3kqjdiarhiqsjhburhk@eotxvli5ma23> <SI2PR01MB50365D850421F63522B5269DFA1EA@SI2PR01MB5036.apcprd01.prod.exchangelabs.com> <ycunrmdtcbpudkpvklm4mty2udi2jlx75akpfc3qfpi7xhwx65@ln4asxaakt3n>
next in thread | previous in thread | raw e-mail | index | archive | help
Felix Palmen wrote on 2023/08/21 18:30: > * Tatsuki Makino <tatsuki_makino@hotmail.com> [20230821 17:40]: >> If we try to use it directly, the command not found if bash is not installed. > > Installing a FreeBSD bash won't help either, this script expects > /bin/bash which will never exist on FreeBSD (it's installed in > /usr/local/bin/bash). This I added after "if" without trying :) I was only doing /compat...bin/bash /compat...bin/ldd /something/about/escpr2. >> we want poudriere to mount real devfs to /compat/linux/dev as well, >> since linux binary behaves like chroot to /compat/linux. > > Well, first /compat/linux is *not* a chroot or jail, but actually just > some kind of "filesystem overlay", which is the great thing about it. It > means Linux binaries can access *all* files of the FreeBSD system, as > long as they are not "shadowed" by something below /compat/linux. I was also trying this in jail of poudriere and made the mistake of thinking it was a chroot because I couldn't find the file that should have been there. However, I will learn about more appropriate words :) > And indeed, to support building native Linux software using poudriere, > it *should* mount devfs on /compat/linux/dev. > >> Alternatively, pkg-plist in emulators/linux_base-c7 is creating dummy >> /compat/linux/dev, and removing it seems to be a workaround. > > In a live system, there's no issue. /etc/rc.d/linux will mount all > necessary pseudo filesystems: > > | if checkyesno linux_mounts_enable; then > | linux_mount linprocfs "${_emul_path}/proc" -o nocover > | linux_mount linsysfs "${_emul_path}/sys" -o nocover > | linux_mount devfs "${_emul_path}/dev" -o nocover > | linux_mount fdescfs "${_emul_path}/dev/fd" -o nocover,linrdlnk > | linux_mount tmpfs "${_emul_path}/dev/shm" -o nocover,mode=1777 > | fi Does this nocover mean that the files that exist in the directory that will be the mount point will remain visible? This will be a feature that will remain non-existent in 12.x and await end of support. > So far, poudriere doesn't mount anything on /compat/linux/dev for its > building jails, although it *does* mount /compat/linux/proc. > > For now, I found that a simple symlink to the real /dev also does the > trick, which I can add with some hackery in the port Makefile itself, by > adding some extra prerequisite for "build-depends" when a poudriere > build is detected. In the long run, poudriere should mount a real devfs > though. In addition, variable JAIL_PARAMS (and JAIL_NET_PARAMS) exist in poudriere and are used to append to something defined somewhere. It may be possible to use this to allow mount inside the jail. But I don't know how to configure the jail that way :) Regards.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?SI2PR01MB5036B1DACFB67D15FD39539DFAE3A>