From owner-freebsd-stable Fri Nov 16 10:23:27 2001 Delivered-To: freebsd-stable@freebsd.org Received: from D00015.dialonly.kemerovo.su (www2.svzserv.kemerovo.su [213.184.65.86]) by hub.freebsd.org (Postfix) with ESMTP id 4110D37B405 for ; Fri, 16 Nov 2001 10:23:17 -0800 (PST) Received: (from eugen@localhost) by D00015.dialonly.kemerovo.su (8.11.6/8.11.4) id fAGIKu300455 for stable@freebsd.org; Sat, 17 Nov 2001 01:20:57 +0700 (KRAT) (envelope-from eugen) Date: Sat, 17 Nov 2001 01:20:56 +0700 From: Eugene Grosbein To: stable@freebsd.org Subject: compiling /bin/sh with builtin 'test' Message-ID: <20011117012056.A320@grosbein.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi! I have a production router that is 4.0-SNAP-somedate installed on old 486SX-25/8M RAM/200M HDD machine. This snapshot is stable for the task of routing/shaping and my router works about a year. The kernel is stripped down and it does not suffer from lack of memory too much. It swaps out unneeded processed like getty etc. taking about 1.5M of swap and runs very smootly then. Basically it runs in kernel mode, there were no user-level processes doing expensive jobs. Now I need to implement some extra tasks using this machine and write some shell scripts using /bin/sh. There are loops in these scripts and these loops run too slow becouse it is slow to fork+exec to execute 'test' (it needs to swap) on this hardware. I tried not to use 'test' (use 'case' for strings etc) but it's not always possible. So I'm thinking about recompiling /bin/sh with 'test' as builtin. Perhaps, I could grab sources of /bin/sh from recent STABLE. I did that for date(1) (I needed 'date -j' that does not work for 4.0) and new 'date' works fine. Btw, I cannot just upgrade machine for some extraneous reasons. Did somebody try that? Any caveats? It is remote production system and I'm afraid if this will render my system unbootable, it will be very black day for me. Eugene Grosbein To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message