summaryrefslogtreecommitdiffstats
path: root/patches/fuel-library/multiarch-efi/0001-Add-arm64-templates-to-cobbler-and-nailgun.patch
blob: bf5db54e6c9f8e0f5c225ac7ef4526047e196fbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
From: Stanislaw Kardach <stanislaw.kardach@cavium.com>
Date: Sun, 21 Feb 2016 16:29:52 +0100
Subject: [PATCH] Add arm64 templates to cobbler and nailgun

Add grub template import to cobbler server manifest

Add arm64 templates to cobbler and nailgun

[ Matei Valeanu ]
Add grub template to cobbler for MAC-files
Limitation: grub2 needs to be installed directly on the
root (/) of a device or partition, as the MAC-files will
search for /grub/grub.cfg on the available partitions

[ Alexandru Avadanii ]
Rebased for Fuel Newton after upstream change:
"Remove deprecated cobbler parts for classic provisioning" [1].

[1] https://github.com/openstack/fuel-library/commit/
    e207593d7b3234cfbde6689dbccdcafe6ba67e58

Signed-off-by: Stanislaw Kardach <stanislaw.kardach@cavium.com>
Signed-off-by: Matei Valeanu <Matei.Valeanu@enea.com>
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
 deployment/puppet/cobbler/manifests/server.pp      | 36 ++++++++++++++++++++++
 .../puppet/cobbler/templates/dnsmasq.template.erb  |  2 ++
 .../cobbler/templates/efidefault.template.erb      |  5 +++
 .../cobbler/templates/grublocal.template.erb       |  2 ++
 .../cobbler/templates/grubprofile.template.erb     | 12 ++++++++
 .../cobbler/templates/grubsystem.template.erb      | 16 ++++++++++
 deployment/puppet/fuel/manifests/auxiliaryrepos.pp | 12 +++++---
 deployment/puppet/fuel/manifests/cobbler.pp        | 36 +++++++++++++++++-----
 10 files changed, 125 insertions(+), 11 deletions(-)
 create mode 100644 deployment/puppet/cobbler/templates/efidefault.template.erb
 create mode 100644 deployment/puppet/cobbler/templates/grublocal.template.erb
 create mode 100644 deployment/puppet/cobbler/templates/grubprofile.template.erb
 create mode 100644 deployment/puppet/cobbler/templates/grubsystem.template.erb

diff --git a/deployment/puppet/cobbler/manifests/server.pp b/deployment/puppet/cobbler/manifests/server.pp
index 891dff7..52936d5 100644
--- a/deployment/puppet/cobbler/manifests/server.pp
+++ b/deployment/puppet/cobbler/manifests/server.pp
@@ -297,6 +297,42 @@ class cobbler::server (
     notify  => [Service[$cobbler_service], Exec['cobbler_sync']],
   }

