From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 3 00:36:05 2007 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74E8116A420; Mon, 3 Sep 2007 00:36:05 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id D3A5C13C46C; Mon, 3 Sep 2007 00:36:04 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (dialup237.ach.sch.gr [81.186.70.237]) (authenticated bits=128) by igloo.linux.gr (8.14.1/8.14.1/Debian-8) with ESMTP id l830IAjK011166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 3 Sep 2007 03:18:19 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.1/8.14.1) with ESMTP id l830I42J012016; Mon, 3 Sep 2007 03:18:05 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.1/8.14.1/Submit) id l830I3J6012015; Mon, 3 Sep 2007 03:18:03 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Mon, 3 Sep 2007 03:18:03 +0300 From: Giorgos Keramidas To: Tim Kientzle Message-ID: <20070903001803.GA8098@kobe.laptop> References: <20070901073440.GL85633@comp.chem.msu.su> <46DAFE5C.6070806@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46DAFE5C.6070806@freebsd.org> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.092, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.31, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: Yar Tikhiy , hackers@freebsd.org Subject: Re: Useful tools missing from /rescue X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2007 00:36:05 -0000 On 2007-09-02 11:18, Tim Kientzle wrote: > Yar Tikhiy wrote: >> In addition, there are chflags and chmod in /rescue, but there's no >> chown in it, so the toolset is a bit incomplete. > > Oh, my. chown was definitely an oversight. That > should have been in there. Probably because chown is a relatively big binary. If build as a static binary here, it ends up being: $ pwd /home/keramida/bsd/src/usr.sbin/chown $ make DEBUG_FLAGS='' NO_SHARED=yes all [...] $ ls -ld chown -rwxrwxr-x 1 keramida users - 2297013 Sep 3 03:06 chown $ strip -s chown $ ls -ld chown -rwxrwxr-x 1 keramida users - 550624 Sep 3 03:06 chown $ This will get smaller when crunched, but it's still almost 4x the size of chmod: $ pwd /home/keramida/bsd/src/bin/chmod $ make DEBUG_FLAGS='' NO_SHARED=yes all [...] $ ls -ld chmod -rwxrwxr-x 1 keramida users - 662678 Sep 3 03:08 chmod $ strip -s chmod $ ls -ld chmod -rwxrwxr-x 1 keramida users - 165884 Sep 3 03:08 chmod $ Running nm(1) on the binaries, I see that they have the same symbols though: $ nm -S chmod | awk '{print $2,$3,$4}' | sort > /tmp/symbols.chmod $ nm -S chown | awk '{print $2,$3,$4}' | sort > /tmp/symbols.chown $ diff -u /tmp/symbols.chmod /tmp/symbols.chown $ Does this mean that adding chown to the already crunched binary will not cause a lot of bloat because of symbols/functions private to chown? - Giorgos