Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 69401E0099B; Tue, 5 May 2015 01:50:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] X-Greylist: delayed 361 seconds by postgrey-1.32 at yocto-www; Tue, 05 May 2015 01:50:35 PDT Received: from root.phytec.de (mail.phytec.eu [217.6.246.34]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id E0561E00961 for ; Tue, 5 May 2015 01:50:35 -0700 (PDT) Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id B7D09A00105 for ; Tue, 5 May 2015 10:45:47 +0200 (CEST) Received: from augenblix.phytec.de ([172.16.0.56]) by idefix.phytec.de (IBM Domino Release 9.0.1FP2 HF590) with ESMTP id 2015050510443264-53880 ; Tue, 5 May 2015 10:44:32 +0200 From: Stefan Christ To: meta-freescale@yoctoproject.org Date: Tue, 5 May 2015 10:40:08 +0200 Message-Id: <1430815208-42300-1-git-send-email-s.christ@phytec.de> X-Mailer: git-send-email 1.9.1 X-MIMETrack: Itemize by SMTP Server on Idefix/Phytec(Release 9.0.1FP2 HF590|December 11, 2014) at 05.05.2015 10:44:32, Serialize by Router on Idefix/Phytec(Release 9.0.1FP2 HF590|December 11, 2014) at 05.05.2015 10:44:32, Serialize complete at 05.05.2015 10:44:32 Subject: [meta-fsl-arm][PATCH] classes: use dd's option fsync instead of sync X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 08:50:38 -0000 The shell command sync flushes all filesystem buffers in the system. On a bigger multiuser system there are multiple gigs of data sometimes in the buffer which then are written out to disk at once. It's better to only flush the specific file with dd's option 'fsync'. Signed-off-by: Stefan Christ --- Hi, I'm curious why the bbclass image_types_fsl.bbclass uses a double 'sync' to burn the sdcard image. Is there a specific reason, why a single sync is not sufficient to write the data to disk? Furthermore calling sync will flush all filesystem buffers on the system. It maybe a performance bottleneck because this may fill up the disk controller capacity quickly. Kind regards, Stefan --- classes/image_types_fsl.bbclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/image_types_fsl.bbclass b/classes/image_types_fsl.bbclass index 75eca59..1ebcb06 100644 --- a/classes/image_types_fsl.bbclass +++ b/classes/image_types_fsl.bbclass @@ -178,8 +178,8 @@ generate_imx_sdcard () { fi # Burn Partition - dd if=${WORKDIR}/boot.img of=${SDCARD} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync - dd if=${SDCARD_ROOTFS} of=${SDCARD} conv=notrunc seek=1 bs=$(expr ${BOOT_SPACE_ALIGNED} \* 1024 + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync + dd if=${WORKDIR}/boot.img of=${SDCARD} conv=notrunc,fsync seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) + dd if=${SDCARD_ROOTFS} of=${SDCARD} conv=notrunc,fsync seek=1 bs=$(expr ${BOOT_SPACE_ALIGNED} \* 1024 + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) } # @@ -293,7 +293,7 @@ generate_mxs_sdcard () { parted ${SDCARD} print - dd if=${SDCARD_ROOTFS} of=${SDCARD} conv=notrunc seek=1 bs=$(expr ${BOOT_SPACE_ALIGNED} \* 1024 + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync + dd if=${SDCARD_ROOTFS} of=${SDCARD} conv=notrunc,fsync seek=1 bs=$(expr ${BOOT_SPACE_ALIGNED} \* 1024 + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) } IMAGE_CMD_sdcard () { -- 1.9.1