Installing single file via signed OFW script

James Cameron quozl at laptop.org
Wed Aug 25 19:38:56 EDT 2010


On Wed, Aug 25, 2010 at 09:53:26AM -0400, Paul Fox wrote:
> martin wrote:
> > [ background: working with a local team in a process that needs to
> > be quick. Booting linux would take way too long and throw our
> > logistics out of whack ]
> > 
> > Is there a straightforward way to have a signed forth script (local
> > team has its own keys) that creates/installs a minimal file to a
> > known location?
> > 
> > We just need to install a config file under /etc ...
> 
> as far as i know, writing to the ext3 root partition from OFW is
> officially unsupported.  the boot partition is ext2 precisely
> because ext3 can't be written reliably from OFW.

Yes, because an ext3 filesystem may have an unresolved journal.
Resolving this requires an ext3 implementation, which OpenFirmware does
not have ... the kernel is the one we use.  If the filesystem was
unmounted cleanly, however, using it as ext2 from OpenFirmware seems to
be doable.  I'm not aware of any side effects.

In the field, this would mean that some attempts would fail and the
laptop would need to be booted and cleanly shutdown before the copy
would work.  If you're going to have to do that to some laptops it kinda
defeats the purpose.

> if you can put the file in the boot partition, then there are copy
> commands that let you creat files on "int:", i believe.  i don't
> have them at my fingertips.

Tested just now:

ok copy u:\ethni.pdf int:2,\versions\running\etc\test.pdf

Booted Tiny Core to look at the partition.  It mounted read-only fine.
The file was present.

Booted the laptop normally.  The file was not present in /etc.  It was in
/versions/pristine/852/etc/test.pdf ... this means that your script must
be build specific or complex enough to figure out what the current build
is.


Repeat test:

ok copy u:\ethni.pdf int:2,\versions\run\852\etc\ethni.pdf

Booted verbose.  Started Browse.  Typed URL /etc/ethni.pdf and the file
was displayed.

I don't know how to ensure an exec bit though.  Hopefully you won't need
it for /etc.


Repeat test with a laptop that had been uncleanly shutdown; removed
battery and DC input while at activity ring:

ok copy u:\ethni.pdf int:2,\versions\run\852\etc\test.pdf
ext3 journal needs recovery
Not writing to the ext2 filesystem because of unsupported extensions
Flushbuf error
ok 

-- 
James Cameron
http://quozl.linux.org.au/



More information about the Devel mailing list