Merge lp:~craig.magina/junk/pandakit into lp:~racb/junk/pandakit

Proposed by Craig Magina
Status: Needs review
Proposed branch: lp:~craig.magina/junk/pandakit
Merge into: lp:~racb/junk/pandakit
Diff against target: 813 lines (+445/-53)
19 files modified
armadaxp-install.expect (+46/-0)
armadaxp.expect (+1/-1)
console-ro (+5/-1)
console-rw (+5/-1)
debian/changelog (+22/-0)
debian/control (+3/-3)
debian/install (+7/-2)
defaults.yaml (+62/-19)
generic-boot.expect (+16/-0)
generic-install.expect (+23/-0)
generic.expect (+1/-1)
pandakit.rtupdate (+6/-0)
pandakit/ipmi.py (+30/-2)
pandakit/pk.py (+8/-3)
pandakit/toecap.py (+29/-11)
preseed.amd64 (+69/-0)
preseed.arm (+19/-9)
preseed.ml (+65/-0)
preseed.remote (+28/-0)
To merge this branch: bzr merge lp:~craig.magina/junk/pandakit
Reviewer Review Type Date Requested Status
Robie Basak Pending
Review via email: mp+193144@code.launchpad.net

Description of the change

Merged all changes made locally

To post a comment you must log in.
lp:~craig.magina/junk/pandakit updated
95. By Craig Magina

Added configuration fields to specify raw power on and off commands for ipmi
Merged local changes

96. By Craig Magina

* Fixed a bug with the SSH global defines in toecap
* Minor cleanup from merge that broke installs
* Added new files in debian/install
* Added new recommends on conserver

97. By Craig Magina

Applied Massimo's sentrysnmp changes to support the cdu's user in 1ss

Unmerged revisions

97. By Craig Magina

Applied Massimo's sentrysnmp changes to support the cdu's user in 1ss

96. By Craig Magina

* Fixed a bug with the SSH global defines in toecap
* Minor cleanup from merge that broke installs
* Added new files in debian/install
* Added new recommends on conserver

95. By Craig Magina

Added configuration fields to specify raw power on and off commands for ipmi
Merged local changes

94. By Craig Magina

