From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7358338671440822272 X-Forwarded-Encrypted: i=2; AJvYcCV4LXp1DVwUraNPYqmQXcbN+rSfRh4Mdp1hV/nHj/ClqH6j7k33dJQ5VYbfUByJAGMwAphaiPT3wqhlskaRVRCA8eRPJcPje4wzfPM= X-Received: by 2002:a2e:9f49:0:b0:2eb:7e45:fac5 with SMTP id 38308e7fff4ca-2ec0e5c6589mr55226031fa.16.1718601833837; Sun, 16 Jun 2024 22:23:53 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:9791:0:b0:2ec:21cc:461e with SMTP id 38308e7fff4ca-2ec21cc4902ls5707411fa.2.-pod-prod-04-eu; Sun, 16 Jun 2024 22:23:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWQLdost1Ge544XzU1JxkbDLqBQfTFyfFNbM8RT+qSz+FQikc16PZmOUW5+5gRSbYH0pFTzvxzZ05ExEXX3NUCr1ww2rFvNra0+PuM= X-Google-Smtp-Source: AGHT+IErD83w1HIg32Nzj6/6dy/wFsWtyVB5NCNSZinnUhmZ5H9ykYHyOqyqFnclD6YA3pCYDJsA X-Received: by 2002:a2e:988c:0:b0:2eb:f472:e7d3 with SMTP id 38308e7fff4ca-2ec0e5b5f05mr53472471fa.6.1718601831041; Sun, 16 Jun 2024 22:23:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718601831; cv=none; d=google.com; s=arc-20160816; b=cGPo6EFBuZlr19SK93dijdIovTnD5glAGHI8vmh5OFzGugTfdDTGoGGEXgT5Adllu/ rQ8ViOD7g1/GxZT5ZWAQuDZT0SyeXBs1SUPa+BukJD8wxMvb0q/KlVfCVeFX9VQOC4/z VoNAxVWVW58s98BgqSA0RIyviAb8ohbce8ZXPu9GCFO+U080shLnNuPem84Q2j68v2Zt vyKkiO+A13/6HGm3qB4kb0Xrx7Nn2B5a2DIzKSbYRbr7WjLf3hRgTDNrqnLj9gldtjQK wakLUOoCvVy6WHGR0b0LFLy9d8Fg5NlAMjPwEgokKipplo6vgEMGW2wNFW0vSo7Okde9 Mq3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id; bh=dyOzol9EKg1vNjldAGyEDaJz0C0G+k5w13qQoNqC9Xk=; fh=7/UjbK27h9mOCgxIRxgjcNtChGWHBqkSxdm7oEnX+HI=; b=ik+AYayoEYkqmCBvb3K4U62gabvNaJAQfRpej0MHIqsIJkDvHQWSd3MFq/Ypsn0fZd YQIAJSNAkVEXbckWZ5zE1FEazDn4GXsSZTDwmMMbzlmTyfR5XN1Ek4q1ygsUzZOdQU6S wBOSQs05CJrwOAMyBB+5gCnBp63IvhVpLpuFTyQCk42BLxWzw150gJ8aIpTXt2eRDNUC tpCh44/AZMeSNBv76H+tJRdnXa1gYmDmBkCm9rL5x1VnVn0FO0ABEphCltPOY9yfqNyM 7viE5Nx7oMTo3vQa2Wmi96/7IpCpxdKwoUqJkBuV15U0yodu6NJhYSfUAvoRVT/i2mMa p9HA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 38308e7fff4ca-2ec05cbade8si1851101fa.5.2024.06.16.22.23.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Jun 2024 22:23:50 -0700 (PDT) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from [127.0.0.1] (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 45H5Nkvw013548 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jun 2024 07:23:48 +0200 Message-ID: <5403d444775bfb469c1098c0b122c515dd0a7501.camel@ilbers.de> Subject: Re: [PATCH] image: check if the file is core dump From: Uladzimir Bely To: Zhibin Dong , isar-users Date: Mon, 17 Jun 2024 08:23:46 +0300 In-Reply-To: References: <20240416051222.3344127-1-zhibin.dong@siemens.com> <20240417064600.12133-1-zhibin.dong@siemens.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.2 (by Flathub.org) MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: ymrnpsze8tzA On Tue, 2024-04-16 at 23:50 -0700, Zhibin Dong wrote: > How about using `--mime-type`? >=20 > =E5=9C=A82024=E5=B9=B44=E6=9C=8817=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=89 UT= C+8 14:47:25 =E5=86=99=E9=81=93=EF=BC=9A > > The previous code does a wrong judgement in two cases: > > 1. a file is suffixed by .core but is not a core dump file > > 2. a file is a core dump file but is not suffixed by .core > >=20 > > The new code uses `file` to determine the type of files, which is > > more > > accurate. > >=20 > > Signed-off-by: Zhibin Dong > > --- > > =C2=A0meta/classes/image.bbclass | 2 +- > > =C2=A01 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/meta/classes/image.bbclass > > b/meta/classes/image.bbclass > > index 98741da0..2b0995d2 100644 > > --- a/meta/classes/image.bbclass > > +++ b/meta/classes/image.bbclass > > @@ -444,7 +444,7 @@ EOSUDO > > =C2=A0 > > =C2=A0# Sometimes qemu-user-static generates coredumps in chroot, move > > them > > =C2=A0# to work temporary directory and inform user about it. > > - for f in $(sudo find ${ROOTFSDIR} -type f -name *.core); do > > + for f in $(sudo find ${ROOTFSDIR} -type f -exec file --mime-type > > {} \; | grep 'application/x-coredump' | cut -d: -f1); do > > =C2=A0sudo mv "${f}" "${WORKDIR}/temp/" > > =C2=A0bbwarn "found core dump in rootfs, check it in > > ${WORKDIR}/temp/${f##*/}" > > =C2=A0done Applied to next, thanks. --=20 Best regards, Uladzimir.