From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6643631712973619200 X-Received: by 2002:a1c:7d03:: with SMTP id y3mr970842wmc.8.1546867036293; Mon, 07 Jan 2019 05:17:16 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:b6ac:: with SMTP id j44ls74678wre.13.gmail; Mon, 07 Jan 2019 05:17:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN7oMkWjyhORMnPRpTBywgenzSbqgdFp+ClCN6md1bcLfMZShjaVBW34JrL+HIRcFMyB/Xjv X-Received: by 2002:adf:fdcd:: with SMTP id i13mr3179717wrs.32.1546867035904; Mon, 07 Jan 2019 05:17:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546867035; cv=none; d=google.com; s=arc-20160816; b=JNnJln8Ydo9AR0kFZbaFOji67iGS3gEQ/Gg4vLUmR6TGat2Cb4aB1r1L6cUyqmP2AH zGyUsfmWfY2ikwXY480ubDe1WfxvFX1T+7nmb7NH9ALq5esVAV2UCS6yz4tzSddK9fzB xnmJ9XMcFBPUQmXb7ggEKGn5KfITZgUAlgoFPGj07K46uADs0XVS9htRIuLzXeeaIP9M kPqxl3BXpUb0HLWHXNXgnhWOE7oGBlG5ysBuOm5lUIpkvWe02XlwCa7S2HZjPIMGpjGQ 9GNW8JaTtFzyMo9Rr4F6N/FssBp+3HUSSDZtr2z7AnsG/5Jt7RoOX+hEmebSUWiChrjK rOCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=M0QZ+HilKuCSrfonsZULSj1W6g1z4aMP0YLb0d12yMY=; b=EHWveyz6HkQL+v34Q//iFKJj1F/UhoVkjjZXLe2W57+QJlkFNz+IRvOtD59GDOIe0j 8V5+zXVo5uGkpU/BdhAgdplTjIspV5FVIPebu+TvBdHlverpLgiHRbyTuVIGmDfgh+7/ ZIGaZPEEzFUGKCumcDfSH07OQKbQYvwMdCjsUWBL2EJrCJ1yDN0b0wwqucXV7O6IrLs0 rIDPhqN1XzdGjRNdPBC/p9CNwcPyZKl0DHgPx3tU1Q5B5174J+XRNAIXXoZiu7nh/5rc KtQXk3vHKL+tbDIn0+mFGRIb2amaWz8sgW/QyomtaIPnyfWsEHEQC4QpQWdrMTt/+ei4 X+1A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id f6si470869wmj.0.2019.01.07.05.17.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jan 2019 05:17:15 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id x07DHFgO029165 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 7 Jan 2019 14:17:15 +0100 Received: from md1za8fc.ad001.siemens.net ([139.25.69.158]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id x07DHF3h030336; Mon, 7 Jan 2019 14:17:15 +0100 Date: Mon, 7 Jan 2019 14:17:14 +0100 From: Henning Schild To: "[ext] Jan Kiszka" Cc: isar-users Subject: Re: [PATCH] scripts: Add rpm2cpio.sh Message-ID: <20190107141714.7c2ddfa7@md1za8fc.ad001.siemens.net> In-Reply-To: References: X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: iG6ewxzM8q4M Am Mon, 7 Jan 2019 07:04:03 +0100 schrieb "[ext] Jan Kiszka" : > From: Jan Kiszka > > Bitbake is able to unpack rpm packages. For this to work, it just > needs rpm2cpio.sh in scripts. Add it from rpm upstream, similar to > what OE core did. Could you add where exactly you got that from, and the commit id if it is version control? Henning > Signed-off-by: Jan Kiszka > --- > scripts/rpm2cpio.sh | 59 > +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, > 59 insertions(+) create mode 100755 scripts/rpm2cpio.sh > > diff --git a/scripts/rpm2cpio.sh b/scripts/rpm2cpio.sh > new file mode 100755 > index 0000000..db3cae6 > --- /dev/null > +++ b/scripts/rpm2cpio.sh > @@ -0,0 +1,59 @@ > +#!/bin/sh -efu > +# > +# This software is a part of ISAR, > +# originating from the RPM Package Manager version 4.14 > +# > +# SPDX-License-Identifier: GPL-2.0 > + > +fatal() { > + echo "$*" >&2 > + exit 1 > +} > + > +pkg="$1" > +[ -n "$pkg" -a -e "$pkg" ] || > + fatal "No package supplied" > + > +_dd() { > + local o="$1"; shift > + dd if="$pkg" skip="$o" iflag=skip_bytes status=none $* > +} > + > +calcsize() { > + offset=$(($1 + 8)) > + > + local i b b0 b1 b2 b3 b4 b5 b6 b7 > + > + i=0 > + while [ $i -lt 8 ]; do > + b="$(_dd $(($offset + $i)) bs=1 count=1)" > + [ -z "$b" ] && > + b="0" || > + b="$(exec printf '%u\n' "'$b")" > + eval "b$i=\$b" > + i=$(($i + 1)) > + done > + > + rsize=$((8 + ((($b0 << 24) + ($b1 << 16) + ($b2 << 8) + $b3) > << 4) + ($b4 << 24) + ($b5 << 16) + ($b6 << 8) + $b7)) > + offset=$(($offset + $rsize)) > +} > + > +case "$(_dd 0 bs=8 count=1)" in > + "$(printf '\355\253\356\333')"*) ;; # '\xed\xab\xee\xdb' > + *) fatal "File doesn't look like rpm: $pkg" ;; > +esac > + > +calcsize 96 > +sigsize=$rsize > + > +calcsize $(($offset + (8 - ($sigsize % 8)) % 8)) > +hdrsize=$rsize > + > +case "$(_dd $offset bs=3 count=1)" in > + "$(printf '\102\132')"*) _dd $offset | bunzip2 ;; # > '\x42\x5a' > + "$(printf '\037\213')"*) _dd $offset | gunzip ;; # > '\x1f\x8b' > + "$(printf '\375\067')"*) _dd $offset | xzcat ;; # > '\xfd\x37' > + "$(printf '\135\000')"*) _dd $offset | unlzma ;; # > '\x5d\x00' > + "$(printf '\050\265')"*) _dd $offset | unzstd ;; # > '\x28\xb5' > + *) fatal "Unrecognized rpm file: $pkg" ;; > +esac