{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments/42719139","id":42719139,"diff_hunk":"@@ -55,95 +58,128 @@\n end\n \n # PXE config\n-[\"share\",\"lib\"].each do |d|\n-  next unless ::File.exists?(\"/usr/#{d}/syslinux/pxelinux.0\")\n-  bash \"Install pxelinux.0\" do\n-    code \"cp /usr/#{d}/syslinux/pxelinux.0 #{tftproot}/discovery/\"\n-    not_if \"cmp /usr/#{d}/syslinux/pxelinux.0 #{tftproot}/discovery/pxelinux.0\"\n+%w(x86_64).each do |arch|\n+  # Make it easy to totally disable/enable ppc64le\n+  next unless discovery_arches.include? arch\n+\n+  directory \"#{discovery_dir}/#{arch}/#{pxecfg_subdir}\" do\n+    recursive true\n+    mode 0755\n+    owner \"root\"\n+    group \"root\"\n+    action :create\n   end\n-  break\n-end\n \n-directory pxecfg_dir do\n-  recursive true\n-  mode 0755\n-  owner \"root\"\n-  group \"root\"\n-  action :create\n+  template \"#{discovery_dir}/#{arch}/#{pxecfg_subdir}/default\" do\n+    mode 0644\n+    owner \"root\"\n+    group \"root\"\n+    source \"default.erb\"\n+    variables(append_line: \"#{append_line} crowbar.state=discovery\",\n+              install_name: \"discovery\",\n+              initrd: \"../initrd0.img\",\n+              kernel: \"../vmlinuz0\")\n+  end\n end\n \n-template pxecfg_default do\n-  mode 0644\n-  owner \"root\"\n-  group \"root\"\n-  source \"default.erb\"\n-  variables(append_line: \"#{append_line} crowbar.state=discovery\",\n-            install_name: \"discovery\",\n-            initrd: \"initrd0.img\",\n-            kernel: \"vmlinuz0\")\n+if discovery_arches.include? \"x86_64\"\n+  package \"syslinux\"\n+\n+  [\"share\", \"lib\"].each do |d|\n+    next unless ::File.exists?(\"/usr/#{d}/syslinux/pxelinux.0\")\n+    bash \"Install pxelinux.0\" do\n+      code \"cp /usr/#{d}/syslinux/pxelinux.0 #{discovery_dir}/x86_64/#{pxe_subdir}/\"\n+      not_if \"cmp /usr/#{d}/syslinux/pxelinux.0 #{discovery_dir}/x86_64/#{pxe_subdir}/pxelinux.0\"\n+    end\n+    break\n+  end\n end\n \n # UEFI config\n use_elilo = true\n+%w(x86_64 ia32).each do |arch|\n+  # Make it easy to totally disable/enable architectures\n+  next unless discovery_arches.include? arch\n \n-if node[:platform_family] != \"suse\"\n-  bash \"Install elilo as UEFI netboot loader\" do\n-    code <<EOC\n-cd #{uefi_dir}\n-tar xzf '#{tftproot}/files/elilo-3.14-all.tar.gz'\n-mv elilo-3.14-x86_64.efi bootx64.efi\n-mv elilo-3.14-ia32.efi bootia32.efi\n-mv elilo-3.14-ia64.efi bootia64.efi\n-rm elilo*.efi elilo*.tar.gz || :\n-EOC\n-    not_if \"test -f '#{uefi_dir}/bootx64.efi'\"\n+  uefi_dir = \"#{discovery_dir}/#{arch}/#{uefi_subdir}\"\n+\n+  short_arch = arch\n+  if arch == \"x86_64\"\n+    short_arch = \"x64\"\n   end\n-else\n-  if node[:platform] == \"suse\" && node[:platform_version].to_f < 12.0\n-    package \"elilo\"\n \n-    bash \"Install bootx64.efi\" do\n-      code \"cp /usr/lib64/efi/elilo.efi #{uefi_dir}/bootx64.efi\"\n-      not_if \"cmp /usr/lib64/efi/elilo.efi #{uefi_dir}/bootx64.efi\"\n+  directory uefi_dir do\n+    recursive true\n+    mode 0755\n+    owner \"root\"\n+    group \"root\"\n+    action :create\n+  end\n+\n+  if node[:platform_family] != \"suse\"\n+    bash \"Install elilo as UEFI netboot loader\" do\n+      code <<EOC\n+  cd #{uefi_dir}\n+  tar xf '#{tftproot}/files/elilo-3.14-all.tar.gz' boot#{short_arch}.efi\n+EOC\n+      not_if \"test -f '#{uefi_dir}/boot#{short_arch}.efi'\"\n     end\n   else\n-    # we use grub2; steps taken from\n-    # https://github.com/openSUSE/kiwi/wiki/Setup-PXE-boot-with-EFI-using-grub2\n-    use_elilo = false\n+    if node[\"platform_version\"].to_f < 12.0\n+      package \"elilo\"\n+\n+      bash \"Install boot#{short_arch}.efi\" do\n+        code \"cp /usr/lib64/efi/elilo.efi #{uefi_dir}/boot#{short_arch}.efi\"\n+        not_if \"cmp /usr/lib64/efi/elilo.efi #{uefi_dir}/boot#{short_arch}.efi\"\n+      end\n+    else\n+      # we use grub2; steps taken from\n+      # https://github.com/openSUSE/kiwi/wiki/Setup-PXE-boot-with-EFI-using-grub2\n+      use_elilo = false\n+\n+      package \"grub2-#{arch}-efi\"\n+\n+      # grub.cfg has to be in boot/grub/ subdirectory\n+      directory \"#{uefi_dir}/default/boot/grub\" do\n+        recursive true\n+        mode 0755\n+        owner \"root\"\n+        group \"root\"\n+        action :create\n+      end\n+\n+      template \"#{uefi_dir}/default/boot/grub/grub.cfg\" do\n+        mode 0644\n+        owner \"root\"\n+        group \"root\"\n+        source \"grub.conf.erb\"\n+        variables(append_line: \"#{append_line} crowbar.state=discovery\",\n+                  install_name: \"Crowbar Discovery Image\",\n+                  admin_ip: admin_ip,\n+                  initrd: \"#{arch}/initrd0.img\",\n+                  kernel: \"#{arch}/vmlinuz0\")\n+      end\n \n-    package \"grub2-x86_64-efi\"\n+      bash \"Build UEFI netboot loader with grub\" do\n+        cwd \"#{uefi_dir}/default\"\n+        code \"grub2-mkstandalone -d /usr/lib/grub2/#{arch}-efi/ -O #{arch}-efi --fonts=\\\"unicode\\\" -o #{uefi_dir}/boot#{short_arch}.efi boot/grub/grub.cfg\"","path":"chef/cookbooks/provisioner/recipes/setup_base_images.rb","position":187,"original_position":187,"commit_id":"733f763662c0a0cd1bff12cb576005f6fc14a1ff","original_commit_id":"733f763662c0a0cd1bff12cb576005f6fc14a1ff","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Metrics/LineLength: Line is too long. [155/150] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)","created_at":"2015-10-22T07:43:32Z","updated_at":"2015-10-22T07:43:32Z","html_url":"https://github.com/crowbar/crowbar-core/pull/83#discussion_r42719139","pull_request_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/83","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments/42719139"},"html":{"href":"https://github.com/crowbar/crowbar-core/pull/83#discussion_r42719139"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/83"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/83","id":47896480,"html_url":"https://github.com/crowbar/crowbar-core/pull/83","diff_url":"https://github.com/crowbar/crowbar-core/pull/83.diff","patch_url":"https://github.com/crowbar/crowbar-core/pull/83.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/83","number":83,"state":"open","locked":false,"title":"Support multiple architecture for repo layout and OS attributes","user":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"body":"Note that this contains https://github.com/crowbar/crowbar-core/pull/81 and https://github.com/crowbar/crowbar-core/pull/82, so please review these first.\r\n\r\nAlso, this depends on https://github.com/SUSE-Cloud/automation/pull/613.","created_at":"2015-10-16T10:56:09Z","updated_at":"2015-10-22T07:43:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b0c3e8e1f23709f53fb0018203f4319051f8719","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/83/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/83/comments","review_comment_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/83/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar-core/statuses/733f763662c0a0cd1bff12cb576005f6fc14a1ff","head":{"label":"vuntz:multiarch-layout","ref":"multiarch-layout","sha":"733f763662c0a0cd1bff12cb576005f6fc14a1ff","user":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"repo":{"id":41142179,"name":"crowbar-core","full_name":"vuntz/crowbar-core","owner":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vuntz/crowbar-core","description":"Core deployment for Crowbar","fork":true,"url":"https://api.github.com/repos/vuntz/crowbar-core","forks_url":"https://api.github.com/repos/vuntz/crowbar-core/forks","keys_url":"https://api.github.com/repos/vuntz/crowbar-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vuntz/crowbar-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vuntz/crowbar-core/teams","hooks_url":"https://api.github.com/repos/vuntz/crowbar-core/hooks","issue_events_url":"https://api.github.com/repos/vuntz/crowbar-core/issues/events{/number}","events_url":"https://api.github.com/repos/vuntz/crowbar-core/events","assignees_url":"https://api.github.com/repos/vuntz/crowbar-core/assignees{/user}","branches_url":"https://api.github.com/repos/vuntz/crowbar-core/branches{/branch}","tags_url":"https://api.github.com/repos/vuntz/crowbar-core/tags","blobs_url":"https://api.github.com/repos/vuntz/crowbar-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vuntz/crowbar-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vuntz/crowbar-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/vuntz/crowbar-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vuntz/crowbar-core/statuses/{sha}","languages_url":"https://api.github.com/repos/vuntz/crowbar-core/languages","stargazers_url":"https://api.github.com/repos/vuntz/crowbar-core/stargazers","contributors_url":"https://api.github.com/repos/vuntz/crowbar-core/contributors","subscribers_url":"https://api.github.com/repos/vuntz/crowbar-core/subscribers","subscription_url":"https://api.github.com/repos/vuntz/crowbar-core/subscription","commits_url":"https://api.github.com/repos/vuntz/crowbar-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/vuntz/crowbar-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/vuntz/crowbar-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/vuntz/crowbar-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/vuntz/crowbar-core/contents/{+path}","compare_url":"https://api.github.com/repos/vuntz/crowbar-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vuntz/crowbar-core/merges","archive_url":"https://api.github.com/repos/vuntz/crowbar-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vuntz/crowbar-core/downloads","issues_url":"https://api.github.com/repos/vuntz/crowbar-core/issues{/number}","pulls_url":"https://api.github.com/repos/vuntz/crowbar-core/pulls{/number}","milestones_url":"https://api.github.com/repos/vuntz/crowbar-core/milestones{/number}","notifications_url":"https://api.github.com/repos/vuntz/crowbar-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vuntz/crowbar-core/labels{/name}","releases_url":"https://api.github.com/repos/vuntz/crowbar-core/releases{/id}","created_at":"2015-08-21T07:34:19Z","updated_at":"2015-08-21T07:34:21Z","pushed_at":"2015-10-22T07:43:17Z","git_url":"git://github.com/vuntz/crowbar-core.git","ssh_url":"git@github.com:vuntz/crowbar-core.git","clone_url":"https://github.com/vuntz/crowbar-core.git","svn_url":"https://github.com/vuntz/crowbar-core","homepage":null,"size":103919,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"crowbar:master","ref":"master","sha":"75b48a48cf2cdda4e48d938e18d90347fb0cc60e","user":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"repo":{"id":39003227,"name":"crowbar-core","full_name":"crowbar/crowbar-core","owner":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crowbar/crowbar-core","description":"Core deployment for Crowbar","fork":false,"url":"https://api.github.com/repos/crowbar/crowbar-core","forks_url":"https://api.github.com/repos/crowbar/crowbar-core/forks","keys_url":"https://api.github.com/repos/crowbar/crowbar-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowbar/crowbar-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowbar/crowbar-core/teams","hooks_url":"https://api.github.com/repos/crowbar/crowbar-core/hooks","issue_events_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/events{/number}","events_url":"https://api.github.com/repos/crowbar/crowbar-core/events","assignees_url":"https://api.github.com/repos/crowbar/crowbar-core/assignees{/user}","branches_url":"https://api.github.com/repos/crowbar/crowbar-core/branches{/branch}","tags_url":"https://api.github.com/repos/crowbar/crowbar-core/tags","blobs_url":"https://api.github.com/repos/crowbar/crowbar-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowbar/crowbar-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowbar/crowbar-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowbar/crowbar-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowbar/crowbar-core/statuses/{sha}","languages_url":"https://api.github.com/repos/crowbar/crowbar-core/languages","stargazers_url":"https://api.github.com/repos/crowbar/crowbar-core/stargazers","contributors_url":"https://api.github.com/repos/crowbar/crowbar-core/contributors","subscribers_url":"https://api.github.com/repos/crowbar/crowbar-core/subscribers","subscription_url":"https://api.github.com/repos/crowbar/crowbar-core/subscription","commits_url":"https://api.github.com/repos/crowbar/crowbar-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowbar/crowbar-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowbar/crowbar-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowbar/crowbar-core/contents/{+path}","compare_url":"https://api.github.com/repos/crowbar/crowbar-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowbar/crowbar-core/merges","archive_url":"https://api.github.com/repos/crowbar/crowbar-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowbar/crowbar-core/downloads","issues_url":"https://api.github.com/repos/crowbar/crowbar-core/issues{/number}","pulls_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls{/number}","milestones_url":"https://api.github.com/repos/crowbar/crowbar-core/milestones{/number}","notifications_url":"https://api.github.com/repos/crowbar/crowbar-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowbar/crowbar-core/labels{/name}","releases_url":"https://api.github.com/repos/crowbar/crowbar-core/releases{/id}","created_at":"2015-07-13T09:31:28Z","updated_at":"2015-10-15T10:15:04Z","pushed_at":"2015-10-22T07:43:18Z","git_url":"git://github.com/crowbar/crowbar-core.git","ssh_url":"git@github.com:crowbar/crowbar-core.git","clone_url":"https://github.com/crowbar/crowbar-core.git","svn_url":"https://github.com/crowbar/crowbar-core","homepage":null,"size":119364,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":21,"forks":21,"open_issues":21,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/83"},"html":{"href":"https://github.com/crowbar/crowbar-core/pull/83"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar-core/issues/83"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar-core/issues/83/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/83/comments"},"review_comment":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/83/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar-core/statuses/733f763662c0a0cd1bff12cb576005f6fc14a1ff"}}}}