Date: Sat, 17 Nov 2001 01:20:56 +0700 From: Eugene Grosbein <eugen@grosbein.pp.ru> To: stable@freebsd.org Subject: compiling /bin/sh with builtin 'test' Message-ID: <20011117012056.A320@grosbein.pp.ru>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011117012056.A320>