[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RFC: pimp my live-helpers



hi list,
I want to open a discussion on how to pimp the great live-helper scripts.

as startpoint I have attached a patch against1.0~a41+20080325.095215 which 
does the following:

1. while doing updates for the cache, instead of deleting a cache & copying it 
complete over, it checks whether rsync is installed and does an 
rsync --delete -a source/ target/

advantage: 
	assuming that the most packages won't change between two builds, 
	we only need to copy the updated files. leftovers are deleted.

extrapackages needed: 
	rsync

2. while we using aufs only within debianLive, here aufs is used to mount the 
chroot/chroot construction instead of doubling all to chroot.tmp and move it 
to chroot/chroot.

this is done by renaming chroot to .chroot, 
creating a chroot.binary and chroot.tmp/... 
and mount our source .chroot (readonly) to chroot.binary and to 
chroot.binary/chroot, each with a rw-aufs-layer.
chroot.binary is then sym-linked to chroot, to better recognize that the 
aufs-mechanic is in use.

this gives us
.chroot: our original untouched chroot, as lh_chroot created it.
chroot.tmp: the aufs cow-directory, where any changes appear for chroot.binary
chroot.binary: mounted .chroot(ro) with aufs-overlay chroot.tmp(rw)
chroot.tmp/.chroot.tmp: the aufs cow-directory, where any changes appear 
	for chroot.binary/chroot
chroot.binary/chroot: mounted .chroot(ro) with aufs-overlay 
	chroot.tmp/.chroot.tmp(rw)
chroot -> chroot.binary: a sym-link for better recognizing.

advantages: 
	* the whole construction of chroot/chroot is done in a few seconds, 
	  instead of doubling MB/GB of data within 10th of 
	  minutes (your mileage my vary)
	* only space for one chroot dir. is needed, instead of double

extrapackages needed: 
	aufs-modules & aufs-tools

this patch is a hack and is meant to start a discussion, even so it worked for 
me for a while perfectly, building usb-images. before it does anything new, 
it checks on existence of rsync or aufs and aufs-tools and is reentrant for 
lh_binary, lh_binary_chroot. 
lh_binary_rootfs is turning it back to normal, removing all tmp. files/dirs.

also attached is a little script, which can be sourced to get some 
shellfunctions which come in handy, while playing around with the 
aufs-construct: 
lh_aufs [-i] [-u]: to mount & umount the aufs construction
lh_mount: to mount proc, devpts & sysfs: 
lh_umount: to umount proc, devpts & sysfs: 


KUDOS to Daniel & the developer gang for providing such a great tool.

guenter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-livehelpers-pimp-1.diff
Type: text/x-diff
Size: 11184 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/debian-live-devel/attachments/20080325/4909d77d/attachment-0001.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lh_functions.sh
Type: application/x-shellscript
Size: 1487 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/debian-live-devel/attachments/20080325/4909d77d/attachment-0001.bin 


Reply to: