[NanoBSD] Double copy when using swap as backing?
Warner Losh
imp at bsdimp.com
Wed Sep 23 16:59:21 UTC 2015
On Wed, Sep 23, 2015 at 9:04 AM, Arrigo Marchiori <ardovm at 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 at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-embedded
> To unsubscribe, send any mail to "freebsd-embedded-unsubscribe at freebsd.org
> "
>
More information about the freebsd-embedded
mailing list