From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] fs/btrfs: Introducing btrfs rootfs support.
Date: Sat, 25 Aug 2018 14:39:39 +0200 [thread overview]
Message-ID: <20180825143939.60ec9d77@windsurf> (raw)
In-Reply-To: <20180823220156.4173-1-robert.heywood@codethink.co.uk>
Hello Robert,
On Thu, 23 Aug 2018 23:01:56 +0100, Robert J. Heywood wrote:
> This patch makes it possible to format the rootfs using btrfs.
> It introduces the option; BR2_TARGET_ROOTFS_BTRFS
>
> When selected, the user is able to specify the filesystem size,
> label, options, and node and sector sizes.
> The new files are based on fs/ext2/{Config.in,ext2.mk}
>
> Signed-off-by: Robert J. Heywood <robert.heywood@codethink.co.uk>
Thanks, I've applied, but I did a few changes. First, I fixed the
issues pointed by Yann E. Morin in the Config.in file. But more
importantly, see below.
> +define ROOTFS_BTRFS_CMD
> + rm -f $@
This is not needed, once you add the -f option to mkfs.btrfs, so I've
done that.
> + truncate -s $(BTRFS_SIZE) $@
mkfs.btrfs has the --byte-count option that allows to set the size of
the filesystem image to be generated, so I've used that instead and
dropped the truncate -s.
> + $(HOST_DIR)/bin/mkfs.btrfs $(BTRFS_OPTS) $@ \
> + || { ret=$$?; \
> + echo "*** Maybe you need to increase the filesystem size (BR2_TARGET_ROOTFS_BTRFS_SIZE)" 1>&2; \
> + exit $$ret; \
This warning was not really useful: mkfs.btrfs automatically extends
the image size as needed. So if you specify 100m, but you need 150m,
mkfs.btrfs will anyway produce a 150m filesystem image, without bailing
out. So an error of mkfs.brtfs cannot be explained by the
BR2_TARGET_ROOTFS_BTRFS_SIZE value being too small. Therefore, I've
dropped this error handling entirely.
Applied to next with those changes:
https://git.buildroot.org/buildroot/commit/?h=next&id=0aade4df1f80d7bff58da2b5d3dfd9d8d6ec4b7d
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2018-08-25 12:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-23 22:01 [Buildroot] [PATCH 2/2] fs/btrfs: Introducing btrfs rootfs support Robert J. Heywood
2018-08-24 21:53 ` Yann E. MORIN
2018-08-25 12:39 ` Thomas Petazzoni [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-08-23 20:26 Robert J. Heywood
2018-08-23 21:27 ` Yann E. MORIN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180825143939.60ec9d77@windsurf \
--to=thomas.petazzoni@bootlin.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox