| # Copyright 2017 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/package.gni") |
| |
| declare_args() { |
| # Additional SSH authorized_keys file to include in the build. |
| # For example: |
| # extra_authorized_keys_file=\"$HOME/.ssh/id_rsa.pub\" |
| extra_authorized_keys_file = "" |
| } |
| |
| package("developer-keys") { |
| deprecated_system_image = true |
| |
| deps = [ |
| ":all", |
| ] |
| |
| resources = [] |
| |
| if (extra_authorized_keys_file != "") { |
| resources += [{ |
| path = rebase_path(extra_authorized_keys_file) |
| dest = "ssh/authorized_keys" |
| }] |
| } |
| } |
| |
| group("all") { |
| public_deps = [ |
| ":ssh_config", |
| ] |
| } |
| |
| keys_dir = "${root_build_dir}/ssh-keys" |
| |
| action("ssh_config") { |
| config_file = "${keys_dir}/ssh_config" |
| script = "generate_ssh_config.sh" |
| args = [ |
| rebase_path("//.ssh/pkey"), |
| rebase_path(config_file), |
| ] |
| outputs = [ |
| config_file, |
| ] |
| } |