From patchwork Thu Jul 18 18:09:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: 'Darko Komljenovic' via swupdate X-Patchwork-Id: 1133804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::33b; helo=mail-ot1-x33b.google.com; envelope-from=swupdate+bncbaabb4hlyluqkgqeotyt24i@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=googlegroups.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="WCpBJW6f"; dkim-atps=neutral Received: from mail-ot1-x33b.google.com (mail-ot1-x33b.google.com [IPv6:2607:f8b0:4864:20::33b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45qMc43dB0z9s3l for ; Fri, 19 Jul 2019 04:09:55 +1000 (AEST) Received: by mail-ot1-x33b.google.com with SMTP id b4sf15702131otf.15 for ; Thu, 18 Jul 2019 11:09:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563473392; cv=pass; d=google.com; s=arc-20160816; b=uWCV7FJkNSvznWEzyCFMzCoQLZ3toUiOgCDnh2aLhsbIpmN7tKrCHOnVD4Mhkzt/BH 7KAMua4+oMaak9TJANoWf/DW5k6jHSpwkgD63dMsS12m9y+LzKaR6l7kKme7IFIQu1vR RqEUf5PFw+z0BBGEsuCaQiZwwT4D6STGwA9Ukesx8PflY6JklRYovPMsrcmlmN+YpiG/ 5v8DJGbF5a0tHpETI27fuSijiU83y0ewRXKaDdM2XzPXn8CWDV57puAGIDqVEatlARHx KNHx3neeVO1/sS0Gy++908dHFOOQBbMGwQi8I3X1OXJmdaQhFlQkOFzaCchBugkKE1Jw ti3w== 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:reply-to:mime-version :content-transfer-encoding:content-language:accept-language :message-id:date:thread-index:thread-topic:subject:to:from :dkim-signature; bh=sjOC2rWmuCG9/kavhV2EdN6f3otbRpCQ8iz7+e24mK4=; b=o5BU6tnpyN5XKA1Vgep8HBaUEnXs19qSC6awhMaYigE7Y4JEx4B34KA5A3biOecpjG 2sp6juyg6TuXARuztpjeOuLVJTkJF4J8ERlC+gZoEcAiBxcbbitmiQBBy9UCs43fKst1 b/b7ATStTnvOYVBHsJRKqshyyHT91xnaxnkuWE8UwCaw9ou6H0DGwoA0Z0PxA2LQeZnu 9Wk3WyF4P7EfeOLL1oMMjN0f4KHxuJoF0NQydUa6V1yez4avC/sUADHKj9SycQKFy1MH iy1MIMnU/7iayGEkBi7tfPxF14pH7/e+qW6NaLwKU64Dx0wdab9YT2Ene01kdgt3h+FI Sl+w== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@woodward.com header.s=20190114Woodward header.b=RNBS778U; spf=pass (google.com: domain of lukasz.zemla@woodward.com designates 204.27.169.35 as permitted sender) smtp.mailfrom=Lukasz.Zemla@woodward.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=woodward.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=from:to:subject:thread-topic:thread-index:date:message-id :accept-language:content-language:content-transfer-encoding :mime-version:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=sjOC2rWmuCG9/kavhV2EdN6f3otbRpCQ8iz7+e24mK4=; b=WCpBJW6fShsiNU1Defd5jSNzFQsePUVfBVf/Tu7yNqpUtk4+PqDhWhrUL3Mjkx8Ogm 0jF8p70nx2v8TQmvzTOc7fQRexQ4HPaEW/VrKzAuHFcGkKPhdpmpHIFMicKiunE68D6w fVO8Rq/T4e7z+pnP/0Ipw5y4ChVKtH6zIgM1LEfxtmOak3TxSsK6vz6F2/uZQXRQOTWi U1SnUqFFST/60vR0T5ZH998HO26xlqI4D2CbSVBtWQY5DdzfuVEhlItpkA5CphVqF5o3 r6K45K9VQxK+rE6b7pV0Sll3QIH5ycz7ZwIBVk02YPDHwFG1hFEQGzdIEZa8sm083guO J2hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:thread-topic:thread-index:date :message-id:accept-language:content-language :content-transfer-encoding:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=sjOC2rWmuCG9/kavhV2EdN6f3otbRpCQ8iz7+e24mK4=; b=U36YORZ4It6LsxiQlhcwhZET1FpFRHPGGA2qgS8NmE5o9Sk3n8srE1AIG3jItSjkwx bq5Sj4HQStcgdUswY3FeO4TrOfbXj/Lc+1aEDqskVxYlvDWD1TFyX8b428DyFsvsvRkl v5LNcFFmgzONIegDB+EtgwrPmRCtS0LHxpDQbIiD2afqAvAdSWoXNsx7Cc7LL+klSOde SCN3K3HtV+biEYoHuGMqYuxAyXjrIXRatGAMGNH79L9QIGVwdWbgwDXMiMhuqGKYy0oE e4ZrfRWt1pK8KxTqHq7Dyi9Mc4RDfL/9+iGIZBljaSNYe6Rc+zuZcR1gqvDWoQKb42Md KQmg== X-Gm-Message-State: APjAAAUwbwbGBTn4KPHk9wioFoHYqIIXlV3vjeu5lSGCG2jRiCtfZYME T3zS/7KyyK66TrxLQEwXbW8= X-Google-Smtp-Source: APXvYqwZAVKoGXyP/Ix3KBMawYzMU2BVtMWA4oef3UotAwb7Q0yEy1UJH6NTG1ynEJTVXgm0YJXQIQ== X-Received: by 2002:a05:6830:12c7:: with SMTP id a7mr34375584otq.284.1563473392533; Thu, 18 Jul 2019 11:09:52 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a9d:6d09:: with SMTP id o9ls5473560otp.7.gmail; Thu, 18 Jul 2019 11:09:52 -0700 (PDT) X-Received: by 2002:a9d:6644:: with SMTP id q4mr27350235otm.308.1563473392065; Thu, 18 Jul 2019 11:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563473392; cv=none; d=google.com; s=arc-20160816; b=KWp1YLNe+ZbLVcpKYOKCNfapprzRx1ZadrdBh1m08PMzxw/6BzrOZOuRZPpKFkPJZy 5A5NdIP6WZJ9Ag2Ajt/vpBOwQhrxiH5HwyJvJP8ci6wCV1Ri8m6g8PQW+d4bGovP1+AC JGKOnhojgMmnvfGBYghzyV7mMPYMF5T8visNUtMX83iNkvgQczOB0JE+jt2ObIR3Mg9R IFrc9hBMFITVtPKriC4k9jseLMfT9a/xWjY3iXpu4OtUp+xAqoEaMfPP9EAhhAI/gCug zvve9VG8e+rtvPcYBBcob0Lu8C7noUY2FGgU2i5taZOhaY7it24dI5Zj9/biLHSTQYjG 0jyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-transfer-encoding:content-language :accept-language:message-id:date:thread-index:thread-topic:subject :to:from:dkim-signature; bh=Xndk3k1Jux64FXIOn16myGIAPLN+HEPzMjRk/S4Gk0M=; b=EItoOSM2nHzAKgDLACkTWQ1WkWVthHIcaT/FENYBq3faMd1VmoOJgtg3DesKDBxGjR Fzi6gqDZ0ZiQm0mhHAyDd0CD7kfbwZ78WAdPTuN+37LoK4/Cxu6WiszfwKguv6Y5nFWH kkOjYSAcv3LV7c8r8VgIQmnT1MpscmNY/MR8MUItJdfNfiU3xasOtJA2r692kHTO1DJO JB3Mnrc32l2qlu/42YZt89L8bmxjQDek6kVMkNNA/F5eheCLjedbuY40m7xP53AQaUA3 EtdQavfJuZ+izPGrfSGdf0bQLqYT5mHk+D33PKDIigg/423yPTBY/hcu9jsV8Fg149UJ KnYA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@woodward.com header.s=20190114Woodward header.b=RNBS778U; spf=pass (google.com: domain of lukasz.zemla@woodward.com designates 204.27.169.35 as permitted sender) smtp.mailfrom=Lukasz.Zemla@woodward.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=woodward.com Received: from Mail4.woodward.com (mail4.woodward.com. [204.27.169.35]) by gmr-mx.google.com with ESMTPS id d8si1121975oth.2.2019.07.18.11.09.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jul 2019 11:09:51 -0700 (PDT) Received-SPF: pass (google.com: domain of lukasz.zemla@woodward.com designates 204.27.169.35 as permitted sender) client-ip=204.27.169.35; Received: from pps.filterd (COIL-PMSGA1.woodward.com [127.0.0.1]) by COIL-PMSGA1.woodward.com (8.16.0.27/8.16.0.27) with SMTP id x6II2PmP014945 for ; Thu, 18 Jul 2019 13:09:51 -0500 Received: from rkfdhc1.woodward.com ([10.1.100.158]) by COIL-PMSGA1.woodward.com with ESMTP id 2tsk2sms9y-1 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT) for ; Thu, 18 Jul 2019 13:09:51 -0500 Received: from Kemp-ExMb1.woodward.com (10.25.100.72) by RKFDHC1.woodward.com (10.1.100.158) with Microsoft SMTP Server (TLS) id 8.3.485.1; Thu, 18 Jul 2019 13:09:50 -0500 Received: from Kemp-ExMb1.woodward.com (10.25.100.72) by Kemp-ExMb1.woodward.com (10.25.100.72) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 18 Jul 2019 20:09:43 +0200 Received: from Kemp-ExMb1.woodward.com ([10.25.100.72]) by Kemp-ExMb1.woodward.com ([10.25.100.72]) with mapi id 15.00.1395.000; Thu, 18 Jul 2019 20:09:43 +0200 X-Patchwork-Original-From: "'Lukasz Zemla' via swupdate" From: 'Darko Komljenovic' via swupdate To: "swupdate@googlegroups.com" Subject: [swupdate] [PATCH] Call scan_mtd_devices() devices after preinstall scripts are executed Thread-Topic: [PATCH] Call scan_mtd_devices() devices after preinstall scripts are executed Thread-Index: AdU9k+Hr/HVH6klyS9e0i/53Gn8Iwg== Date: Thu, 18 Jul 2019 18:09:43 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.104.108.101] MIME-Version: 1.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=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=563 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907180187 X-Original-Sender: lukasz.zemla@woodward.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@woodward.com header.s=20190114Woodward header.b=RNBS778U; spf=pass (google.com: domain of lukasz.zemla@woodward.com designates 204.27.169.35 as permitted sender) smtp.mailfrom=Lukasz.Zemla@woodward.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=woodward.com X-Original-From: Lukasz Zemla Reply-To: Lukasz Zemla Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Hello, Per https:// sbabic.github.io/swupdate/handlers.html#handler-for-ubi-volumes: > If the storage is empty, it is required to setup the layout and create the volumes. > This can be easy done with a preinstall script. Building with meta-SWUpdate, > the original mtd-utils are available and can be called by a Lua script. In current implementation it will not work because scan_mtd_devices() is called before calling preinstall scripts. Proposed patch below. Best regards, Lukasz Zemla Call scan_mtd_devices() devices after preinstall scripts are executed This will make possibility to create UBI volumes on blank flash by preinstall script - delayed scan_mtd_devices() will be able to notice them. Signed-off-by: Lukasz Zemla *** The information in this email is confidential and intended solely for the individual or entity to whom it is addressed.  If you have received this email in error please notify the sender by return e-mail, delete this email, and refrain from any disclosure or action based on the information. *** diff --git a/core/swupdate.c b/core/swupdate.c index 58218d0..10f6c44 100644 --- a/core/swupdate.c +++ b/core/swupdate.c @@ -362,10 +362,6 @@ static int install_from_file(char *fname, int check) exit(EXIT_SUCCESS); } -#ifdef CONFIG_MTD - mtd_cleanup(); - scan_mtd_devices(); -#endif /* * Set "recovery_status" as begin of the transaction" */ diff --git a/corelib/installer.c b/corelib/installer.c index ff6cb18..78d7816 100644 --- a/corelib/installer.c +++ b/corelib/installer.c @@ -281,6 +281,11 @@ int install_images(struct swupdate_cfg *sw, int fdsw, int fromfile) } } +#ifdef CONFIG_MTD + mtd_cleanup(); + scan_mtd_devices(); +#endif + LIST_FOREACH(img, &sw->images, next) { /*