Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4794101ybi; Mon, 15 Jul 2019 15:06:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPAix4uWgHIipHsbL6uQvHY3pjIu5LOhCpDSvNW9BvKgVkG2xCZSFZmTDwOR4xy23i847z X-Received: by 2002:a17:902:9a49:: with SMTP id x9mr31045062plv.282.1563228389425; Mon, 15 Jul 2019 15:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563228389; cv=none; d=google.com; s=arc-20160816; b=hO5pU1W/S3SryGgypYzyNm+RAIOEdaV+VFHzdqhkmoS+vbdQJaxOVBXJFmDjz0Urss rJrlSnyF4aeT71a2RgKsgP3lZzYDz7G21CYRW+BWSsAwKUyMWZUZigEJCDXI94ERV/1k 32xU3GReS6VvZRJBenpoWnRihu+xpVbjSgAGgV0P3b4r2cypWtEhFYblg4sTIRjYo/f5 tMoqQvhvni+HAaWbQnOVhr4uVxCz8ltoXvGE0HUwcrrpvAjfbu+0wfgAw3TYvk+8QfKr FwGnUbwcRnQHm+KTPws1mgDtLt2SsmDlinzjNQ96cdyYvclcYIURQ7T8qCigbpvKWQmS 4a6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=hBTYV7dsLn/ggIoXGJ3xxvrwmObruuMnBH8CE5+DbDk=; b=AQUnuKL4WwbohrOKlaYIOIxhT13aVvI6jTP4CmILogADsvM+GH8xPBXG0FgPxoxydi Lol/KHgP6geFQ5r/2YVLO8OhwM3SfHfB5iXbVI/FLLhgaBAZDTP2fn2z2LToAdlo217r V2xhrlW/7SbmWP9/4Xwi83EwUtYi8fL6q2BYHW5O2vBequrxpbcjxtll1sHSnM280cl6 4nFyX6QLynmekg4216UOJ5xyb6t+CKvsK5rt49+Pf8IIPX6St0MAG8CT1nfzvsTxZ4l7 SdqkSDtkMhJxF4Fgg8YXfthyEVeOALTQWuCTvEfAB7bIDNkuEpg+Mhb22xq6l7OHD+ZM 1lFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u185si17208126pgd.561.2019.07.15.15.06.12; Mon, 15 Jul 2019 15:06:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732593AbfGOWFm (ORCPT + 99 others); Mon, 15 Jul 2019 18:05:42 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:17492 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731717AbfGOWFl (ORCPT ); Mon, 15 Jul 2019 18:05:41 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6FLwjbc073885 for ; Mon, 15 Jul 2019 18:05:40 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2trxmdfxbb-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 15 Jul 2019 18:05:40 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 15 Jul 2019 23:05:38 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 15 Jul 2019 23:05:34 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6FM5XAa48103650 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Jul 2019 22:05:33 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1BAE142045; Mon, 15 Jul 2019 22:05:33 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5B3034204C; Mon, 15 Jul 2019 22:05:32 +0000 (GMT) Received: from localhost (unknown [9.145.71.68]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 15 Jul 2019 22:05:32 +0000 (GMT) Date: Tue, 16 Jul 2019 00:05:30 +0200 From: Vasily Gorbik To: Petr Tesarik Cc: Christian Borntraeger , Heiko Carstens , Thomas Gleixner , Philipp Rudo , Greg Kroah-Hartman , Laura Abbott , Masahiro Yamada , "linux-kernel@vger.kernel.org" , "linux-s390@vger.kernel.org" , Raymund Will Subject: Re: [PATCH 2/2] s390: add Linux banner to the compressed image References: <20190714175041.194c98be@ezekiel.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190714175041.194c98be@ezekiel.suse.cz> X-TM-AS-GCONF: 00 x-cbid: 19071522-0008-0000-0000-000002FD7B28 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19071522-0009-0000-0000-0000226AEED9 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-15_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907150246 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 14, 2019 at 03:52:52PM +0000, Petr Tesarik wrote: > On Sun, 14 Jul 2019 16:35:33 +0200 > Vasily Gorbik wrote: > > > On Fri, Jul 12, 2019 at 07:21:01PM +0200, Petr Tesarik wrote: > > > Various tools determine the kernel version from a given binary by > > > scanning for the Linux banner string. This does not work if the > > > banner string is compressed, but we can link it once more into the > > > uncompressed portion of bzImage. > > > But even before discussing solutions I would like to understand the > > problem first. Which specific tools are you referring to? What are they > > good for? And how do they get the kernel version from other architectures > > compressed images? > > The tool I'm aware of is called get_kernel_version. It's built as part > of openSUSE aaa_base and is used at install time. I'm not quite sure > how it is used, but I have added Raymund Will to Cc; he can provide > more information. There's also an open bug for it: > > https://bugzilla.opensuse.org/show_bug.cgi?id=1139939 Oh, I see, found it, thanks. Very interesting tool. https://github.com/openSUSE/aaa_base/blob/master/get_kernel_version.c And the only usage of this tool I found is to get the kernel version of /boot/image (on s390) to run depmod during yast-installation/src/clients/network_finish.rb I also see that queries to rpm are already done from yast-yast2/library/system/src/modules/Kernel.rb Wouldn't it be more reliable (and portable) to just get the kernel version from rpm metadata? Without using unreliable tools? Or find some other solution, since this is the only use case for the tool? $ rpm -qf --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' /boot/vmlinuz-5.1.17-300.fc30.x86_64 5.1.17-300.fc30.x86_64 [it looks like openSUSE kernel rpms don't have metadata to reconstruct full kernel version currently, but that could be improved?] Anyhow, I'm not opposed to an idea to make it possible to detect the kernel version from bzImage. But it should be reliable. So, see the follow on patch I'm sending.