Difference between revisions of "Vnx-rootfsfedora"
(→Basic installation) |
(→Basic installation) |
||
Line 15: | Line 15: | ||
vnx --create-rootfs vnx_rootfs_kvm_fedora.qcow2 --install-media /almacen/iso/Fedora-16-i686-Live-Desktop.iso --mem 768M | vnx --create-rootfs vnx_rootfs_kvm_fedora.qcow2 --install-media /almacen/iso/Fedora-16-i686-Live-Desktop.iso --mem 768M | ||
<li>Follow the Fedora installation assistant. At some point, you will have to choose among different system profiles: desktop, web server, minimal, etc.</li> | <li>Follow the Fedora installation assistant. At some point, you will have to choose among different system profiles: desktop, web server, minimal, etc.</li> | ||
− | <li>Enable login on the first serial line | + | <li>Enable login on the first serial line:</li> |
+ | <ul> | ||
+ | <li>Fedora 16. Execute this command:</li> | ||
+ | ln -s /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyS0.service | ||
+ | <li>Fedora 14. Create a file named /etc/init/serial-ttyS0.conf with the following content:</li> | ||
#This service maintains a getty on /dev/ttyS0. | #This service maintains a getty on /dev/ttyS0. | ||
start on stopped rc RUNLEVEL=[2345] | start on stopped rc RUNLEVEL=[2345] | ||
Line 21: | Line 25: | ||
respawn | respawn | ||
exec /sbin/agetty /dev/ttyS0 9600 vt100-nav | exec /sbin/agetty /dev/ttyS0 9600 vt100-nav | ||
− | + | Besides, add ttyS0 to /etc/securetty file if you want to login root on that console: | |
echo "ttyS0" >> /etc/securetty | echo "ttyS0" >> /etc/securetty | ||
+ | </ul> | ||
</ul> | </ul> | ||
Revision as of 14:45, 21 May 2012
How to create a Fedora root filesystem for VNX
(being updated...do not use...)
Follow this procedure to create a fedora based root filesystem for VNX. The procedure has been tested with Fedora 16 and 14.
Basic installation
- Create the filesystem disk image:
qemu-img create -f qcow2 vnx_rootfs_kvm_fedora.qcow2 8GB
wget ftp://ftp.rediris.es/mirror/fedora/16/Fedora/i386/iso/Fedora-16-i386-DVD.iso cp Fedora-16-i386-DVD.iso /almacen/iso
vnx --create-rootfs vnx_rootfs_kvm_fedora.qcow2 --install-media /almacen/iso/Fedora-16-i686-Live-Desktop.iso --mem 768M
- Fedora 16. Execute this command:
ln -s /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyS0.service
#This service maintains a getty on /dev/ttyS0. start on stopped rc RUNLEVEL=[2345] stop on starting runlevel [016] respawn exec /sbin/agetty /dev/ttyS0 9600 vt100-nav
Besides, add ttyS0 to /etc/securetty file if you want to login root on that console:
echo "ttyS0" >> /etc/securetty
Configuration
- Update the system and install additional packages
yum update yum install perl perl-XML-DOM acpid udisks
Note: if yum fails, check that the network is working. Maybe you will have to manually execute "dhclient eth0", at least in the case of a minimal installation.
- From the host execute:
/usr/share/vnx/bin/vnx_update_aced Fedora /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz
ln -s /media/CDROM /media/cdrom udisks --mount /dev/sr0 perl /media/cdrom/install_vnxaced
chkconfig --level 3 network on
- Install other services needed, for example, an apache server:
yum install httpd update-rc.d -f apache2 remove # to avoid automatic start
yum install telnet wget openssh-clients
AutomaticLoginEnable=true AutomaticLogin=vnx
chkconfig iptables off
VER=v0.21 OS=Fedora 14 DESC=Basic Fedora 14 root-filesystem without GUI
#!/bin/bash # Clean yum cache yum clean all # Delete /etc/resolv.conf rm -f /etc/resolv.conf # Clean command history rm -f /root/.bash_history # Delete udev net rules files: rm -f /etc/udev/rules.d/70-persistent-net.rules # Delete VNXACE log rm -f /var/log/vnxaced.log while true; do # Ask for a message to save in /etc/vnx_rootfs_version file echo "** Save a log message in /etc/vnx_rootfs_version file " echo -n "** describing the modifications done? " read -n 1 -p "[y/n] " answer echo "" case $answer in [Yy]* ) echo "** Log message (1 line maximum):" read logmsg DATE=`date` echo "MODDATE=$DATE" >> /etc/vnx_rootfs_version echo "MODDESC=$logmsg" >> /etc/vnx_rootfs_version break;; [Nn]* ) break;; * ) echo "** Error: please answer 'y' or 'n'.";; esac done # Halt the system halt -p
chmod +x /usr/local/bin/vnx_halt
vnx_halt
Installing additional software
To install additional software or modify your root filesystem, you just have to start it as described above and make the operations required on the filesystem.
- Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):
/usr/share/vnx/bin/vnx_modify_rootfs rootfs_fedora.xml
- Install the software:
yum install ...
- Stop the machine with:
vnx_halt