9 def getconf(hostname, force=False, media=None):
10 n = api.GetNodes(hostname)
11 filename = "bootcd/" + hostname + ".txt"
12 if not os.path.exists(filename) or force:
13 f = open("bootcd/" + hostname + ".txt", 'w')
14 f.write( api.AdmGenerateNodeConfFile(n[0]['node_id']) )
16 print os.system("cd bootcd; ./build.sh -f %s.txt -t iso -o /plc/data/var/www/html/bootcds/%s.iso &> /dev/null" % ( hostname, hostname))
17 print os.system("cd bootcd; ./build.sh -f %s.txt -t usb_partition -o /plc/data/var/www/html/bootcds/%s-partition.usb &> /dev/null" % ( hostname, hostname))
19 # assume that the images have already been generated..
24 args['url_list'] = " http://%s/bootcds/%s-partition.usb\n" % (monitorconfig.MONITOR_HOSTNAME, hostname)
25 args['url_list'] += " http://%s/bootcds/%s.iso" % (monitorconfig.MONITOR_HOSTNAME, hostname)
28 args['url_list'] = " http://%s/bootcds/%s-partition.usb\n" % (monitorconfig.MONITOR_HOSTNAME, hostname)
30 args['url_list'] = " http://%s/bootcds/%s.iso" % (monitorconfig.MONITOR_HOSTNAME, hostname)
32 args['url_list'] = " http://%s/bootcds/%s-partition.usb\n" % (monitorconfig.MONITOR_HOSTNAME, hostname)
33 args['url_list'] += " http://%s/bootcds/%s.iso" % (monitorconfig.MONITOR_HOSTNAME, hostname)
38 if __name__ == '__main__':
39 import parser as parsermodule
41 parser = parsermodule.getParser()
42 parser.set_defaults(media='both', force=False)
43 parser.add_option("", "--media", dest="media", metavar="usb, iso, both",
44 help="""Which media to generate the message for.""")
45 parser.add_option("", "--force", dest="force", action="store_true",
46 help="""Force the recreation of the usb images.""")
47 parser = parsermodule.getParser(['defaults'], parser)
49 config = parsesrmodule.parse_args(parser)
51 ret = {'url_list' : ''}
53 conf = getconf(i, config.force, config.media)
54 ret['url_list'] += conf['url_list']
57 if config.media == "both":
61 Here are links to both the ISO CD image, and partitioned, USB image for the
62 DC7800 and others. These are based on the new 4.2 BootImage, and are the most
63 up-to-date software for PlanetLab nodes.
67 All that is necessary is to raw-write these images to a usb stick or CD-ROM, and
68 then boot from them. If using USB, please use a command like:
70 dd if=%(hostname)s.usb of=/dev/sdX
72 Where sdX is your USB device. It is not necessary to run any other formatting
73 commands for these images, because they already include a MBR, partition
76 Please let me know if you have any trouble.
82 elif config.media == "iso":
86 Here are links to the ISO CD image(s) for your machines. These are based on
87 the new 4.2 BootImage, and are the most up-to-date software for PlanetLab
92 All that is necessary is to burn these images to a CD-ROM, and
95 Please let me know if you have any trouble.
101 elif config.media == "usb":
105 Here are links to the partitioned, USB images for the DC7800 and others.
106 These are based on the new 4.2 BootImage, and are the most
107 up-to-date software for PlanetLab nodes.
111 All that is necessary is to raw-write these images to a usb stick, and
112 then boot from them. Please use a command like:
114 dd if=%(hostname)s.usb of=/dev/sdX
116 Where sdX is your direct, USB device. Do not use a partition on the usb
117 image, or the boot will fail. It is not necessary to run any other formatting
118 commands for these images, because they already include a MBR, partition
121 Please let me know if you have any trouble.