On Mon, 2007-09-17 at 22:31 -0500, Douglas McClendon wrote: > Jeremy Katz wrote: > > On Mon, 2007-09-17 at 12:34 -0500, Douglas McClendon wrote: > >> this patch takes care of the anaconda side of taking advantage of > >> livecd's created with a livecd-tools that has > >> turboLiveInst/genMinInstDelta support. But the code does check for the > >> legacy situation, and handles it gracefully. Thus this patch is safe > >> even in the absence of the actual beneficial final patch to livecd-tools. > > > > So as you alluded in your later mail, this looks like it could be > > confused if something else ended up using loop118 instead. Is there a > > good reason not to just set up the minimal snapshot from the initrd and > > then just use it if it exists? That would then make the anaconda side > > super-crazy-simple (look for /dev/mapper/live-osimg-min and use it if it > > exists). > > The danger would be loop117, as that is the one created at install time. > loop118 being locked up at initramfs time.
Not if new anaconda is used with old livecd-creator -- then loop118 wouldn't have been used and something else could use it while the live system is running. > The reason why I think it should stay as is, instead of setting > everything up at initramfs time, is because the loop117 gets associated > with the decompressed-into-devshm contents of loop118. The > decompression being 7kb->1.2M in the typical case. > > I'd say that the 1.2M ram hit should only be taken during install, and > that outweighs the benefits of moving the complexity from liveinst.sh to > initramfs. But the time that the memory hit matters the _most_ is during the install as we have to have swap disabled during parts of it. Otherwise, swap is available and can be used. It also means that there's less need to worry about the cleanup case in anaconda. Also, it takes care of my biggest complaint from the past (anaconda having to know too many details of how things are setup -- I _really_ like that right now, anaconda just needs to know to look at block device that's already set up and nothing more is needed) Patch ends up being the attached plus the teensy change so that anaconda will check /dev/mapper/live-osimg-min Jeremy
diff --git a/config/livecd-fedora-minimal.ks b/config/livecd-fedora-minimal.ks index 59fced6..e5306c9 100644 --- a/config/livecd-fedora-minimal.ks +++ b/config/livecd-fedora-minimal.ks @@ -6,8 +6,8 @@ selinux --enforcing firewall --disabled part / --size 1024 -repo --name=development --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=$basearch - +#repo --name=development --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=$basearch +repo --name=development --baseurl=file:///home/katzj/trees/rawhide/i386 %packages @core diff --git a/creator/mayflower b/creator/mayflower index e1933d5..1357dd5 100755 --- a/creator/mayflower +++ b/creator/mayflower @@ -78,6 +78,7 @@ cp /sbin/losetup sbin cp /sbin/blockdev sbin cp /sbin/dmsetup sbin cp /bin/dd bin +cp /bin/gzip bin # we explicitly load these, so should be sure they're present MODULES="loop dm_snapshot " @@ -629,20 +630,18 @@ modprobe loop max_loop=128 # we might have a genMinInstDelta delta file for anaconda to take advantage of if [ -e /sysroot/LiveOS/osmin.gz ]; then - OSMIN=/sysroot/LiveOS/osmin.gz + OSMINGZ=/sysroot/LiveOS/osmin.gz elif [ -e /sysroot/osmin.gz ]; then - OSMIN=/sysroot/osmin.gz + OSMINGZ=/sysroot/osmin.gz fi -if [ -n "\$OSMIN" ]; then +if [ -n "\$OSMINGZ" ]; then mknod /dev/loop118 b 7 118 - dd if=\$OSMIN of=/osmin.gz bs=512 2> /dev/null - # pad to at least next sector boundry - dd if=/dev/zero of=/osmin.gz bs=512 count=1 oflag=append conv=notrunc 2> /dev/null - losetup /dev/loop118 /osmin.gz + # decompress the delta data + gzip -cd \$OSMINGZ > /osmin + losetup /dev/loop118 /osmin fi - # we might have an uncompressed embedded ext3 to use as rootfs (uncompressed live) # if [ -e /sysroot/LiveOS/ext3fs.img ]; then @@ -714,6 +713,12 @@ if [ -n "\$SQUASHED" ] ; then do_live_from_loop121 fi +if [ -e /osmin ]; then + # set up the devicemapper snapshot device, which will merge + # the normal live fs image, and the delta, into a minimzied fs image + echo "0 \$( blockdev --getsize /dev/loop121 ) snapshot /dev/loop121 /dev/loop118 p 8" | dmsetup create --readonly live-osimg-min +fi + if [ "\$eshell" == "1" ] ; then echo "Shell requested on kernel commandline." echo "Rootfs is mounted ro on /sysroot. Exit to continue booting."
-- Fedora-livecd-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/fedora-livecd-list
