From patchwork Tue Apr 16 05:12:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhibin Dong X-Patchwork-Id: 3492 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Tue, 16 Apr 2024 07:52:17 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-oo1-f59.google.com (mail-oo1-f59.google.com [209.85.161.59]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 43G5qFjQ021473 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 Apr 2024 07:52:16 +0200 Received: by mail-oo1-f59.google.com with SMTP id 006d021491bc7-5aa319be326sf5189402eaf.2 for ; Mon, 15 Apr 2024 22:52:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713246730; cv=pass; d=google.com; s=arc-20160816; b=ZtwMWnPIjOXPk97CRTObkexqH5HUqjN6e8HwmW2SgG2x5VfCv20A/fPZjrKzqzXrH/ XVHtxCDOGGEuffrqgYlJPRhSf+t/DLvMOuwm/NWzeIwKiSneUfY0fSvELiIF1WUv+bNY U5zyLthLfwsGpjOecrDzviqTX2hhHf0PwL3L6CEIYIbAG2FABjtzkfgAmVeysTUzCScH TAVEizfHb7unYibsXg264WXxTtMAxwtdLcmtcxratScSNn3V6ecR7S6nGlnQWrRYHrae 6M+4XMpH58R51COjxKjXzPrwB/N73wjdG5RapCjOyZqNS/TWbz6XM0rYUuQVxpkoS0Os Ij7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature:dkim-signature; bh=1Ajn42zvEompYWr+m7FqSPPVHNaM3XBm/1P37V2Kmbk=; fh=LPe4mju88F4kHoorREVD5G3bVnU1uZb9bBNVJbMOjmI=; b=U3mb2VFF7qn1SXx6JgnLngXSdrPIVePZgdxKWgLPbr1GSLo6V4Z6wApYAFS4ZYrE3D A4/tRf/QYlb1flGMiIeixC+pHDwmaG9v7F2q/nb0rl9x4SYKBpur4NLRVE72+wIkKQtZ xS3g9f47F9x7RMGUm0TNX99Z/7dgv8qU9vLAnR/6x1kthsngwp5PJSCFHjm+ah6oVtqn 2m6BD9PY+jXW4ic1MfYOKwwPJE44TuNurKIHUJbqXqnnnASRJ/ZtWULDAJkR/H/7/vZv n/XNKk5tIu+ePKCFV0Zhhr+rgUHEjZhoxj81brgYPopma0iiTfrYuo0exzB/ShWET97d IkwA==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jT5GMLuY; spf=pass (google.com: domain of developerdong@gmail.com designates 2001:4860:4864:20::34 as permitted sender) smtp.mailfrom=developerdong@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1713246730; x=1713851530; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=1Ajn42zvEompYWr+m7FqSPPVHNaM3XBm/1P37V2Kmbk=; b=ZNpU9bdxFPrmXq0aRsvW27UM7P5gso40St+BOZmqTSYM8KT2eNScKl/eU3As/lvShs 3OC2li0DgQUy/nsJse1LqvFxOSdPizUzUPFzJymzSraDtMOE9/9Zob5uBNUEL/hhVTuT +fB7VL2FlvaXpvnlZXkKY13dAEBjgvT+/waPoqFUEp69JDfxqsep8DlRI4q64hcfHeEM DsiMOpmpHbS+roPqbah7JrD0RNoQaiyXD0GrWSQgkQOzcWKQ0kCcRWlPQhyXO4Yon1i0 HKBAi9h/+CFHFc26Am2xgFIJXnG0bpi4xUNcWANZXKnpwcsQ8/WlA2IdZ9W1lNHxRkvJ 7Xug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713246730; x=1713851530; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=1Ajn42zvEompYWr+m7FqSPPVHNaM3XBm/1P37V2Kmbk=; b=EJqrsSZqpUJvCEqz3RAqGVYp0VZwWG4A/O1TMu+XBMinnPM+YfrzZajLSG0T8NofnA /ZVsgMkmmpSdNRsnbThK8lpY+GjMa3QEVu8x9hqtFMikahkXnTqIlHwPZxJRcVFZ5/OO GAQiDlLjztPvO8edBmXszTnmRchJGbcVssO7TGxeJPRksawyHPEVP9wEX6VAZHm9Sj3o N3bSTQF2qeFhcvzLJgIxJZPqjJKCPn/o9DeGFNpT2JH5sTDBnFCFyCaRrCpfA8VKoXGz uaxzq2KGk4IuLL+pBFty2YSxVtvEy6tTnLQvi0Tnfyll+N3HiQ9OKJbk0GAiaQee/um6 0Rqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713246730; x=1713851530; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=1Ajn42zvEompYWr+m7FqSPPVHNaM3XBm/1P37V2Kmbk=; b=TFQLO8XafpBCFws3kK5MTpmm+1zt0i6Os83EMwJWAbmOzizfrERB/TQIRF+YaS3xzi iGmLcUj91AUxK9m7rAye/5qcBtCPDLcwZsQQCCILY9RbHtARE4krhpTGSmat3zZGbUd0 0stGPie8ckWcat/sEaCFUsNEgSuvlSsqAmQyYbfuPwjsnwGRjSoGlr0/JbylEzfhDkGt OtgZHMRoiDDWh0ln6w6+CcujWx8kAB5kd9/V8V7/qVV0dQxNsh4ATI0NrsqYrAVot1uz EzluFdy6+oL8ATpX8lGHhhnUCk7sbhtV9tRtEql8WnBdYZipwy7axByhr8//Oa6/Fa90 ys3g== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCVSVksBMZZSDy2xj4091GobPaiG2PYZC0nfhrNzopfG9V2WCcFUFjL890y65DJWO5Afa8fof7SQIvgWR6N2D03adCgNjXo= X-Gm-Message-State: AOJu0YzMqHbpeMs8BoLcTGrnZ4QCiqpcvM1v6Knu+FVjjQSaZGZKxV++ U8FJuwMJs1FN5l0BlDtIC/CAQn7zGcpRrckxML/jFyfNu0uWHK3o X-Google-Smtp-Source: AGHT+IGQvs3RAxAyc/X9tNOjAsFk8cJiSbG5UhFFMqS/sFnEy+XrLvlA0jKEykjSif9QFKJEpPo9gQ== X-Received: by 2002:a05:6820:3090:b0:5aa:3ad4:b323 with SMTP id eu16-20020a056820309000b005aa3ad4b323mr12002327oob.6.1713246729801; Mon, 15 Apr 2024 22:52:09 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6820:16a0:b0:5a4:ee4f:96d0 with SMTP id bc32-20020a05682016a000b005a4ee4f96d0ls1688305oob.0.-pod-prod-09-us; Mon, 15 Apr 2024 22:52:09 -0700 (PDT) X-Received: by 2002:a05:6830:2646:b0:6eb:5652:e9ac with SMTP id f6-20020a056830264600b006eb5652e9acmr534646otu.5.1713246729420; Mon, 15 Apr 2024 22:52:09 -0700 (PDT) Received: by 2002:a05:6808:bc6:b0:3c7:2609:6bf4 with SMTP id 5614622812f47-3c726096daamsb6e; Mon, 15 Apr 2024 22:12:44 -0700 (PDT) X-Received: by 2002:a54:448a:0:b0:3c6:efd4:199c with SMTP id v10-20020a54448a000000b003c6efd4199cmr11498788oiv.59.1713244364004; Mon, 15 Apr 2024 22:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713244363; cv=none; d=google.com; s=arc-20160816; b=osvRuNnhJUxCAWMd/tEIUfrtZRbM3jWMfQvqzBRbzOeD120ldO4mtdfoQrTCRTva15 XT3JdoTEcbWNdROA6OaeI5a4S4SnDRDEaKXbZexJulYZ3fSa+vbnEJwKNWYAWA7hutE8 bqOD27u5+QBJ2fE9QspZUnSvA7sg7VnPEjq7IyOOnqTzaz8zgpFAMiuPAetW+JnrqHKN nFcng49nR8lBgOpvdLxta3SsWH799uBcbVzNCfqdnYvFySOQC4GjRKbDU6OiW8eRAg2S Vn4Q3qXVUO7q+6UcT7mn1lUFKkoxbIZgpyb84qahF0kzM/6fDRh/l8Uqla+8jmHz8gFO o0Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=0Gponuc1qcetSfFdW18kaLsA5IwY75XRLC8B11k1noE=; fh=dZbs7OdW2ieBo6+PoNybICM0JqsHP1X53GnCLtZWpyw=; b=s3L95eoXCK8q3uZ3U/OpUkMQZxu70PvGfluvb/qyzIRmdoQQHzvUs04y2Vy09mVhsh 8FM1qBlrazSf1oC30t2EjN+55dhbFCqmjQQTqJSR0DPKhi/86hmrQJxHzrXMIhpEpr6t bZNEGOcHv32NZ7sNbBGjiDSzhPwb2MMrhXRCbVFMoLEYcSSRjPPeVlAW5uw2B3z2awby LZ7mp5s28W1aiDRH/RrzkFd75K1yd25N0QngS84xPh5GYav1Hh6sthFO+qHdVq9fOxXV tW8zPVVFXWLFwzoscxzeVfWaTJDTWKNxv3DLBJcPFGhd9tJOy/6LeC2z+0xchAg6EDDe S++w==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jT5GMLuY; spf=pass (google.com: domain of developerdong@gmail.com designates 2001:4860:4864:20::34 as permitted sender) smtp.mailfrom=developerdong@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com. [2001:4860:4864:20::34]) by gmr-mx.google.com with ESMTPS id bd4-20020a056808220400b003c614d0a6b2si653326oib.1.2024.04.15.22.12.43 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Apr 2024 22:12:43 -0700 (PDT) Received-SPF: pass (google.com: domain of developerdong@gmail.com designates 2001:4860:4864:20::34 as permitted sender) client-ip=2001:4860:4864:20::34; Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-22fa18566adso2309034fac.0 for ; Mon, 15 Apr 2024 22:12:43 -0700 (PDT) X-Received: by 2002:a05:6870:f811:b0:229:f988:4305 with SMTP id fr17-20020a056870f81100b00229f9884305mr14629042oab.10.1713244363106; Mon, 15 Apr 2024 22:12:43 -0700 (PDT) Received: from md3knb8c.ad001.siemens.net (45.78.51.22.16clouds.com. [45.78.51.22]) by smtp.gmail.com with ESMTPSA id e18-20020a056a0000d200b006edadf8058asm8073878pfj.23.2024.04.15.22.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 22:12:42 -0700 (PDT) From: Zhibin Dong To: isar-users@googlegroups.com Cc: Zhibin Dong Subject: [PATCH] image: check if the file is core dump Date: Tue, 16 Apr 2024 13:12:22 +0800 Message-Id: <20240416051222.3344127-1-zhibin.dong@siemens.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Original-Sender: developerDong@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jT5GMLuY; spf=pass (google.com: domain of developerdong@gmail.com designates 2001:4860:4864:20::34 as permitted sender) smtp.mailfrom=developerdong@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_PASS 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= 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 The new code uses `file` to determine the type of files, which is more accurate. Signed-off-by: Zhibin Dong --- meta/classes/image.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 98741da0..10923947 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -444,7 +444,7 @@ EOSUDO # Sometimes qemu-user-static generates coredumps in chroot, move them # 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 {} \; | grep 'core file' | cut -d: -f1); do sudo mv "${f}" "${WORKDIR}/temp/" bbwarn "found core dump in rootfs, check it in ${WORKDIR}/temp/${f##*/}" done