From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 0408BE00E8F; Tue, 22 Sep 2015 01:03:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [134.134.136.20 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id F119CE00927 for ; Tue, 22 Sep 2015 01:03:52 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 22 Sep 2015 01:03:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,572,1437462000"; d="scan'208";a="566080211" Received: from linux.intel.com ([10.23.219.25]) by FMSMGA003.fm.intel.com with ESMTP; 22 Sep 2015 01:03:29 -0700 Received: from linux.intel.com (vmed.fi.intel.com [10.237.72.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTP id E20B06A4005; Tue, 22 Sep 2015 01:02:33 -0700 (PDT) Date: Tue, 22 Sep 2015 11:03:23 +0300 From: Ed Bartosh To: Elliot Smith Message-ID: <20150922080323.GA21718@linux.intel.com> References: <1442857762-2642-1-git-send-email-elliot.smith@intel.com> MIME-Version: 1.0 In-Reply-To: <1442857762-2642-1-git-send-email-elliot.smith@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.21 (2010-09-15) Cc: toaster@yoctoproject.org Subject: Re: [review-request][PATCH] toaster: Add fake entry to Target_File for filesystem root X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: ed.bartosh@linux.intel.com List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2015 08:03:55 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 21, 2015 at 06:49:22PM +0100, Elliot Smith wrote: > The files-in-image.txt file is produced by bitbake after an > image is created, listing all the files in the image. > However, this list doesn't include the root directory ('/'). > Did you try to look what caused this change? Bitbake used to include root dir into this file previously, right? > buildinfohelper.py then tries to construct the filesystem > tree from this file, assuming that every directory apart from > the root directory (which is special-cased) can be assigned > a parent. But because the root directory isn't listed in > files-in-image.txt, an object for the root directory is never > created. > > The direct subdirectories of the root ('./bin', './usr' etc.) > then can't be assigned a parent directory, as the object > representing the root directory doesn't exist. This > results in a Target_File lookup error and causes the > directory listing page to fail. > > Fix this by creating a fake entry for the root directory > in the Target_File table, so that the direct subdirectories > of / can be assigned a parent. Note that it doesn't matter > that the root is faked, as its properties are never shown > in the directory structure tree. > This looks like a workaround to me. It should be fixed in bitbake code if it's possible. Regards, Ed > [YOCTO #8280] > > Signed-off-by: Elliot Smith > --- > bitbake/lib/bb/ui/buildinfohelper.py | 31 +++++++++++++++++-------------- > 1 file changed, 17 insertions(+), 14 deletions(-) > > diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py > index 6e313fe..b2201f6 100644 > --- a/bitbake/lib/bb/ui/buildinfohelper.py > +++ b/bitbake/lib/bb/ui/buildinfohelper.py > @@ -353,26 +353,29 @@ class ORMWrapper(object): > files = filedata['files'] > syms = filedata['syms'] > > - # we insert directories, ordered by name depth > + # always create the root directory as a special case; > + # note that this is never displayed, so the owner, group, > + # size, permission are irrelevant > + tf_obj = Target_File.objects.create(target = target_obj, > + path = '/', > + size = 0, > + owner = '', > + group = '', > + permission = '', > + inodetype = Target_File.ITYPE_DIRECTORY) > + tf_obj.save() > + > + # insert directories, ordered by name depth > for d in sorted(dirs, key=lambda x:len(x[-1].split("/"))): > (user, group, size) = d[1:4] > permission = d[0][1:] > path = d[4].lstrip(".") > + > + # we already created the root directory, so ignore any > + # entry for it > if len(path) == 0: > - # we create the root directory as a special case > - path = "/" > - tf_obj = Target_File.objects.create( > - target = target_obj, > - path = path, > - size = size, > - inodetype = Target_File.ITYPE_DIRECTORY, > - permission = permission, > - owner = user, > - group = group, > - ) > - tf_obj.directory = tf_obj > - tf_obj.save() > continue > + > parent_path = "/".join(path.split("/")[:len(path.split("/")) - 1]) > if len(parent_path) == 0: > parent_path = "/" > -- > Elliot Smith > Software Engineer > Intel OTC > > --------------------------------------------------------------------- > Intel Corporation (UK) Limited > Registered No. 1134945 (England) > Registered Office: Pipers Way, Swindon SN3 1RJ > VAT No: 860 2173 47 > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies. > > -- > _______________________________________________ > toaster mailing list > toaster@yoctoproject.org > https://lists.yoctoproject.org/listinfo/toaster -- -- Regards, Ed