X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=livecd-post.sh.in;h=31126820eb4d1a98bfcd77fe345e164d3608e79b;hb=65b46ce56a110e798c9a21f99eb7969f5ca073e3;hp=82427ae24e74187b8bc1baaee5b51c2da0116f54;hpb=502d99a2567724ac5153a0eaa64bc13e8d13ce24;p=virt-p2v.git diff --git a/livecd-post.sh.in b/livecd-post.sh.in index 82427ae..3112682 100644 --- a/livecd-post.sh.in +++ b/livecd-post.sh.in @@ -2,39 +2,78 @@ # installer. It runs inside the live CD chroot while it is # being created (after all the packages have been installed) # but before we make the ISO. +# +# Copyright (C) 2007 Red Hat Inc. +# Written by Richard W.M. Jones +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# Create a 'p2v' init script which runs last thing during the -# boot. +# This is the virt-p2v script. +cat > /usr/bin/virt-p2v << '__EOF1234__' +@VIRT-P2V@ +__EOF1234__ -cat > /etc/init.d/p2v << '__EOF__' -@P2V.INIT@ -__EOF__ +chmod 0755 /usr/bin/virt-p2v +/sbin/restorecon /usr/bin/virt-p2v -# Make the 'p2v' script run when the live CD boots. -chmod 0755 /etc/init.d/p2v -/sbin/restorecon /etc/init.d/p2v -/sbin/chkconfig --add p2v +# iso-attach program. +cat > /usr/bin/iso-attach << '__EOF2134__' +@ISO-ATTACH@ +__EOF2134__ -cat > /usr/bin/virt-p2v.sh << '__EOF__' -@VIRT-P2V.SH@ -__EOF__ +chmod 0755 /usr/bin/iso-attach +/sbin/restorecon /usr/bin/iso-attach -chmod 0755 /usr/bin/virt-p2v.sh -/sbin/restorecon /usr/bin/virt-p2v.sh +# Update wrapper - checks the CD-ROM for any attached file. +cat > /usr/bin/virt-p2v-update-wrapper << '__EOF1243__' +@VIRT-P2V-UPDATE-WRAPPER@ +__EOF1243__ + +chmod 0755 /usr/bin/virt-p2v-update-wrapper +/sbin/restorecon /usr/bin/virt-p2v-update-wrapper + +# Install custom inittab. +cat > /etc/inittab << '__EOF4123__' +@INITTAB@ +__EOF4123__ + +# Install custom lvm.conf. The script selects this by adjusting +# $LVM_SYSTEM_DIR environment variable at the right time. +cp -a /etc/lvm /etc/lvm.new +cat > /etc/lvm.new/lvm.conf << '__EOF4312__' +@LVM.CONF@ +__EOF4312__ # Turn off firstboot for livecd boots. echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot # Don't start yum-updatesd for livecd boots. -chkconfig --level 345 yum-updatesd off +/sbin/chkconfig --level 345 yum-updatesd off # Don't start cron/at as they tend to spawn things which are # disk intensive that are painful on a live image. -chkconfig --level 345 crond off -chkconfig --level 345 atd off -chkconfig --level 345 anacron off -chkconfig --level 345 readahead_early off -chkconfig --level 345 readahead_later off +/sbin/chkconfig --level 345 crond off +/sbin/chkconfig --level 345 atd off +/sbin/chkconfig --level 345 anacron off +/sbin/chkconfig --level 345 readahead_early off +/sbin/chkconfig --level 345 readahead_later off # Stopgap fix for RH #217966; should be fixed in HAL instead touch /media/.hal-mtab + +# Make some mountpoints. +mkdir /mnt/root + +%end