From owner-freebsd-embedded@freebsd.org Wed Sep 23 16:59:21 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 C7FC6A07267 for ; Wed, 23 Sep 2015 16:59:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-f49.google.com (mail-qg0-f49.google.com [209.85.192.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CCAC1EBC for ; Wed, 23 Sep 2015 16:59:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qgez77 with SMTP id z77so24422589qge.1 for ; Wed, 23 Sep 2015 09:59:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=yojTaTzIrmFs4D5L7cdXsi+fM2calmwg6HkbaxPH22w=; b=Un3uhlcRJLRl70WHYuqq5ikFWkvNhiC7t9jhN0RxVNc/Tr839atrcF6kW/3I+CqGMT +Vp8NMpUYJd7L0yzXB840jOJIjRUDrnoBp7eHE0pjlK4QgIJv/YyAjmOXKJoKxdQknnt +SqeLI/+405odl7cRitYwhSKNFlztGk2cSI4kbSYtioHTpk43ItEv5iVEcYeKHe7sIFL 2BT7BvEHQqbSoHHmcReyOOPLjAQihWWU/qDwgHkb1yA/k3I29wlIh1hDaWhrsEbhqa5J mXR3GQt1A2IQjgKbEiSuOxrm61PBoHVtIi/I/LUW3PJP1eRqjSZtatVA87W/X1Cu53qA fTPA== X-Gm-Message-State: ALoCoQk9uY08B37MR7bv6h9//EbvfDykRSsV2nPgnXnwFTufmJ5A3UX7I8vK9wdSV92eJfFPPgAP MIME-Version: 1.0 X-Received: by 10.140.234.78 with SMTP id f75mr40923055qhc.20.1443027184096; Wed, 23 Sep 2015 09:53:04 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.140.80.167 with HTTP; Wed, 23 Sep 2015 09:53:04 -0700 (PDT) X-Originating-IP: [40.140.178.190] In-Reply-To: <20150923160431.GB37383@nuvolo> References: <20150923160431.GB37383@nuvolo> Date: Wed, 23 Sep 2015 09:53:04 -0700 X-Google-Sender-Auth: 5erQgrJXzoXD5rOwxLepliCY9Lo Message-ID: Subject: Re: [NanoBSD] Double copy when using swap as backing? From: Warner Losh To: Arrigo Marchiori Cc: FreeBSD Embedded list Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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:59:21 -0000 On Wed, Sep 23, 2015 at 9:04 AM, Arrigo Marchiori wrote: > 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 think you are right. I have submitted patches in my mailbox that fix this. I've been bad about integrating them because I've been thinking of a big overhaul of nanobsd to push some of its functionality down into the rest of FreeBSD for things like crochet and raspbsd to use to create images rather than forcing them to reinvent the wheel... Warner > 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 > _______________________________________________ > freebsd-embedded@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-embedded > To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.org > " >