[PATCH] olpc.fth - grow the root filesystem partition on boot

James Cameron quozl at laptop.org
Fri Mar 16 19:58:05 EDT 2012

On Fri, Mar 16, 2012 at 11:58:51AM -0600, Daniel Drake wrote:
> I'll try to take on this project this release cycle.
> Posted some thoughts at http://dev.laptop.org/ticket/10040


Consensus is to implement a partition resize in OpenFirmware as the last
step of ''fs-update''.  This doesn't preclude the initramfs doing it,
and the initramfs will do the filesystem resize.

In OpenFirmware, we might either:

 * do the resize only if the .zd file requests it, (a new ''resize:''
   line after ''zblocks-end:''), or

 * do the resize regardless, thus affecting previous builds once a
   firmware update occurs.

The first option avoids immediate impact to factory scripts which do an
''fs-verify'' after ''fs-update''.

Once factory is given a build that includes ''resize:'', the factory
scripts will require changing from

fs-update ...
fs-verify ...


fs-update-no-resize ...
fs-verify ...

Not changing the scripts will cause an fs-verify failure for the first
block of the storage.

I expect builds to begin doing this in the 12.1.0 series, leaving the
11.3.1 series unchanged, but we don't easily separate OpenFirmware in
that way.

Adding resize: to the end of an .zd file does not cause any error on the
current version of OpenFirmware on XO-1.75, so it can be added now:

>From 7ed7ac8452da32bce60208558d0e729a4bfe35b8 Mon Sep 17 00:00:00 2001
From: James Cameron <quozl at laptop.org>
Date: Sat, 17 Mar 2012 10:56:30 +1100
Subject: [PATCH] add resize

 bin/zhashfs.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/zhashfs.c b/bin/zhashfs.c
index 12a0ffb..0d765ea 100644
--- a/bin/zhashfs.c
+++ b/bin/zhashfs.c
@@ -221,8 +221,8 @@ int main(int argc, char **argv)
     LTC_ARGCHK(readlen == zblocksize);
     write_block(0, buf);
-    fprintf(outfile, "zblocks-end:\n");
-    fprintf(zfile,   "zblocks-end:\n");
+    fprintf(outfile, "zblocks-end:\nresize:\n");
+    fprintf(zfile,   "zblocks-end:\nresize:\n");

James Cameron

More information about the Devel mailing list