[Fedora-livecd-list] [PATCH] persistence - VERY ROUGH first pass

Douglas McClendon dmc.fedora at filteredperception.org
Tue Jul 24 08:43:57 UTC 2007


Attached is a _first pass_ patch that enables LiveOS persistence for 
livecd-tools.  Before you read this and get _too_ excited, note that I'm really 
only posting this because of the f8t1 devel freeze.  If I get any encouragement, 
I am very willing to work my ass off in the next few days to get this cleaned up 
into respectable shape for a potential f8t1 feature.  But I also realize it is 
probably just too late for that. (OTOH the code is already structured so that it 
is obvious that in the absence of a persistence bootarg, the code has no impact)

The Principals Of OPeration are-

- unless a boot argument of "persistence[=[devspec][:pathspec]]" is seen, 
nothing will behave differently, except for the existence of a new tool 
/usr/sbin/livetool

- after booting normally (no persistence bootarg), if you invoke

"/usr/sbin/livetool persistence initialize [devspec][:pathspec]"

then a persistence file will be initialized.  By tomorrow I should have an 
option that allows the existing in-ram-overlay to be live migrated to the new 
file (thus freeing the ram by the time the command completes).  I have done this 
manually.  Currently this tool is not implemented.  Creating a sparse or zeros 
file of any size (say 512M) should work fine.

e.g. dd if=/dev/zero of=/mnt/stick/LiveOS/Persistence-mylabel \
bs=1k count=1 seek=$(( 1024 * 512)

- to use the persistence file on a subsequent boot, add the bootarg 
"persistence" which is equivalent to "persistence=auto"

- devspec can be in the following forms (should be obvious what they mean),
and defaults to auto, which means to search all mountable partitions.  (the 
search process mounts readonly (with paranoid blockdev --setro as well)

sda1
sdb
/dev/sdc3
LABEL=MyLabel
UUID=MyUUID

- pathspec defaults to /LiveOS/Persistence-LIVEOS_LABEL
(e.g. /LiveOS/Persistence-Fedora-7-Live-i386)

if pathspec does not start with a /, it prepends the above default.
(e.g. persistence=:dmc would mean to search all partitions for 
/LiveOS/Persistence-Fedora-7-Live-i386-dmc)

if pathspec starts with a / then it is used as is.  e.g. 
persistence=:/home/dmc/testpers would search all partitions(and whole devices) 
for /home/dmc/testpers )

To round out the examples, persistence=LABEL="my usb stick":/my/path/to/file

Finally: Known bugs:

1) I had to comment out the mayflower generated init's trap and set -e

2) ext3's inability to mounted readonly is annoying (yeah, I know norecovery or 
ext2 will probably get it for me, still annoying)

3) choice handling is broken.  Don't use auto when it will find more than one 
entry.  Maybe just don't use auto at all.

4) livetool doesn't do anything.  For now, just create a sparse file of any 
interesting length (512M is fine) as mentioned above.

Well, that about covers it for now.  As always, comments, suggestions, and 
criticisms will be greatly appreciated.  (though feel free to wait 48 hours for 
plenty of obvious improvements, such as fixing those known bugs).

"release early, release often"...

-dmc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: livecd.persistence.patch
Type: text/x-patch
Size: 11656 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/livecd/attachments/20070724/fc38d308/attachment.bin 


More information about the livecd mailing list