Merged all modifications from local system

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'armadaxp-install.expect'
--- armadaxp-install.expect 1970-01-01 00:00:00 +0000
+++ armadaxp-install.expect 2014-02-07 20:43:02 +0000
@@ -0,0 +1,46 @@
1#!/usr/bin/expect -f
2
3set hostname [lindex $argv 0]
4spawn /usr/lib/pandakit/console-rw $hostname
5set timeout 30
6expect {
7 -ex "Hit any key to stop autoboot:" {send "\n"}
8 timeout {send_user "timed out\n"; exit 1}
9}
10expect {
11 -ex "Marvell>> " {sleep 2;send "dhcp\n"}
12 timeout {send_user "timed out\n"; exit 1}
13}
14expect {
15 timeout {send_user "timed out\n"; exit 1}
16 -ex "egiga0 mvNetaPortEnable failed" {send_user "known race\n"; exit 75}
17 -ex "Retry count exceeded" {send_user "bootp error\n"; exit 1}
18 -ex "DHCP client bound to address"
19}
20expect {
21 -ex "Marvell>> " {send "pxe get\n"}
22 timeout {send_user "timed out\n"; exit 1}
23}
24expect {
25 -ex "Marvell>> " {send "pxe boot\n"}
26 timeout {send_user "timed out\n"; exit 1}
27}
28expect {
29 timeout {send_user "timed out\n"; exit 1}
30 -ex "Starting kernel ..."
31}
32set timeout 1900
33expect {
34 timeout {send_user "timed out\n"; exit 1}
35 "Error parsing config file" {exit 4}
36# "Uncompressing Linux" {exit 99}
37# "Detecting network hardwar" {exit 0}
38 "Oops" {exit 2}
39 "panic occurred" {exit 6}
40 "Kernel panic" {sleep 60; exit 7}
41 "The debootstrap program exited with an error (return value 1)" {exit 3}
42 "Press enter to continue" {exit 5}
43# "Prompt: '?' for help>" as well as "Prompt: '?' for help, default=1>"
44 "Prompt: '?' for help" {exit 8}
45 "Restarting system." {exit 0}
46}
047
=== modified file 'armadaxp.expect'
--- armadaxp.expect 2012-07-04 14:00:28 +0000
+++ armadaxp.expect 2014-02-07 20:43:02 +0000
@@ -29,7 +29,7 @@
29 timeout {send_user "timed out\n"; exit 1}29 timeout {send_user "timed out\n"; exit 1}
30 -ex "Starting kernel ..."30 -ex "Starting kernel ..."
31}31}
32set timeout 190032set timeout 3200
33expect {33expect {
34 timeout {send_user "timed out\n"; exit 1}34 timeout {send_user "timed out\n"; exit 1}
35 "Error parsing config file" {exit 4}35 "Error parsing config file" {exit 4}
3636
=== modified file 'console-ro'
--- console-ro 2012-03-21 11:59:24 +0000
+++ console-ro 2014-02-07 20:43:02 +0000
@@ -16,7 +16,11 @@
16 hostname = sys.argv[1]16 hostname = sys.argv[1]
17 console = local_setup['machines'][hostname]['console']17 console = local_setup['machines'][hostname]['console']
18 if console['driver'] == 'conserver':18 if console['driver'] == 'conserver':
19 subprocess.check_call('while true;do sleep 999999;done|console -p3109 -Mlocalhost -s "%s"|(sed -n 2q;cat)' % hostname, shell=True)19 if 'master' in console:
20 master = console['master']
21 else:
22 master = 'localhost'
23 subprocess.check_call('while true;do sleep 999999;done|console -p3109 -M "%s" -s "%s"|(sed -n 2q;cat)' % (master,hostname), shell=True)
20 elif console['driver'] == 'tty':24 elif console['driver'] == 'tty':
21 baud = console['baud']25 baud = console['baud']
22 tty = console['tty']26 tty = console['tty']
2327
=== modified file 'console-rw'
--- console-rw 2012-03-27 11:24:34 +0000
+++ console-rw 2014-02-07 20:43:02 +0000
@@ -10,6 +10,10 @@
10 hostname = sys.argv[1]10 hostname = sys.argv[1]
11 console = local_setup['machines'][hostname]['console']11 console = local_setup['machines'][hostname]['console']
12 if console['driver'] == 'conserver':12 if console['driver'] == 'conserver':
13 subprocess.check_call('console -f -p3109 -Mlocalhost "%s"' % hostname, shell=True)13 if 'master' in console:
14 master = console['master']
15 else:
16 master = 'localhost'
17 subprocess.check_call('console -f -p3109 -M "%s" "%s"' % (master,hostname), shell=True)
14 else:18 else:
15 raise NotImplementedError()19 raise NotImplementedError()
1620
=== modified file 'debian/changelog'
--- debian/changelog 2012-03-08 16:55:18 +0000
+++ debian/changelog 2014-02-07 20:43:02 +0000
@@ -1,3 +1,25 @@
1pandakit (0.1-4) precise; urgency=low
2
3 * Fixed a bug with the SSH global defines in toecap
4
5 -- Craig Magina <craig.magina@canonical.com> Sun, 15 Dec 2013 17:03:00 -0500
6
7pandakit (0.1-3) precise; urgency=low
8
9 * Minor cleanup from merge that broke installs
10 * Added new files in debian/install
11 * Added new recommends on conserver
12
13 -- Craig Magina <craig.magina@canonical.com> Tue, 10 Dec 2013 14:43:24 -0400
14
15pandakit (0.1-2) precise; urgency=low
16
17 * Added configuration fields to specify raw power on and off commands for
18 ipmi
19 * Merged local changes
20
21 -- Craig Magina <craig.magina@canonical.com> Fri, 01 Nov 2013 18:06:44 -0400
22
1pandakit (0.1-1) precise; urgency=low23pandakit (0.1-1) precise; urgency=low
224
3 * Initial release.25 * Initial release.
426
=== modified file 'debian/control'
--- debian/control 2012-05-18 14:24:21 +0000
+++ debian/control 2014-02-07 20:43:02 +0000
@@ -3,13 +3,13 @@
3Priority: optional3Priority: optional
4Maintainer: Robie Basak <robie.basak@canonical.com>4Maintainer: Robie Basak <robie.basak@canonical.com>
5Standards-Version: 3.9.3.15Standards-Version: 3.9.3.1
6Build-Depends: debhelper (>= 7), python-all-dev (>= 2.7), python-support6Build-Depends: debhelper (>= 7), python-all-dev (>= 2.7), python-support, python-setuptools
7XS-Python-Version: >= 2.77XS-Python-Version: >= 2.7
88
9Package: pandakit9Package: pandakit
10Architecture: all10Architecture: all
11Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, expect, cobbler, python-usb, snmp, socat, python-lockfile11Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, expect, cobbler, python-usb, snmp, socat, python-lockfile
12Recommends: u-boot-linaro-omap4-panda-splusb, ipmitool12Recommends: u-boot-linaro-omap4-panda-splusb, ipmitool, conserver-server, conserver-client
13XB-Python-Version: ${python:Versions}13XB-Python-Version: ${python:Versions}
14Provides: ${python:Provides}14Provides: ${python:Provides}
15Description: tools to automate Pandaboard development15Description: tools to automate ARM board development
1616
=== modified file 'debian/install'
--- debian/install 2012-07-04 14:00:28 +0000
+++ debian/install 2014-02-07 20:43:02 +0000
@@ -2,12 +2,16 @@
2console-ro usr/lib/pandakit2console-ro usr/lib/pandakit
3console-rw usr/lib/pandakit3console-rw usr/lib/pandakit
4cobbler-clean usr/lib/pandakit4cobbler-clean usr/lib/pandakit
5generic.expect usr/lib/pandakit5generic-install.expect usr/lib/pandakit
6armadaxp.expect usr/lib/pandakit6generic-boot.expect usr/lib/pandakit
7armadaxp-install.expect usr/lib/pandakit
7omap4-netboot-mkcard.sh usr/lib/pandakit8omap4-netboot-mkcard.sh usr/lib/pandakit
8preseed.arm usr/share/pandakit9preseed.arm usr/share/pandakit
9preseed.armadaxp usr/share/pandakit10preseed.armadaxp usr/share/pandakit
11preseed.armadaxp_z1 usr/share/pandakit
10preseed.i386 usr/share/pandakit12preseed.i386 usr/share/pandakit
13preseed.amd64 usr/share/pandakit
14preseed.remote usr/share/pandakit
11relay-kmtronic usr/lib/pandakit15relay-kmtronic usr/lib/pandakit
12remote-netboot.py usr/lib/pandakit16remote-netboot.py usr/lib/pandakit
13ttyusb-dev usr/lib/pandakit17ttyusb-dev usr/lib/pandakit
@@ -15,3 +19,4 @@
15local_setup.yaml etc/pandakit19local_setup.yaml etc/pandakit
16defaults.yaml etc/pandakit20defaults.yaml etc/pandakit
1785-pandakit.rules /lib/udev/rules.d2185-pandakit.rules /lib/udev/rules.d
22pandakit.rtupdate usr/share/python/runtime.d
18\ No newline at end of file23\ No newline at end of file
1924
=== modified file 'defaults.yaml'
--- defaults.yaml 2012-07-04 15:10:26 +0000
+++ defaults.yaml 2014-02-07 20:43:02 +0000
@@ -1,20 +1,28 @@
1default_keywords: [ generic, armhf, quantal ]1default_keywords: [ generic, armhf, raring ]
2settings:2settings:
3 preseed: '/usr/share/pandakit/%(preseed)s'3 preseed: '/usr/share/pandakit/%(preseed)s'
4 kernel: '%(mirror)s/dists/%(release)s/main/installer-%(arch)s/current/images/%(installer)s/%(kernel_name)s'4 kernel: '%(mirror)s/dists/%(release)s/main/installer-%(arch)s/current/images/%(installer)s/%(kernel_name)s'
5 initrd: '%(mirror)s/dists/%(release)s/main/installer-%(arch)s/current/images/%(installer)s/%(initrd_name)s'5 initrd: '%(mirror)s/dists/%(release)s/main/installer-%(arch)s/current/images/%(installer)s/%(initrd_name)s'
6 kopts: '%(kopts)s DEBIAN_FRONTEND=text'6 kopts: '%(kopts)s DEBIAN_FRONTEND=text'
7 monitor: '/usr/lib/pandakit/%(monitor)s.expect'7 boot_monitor: '/usr/lib/pandakit/%(boot_monitor)s.expect'
8 install_monitor: '/usr/lib/pandakit/%(install_monitor)s.expect'
8settings_exceptions:9settings_exceptions:
9 # These are regular expression pairs10 # These are regular expression pairs
10 # Workaround for precise netboot images being in a slightly different path11 # Workaround for precise netboot images being in a slightly different path
11 # on armadaxp12 # on armadaxp
13# kernel:
14# - - '/dists/precise/main/installer-armhf/current/images/armadaxp/netboot/uImage$'
15# - '/dists/precise/main/installer-armhf/current/images/armadaxp/uImage'
16# initrd:
17# - - '/dists/precise/main/installer-armhf/current/images/armadaxp/netboot/uInitrd$'
18# - '/dists/precise/main/installer-armhf/current/images/armadaxp/uInitrd'
19 # On highbank in precise, the installer is only available in the -updates pocket
12 kernel:20 kernel:
13 - - '/dists/precise/main/installer-armhf/current/images/armadaxp/netboot/uImage$'21 - - '/dists/precise/main/installer-armhf/current/images/highbank/netboot/vmlinuz$'
14 - '/dists/precise/main/installer-armhf/current/images/armadaxp/uImage'22 - '/dists/precise-updates/main/installer-armhf/current/images/highbank/netboot/vmlinuz'
15 initrd:23 initrd:
16 - - '/dists/precise/main/installer-armhf/current/images/armadaxp/netboot/uInitrd$'24 - - '/dists/precise/main/installer-armhf/current/images/highbank/netboot/initrd.gz$'
17 - '/dists/precise/main/installer-armhf/current/images/armadaxp/uInitrd'25 - '/dists/precise-updates/main/installer-armhf/current/images/highbank/netboot/initrd.gz'
18keyword_map:26keyword_map:
19 armel:27 armel:
20 mirror: http://ports.ubuntu.com/ubuntu-ports28 mirror: http://ports.ubuntu.com/ubuntu-ports
@@ -28,34 +36,69 @@
28 kernel_name: uImage36 kernel_name: uImage
29 initrd_name: uInitrd37 initrd_name: uInitrd
30 preseed: preseed.arm38 preseed: preseed.arm
31 i386:39 amd64:
32 mirror: http://archive.ubuntu.com/ubuntu40 mirror: http://archive.ubuntu.com/ubuntu
33 arch: i38641 arch: amd64
34 installer: netboot/ubuntu-installer/i38642 installer: netboot/ubuntu-installer/amd64
35 kernel_name: linux43 kernel_name: linux
36 initrd_name: initrd.gz44 initrd_name: initrd.gz
37 preseed: preseed.i38645 preseed: preseed.amd64
46 lpae:
47 installer: generic-lpae/netboot
38 oneiric:48 oneiric:
39 release: oneiric49 release: oneiric
40 precise:50 precise:
41 release: precise51 release: precise
52 precise-updates:
53 release: precise-updates
42 quantal:54 quantal:
43 release: quantal55 release: quantal
56 quantal-updates:
57 release: quantal-updates
58 raring:
59 release: raring
60 raring-updates:
61 release: raring-updates
62 saucy:
63 release: saucy
64 saucy-updates:
65 release: saucy-updates
66 trusty:
67 release: trusty
68 trusty-updates:
69 release: trusty-updates
44 generic:70 generic:
45 monitor: generic71 boot_monitor: generic-boot
72 install_monitor: generic-install
46 kopts: ''73 kopts: ''
47 omap4:74 omap4:
48 installer: omap4/netboot75 installer: omap4/netboot
49 kopts: 'console=ttyO2,115200n8 earlyprintk=ttyO2 text fixrtc'76 kopts: 'console=ttyO2,115200n8 earlyprintk=ttyO2 text fixrtc vram=48M omapfb.vram=0:24M'
77 omap4-proposed:
78 installer: omap4/netboot
79 kopts: 'apt-setup/proposed=true console=ttyO2,115200n8 earlyprintk=ttyO2 text fixrtc'
50 armadaxp:80 armadaxp:
51 installer: armadaxp/netboot81 installer: armadaxp/netboot
52 preseed: preseed.armadaxp82 install_monitor: armadaxp-install
53 monitor: armadaxp83 kopts: 'console=ttyS0,115200n8 earlyprintk=ttyS0 text netcfg/choose_interface=auto fixrtc'
54 kopts: 'console=ttyS0,115200n8 earlyprintk=ttyS0 text netcfg/choose_interface=auto fixrtc'84 armadaxp-proposed:
55 armadaxp_z1:85 installer: armadaxp/netboot
56 preseed: preseed.armadaxp_z186 install_monitor: armadaxp-install
87 kopts: 'apt-setup/proposed=true console=ttyS0,115200n8 earlyprintk=ttyS0 text netcfg/choose_interface=auto fixrtc'
88 armadaxp-z1:
89 preseed: preseed.armadaxp-z1
90 # Need to specify a local hand-built installer somehow for Z1
91 installer: armadaxp-z1/netboot
92 install_monitor: armadaxp-install
93 kopts: 'console=ttyS0,115200n8 earlyprintk=ttyS0 text netcfg/choose_interface=auto fixrtc'
57 highbank:94 highbank:
58 installer: highbank/netboot95 release: quantal
59 kopts: 'console=ttyAMA0 earlyprintk=ttyAMA0 text netcfg/choose_interface=auto'96 installer: highbank/netboot
97 kopts: 'console=ttyAMA0 earlyprintk=ttyAMA0 text netcfg/choose_interface=auto fixrtc'
98 kernel_name: vmlinuz
99 initrd_name: initrd.gz
100 highbank-proposed:
101 installer: highbank/netboot
102 kopts: 'apt-setup/proposed=true console=ttyAMA0 earlyprintk=ttyAMA0 text netcfg/choose_interface=auto fixrtc'
60 kernel_name: vmlinuz103 kernel_name: vmlinuz
61 initrd_name: initrd.gz104 initrd_name: initrd.gz
62105
=== added file 'generic-boot.expect'
--- generic-boot.expect 1970-01-01 00:00:00 +0000
+++ generic-boot.expect 2014-02-07 20:43:02 +0000
@@ -0,0 +1,16 @@
1#!/usr/bin/expect -f
2
3set timeout 1600
4spawn pk console $argv
5expect {
6 timeout {send_user "timed out\n"; exit 1}
7# "Uncompressing Linux" {exit 99}
8# "Detecting network hardwar" {exit 0}
9 "Oops" {exit 2}
10 "panic occurred" {exit 6}
11 "Kernel panic" {sleep 60; exit 7}
12 "Press enter to continue" {exit 5}
13# "Prompt: '?' for help>" as well as "Prompt: '?' for help, default=1>"
14 "Prompt: '?' for help" {exit 8}
15 "login:" {exit 0}
16}
017
=== added file 'generic-install.expect'
--- generic-install.expect 1970-01-01 00:00:00 +0000
+++ generic-install.expect 2014-02-07 20:43:02 +0000
@@ -0,0 +1,23 @@
1#!/usr/bin/expect -f
2
3set timeout 1900
4spawn pk console $argv
5expect {
6 "ERROR: Debootstrap warning" {exit 75}
7 "You have not selected any partitions for use as swap space." {exit 75}
8 "Could not stat device" {exit 75}
9 "No root file system is defined." {exit 75}
10 "ERROR: Installation step failed" {exit 75}
11 timeout {send_user "timed out\n"; exit 1}
12 "Error parsing config file" {exit 4}
13# "Uncompressing Linux" {exit 99}
14# "Detecting network hardwar" {exit 0}
15 "Oops" {exit 2}
16 "panic occurred" {exit 6}
17 "Kernel panic" {sleep 60; exit 7}
18 "The debootstrap program exited with an error (return value 1)" {exit 3}
19 "Press enter to continue" {exit 5}
20# "Prompt: '?' for help>" as well as "Prompt: '?' for help, default=1>"
21 "Prompt: '?' for help" {exit 8}
22 "Restarting system." {exit 0}
23}
024
=== modified file 'generic.expect'
--- generic.expect 2012-04-03 14:30:44 +0000
+++ generic.expect 2014-02-07 20:43:02 +0000
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f1#!/usr/bin/expect -f
22
3set timeout 16003set timeout 3200
4spawn pk console $argv4spawn pk console $argv
5expect {5expect {
6 "ERROR: Debootstrap warning" {exit 75}6 "ERROR: Debootstrap warning" {exit 75}
77
=== added file 'pandakit.rtupdate'
--- pandakit.rtupdate 1970-01-01 00:00:00 +0000
+++ pandakit.rtupdate 2014-02-07 20:43:02 +0000
@@ -0,0 +1,6 @@
1#! /bin/sh
2set -e
3if [ "$1" = rtupdate ]; then
4 pyclean -p pandakit /usr/lib/pandakit
5 pycompile -p pandakit -V 2.7- /usr/lib/pandakit
6fi
0\ No newline at end of file7\ No newline at end of file
18
=== modified file 'pandakit/ipmi.py'
--- pandakit/ipmi.py 2012-05-19 00:14:47 +0000
+++ pandakit/ipmi.py 2014-02-07 20:43:02 +0000
@@ -13,6 +13,29 @@
13 bmc = machine['bmc']13 bmc = machine['bmc']
14 return bmc['ip_address']14 return bmc['ip_address']
1515
16def get_bmc_user(machine_name):
17 machines = config.get_config()['machines']
18 machine = machines[machine_name]
19 bmc = machine['bmc']
20 return bmc['username']
21
22def get_bmc_pwd(machine_name):
23 machines = config.get_config()['machines']
24 machine = machines[machine_name]
25 bmc = machine['bmc']
26 return bmc['password']
27
28def get_bmc_intf(machine_name):
29 machines = config.get_config()['machines']
30 machine = machines[machine_name]
31 bmc = machine['bmc']
32 try:
33 return bmc['intf']
34 except KeyError:
35 return 'lan'
36 else:
37 return bmc['intf']
38
16def has_bmc(machine_name):39def has_bmc(machine_name):
17 try:40 try:
18 get_bmc_ip(machine_name)41 get_bmc_ip(machine_name)
@@ -23,11 +46,16 @@
2346
24def sol(machine_name):47def sol(machine_name):
25 bmc_ip = get_bmc_ip(machine_name)48 bmc_ip = get_bmc_ip(machine_name)
26 os.execlp('socat', 'socat', '-,echo=0,raw', 'EXEC:ipmitool -H %s -U admin -P admin -I lanplus sol activate,pty' % bmc_ip)49 bmc_user = get_bmc_user(machine_name)
50 bmc_pwd = get_bmc_pwd(machine_name)
51 os.execlp('socat', 'socat', '-,echo=0,raw', 'EXEC:ipmitool -H %s -U %s -P %s -I lanplus sol activate,pty' % (bmc_ip, bmc_user, bmc_pwd) )
2752
28def ipmi(machine_name, *args):53def ipmi(machine_name, *args):
29 bmc_ip = get_bmc_ip(machine_name)54 bmc_ip = get_bmc_ip(machine_name)
30 cmd = ['ipmitool', '-H', bmc_ip, '-U', 'admin', '-P', 'admin']55 bmc_user = get_bmc_user(machine_name)
56 bmc_pwd = get_bmc_pwd(machine_name)
57 bmc_intf = get_bmc_intf(machine_name)
58 cmd = ['ipmitool', '-H', bmc_ip, '-U', bmc_user, '-P', bmc_pwd, '-I', bmc_intf]
31 cmd.extend(args)59 cmd.extend(args)
32 subprocess.check_call(cmd, close_fds=True)60 subprocess.check_call(cmd, close_fds=True)
33 time.sleep(3)61 time.sleep(3)
3462
=== modified file 'pandakit/pk.py'
--- pandakit/pk.py 2013-09-23 13:54:30 +0000
+++ pandakit/pk.py 2014-02-07 20:43:02 +0000
@@ -18,9 +18,9 @@
18 for hostname in hostnames:18 for hostname in hostnames:
19 machine_definition = local_config['machines'][hostname]19 machine_definition = local_config['machines'][hostname]
20 if 'bmc' in machine_definition:20 if 'bmc' in machine_definition:
21 if 'raw' in machine_definition:21 try:
22 pandakit.ipmi.main(hostname, machine_definition['bmc']['raw'][state])22 pandakit.ipmi.main(hostname, *machine_definition['bmc'][state + '-cmd'].split())
23 else:23 except KeyError:
24 pandakit.ipmi.main(hostname, 'power', state)24 pandakit.ipmi.main(hostname, 'power', state)
25 elif 'relay' in machine_definition:25 elif 'relay' in machine_definition:
26 relay_name = machine_definition['relay']['name']26 relay_name = machine_definition['relay']['name']
@@ -41,6 +41,11 @@
41 relay_index = local_config['machines'][hostname]['relay']['index']41 relay_index = local_config['machines'][hostname]['relay']['index']
42 state_code = { 'on': 1, 'off': 2, 'reset': 3 }[state]42 state_code = { 'on': 1, 'off': 2, 'reset': 3 }[state]
43 subprocess.check_call('snmpset -c private -v1 %s .1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.%d i %d >/dev/null' % (host, relay_index, state_code), shell=True)43 subprocess.check_call('snmpset -c private -v1 %s .1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.%d i %d >/dev/null' % (host, relay_index, state_code), shell=True)
44 elif relay['driver'] == 'sentrysnmp':
45 host = relay['host']
46 relay_index = local_config['machines'][hostname]['relay']['index']
47 state_code = { 'on': 1, 'off': 2, 'reset': 3 }[state]
48 subprocess.check_call('snmpset -c private -v1 %s .1.3.6.1.4.1.1718.3.2.3.1.11.1.1.%d i %d >/dev/null' % (host, relay_index, state_code), shell=True)
44 else:49 else:
45 print "Power cycle %s and press enter" % hostname50 print "Power cycle %s and press enter" % hostname
46 raw_input()51 raw_input()
4752
=== modified file 'pandakit/toecap.py'
--- pandakit/toecap.py 2012-07-04 15:10:26 +0000
+++ pandakit/toecap.py 2014-02-07 20:43:02 +0000
@@ -32,8 +32,6 @@
32except:32except:
33 HOME = os.getenv('HOME')33 HOME = os.getenv('HOME')
3434
35SSH_KNOWN_HOSTS_FILE = os.path.join(HOME, '.ssh', 'known_hosts')
36SSH_ID_RSA_PUB_FILE = os.path.join(HOME, '.ssh', 'id_rsa.pub')
37USBBOOT_DEVPATH_DIR = '/var/run/pandakit/usbboot'35USBBOOT_DEVPATH_DIR = '/var/run/pandakit/usbboot'
38COBBLER_LOCK = '/var/run/pandakit/cobbler'36COBBLER_LOCK = '/var/run/pandakit/cobbler'
39COBBLER_LOCK_DIR = os.path.dirname(COBBLER_LOCK)37COBBLER_LOCK_DIR = os.path.dirname(COBBLER_LOCK)
@@ -167,7 +165,7 @@
167 return 'console' in config.get_config()['machines'][hostname]165 return 'console' in config.get_config()['machines'][hostname]
168166
169167
170def do_boot(args):168def do_install(args):
171 if args.ip_address:169 if args.ip_address:
172 sudo_user = os.getenv('SUDO_USER')170 sudo_user = os.getenv('SUDO_USER')
173 if sudo_user:171 if sudo_user:
@@ -183,10 +181,10 @@
183 if ipmi.has_bmc(args.hostname):181 if ipmi.has_bmc(args.hostname):
184 ipmi.main(args.hostname, 'chassis', 'bootdev', 'pxe')182 ipmi.main(args.hostname, 'chassis', 'bootdev', 'pxe')
185183
186 if args.monitor and has_console(args.hostname):184 if args.install_monitor and has_console(args.hostname):
187 # Start the monitor before resetting the board, so that it doesn't185 # Start the monitor before resetting the board, so that it doesn't
188 # miss anything from the moment the board powers on.186 # miss anything from the moment the board powers on.
189 monitor = subprocess.Popen([args.monitor, args.hostname])187 monitor = subprocess.Popen([args.install_monitor, args.hostname])
190 subprocess.check_call(['pk', 'power', 'on', args.hostname])188 subprocess.check_call(['pk', 'power', 'on', args.hostname])
191 exit_status = monitor.wait()189 exit_status = monitor.wait()
192 return exit_status190 return exit_status
@@ -196,6 +194,12 @@
196 raw_input()194 raw_input()
197 return 0195 return 0
198196
197def boot_monitor(args):
198 if args.boot_monitor and has_console(args.hostname):
199 monitor = subprocess.Popen([args.boot_monitor, args.hostname])
200 exit_status = monitor.wait()
201 return exit_status
202
199203
200def assign_defaults(args):204def assign_defaults(args):
201 local_setup = config.get_config()205 local_setup = config.get_config()
@@ -211,7 +215,8 @@
211 keywords_to_apply = itertools.chain(default['default_keywords'],215 keywords_to_apply = itertools.chain(default['default_keywords'],
212 machine_keywords,216 machine_keywords,
213 args.keywords)217 args.keywords)
214 settings_to_apply = ['kernel', 'initrd', 'preseed', 'kopts', 'monitor']218 settings_to_apply = ['kernel', 'initrd', 'preseed', 'kopts',
219 'boot_monitor', 'install_monitor']
215220
216 for keyword in keywords_to_apply:221 for keyword in keywords_to_apply:
217 keyword_assignments.update(default['keyword_map'][keyword])222 keyword_assignments.update(default['keyword_map'][keyword])
@@ -248,6 +253,7 @@
248 pass253 pass
249254
250 if 'ssh_key' not in os.environ:255 if 'ssh_key' not in os.environ:
256 SSH_ID_RSA_PUB_FILE = os.path.join(HOME, '.ssh', 'id_rsa.pub')
251 try:257 try:
252 f = open(SSH_ID_RSA_PUB_FILE, 'r')258 f = open(SSH_ID_RSA_PUB_FILE, 'r')
253 except IOError, e:259 except IOError, e:
@@ -266,7 +272,8 @@
266 parser.add_argument('--initrd')272 parser.add_argument('--initrd')
267 parser.add_argument('--preseed')273 parser.add_argument('--preseed')
268 parser.add_argument('--kopts')274 parser.add_argument('--kopts')
269 parser.add_argument('--monitor')275 parser.add_argument('--boot-monitor')
276 parser.add_argument('--install-monitor')
270 parser.add_argument('--ip-address')277 parser.add_argument('--ip-address')
271 parser.add_argument('--usb-spl')278 parser.add_argument('--usb-spl')
272 parser.add_argument('--tries', type=int, default=1)279 parser.add_argument('--tries', type=int, default=1)
@@ -319,7 +326,7 @@
319 print "Removing temporary cobbler config"326 print "Removing temporary cobbler config"
320 cobbler_teardown(*context)327 cobbler_teardown(*context)
321 teardown_functions.append(teardown_cobbler)328 teardown_functions.append(teardown_cobbler)
322 329
323 if args.usb_spl:330 if args.usb_spl:
324 mkdir_p(USBBOOT_DEVPATH_DIR)331 mkdir_p(USBBOOT_DEVPATH_DIR)
325 usbboot_devpath = os.path.join(USBBOOT_DEVPATH_DIR, args.usb_spl)332 usbboot_devpath = os.path.join(USBBOOT_DEVPATH_DIR, args.usb_spl)
@@ -328,7 +335,7 @@
328 os.unlink(usbboot_devpath)335 os.unlink(usbboot_devpath)
329 teardown_functions.append(teardown_usb_spl)336 teardown_functions.append(teardown_usb_spl)
330337
331 exit_status = do_boot(args)338 exit_status = do_install(args)
332339
333 finally:340 finally:
334 for f in teardown_functions:341 for f in teardown_functions:
@@ -336,16 +343,27 @@
336343
337 # Exit if the monitor reported a problem344 # Exit if the monitor reported a problem
338 if exit_status:345 if exit_status:
339 print >>sys.stderr, 'Monitor returned status %d' % exit_status346 print >>sys.stderr, 'Install Monitor returned status %d' % exit_status
347 return exit_status
348
349 exit_status = boot_monitor(args)
350 # Exit if the monitor reported a problem
351 if exit_status:
352 print >>sys.stderr, 'Boot Monitor returned status %d' % exit_status
340 return exit_status353 return exit_status
341354
342 if args.ip_address:355 if args.ip_address:
356 SSH_KNOWN_HOSTS_FILE = os.path.join(HOME, '.ssh', 'known_hosts')
343 keyscan = subprocess.Popen(['ssh-keyscan', args.ip_address],357 keyscan = subprocess.Popen(['ssh-keyscan', args.ip_address],
344 stdout=subprocess.PIPE)358 stdout=subprocess.PIPE)
345 keyscan_output = keyscan.communicate()[0]359 keyscan_output = keyscan.communicate()[0]
346 if keyscan.returncode:360 if keyscan.returncode:
347 sys.exit(keyscan.returncode)361 sys.exit(keyscan.returncode)
348 with open(SSH_KNOWN_HOSTS_FILE, 'a') as f:362 if os.path.exists(SSH_KNOWN_HOSTS_FILE):
363 fmode = 'a'
364 else:
365 fmode = 'w'
366 with open(SSH_KNOWN_HOSTS_FILE, fmode) as f:
349 f.write(keyscan_output)367 f.write(keyscan_output)
350368
351 return 0369 return 0
352370
=== added file 'preseed.amd64'
--- preseed.amd64 1970-01-01 00:00:00 +0000
+++ preseed.amd64 2014-02-07 20:43:02 +0000
@@ -0,0 +1,69 @@
1d-i anna/choose_modules string network-console parted-udeb
2d-i network-console/password password ubuntu
3d-i network-console/password-again password ubuntu
4d-i network-console/start note
5d-i clock-setup/ntp boolean true
6d-i clock-setup/ntp-server string ntp.ubuntu.com
7d-i clock-setup/utc-auto boolean true
8d-i console-setup/ask_detect boolean false
9d-i debian-installer/exit/restart boolean true
10d-i finish-install/reboot_in_progress note
11d-i pkgsel/upgrade select full-upgrade
12d-i pkgsel/update-policy select none
13d-i pkgsel/updatedb boolean false
14d-i netcfg/get_hostname string unassigned-hostname
15d-i netcfg/get_domain string unassigned-domain
16d-i partman-auto/disk string /dev/sda
17d-i partman-auto/method string regular
18d-i partman-auto/purge_lvm_from_device boolean true
19d-i partman-lvm/device_remove_lvm boolean true
20d-i partman-md/device_remove_md boolean true
21d-i partman-auto/expert_recipe string \
22 boot-root :: \
23 256 256 256 ext3 \
24 $primary{{ }} $bootable{{ }} \
25 method{{ format }} format{{ }} \
26 use_filesystem{{ }} filesystem{{ ext3 }} \
27 mountpoint{{ /boot }} \
28 . \
29 100000 100000 100000 ext4 \
30 $primary{{ }} \
31 method{{ format }} format{{ }} \
32 use_filesystem{{ }} filesystem{{ ext4 }} \
33 mountpoint{{ / }} \
34 . \
35 1100 1100 1100 linux-swap \
36 method{{ swap }} format{{ }} \
37 . \
38 20000 20000 20000 ext4 \
39 method{{ format }} format{{ }} \
40 use_filesystem{{ }} filesystem{{ ext4 }} \
41 label{{ TEST }} \
42 mountpoint{{ /test }} \
43 . \
44 100 100 100 ext4 \
45 method{{ format }} format{{ }} \
46 use_filesystem{{ }} filesystem{{ ext4 }} \
47 label{{ DELETEME }} \
48 mountpoint{{ /tmp/deleteme }} \
49 .
50d-i partman-partitioning/confirm_write_new_label boolean true
51d-i partman/choose_partition select finish
52d-i partman/confirm boolean true
53d-i partman/confirm_nooverwrite boolean true
54d-i partman/mount_style select traditional
55d-i passwd/user-fullname string Ubuntu
56d-i passwd/user-password-crypted password $6$.1eHH0iY$ArGzKX2YeQ3G6U.mlOO3A.NaL22Ewgz8Fi4qqz.Ns7EMKjEJRIW2Pm/TikDptZpuu7I92frytmk5YeL.9fRY4.
57d-i passwd/username string ubuntu
58d-i user-setup/allow-password-weak boolean true
59d-i base-installer/kernel/override-image string linux-server
60d-i debian-installer/splash boolean false
61d-i pkgsel/install-language-support boolean false
62d-i pkgsel/language-pack-patterns string
63d-i pkgsel/include string openssh-server
64d-i mirror/country string manual
65d-i mirror/http/hostname string archive.ubuntu.com
66d-i mirror/http/directory string /ubuntu
67d-i mirror/http/proxy string {http_proxy}
68d-i debian-installer/locale string C
69d-i preseed/late_command string echo "ubuntu ALL=(ALL) NOPASSWD: ALL" > /target/etc/sudoers.d/pandakit; chmod 0440 /target/etc/sudoers.d/pandakit; mkdir -m700 -p /target/root/.ssh; echo {ssh_key} > /target/root/.ssh/authorized_keys; echo http_proxy={http_proxy} >> /target/etc/environment; mkdir -m700 -p /target/home/ubuntu/.ssh; cp /target/root/.ssh/authorized_keys /target/home/ubuntu/.ssh/; in-target chown -R ubuntu. /home/ubuntu/.ssh; umount -f `mount | grep deleteme | cut -f 1 -d " "`; parted /dev/sda rm `grep deleteme /target/etc/fstab | cut -f 1 -d " " | cut -f 2 -d "a"`; sed -i "/deleteme/d" /target/etc/fstab
070
=== modified file 'preseed.arm'
--- preseed.arm 2012-07-04 14:00:28 +0000
+++ preseed.arm 2014-02-07 20:43:02 +0000
@@ -1,3 +1,7 @@
1d-i anna/choose_modules string network-console parted-udeb
2d-i network-console/password password ubuntu
3d-i network-console/password-again password ubuntu
4d-i network-console/start note
1d-i clock-setup/ntp boolean true5d-i clock-setup/ntp boolean true
2d-i clock-setup/ntp-server string ntp.ubuntu.com6d-i clock-setup/ntp-server string ntp.ubuntu.com
3d-i clock-setup/utc-auto boolean true7d-i clock-setup/utc-auto boolean true
@@ -16,26 +20,32 @@
16d-i partman-md/device_remove_md boolean true20d-i partman-md/device_remove_md boolean true
17d-i partman-auto/expert_recipe string \21d-i partman-auto/expert_recipe string \
18 boot-root :: \22 boot-root :: \
19 256 256 256 ext4 \23 256 256 256 ext3 \
20 $primary{{ }} $bootable{{ }} \24 $primary{{ }} $bootable{{ }} \
21 method{{ format }} format{{ }} \25 method{{ format }} format{{ }} \
22 use_filesystem{{ }} filesystem{{ ext4 }} \26 use_filesystem{{ }} filesystem{{ ext3 }} \
23 mountpoint{{ /boot }} \27 mountpoint{{ /boot }} \
24 . \28 . \
25 4000 10000 20000 ext4 \29 100000 100000 100000 ext4 \
26 $primary{{ }} \30 $primary{{ }} \
27 method{{ format }} format{{ }} \31 method{{ format }} format{{ }} \
28 use_filesystem{{ }} filesystem{{ ext4 }} \32 use_filesystem{{ }} filesystem{{ ext4 }} \
29 mountpoint{{ / }} \33 mountpoint{{ / }} \
30 . \34 . \
31 1100 1100 1100 linux-swap \35 1100 1100 1100 linux-swap \
32 method{{ swap }} format{{ }} \36 method{{ swap }} format{{ }} \
33 . \37 . \
34 500 10000 1000000 ext4 \38 20000 20000 20000 ext4 \
35 method{{ format }} format{{ }} \39 method{{ format }} format{{ }} \
36 use_filesystem{{ }} filesystem{{ ext4 }} \40 use_filesystem{{ }} filesystem{{ ext4 }} \
37 label{{ TEST }} \41 label{{ TEST }} \
38 mountpoint{{ /test }} \42 mountpoint{{ /test }} \
43 . \
44 100 100 100 ext4 \
45 method{{ format }} format{{ }} \
46 use_filesystem{{ }} filesystem{{ ext4 }} \
47 label{{ DELETEME }} \
48 mountpoint{{ /tmp/deleteme }} \
39 .49 .
40d-i partman-partitioning/confirm_write_new_label boolean true50d-i partman-partitioning/confirm_write_new_label boolean true
41d-i partman/choose_partition select finish51d-i partman/choose_partition select finish
@@ -56,4 +66,4 @@
56d-i mirror/http/directory string /ubuntu-ports66d-i mirror/http/directory string /ubuntu-ports
57d-i mirror/http/proxy string {http_proxy}67d-i mirror/http/proxy string {http_proxy}
58d-i debian-installer/locale string C68d-i debian-installer/locale string C
59d-i preseed/late_command string echo "ubuntu ALL=(ALL) NOPASSWD: ALL" > /target/etc/sudoers.d/pandakit; chmod 0440 /target/etc/sudoers.d/pandakit; mkdir -m700 -p /target/root/.ssh; echo {ssh_key} > /target/root/.ssh/authorized_keys; echo http_proxy={http_proxy} >> /target/etc/environment; mkdir -m700 -p /target/home/ubuntu/.ssh; cp /target/root/.ssh/authorized_keys /target/home/ubuntu/.ssh/; in-target chown -R ubuntu. /home/ubuntu/.ssh69d-i preseed/late_command string echo "ubuntu ALL=(ALL) NOPASSWD: ALL" > /target/etc/sudoers.d/pandakit; chmod 0440 /target/etc/sudoers.d/pandakit; mkdir -m700 -p /target/root/.ssh; echo {ssh_key} > /target/root/.ssh/authorized_keys; echo http_proxy={http_proxy} >> /target/etc/environment; mkdir -m700 -p /target/home/ubuntu/.ssh; cp /target/root/.ssh/authorized_keys /target/home/ubuntu/.ssh/; in-target chown -R ubuntu. /home/ubuntu/.ssh; umount -f `mount | grep deleteme | cut -f 1 -d " "`; parted /dev/sda rm `grep deleteme /target/etc/fstab | cut -f 1 -d " " | cut -f 2 -d "a"`; sed -i "/deleteme/d" /target/etc/fstab
6070
=== added file 'preseed.ml'
--- preseed.ml 1970-01-01 00:00:00 +0000
+++ preseed.ml 2014-02-07 20:43:02 +0000
@@ -0,0 +1,65 @@
1d-i anna/choose_modules string network-console parted-udeb
2d-i network-console/password password ubuntu
3d-i network-console/password-again password ubuntu
4d-i network-console/start note
5d-i clock-setup/ntp boolean true
6d-i clock-setup/ntp-server string ntp.ubuntu.com
7d-i clock-setup/utc-auto boolean true
8d-i console-setup/ask_detect boolean false
9d-i debian-installer/exit/restart boolean true
10d-i finish-install/reboot_in_progress note
11d-i pkgsel/upgrade select full-upgrade
12d-i pkgsel/update-policy select none
13d-i pkgsel/updatedb boolean false
14d-i netcfg/get_hostname string unassigned-hostname
15d-i netcfg/get_domain string unassigned-domain
16d-i partman-auto/disk string /dev/sda
17d-i partman-auto/method string regular
18d-i partman-auto/purge_lvm_from_device boolean true
19d-i partman-lvm/device_remove_lvm boolean true
20d-i partman-md/device_remove_md boolean true
21d-i partman-auto/expert_recipe string \
22 boot-root :: \
23 256 256 256 ext3 \
24 $primary{{ }} $bootable{{ }} \
25 method{{ format }} format{{ }} \
26 use_filesystem{{ }} filesystem{{ ext3 }} \
27 mountpoint{{ /boot }} \
28 . \
29 100000 100000 100000 ext4 \
30 $primary{{ }} \
31 method{{ format }} format{{ }} \
32 use_filesystem{{ }} filesystem{{ ext4 }} \
33 mountpoint{{ / }} \
34 . \
35 1100 1100 1100 linux-swap \
36 method{{ swap }} format{{ }} \
37 . \
38 20000 20000 20000 ext4 \
39 method{{ format }} format{{ }} \
40 use_filesystem{{ }} filesystem{{ ext4 }} \
41 label{{ TEST }} \
42 mountpoint{{ /test }} \
43 . \
44 100 100 100 ext4 \
45 method{{ format }} format{{ }} \
46 use_filesystem{{ }} filesystem{{ ext4 }} \
47 label{{ DELETEME }} \
48 mountpoint{{ /tmp/deleteme }} \
49 .
50d-i partman-partitioning/confirm_write_new_label boolean true
51d-i partman/choose_partition select finish
52d-i partman/confirm boolean true
53d-i partman/confirm_nooverwrite boolean true
54d-i partman/mount_style select traditional
55d-i passwd/user-fullname string Ubuntu
56d-i passwd/user-password-crypted password $6$.1eHH0iY$ArGzKX2YeQ3G6U.mlOO3A.NaL22Ewgz8Fi4qqz.Ns7EMKjEJRIW2Pm/TikDptZpuu7I92frytmk5YeL.9fRY4.
57d-i passwd/username string ubuntu
58d-i user-setup/allow-password-weak boolean true
59d-i base-installer/kernel/override-image string linux-server
60d-i debian-installer/splash boolean false
61d-i pkgsel/install-language-support boolean false
62d-i pkgsel/language-pack-patterns string
63d-i pkgsel/include string openssh-server
64d-i debian-installer/locale string C
65d-i preseed/late_command string echo "ubuntu ALL=(ALL) NOPASSWD: ALL" > /target/etc/sudoers.d/pandakit; chmod 0440 /target/etc/sudoers.d/pandakit; mkdir -m700 -p /target/root/.ssh; echo {ssh_key} > /target/root/.ssh/authorized_keys; echo http_proxy={http_proxy} >> /target/etc/environment; mkdir -m700 -p /target/home/ubuntu/.ssh; cp /target/root/.ssh/authorized_keys /target/home/ubuntu/.ssh/; in-target chown -R ubuntu. /home/ubuntu/.ssh; umount -f `mount | grep deleteme | cut -f 1 -d " "`; parted /dev/sda rm `grep deleteme /target/etc/fstab | cut -f 1 -d " " | cut -f 2 -d "a"`; sed -i "/deleteme/d" /target/etc/fstab
066
=== added file 'preseed.remote'
--- preseed.remote 1970-01-01 00:00:00 +0000
+++ preseed.remote 2014-02-07 20:43:02 +0000
@@ -0,0 +1,28 @@
1d-i clock-setup/ntp boolean true
2d-i clock-setup/ntp-server string ntp.ubuntu.com
3d-i clock-setup/utc-auto boolean true
4d-i console-setup/ask_detect boolean false
5d-i pkgsel/upgrade select full-upgrade
6d-i pkgsel/update-policy select none
7d-i pkgsel/updatedb boolean false
8d-i netcfg/get_hostname string unassigned-hostname
9d-i netcfg/get_domain string unassigned-domain
10d-i anna/choose_modules string network-console
11d-i network-console/password password uinst
12d-i network-console/password-again password uinst
13d-i passwd/user-fullname string Ubuntu
14d-i passwd/user-password-crypted password $6$.1eHH0iY$ArGzKX2YeQ3G6U.mlOO3A.NaL22Ewgz8Fi4qqz.Ns7EMKjEJRIW2Pm/TikDptZpuu7I92frytmk5YeL.9fRY4.
15d-i passwd/username string ubuntu
16d-i user-setup/allow-password-weak boolean true
17d-i base-installer/kernel/override-image string linux-server
18d-i debian-installer/splash boolean false
19d-i pkgsel/install-language-support boolean false
20d-i pkgsel/language-pack-patterns string
21d-i pkgsel/include string openssh-server
22d-i mirror/country string manual
23d-i mirror/http/hostname string ports.ubuntu.com
24d-i mirror/http/directory string /ubuntu-ports
25d-i mirror/http/proxy string {http_proxy}
26d-i mirror/suite string precise
27d-i debian-installer/locale string C
28d-i preseed/late_command string echo "ubuntu ALL=(ALL) NOPASSWD: ALL" > /target/etc/sudoers.d/pandakit; chmod 0440 /target/etc/sudoers.d/pandakit; mkdir -m700 -p /target/root/.ssh; echo {ssh_key} > /target/root/.ssh/authorized_keys; echo http_proxy={http_proxy} >> /target/etc/environment; mkdir -m700 -p /target/home/ubuntu/.ssh; cp /target/root/.ssh/authorized_keys /target/home/ubuntu/.ssh/; in-target chown -R ubuntu. /home/ubuntu/.ssh

Subscribers

People subscribed via source and target branches

to all changes: