Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Sep 2015 09:53:04 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Arrigo Marchiori <ardovm@yahoo.it>
Cc:        FreeBSD Embedded list <freebsd-embedded@freebsd.org>
Subject:   Re: [NanoBSD] Double copy when using swap as backing?
Message-ID:  <CANCZdfpuE9j_d-f-Acbep8q4OJzU4K_8oN=a2jRGdtYLbgF-wg@mail.gmail.com>
In-Reply-To: <20150923160431.GB37383@nuvolo>
References:  <20150923160431.GB37383@nuvolo>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 23, 2015 at 9:04 AM, Arrigo Marchiori <ardovm@yahoo.it> 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
> "
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpuE9j_d-f-Acbep8q4OJzU4K_8oN=a2jRGdtYLbgF-wg>