+  file { '/etc/cobbler/pxe/efidefault.template':
+    content => template('cobbler/efidefault.template.erb'),
+    owner   => 'root',
+    group   => 'root',
+    mode    => '0644',
+    require => Package[$cobbler::packages::cobbler_package],
+    notify  => [Service[$cobbler_service], Exec['cobbler_sync']],
+  }
+
+  file { '/etc/cobbler/pxe/grubprofile.template':
+    content => template('cobbler/grubprofile.template.erb'),
+    owner   => 'root',
+    group   => 'root',
+    mode    => '0644',
+    require => Package[$cobbler::packages::cobbler_package],
+    notify  => [Service[$cobbler_service], Exec['cobbler_sync']],
+  }
+
+  file { '/etc/cobbler/pxe/grubsystem.template':
+    content => template('cobbler/grubsystem.template.erb'),
+    owner   => 'root',
+    group   => 'root',
+    mode    => '0644',
+    require => Package[$cobbler::packages::cobbler_package],
+    notify  => [Service[$cobbler_service], Exec['cobbler_sync']],
+  }
+
+  file { '/etc/cobbler/pxe/grublocal.template':
+    content => template('cobbler/grublocal.template.erb'),
+    owner   => 'root',
+    group   => 'root',
+    mode    => '0644',
+    require => Package[$cobbler::packages::cobbler_package],
+    notify  => [Service[$cobbler_service], Exec['cobbler_sync']],
+  }
+
   exec { '/var/lib/tftpboot/chain.c32':
     command => 'cp /usr/share/syslinux/chain.c32 /var/lib/tftpboot/chain.c32',
     unless  => 'test -e /var/lib/tftpboot/chain.c32',
diff --git a/deployment/puppet/cobbler/templates/dnsmasq.template.erb b/deployment/puppet/cobbler/templates/dnsmasq.template.erb
index d70f8de..98278e9 100644
--- a/deployment/puppet/cobbler/templates/dnsmasq.template.erb
+++ b/deployment/puppet/cobbler/templates/dnsmasq.template.erb
@@ -41,5 +41,7 @@ dhcp-no-override
 # by assigning IPs one by one instead of using hash algorithm.
 dhcp-sequential-ip

+dhcp-match=set:arm64,93,11
+dhcp-boot=net:arm64,grub/grub-aarch64.efi,boothost,<%= @next_server %>
 dhcp-option=6,<%= @name_server %>
 $insert_cobbler_system_definitions
diff --git a/deployment/puppet/cobbler/templates/efidefault.template.erb b/deployment/puppet/cobbler/templates/efidefault.template.erb
new file mode 100644
index 0000000..af09eb8
--- /dev/null
+++ b/deployment/puppet/cobbler/templates/efidefault.template.erb
@@ -0,0 +1,5 @@
+set default=1
+set timeout=5
+tr -s ipxe_mac ':' '-' $net_default_mac
+
+$grub_menu_items
diff --git a/deployment/puppet/cobbler/templates/grublocal.template.erb b/deployment/puppet/cobbler/templates/grublocal.template.erb
new file mode 100644
index 0000000..e16c27d
--- /dev/null
+++ b/deployment/puppet/cobbler/templates/grublocal.template.erb
@@ -0,0 +1,2 @@
+search --file --no-floppy --set grub_install_device /grub/grub.cfg
+configfile ($grub_install_device)/grub/grub.cfg
diff --git a/deployment/puppet/cobbler/templates/grubprofile.template.erb b/deployment/puppet/cobbler/templates/grubprofile.template.erb
new file mode 100644
index 0000000..eb7557c
--- /dev/null
+++ b/deployment/puppet/cobbler/templates/grubprofile.template.erb
@@ -0,0 +1,12 @@
+menuentry '$profile_name' {
+    echo 'Network status:'
+    net_ls_cards
+    net_ls_addr
+    net_ls_routes
+
+    echo 'Loading Linux ...'
+    linux (tftp)$kernel_path $kernel_options BOOTIF=01-$ipxe_mac
+    echo 'Loading initial ramdisk ...'
+    initrd (tftp)$initrd_path
+    echo 'Booting bootstrap image ...'
+}
diff --git a/deployment/puppet/cobbler/templates/grubsystem.template.erb b/deployment/puppet/cobbler/templates/grubsystem.template.erb
new file mode 100644
index 0000000..9a191bc
--- /dev/null
+++ b/deployment/puppet/cobbler/templates/grubsystem.template.erb
@@ -0,0 +1,16 @@
+set default=1
+set timeout=5
+tr -s ipxe_mac ':' '-' $net_default_mac
+
+menuentry '$profile_name' {
+    echo 'Network status:'
+    net_ls_cards
+    net_ls_addr
+    net_ls_routes
+
+    echo 'Loading Linux ...'
+    linux (tftp)$kernel_path $kernel_options BOOTIF=01-$ipxe_mac
+    echo 'Loading initial ramdisk ...'
+    initrd (tftp)$initrd_path
+    echo 'Booting bootstrap image ...'
+}
diff --git a/deployment/puppet/fuel/manifests/auxiliaryrepos.pp b/deployment/puppet/fuel/manifests/auxiliaryrepos.pp
index 493ffc6..909fc92 100644
--- a/deployment/puppet/fuel/manifests/auxiliaryrepos.pp
+++ b/deployment/puppet/fuel/manifests/auxiliaryrepos.pp
@@ -53,17 +53,21 @@ class fuel::auxiliaryrepos(

   exec { 'create_ubuntu_repo_dirs':
     path    => '/bin:/sbin:/usr/bin:/usr/sbin',
-    command => "bash -c \"mkdir -p ${ubuntu_dir}/pool/{main,restricted} ${ubuntu_dir}/dists/auxiliary/{main,restricted}/binary-amd64/\"",
+    command => "bash -c \"mkdir -p ${ubuntu_dir}/pool/{main,restricted} ${ubuntu_dir}/dists/auxiliary/{main,restricted}/binary-{amd64,arm64}/\"",
     unless  => "test -d ${ubuntu_dir}/pool && \
       test -d ${ubuntu_dir}/dists/auxiliary/main/binary-amd64 && \
-      test -d ${ubuntu_dir}/dists/auxiliary/restricted/binary-amd64",
+      test -d ${ubuntu_dir}/dists/auxiliary/restricted/binary-amd64 && \
+      test -d ${ubuntu_dir}/dists/auxiliary/main/binary-arm64 && \
+      test -d ${ubuntu_dir}/dists/auxiliary/restricted/binary-arm64",
   }

   exec { 'create_ubuntu_repo_Packages':
     path    => '/bin:/sbin:/usr/bin:/usr/sbin',
-    command => "bash -c \"touch ${ubuntu_dir}/dists/auxiliary/{main,restricted}/binary-amd64/Packages\"",
+    command => "bash -c \"touch ${ubuntu_dir}/dists/auxiliary/{main,restricted}/binary-{amd64,arm64}/Packages\"",
     unless  => "test -f ${ubuntu_dir}/dists/auxiliary/main/binary-amd64/Packages && \
-      test -f ${ubuntu_dir}/dists/auxiliary/restricted/binary-amd64/Packages",
+      test -f ${ubuntu_dir}/dists/auxiliary/restricted/binary-amd64/Packages && \
+      test -f ${ubuntu_dir}/dists/auxiliary/main/binary-arm64/Packages && \
+      test -f ${ubuntu_dir}/dists/auxiliary/restricted/binary-arm64/Packages",
   }

   file { $release_files:
diff --git a/deployment/puppet/fuel/manifests/cobbler.pp b/deployment/puppet/fuel/manifests/cobbler.pp
index b403733..c89027d 100644
--- a/deployment/puppet/fuel/manifests/cobbler.pp
+++ b/deployment/puppet/fuel/manifests/cobbler.pp
@@ -166,7 +188,7 @@ class fuel::cobbler(
     distro    => 'ubuntu_bootstrap',
     menu      => true,
     kickstart => '',
-    kopts     => extend_kopts($bootstrap_meta['extend_kopts'], "console=ttyS0,9600 console=tty0 panic=60 ethdevice-timeout=${bootstrap_ethdevice_timeout} boot=live toram components fetch=http://${server}:8080/bootstraps/active_bootstrap/root.squashfs biosdevname=0 url=${nailgun_api_url} mco_user=${mco_user} mco_pass=${mco_pass} ip=frommedia"),
+    kopts     => extend_kopts($bootstrap_meta['extend_kopts'], "console=ttyAMA0,115200 console=ttyS0,115200 panic=60 ethdevice-timeout=${bootstrap_ethdevice_timeout} boot=live toram components fetch=http://${server}:8080/bootstraps/active_bootstrap/root.squashfs biosdevname=0 url=${nailgun_api_url} mco_user=${mco_user} mco_pass=${mco_pass} ip=frommedia"),
     ksmeta    => '',
     server    => $real_server,
     require   => Cobbler_distro['ubuntu_bootstrap'],