From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by mail.openembedded.org (Postfix) with ESMTP id F1B9673C73 for ; Fri, 10 Apr 2015 15:01:36 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.14.9/8.14.9) with ESMTP id t3AF1a8L007702 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Fri, 10 Apr 2015 08:01:36 -0700 (PDT) Received: from Marks-MacBook-Pro.local (172.25.36.228) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.3.224.2; Fri, 10 Apr 2015 08:01:35 -0700 Message-ID: <5527E5CE.7050706@windriver.com> Date: Fri, 10 Apr 2015 10:01:34 -0500 From: Mark Hatle Organization: Wind River Systems User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Martin Jansa , References: <1428674774-29364-1-git-send-email-Martin.Jansa@gmail.com> In-Reply-To: <1428674774-29364-1-git-send-email-Martin.Jansa@gmail.com> Subject: Re: [PATCH] e2fsprogs: Package populate-extfs.sh and enable symlink install X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2015 15:01:38 -0000 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit I'm a bit confused by this. Why is symlink saving space over hardlink? The hardlinked items should retain their hard link status through the packaging and into the image. If not, it sounds like there is a bug in the packaging mechanism you are using (opkg, deb, rpm?) and/or the image generation. And just because 'ls' shows the sizes, the fact they are hard linked means they're not taking up duplicate space. I know there is a lot more then just e2fsprogs that does a hard link vs symlinks for various command, which is why I'm trying to understand where we might have a problem. --Mark On 4/10/15 9:06 AM, Martin Jansa wrote: > * install populate-extfs.sh from contrib, be aware that in order > to use it you need to set DEBUGFS shell variable, otherwise it will > try to use debugfs from relative path which is almost always > incorrect: > CONTRIB_DIR=$(dirname $(readlink -f $0)) > DEBUGFS="$CONTRIB_DIR/../debugfs/debugfs" > > * use symlinks to install e2fsck, mke2fs, without this option we have: > $ ls -lahi tmp-glibc/work/arm920tt-oe-linux-gnueabi/e2fsprogs/1.42.9-r0/image/sbin/ > ... > 101982430 -rwxr-xr-x 5 bitbake bitbake 972K Apr 10 15:43 e2fsck > 101982430 -rwxr-xr-x 5 bitbake bitbake 972K Apr 10 15:43 fsck.ext2 > 101982430 -rwxr-xr-x 5 bitbake bitbake 972K Apr 10 15:43 fsck.ext3 > 101982430 -rwxr-xr-x 5 bitbake bitbake 972K Apr 10 15:43 fsck.ext4 > 101982430 -rwxr-xr-x 5 bitbake bitbake 972K Apr 10 15:43 fsck.ext4dev > ... > 101982441 -rwxr-xr-x 5 bitbake bitbake 348K Apr 10 15:43 mke2fs > 101982441 -rwxr-xr-x 5 bitbake bitbake 348K Apr 10 15:43 mkfs.ext2 > 101982441 -rwxr-xr-x 5 bitbake bitbake 348K Apr 10 15:43 mkfs.ext3 > 101982441 -rwxr-xr-x 5 bitbake bitbake 348K Apr 10 15:43 mkfs.ext4 > 101982441 -rwxr-xr-x 5 bitbake bitbake 348K Apr 10 15:43 mkfs.ext4dev > ... > > which would be OK, because they are hadlinks, but after runstrip in > do_package we get one stripped binary and 4 hardlinks to the original > one: > > $ ls -lahi tmp-glibc/work/arm920tt-oe-linux-gnueabi/e2fsprogs/1.42.9-r0/packages-split/e2fsprogs-e2fsck/sbin > 101982713 -rwxr-xr-x 8 bitbake bitbake 972K Apr 10 15:43 e2fsck > 101982713 -rwxr-xr-x 8 bitbake bitbake 972K Apr 10 15:43 fsck.ext2 > 101982713 -rwxr-xr-x 8 bitbake bitbake 972K Apr 10 15:43 fsck.ext3 > 101982713 -rwxr-xr-x 8 bitbake bitbake 972K Apr 10 15:43 fsck.ext4 > 101983136 -rwxr-xr-x 2 bitbake bitbake 185K Apr 10 15:43 fsck.ext4dev > $ ls -lahi tmp-glibc/work/arm920tt-oe-linux-gnueabi/e2fsprogs/1.42.9-r0/packages-split/e2fsprogs-mke2fs/sbin/ > 101982716 -rwxr-xr-x 8 bitbake bitbake 348K Apr 10 15:43 mke2fs > 101982716 -rwxr-xr-x 8 bitbake bitbake 348K Apr 10 15:43 mkfs.ext2 > 101988266 -rwxr-xr-x 2 bitbake bitbake 72K Apr 10 15:43 mkfs.ext3 > 101982716 -rwxr-xr-x 8 bitbake bitbake 348K Apr 10 15:43 mkfs.ext4 > 101982716 -rwxr-xr-x 8 bitbake bitbake 348K Apr 10 15:43 mkfs.ext4dev > > That's super annoying for big files like this which are often include > in small recovery images. Using --enable-symlink-install option results > in one stripped binary and 4 symlinks: > > $ ls -lahi tmp-glibc/work/arm920tt-oe-linux-gnueabi/e2fsprogs/1.42.9-r0/packages-split/e2fsprogs-e2fsck/sbin/ > 102113806 -rwxr-xr-x 2 bitbake bitbake 185K Apr 10 15:50 e2fsck > 102113813 lrwxrwxrwx 1 bitbake bitbake 6 Apr 10 15:50 fsck.ext2 -> e2fsck > 102113814 lrwxrwxrwx 1 bitbake bitbake 6 Apr 10 15:50 fsck.ext3 -> e2fsck > 102113812 lrwxrwxrwx 1 bitbake bitbake 6 Apr 10 15:50 fsck.ext4 -> e2fsck > 102113815 lrwxrwxrwx 1 bitbake bitbake 6 Apr 10 15:50 fsck.ext4dev -> e2fsck > $ ls -lahi tmp-glibc/work/arm920tt-oe-linux-gnueabi/e2fsprogs/1.42.9-r0/packages-split/e2fsprogs-mke2fs/sbin/ > 102113804 -rwxr-xr-x 2 bitbake bitbake 72K Apr 10 15:50 mke2fs > 102113825 lrwxrwxrwx 1 bitbake bitbake 6 Apr 10 15:50 mkfs.ext2 -> mke2fs > 102113826 lrwxrwxrwx 1 bitbake bitbake 6 Apr 10 15:50 mkfs.ext3 -> mke2fs > 102113823 lrwxrwxrwx 1 bitbake bitbake 6 Apr 10 15:50 mkfs.ext4 -> mke2fs > 102113824 lrwxrwxrwx 1 bitbake bitbake 6 Apr 10 15:50 mkfs.ext4dev -> mke2fs > > Saving cca 1,5MB. > > Signed-off-by: Martin Jansa > --- > meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb > index 66065bc..95b4550 100644 > --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb > +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb > @@ -26,7 +26,7 @@ SRC_URI += "file://acinclude.m4 \ > SRC_URI[md5sum] = "3f8e41e63b432ba114b33f58674563f7" > SRC_URI[sha256sum] = "2f92ac06e92fa00f2ada3ee67dad012d74d685537527ad1241d82f2d041f2802" > > -EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-elf-shlibs --disable-libuuid --disable-uuidd --enable-verbose-makecmds" > +EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-elf-shlibs --disable-libuuid --disable-uuidd --enable-verbose-makecmds --enable-symlink-install" > EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs" > > do_configure_prepend () { > @@ -54,6 +54,8 @@ do_install () { > oe_multilib_header ext2fs/ext2_types.h > install -d ${D}${base_bindir} > mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs > + > + install -v -m 755 ${S}/contrib/populate-extfs.sh ${D}${base_sbindir}/ > } > > do_install_append_class-target() { >