From owner-freebsd-current@FreeBSD.ORG Fri Apr 18 18:22:24 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D991737B401 for ; Fri, 18 Apr 2003 18:22:24 -0700 (PDT) Received: from kientzle.com (h-66-166-149-50.SNVACAID.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 10A0E43F85 for ; Fri, 18 Apr 2003 18:22:24 -0700 (PDT) (envelope-from kientzle@acm.org) Received: from acm.org (ugly.x.kientzle.com [66.166.149.51]) by kientzle.com (8.11.3/8.11.3) with ESMTP id h3J1Lhv13984; Fri, 18 Apr 2003 18:21:47 -0700 (PDT) (envelope-from kientzle@acm.org) Message-ID: <3EA0A4E3.6090801@acm.org> Date: Fri, 18 Apr 2003 18:22:43 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:0.9.6) Gecko/20011206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Taylor References: <20030417141133.GA4155@madman.celabo.org> <20030417144449.GA4530@madman.celabo.org> <200304171535.h3HFZEFs094589@strings.polstra.com> <20030418014500.B94094@iclub.nsu.ru> <200304171944.h3HJi1jK095151@strings.polstra.com> <3E9F0A28.8030906@btc.adaptec.com> <3E9F1C15.7080702@acm.org> <20030417221622.GA18079@gattaca.yadt.co.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: current@freebsd.org Subject: Re: Going Dynamic (Was: HEADS UP: new NSS) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: kientzle@acm.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2003 01:22:25 -0000 David Taylor wrote: > Hmm, but if /sbin/mount_ufs (say) is dynamically linked, and the libraries > are still in /usr, how do you mount /usr? That's why certain critical shared libs (e.g., libc.so) need to be moved to /lib. >>As I said, I've already done a chunk of work >>for this. If someone would like to help finish... > > If there's a list of tasks that need to be done, I'd be willing to see > what I can do (although I'm going back to uni next week)... Here are the remaining tasks that I know of: 1) Create /lib, move shared libraries. This involves working on bsd.lib.mk and a few related pieces so that certain libraries get installed differently: * shared lib into /lib * compatibility symlinks from /usr/lib -> /lib * static lib into /usr/lib Here's a list of libraries that I believe need to be moved: libc libcrypt libedit libkvm libl libm libtermcap libutil libalias libatm libcam libcurses libdevstat libipsec libipx libmd libncp libreadline libsbuf libsmb libufs libz 2) Update ld-elf.so.1 I've not yet looked carefully at this. This may need to be moved? It will definitely need to have the default search path altered to look in /lib first. If the above is done correctly, it should be possible to dynamically link one of the standard utils (by adding NOSHARED=yes to the Makefile for 'ed' or 'pax', for example), boot to single user and have that utility work, even without /usr being mounted. 3) Set up a system-wide switch. This may just mean setting a default for NOSHARED. It may be necessary to visit specific Makefiles to override NOSHARED=no to force those utilities to be compiled static. (/sbin/init may require this. A few other utils may also benefit.) 4) Boot-time safety issues. Various tweaks to ensure that _something_ is possible even if the system gets screwed up. Not sure which of the following is best: a) Kernel automatically runs /rescue/init if /sbin/init fails too quickly. b) Prompt user for an alternate init if /sbin/init fails. c) Have /sbin/init remain static, alter it to prompt for /rescue/sh in single-user mode (always? sometimes?). I'm leaning towards some variant of (c), but I'm not sure what all the issues are here. Tim Kientzle