{"action":"created","comment":{"url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls/comments/138136028","pull_request_review_id":61893014,"id":138136028,"diff_hunk":"@@ -141,6 +154,109 @@ disable_esm() {\n     fi\n }\n \n+fips_prep_check() {\n+    # check to see if fips pkgs already installed.\n+    fips_hmacs=\"openssh-client-hmac openssh-server-hmac libssl1.0.0-hmac \\\n+                linux-fips strongswan-hmac\"\n+    for pkg in $fips_hmacs; do\n+        dpkg-query -W $pkg > /dev/null 2>&1\n+        if [ $? -eq 0 ]; then\n+            echo \"ERROR: Looks like FIPS already installed.\"\n+            return 1\n+        fi\n+    done\n+\n+    # sanity check\n+    case \"$ARCH\" in\n+        s390x|x86_64|ppc64le)\n+            ;;\n+        *)\n+            echo \"ERROR: $ARCH is not fips supported.\"\n+            return 1\n+            ;;\n+    esac\n+    return 0\n+}\n+\n+configure_fips() {\n+    # if /boot has its own partition, then get the bootdevice\n+    # Note: /boot/efi  does not count\n+    bootdev=$(awk '!/^\\s*#/ && $2 ~ /^\\/boot\\/?$/ { print $1 }' $FSTAB)\n+    fips_params=\"fips=1\"\n+    if [ -n \"$bootdev\" ]; then\n+        fips_params=\"$fips_params bootdev=$bootdev\"\n+    fi\n+\n+    if [ $ARCH = 's390x' ]; then\n+        sed -i -e 's/^parameters\\s*=.*/& '\"$fips_params\"'/' \"$FIPS_BOOT_CFG\"\n+        echo -n 'Updating zipl to enable fips ...'\n+        check_result zipl\n+    else\n+        if ! test -d $FIPS_BOOT_CFG_DIR; then\n+            mkdir $FIPS_BOOT_CFG_DIR > /dev/null 2>&1\n+            if [ $? -ne 0 ]; then\n+                echo \"Failed to make directory, $FIPS_BOOT_CFG_DIR.\"\n+                return 1\n+            fi\n+        fi\n+        cat > \"$FIPS_BOOT_CFG\" <<EOF","path":"ubuntu-advantage","position":80,"original_position":80,"commit_id":"b1bf27ecddeb49f40d075f70ca3edabfb824bb0d","original_commit_id":"af7a4af13ada40bce70bce601d9ed29ef69dac57","user":{"login":"joylatten","id":1036781,"avatar_url":"https://avatars2.githubusercontent.com/u/1036781?v=4","gravatar_id":"","url":"https://api.github.com/users/joylatten","html_url":"https://github.com/joylatten","followers_url":"https://api.github.com/users/joylatten/followers","following_url":"https://api.github.com/users/joylatten/following{/other_user}","gists_url":"https://api.github.com/users/joylatten/gists{/gist_id}","starred_url":"https://api.github.com/users/joylatten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joylatten/subscriptions","organizations_url":"https://api.github.com/users/joylatten/orgs","repos_url":"https://api.github.com/users/joylatten/repos","events_url":"https://api.github.com/users/joylatten/events{/privacy}","received_events_url":"https://api.github.com/users/joylatten/received_events","type":"User","site_admin":false},"body":"ok","created_at":"2017-09-11T17:23:55Z","updated_at":"2017-09-11T17:23:55Z","html_url":"https://github.com/CanonicalLtd/ubuntu-advantage-script/pull/58#discussion_r138136028","pull_request_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls/58","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls/comments/138136028"},"html":{"href":"https://github.com/CanonicalLtd/ubuntu-advantage-script/pull/58#discussion_r138136028"},"pull_request":{"href":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls/58"}},"in_reply_to_id":137782952},"pull_request":{"url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls/58","id":139845179,"html_url":"https://github.com/CanonicalLtd/ubuntu-advantage-script/pull/58","diff_url":"https://github.com/CanonicalLtd/ubuntu-advantage-script/pull/58.diff","patch_url":"https://github.com/CanonicalLtd/ubuntu-advantage-script/pull/58.patch","issue_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/issues/58","number":58,"state":"open","locked":false,"title":"Fipsua","user":{"login":"joylatten","id":1036781,"avatar_url":"https://avatars2.githubusercontent.com/u/1036781?v=4","gravatar_id":"","url":"https://api.github.com/users/joylatten","html_url":"https://github.com/joylatten","followers_url":"https://api.github.com/users/joylatten/followers","following_url":"https://api.github.com/users/joylatten/following{/other_user}","gists_url":"https://api.github.com/users/joylatten/gists{/gist_id}","starred_url":"https://api.github.com/users/joylatten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joylatten/subscriptions","organizations_url":"https://api.github.com/users/joylatten/orgs","repos_url":"https://api.github.com/users/joylatten/repos","events_url":"https://api.github.com/users/joylatten/events{/privacy}","received_events_url":"https://api.github.com/users/joylatten/received_events","type":"User","site_admin":false},"body":"Please review modifications to include enabling fips in ubuntu-advantage script.","created_at":"2017-09-07T16:03:22Z","updated_at":"2017-09-11T17:23:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c533bed80a020cae110b49acfc85a3c535dd9d2b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls/58/commits","review_comments_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls/58/comments","review_comment_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/issues/58/comments","statuses_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/statuses/b1bf27ecddeb49f40d075f70ca3edabfb824bb0d","head":{"label":"joylatten:fipsua","ref":"fipsua","sha":"b1bf27ecddeb49f40d075f70ca3edabfb824bb0d","user":{"login":"joylatten","id":1036781,"avatar_url":"https://avatars2.githubusercontent.com/u/1036781?v=4","gravatar_id":"","url":"https://api.github.com/users/joylatten","html_url":"https://github.com/joylatten","followers_url":"https://api.github.com/users/joylatten/followers","following_url":"https://api.github.com/users/joylatten/following{/other_user}","gists_url":"https://api.github.com/users/joylatten/gists{/gist_id}","starred_url":"https://api.github.com/users/joylatten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joylatten/subscriptions","organizations_url":"https://api.github.com/users/joylatten/orgs","repos_url":"https://api.github.com/users/joylatten/repos","events_url":"https://api.github.com/users/joylatten/events{/privacy}","received_events_url":"https://api.github.com/users/joylatten/received_events","type":"User","site_admin":false},"repo":{"id":102740986,"name":"ubuntu-advantage-script","full_name":"joylatten/ubuntu-advantage-script","owner":{"login":"joylatten","id":1036781,"avatar_url":"https://avatars2.githubusercontent.com/u/1036781?v=4","gravatar_id":"","url":"https://api.github.com/users/joylatten","html_url":"https://github.com/joylatten","followers_url":"https://api.github.com/users/joylatten/followers","following_url":"https://api.github.com/users/joylatten/following{/other_user}","gists_url":"https://api.github.com/users/joylatten/gists{/gist_id}","starred_url":"https://api.github.com/users/joylatten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joylatten/subscriptions","organizations_url":"https://api.github.com/users/joylatten/orgs","repos_url":"https://api.github.com/users/joylatten/repos","events_url":"https://api.github.com/users/joylatten/events{/privacy}","received_events_url":"https://api.github.com/users/joylatten/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joylatten/ubuntu-advantage-script","description":"Script to manage Ubuntu Advantage offerings from Canonical","fork":true,"url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script","forks_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/forks","keys_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/teams","hooks_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/hooks","issue_events_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/issues/events{/number}","events_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/events","assignees_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/assignees{/user}","branches_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/branches{/branch}","tags_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/tags","blobs_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/git/refs{/sha}","trees_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/statuses/{sha}","languages_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/languages","stargazers_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/stargazers","contributors_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/contributors","subscribers_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/subscribers","subscription_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/subscription","commits_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/commits{/sha}","git_commits_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/git/commits{/sha}","comments_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/comments{/number}","issue_comment_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/issues/comments{/number}","contents_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/contents/{+path}","compare_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/merges","archive_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/downloads","issues_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/issues{/number}","pulls_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/pulls{/number}","milestones_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/milestones{/number}","notifications_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/labels{/name}","releases_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/releases{/id}","deployments_url":"https://api.github.com/repos/joylatten/ubuntu-advantage-script/deployments","created_at":"2017-09-07T13:34:48Z","updated_at":"2017-09-07T13:34:49Z","pushed_at":"2017-09-07T15:27:10Z","git_url":"git://github.com/joylatten/ubuntu-advantage-script.git","ssh_url":"git@github.com:joylatten/ubuntu-advantage-script.git","clone_url":"https://github.com/joylatten/ubuntu-advantage-script.git","svn_url":"https://github.com/joylatten/ubuntu-advantage-script","homepage":"","size":99,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"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":"CanonicalLtd:master","ref":"master","sha":"0e03f5d2045d71b1512bffd6579e850b915de93f","user":{"login":"CanonicalLtd","id":7490288,"avatar_url":"https://avatars0.githubusercontent.com/u/7490288?v=4","gravatar_id":"","url":"https://api.github.com/users/CanonicalLtd","html_url":"https://github.com/CanonicalLtd","followers_url":"https://api.github.com/users/CanonicalLtd/followers","following_url":"https://api.github.com/users/CanonicalLtd/following{/other_user}","gists_url":"https://api.github.com/users/CanonicalLtd/gists{/gist_id}","starred_url":"https://api.github.com/users/CanonicalLtd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CanonicalLtd/subscriptions","organizations_url":"https://api.github.com/users/CanonicalLtd/orgs","repos_url":"https://api.github.com/users/CanonicalLtd/repos","events_url":"https://api.github.com/users/CanonicalLtd/events{/privacy}","received_events_url":"https://api.github.com/users/CanonicalLtd/received_events","type":"Organization","site_admin":false},"repo":{"id":88025280,"name":"ubuntu-advantage-script","full_name":"CanonicalLtd/ubuntu-advantage-script","owner":{"login":"CanonicalLtd","id":7490288,"avatar_url":"https://avatars0.githubusercontent.com/u/7490288?v=4","gravatar_id":"","url":"https://api.github.com/users/CanonicalLtd","html_url":"https://github.com/CanonicalLtd","followers_url":"https://api.github.com/users/CanonicalLtd/followers","following_url":"https://api.github.com/users/CanonicalLtd/following{/other_user}","gists_url":"https://api.github.com/users/CanonicalLtd/gists{/gist_id}","starred_url":"https://api.github.com/users/CanonicalLtd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CanonicalLtd/subscriptions","organizations_url":"https://api.github.com/users/CanonicalLtd/orgs","repos_url":"https://api.github.com/users/CanonicalLtd/repos","events_url":"https://api.github.com/users/CanonicalLtd/events{/privacy}","received_events_url":"https://api.github.com/users/CanonicalLtd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CanonicalLtd/ubuntu-advantage-script","description":"Script to manage Ubuntu Advantage offerings from Canonical","fork":false,"url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script","forks_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/forks","keys_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/teams","hooks_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/hooks","issue_events_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/issues/events{/number}","events_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/events","assignees_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/assignees{/user}","branches_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/branches{/branch}","tags_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/tags","blobs_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/git/refs{/sha}","trees_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/statuses/{sha}","languages_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/languages","stargazers_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/stargazers","contributors_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/contributors","subscribers_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/subscribers","subscription_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/subscription","commits_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/commits{/sha}","git_commits_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/git/commits{/sha}","comments_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/comments{/number}","issue_comment_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/issues/comments{/number}","contents_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/contents/{+path}","compare_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/merges","archive_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/downloads","issues_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/issues{/number}","pulls_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls{/number}","milestones_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/milestones{/number}","notifications_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/labels{/name}","releases_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/releases{/id}","deployments_url":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/deployments","created_at":"2017-04-12T07:56:40Z","updated_at":"2017-09-06T14:02:43Z","pushed_at":"2017-09-07T16:03:23Z","git_url":"git://github.com/CanonicalLtd/ubuntu-advantage-script.git","ssh_url":"git@github.com:CanonicalLtd/ubuntu-advantage-script.git","clone_url":"https://github.com/CanonicalLtd/ubuntu-advantage-script.git","svn_url":"https://github.com/CanonicalLtd/ubuntu-advantage-script","homepage":"","size":92,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":1,"forks":7,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls/58"},"html":{"href":"https://github.com/CanonicalLtd/ubuntu-advantage-script/pull/58"},"issue":{"href":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/issues/58"},"comments":{"href":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/CanonicalLtd/ubuntu-advantage-script/statuses/b1bf27ecddeb49f40d075f70ca3edabfb824bb0d"}},"author_association":"NONE"}}
{"actor":{"display_login":"joylatten"}}