From owner-freebsd-embedded@freebsd.org Wed Sep 23 16:07:36 2015 Return-Path: Delivered-To: freebsd-embedded@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCDEDA07673 for ; Wed, 23 Sep 2015 16:07:36 +0000 (UTC) (envelope-from ardovm@yahoo.it) Received: from nm18-vm5.bullet.mail.ir2.yahoo.com (nm18-vm5.bullet.mail.ir2.yahoo.com [212.82.96.229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C16E1CE9 for ; Wed, 23 Sep 2015 16:07:35 +0000 (UTC) (envelope-from ardovm@yahoo.it) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.it; s=s2048; t=1443024275; bh=t/1umThCDssjhbFBB93d56itTftuZ4bs4gmZScu1Aqw=; h=Date:From:To:Subject:From:Subject; b=iwL+Rg2VdjJRg4Lfx63aRoRvnnFIHgHrVa1+xWUM15WJ1oCmP8cqoi5eI/XbR17S5udENIivMejOr9pcjMCBVGrF4g3Yhw9v6nXTn6QSzhocnmpcDQfbC3RFTXYZ6LCCW4aP7f/qSfW64KmUEHv2IkhhTgcsUeVNXmPCbJcS6PwU06rmpPUopXs7SD18dtFrq7ySg97hSKN3glsi8wVE6wOC2QAF/dJGKlrAV6Tyej7Ezq28MgmYvuJOA+Vx5y0gJAnEVeCfNNzTQAMsVs+0J6njC+3jZ4zXv/Z2f3sOJtNucjPxmj76p8TYrmjnGa5K8y4Jx7BZQ0+Wkygep6IKQg== Received: from [212.82.98.50] by nm18.bullet.mail.ir2.yahoo.com with NNFMP; 23 Sep 2015 16:04:35 -0000 Received: from [46.228.39.94] by tm3.bullet.mail.ir2.yahoo.com with NNFMP; 23 Sep 2015 16:04:35 -0000 Received: from [127.0.0.1] by smtp131.mail.ir2.yahoo.com with NNFMP; 23 Sep 2015 16:04:35 -0000 X-Yahoo-Newman-Id: 426169.12488.bm@smtp131.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Q64pWGgVM1nYiFSvoW7OBzqsoLPRJzbfzDNbrelAdyrk1us rwZIPS6QJZ.5fhRuwX8gCcvWOsn44h8CKMnWShv2GrVsfA9fC_taHN7V3IYw neSeSsx4touar0icXjAYs8Vpn9_VVoAnVxyd5FGyO_UsnNW.GqPlu8gIHPBY 8xqD2tTf9hXo9fKc6abrfxL7Qo5k1d3b3aqz7dlLua9pV3GDNUuMVLOFk9ai mmFe2TSp.H.027M1ZDlqKfLBkXFE2ge.pPXkd6f_jNKTro6RSu9MegRNgpT6 4B9wDTO2iwxMbWoXSQz7NMXY_5_S9_yjlDZkO5IU9O8XpT3sFDd4AFP59yfp dwXG8_wPCmlfI0GYEbgeK656GTIAiNcyOfHXUxDibtVpNf72grjuXZLQ2_nh kctUrVJoMdFD27H.jzH.QqsLoEgy.Wcc8.AglcjUbxITIeYaftVTAfMhG3f2 2P043mNm8NXl_Q3LFJLd6Ps7LacXPlCcXI9nNrM.mP8LAoUxQDOKT2yyA2RG 9syFZqg2z0GD8XngeTRz269XkC6GeehSfN2E- X-Yahoo-SMTP: WU.IBxeswBAAnLcBZV3tEZIK0A-- Received: by nuvolo.localdomain (Postfix, from userid 1001) id 0262114F254; Wed, 23 Sep 2015 18:04:31 +0200 (CEST) Date: Wed, 23 Sep 2015 18:04:31 +0200 From: Arrigo Marchiori To: FreeBSD Embedded list Subject: [NanoBSD] Double copy when using swap as backing? Message-ID: <20150923160431.GB37383@nuvolo> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2015 16:07:36 -0000 Hello list, I was looking at the nanobsd.sh script from 10-STABLE and I found something that I could not understand. In function create_diskimage(), lines 639-650 result in two invocations of dd: 1- if NANO_IMAGE_MBRONLY is `yes': dd if=/dev/${MD} of=${NANO_DISKIMGDIR}/_.disk.mbr bs=512 count=1 dd conv=sparse if=/dev/${MD} of=${IMG} bs=64k 2- otherwise: dd if=/dev/${MD} of=${IMG} bs=64k dd conv=sparse if=/dev/${MD} of=${IMG} bs=64k Case 2 looks a duplicate to me; the first dd could be avoided. Or did I miss anything? I don't use swap-backed md's therefore I cannot experiment with that part. I just wonder if it may help someone by speeding their builds up. Best regards, -- rigo http://rigo.altervista.org