From owner-freebsd-emulation@FreeBSD.ORG Tue Feb 21 22:36:59 2006 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C48D16A420 for ; Tue, 21 Feb 2006 22:36:59 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id EA71143D48 for ; Tue, 21 Feb 2006 22:36:58 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 936601A3C2C; Tue, 21 Feb 2006 14:36:58 -0800 (PST) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 90FAF53BBB; Tue, 21 Feb 2006 17:36:56 -0500 (EST) Date: Tue, 21 Feb 2006 17:36:56 -0500 From: Kris Kennaway To: Brooks Davis Message-ID: <20060221223655.GA70811@xor.obsecurity.org> References: <59887930@srv.sem.ipt.ru> <20060221210659.GA64256@xor.obsecurity.org> <20060221213812.GA69006@xor.obsecurity.org> <20060221215041.GB22713@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <20060221215041.GB22713@odin.ac.hmc.edu> User-Agent: Mutt/1.4.2.1i Cc: freebsd-emulation@freebsd.org, Kris Kennaway Subject: Re: linprocfs and linux_base port upgrade X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2006 22:36:59 -0000 --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 21, 2006 at 01:50:41PM -0800, Brooks Davis wrote: > On Tue, Feb 21, 2006 at 04:38:12PM -0500, Kris Kennaway wrote: > > On Tue, Feb 21, 2006 at 04:07:00PM -0500, Kris Kennaway wrote: > > > On Tue, Feb 21, 2006 at 03:52:05PM +0300, Boris Samorodov wrote: > > > > Hi! > > > >=20 > > > >=20 > > > > Assume that one has a linux_base port installed and linprocfs is > > > > mounted. The task is to upgrade the linux_base port. We do: > > > > - Un-mounting linprocfs; > > > > - deletting /compat/linux (along /compat/linux/proc); > > > > - ... > > > >=20 > > > > The problem: a short period of time (well, it may be not so short > > > > accoring to various curcumstances) exists when there _is no_ > > > > /compat/linux/proc directory and linprocfs _is_ defined at > > > > /etc/fstab. If something goes wrong when upgrading (system panic, p= ort > > > > upgrading errors, etc) one can get an unbootable machine. > > > >=20 > > > > I think that a linux_base port should: > > > > - comment the linprocfs definition right after removing > > > > /compat/linux/proc directory; > > > > - remove the comment after creating the needed directory. > > > >=20 > > > > The comment itself should be a readable and unique one (ie all > > > > linux_base ports should use the same text). Ex.: > > > > "#*linux_base autocomment*". > > > >=20 > > > >=20 > > > > Do you have some other ideas? > > >=20 > > > Actually, this unmount ... remount situation is pretty evil. For > > > example, it prevents users from building linux_base in a jail. In > > > fact I'd like to switch to building packages in jails instead of > > > chroots on the package cluster, but this is the major reason I can't. > >=20 > > Not to mention that the umount isn't always reliable for some reason: > > the linux_base-8 package build often fails with this: > >=20 > > =3D=3D=3D> Checking if emulators/linux_base-8 already installed > > Un-mounting linprocfs... > > kern.fallback_elf_brand: -1 -> 3 > > redhat-release-8.0-8.noarch.rpm > > glibc-common-2.3.2-4.80.8.i386.rpm > > glibc-2.3.2-4.80.8.i386.rpm > > setup-2.5.20-1.noarch.rpm > > filesystem-2.1.6-5.noarch.rpm > > unpacking of archive failed on file /proc: cpio: chown failed - Operati= on not supported > > *** Error code 1 >=20 > I've also had issues where trying to build a native jdk in a chroot. > The problem is that the chroot in question doesn't have the necessicary > fstab entries so procfs get unmounted, but not remounted. Installing > linux_base in a prior invocation (also required on amd64 due to the > ARCH override) and mounting and unmounting the chroot's /compat/linux/proc > before and after every port build seems to work OK. In my environment I have fstab configured, but it's still not reliable; sometimes jdk will end up built without linprocfs present, as though it was not remounted correctly. I suspect umount and/or mount of linprocfs may sometimes fail, but I haven't managed to track down why. Anyway, [u]mounting during port builds should be avoided for the reasons I gave earlier. Kris --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFD+5YHWry0BWjoQKURAsmMAKC7vaeIa0T0YzlBTWS9PHitgGxoIQCglLcr iF1soNZJQLnF4GFtujns1LI= =/d6m -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT--