From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 19 Jul 2024 07:33:35 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f185.google.com (mail-lj1-f185.google.com [209.85.208.185]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 46J5XYBL031821 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 19 Jul 2024 07:33:34 +0200 Received: by mail-lj1-f185.google.com with SMTP id 38308e7fff4ca-2ee848b2fedsf15800091fa.0 for ; Thu, 18 Jul 2024 22:33:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1721367209; cv=pass; d=google.com; s=arc-20160816; b=Dfzpp1qN1htg8oUXU9FDIl4bazlilIsXxMStt0uVvl72VZuoKWgvMq7V/oepgp3qeR 3ipEK5oBcFm4fjU7vf4FlbuvcdvVQoTRtiu+atHvi1F9Ywl1/Y6wYtGEETjG9VTF7Zls H+yPwp7Gxw8AihiDW2qw8gTVIwcFf7oY/mHKf0lPW1RhkIa0WNNyb0X1mn7uGA46pNoV oBduvzae8E/Ad7cMxWcDmcBR00icBK9D/4ur4RSZ51OWhE0tByoYUMgQylxmRezSD2Eg 8XsQAKcBUE15QdjoNv70unkivs3aFE0EBjxEM7mdAgKD3e4As4rxDVEMWkYBgniQ6vxy C/YQ== 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:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:sender:dkim-signature; bh=a4P6jxVmcYrXX28XhWkvqfIsigNpf79L9SAffbq1pEc=; fh=GkqcsPfVsB21nkGZhQkVJZc7SvAaBYSKMG3wi/Z5gWc=; b=deVKy8Qb7i9wAF7YMg6SVcY4G9vemD4nr+gAsTLLfuQpV0yFt5fR2kjOW81MdVgh+/ /HU/ALIUCvdaNFg2DQFefUxdi198OxQDef2ligsf9hjF2RwhPt1OYHSWXiGWpWoTgR2t HPejjFeX1ZXWz5/t2f5M6zGEQK/JbHPB7mFWYME0jmHr8d1uGsf9WYjs6H5nn1Hy/AmY p4QzsUCdnftPF10tGIh6j9QMgWiUPQir5SiGXvOlVg8yECTbltlMG3h6yEkOTs7fPFZZ UA5HC70PKYPqTik5pTCc9GuJOTlaPlhsVewZF5lYNirFjbltm7jw43AeWcxk3Wf2yGSr Uuvw==; darn=isar-build.org ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1721367209; x=1721972009; 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:user-agent:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id:sender :from:to:cc:subject:date:message-id:reply-to; bh=a4P6jxVmcYrXX28XhWkvqfIsigNpf79L9SAffbq1pEc=; b=OhWo5ZXqho4AXZgI6IYtIb8PNVn5hPAiM5z/O0g3Si+eh7dCllkgppaPq/JD6MSjWS e/zCKxpQC9uHIulz15a33QnyTt+c7HjaoYIq39AvcEvVCei3MSE/49cU27XPnDlzpf6/ /ZpZxCgp6Fdfr3BEAh51uWCmrc6tGHoH3/N8ahJmMxGCTx26VYjPsUns+nzPO1OjNqCo PvDN3P6f267rtmlLWNbN+dHLGncog4xIpDz9OCGmpytd0lmsqTDNnFTenP1aCRf2x1tA OAoufPwm59f2XP3g0/7OOB+OlsjcxMj9e3wsc5aL2zOgihD3YZIZE89S0Ufzv537vWXH Qc/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721367209; x=1721972009; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:x-beenthere:x-gm-message-state:sender :from:to:cc:subject:date:message-id:reply-to; bh=a4P6jxVmcYrXX28XhWkvqfIsigNpf79L9SAffbq1pEc=; b=hoj+62C9poBwPRh7yvssNKoaY8tgrV4U/1OhP95DRDXWqeBjBtbMyHLyv7pL4mmH61 D+1AgPvR0YAFHEb1j98w3dA47i25ohwbAdjbSu5wbWWkP/2r5gEgLd83IBZvmlXulI6Q NXerQh89rAU3sqVFInuDaqll3sFUJ0ZXoNjZtl5fJRjv3athJTmLTlctvATTw1Eauiqa d2LzNET7BSODA8KS4qYv6jb9HSwI7ZuMyaxmUmjK2zx3q9COLpgJJtUoRnqWdSFD+eDC 67GKhWONefFo9O9RDj1r5j9shyuY5dtyR3WP9RG8fPyW39Nb2I7NPx/kMIa8e6TRF8ff yPUw== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCV9hub+6/v8lz70SaZC8Vrbd+ZqEw1PKsymwraAD6JXqPAzujIl8nj+opjkFtayaFA9GKiA+y1w4DtBL5+QnwVUoD4= X-Gm-Message-State: AOJu0YyrvHovBStOSp376VlxCeWpuqd5nPXSP72CvwphkHJx1hHT6JGj t8LFjKjHunVBDWW+mWcxupgklC2ToYbyo1tZY5AltQvER97beX9z X-Google-Smtp-Source: AGHT+IGqNXjXMBUvWqw4cpfkRIP0xOkxmGlihT5XC0y6fjRdW6KEHUv86qz5CovcTVAV6cVWTqkS3g== X-Received: by 2002:a2e:860b:0:b0:2ed:59af:ecb7 with SMTP id 38308e7fff4ca-2ef05c6fcadmr27517301fa.15.1721367208187; Thu, 18 Jul 2024 22:33:28 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:a98a:0:b0:2ec:5d3e:a6d3 with SMTP id 38308e7fff4ca-2ef04dd7a50ls6632661fa.2.-pod-prod-07-eu; Thu, 18 Jul 2024 22:33:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUNEqHPXpJDLk2pAk69jilEaNZVmLyAToqsi11m5c80L2ysE/VIDAGuv5fexVA1byqWzQPkDa95vLTy5mVypiMu9ter+/43wmnZPvA= X-Received: by 2002:a05:6512:a83:b0:52e:f463:977d with SMTP id 2adb3069b0e04-52ef46398aemr737865e87.20.1721367205731; Thu, 18 Jul 2024 22:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721367205; cv=none; d=google.com; s=arc-20160816; b=d88w2ncG3VTk+/HVl5LAapblcBFcXRddsj31IGYoN0cqweKhWlcsHC1IJm4YeX/IPN JcaFvgTO0HJEbKfyvizpnHw2WNxRdOrdRTbGwF7c0ZxcgxCiUIkZz1zFEBr5AFLmJmle xkFQVVce3z7WplIQtxtfkZbRwqIwl493LhEx/HbjaivfOROCOtw/3pu8VOyvo98VwwnC sWuh5/xtaqLKTtF19vaV1d5DgZBIqfNDz2gOYENtPoqt6hS1ELqxTOUzKap2B92d1CTV UnCoC+Qo4+v+QXmOJnVvBlqsd8e6eer1wAaeWW5X1jwc0S2PqQqCFhNLSdxX31I1x7GX 2ILA== 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:cc:to:from:subject:message-id; bh=iy5haaQEgoQkCrpnD7js60A9EqmPlCrkwJBuDzZlwe0=; fh=1yfmkZma2ouV1RkJ/uIrSVOoA3W+nKErD914WrY7/kE=; b=hs42pcxJX0h5+VLX6jwBboPAs5PXOnoD8ipb41vcAiFosU2MXeTCFnzBcQ+eeofw7b 8aPEgy3wCyMQ6DC9p/Jy/x7nP1M9Abh9vgXP3eu5VA3UGh2pAFccXWCe3YRh37dU8dsf hqPfP1YrVnh8xLv7mqa6aRc2dA5lDKn2F4OzRbc9HyOImrVBcmwvG8ER/e86JPX/Flyg wqpMxX22/PjMWZx89Rnx1Tw6bml/SZ9qNy/OvoDUJg+cjWup+oaikTw6vf9HFgqFCqMW HbGVEMJTx85lnEgJUIdvr1AI1IFnhrv/cqsIIAZhqx56Sh4q6KxEQKnIEw3EXuzX2nST JseQ==; 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 Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 2adb3069b0e04-52ef55495bcsi14585e87.11.2024.07.18.22.33.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jul 2024 22:33:25 -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; 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 46J5XMn5031807 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Jul 2024 07:33:23 +0200 Message-ID: <8ee5a7a2efc86e7b733c52fb28ccc3586ebf0132.camel@ilbers.de> Subject: Re: [PATCH 10/17] meta-isar: deploy-image: Warn if overwriting a non-empty disk From: Uladzimir Bely To: Jan Kiszka , "Moessbauer, Felix (T CED OES-DE)" , "isar-users@googlegroups.com" Cc: "Gylstorff, Quirin (T CED OES-DE)" Date: Fri, 19 Jul 2024 08:33:22 +0300 In-Reply-To: References: <76e3eff93cb07536292fe39dd5291cb744f94e9c.1719927511.git.jan.kiszka@siemens.com> <18a05844c67acbd77941605336ce6e3a1a9f5326.camel@siemens.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3 (by Flathub.org) MIME-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED, RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,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-Original-Sender: ubely@ilbers.de X-Original-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 Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-TUID: OXXROk2hwF8U On Wed, 2024-07-03 at 17:55 +0200, 'Jan Kiszka' via isar-users wrote: > On 03.07.24 17:53, Moessbauer, Felix (T CED OES-DE) wrote: > > On Tue, 2024-07-02 at 15:38 +0200, 'Jan Kiszka' via isar-users > > wrote: > > > From: Jan Kiszka > > >=20 > > > Check of the first MB of the target device is only containing > > > zero > > -------^ typo: if > >=20 > > > and > > > warn otherwise before overwriting potentially valuable data. > > > Looking > > > at the first MB should cover enough partition table and file > > > system > > > structures to detect a valid disk. > > >=20 > > > Signed-off-by: Jan Kiszka > > > --- > > > =C2=A0.../deploy-image/files/deploy-image-wic.sh=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 | 6 > > > ++++++ > > > =C2=A01 file changed, 6 insertions(+) > > >=20 > > > diff --git a/meta-isar/recipes-installer/deploy- > > > image/files/deploy- > > > image-wic.sh b/meta-isar/recipes-installer/deploy- > > > image/files/deploy- > > > image-wic.sh > > > index 09d6cc11..81a006ce 100644 > > > --- a/meta-isar/recipes-installer/deploy-image/files/deploy- > > > image- > > > wic.sh > > > +++ b/meta-isar/recipes-installer/deploy-image/files/deploy- > > > image- > > > wic.sh > > > @@ -96,6 +96,12 @@ if ! dialog --yes-label Ok --no-label Cancel \ > > > =C2=A0=C2=A0=C2=A0=C2=A0 exit 0 > > > =C2=A0fi > > > =C2=A0 > > > +if ! cmp /dev/zero "$TARGET_DEVICE" -n 1M && \ > > > +=C2=A0=C2=A0 ! dialog --defaultno \ > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -= -yesno "WARNING: Target device is not empty! > > > Continue > >=20 > > Ok, but I'm sure this will almost always fire. > > Even fresh devices are not necessarily zeroed. >=20 > Flash drives are generally by design. But if you have a concrete > proposal how to improve the heuristics, I'm all ears. >=20 > Jan >=20 What about simply checking the device for partitions? `lsblk -n "$TARGET_DEVICE" -o TYPE | grep part >/dev/null` This should fit our needs. > --=20 > Siemens AG, Technology > Linux Expert Center >=20 --=20 Best regards, Uladzimir. --=20 You received this message because you are subscribed to the Google Groups "= isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to isar-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/= isar-users/8ee5a7a2efc86e7b733c52fb28ccc3586ebf0132.camel%40ilbers.de.