Rewrite /etc/fstab and transport image to remote end.
[virt-p2v.git] / livecd-post.sh.in
1 # This is the post-configuration section of the kickstart
2 # installer.  It runs inside the live CD chroot while it is
3 # being created (after all the packages have been installed)
4 # but before we make the ISO.
5 #
6 # Copyright (C) 2007 Red Hat Inc.
7 # Written by Richard W.M. Jones <rjones@redhat.com>
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22 #
23 # $Id$
24
25 # Create a 'p2v' init script which runs last thing during the
26 # boot.
27
28 cat > /etc/init.d/p2v << '__EOF4321__'
29 @P2V.INIT@
30 __EOF4321__
31
32 # Make the 'p2v' script run when the live CD boots.
33 chmod 0755 /etc/init.d/p2v
34 /sbin/restorecon /etc/init.d/p2v
35 /sbin/chkconfig --add p2v
36
37 cat > /usr/bin/virt-p2v.sh << '__EOF1234__'
38 @VIRT-P2V.SH@
39 __EOF1234__
40
41 chmod 0755 /usr/bin/virt-p2v.sh
42 /sbin/restorecon /usr/bin/virt-p2v.sh
43
44 # Install custom inittab.
45 cat > /etc/inittab << '__EOF4123__'
46 @INITTAB@
47 __EOF4123__
48
49 # Install custom lvm.conf.new (the shell script will rename to
50 # lvm.conf when the time comes).
51 cat > /etc/lvm/lvm.conf.new << '__EOF4312__'
52 @LVM.CONF@
53 __EOF4312__
54
55 # Turn off firstboot for livecd boots.
56 echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
57
58 # Don't start yum-updatesd for livecd boots.
59 /sbin/chkconfig --level 345 yum-updatesd off
60
61 # Don't start cron/at as they tend to spawn things which are
62 # disk intensive that are painful on a live image.
63 /sbin/chkconfig --level 345 crond off
64 /sbin/chkconfig --level 345 atd off
65 /sbin/chkconfig --level 345 anacron off
66 /sbin/chkconfig --level 345 readahead_early off
67 /sbin/chkconfig --level 345 readahead_later off
68
69 # Stopgap fix for RH #217966; should be fixed in HAL instead
70 touch /media/.hal-mtab
71
72 # Make some mountpoints.
73 mkdir /mnt/root