-#!/usr/bin/python2
+#!/usr/bin/python
# Copyright (c) 2003 Intel Corporation
# All rights reserved.
PARTITIONS dictionary of generic part. types (root/swap)
and their associated devices.
PLCONF_DIR The directory to store the configuration file in
- NETWORK_SETTINGS A dictionary of the values from the network
+ INTERFACE_SETTINGS A dictionary of the values from the network
configuration file
- BOOT_CD_VERSION A tuple of the current bootcd version
-
Sets the following variables:
None
if PLCONF_DIR == "":
raise ValueError, "PLCONF_DIR"
- NETWORK_SETTINGS= vars["NETWORK_SETTINGS"]
- if NETWORK_SETTINGS == "":
- raise ValueError, "NETWORK_SETTINGS"
-
- BOOT_CD_VERSION= vars["BOOT_CD_VERSION"]
- if BOOT_CD_VERSION == "":
- raise ValueError, "BOOT_CD_VERSION"
+ INTERFACE_SETTINGS= vars["INTERFACE_SETTINGS"]
+ if INTERFACE_SETTINGS == "":
+ raise ValueError, "INTERFACE_SETTINGS"
except KeyError, var:
raise BootManagerException, "Missing variable in vars: %s\n" % var
fstab= file( "%s/etc/fstab" % SYSIMG_PATH, "w" )
fstab.write( "%s none swap sw 0 0\n" % \
PARTITIONS["mapper-swap"] )
- fstab.write( "%s / ext3 defaults 0 0\n" % \
+ fstab.write( "%s / ext3 defaults 1 1\n" % \
PARTITIONS["mapper-root"] )
- fstab.write( "%s /vservers ext3 tagxid,defaults 0 0\n" % \
+ fstab.write( "%s /vservers ext3 tagxid,defaults 1 2\n" % \
PARTITIONS["mapper-vservers"] )
fstab.write( "none /proc proc defaults 0 0\n" )
fstab.write( "none /dev/shm tmpfs defaults 0 0\n" )
# fstab.write( "none /rcfs rcfs defaults 0 0\n" )
fstab.close()
-
log.write( "Writing system /etc/issue\n" )
issue= file( "%s/etc/issue" % SYSIMG_PATH, "w" )
issue.write( "PlanetLab Node: \\n\n" )
# the system image so we can run programs inside that need network access
method= ""
try:
- method= vars['NETWORK_SETTINGS']['method']
+ method= vars['INTERFACE_SETTINGS']['method']
except:
pass
if method == "dhcp":
utils.sysexec( "cp /etc/resolv.conf %s/etc/" % SYSIMG_PATH, log )
- # the kernel rpm should have already done this, so don't fail the
- # install if it fails
- log.write( "Mounting /proc in system image\n" )
- utils.sysexec_noerr( "mount -t proc proc %s/proc" % SYSIMG_PATH, log )
-
- # mkinitrd references both /etc/modprobe.conf and /etc/fstab
- # as well as /proc/lvm/global. The kernel RPM installation
- # likely created an improper initrd since these files did not
- # yet exist. Re-create the initrd here.
- log.write( "Making initrd\n" )
-
- # trick mkinitrd in case the current environment does not have device mapper
- fake_root_lvm= False
- if not os.path.exists( "%s/%s" % (SYSIMG_PATH,PARTITIONS["mapper-root"]) ):
- fake_root_lvm= True
- utils.makedirs( "%s/dev/mapper" % SYSIMG_PATH )
- rootdev= file( "%s/%s" % (SYSIMG_PATH,PARTITIONS["mapper-root"]), "w" )
- rootdev.close()
-
- initrd, kernel_version= systeminfo.getKernelVersion(vars,log)
- utils.removefile( "%s/boot/%s" % (SYSIMG_PATH, initrd) )
- utils.sysexec( "chroot %s mkinitrd /boot/initrd-%s.img %s" % \
- (SYSIMG_PATH, kernel_version, kernel_version), log )
-
- if fake_root_lvm == True:
- utils.removefile( "%s/%s" % (SYSIMG_PATH,PARTITIONS["mapper-root"]) )
-
log.write( "Writing node install version\n" )
utils.makedirs( "%s/etc/planetlab" % SYSIMG_PATH )
ver= file( "%s/etc/planetlab/install_version" % SYSIMG_PATH, "w" )