From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7358338671440822272 X-Received: by 2002:a17:902:db0e:b0:1e0:b62a:c0a2 with SMTP id m14-20020a170902db0e00b001e0b62ac0a2mr15979189plx.51.1713336445235; Tue, 16 Apr 2024 23:47:25 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:902:e84e:b0:1e5:10f7:ff1e with SMTP id t14-20020a170902e84e00b001e510f7ff1els3206337plg.0.-pod-prod-01-us; Tue, 16 Apr 2024 23:47:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDun48OtIIk5+bQC2P3i0xu32hSysHE6KgPJjoRGj5kA0GFl5VvqxXk4vZjjbK7mNcQlIO X-Received: by 2002:a17:902:ce0e:b0:1e4:cb0e:2988 with SMTP id k14-20020a170902ce0e00b001e4cb0e2988mr18629996plg.2.1713336443605; Tue, 16 Apr 2024 23:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713336443; cv=none; d=google.com; s=arc-20160816; b=XxW1P6uqu1oh341b5UlefxNcgCYpkSwN+Z6kFiZ9k6a4z/9w2JBX4lUQKaBGzWVXzq p3A2TdhhWCGYhBvErUAHdNMXkvUtRTDF6rV9iTMUgj3B6gNsjTibeu7jOsdi/QW+TnMS uY5PZohQUbZwJZQpglZ7hds2Tas1ZpYjUADXo0N+5pmEJaqULy8IiZaLsCSntaXZQXv8 mlgo24iUpyRelPVZQuRwj+7tUG3fipzKkd0zMfaUg/CDz4086rbKzOAFlPnqO2g27mMe Il/4eCwbGkL5YRXmt1lqOI9z/C5yDXMfOIDAMvol2nvJj4/c3zb7hesDgEvCGU8h3TrB PfTA== 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:date:subject:cc:to:from:dkim-signature; bh=srWZbDE5T2BoGFdeBQf+PyUU4w0ZaIs6i4NJhOO5yOU=; fh=dZbs7OdW2ieBo6+PoNybICM0JqsHP1X53GnCLtZWpyw=; b=d1aegAJzPVqCfVC729duIw9evVybg58JBx456mjFx7NLGRQ1kXO44W5QK6nDck9swK VCw+NGBk3bSC7w3dixk+W1nypoaop2J7Ap1OPwLoaYatH+GnLY/NzMkm20D7Z1onq5Dq 72oyH+H/Bzs5DiEvo5g+8RFpH7vzDYyakXlIqA5HpVL19zI3bv+omN5zH2Nj+v0czmmC g0HdtepkSUYnQnUZ50Bjam1v1H8GmQP+iFRM7D9TERUK90Afcctofzq8ha7SfXonFqWj O3wLT4tB55f0jwWM2vn6M0WgVI9bK+/7QQEGEWaTjrvIztq2XMqSswyVqLRogH3iyYcQ W6DQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PG6vDCR+; spf=pass (google.com: domain of developerdong@gmail.com designates 2607:f8b0:4864:20::430 as permitted sender) smtp.mailfrom=developerdong@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com. [2607:f8b0:4864:20::430]) by gmr-mx.google.com with ESMTPS id l18-20020a170903005200b001e5083fbf11si808957pla.0.2024.04.16.23.47.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Apr 2024 23:47:23 -0700 (PDT) Received-SPF: pass (google.com: domain of developerdong@gmail.com designates 2607:f8b0:4864:20::430 as permitted sender) client-ip=2607:f8b0:4864:20::430; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PG6vDCR+; spf=pass (google.com: domain of developerdong@gmail.com designates 2607:f8b0:4864:20::430 as permitted sender) smtp.mailfrom=developerdong@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6eff9dc1821so2630333b3a.3 for ; Tue, 16 Apr 2024 23:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713336442; x=1713941242; dara=google.com; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=srWZbDE5T2BoGFdeBQf+PyUU4w0ZaIs6i4NJhOO5yOU=; b=PG6vDCR+Elea/swiYKuHQHku/OLLadC9i8GYPzEbYnotyzS9QyWm9H1jFAyGz4mYmi sxssGLjVRB7eR6c6A1/OGbUXcjHbb3/kAS0J6Olq1JCo6Z0kei9FDr8DNvHR9IznuYPf TKA6hfcabsrO4x63ZRKgIQumtDBTPhI2HfYPRqCu1Io02Z5BtgrB1QEom3XNb/DlZExp J67YdQ9o5e6d5+axsiO6rTfXixd5XcO6/uXe25LpcxlEp6FWaVP440RDxpkEYGk07OiU I2mg8gVWXBWNbXMXwADn6V0D725h4Xpzkl1OqmSfqB50ab8N6/eJbaLElM+Tpn7jT2x4 jocQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713336442; x=1713941242; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=srWZbDE5T2BoGFdeBQf+PyUU4w0ZaIs6i4NJhOO5yOU=; b=O5c9dwamgAaAy3WRwBrzQv60uhliR9gCuiEn1gFfst750DXU8pALhHydbjU+ezk4Qk liyWIL5o9LK30w6AIRee1YLkc24bElWA9fsB7KCJml9p94FhnejXPRJO0l4H/6bO00/I lTwb334zbk8jMYMjc+uiOKsWc1aVbhetqmeUaGGzuWBpTFecwtWmjvMQKPGdwZQxJpHH BxOTrX+NwwIUrpyX+Hq6+/sGcoVIljE4WDE5n66teu+J0VRBtMdBXShDer+JbbD4lU+K xNmJAE1xsqTjL7KNGS9ePQs9K4OJtTpyQobsWjcCIn3qopRo3cfENYjM6tdLZNAeJqFV +cjg== X-Gm-Message-State: AOJu0Yzp6ucNwM8aB+8VjvyPxKfEeOBoJdJM820yZrPWdOT2RG4fcCa3 HcN6eS1z85ad9hzB/x/CCM9G9JkPL3XCUVF7dpxfRG/a4VggoX2D/PN6P8KUxYnefg== X-Received: by 2002:a05:6a00:10c2:b0:6ed:41f3:cd06 with SMTP id d2-20020a056a0010c200b006ed41f3cd06mr16312351pfu.7.1713336442193; Tue, 16 Apr 2024 23:47:22 -0700 (PDT) Return-Path: Received: from md3knb8c.ad001.siemens.net (45.78.51.22.16clouds.com. [45.78.51.22]) by smtp.gmail.com with ESMTPSA id 9-20020a631149000000b005dbed0ffb10sm9971283pgr.83.2024.04.16.23.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 23:47:21 -0700 (PDT) From: Zhibin Dong X-Google-Original-From: Zhibin Dong To: isar-users@googlegroups.com Cc: Zhibin Dong Subject: [PATCH] image: check if the file is core dump Date: Wed, 17 Apr 2024 14:46:00 +0800 Message-Id: <20240417064600.12133-1-zhibin.dong@siemens.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240416051222.3344127-1-zhibin.dong@siemens.com> References: <20240416051222.3344127-1-zhibin.dong@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: lfz7o2b9ebg7 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..2b0995d2 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 --mime-type {} \; | grep 'application/x-coredump' | cut -d: -f1); do sudo mv "${f}" "${WORKDIR}/temp/" bbwarn "found core dump in rootfs, check it in ${WORKDIR}/temp/${f##*/}" done -- 2.39.2