{"action":"created","comment":{"url":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments/48466477","id":48466477,"diff_hunk":"@@ -0,0 +1,155 @@\n+#!/bin/bash\n+\n+#-----------------------------------------------------------\n+#\n+# Get proper disk to install OS\n+#\n+# 1. Check all partitions list in /proc/partitions, whether \n+#    there is disk had OS installed. Select the one with the\n+#    smallest WWN.\n+# 2. Check all disks list in /proc/partitions, sort them by\n+#    WWN and driver type, select the first one.\n+# 3. Select the default one: /dev/sda.   \n+#\n+# Output: /tmp/install_disk\n+#\n+#-----------------------------------------------------------\n+\n+install_disk=\"\"\n+rm /tmp/install_disk\n+\n+# Check if any disk have installed OS\n+if [ -z \"$install_disk\" ]; then\n+\n+    entries=$(awk -F ' '  '{print $4}' /proc/partitions)","path":"xCAT-server/share/xcat/install/scripts/getinstdisk","position":24,"original_position":24,"commit_id":"195fdd7a54c6b17a1453ad24646c1a23fc3da0f6","original_commit_id":"195fdd7a54c6b17a1453ad24646c1a23fc3da0f6","user":{"login":"immarvin","id":5668922,"avatar_url":"https://avatars.githubusercontent.com/u/5668922?v=3","gravatar_id":"","url":"https://api.github.com/users/immarvin","html_url":"https://github.com/immarvin","followers_url":"https://api.github.com/users/immarvin/followers","following_url":"https://api.github.com/users/immarvin/following{/other_user}","gists_url":"https://api.github.com/users/immarvin/gists{/gist_id}","starred_url":"https://api.github.com/users/immarvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/immarvin/subscriptions","organizations_url":"https://api.github.com/users/immarvin/orgs","repos_url":"https://api.github.com/users/immarvin/repos","events_url":"https://api.github.com/users/immarvin/events{/privacy}","received_events_url":"https://api.github.com/users/immarvin/received_events","type":"User","site_admin":false},"body":"The header of ``/proc/partitions`` should be filtered out\r\n[root@c910f03c05k21 ~]# entries=$(awk -F ' '  '{print $4}' /proc/partitions)\r\n[root@c910f03c05k21 ~]# echo $entries\r\nname sr0 sda sda1 sda2 sda3 sda4 sda5 dm-0 loop0 loop1 loop2 loop3\r\n\r\n","created_at":"2015-12-28T07:52:27Z","updated_at":"2015-12-28T07:52:27Z","html_url":"https://github.com/xcat2/xcat-core/pull/531#discussion_r48466477","pull_request_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/531","_links":{"self":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments/48466477"},"html":{"href":"https://github.com/xcat2/xcat-core/pull/531#discussion_r48466477"},"pull_request":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/531"}}},"pull_request":{"url":"https://api.github.com/repos/xcat2/xcat-core/pulls/531","id":53518920,"html_url":"https://github.com/xcat2/xcat-core/pull/531","diff_url":"https://github.com/xcat2/xcat-core/pull/531.diff","patch_url":"https://github.com/xcat2/xcat-core/pull/531.patch","issue_url":"https://api.github.com/repos/xcat2/xcat-core/issues/531","number":531,"state":"open","locked":false,"title":"Get_install_disk,Task 75933","user":{"login":"xuweibj","id":15208204,"avatar_url":"https://avatars.githubusercontent.com/u/15208204?v=3","gravatar_id":"","url":"https://api.github.com/users/xuweibj","html_url":"https://github.com/xuweibj","followers_url":"https://api.github.com/users/xuweibj/followers","following_url":"https://api.github.com/users/xuweibj/following{/other_user}","gists_url":"https://api.github.com/users/xuweibj/gists{/gist_id}","starred_url":"https://api.github.com/users/xuweibj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuweibj/subscriptions","organizations_url":"https://api.github.com/users/xuweibj/orgs","repos_url":"https://api.github.com/users/xuweibj/repos","events_url":"https://api.github.com/users/xuweibj/events{/privacy}","received_events_url":"https://api.github.com/users/xuweibj/received_events","type":"User","site_admin":false},"body":"For RedHat/Ubuntu/Sles/PowerKVM, the files for choosing install disk are different, but with similar logic. It is inconvenient for maintenance. And because of different methods for choosing disk and the disk name maybe different from last boot (physical machine), the OS may be installed on different disk. To avoid this situation, we want to use the same logic/file for all.\r\nThe idea is,  for RedHat/Ubuntu/Sles/PowerKVM we use the same file to get the install disk.\r\nThe file will get install disk, and then output it to the file \"/tmp/install_disk\".","created_at":"2015-12-14T02:31:16Z","updated_at":"2015-12-28T07:52:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f864c82dae063df13c4473a4fa6fff0a58c087a8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/531/commits","review_comments_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/531/comments","review_comment_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xcat2/xcat-core/issues/531/comments","statuses_url":"https://api.github.com/repos/xcat2/xcat-core/statuses/195fdd7a54c6b17a1453ad24646c1a23fc3da0f6","head":{"label":"xuweibj:T75933","ref":"T75933","sha":"195fdd7a54c6b17a1453ad24646c1a23fc3da0f6","user":{"login":"xuweibj","id":15208204,"avatar_url":"https://avatars.githubusercontent.com/u/15208204?v=3","gravatar_id":"","url":"https://api.github.com/users/xuweibj","html_url":"https://github.com/xuweibj","followers_url":"https://api.github.com/users/xuweibj/followers","following_url":"https://api.github.com/users/xuweibj/following{/other_user}","gists_url":"https://api.github.com/users/xuweibj/gists{/gist_id}","starred_url":"https://api.github.com/users/xuweibj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuweibj/subscriptions","organizations_url":"https://api.github.com/users/xuweibj/orgs","repos_url":"https://api.github.com/users/xuweibj/repos","events_url":"https://api.github.com/users/xuweibj/events{/privacy}","received_events_url":"https://api.github.com/users/xuweibj/received_events","type":"User","site_admin":false},"repo":{"id":45444036,"name":"xcat-core","full_name":"xuweibj/xcat-core","owner":{"login":"xuweibj","id":15208204,"avatar_url":"https://avatars.githubusercontent.com/u/15208204?v=3","gravatar_id":"","url":"https://api.github.com/users/xuweibj","html_url":"https://github.com/xuweibj","followers_url":"https://api.github.com/users/xuweibj/followers","following_url":"https://api.github.com/users/xuweibj/following{/other_user}","gists_url":"https://api.github.com/users/xuweibj/gists{/gist_id}","starred_url":"https://api.github.com/users/xuweibj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuweibj/subscriptions","organizations_url":"https://api.github.com/users/xuweibj/orgs","repos_url":"https://api.github.com/users/xuweibj/repos","events_url":"https://api.github.com/users/xuweibj/events{/privacy}","received_events_url":"https://api.github.com/users/xuweibj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xuweibj/xcat-core","description":"Code repo for xCAT core packages","fork":true,"url":"https://api.github.com/repos/xuweibj/xcat-core","forks_url":"https://api.github.com/repos/xuweibj/xcat-core/forks","keys_url":"https://api.github.com/repos/xuweibj/xcat-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xuweibj/xcat-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xuweibj/xcat-core/teams","hooks_url":"https://api.github.com/repos/xuweibj/xcat-core/hooks","issue_events_url":"https://api.github.com/repos/xuweibj/xcat-core/issues/events{/number}","events_url":"https://api.github.com/repos/xuweibj/xcat-core/events","assignees_url":"https://api.github.com/repos/xuweibj/xcat-core/assignees{/user}","branches_url":"https://api.github.com/repos/xuweibj/xcat-core/branches{/branch}","tags_url":"https://api.github.com/repos/xuweibj/xcat-core/tags","blobs_url":"https://api.github.com/repos/xuweibj/xcat-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xuweibj/xcat-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xuweibj/xcat-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/xuweibj/xcat-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xuweibj/xcat-core/statuses/{sha}","languages_url":"https://api.github.com/repos/xuweibj/xcat-core/languages","stargazers_url":"https://api.github.com/repos/xuweibj/xcat-core/stargazers","contributors_url":"https://api.github.com/repos/xuweibj/xcat-core/contributors","subscribers_url":"https://api.github.com/repos/xuweibj/xcat-core/subscribers","subscription_url":"https://api.github.com/repos/xuweibj/xcat-core/subscription","commits_url":"https://api.github.com/repos/xuweibj/xcat-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/xuweibj/xcat-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/xuweibj/xcat-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/xuweibj/xcat-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/xuweibj/xcat-core/contents/{+path}","compare_url":"https://api.github.com/repos/xuweibj/xcat-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xuweibj/xcat-core/merges","archive_url":"https://api.github.com/repos/xuweibj/xcat-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xuweibj/xcat-core/downloads","issues_url":"https://api.github.com/repos/xuweibj/xcat-core/issues{/number}","pulls_url":"https://api.github.com/repos/xuweibj/xcat-core/pulls{/number}","milestones_url":"https://api.github.com/repos/xuweibj/xcat-core/milestones{/number}","notifications_url":"https://api.github.com/repos/xuweibj/xcat-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xuweibj/xcat-core/labels{/name}","releases_url":"https://api.github.com/repos/xuweibj/xcat-core/releases{/id}","created_at":"2015-11-03T05:30:52Z","updated_at":"2015-11-03T05:31:07Z","pushed_at":"2015-12-28T06:55:40Z","git_url":"git://github.com/xuweibj/xcat-core.git","ssh_url":"git@github.com:xuweibj/xcat-core.git","clone_url":"https://github.com/xuweibj/xcat-core.git","svn_url":"https://github.com/xuweibj/xcat-core","homepage":null,"size":181318,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"xcat2:master","ref":"master","sha":"19bd82de4b3cf27f505cf700da18aee46d548fe6","user":{"login":"xcat2","id":10124414,"avatar_url":"https://avatars.githubusercontent.com/u/10124414?v=3","gravatar_id":"","url":"https://api.github.com/users/xcat2","html_url":"https://github.com/xcat2","followers_url":"https://api.github.com/users/xcat2/followers","following_url":"https://api.github.com/users/xcat2/following{/other_user}","gists_url":"https://api.github.com/users/xcat2/gists{/gist_id}","starred_url":"https://api.github.com/users/xcat2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xcat2/subscriptions","organizations_url":"https://api.github.com/users/xcat2/orgs","repos_url":"https://api.github.com/users/xcat2/repos","events_url":"https://api.github.com/users/xcat2/events{/privacy}","received_events_url":"https://api.github.com/users/xcat2/received_events","type":"Organization","site_admin":false},"repo":{"id":27747508,"name":"xcat-core","full_name":"xcat2/xcat-core","owner":{"login":"xcat2","id":10124414,"avatar_url":"https://avatars.githubusercontent.com/u/10124414?v=3","gravatar_id":"","url":"https://api.github.com/users/xcat2","html_url":"https://github.com/xcat2","followers_url":"https://api.github.com/users/xcat2/followers","following_url":"https://api.github.com/users/xcat2/following{/other_user}","gists_url":"https://api.github.com/users/xcat2/gists{/gist_id}","starred_url":"https://api.github.com/users/xcat2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xcat2/subscriptions","organizations_url":"https://api.github.com/users/xcat2/orgs","repos_url":"https://api.github.com/users/xcat2/repos","events_url":"https://api.github.com/users/xcat2/events{/privacy}","received_events_url":"https://api.github.com/users/xcat2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xcat2/xcat-core","description":"Code repo for xCAT core packages","fork":false,"url":"https://api.github.com/repos/xcat2/xcat-core","forks_url":"https://api.github.com/repos/xcat2/xcat-core/forks","keys_url":"https://api.github.com/repos/xcat2/xcat-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xcat2/xcat-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xcat2/xcat-core/teams","hooks_url":"https://api.github.com/repos/xcat2/xcat-core/hooks","issue_events_url":"https://api.github.com/repos/xcat2/xcat-core/issues/events{/number}","events_url":"https://api.github.com/repos/xcat2/xcat-core/events","assignees_url":"https://api.github.com/repos/xcat2/xcat-core/assignees{/user}","branches_url":"https://api.github.com/repos/xcat2/xcat-core/branches{/branch}","tags_url":"https://api.github.com/repos/xcat2/xcat-core/tags","blobs_url":"https://api.github.com/repos/xcat2/xcat-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xcat2/xcat-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xcat2/xcat-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/xcat2/xcat-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xcat2/xcat-core/statuses/{sha}","languages_url":"https://api.github.com/repos/xcat2/xcat-core/languages","stargazers_url":"https://api.github.com/repos/xcat2/xcat-core/stargazers","contributors_url":"https://api.github.com/repos/xcat2/xcat-core/contributors","subscribers_url":"https://api.github.com/repos/xcat2/xcat-core/subscribers","subscription_url":"https://api.github.com/repos/xcat2/xcat-core/subscription","commits_url":"https://api.github.com/repos/xcat2/xcat-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/xcat2/xcat-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/xcat2/xcat-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/xcat2/xcat-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/xcat2/xcat-core/contents/{+path}","compare_url":"https://api.github.com/repos/xcat2/xcat-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xcat2/xcat-core/merges","archive_url":"https://api.github.com/repos/xcat2/xcat-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xcat2/xcat-core/downloads","issues_url":"https://api.github.com/repos/xcat2/xcat-core/issues{/number}","pulls_url":"https://api.github.com/repos/xcat2/xcat-core/pulls{/number}","milestones_url":"https://api.github.com/repos/xcat2/xcat-core/milestones{/number}","notifications_url":"https://api.github.com/repos/xcat2/xcat-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xcat2/xcat-core/labels{/name}","releases_url":"https://api.github.com/repos/xcat2/xcat-core/releases{/id}","created_at":"2014-12-09T03:21:50Z","updated_at":"2015-12-18T07:06:52Z","pushed_at":"2015-12-28T07:45:07Z","git_url":"git://github.com/xcat2/xcat-core.git","ssh_url":"git@github.com:xcat2/xcat-core.git","clone_url":"https://github.com/xcat2/xcat-core.git","svn_url":"https://github.com/xcat2/xcat-core","homepage":null,"size":181830,"stargazers_count":22,"watchers_count":22,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":67,"forks":38,"open_issues":67,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/531"},"html":{"href":"https://github.com/xcat2/xcat-core/pull/531"},"issue":{"href":"https://api.github.com/repos/xcat2/xcat-core/issues/531"},"comments":{"href":"https://api.github.com/repos/xcat2/xcat-core/issues/531/comments"},"review_comments":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/531/comments"},"review_comment":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/531/commits"},"statuses":{"href":"https://api.github.com/repos/xcat2/xcat-core/statuses/195fdd7a54c6b17a1453ad24646c1a23fc3da0f6"}}}}