# boot cd.
log.write( "Writing /etc/modprobe.conf\n" )
+ # get the kernel version
+ initrd= os.readlink( "%s/boot/initrd-boot" % SYSIMG_PATH )
+ kernel_version= initrd.replace("initrd-", "").replace(".img", "")
+
sysinfo= systeminfo()
- sysmods= sysinfo.get_system_modules(SYSIMG_PATH)
+ sysmods= sysinfo.get_system_modules(SYSIMG_PATH, kernel_version)
if sysmods is None:
raise BootManagerException, "Unable to get list of system modules."
rootdev= file( "%s/%s" % (SYSIMG_PATH,PARTITIONS["mapper-root"]), "w" )
rootdev.close()
- utils.sysexec( "chroot %s sh -c '" \
- "kernelversion=`ls /lib/modules | tail -1` && " \
- "rm -f /boot/initrd-$kernelversion.img && " \
- "mkinitrd /boot/initrd-$kernelversion.img $kernelversion'" % \
- SYSIMG_PATH, log )
+ # initrd set above
+ 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 == 1:
utils.removefile( "%s/%s" % (SYSIMG_PATH,PARTITIONS["mapper-root"]) )
network= network_settings['network']
netmask= network_settings['netmask']
dns1= network_settings['dns1']
+ mac= network_settings['mac']
except KeyError, e:
raise BootManagerException, "Missing value %s in network settings." % str(e)
else:
eth0_file.write( "BOOTPROTO=dhcp\n" )
eth0_file.write( "DHCP_HOSTNAME=%s\n" % hostname )
+ if mac != "":
+ eth0_file.write( "HWADDR=%s\n" % mac )
eth0_file.write( "ONBOOT=yes\n" )
eth0_file.write( "USERCTL=no\n" )
eth0_file.close()