Copy disabled (too large)
Download .txt
Showing preview only (11,062K chars total). Download the full file to get everything.
Repository: burmilla/os
Branch: master
Commit: 76d5ad24b897
Files: 1572
Total size: 10.2 MB
Directory structure:
gitextract_wmx6zcva/
├── .dockerignore
├── .github/
│ ├── ISSUE_TEMPLATE.md
│ └── workflows/
│ ├── create-release.yml
│ └── pull-request-validation.yml
├── .gitignore
├── Dockerfile.dapper
├── LICENSE
├── Makefile
├── README.md
├── assets/
│ ├── rancher.key
│ ├── rancher.key.pub
│ └── scripts_ssh_config
├── cmd/
│ ├── cloudinitexecute/
│ │ ├── authorize_ssh_keys.go
│ │ └── cloudinitexecute.go
│ ├── cloudinitsave/
│ │ └── cloudinitsave.go
│ ├── control/
│ │ ├── autologin.go
│ │ ├── bootstrap.go
│ │ ├── cli.go
│ │ ├── config.go
│ │ ├── config_test.go
│ │ ├── console.go
│ │ ├── console_init.go
│ │ ├── dev.go
│ │ ├── docker_init.go
│ │ ├── engine.go
│ │ ├── entrypoint.go
│ │ ├── env.go
│ │ ├── install/
│ │ │ ├── grub.go
│ │ │ ├── install.go
│ │ │ ├── service.go
│ │ │ └── syslinux.go
│ │ ├── install.go
│ │ ├── os.go
│ │ ├── preload.go
│ │ ├── recovery_init.go
│ │ ├── service/
│ │ │ ├── app/
│ │ │ │ └── app.go
│ │ │ ├── command/
│ │ │ │ └── command.go
│ │ │ └── service.go
│ │ ├── switch_console.go
│ │ ├── tlsconf.go
│ │ ├── udevsettle.go
│ │ ├── user_docker.go
│ │ └── util.go
│ ├── init/
│ │ └── init.go
│ ├── network/
│ │ └── network.go
│ ├── power/
│ │ ├── power.go
│ │ └── shutdown.go
│ ├── respawn/
│ │ └── respawn.go
│ ├── sysinit/
│ │ └── sysinit.go
│ └── wait/
│ └── wait.go
├── config/
│ ├── cloudinit/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── CONTRIBUTING.md
│ │ ├── DCO
│ │ ├── Documentation/
│ │ │ ├── cloud-config-deprecated.md
│ │ │ ├── cloud-config-locations.md
│ │ │ ├── cloud-config-oem.md
│ │ │ ├── cloud-config.md
│ │ │ ├── config-drive.md
│ │ │ ├── debian-interfaces.md
│ │ │ └── vmware-guestinfo.md
│ │ ├── LICENSE
│ │ ├── MAINTAINERS
│ │ ├── NOTICE
│ │ ├── README.md
│ │ ├── build
│ │ ├── config/
│ │ │ ├── config.go
│ │ │ ├── config_test.go
│ │ │ ├── decode.go
│ │ │ ├── etc_hosts.go
│ │ │ ├── etcd.go
│ │ │ ├── etcd2.go
│ │ │ ├── file.go
│ │ │ ├── file_test.go
│ │ │ ├── flannel.go
│ │ │ ├── fleet.go
│ │ │ ├── ignition.go
│ │ │ ├── locksmith.go
│ │ │ ├── locksmith_test.go
│ │ │ ├── oem.go
│ │ │ ├── script.go
│ │ │ ├── unit.go
│ │ │ ├── unit_test.go
│ │ │ ├── update.go
│ │ │ ├── update_test.go
│ │ │ ├── user.go
│ │ │ └── validate/
│ │ │ ├── context.go
│ │ │ ├── context_test.go
│ │ │ ├── node.go
│ │ │ ├── node_test.go
│ │ │ ├── report.go
│ │ │ ├── report_test.go
│ │ │ ├── rules.go
│ │ │ ├── rules_test.go
│ │ │ ├── validate.go
│ │ │ └── validate_test.go
│ │ ├── cover
│ │ ├── datasource/
│ │ │ ├── configdrive/
│ │ │ │ ├── configdrive.go
│ │ │ │ └── configdrive_test.go
│ │ │ ├── datasource.go
│ │ │ ├── file/
│ │ │ │ └── file.go
│ │ │ ├── metadata/
│ │ │ │ ├── aliyun/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── azure/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── cloudstack/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── digitalocean/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── ec2/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── exoscale/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── gce/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── metadata.go
│ │ │ │ ├── metadata_test.go
│ │ │ │ ├── packet/
│ │ │ │ │ └── metadata.go
│ │ │ │ └── test/
│ │ │ │ └── test.go
│ │ │ ├── proccmdline/
│ │ │ │ ├── proc_cmdline.go
│ │ │ │ └── proc_cmdline_test.go
│ │ │ ├── proxmox/
│ │ │ │ ├── proxmox.go
│ │ │ │ └── proxmox_test.go
│ │ │ ├── test/
│ │ │ │ ├── filesystem.go
│ │ │ │ └── filesystem_test.go
│ │ │ ├── tftp/
│ │ │ │ ├── tftp.go
│ │ │ │ └── tftp_test.go
│ │ │ ├── url/
│ │ │ │ └── url.go
│ │ │ └── vmware/
│ │ │ ├── vmware.go
│ │ │ ├── vmware_amd64.go
│ │ │ ├── vmware_test.go
│ │ │ └── vmware_unsupported.go
│ │ ├── initialize/
│ │ │ ├── env.go
│ │ │ ├── env_test.go
│ │ │ ├── github.go
│ │ │ ├── ssh_keys.go
│ │ │ ├── ssh_keys_test.go
│ │ │ ├── user_data.go
│ │ │ ├── user_data_test.go
│ │ │ └── workspace.go
│ │ ├── network/
│ │ │ ├── debian.go
│ │ │ ├── debian_test.go
│ │ │ ├── interface.go
│ │ │ ├── interface_test.go
│ │ │ ├── is_go15_false_test.go
│ │ │ ├── is_go15_true_test.go
│ │ │ ├── packet.go
│ │ │ ├── stanza.go
│ │ │ ├── stanza_test.go
│ │ │ ├── vmware.go
│ │ │ └── vmware_test.go
│ │ ├── pkg/
│ │ │ ├── http_client.go
│ │ │ └── http_client_test.go
│ │ ├── system/
│ │ │ ├── env.go
│ │ │ ├── env_file.go
│ │ │ ├── env_file_test.go
│ │ │ ├── env_test.go
│ │ │ ├── etc_hosts.go
│ │ │ ├── etc_hosts_test.go
│ │ │ ├── etcd.go
│ │ │ ├── etcd2.go
│ │ │ ├── etcd_test.go
│ │ │ ├── file.go
│ │ │ ├── file_test.go
│ │ │ ├── flannel.go
│ │ │ ├── flannel_test.go
│ │ │ ├── fleet.go
│ │ │ ├── fleet_test.go
│ │ │ ├── locksmith.go
│ │ │ ├── locksmith_test.go
│ │ │ ├── oem.go
│ │ │ ├── oem_test.go
│ │ │ ├── ssh_key.go
│ │ │ ├── unit.go
│ │ │ ├── unit_test.go
│ │ │ ├── update.go
│ │ │ ├── update_test.go
│ │ │ └── user.go
│ │ ├── test
│ │ ├── units/
│ │ │ ├── 90-configdrive.rules
│ │ │ ├── 90-ovfenv.rules
│ │ │ ├── media-configdrive.mount
│ │ │ ├── media-configvirtfs.mount
│ │ │ ├── media-ovfenv.mount
│ │ │ ├── system-cloudinit@.service
│ │ │ ├── system-config.target
│ │ │ ├── user-cloudinit-proc-cmdline.service
│ │ │ ├── user-cloudinit@.path
│ │ │ ├── user-cloudinit@.service
│ │ │ ├── user-config-ovfenv.service
│ │ │ ├── user-config.target
│ │ │ ├── user-configdrive.service
│ │ │ └── user-configvirtfs.service
│ │ └── vendor.manifest
│ ├── cmdline/
│ │ └── cmdline.go
│ ├── config.go
│ ├── config_test.go
│ ├── data_funcs.go
│ ├── disk.go
│ ├── docker_config.go
│ ├── docker_config_test.go
│ ├── metadata_test.go
│ ├── schema.go
│ ├── types.go
│ ├── validate.go
│ ├── validate_test.go
│ └── yaml/
│ └── command.go
├── images/
│ ├── 00-rootfs/
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ └── prebuild.sh
│ ├── 01-base/
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── etc/
│ │ │ ├── dhcpcd.conf.tpl
│ │ │ ├── dhcpcd.enter-hook
│ │ │ ├── inputrc
│ │ │ └── wpa_supplicant.conf.tpl
│ │ └── usr/
│ │ ├── bin/
│ │ │ ├── growpart
│ │ │ └── start_ntp.sh
│ │ ├── lib/
│ │ │ ├── dhcpcd/
│ │ │ │ ├── dhcpcd-hooks/
│ │ │ │ │ └── 10-mtu
│ │ │ │ └── dhcpcd-run-hooks
│ │ │ └── udev/
│ │ │ └── rules-extras.d/
│ │ │ ├── 50-firmware.rules
│ │ │ ├── 70-uaccess.rules
│ │ │ ├── 73-special-net-names.rules
│ │ │ ├── 73-usb-net-by-mac.rules
│ │ │ ├── 77-mm-cinterion-port-types.rules
│ │ │ ├── 77-mm-dell-port-types.rules
│ │ │ ├── 77-mm-ericsson-mbm.rules
│ │ │ ├── 77-mm-haier-port-types.rules
│ │ │ ├── 77-mm-huawei-net-port-types.rules
│ │ │ ├── 77-mm-longcheer-port-types.rules
│ │ │ ├── 77-mm-mtk-port-types.rules
│ │ │ ├── 77-mm-nokia-port-types.rules
│ │ │ ├── 77-mm-pcmcia-device-blacklist.rules
│ │ │ ├── 77-mm-platform-serial-whitelist.rules
│ │ │ ├── 77-mm-qdl-device-blacklist.rules
│ │ │ ├── 77-mm-simtech-port-types.rules
│ │ │ ├── 77-mm-telit-port-types.rules
│ │ │ ├── 77-mm-usb-device-blacklist.rules
│ │ │ ├── 77-mm-usb-serial-adapters-greylist.rules
│ │ │ ├── 77-mm-x22x-port-types.rules
│ │ │ ├── 77-mm-zte-port-types.rules
│ │ │ └── 80-mm-candidate.rules
│ │ └── share/
│ │ └── logrotate/
│ │ └── logrotate.d/
│ │ └── dhcpcd.debug
│ ├── 02-acpid/
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ └── etc/
│ │ └── acpi/
│ │ ├── events/
│ │ │ └── lid
│ │ └── suspend.sh
│ ├── 02-bootstrap/
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── od-1m0
│ │ └── usr/
│ │ └── sbin/
│ │ └── auto-format.sh
│ ├── 02-console/
│ │ ├── Dockerfile
│ │ ├── iscsid.conf
│ │ ├── prebuild.sh
│ │ └── sshd_config.append.tpl
│ ├── 02-logrotate/
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── etc/
│ │ │ └── logrotate.conf
│ │ └── usr/
│ │ ├── bin/
│ │ │ └── entrypoint.sh
│ │ └── share/
│ │ └── logrotate/
│ │ └── logrotate.d/
│ │ └── docker
│ └── 02-syslog/
│ ├── .dockerignore
│ ├── Dockerfile
│ └── usr/
│ ├── bin/
│ │ └── entrypoint.sh
│ └── share/
│ └── logrotate/
│ └── logrotate.d/
│ └── syslog
├── main.go
├── os-config.tpl.yml
├── pkg/
│ ├── compose/
│ │ ├── project.go
│ │ └── reload.go
│ ├── dfs/
│ │ └── scratch.go
│ ├── docker/
│ │ ├── auth.go
│ │ ├── client.go
│ │ ├── client_factory.go
│ │ ├── env.go
│ │ ├── service.go
│ │ ├── service_factory.go
│ │ └── util.go
│ ├── hostname/
│ │ └── hostname.go
│ ├── init/
│ │ ├── b2d/
│ │ │ └── b2d.go
│ │ ├── bootstrap/
│ │ │ └── bootstrap.go
│ │ ├── cloudinit/
│ │ │ └── cloudinit.go
│ │ ├── configfiles/
│ │ │ └── configfiles.go
│ │ ├── debug/
│ │ │ └── debug.go
│ │ ├── docker/
│ │ │ └── docker.go
│ │ ├── env/
│ │ │ └── env.go
│ │ ├── fsmount/
│ │ │ └── fsmount.go
│ │ ├── hypervisor/
│ │ │ └── hypervisor.go
│ │ ├── modules/
│ │ │ └── modules.go
│ │ ├── one/
│ │ │ └── one.go
│ │ ├── prepare/
│ │ │ └── prepare.go
│ │ ├── recovery/
│ │ │ └── recovery.go
│ │ ├── sharedroot/
│ │ │ └── sharedroot.go
│ │ └── switchroot/
│ │ └── switchroot.go
│ ├── log/
│ │ ├── log.go
│ │ └── showuserlog.go
│ ├── netconf/
│ │ ├── bonding.go
│ │ ├── bridge.go
│ │ ├── ipv4ll_linux.go
│ │ ├── netconf_linux.go
│ │ ├── netconf_linux_test.go
│ │ ├── types.go
│ │ └── vlan.go
│ ├── sysinit/
│ │ └── sysinit.go
│ └── util/
│ ├── backoff.go
│ ├── cutil.go
│ ├── network/
│ │ ├── cache.go
│ │ ├── network.go
│ │ ├── network_test.go
│ │ └── route.go
│ ├── term.go
│ ├── util.go
│ ├── util_linux.go
│ ├── util_test.go
│ └── versions/
│ ├── compare.go
│ └── compare_test.go
├── scripts/
│ ├── build
│ ├── build-host
│ ├── build-images
│ ├── build-moby
│ ├── build-target
│ ├── checksums
│ ├── ci
│ ├── clean
│ ├── copy-latest.sh
│ ├── copy-release.sh
│ ├── create-installed
│ ├── default
│ ├── dev
│ ├── entry
│ ├── global.cfg
│ ├── hash-initrd
│ ├── help
│ ├── hosting/
│ │ ├── burmillaos.ipxe
│ │ ├── digitalocean/
│ │ │ ├── cloud-config.yml
│ │ │ ├── fedora-symbiote.yml
│ │ │ └── host.sh
│ │ └── packet/
│ │ ├── packet.sh
│ │ ├── test.expect
│ │ └── test.sh
│ ├── images/
│ │ └── raspberry-pi-hypriot64/
│ │ ├── .dockerignore
│ │ ├── .gitignore
│ │ ├── README.md
│ │ └── scripts/
│ │ └── build.sh
│ ├── inline_schema.go
│ ├── installer/
│ │ ├── BaseDockerfile.amd64
│ │ ├── BaseDockerfile.arm64
│ │ ├── Dockerfile.amd64
│ │ ├── Dockerfile.arm64
│ │ ├── README.md
│ │ ├── cache-services.sh
│ │ ├── conf/
│ │ │ ├── cloud-config-local.yml
│ │ │ ├── empty.yml
│ │ │ └── vagrant.yml
│ │ └── kexec/
│ │ └── Dockerfile.dapper
│ ├── isolinux.cfg
│ ├── isolinux_label.cfg
│ ├── layout
│ ├── layout-initrd
│ ├── layout-kernel
│ ├── moby/
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ └── rancheros.yml
│ ├── package
│ ├── package-initrd
│ ├── package-installer
│ ├── package-iso
│ ├── package-rootfs
│ ├── prepare
│ ├── release
│ ├── release-4glte
│ ├── release-amd64
│ ├── release-arm64
│ ├── release-build
│ ├── release-rpi64
│ ├── ros
│ ├── run
│ ├── run-common
│ ├── run-install
│ ├── run-moby
│ ├── schema.json
│ ├── schema_template
│ ├── shell
│ ├── ssh
│ ├── tar-images
│ ├── template
│ ├── test
│ ├── tools/
│ │ ├── collect_rancheros_info.sh
│ │ ├── flush_crt_iso.sh
│ │ └── flush_crt_nbd.sh
│ ├── validate
│ └── version
├── trash.conf
└── vendor/
├── github.com/
│ ├── Microsoft/
│ │ └── go-winio/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── backup.go
│ │ ├── file.go
│ │ ├── fileinfo.go
│ │ ├── pipe.go
│ │ ├── privilege.go
│ │ ├── reparse.go
│ │ ├── sd.go
│ │ ├── syscall.go
│ │ └── zsyscall.go
│ ├── SvenDowideit/
│ │ └── cpuid/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── cpuid.go
│ │ ├── cpuid_386.s
│ │ ├── cpuid_amd64.s
│ │ ├── detect_intel.go
│ │ ├── detect_ref.go
│ │ ├── generate.go
│ │ └── private-gen.go
│ ├── cloudfoundry-incubator/
│ │ └── candiedyaml/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── api.go
│ │ ├── decode.go
│ │ ├── emitter.go
│ │ ├── encode.go
│ │ ├── libyaml-LICENSE
│ │ ├── parser.go
│ │ ├── reader.go
│ │ ├── resolver.go
│ │ ├── run_parser.go
│ │ ├── scanner.go
│ │ ├── tags.go
│ │ ├── writer.go
│ │ ├── yaml_definesh.go
│ │ ├── yaml_privateh.go
│ │ └── yamlh.go
│ ├── codegangsta/
│ │ └── cli/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── app.go
│ │ ├── appveyor.yml
│ │ ├── category.go
│ │ ├── cli.go
│ │ ├── command.go
│ │ ├── context.go
│ │ ├── errors.go
│ │ ├── flag.go
│ │ ├── funcs.go
│ │ ├── help.go
│ │ └── runtests
│ ├── coreos/
│ │ └── yaml/
│ │ ├── LICENSE
│ │ ├── LICENSE.libyaml
│ │ ├── README.md
│ │ ├── apic.go
│ │ ├── decode.go
│ │ ├── emitterc.go
│ │ ├── encode.go
│ │ ├── parserc.go
│ │ ├── readerc.go
│ │ ├── resolve.go
│ │ ├── scannerc.go
│ │ ├── sorter.go
│ │ ├── writerc.go
│ │ ├── yaml.go
│ │ ├── yamlh.go
│ │ └── yamlprivateh.go
│ ├── davecgh/
│ │ └── go-spew/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── cov_report.sh
│ │ ├── spew/
│ │ │ ├── bypass.go
│ │ │ ├── bypasssafe.go
│ │ │ ├── common.go
│ │ │ ├── config.go
│ │ │ ├── doc.go
│ │ │ ├── dump.go
│ │ │ ├── format.go
│ │ │ └── spew.go
│ │ └── test_coverage.txt
│ ├── docker/
│ │ ├── containerd/
│ │ │ ├── .gitignore
│ │ │ ├── CONTRIBUTING.md
│ │ │ ├── Dockerfile
│ │ │ ├── LICENSE.code
│ │ │ ├── LICENSE.docs
│ │ │ ├── MAINTAINERS
│ │ │ ├── Makefile
│ │ │ ├── NOTICE
│ │ │ ├── README.md
│ │ │ ├── osutils/
│ │ │ │ ├── fds.go
│ │ │ │ ├── prctl.go
│ │ │ │ ├── prctl_solaris.go
│ │ │ │ └── reaper.go
│ │ │ ├── subreaper/
│ │ │ │ ├── exec/
│ │ │ │ │ ├── copy.go
│ │ │ │ │ └── wrapper.go
│ │ │ │ └── reaper.go
│ │ │ └── trash.conf
│ │ ├── distribution/
│ │ │ ├── .gitignore
│ │ │ ├── .mailmap
│ │ │ ├── AUTHORS
│ │ │ ├── CONTRIBUTING.md
│ │ │ ├── Dockerfile
│ │ │ ├── LICENSE
│ │ │ ├── MAINTAINERS
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── ROADMAP.md
│ │ │ ├── blobs.go
│ │ │ ├── circle.yml
│ │ │ ├── context/
│ │ │ │ ├── context.go
│ │ │ │ ├── doc.go
│ │ │ │ ├── http.go
│ │ │ │ ├── logger.go
│ │ │ │ ├── trace.go
│ │ │ │ ├── util.go
│ │ │ │ └── version.go
│ │ │ ├── coverpkg.sh
│ │ │ ├── digest/
│ │ │ │ ├── digest.go
│ │ │ │ ├── digester.go
│ │ │ │ ├── doc.go
│ │ │ │ ├── set.go
│ │ │ │ └── verifiers.go
│ │ │ ├── doc.go
│ │ │ ├── errors.go
│ │ │ ├── manifests.go
│ │ │ ├── reference/
│ │ │ │ ├── reference.go
│ │ │ │ └── regexp.go
│ │ │ ├── registry/
│ │ │ │ ├── api/
│ │ │ │ │ ├── errcode/
│ │ │ │ │ │ ├── errors.go
│ │ │ │ │ │ ├── handler.go
│ │ │ │ │ │ └── register.go
│ │ │ │ │ └── v2/
│ │ │ │ │ ├── descriptors.go
│ │ │ │ │ ├── doc.go
│ │ │ │ │ ├── errors.go
│ │ │ │ │ ├── routes.go
│ │ │ │ │ └── urls.go
│ │ │ │ ├── client/
│ │ │ │ │ ├── auth/
│ │ │ │ │ │ ├── api_version.go
│ │ │ │ │ │ ├── authchallenge.go
│ │ │ │ │ │ └── session.go
│ │ │ │ │ ├── blob_writer.go
│ │ │ │ │ ├── errors.go
│ │ │ │ │ ├── repository.go
│ │ │ │ │ └── transport/
│ │ │ │ │ ├── http_reader.go
│ │ │ │ │ └── transport.go
│ │ │ │ └── storage/
│ │ │ │ └── cache/
│ │ │ │ ├── cache.go
│ │ │ │ ├── cachedblobdescriptorstore.go
│ │ │ │ └── memory/
│ │ │ │ └── memory.go
│ │ │ ├── registry.go
│ │ │ ├── tags.go
│ │ │ └── uuid/
│ │ │ └── uuid.go
│ │ ├── docker/
│ │ │ ├── .dockerignore
│ │ │ ├── .gitignore
│ │ │ ├── Dockerfile.dapper
│ │ │ ├── LICENSE
│ │ │ ├── Makefile
│ │ │ ├── NOTICE
│ │ │ ├── builder/
│ │ │ │ ├── builder.go
│ │ │ │ ├── context.go
│ │ │ │ ├── context_unix.go
│ │ │ │ ├── dockerignore/
│ │ │ │ │ └── dockerignore.go
│ │ │ │ ├── dockerignore.go
│ │ │ │ ├── git.go
│ │ │ │ ├── remote.go
│ │ │ │ └── tarsum.go
│ │ │ ├── cliconfig/
│ │ │ │ └── config.go
│ │ │ ├── daemon/
│ │ │ │ └── graphdriver/
│ │ │ │ ├── counter.go
│ │ │ │ ├── driver.go
│ │ │ │ ├── driver_freebsd.go
│ │ │ │ ├── driver_linux.go
│ │ │ │ ├── driver_unsupported.go
│ │ │ │ ├── fsdiff.go
│ │ │ │ ├── plugin.go
│ │ │ │ ├── plugin_unsupported.go
│ │ │ │ └── proxy.go
│ │ │ ├── image/
│ │ │ │ ├── fs.go
│ │ │ │ ├── image.go
│ │ │ │ ├── rootfs.go
│ │ │ │ ├── rootfs_unix.go
│ │ │ │ ├── store.go
│ │ │ │ └── v1/
│ │ │ │ └── imagev1.go
│ │ │ ├── layer/
│ │ │ │ ├── empty.go
│ │ │ │ ├── filestore.go
│ │ │ │ ├── layer.go
│ │ │ │ ├── layer_store.go
│ │ │ │ ├── layer_unix.go
│ │ │ │ ├── migration.go
│ │ │ │ ├── mounted_layer.go
│ │ │ │ └── ro_layer.go
│ │ │ ├── opts/
│ │ │ │ ├── hosts.go
│ │ │ │ ├── hosts_unix.go
│ │ │ │ ├── ip.go
│ │ │ │ ├── opts.go
│ │ │ │ └── opts_unix.go
│ │ │ ├── pkg/
│ │ │ │ ├── README.md
│ │ │ │ ├── archive/
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── archive.go
│ │ │ │ │ ├── archive_unix.go
│ │ │ │ │ ├── changes.go
│ │ │ │ │ ├── changes_linux.go
│ │ │ │ │ ├── changes_other.go
│ │ │ │ │ ├── changes_unix.go
│ │ │ │ │ ├── copy.go
│ │ │ │ │ ├── copy_unix.go
│ │ │ │ │ ├── diff.go
│ │ │ │ │ ├── example_changes.go
│ │ │ │ │ ├── time_linux.go
│ │ │ │ │ ├── time_unsupported.go
│ │ │ │ │ ├── whiteouts.go
│ │ │ │ │ └── wrap.go
│ │ │ │ ├── chrootarchive/
│ │ │ │ │ ├── archive.go
│ │ │ │ │ ├── archive_unix.go
│ │ │ │ │ ├── diff.go
│ │ │ │ │ ├── diff_unix.go
│ │ │ │ │ └── init_unix.go
│ │ │ │ ├── fileutils/
│ │ │ │ │ ├── fileutils.go
│ │ │ │ │ └── fileutils_unix.go
│ │ │ │ ├── gitutils/
│ │ │ │ │ └── gitutils.go
│ │ │ │ ├── homedir/
│ │ │ │ │ └── homedir.go
│ │ │ │ ├── httputils/
│ │ │ │ │ ├── httputils.go
│ │ │ │ │ ├── mimetype.go
│ │ │ │ │ └── resumablerequestreader.go
│ │ │ │ ├── idtools/
│ │ │ │ │ ├── idtools.go
│ │ │ │ │ ├── idtools_unix.go
│ │ │ │ │ ├── usergroupadd_linux.go
│ │ │ │ │ └── usergroupadd_unsupported.go
│ │ │ │ ├── ioutils/
│ │ │ │ │ ├── bytespipe.go
│ │ │ │ │ ├── fmt.go
│ │ │ │ │ ├── multireader.go
│ │ │ │ │ ├── readers.go
│ │ │ │ │ ├── scheduler.go
│ │ │ │ │ ├── scheduler_gccgo.go
│ │ │ │ │ ├── temp_unix.go
│ │ │ │ │ ├── writeflusher.go
│ │ │ │ │ └── writers.go
│ │ │ │ ├── jsonlog/
│ │ │ │ │ ├── jsonlog.go
│ │ │ │ │ ├── jsonlog_marshalling.go
│ │ │ │ │ ├── jsonlogbytes.go
│ │ │ │ │ └── time_marshalling.go
│ │ │ │ ├── jsonmessage/
│ │ │ │ │ └── jsonmessage.go
│ │ │ │ ├── mflag/
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── README.md
│ │ │ │ │ └── flag.go
│ │ │ │ ├── mount/
│ │ │ │ │ ├── flags.go
│ │ │ │ │ ├── flags_freebsd.go
│ │ │ │ │ ├── flags_linux.go
│ │ │ │ │ ├── flags_unsupported.go
│ │ │ │ │ ├── mount.go
│ │ │ │ │ ├── mounter_freebsd.go
│ │ │ │ │ ├── mounter_linux.go
│ │ │ │ │ ├── mounter_unsupported.go
│ │ │ │ │ ├── mountinfo.go
│ │ │ │ │ ├── mountinfo_freebsd.go
│ │ │ │ │ ├── mountinfo_linux.go
│ │ │ │ │ ├── mountinfo_unsupported.go
│ │ │ │ │ └── sharedsubtree_linux.go
│ │ │ │ ├── plugins/
│ │ │ │ │ ├── client.go
│ │ │ │ │ ├── discovery.go
│ │ │ │ │ ├── errors.go
│ │ │ │ │ ├── plugins.go
│ │ │ │ │ └── transport/
│ │ │ │ │ ├── http.go
│ │ │ │ │ └── transport.go
│ │ │ │ ├── pools/
│ │ │ │ │ └── pools.go
│ │ │ │ ├── progress/
│ │ │ │ │ ├── progress.go
│ │ │ │ │ └── progressreader.go
│ │ │ │ ├── promise/
│ │ │ │ │ └── promise.go
│ │ │ │ ├── random/
│ │ │ │ │ └── random.go
│ │ │ │ ├── reexec/
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── command_freebsd.go
│ │ │ │ │ ├── command_linux.go
│ │ │ │ │ ├── command_unsupported.go
│ │ │ │ │ └── reexec.go
│ │ │ │ ├── signal/
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── signal.go
│ │ │ │ │ ├── signal_darwin.go
│ │ │ │ │ ├── signal_freebsd.go
│ │ │ │ │ ├── signal_linux.go
│ │ │ │ │ ├── signal_unix.go
│ │ │ │ │ ├── signal_unsupported.go
│ │ │ │ │ └── trap.go
│ │ │ │ ├── stdcopy/
│ │ │ │ │ └── stdcopy.go
│ │ │ │ ├── streamformatter/
│ │ │ │ │ └── streamformatter.go
│ │ │ │ ├── stringid/
│ │ │ │ │ ├── README.md
│ │ │ │ │ └── stringid.go
│ │ │ │ ├── symlink/
│ │ │ │ │ ├── LICENSE.APACHE
│ │ │ │ │ ├── LICENSE.BSD
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── fs.go
│ │ │ │ │ └── fs_unix.go
│ │ │ │ ├── system/
│ │ │ │ │ ├── chtimes.go
│ │ │ │ │ ├── chtimes_unix.go
│ │ │ │ │ ├── errors.go
│ │ │ │ │ ├── filesys.go
│ │ │ │ │ ├── lstat.go
│ │ │ │ │ ├── meminfo.go
│ │ │ │ │ ├── meminfo_linux.go
│ │ │ │ │ ├── meminfo_unsupported.go
│ │ │ │ │ ├── mknod.go
│ │ │ │ │ ├── path_unix.go
│ │ │ │ │ ├── stat.go
│ │ │ │ │ ├── stat_freebsd.go
│ │ │ │ │ ├── stat_linux.go
│ │ │ │ │ ├── stat_openbsd.go
│ │ │ │ │ ├── stat_solaris.go
│ │ │ │ │ ├── stat_unsupported.go
│ │ │ │ │ ├── syscall_unix.go
│ │ │ │ │ ├── umask.go
│ │ │ │ │ ├── utimes_darwin.go
│ │ │ │ │ ├── utimes_freebsd.go
│ │ │ │ │ ├── utimes_linux.go
│ │ │ │ │ ├── utimes_unsupported.go
│ │ │ │ │ ├── xattrs_linux.go
│ │ │ │ │ └── xattrs_unsupported.go
│ │ │ │ ├── tarsum/
│ │ │ │ │ ├── builder_context.go
│ │ │ │ │ ├── fileinfosums.go
│ │ │ │ │ ├── tarsum.go
│ │ │ │ │ ├── tarsum_spec.md
│ │ │ │ │ ├── versioning.go
│ │ │ │ │ └── writercloser.go
│ │ │ │ ├── term/
│ │ │ │ │ ├── ascii.go
│ │ │ │ │ ├── tc_linux_cgo.go
│ │ │ │ │ ├── tc_other.go
│ │ │ │ │ ├── term.go
│ │ │ │ │ ├── termios_darwin.go
│ │ │ │ │ ├── termios_freebsd.go
│ │ │ │ │ ├── termios_linux.go
│ │ │ │ │ └── termios_openbsd.go
│ │ │ │ ├── urlutil/
│ │ │ │ │ └── urlutil.go
│ │ │ │ └── version/
│ │ │ │ └── version.go
│ │ │ ├── reference/
│ │ │ │ ├── reference.go
│ │ │ │ └── store.go
│ │ │ ├── registry/
│ │ │ │ ├── auth.go
│ │ │ │ ├── config.go
│ │ │ │ ├── config_unix.go
│ │ │ │ ├── endpoint_v1.go
│ │ │ │ ├── reference.go
│ │ │ │ ├── registry.go
│ │ │ │ ├── service.go
│ │ │ │ ├── service_v1.go
│ │ │ │ ├── service_v2.go
│ │ │ │ ├── session.go
│ │ │ │ └── types.go
│ │ │ ├── runconfig/
│ │ │ │ └── opts/
│ │ │ │ ├── envfile.go
│ │ │ │ ├── opts.go
│ │ │ │ ├── parse.go
│ │ │ │ ├── throttledevice.go
│ │ │ │ ├── ulimit.go
│ │ │ │ └── weightdevice.go
│ │ │ └── trash.conf
│ │ ├── engine-api/
│ │ │ ├── .travis.yml
│ │ │ ├── CHANGELOG.md
│ │ │ ├── CONTRIBUTING.md
│ │ │ ├── LICENSE
│ │ │ ├── MAINTAINERS
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── appveyor.yml
│ │ │ ├── client/
│ │ │ │ ├── client.go
│ │ │ │ ├── client_darwin.go
│ │ │ │ ├── client_unix.go
│ │ │ │ ├── client_windows.go
│ │ │ │ ├── container_attach.go
│ │ │ │ ├── container_commit.go
│ │ │ │ ├── container_copy.go
│ │ │ │ ├── container_create.go
│ │ │ │ ├── container_diff.go
│ │ │ │ ├── container_exec.go
│ │ │ │ ├── container_export.go
│ │ │ │ ├── container_inspect.go
│ │ │ │ ├── container_kill.go
│ │ │ │ ├── container_list.go
│ │ │ │ ├── container_logs.go
│ │ │ │ ├── container_pause.go
│ │ │ │ ├── container_remove.go
│ │ │ │ ├── container_rename.go
│ │ │ │ ├── container_resize.go
│ │ │ │ ├── container_restart.go
│ │ │ │ ├── container_start.go
│ │ │ │ ├── container_stats.go
│ │ │ │ ├── container_stop.go
│ │ │ │ ├── container_top.go
│ │ │ │ ├── container_unpause.go
│ │ │ │ ├── container_update.go
│ │ │ │ ├── container_wait.go
│ │ │ │ ├── errors.go
│ │ │ │ ├── events.go
│ │ │ │ ├── hijack.go
│ │ │ │ ├── image_build.go
│ │ │ │ ├── image_create.go
│ │ │ │ ├── image_history.go
│ │ │ │ ├── image_import.go
│ │ │ │ ├── image_inspect.go
│ │ │ │ ├── image_list.go
│ │ │ │ ├── image_load.go
│ │ │ │ ├── image_pull.go
│ │ │ │ ├── image_push.go
│ │ │ │ ├── image_remove.go
│ │ │ │ ├── image_save.go
│ │ │ │ ├── image_search.go
│ │ │ │ ├── image_tag.go
│ │ │ │ ├── info.go
│ │ │ │ ├── interface.go
│ │ │ │ ├── login.go
│ │ │ │ ├── network_connect.go
│ │ │ │ ├── network_create.go
│ │ │ │ ├── network_disconnect.go
│ │ │ │ ├── network_inspect.go
│ │ │ │ ├── network_list.go
│ │ │ │ ├── network_remove.go
│ │ │ │ ├── privileged.go
│ │ │ │ ├── request.go
│ │ │ │ ├── transport/
│ │ │ │ │ ├── cancellable/
│ │ │ │ │ │ ├── canceler.go
│ │ │ │ │ │ ├── canceler_go14.go
│ │ │ │ │ │ └── cancellable.go
│ │ │ │ │ ├── client.go
│ │ │ │ │ └── transport.go
│ │ │ │ ├── version.go
│ │ │ │ ├── volume_create.go
│ │ │ │ ├── volume_inspect.go
│ │ │ │ ├── volume_list.go
│ │ │ │ └── volume_remove.go
│ │ │ └── types/
│ │ │ ├── auth.go
│ │ │ ├── blkiodev/
│ │ │ │ └── blkio.go
│ │ │ ├── client.go
│ │ │ ├── configs.go
│ │ │ ├── container/
│ │ │ │ ├── config.go
│ │ │ │ ├── host_config.go
│ │ │ │ ├── hostconfig_unix.go
│ │ │ │ └── hostconfig_windows.go
│ │ │ ├── filters/
│ │ │ │ └── parse.go
│ │ │ ├── network/
│ │ │ │ └── network.go
│ │ │ ├── registry/
│ │ │ │ └── registry.go
│ │ │ ├── seccomp.go
│ │ │ ├── stats.go
│ │ │ ├── strslice/
│ │ │ │ └── strslice.go
│ │ │ ├── time/
│ │ │ │ └── timestamp.go
│ │ │ └── types.go
│ │ ├── go-connections/
│ │ │ ├── CONTRIBUTING.md
│ │ │ ├── LICENSE
│ │ │ ├── MAINTAINERS
│ │ │ ├── README.md
│ │ │ ├── circle.yml
│ │ │ ├── nat/
│ │ │ │ ├── nat.go
│ │ │ │ ├── parse.go
│ │ │ │ └── sort.go
│ │ │ ├── sockets/
│ │ │ │ ├── README.md
│ │ │ │ ├── inmem_socket.go
│ │ │ │ ├── proxy.go
│ │ │ │ ├── sockets.go
│ │ │ │ ├── sockets_unix.go
│ │ │ │ ├── sockets_windows.go
│ │ │ │ ├── tcp_socket.go
│ │ │ │ └── unix_socket.go
│ │ │ └── tlsconfig/
│ │ │ ├── config.go
│ │ │ ├── config_client_ciphers.go
│ │ │ └── config_legacy_client_ciphers.go
│ │ ├── go-units/
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── circle.yml
│ │ │ ├── duration.go
│ │ │ ├── size.go
│ │ │ └── ulimit.go
│ │ ├── libcompose/
│ │ │ ├── .dockerignore
│ │ │ ├── .gitignore
│ │ │ ├── CHANGELOG.md
│ │ │ ├── CONTRIBUTING.md
│ │ │ ├── Dockerfile
│ │ │ ├── Jenkinsfile
│ │ │ ├── LICENSE
│ │ │ ├── MAINTAINERS
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── cli/
│ │ │ │ ├── app/
│ │ │ │ │ ├── app.go
│ │ │ │ │ ├── types.go
│ │ │ │ │ └── version.go
│ │ │ │ ├── docker/
│ │ │ │ │ └── app/
│ │ │ │ │ ├── commands.go
│ │ │ │ │ └── factory.go
│ │ │ │ └── logger/
│ │ │ │ ├── color_logger.go
│ │ │ │ └── colors.go
│ │ │ ├── config/
│ │ │ │ ├── convert.go
│ │ │ │ ├── hash.go
│ │ │ │ ├── interpolation.go
│ │ │ │ ├── merge.go
│ │ │ │ ├── merge_v1.go
│ │ │ │ ├── merge_v2.go
│ │ │ │ ├── schema.go
│ │ │ │ ├── schema_helpers.go
│ │ │ │ ├── types.go
│ │ │ │ ├── utils.go
│ │ │ │ └── validation.go
│ │ │ ├── docker/
│ │ │ │ ├── auth.go
│ │ │ │ ├── builder/
│ │ │ │ │ └── builder.go
│ │ │ │ ├── client/
│ │ │ │ │ └── client.go
│ │ │ │ ├── container.go
│ │ │ │ ├── context.go
│ │ │ │ ├── convert.go
│ │ │ │ ├── functions.go
│ │ │ │ ├── image.go
│ │ │ │ ├── name.go
│ │ │ │ ├── project.go
│ │ │ │ ├── service.go
│ │ │ │ └── service_factory.go
│ │ │ ├── labels/
│ │ │ │ └── labels.go
│ │ │ ├── logger/
│ │ │ │ ├── null.go
│ │ │ │ └── types.go
│ │ │ ├── lookup/
│ │ │ │ ├── composable.go
│ │ │ │ ├── envfile.go
│ │ │ │ ├── file.go
│ │ │ │ └── simple_env.go
│ │ │ ├── project/
│ │ │ │ ├── client_factory.go
│ │ │ │ ├── container.go
│ │ │ │ ├── context.go
│ │ │ │ ├── empty.go
│ │ │ │ ├── events/
│ │ │ │ │ └── events.go
│ │ │ │ ├── info.go
│ │ │ │ ├── interface.go
│ │ │ │ ├── listener.go
│ │ │ │ ├── options/
│ │ │ │ │ └── types.go
│ │ │ │ ├── project.go
│ │ │ │ ├── service-wrapper.go
│ │ │ │ ├── service.go
│ │ │ │ └── utils.go
│ │ │ ├── utils/
│ │ │ │ └── util.go
│ │ │ ├── version/
│ │ │ │ └── version.go
│ │ │ └── yaml/
│ │ │ └── types_yaml.go
│ │ ├── libnetwork/
│ │ │ ├── .dockerignore
│ │ │ ├── .gitignore
│ │ │ ├── CHANGELOG.md
│ │ │ ├── Dockerfile.build
│ │ │ ├── LICENSE
│ │ │ ├── MAINTAINERS
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── ROADMAP.md
│ │ │ ├── Vagrantfile
│ │ │ ├── circle.yml
│ │ │ ├── machines
│ │ │ ├── resolvconf/
│ │ │ │ ├── README.md
│ │ │ │ ├── dns/
│ │ │ │ │ └── resolvconf.go
│ │ │ │ └── resolvconf.go
│ │ │ └── wrapmake.sh
│ │ └── machine/
│ │ ├── .dockerignore
│ │ ├── .gitignore
│ │ ├── .godir
│ │ ├── .travis.yml
│ │ ├── CHANGELOG.md
│ │ ├── CONTRIBUTING.md
│ │ ├── Dockerfile
│ │ ├── LICENSE
│ │ ├── MAINTAINERS
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── ROADMAP.md
│ │ ├── log/
│ │ │ ├── log.go
│ │ │ └── terminal.go
│ │ └── utils/
│ │ ├── b2d.go
│ │ ├── certs.go
│ │ └── utils.go
│ ├── fatih/
│ │ └── structs/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── field.go
│ │ ├── structs.go
│ │ └── tags.go
│ ├── flynn/
│ │ └── go-shlex/
│ │ ├── COPYING
│ │ ├── Makefile
│ │ ├── README.md
│ │ └── shlex.go
│ ├── gorilla/
│ │ ├── context/
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── context.go
│ │ │ └── doc.go
│ │ └── mux/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── mux.go
│ │ ├── regexp.go
│ │ └── route.go
│ ├── opencontainers/
│ │ └── runc/
│ │ ├── .gitignore
│ │ ├── CONTRIBUTING.md
│ │ ├── Dockerfile
│ │ ├── LICENSE
│ │ ├── MAINTAINERS
│ │ ├── MAINTAINERS_GUIDE.md
│ │ ├── Makefile
│ │ ├── NOTICE
│ │ ├── PRINCIPLES.md
│ │ ├── README.md
│ │ └── libcontainer/
│ │ ├── README.md
│ │ ├── SPEC.md
│ │ └── user/
│ │ ├── MAINTAINERS
│ │ ├── lookup.go
│ │ ├── lookup_unix.go
│ │ ├── lookup_unsupported.go
│ │ └── user.go
│ ├── packethost/
│ │ └── packngo/
│ │ ├── .drone.yml
│ │ ├── .gitignore
│ │ ├── LICENSE.txt
│ │ ├── README.md
│ │ └── metadata/
│ │ └── metadata.go
│ ├── pin/
│ │ └── tftp/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── backoff.go
│ │ ├── client.go
│ │ ├── netascii/
│ │ │ └── netascii.go
│ │ ├── packet.go
│ │ ├── receiver.go
│ │ ├── sender.go
│ │ └── server.go
│ ├── pkg/
│ │ └── errors/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── appveyor.yml
│ │ ├── errors.go
│ │ └── stack.go
│ ├── pmezard/
│ │ └── go-difflib/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── difflib/
│ │ └── difflib.go
│ ├── ryanuber/
│ │ └── go-glob/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── glob.go
│ ├── sigma/
│ │ ├── bdoor/
│ │ │ ├── LICENSE
│ │ │ ├── README
│ │ │ └── check.go
│ │ ├── vmw-guestinfo/
│ │ │ ├── CDDL.txt
│ │ │ ├── LGPL.txt
│ │ │ ├── LICENSE
│ │ │ ├── README
│ │ │ ├── rpcvmx/
│ │ │ │ └── rpcvmx.go
│ │ │ └── vmcheck/
│ │ │ ├── vmcheck.go
│ │ │ ├── vmcheck_386.s
│ │ │ ├── vmcheck_amd64.s
│ │ │ ├── vmcheck_general.go
│ │ │ └── vmcheck_linux.go
│ │ └── vmw-ovflib/
│ │ ├── LICENSE
│ │ ├── README
│ │ └── ovf.go
│ ├── stretchr/
│ │ └── testify/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENCE.txt
│ │ ├── README.md
│ │ ├── assert/
│ │ │ ├── assertions.go
│ │ │ ├── doc.go
│ │ │ ├── errors.go
│ │ │ ├── forward_assertions.go
│ │ │ └── http_assertions.go
│ │ └── require/
│ │ ├── doc.go
│ │ ├── forward_requirements.go
│ │ └── requirements.go
│ ├── tredoe/
│ │ └── term/
│ │ ├── AUTHORS.md
│ │ ├── CONTRIBUTORS.md
│ │ ├── LICENSE-MPL.txt
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── sys/
│ │ │ ├── doc.go
│ │ │ ├── key_unix.go
│ │ │ ├── sys_bsd.go
│ │ │ ├── sys_linux.go
│ │ │ ├── sys_unix.go
│ │ │ ├── z-sys_darwin_386.go
│ │ │ ├── z-sys_darwin_amd64.go
│ │ │ ├── z-sys_freebsd.go
│ │ │ ├── z-sys_linux.go
│ │ │ ├── z-sys_netbsd.go
│ │ │ └── z-sys_openbsd.go
│ │ ├── term.go
│ │ ├── term_unix.go
│ │ └── util_unix.go
│ ├── vbatts/
│ │ └── tar-split/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── archive/
│ │ │ └── tar/
│ │ │ ├── common.go
│ │ │ ├── reader.go
│ │ │ ├── stat_atim.go
│ │ │ ├── stat_atimespec.go
│ │ │ ├── stat_unix.go
│ │ │ └── writer.go
│ │ └── tar/
│ │ ├── asm/
│ │ │ ├── README.md
│ │ │ ├── assemble.go
│ │ │ ├── disassemble.go
│ │ │ └── doc.go
│ │ └── storage/
│ │ ├── doc.go
│ │ ├── entry.go
│ │ ├── getter.go
│ │ └── packer.go
│ ├── vishvananda/
│ │ ├── netlink/
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── addr.go
│ │ │ ├── addr_linux.go
│ │ │ ├── bpf_linux.go
│ │ │ ├── bridge_linux.go
│ │ │ ├── class.go
│ │ │ ├── class_linux.go
│ │ │ ├── conntrack_linux.go
│ │ │ ├── conntrack_unspecified.go
│ │ │ ├── filter.go
│ │ │ ├── filter_linux.go
│ │ │ ├── genetlink_linux.go
│ │ │ ├── genetlink_unspecified.go
│ │ │ ├── gtp_linux.go
│ │ │ ├── handle_linux.go
│ │ │ ├── handle_unspecified.go
│ │ │ ├── link.go
│ │ │ ├── link_linux.go
│ │ │ ├── link_tuntap_linux.go
│ │ │ ├── neigh.go
│ │ │ ├── neigh_linux.go
│ │ │ ├── netlink.go
│ │ │ ├── netlink_linux.go
│ │ │ ├── netlink_unspecified.go
│ │ │ ├── nl/
│ │ │ │ ├── addr_linux.go
│ │ │ │ ├── bridge_linux.go
│ │ │ │ ├── conntrack_linux.go
│ │ │ │ ├── genetlink_linux.go
│ │ │ │ ├── link_linux.go
│ │ │ │ ├── mpls_linux.go
│ │ │ │ ├── nl_linux.go
│ │ │ │ ├── nl_unspecified.go
│ │ │ │ ├── route_linux.go
│ │ │ │ ├── syscall.go
│ │ │ │ ├── tc_linux.go
│ │ │ │ ├── xfrm_linux.go
│ │ │ │ ├── xfrm_monitor_linux.go
│ │ │ │ ├── xfrm_policy_linux.go
│ │ │ │ └── xfrm_state_linux.go
│ │ │ ├── order.go
│ │ │ ├── protinfo.go
│ │ │ ├── protinfo_linux.go
│ │ │ ├── qdisc.go
│ │ │ ├── qdisc_linux.go
│ │ │ ├── route.go
│ │ │ ├── route_linux.go
│ │ │ ├── route_unspecified.go
│ │ │ ├── rule.go
│ │ │ ├── rule_linux.go
│ │ │ ├── socket.go
│ │ │ ├── socket_linux.go
│ │ │ ├── xfrm.go
│ │ │ ├── xfrm_monitor_linux.go
│ │ │ ├── xfrm_policy.go
│ │ │ ├── xfrm_policy_linux.go
│ │ │ ├── xfrm_state.go
│ │ │ └── xfrm_state_linux.go
│ │ └── netns/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── netns.go
│ │ ├── netns_linux.go
│ │ └── netns_unspecified.go
│ ├── vmware/
│ │ └── vmw-guestinfo/
│ │ ├── LICENSE
│ │ ├── README
│ │ ├── bdoor/
│ │ │ ├── bdoor.go
│ │ │ ├── bdoor_386.go
│ │ │ ├── bdoor_386.s
│ │ │ ├── bdoor_amd64.go
│ │ │ ├── bdoor_amd64.s
│ │ │ └── word.go
│ │ ├── go.mod
│ │ ├── message/
│ │ │ ├── log.go
│ │ │ └── message.go
│ │ └── rpcout/
│ │ └── rpcout.go
│ └── xeipuuv/
│ ├── gojsonpointer/
│ │ ├── LICENSE-APACHE-2.0.txt
│ │ ├── README.md
│ │ └── pointer.go
│ ├── gojsonreference/
│ │ ├── LICENSE-APACHE-2.0.txt
│ │ ├── README.md
│ │ └── reference.go
│ └── gojsonschema/
│ ├── .gitignore
│ ├── .travis.yml
│ ├── LICENSE-APACHE-2.0.txt
│ ├── README.md
│ ├── errors.go
│ ├── format_checkers.go
│ ├── glide.yaml
│ ├── internalLog.go
│ ├── jsonContext.go
│ ├── jsonLoader.go
│ ├── locales.go
│ ├── result.go
│ ├── schema.go
│ ├── schemaPool.go
│ ├── schemaReferencePool.go
│ ├── schemaType.go
│ ├── subSchema.go
│ ├── types.go
│ ├── utils.go
│ └── validation.go
└── golang.org/
└── x/
├── crypto/
│ ├── .gitattributes
│ ├── .gitignore
│ ├── AUTHORS
│ ├── CONTRIBUTING.md
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ ├── README
│ ├── codereview.cfg
│ └── ssh/
│ └── terminal/
│ ├── terminal.go
│ ├── util.go
│ ├── util_bsd.go
│ ├── util_linux.go
│ └── util_windows.go
├── net/
│ ├── .gitattributes
│ ├── .gitignore
│ ├── AUTHORS
│ ├── CONTRIBUTING.md
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ ├── README.md
│ ├── codereview.cfg
│ ├── context/
│ │ ├── context.go
│ │ ├── go17.go
│ │ ├── go19.go
│ │ ├── pre_go17.go
│ │ └── pre_go19.go
│ ├── go.mod
│ ├── go.sum
│ ├── internal/
│ │ └── socks/
│ │ ├── client.go
│ │ └── socks.go
│ └── proxy/
│ ├── dial.go
│ ├── direct.go
│ ├── per_host.go
│ ├── proxy.go
│ └── socks5.go
└── sys/
├── .gitattributes
├── .gitignore
├── AUTHORS
├── CONTRIBUTING.md
├── CONTRIBUTORS
├── LICENSE
├── PATENTS
├── README.md
├── codereview.cfg
├── go.mod
├── internal/
│ └── unsafeheader/
│ └── unsafeheader.go
├── unix/
│ ├── .gitignore
│ ├── README.md
│ ├── affinity_linux.go
│ ├── aliases.go
│ ├── asm_aix_ppc64.s
│ ├── asm_darwin_386.s
│ ├── asm_darwin_amd64.s
│ ├── asm_darwin_arm.s
│ ├── asm_darwin_arm64.s
│ ├── asm_dragonfly_amd64.s
│ ├── asm_freebsd_386.s
│ ├── asm_freebsd_amd64.s
│ ├── asm_freebsd_arm.s
│ ├── asm_freebsd_arm64.s
│ ├── asm_linux_386.s
│ ├── asm_linux_amd64.s
│ ├── asm_linux_arm.s
│ ├── asm_linux_arm64.s
│ ├── asm_linux_mips64x.s
│ ├── asm_linux_mipsx.s
│ ├── asm_linux_ppc64x.s
│ ├── asm_linux_riscv64.s
│ ├── asm_linux_s390x.s
│ ├── asm_netbsd_386.s
│ ├── asm_netbsd_amd64.s
│ ├── asm_netbsd_arm.s
│ ├── asm_netbsd_arm64.s
│ ├── asm_openbsd_386.s
│ ├── asm_openbsd_amd64.s
│ ├── asm_openbsd_arm.s
│ ├── asm_openbsd_arm64.s
│ ├── asm_solaris_amd64.s
│ ├── bluetooth_linux.go
│ ├── cap_freebsd.go
│ ├── constants.go
│ ├── dev_aix_ppc.go
│ ├── dev_aix_ppc64.go
│ ├── dev_darwin.go
│ ├── dev_dragonfly.go
│ ├── dev_freebsd.go
│ ├── dev_linux.go
│ ├── dev_netbsd.go
│ ├── dev_openbsd.go
│ ├── dirent.go
│ ├── endian_big.go
│ ├── endian_little.go
│ ├── env_unix.go
│ ├── errors_freebsd_386.go
│ ├── errors_freebsd_amd64.go
│ ├── errors_freebsd_arm.go
│ ├── errors_freebsd_arm64.go
│ ├── fcntl.go
│ ├── fcntl_darwin.go
│ ├── fcntl_linux_32bit.go
│ ├── fdset.go
│ ├── gccgo.go
│ ├── gccgo_c.c
│ ├── gccgo_linux_amd64.go
│ ├── ioctl.go
│ ├── mkall.sh
│ ├── mkasm_darwin.go
│ ├── mkerrors.sh
│ ├── mkmerge.go
│ ├── mkpost.go
│ ├── mksyscall.go
│ ├── mksyscall_aix_ppc.go
│ ├── mksyscall_aix_ppc64.go
│ ├── mksyscall_solaris.go
│ ├── mksysctl_openbsd.go
│ ├── mksysnum.go
│ ├── pagesize_unix.go
│ ├── pledge_openbsd.go
│ ├── race.go
│ ├── race0.go
│ ├── readdirent_getdents.go
│ ├── readdirent_getdirentries.go
│ ├── sockcmsg_dragonfly.go
│ ├── sockcmsg_linux.go
│ ├── sockcmsg_unix.go
│ ├── sockcmsg_unix_other.go
│ ├── str.go
│ ├── syscall.go
│ ├── syscall_aix.go
│ ├── syscall_aix_ppc.go
│ ├── syscall_aix_ppc64.go
│ ├── syscall_bsd.go
│ ├── syscall_darwin.1_12.go
│ ├── syscall_darwin.1_13.go
│ ├── syscall_darwin.go
│ ├── syscall_darwin_386.1_11.go
│ ├── syscall_darwin_386.go
│ ├── syscall_darwin_amd64.1_11.go
│ ├── syscall_darwin_amd64.go
│ ├── syscall_darwin_arm.1_11.go
│ ├── syscall_darwin_arm.go
│ ├── syscall_darwin_arm64.1_11.go
│ ├── syscall_darwin_arm64.go
│ ├── syscall_darwin_libSystem.go
│ ├── syscall_dragonfly.go
│ ├── syscall_dragonfly_amd64.go
│ ├── syscall_freebsd.go
│ ├── syscall_freebsd_386.go
│ ├── syscall_freebsd_amd64.go
│ ├── syscall_freebsd_arm.go
│ ├── syscall_freebsd_arm64.go
│ ├── syscall_illumos.go
│ ├── syscall_linux.go
│ ├── syscall_linux_386.go
│ ├── syscall_linux_amd64.go
│ ├── syscall_linux_amd64_gc.go
│ ├── syscall_linux_arm.go
│ ├── syscall_linux_arm64.go
│ ├── syscall_linux_gc.go
│ ├── syscall_linux_gc_386.go
│ ├── syscall_linux_gccgo_386.go
│ ├── syscall_linux_gccgo_arm.go
│ ├── syscall_linux_mips64x.go
│ ├── syscall_linux_mipsx.go
│ ├── syscall_linux_ppc64x.go
│ ├── syscall_linux_riscv64.go
│ ├── syscall_linux_s390x.go
│ ├── syscall_linux_sparc64.go
│ ├── syscall_netbsd.go
│ ├── syscall_netbsd_386.go
│ ├── syscall_netbsd_amd64.go
│ ├── syscall_netbsd_arm.go
│ ├── syscall_netbsd_arm64.go
│ ├── syscall_openbsd.go
│ ├── syscall_openbsd_386.go
│ ├── syscall_openbsd_amd64.go
│ ├── syscall_openbsd_arm.go
│ ├── syscall_openbsd_arm64.go
│ ├── syscall_solaris.go
│ ├── syscall_solaris_amd64.go
│ ├── syscall_unix.go
│ ├── syscall_unix_gc.go
│ ├── syscall_unix_gc_ppc64x.go
│ ├── timestruct.go
│ ├── types_aix.go
│ ├── types_darwin.go
│ ├── types_dragonfly.go
│ ├── types_freebsd.go
│ ├── types_netbsd.go
│ ├── types_openbsd.go
│ ├── types_solaris.go
│ ├── unveil_openbsd.go
│ ├── xattr_bsd.go
│ ├── zerrors_aix_ppc.go
│ ├── zerrors_aix_ppc64.go
│ ├── zerrors_darwin_386.go
│ ├── zerrors_darwin_amd64.go
│ ├── zerrors_darwin_arm.go
│ ├── zerrors_darwin_arm64.go
│ ├── zerrors_dragonfly_amd64.go
│ ├── zerrors_freebsd_386.go
│ ├── zerrors_freebsd_amd64.go
│ ├── zerrors_freebsd_arm.go
│ ├── zerrors_freebsd_arm64.go
│ ├── zerrors_linux.go
│ ├── zerrors_linux_386.go
│ ├── zerrors_linux_amd64.go
│ ├── zerrors_linux_arm.go
│ ├── zerrors_linux_arm64.go
│ ├── zerrors_linux_mips.go
│ ├── zerrors_linux_mips64.go
│ ├── zerrors_linux_mips64le.go
│ ├── zerrors_linux_mipsle.go
│ ├── zerrors_linux_ppc64.go
│ ├── zerrors_linux_ppc64le.go
│ ├── zerrors_linux_riscv64.go
│ ├── zerrors_linux_s390x.go
│ ├── zerrors_linux_sparc64.go
│ ├── zerrors_netbsd_386.go
│ ├── zerrors_netbsd_amd64.go
│ ├── zerrors_netbsd_arm.go
│ ├── zerrors_netbsd_arm64.go
│ ├── zerrors_openbsd_386.go
│ ├── zerrors_openbsd_amd64.go
│ ├── zerrors_openbsd_arm.go
│ ├── zerrors_openbsd_arm64.go
│ ├── zerrors_solaris_amd64.go
│ ├── zptrace_armnn_linux.go
│ ├── zptrace_linux_arm64.go
│ ├── zptrace_mipsnn_linux.go
│ ├── zptrace_mipsnnle_linux.go
│ ├── zptrace_x86_linux.go
│ ├── zsyscall_aix_ppc.go
│ ├── zsyscall_aix_ppc64.go
│ ├── zsyscall_aix_ppc64_gc.go
│ ├── zsyscall_aix_ppc64_gccgo.go
│ ├── zsyscall_darwin_386.1_11.go
│ ├── zsyscall_darwin_386.1_13.go
│ ├── zsyscall_darwin_386.1_13.s
│ ├── zsyscall_darwin_386.go
│ ├── zsyscall_darwin_386.s
│ ├── zsyscall_darwin_amd64.1_11.go
│ ├── zsyscall_darwin_amd64.1_13.go
│ ├── zsyscall_darwin_amd64.1_13.s
│ ├── zsyscall_darwin_amd64.go
│ ├── zsyscall_darwin_amd64.s
│ ├── zsyscall_darwin_arm.1_11.go
│ ├── zsyscall_darwin_arm.1_13.go
│ ├── zsyscall_darwin_arm.1_13.s
│ ├── zsyscall_darwin_arm.go
│ ├── zsyscall_darwin_arm.s
│ ├── zsyscall_darwin_arm64.1_11.go
│ ├── zsyscall_darwin_arm64.1_13.go
│ ├── zsyscall_darwin_arm64.1_13.s
│ ├── zsyscall_darwin_arm64.go
│ ├── zsyscall_darwin_arm64.s
│ ├── zsyscall_dragonfly_amd64.go
│ ├── zsyscall_freebsd_386.go
│ ├── zsyscall_freebsd_amd64.go
│ ├── zsyscall_freebsd_arm.go
│ ├── zsyscall_freebsd_arm64.go
│ ├── zsyscall_illumos_amd64.go
│ ├── zsyscall_linux.go
│ ├── zsyscall_linux_386.go
│ ├── zsyscall_linux_amd64.go
│ ├── zsyscall_linux_arm.go
│ ├── zsyscall_linux_arm64.go
│ ├── zsyscall_linux_mips.go
│ ├── zsyscall_linux_mips64.go
│ ├── zsyscall_linux_mips64le.go
│ ├── zsyscall_linux_mipsle.go
│ ├── zsyscall_linux_ppc64.go
│ ├── zsyscall_linux_ppc64le.go
│ ├── zsyscall_linux_riscv64.go
│ ├── zsyscall_linux_s390x.go
│ ├── zsyscall_linux_sparc64.go
│ ├── zsyscall_netbsd_386.go
│ ├── zsyscall_netbsd_amd64.go
│ ├── zsyscall_netbsd_arm.go
│ ├── zsyscall_netbsd_arm64.go
│ ├── zsyscall_openbsd_386.go
│ ├── zsyscall_openbsd_amd64.go
│ ├── zsyscall_openbsd_arm.go
│ ├── zsyscall_openbsd_arm64.go
│ ├── zsyscall_solaris_amd64.go
│ ├── zsysctl_openbsd_386.go
│ ├── zsysctl_openbsd_amd64.go
│ ├── zsysctl_openbsd_arm.go
│ ├── zsysctl_openbsd_arm64.go
│ ├── zsysnum_darwin_386.go
│ ├── zsysnum_darwin_amd64.go
│ ├── zsysnum_darwin_arm.go
│ ├── zsysnum_darwin_arm64.go
│ ├── zsysnum_dragonfly_amd64.go
│ ├── zsysnum_freebsd_386.go
│ ├── zsysnum_freebsd_amd64.go
│ ├── zsysnum_freebsd_arm.go
│ ├── zsysnum_freebsd_arm64.go
│ ├── zsysnum_linux_386.go
│ ├── zsysnum_linux_amd64.go
│ ├── zsysnum_linux_arm.go
│ ├── zsysnum_linux_arm64.go
│ ├── zsysnum_linux_mips.go
│ ├── zsysnum_linux_mips64.go
│ ├── zsysnum_linux_mips64le.go
│ ├── zsysnum_linux_mipsle.go
│ ├── zsysnum_linux_ppc64.go
│ ├── zsysnum_linux_ppc64le.go
│ ├── zsysnum_linux_riscv64.go
│ ├── zsysnum_linux_s390x.go
│ ├── zsysnum_linux_sparc64.go
│ ├── zsysnum_netbsd_386.go
│ ├── zsysnum_netbsd_amd64.go
│ ├── zsysnum_netbsd_arm.go
│ ├── zsysnum_netbsd_arm64.go
│ ├── zsysnum_openbsd_386.go
│ ├── zsysnum_openbsd_amd64.go
│ ├── zsysnum_openbsd_arm.go
│ ├── zsysnum_openbsd_arm64.go
│ ├── ztypes_aix_ppc.go
│ ├── ztypes_aix_ppc64.go
│ ├── ztypes_darwin_386.go
│ ├── ztypes_darwin_amd64.go
│ ├── ztypes_darwin_arm.go
│ ├── ztypes_darwin_arm64.go
│ ├── ztypes_dragonfly_amd64.go
│ ├── ztypes_freebsd_386.go
│ ├── ztypes_freebsd_amd64.go
│ ├── ztypes_freebsd_arm.go
│ ├── ztypes_freebsd_arm64.go
│ ├── ztypes_linux.go
│ ├── ztypes_linux_386.go
│ ├── ztypes_linux_amd64.go
│ ├── ztypes_linux_arm.go
│ ├── ztypes_linux_arm64.go
│ ├── ztypes_linux_mips.go
│ ├── ztypes_linux_mips64.go
│ ├── ztypes_linux_mips64le.go
│ ├── ztypes_linux_mipsle.go
│ ├── ztypes_linux_ppc64.go
│ ├── ztypes_linux_ppc64le.go
│ ├── ztypes_linux_riscv64.go
│ ├── ztypes_linux_s390x.go
│ ├── ztypes_linux_sparc64.go
│ ├── ztypes_netbsd_386.go
│ ├── ztypes_netbsd_amd64.go
│ ├── ztypes_netbsd_arm.go
│ ├── ztypes_netbsd_arm64.go
│ ├── ztypes_openbsd_386.go
│ ├── ztypes_openbsd_amd64.go
│ ├── ztypes_openbsd_arm.go
│ ├── ztypes_openbsd_arm64.go
│ └── ztypes_solaris_amd64.go
└── windows/
├── aliases.go
├── dll_windows.go
├── empty.s
├── env_windows.go
├── eventlog.go
├── exec_windows.go
├── memory_windows.go
├── mkerrors.bash
├── mkknownfolderids.bash
├── mksyscall.go
├── race.go
├── race0.go
├── security_windows.go
├── service.go
├── str.go
├── syscall.go
├── syscall_windows.go
├── types_windows.go
├── types_windows_386.go
├── types_windows_amd64.go
├── types_windows_arm.go
├── zerrors_windows.go
├── zknownfolderids_windows.go
└── zsyscall_windows.go
================================================
FILE CONTENTS
================================================
================================================
FILE: .dockerignore
================================================
.DS_Store
.idea
.trash-cache
bin
state
build
images/*/build
scripts/images/*/dist/
dist
tests/integration/.venv*
tests/integration/.tox
*/*/*/*.pyc
*/*/*/__pycache__
.trash-cache
vendor/*/*/*/.git
tmp
docs/_site
================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
**BurmillaOS Version: (ros os version)**
**Where are you running BurmillaOS? (docker-machine, AWS, GCE, baremetal, etc.)**
**Which processor architecture you are using?**
**Do you use some extra hardware? (GPU, etc)?**
**Which console you use (default, ubuntu, centos, etc..)**
**Do you use some service(s) which are not enabled by default?**
**Have you installed some extra tools to console?**
**Do you use some other customizations?**
**Please share copy of your cloud-init (remember remove all sensitive data first)**
```yaml
<replace with sudo ros config export output>
```
================================================
FILE: .github/workflows/create-release.yml
================================================
name: release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Install github-release
run: |
sudo wget https://github.com/github-release/github-release/releases/download/v0.9.0/linux-amd64-github-release.bz2 -O /usr/local/bin/github-release.bz2
sudo bunzip2 /usr/local/bin/github-release.bz2
sudo chmod 0755 /usr/local/bin/github-release
- name: Build OS
run: |
export VERSION=$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))
if [ -z "$VERSION" ]; then
echo "Build is not started from tag. Will exit..."
exit 1
fi
export OS_FIRMWARE=${{ github.event.inputs.firmware }}
export ARCH=amd64
make release
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Publish release
run: ${PWD}/dist/publish.sh
env:
GITHUB_TOKEN: ${{ secrets.OS_RELEASE_TOKEN }}
================================================
FILE: .github/workflows/pull-request-validation.yml
================================================
name: PR
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Test with dapper
run: |
make pr-validation
================================================
FILE: .gitignore
================================================
.DS_Store
/assets/ca.crt
/state
/bin
/build
/dist
/gopath
/images/*/build
/scripts/images/vmware/assets
.dockerfile
*.swp
/tests/integration/MANIFEST
/tests/integration/.venv*
/tests/integration/.tox
/tests/integration/.idea
*.pyc
__pycache__
/.dapper
/.trash-cache
/trash.lock
.idea
.trash-conf
/Dockerfile.dapper*
!/Dockerfile.dapper
scripts/images/raspberry-pi-hypriot64/Dockerfile.dapper*
================================================
FILE: Dockerfile.dapper
================================================
FROM ubuntu:bionic
# FROM arm64=arm64v8/ubuntu:bionic
# get the apt-cacher proxy set
ARG APTPROXY=
ARG APT_ARCHIVE_SOURCE="archive.ubuntu.com"
RUN echo "Acquire::http { Proxy \"$APTPROXY\"; };" >> /etc/apt/apt.conf.d/01proxy \
&& cat /etc/apt/apt.conf.d/01proxy \
&& sed -i "s|archive.ubuntu.com|${APT_ARCHIVE_SOURCE}|" /etc/apt/sources.list \
&& cat /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cpio \
curl \
dosfstools \
gccgo \
genisoimage \
gettext \
git \
isolinux \
less \
libblkid-dev \
libmount-dev \
libselinux1-dev \
locales \
module-init-tools \
mtools \
openssh-client \
pkg-config \
qemu \
qemu-kvm \
rsync \
sudo \
syslinux-common \
vim \
wget \
xorriso \
xz-utils \
telnet
########## Dapper Configuration #####################
ENV DAPPER_ENV VERSION DEV_BUILD RUNTEST DEBUG APTPROXY ENGINE_REGISTRY_MIRROR KERNEL_CHECK APPEND_SYSTEM_IMAGES APPEND_USER_IMAGES
ENV DAPPER_DOCKER_SOCKET true
ENV DAPPER_SOURCE /go/src/github.com/burmilla/os
ENV DAPPER_OUTPUT ./bin ./dist ./build/initrd ./build/kernel
ENV DAPPER_RUN_ARGS --privileged
ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache
ENV SHELL /bin/bash
WORKDIR ${DAPPER_SOURCE}
########## General Configuration #####################
ARG DAPPER_HOST_ARCH=amd64
ARG HOST_ARCH=${DAPPER_HOST_ARCH}
ARG ARCH=${HOST_ARCH}
ARG OS_REPO=burmilla
ARG HOSTNAME_DEFAULT=burmilla
ARG DISTRIB_ID=BurmillaOS
ARG KERNEL_VERSION=5.10.248-burmilla
ARG KERNEL_URL_amd64=https://github.com/burmilla/os-kernel/releases/download/v${KERNEL_VERSION}/linux-${KERNEL_VERSION}-x86.tar.gz
ARG KERNEL_URL_arm64=https://github.com/burmilla/os-kernel/releases/download/v${KERNEL_VERSION}/linux-${KERNEL_VERSION}-arm64.tar.gz
ARG BUILD_DOCKER_URL_amd64=https://download.docker.com/linux/static/stable/x86_64/docker-26.1.4.tgz
ARG BUILD_DOCKER_URL_arm64=https://download.docker.com/linux/static/stable/aarch64/docker-26.1.4.tgz
ARG OS_RELEASES_YML=https://raw.githubusercontent.com/burmilla/releases/v2.0.x
ARG OS_SERVICES_REPO=https://raw.githubusercontent.com/${OS_REPO}/os-services
ARG IMAGE_NAME=${OS_REPO}/os
ARG OS_CONSOLE=default
ARG OS_AUTOFORMAT=false
ARG OS_FIRMWARE=true
ARG OS_BASE_URL_amd64=https://github.com/burmilla/os-base/releases/download/v2023.05-1/os-base_amd64.tar.xz
ARG OS_BASE_URL_arm64=https://github.com/burmilla/os-base/releases/download/v2023.05-1/os-base_arm64.tar.xz
ARG OS_INITRD_BASE_URL_amd64=https://github.com/burmilla/os-initrd-base/releases/download/v2023.02.10-2/os-initrd-base-amd64.tar.gz
ARG OS_INITRD_BASE_URL_arm64=https://github.com/burmilla/os-initrd-base/releases/download/v2023.02.10-2/os-initrd-base-arm64.tar.gz
ARG SYSTEM_DOCKER_VERSION=17.06.107
ARG SYSTEM_DOCKER_URL_amd64=https://github.com/burmilla/os-system-docker/releases/download/${SYSTEM_DOCKER_VERSION}/docker-amd64-${SYSTEM_DOCKER_VERSION}.tgz
ARG SYSTEM_DOCKER_URL_arm64=https://github.com/burmilla/os-system-docker/releases/download/${SYSTEM_DOCKER_VERSION}/docker-arm64-${SYSTEM_DOCKER_VERSION}.tgz
ARG AZURE_SERVICE=false
ARG PROXMOXVE_SERVICE=false
ARG SKIP_BUILD=false
######################################################
# Set up environment and export all ARGS as ENV
ENV ARCH=${ARCH} \
HOST_ARCH=${HOST_ARCH} \
XZ_DEFAULTS="-T0"
ENV BUILD_DOCKER_URL=BUILD_DOCKER_URL_${ARCH} \
BUILD_DOCKER_URL_amd64=${BUILD_DOCKER_URL_amd64} \
BUILD_DOCKER_URL_arm64=${BUILD_DOCKER_URL_arm64} \
DAPPER_HOST_ARCH=${DAPPER_HOST_ARCH} \
DISTRIB_ID=${DISTRIB_ID} \
DOWNLOADS=/usr/src/downloads \
GOPATH=/go \
GO_VERSION=1.19.5 \
GO111MODULE=off \
GOARCH=$ARCH \
HOSTNAME_DEFAULT=${HOSTNAME_DEFAULT} \
IMAGE_NAME=${IMAGE_NAME} \
KERNEL_VERSION=${KERNEL_VERSION} \
KERNEL_URL=KERNEL_URL_${ARCH} \
KERNEL_URL_amd64=${KERNEL_URL_amd64} \
KERNEL_URL_arm64=${KERNEL_URL_arm64} \
OS_BASE_URL=OS_BASE_URL_${ARCH} \
OS_BASE_URL_amd64=${OS_BASE_URL_amd64} \
OS_BASE_URL_arm64=${OS_BASE_URL_arm64} \
OS_INITRD_BASE_URL=OS_INITRD_BASE_URL_${ARCH} \
OS_INITRD_BASE_URL_amd64=${OS_INITRD_BASE_URL_amd64} \
OS_INITRD_BASE_URL_arm64=${OS_INITRD_BASE_URL_arm64} \
OS_RELEASES_YML=${OS_RELEASES_YML} \
OS_REPO=${OS_REPO} \
OS_SERVICES_REPO=${OS_SERVICES_REPO} \
OS_CONSOLE=${OS_CONSOLE} \
OS_AUTOFORMAT=${OS_AUTOFORMAT} \
OS_FIRMWARE=${OS_FIRMWARE} \
REPO_VERSION=master \
SYSTEM_DOCKER_URL=SYSTEM_DOCKER_URL_${ARCH} \
SYSTEM_DOCKER_URL_amd64=${SYSTEM_DOCKER_URL_amd64} \
SYSTEM_DOCKER_URL_arm64=${SYSTEM_DOCKER_URL_arm64} \
AZURE_SERVICE=${AZURE_SERVICE} \
PROXMOXVE_SERVICE=${PROXMOXVE_SERVICE} \
SKIP_BUILD=${SKIP_BUILD}
ENV PATH=${GOPATH}/bin:/usr/local/go/bin:$PATH
ENV GO111MODULE=off
RUN mkdir -p ${DOWNLOADS}
# Download kernel
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN echo "... Downloading ${!KERNEL_URL}"; \
if [ "${!KERNEL_URL}" != "skip" ]; then \
curl -fL ${!KERNEL_URL} > ${DOWNLOADS}/kernel.tar.gz \
;fi
# Install Go
RUN curl -L https://dl.google.com/go/go${GO_VERSION}.linux-${HOST_ARCH}.tar.gz | tar -xzf - -C /usr/local && \
go get github.com/burmilla/trash
# Install Host Docker
RUN curl -fL ${!BUILD_DOCKER_URL} > /tmp/docker.tgz && \
tar zxvf /tmp/docker.tgz --strip-components=1 -C /usr/bin/ && \
chmod +x /usr/bin/docker
# Install dapper
RUN curl -sL https://releases.rancher.com/dapper/v0.5.4/dapper-`uname -s`-`uname -m | sed 's/arm.*/arm/'` > /usr/bin/dapper && \
chmod +x /usr/bin/dapper
RUN cd ${DOWNLOADS} && \
curl -pfL ${!OS_BASE_URL} | tar xvJf -
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
================================================
FILE: Makefile
================================================
TARGETS := $(shell ls scripts | grep -vE 'clean|run|help|release*|build-moby|run-moby')
.dapper:
@echo Downloading dapper
@curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m|sed 's/v7l//'` > .dapper.tmp
@@chmod +x .dapper.tmp
@./.dapper.tmp -v
@mv .dapper.tmp .dapper
$(TARGETS): .dapper
./.dapper $@
pr-validation: .dapper
ARCH="amd64" \
KERNEL_URL_amd64="skip" \
SKIP_BUILD="true" \
./.dapper ci
trash: .dapper
./.dapper -m bind trash
trash-keep: .dapper
./.dapper -m bind trash -k
deps: trash
build/initrd/.id: .dapper
./.dapper prepare
run: build/initrd/.id .dapper
./.dapper -m bind build-target
./scripts/run
build-moby:
./scripts/build-moby
run-moby:
./scripts/run-moby
shell-bind: .dapper
./.dapper -m bind -s
clean:
@./scripts/clean
release: .dapper release-build
release-build:
mkdir -p dist
./.dapper release
rpi64: .dapper
./scripts/release-rpi64
vmware: .dapper
mkdir -p dist
OS_FIRMWARE="false" \
APPEND_SYSTEM_IMAGES="burmilla/os-openvmtools:11.2.0-5" \
./.dapper release-vmware
hyperv: .dapper
mkdir -p dist
OS_FIRMWARE="false" \
APPEND_SYSTEM_IMAGES="burmilla/os-hypervvmtools:v4.14.206-burmilla-1" \
./.dapper release-hyperv
azurebase: .dapper
mkdir -p dist
AZURE_SERVICE="true" \
OS_FIRMWARE="false" \
APPEND_SYSTEM_IMAGES="burmilla/os-hypervvmtools:v4.14.206-burmilla-1 burmilla/os-waagent:v2.2.49.2-1" \
./.dapper release-azurebase
4glte: .dapper
mkdir -p dist
APPEND_SYSTEM_IMAGES="burmilla/os-modemmanager:v1.6.4-1" \
./.dapper release-4glte
proxmoxve: .dapper
mkdir -p dist
PROXMOXVE_SERVICE="true" \
OS_FIRMWARE="false" \
APPEND_SYSTEM_IMAGES="burmilla/os-qemuguestagent:v3.1.0-1" \
./.dapper release-proxmoxve
help:
@./scripts/help
.DEFAULT_GOAL := default
.PHONY: $(TARGETS)
================================================
FILE: README.md
================================================
# BurmillaOS
BurmillaOS is successor of [RancherOS](//github.com/rancher/os) which reached end of life.

[](https://store.docker.com/community/images/burmilla/os)
[](https://goreportcard.com/badge/github.com/burmilla/os)
The smallest, easiest way to run Docker in production at scale. Everything in BurmillaOS is a container managed by Docker. This includes system services such as udev and rsyslog. BurmillaOS includes only the bare minimum amount of software needed to run Docker. This keeps the binary download of BurmillaOS very small. Everything else can be pulled in dynamically through Docker.
## How this works
Everything in BurmillaOS is a Docker container. We accomplish this by launching two instances of
Docker. One is what we call the system Docker which runs as the first process. System Docker then launches
a container that runs the user Docker. The user Docker is then the instance that gets primarily
used to create containers. We created this separation because it seemed logical and also
it would really be bad if somebody did `docker rm -f $(docker ps -qa)` and deleted the entire OS.

## Documentation for BurmillaOS
Please refer to our [BurmillaOS Documentation](https://burmilla.github.io) website to read all about BurmillaOS. It has detailed information on how BurmillaOS works, getting-started and other details.
Please submit any **BurmillaOS** bugs, issues, and feature requests to [burmilla/os](//github.com/burmilla/os/issues).
## License
Copyright (c) 2020-2024 [BurmillaOS community](https://burmillaos.org)
Copyright (c) 2014-2020 [Rancher Labs, Inc.](http://rancher.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: assets/rancher.key
================================================
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAvOcPbLWcoi0Kfw5FTun6sIkoWHI9QpSnbQqoB7X/jy6SZBUX
khbvMttcvnr9PYLEjEUa4xe8rdKVB1es53EIVXqrGbYHOVmxC2NgzmFBpkZ/wgrz
216L6Aa0I0qK6pQZqbj8LErWC6/dl5/lVbDDUlCHoB2Ntg6YRmwyhvOb6ygfB8VM
RiA8RQXbP7hPBYUsvsbKMk/41GQyuqYKth5xpeg/NVYiJSnnKTqVpVtwfn3mvfQA
zcmTVbw82xxOaXCN1UcPLufVpqVjlIE+qmnDVQApfBqqQb0JPLMOzv1/Q0mRwimn
3g/RuZPhmGwFM/dnylq8f5Tl31Fz0t/nPHUSBQIDAQABAoIBAGS4EhpVTvmNaF5M
PpoP2TFNQCzAZHdeiVJzbxoFaQhvvXANau7iuZD1MyMAsouccK2VnvtcSaaoc/th
PPh95QKmkBn6Wymx79rxlskTRAyi5DWS32ikpZYGFQAIG79tTa2XyyTWlf/POihB
AedJgysdcuLlPwzGBVzvDZW0x/p+Ejs+etW0QBb1swcqheM9cc6RBoF/aLPyUK4i
1ztVuzJTvTTV16xTNF93XFS177Y6toXZEaCBpuMg/XX0y0Fj4iAkSIqJoEV6MKeI
SqQad/sVsLTwCsW+/so7jfRWtm5xRJOtNxpSUrGrNYuRBUr4VlXNZT4TOOS9BFEF
AyTSBcECgYEA+9wnSZjEFgz/8x/xsyPCsKBhCu6nfV/mxVgTrRXuMtpzujAnKXsf
jEh1vtKH9UpbwM+gRYxZL+ZVjB2uE523hoDxqDfpVnWfItNs4OU4qougqUHBdsZe
0t0Xjyl/17f7g7BWMXSWhTcoDlirGHtjvIDh0CXVfWvtcLaiQj0dAfUCgYEAwAH6
JPZotxue8bUyglCrOyg3P0G9QgeQSabbCCKDyiGzKYTXqx1vxEZ+0RCKSg0D/spK
2x7V0wearEOX/rCuQVw2r4oltUmbmq+BHYnXXz0hM0TMJs1BPZhvMhPGWq0lm1WL
NKfAOU64hZQAPwf3Z+3B5jywQfOmwssOfAXr9dECgYBroKrRUo0I90kxNkdtTCzY
mdCegVnlw+O0FW1jG+oMpTmrKQSzP0A+DID0qLcc5UfMX22YCt/aDk4kcFKBY3aX
7eZXAn2eSulUUpFGke3jQ4PGkKkB/sdqyLxWm19caez7W5GZ1L618toVN2L2NVRr
q4/UCTbwP/zZm9I/CCqrOQKBgQClQk5hd/BDAbP5B+L0RKhMX13FxTg217m5mrJU
uxhBZmYFK0BRGCH1hlNqb9kGyVMR/l0VYeHaI2ZeNENjRACHYu3ygm3YLgWOytXP
ba+AWmXz8ZfhIbKwaD30lQ6ZRwPiQWtyI5wP9xBccDkSBzJLMlk8aCmwahyy9gB+
gL5JsQKBgBT1ILAQvK2IGmwHFvUApXruARIvU4lrMQJ9tpYiPtpSNAPP73jUac68
thh3zQYJfYDQbdbwnF41X6WPvbYwb7uH5PG/T2A78YSZQyMpCk+enaf8o0dOZEAH
jhnrn3KQFCRQXRUfm9O6N+S04S4uXT8++vlZucW7jEq8GW0nYxj/
-----END RSA PRIVATE KEY-----
================================================
FILE: assets/rancher.key.pub
================================================
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC85w9stZyiLQp/DkVO6fqwiShYcj1ClKdtCqgHtf+PLpJkFReSFu8y21y+ev09gsSMRRrjF7yt0pUHV6zncQhVeqsZtgc5WbELY2DOYUGmRn/CCvPbXovoBrQjSorqlBmpuPwsStYLr92Xn+VVsMNSUIegHY22DphGbDKG85vrKB8HxUxGIDxFBds/uE8FhSy+xsoyT/jUZDK6pgq2HnGl6D81ViIlKecpOpWlW3B+fea99ADNyZNVvDzbHE5pcI3VRw8u59WmpWOUgT6qacNVACl8GqpBvQk8sw7O/X9DSZHCKafeD9G5k+GYbAUz92fKWrx/lOXfUXPS3+c8dRIF
================================================
FILE: assets/scripts_ssh_config
================================================
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
LogLevel quiet
================================================
FILE: cmd/cloudinitexecute/authorize_ssh_keys.go
================================================
package cloudinitexecute
import (
"io/ioutil"
"os"
"path"
"strconv"
"strings"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
)
const (
sshDirName = ".ssh"
authorizedKeysFileName = "authorized_keys"
)
func authorizeSSHKeys(username string, authorizedKeys []string, name string) error {
var uid int
var gid int
var homeDir string
bytes, err := ioutil.ReadFile("/etc/passwd")
if err != nil {
return err
}
for _, line := range strings.Split(string(bytes), "\n") {
if strings.HasPrefix(line, username) {
split := strings.Split(line, ":")
if len(split) < 6 {
break
}
uid, err = strconv.Atoi(split[2])
if err != nil {
return err
}
gid, err = strconv.Atoi(split[3])
if err != nil {
return err
}
homeDir = split[5]
}
}
sshDir := path.Join(homeDir, sshDirName)
authorizedKeysFile := path.Join(sshDir, authorizedKeysFileName)
if _, err := os.Stat(sshDir); os.IsNotExist(err) {
if err = os.Mkdir(sshDir, 0700); err != nil {
return err
}
} else if err != nil {
return err
}
if err = os.Chown(sshDir, uid, gid); err != nil {
return err
}
for _, authorizedKey := range authorizedKeys {
if err = authorizeSSHKey(authorizedKey, authorizedKeysFile, uid, gid); err != nil {
log.Errorf("Failed to authorize SSH key %s: %v", authorizedKey, err)
}
}
return nil
}
func authorizeSSHKey(authorizedKey, authorizedKeysFile string, uid, gid int) error {
authorizedKeysFileInfo, err := os.Stat(authorizedKeysFile)
if os.IsNotExist(err) {
keysFile, err := os.Create(authorizedKeysFile)
if err != nil {
return err
}
if err = keysFile.Chmod(0600); err != nil {
return err
}
if err = keysFile.Close(); err != nil {
return err
}
authorizedKeysFileInfo, err = os.Stat(authorizedKeysFile)
if err != nil {
return err
}
} else if err != nil {
return err
}
bytes, err := ioutil.ReadFile(authorizedKeysFile)
if err != nil {
return err
}
if !strings.Contains(string(bytes), authorizedKey) {
bytes = append(bytes, []byte(authorizedKey)...)
bytes = append(bytes, '\n')
}
perm := authorizedKeysFileInfo.Mode().Perm()
if err = util.WriteFileAtomic(authorizedKeysFile, bytes, perm); err != nil {
return err
}
return os.Chown(authorizedKeysFile, uid, gid)
}
================================================
FILE: cmd/cloudinitexecute/cloudinitexecute.go
================================================
package cloudinitexecute
import (
"flag"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path"
"strings"
rancherConfig "github.com/burmilla/os/config"
"github.com/burmilla/os/config/cloudinit/config"
"github.com/burmilla/os/config/cloudinit/system"
"github.com/burmilla/os/pkg/docker"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
"golang.org/x/net/context"
)
const (
resizeStamp = "/var/lib/rancher/resizefs.done"
sshKeyName = "rancheros-cloud-config"
)
var (
console bool
preConsole bool
flags *flag.FlagSet
)
func init() {
flags = flag.NewFlagSet(os.Args[0], flag.ContinueOnError)
flags.BoolVar(&console, "console", false, "apply console configuration")
flags.BoolVar(&preConsole, "pre-console", false, "apply pre-console configuration")
}
func Main() {
flags.Parse(os.Args[1:])
log.InitLogger()
log.Infof("Running cloud-init-execute: pre-console=%v, console=%v", preConsole, console)
cfg := rancherConfig.LoadConfig()
if !console && !preConsole {
console = true
preConsole = true
}
if console {
ApplyConsole(cfg)
}
if preConsole {
applyPreConsole(cfg)
}
}
func ApplyConsole(cfg *rancherConfig.CloudConfig) {
if len(cfg.SSHAuthorizedKeys) > 0 {
if err := authorizeSSHKeys("rancher", cfg.SSHAuthorizedKeys, sshKeyName); err != nil {
log.Error(err)
}
if err := authorizeSSHKeys("docker", cfg.SSHAuthorizedKeys, sshKeyName); err != nil {
log.Error(err)
}
}
WriteFiles(cfg, "console")
for _, mount := range cfg.Mounts {
if len(mount) != 4 {
log.Errorf("Unable to mount %s: must specify exactly four arguments", mount[1])
}
if mount[2] == "nfs" || mount[2] == "nfs4" {
if err := os.MkdirAll(mount[1], 0755); err != nil {
log.Errorf("Unable to create mount point %s: %v", mount[1], err)
continue
}
cmdArgs := []string{mount[0], mount[1], "-t", mount[2]}
if mount[3] != "" {
cmdArgs = append(cmdArgs, "-o", mount[3])
}
cmd := exec.Command("mount", cmdArgs...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Errorf("Failed to mount %s: %v", mount[1], err)
}
continue
}
device := util.ResolveDevice(mount[0])
if mount[2] == "swap" {
cmd := exec.Command("swapon", device)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
log.Errorf("Unable to swapon %s: %v", device, err)
}
continue
}
if err := util.Mount(device, mount[1], mount[2], mount[3]); err != nil {
log.Errorf("Failed to mount %s: %v", mount[1], err)
}
}
err := util.RunCommandSequence(cfg.Runcmd)
if err != nil {
log.Error(err)
}
}
func WriteFiles(cfg *rancherConfig.CloudConfig, container string) {
for _, file := range cfg.WriteFiles {
fileContainer := file.Container
if fileContainer == "" {
fileContainer = "console"
}
if fileContainer != container {
continue
}
content, err := config.DecodeContent(file.File.Content, file.File.Encoding)
if err != nil {
continue
}
file.File.Content = string(content)
file.File.Encoding = ""
f := system.File{
File: file.File,
}
fullPath, err := system.WriteFile(&f, "/")
if err != nil {
log.WithFields(log.Fields{"err": err, "path": fullPath}).Error("Error writing file")
continue
}
log.Printf("Wrote file %s to filesystem", fullPath)
}
}
func applyPreConsole(cfg *rancherConfig.CloudConfig) {
if cfg.Rancher.ResizeDevice != "" {
if _, err := os.Stat(resizeStamp); os.IsNotExist(err) {
if err := resizeDevice(cfg); err == nil {
os.Create(resizeStamp)
} else {
log.Errorf("Failed to resize %s: %s", cfg.Rancher.ResizeDevice, err)
}
} else {
log.Infof("Skipped resizing %s because %s exists", cfg.Rancher.ResizeDevice, resizeStamp)
}
}
for k, v := range cfg.Rancher.Sysctl {
elems := []string{"/proc", "sys"}
elems = append(elems, strings.Split(k, ".")...)
path := path.Join(elems...)
if err := ioutil.WriteFile(path, []byte(v), 0644); err != nil {
log.Errorf("Failed to set sysctl key %s: %s", k, err)
}
}
client, err := docker.NewSystemClient()
if err != nil {
log.Error(err)
}
for _, restart := range cfg.Rancher.RestartServices {
if err = client.ContainerRestart(context.Background(), restart, 10); err != nil {
log.Error(err)
}
}
}
func resizeDevice(cfg *rancherConfig.CloudConfig) error {
partition := "1"
targetPartition := fmt.Sprintf("%s%s", cfg.Rancher.ResizeDevice, partition)
if strings.Contains(cfg.Rancher.ResizeDevice, "mmcblk") {
partition = "2"
targetPartition = fmt.Sprintf("%sp%s", cfg.Rancher.ResizeDevice, partition)
} else if strings.Contains(cfg.Rancher.ResizeDevice, "nvme") {
targetPartition = fmt.Sprintf("%sp%s", cfg.Rancher.ResizeDevice, partition)
}
cmd := exec.Command("growpart", cfg.Rancher.ResizeDevice, partition)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Run()
cmd = exec.Command("partprobe", cfg.Rancher.ResizeDevice)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
return err
}
cmd = exec.Command("resize2fs", targetPartition)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err = cmd.Run()
if err != nil {
return err
}
return nil
}
================================================
FILE: cmd/cloudinitsave/cloudinitsave.go
================================================
// Copyright 2015 CoreOS, Inc.
// Copyright 2015-2017 Rancher Labs, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cloudinitsave
import (
"bytes"
"errors"
"os"
"path"
"strings"
"sync"
"time"
"github.com/burmilla/os/cmd/control"
"github.com/burmilla/os/cmd/network"
rancherConfig "github.com/burmilla/os/config"
"github.com/burmilla/os/config/cloudinit/config"
"github.com/burmilla/os/config/cloudinit/datasource"
"github.com/burmilla/os/config/cloudinit/datasource/configdrive"
"github.com/burmilla/os/config/cloudinit/datasource/file"
"github.com/burmilla/os/config/cloudinit/datasource/metadata/aliyun"
"github.com/burmilla/os/config/cloudinit/datasource/metadata/azure"
"github.com/burmilla/os/config/cloudinit/datasource/metadata/cloudstack"
"github.com/burmilla/os/config/cloudinit/datasource/metadata/digitalocean"
"github.com/burmilla/os/config/cloudinit/datasource/metadata/ec2"
"github.com/burmilla/os/config/cloudinit/datasource/metadata/exoscale"
"github.com/burmilla/os/config/cloudinit/datasource/metadata/gce"
"github.com/burmilla/os/config/cloudinit/datasource/metadata/packet"
"github.com/burmilla/os/config/cloudinit/datasource/proccmdline"
"github.com/burmilla/os/config/cloudinit/datasource/proxmox"
"github.com/burmilla/os/config/cloudinit/datasource/tftp"
"github.com/burmilla/os/config/cloudinit/datasource/url"
"github.com/burmilla/os/config/cloudinit/datasource/vmware"
"github.com/burmilla/os/config/cloudinit/pkg"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/netconf"
"github.com/burmilla/os/pkg/util"
yaml "github.com/cloudfoundry-incubator/candiedyaml"
)
const (
datasourceInterval = 100 * time.Millisecond
datasourceMaxInterval = 30 * time.Second
datasourceTimeout = 5 * time.Minute
)
func Main() {
log.InitLogger()
log.Info("Running cloud-init-save")
if err := control.UdevSettle(); err != nil {
log.Errorf("Failed to run udev settle: %v", err)
}
if err := saveCloudConfig(); err != nil {
log.Errorf("Failed to save cloud-config: %v", err)
}
// exit wpa_supplicant
netconf.StopWpaSupplicant()
// exit dhcpcd
netconf.StopDhcpcd()
}
func saveCloudConfig() error {
log.Infof("SaveCloudConfig")
cfg := rancherConfig.LoadConfig()
log.Debugf("init: SaveCloudConfig(pre ApplyNetworkConfig): %#v", cfg.Rancher.Network)
network.ApplyNetworkConfig(cfg)
log.Infof("datasources that will be considered: %#v", cfg.Rancher.CloudInit.Datasources)
dss := getDatasources(cfg.Rancher.CloudInit.Datasources)
if len(dss) == 0 {
log.Errorf("currentDatasource - none found")
return nil
}
foundDs := selectDatasource(dss)
log.Infof("Cloud-init datasource that was used: %s", foundDs)
// Apply any newly detected network config.
cfg = rancherConfig.LoadConfig()
log.Debugf("init: SaveCloudConfig(post ApplyNetworkConfig): %#v", cfg.Rancher.Network)
network.ApplyNetworkConfig(cfg)
return nil
}
func saveFiles(cloudConfigBytes, scriptBytes []byte, metadata datasource.Metadata) error {
os.MkdirAll(rancherConfig.CloudConfigDir, os.ModeDir|0600)
if len(scriptBytes) > 0 {
log.Infof("Writing to %s", rancherConfig.CloudConfigScriptFile)
if err := util.WriteFileAtomic(rancherConfig.CloudConfigScriptFile, scriptBytes, 500); err != nil {
log.Errorf("Error while writing file %s: %v", rancherConfig.CloudConfigScriptFile, err)
return err
}
}
if len(cloudConfigBytes) > 0 {
if err := util.WriteFileAtomic(rancherConfig.CloudConfigBootFile, cloudConfigBytes, 400); err != nil {
return err
}
log.Infof("Wrote to %s", rancherConfig.CloudConfigBootFile)
}
metaDataBytes, err := yaml.Marshal(metadata)
if err != nil {
return err
}
if err = util.WriteFileAtomic(rancherConfig.MetaDataFile, metaDataBytes, 400); err != nil {
return err
}
log.Infof("Wrote to %s", rancherConfig.MetaDataFile)
// if we write the empty meta yml, the merge fails.
// TODO: the problem is that a partially filled one will still have merge issues, so that needs fixing - presumably by making merge more clever, and making more fields optional
emptyMeta, err := yaml.Marshal(datasource.Metadata{})
if err != nil {
return err
}
if bytes.Compare(metaDataBytes, emptyMeta) == 0 {
log.Infof("not writing %s: its all defaults.", rancherConfig.CloudConfigNetworkFile)
return nil
}
type nonRancherCfg struct {
Network netconf.NetworkConfig `yaml:"network,omitempty"`
}
type nonCfg struct {
Rancher nonRancherCfg `yaml:"rancher,omitempty"`
}
// write the network.yml file from metadata
cc := nonCfg{
Rancher: nonRancherCfg{
Network: metadata.NetworkConfig,
},
}
if err := os.MkdirAll(path.Dir(rancherConfig.CloudConfigNetworkFile), 0700); err != nil {
log.Errorf("Failed to create directory for file %s: %v", rancherConfig.CloudConfigNetworkFile, err)
}
if err := rancherConfig.WriteToFile(cc, rancherConfig.CloudConfigNetworkFile); err != nil {
log.Errorf("Failed to save config file %s: %v", rancherConfig.CloudConfigNetworkFile, err)
}
log.Infof("Wrote to %s", rancherConfig.CloudConfigNetworkFile)
return nil
}
func fetchAndSave(ds datasource.Datasource) error {
var metadata datasource.Metadata
log.Infof("Fetching user-data from datasource %s", ds)
userDataBytes, err := ds.FetchUserdata()
if err != nil {
log.Errorf("Failed fetching user-data from datasource: %v", err)
return err
}
userDataBytes, err = decompressIfGzip(userDataBytes)
if err != nil {
log.Errorf("Failed decompressing user-data from datasource: %v", err)
return err
}
log.Infof("Fetching meta-data from datasource of type %v", ds.Type())
metadata, err = ds.FetchMetadata()
if err != nil {
log.Errorf("Failed fetching meta-data from datasource: %v", err)
return err
}
userData := string(userDataBytes)
scriptBytes := []byte{}
if config.IsScript(userData) {
scriptBytes = userDataBytes
userDataBytes = []byte{}
} else if isCompose(userData) {
if userDataBytes, err = composeToCloudConfig(userDataBytes); err != nil {
log.Errorf("Failed to convert compose to cloud-config syntax: %v", err)
return err
}
} else if config.IsCloudConfig(userData) {
if _, err := rancherConfig.ReadConfig(userDataBytes, false); err != nil {
log.WithFields(log.Fields{"cloud-config": userData, "err": err}).Warn("Failed to parse cloud-config, not saving.")
userDataBytes = []byte{}
}
} else {
log.Errorf("Unrecognized user-data\n(%s)", userData)
userDataBytes = []byte{}
}
if _, err := rancherConfig.ReadConfig(userDataBytes, false); err != nil {
log.WithFields(log.Fields{"cloud-config": userData, "err": err}).Warn("Failed to parse cloud-config")
return errors.New("Failed to parse cloud-config")
}
return saveFiles(userDataBytes, scriptBytes, metadata)
}
// getDatasources creates a slice of possible Datasources for cloudinit based
// on the different source command-line flags.
func getDatasources(datasources []string) []datasource.Datasource {
dss := make([]datasource.Datasource, 0, 5)
for _, ds := range datasources {
parts := strings.SplitN(ds, ":", 2)
root := ""
if len(parts) > 1 {
root = parts[1]
}
switch parts[0] {
case "*":
dss = append(dss, getDatasources([]string{"configdrive", "vmware", "ec2", "digitalocean", "packet", "gce", "cloudstack", "exoscale", "proxmox"})...)
case "proxmox":
if root == "" {
root = "/media/pve-config"
}
dss = append(dss, proxmox.NewDataSource(root))
case "exoscale":
dss = append(dss, exoscale.NewDatasource(root))
case "cloudstack":
for _, source := range cloudstack.NewDatasource(root) {
dss = append(dss, source)
}
case "ec2":
dss = append(dss, ec2.NewDatasource(root))
case "file":
if root != "" {
dss = append(dss, file.NewDatasource(root))
}
case "tftp":
dss = append(dss, tftp.NewDatasource(root))
case "url":
if root != "" {
dss = append(dss, url.NewDatasource(root))
}
case "cmdline":
if len(parts) == 1 {
dss = append(dss, proccmdline.NewDatasource())
}
case "configdrive":
if root == "" {
root = "/media/config-2"
}
dss = append(dss, configdrive.NewDatasource(root))
case "digitalocean":
// TODO: should we enableDoLinkLocal() - to avoid the need for the other kernel/oem options?
dss = append(dss, digitalocean.NewDatasource(root))
case "gce":
dss = append(dss, gce.NewDatasource(root))
case "packet":
dss = append(dss, packet.NewDatasource(root))
case "vmware":
// made vmware datasource dependent on detecting vmware independently, as it crashes things otherwise
v := vmware.NewDatasource(root)
if v != nil {
dss = append(dss, v)
}
case "aliyun":
dss = append(dss, aliyun.NewDatasource(root))
case "azure":
dss = append(dss, azure.NewDatasource(root))
}
}
return dss
}
func enableDoLinkLocal() {
cfg := rancherConfig.LoadConfig()
dhcpTimeout := cfg.Rancher.Defaults.Network.DHCPTimeout
if cfg.Rancher.Network.DHCPTimeout > 0 {
dhcpTimeout = cfg.Rancher.Network.DHCPTimeout
}
_, err := netconf.ApplyNetworkConfigs(&netconf.NetworkConfig{
Interfaces: map[string]netconf.InterfaceConfig{
"eth0": {
IPV4LL: true,
},
},
DHCPTimeout: dhcpTimeout,
}, false, false)
if err != nil {
log.Errorf("Failed to apply link local on eth0: %v", err)
}
}
// selectDatasource attempts to choose a valid Datasource to use based on its
// current availability. The first Datasource to report to be available is
// returned. Datasources will be retried if possible if they are not
// immediately available. If all Datasources are permanently unavailable or
// datasourceTimeout is reached before one becomes available, nil is returned.
func selectDatasource(sources []datasource.Datasource) datasource.Datasource {
ds := make(chan datasource.Datasource)
stop := make(chan struct{})
var wg sync.WaitGroup
for _, s := range sources {
wg.Add(1)
go func(s datasource.Datasource) {
defer wg.Done()
duration := datasourceInterval
for {
log.Infof("cloud-init: Checking availability of %q", s.Type())
if s.IsAvailable() {
log.Infof("cloud-init: Datasource available: %s", s)
ds <- s
return
}
if !s.AvailabilityChanges() {
log.Infof("cloud-init: Datasource unavailable, skipping: %s", s)
return
}
log.Errorf("cloud-init: Datasource not ready, will retry: %s", s)
select {
case <-stop:
return
case <-time.After(duration):
duration = pkg.ExpBackoff(duration, datasourceMaxInterval)
}
}
}(s)
}
done := make(chan struct{})
go func() {
wg.Wait()
close(done)
}()
var s datasource.Datasource
select {
case s = <-ds:
err := fetchAndSave(s)
if err != nil {
log.Errorf("Error fetching cloud-init datasource(%s): %s", s, err)
}
case <-done:
case <-time.After(datasourceTimeout):
}
close(stop)
return s
}
func isCompose(content string) bool {
return strings.HasPrefix(content, "#compose\n")
}
func composeToCloudConfig(bytes []byte) ([]byte, error) {
compose := make(map[interface{}]interface{})
err := yaml.Unmarshal(bytes, &compose)
if err != nil {
return nil, err
}
return yaml.Marshal(map[interface{}]interface{}{
"rancher": map[interface{}]interface{}{
"services": compose,
},
})
}
const gzipMagicBytes = "\x1f\x8b"
func decompressIfGzip(userdataBytes []byte) ([]byte, error) {
if !bytes.HasPrefix(userdataBytes, []byte(gzipMagicBytes)) {
return userdataBytes, nil
}
return config.DecompressGzip(userdataBytes)
}
================================================
FILE: cmd/control/autologin.go
================================================
package control
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/log"
"github.com/codegangsta/cli"
)
func AutologinMain() {
log.InitLogger()
app := cli.NewApp()
app.Name = os.Args[0]
app.Usage = "autologin console"
app.Version = config.Version
app.Author = "Project Burmilla\n\tRancher Labs, Inc."
app.Email = "burmilla@localhost.local"
app.EnableBashCompletion = true
app.Action = autologinAction
app.HideHelp = true
app.Run(os.Args)
}
func autologinAction(c *cli.Context) error {
cmd := exec.Command("/bin/stty", "sane")
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
cmd.Stdin = os.Stdin
if err := cmd.Run(); err != nil {
log.Error(err)
}
usertty := ""
user := "root"
if c.NArg() > 0 {
usertty = c.Args().Get(0)
s := strings.SplitN(usertty, ":", 2)
user = s[0]
}
mode := filepath.Base(os.Args[0])
console := CurrentConsole()
cfg := config.LoadConfig()
loginBin := ""
args := []string{}
if console == "centos" || console == "fedora" ||
mode == "recovery" {
// For some reason, centos and fedora ttyS0 and tty1 don't work with `login -f rancher`
// until I make time to read their source, lets just give us a way to get work done
loginBin = "bash"
args = append(args, "--login")
if mode == "recovery" {
os.Setenv("PROMPT_COMMAND", `echo "[`+fmt.Sprintf("Recovery console %s@%s:${PWD}", user, cfg.Hostname)+`]"`)
}
} else {
loginBin = "login"
args = append(args, "-f", user)
// TODO: add a PROMPT_COMMAND if we haven't switch-rooted
}
loginBinPath, err := exec.LookPath(loginBin)
if err != nil {
fmt.Printf("error finding %s in path: %s", cmd.Args[0], err)
return err
}
os.Setenv("TERM", "linux")
// Causes all sorts of issues
//return syscall.Exec(loginBinPath, args, os.Environ())
cmd = exec.Command(loginBinPath, args...)
cmd.Env = os.Environ()
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
cmd.Stdin = os.Stdin
if err := cmd.Run(); err != nil {
log.Errorf("\nError starting %s: %s", cmd.Args[0], err)
}
return nil
}
================================================
FILE: cmd/control/bootstrap.go
================================================
package control
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
)
func BootstrapMain() {
log.InitLogger()
log.Debugf("bootstrapAction")
if err := UdevSettle(); err != nil {
log.Errorf("Failed to run udev settle: %v", err)
}
log.Debugf("bootstrapAction: loadingConfig")
cfg := config.LoadConfig()
log.Debugf("bootstrapAction: Rngd(%v)", cfg.Rancher.State.Rngd)
if cfg.Rancher.State.Rngd {
if err := runRngd(); err != nil {
log.Errorf("Failed to run rngd: %v", err)
}
}
log.Debugf("bootstrapAction: MdadmScan(%v)", cfg.Rancher.State.MdadmScan)
if cfg.Rancher.State.MdadmScan {
if err := mdadmScan(); err != nil {
log.Errorf("Failed to run mdadm scan: %v", err)
}
}
log.Debugf("bootstrapAction: cryptsetup(%v)", cfg.Rancher.State.Cryptsetup)
if cfg.Rancher.State.Cryptsetup {
if err := cryptsetup(); err != nil {
log.Errorf("Failed to run cryptsetup: %v", err)
}
}
log.Debugf("bootstrapAction: LvmScan(%v)", cfg.Rancher.State.LvmScan)
if cfg.Rancher.State.LvmScan {
if err := vgchange(); err != nil {
log.Errorf("Failed to run vgchange: %v", err)
}
}
stateScript := cfg.Rancher.State.Script
log.Debugf("bootstrapAction: stateScript(%v)", stateScript)
if stateScript != "" {
if err := runStateScript(stateScript); err != nil {
log.Errorf("Failed to run state script: %v", err)
}
}
log.Debugf("bootstrapAction: RunCommandSequence(%v)", cfg.Bootcmd)
err := util.RunCommandSequence(cfg.Bootcmd)
if err != nil {
log.Error(err)
}
if cfg.Rancher.State.Dev != "" && cfg.Rancher.State.Wait {
waitForRoot(cfg)
}
if len(cfg.Rancher.State.Autoformat) > 0 {
log.Infof("bootstrap container: Autoformat(%v) as %s", cfg.Rancher.State.Autoformat, "ext4")
if err := autoformat(cfg.Rancher.State.Autoformat); err != nil {
log.Errorf("Failed to run autoformat: %v", err)
}
}
log.Debugf("bootstrapAction: udev settle2")
if err := UdevSettle(); err != nil {
log.Errorf("Failed to run udev settle: %v", err)
}
}
func mdadmScan() error {
cmd := exec.Command("mdadm", "--assemble", "--scan")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
}
func vgchange() error {
cmd := exec.Command("vgchange", "--activate", "ay")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
}
func cryptsetup() error {
devices, err := util.BlkidType("crypto_LUKS")
if err != nil {
return err
}
for _, cryptdevice := range devices {
fdRead, err := os.Open("/dev/console")
if err != nil {
return err
}
defer fdRead.Close()
fdWrite, err := os.OpenFile("/dev/console", os.O_WRONLY|os.O_APPEND, 0)
if err != nil {
return err
}
defer fdWrite.Close()
cmd := exec.Command("cryptsetup", "luksOpen", cryptdevice, fmt.Sprintf("luks-%s", filepath.Base(cryptdevice)))
cmd.Stdout = fdWrite
cmd.Stderr = fdWrite
cmd.Stdin = fdRead
if err := cmd.Run(); err != nil {
log.Errorf("Failed to run cryptsetup for %s: %v", cryptdevice, err)
}
}
return nil
}
func runRngd() error {
// use /dev/urandom as random number input for rngd
// this is a really bad idea
// since I am simple filling the kernel entropy pool with entropy coming from the kernel itself!
// but this does not need to consider the user's hw rngd drivers.
cmd := exec.Command("rngd", "-r", "/dev/urandom", "-q")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
}
func runStateScript(script string) error {
f, err := ioutil.TempFile("", "")
if err != nil {
return err
}
if _, err := f.WriteString(script); err != nil {
return err
}
if err := f.Chmod(os.ModePerm); err != nil {
return err
}
if err := f.Close(); err != nil {
return err
}
return util.RunScript(f.Name())
}
func waitForRoot(cfg *config.CloudConfig) {
var dev string
for i := 0; i < 30; i++ {
dev = util.ResolveDevice(cfg.Rancher.State.Dev)
if dev != "" {
break
}
time.Sleep(time.Millisecond * 1000)
}
if dev == "" {
return
}
for i := 0; i < 30; i++ {
if _, err := os.Stat(dev); err == nil {
break
}
time.Sleep(time.Millisecond * 1000)
}
}
func autoformat(autoformatDevices []string) error {
cmd := exec.Command("/usr/sbin/auto-format.sh")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Env = []string{
"AUTOFORMAT=" + strings.Join(autoformatDevices, " "),
}
return cmd.Run()
}
================================================
FILE: cmd/control/cli.go
================================================
package control
import (
"fmt"
"os"
"github.com/burmilla/os/cmd/control/service"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/log"
"github.com/codegangsta/cli"
)
func Main() {
log.InitLogger()
cli.VersionPrinter = func(c *cli.Context) {
cfg := config.LoadConfig()
runningName := cfg.Rancher.Upgrade.Image + ":" + config.Version
fmt.Fprintf(c.App.Writer, "version %s from os image %s\n", c.App.Version, runningName)
}
app := cli.NewApp()
app.Name = os.Args[0]
app.Usage = fmt.Sprintf("Control and configure BurmillaOS\nbuilt: %s", config.BuildDate)
app.Version = config.Version
app.Author = "Project Burmilla\n\tRancher Labs, Inc."
app.EnableBashCompletion = true
app.Before = func(c *cli.Context) error {
if os.Geteuid() != 0 {
log.Fatalf("%s: Need to be root", os.Args[0])
}
return nil
}
app.Commands = []cli.Command{
{
Name: "config",
ShortName: "c",
Usage: "configure settings",
HideHelp: true,
Subcommands: configSubcommands(),
},
{
Name: "console",
Usage: "manage which console container is used",
HideHelp: true,
Subcommands: consoleSubcommands(),
},
{
Name: "console-init",
Hidden: true,
HideHelp: true,
SkipFlagParsing: true,
Action: consoleInitAction,
},
{
Name: "dev",
Hidden: true,
HideHelp: true,
SkipFlagParsing: true,
Action: devAction,
},
{
Name: "docker-init",
Hidden: true,
HideHelp: true,
SkipFlagParsing: true,
Action: dockerInitAction,
},
{
Name: "engine",
Usage: "manage which Docker engine is used",
HideHelp: true,
Subcommands: engineSubcommands(),
},
{
Name: "entrypoint",
Hidden: true,
HideHelp: true,
SkipFlagParsing: true,
Action: entrypointAction,
},
{
Name: "env",
Hidden: true,
HideHelp: true,
SkipFlagParsing: true,
Action: envAction,
},
service.Commands(),
{
Name: "os",
Usage: "operating system upgrade/downgrade",
HideHelp: true,
Subcommands: osSubcommands(),
},
{
Name: "preload-images",
Hidden: true,
HideHelp: true,
SkipFlagParsing: true,
Action: preloadImagesAction,
},
{
Name: "recovery-init",
Hidden: true,
HideHelp: true,
SkipFlagParsing: true,
Action: recoveryInitAction,
},
{
Name: "switch-console",
Hidden: true,
HideHelp: true,
SkipFlagParsing: true,
Action: switchConsoleAction,
},
{
Name: "tls",
Usage: "setup tls configuration",
HideHelp: true,
Subcommands: tlsConfCommands(),
},
{
Name: "udev-settle",
Hidden: true,
HideHelp: true,
SkipFlagParsing: true,
Action: udevSettleAction,
},
{
Name: "user-docker",
Hidden: true,
HideHelp: true,
SkipFlagParsing: true,
Action: userDockerAction,
},
installCommand,
}
app.Run(os.Args)
}
================================================
FILE: cmd/control/config.go
================================================
package control
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"sort"
"strings"
"text/template"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
yaml "github.com/cloudfoundry-incubator/candiedyaml"
"github.com/codegangsta/cli"
"github.com/pkg/errors"
)
func configSubcommands() []cli.Command {
return []cli.Command{
{
Name: "get",
Usage: "get value",
Action: configGet,
},
{
Name: "set",
Usage: "set a value",
Action: configSet,
},
{
Name: "images",
Usage: "List Docker images for a configuration from a file",
Action: runImages,
Flags: []cli.Flag{
cli.StringFlag{
Name: "input, i",
Usage: "File from which to read config",
},
},
},
{
Name: "generate",
Usage: "Generate a configuration file from a template",
Action: runGenerate,
HideHelp: true,
},
{
Name: "export",
Usage: "export configuration",
Flags: []cli.Flag{
cli.StringFlag{
Name: "output, o",
Usage: "File to which to save",
},
cli.BoolFlag{
Name: "private, p",
Usage: "Include the generated private keys",
},
cli.BoolFlag{
Name: "full, f",
Usage: "Export full configuration, including internal and default settings",
},
},
Action: export,
},
{
Name: "merge",
Usage: "merge configuration from stdin",
Action: merge,
Flags: []cli.Flag{
cli.StringFlag{
Name: "input, i",
Usage: "File from which to read",
},
},
},
{
Name: "syslinux",
Usage: "edit Syslinux boot global.cfg",
Action: editSyslinux,
},
{
Name: "validate",
Usage: "validate configuration from stdin",
Action: validate,
Flags: []cli.Flag{
cli.StringFlag{
Name: "input, i",
Usage: "File from which to read",
},
},
},
}
}
func imagesFromConfig(cfg *config.CloudConfig) []string {
imagesMap := map[string]int{}
for _, service := range cfg.Rancher.BootstrapContainers {
imagesMap[service.Image] = 1
}
for _, service := range cfg.Rancher.Services {
imagesMap[service.Image] = 1
}
images := make([]string, len(imagesMap))
i := 0
for image := range imagesMap {
images[i] = image
i++
}
sort.Strings(images)
return images
}
func runImages(c *cli.Context) error {
configFile := c.String("input")
cfg, err := config.ReadConfig(nil, false, configFile)
if err != nil {
log.WithFields(log.Fields{"err": err, "file": configFile}).Fatalf("Could not read config from file")
}
images := imagesFromConfig(cfg)
fmt.Println(strings.Join(images, " "))
return nil
}
func runGenerate(c *cli.Context) error {
if err := genTpl(os.Stdin, os.Stdout); err != nil {
log.Fatalf("Failed to generate config, err: '%s'", err)
}
return nil
}
func genTpl(in io.Reader, out io.Writer) error {
bytes, err := ioutil.ReadAll(in)
if err != nil {
log.Fatal("Could not read from stdin")
}
tpl := template.Must(template.New("osconfig").Parse(string(bytes)))
return tpl.Execute(out, env2map(os.Environ()))
}
func env2map(env []string) map[string]string {
m := make(map[string]string, len(env))
for _, s := range env {
d := strings.Split(s, "=")
m[d[0]] = d[1]
}
return m
}
func editSyslinux(c *cli.Context) error {
// check whether is Raspberry Pi or not
bytes, err := ioutil.ReadFile("/proc/device-tree/model")
if err == nil && strings.Contains(strings.ToLower(string(bytes)), "raspberry") {
buf := bufio.NewWriter(os.Stdout)
fmt.Fprintln(buf, "raspberry pi can not use this command")
buf.Flush()
return errors.New("raspberry pi can not use this command")
}
if isExist := checkGlobalCfg(); !isExist {
buf := bufio.NewWriter(os.Stdout)
fmt.Fprintln(buf, "global.cfg can not be found")
buf.Flush()
return errors.New("global.cfg can not be found")
}
cmd := exec.Command("system-docker", "run", "--rm", "-it",
"-v", "/:/host",
"-w", "/host",
"--entrypoint=nano",
"burmilla/os-console:"+config.Version,
"boot/global.cfg")
cmd.Stdout, cmd.Stderr, cmd.Stdin = os.Stdout, os.Stderr, os.Stdin
return cmd.Run()
}
func configSet(c *cli.Context) error {
if c.NArg() < 2 {
return nil
}
key := c.Args().Get(0)
value := c.Args().Get(1)
if key == "" {
return nil
}
err := config.Set(key, value)
if err != nil {
log.Fatal(err)
}
return nil
}
func configGet(c *cli.Context) error {
arg := c.Args().Get(0)
if arg == "" {
return nil
}
val, err := config.Get(arg)
if err != nil {
log.WithFields(log.Fields{"key": arg, "val": val, "err": err}).Fatal("config get: failed to retrieve value")
}
printYaml := false
switch val.(type) {
case []interface{}:
printYaml = true
case map[interface{}]interface{}:
printYaml = true
}
if printYaml {
bytes, err := yaml.Marshal(val)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(bytes))
} else {
fmt.Println(val)
}
return nil
}
func merge(c *cli.Context) error {
bytes, err := inputBytes(c)
if err != nil {
log.Fatal(err)
}
if err = config.Merge(bytes); err != nil {
log.Error(err)
validationErrors, err := config.ValidateBytes(bytes)
if err != nil {
log.Fatal(err)
}
for _, validationError := range validationErrors.Errors() {
log.Error(validationError)
}
log.Fatal("EXITING: Failed to parse configuration")
}
return nil
}
func export(c *cli.Context) error {
content, err := config.Export(c.Bool("private"), c.Bool("full"))
if err != nil {
log.Fatal(err)
}
output := c.String("output")
if output == "" {
fmt.Println(content)
} else {
err := util.WriteFileAtomic(output, []byte(content), 0400)
if err != nil {
log.Fatal(err)
}
}
return nil
}
func validate(c *cli.Context) error {
bytes, err := inputBytes(c)
if err != nil {
log.Fatal(err)
}
validationErrors, err := config.ValidateBytes(bytes)
if err != nil {
log.Fatal(err)
}
for _, validationError := range validationErrors.Errors() {
log.Error(validationError)
}
return nil
}
func inputBytes(c *cli.Context) ([]byte, error) {
input := os.Stdin
inputFile := c.String("input")
if inputFile != "" {
var err error
input, err = os.Open(inputFile)
if err != nil {
return nil, err
}
defer input.Close()
}
content, err := ioutil.ReadAll(input)
if err != nil {
return nil, err
}
if bytes.Contains(content, []byte{13, 10}) {
return nil, errors.New("file format shouldn't contain CRLF characters")
}
return content, nil
}
================================================
FILE: cmd/control/config_test.go
================================================
package control
import (
"bytes"
"os"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func TestGenTpl(t *testing.T) {
assert := require.New(t)
tpl := `
services:
{{if eq "amd64" .ARCH -}}
acpid:
image: burmilla/os-acpid:0.x.x
labels:
io.rancher.os.scope: system
net: host
uts: host
privileged: true
volumes_from:
- command-volumes
- system-volumes
{{end -}}
all-volumes:`
for _, tc := range []struct {
arch string
expected string
}{
{"amd64", `
services:
acpid:
image: burmilla/os-acpid:0.x.x
labels:
io.rancher.os.scope: system
net: host
uts: host
privileged: true
volumes_from:
- command-volumes
- system-volumes
all-volumes:`},
{"arm", `
services:
all-volumes:`},
} {
out := &bytes.Buffer{}
os.Setenv("ARCH", tc.arch)
genTpl(strings.NewReader(tpl), out)
assert.Equal(tc.expected, out.String(), tc.arch)
}
}
================================================
FILE: cmd/control/console.go
================================================
package control
import (
"fmt"
"sort"
"strings"
"github.com/burmilla/os/cmd/control/service"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/compose"
"github.com/burmilla/os/pkg/docker"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
"github.com/burmilla/os/pkg/util/network"
"github.com/codegangsta/cli"
"github.com/docker/docker/reference"
composeConfig "github.com/docker/libcompose/config"
"github.com/docker/libcompose/project/options"
"golang.org/x/net/context"
)
func consoleSubcommands() []cli.Command {
return []cli.Command{
{
Name: "switch",
Usage: "switch console without a reboot",
Action: consoleSwitch,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "force, f",
Usage: "do not prompt for input",
},
cli.BoolFlag{
Name: "no-pull",
Usage: "don't pull console image",
},
},
},
{
Name: "enable",
Usage: "set console to be switched on next reboot",
Action: consoleEnable,
},
{
Name: "list",
Usage: "list available consoles",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "update, u",
Usage: "update console cache",
},
},
Action: consoleList,
},
}
}
func consoleSwitch(c *cli.Context) error {
if len(c.Args()) != 1 {
log.Fatal("Must specify exactly one console to switch to")
}
newConsole := c.Args()[0]
cfg := config.LoadConfig()
validateConsole(newConsole, cfg)
if newConsole == CurrentConsole() {
log.Warnf("Console is already set to %s", newConsole)
}
if !c.Bool("force") {
fmt.Println(`Switching consoles will
1. destroy the current console container
2. log you out
3. restart Docker`)
if !yes("Continue") {
return nil
}
}
if !c.Bool("no-pull") && newConsole != "default" {
if err := compose.StageServices(cfg, newConsole); err != nil {
return err
}
}
service, err := compose.CreateService(nil, "switch-console", &composeConfig.ServiceConfigV1{
LogDriver: "json-file",
Privileged: true,
Net: "host",
Pid: "host",
Image: config.OsBase,
Labels: map[string]string{
config.ScopeLabel: config.System,
},
Command: []string{"/usr/bin/ros", "switch-console", newConsole},
VolumesFrom: []string{"all-volumes"},
})
if err != nil {
return err
}
if err = service.Delete(context.Background(), options.Delete{}); err != nil {
return err
}
if err = service.Up(context.Background(), options.Up{}); err != nil {
return err
}
return service.Log(context.Background(), true)
}
func consoleEnable(c *cli.Context) error {
if len(c.Args()) != 1 {
log.Fatal("Must specify exactly one console to enable")
}
newConsole := c.Args()[0]
cfg := config.LoadConfig()
validateConsole(newConsole, cfg)
if newConsole != "default" {
if err := compose.StageServices(cfg, newConsole); err != nil {
return err
}
}
if err := config.Set("rancher.console", newConsole); err != nil {
log.Errorf("Failed to update 'rancher.console': %v", err)
}
return nil
}
func consoleList(c *cli.Context) error {
cfg := config.LoadConfig()
consoles := availableConsoles(cfg, c.Bool("update"))
CurrentConsole := CurrentConsole()
for _, console := range consoles {
if console == CurrentConsole {
fmt.Printf("current %s\n", console)
} else if console == cfg.Rancher.Console {
fmt.Printf("enabled %s\n", console)
} else {
fmt.Printf("disabled %s\n", console)
}
}
return nil
}
func validateConsole(console string, cfg *config.CloudConfig) {
consoles := availableConsoles(cfg, false)
if !service.IsLocalOrURL(console) && !util.Contains(consoles, console) {
log.Fatalf("%s is not a valid console", console)
}
}
func availableConsoles(cfg *config.CloudConfig, update bool) []string {
if update {
err := network.UpdateCaches(cfg.Rancher.Repositories.ToArray(), "consoles")
if err != nil {
log.Debugf("Failed to update console caches: %v", err)
}
}
consoles, err := network.GetConsoles(cfg.Rancher.Repositories.ToArray())
if err != nil {
log.Fatal(err)
}
consoles = append(consoles, "default")
sort.Strings(consoles)
return consoles
}
// CurrentConsole gets the name of the console that's running
func CurrentConsole() (console string) {
// TODO: replace this docker container look up with a libcompose service lookup?
// sudo system-docker inspect --format "{{.Config.Image}}" console
client, err := docker.NewSystemClient()
if err != nil {
log.Warnf("Failed to detect current console: %v", err)
return
}
info, err := client.ContainerInspect(context.Background(), "console")
if err != nil {
log.Warnf("Failed to detect current console: %v", err)
return
}
// parse image name, then remove os- prefix and the console suffix
image, err := reference.ParseNamed(info.Config.Image)
if err != nil {
log.Warnf("Failed to detect current console(%s): %v", info.Config.Image, err)
return
}
if strings.Contains(image.Name(), "os-console") {
console = "default"
return
}
console = strings.TrimPrefix(strings.TrimSuffix(image.Name(), "console"), "burmilla/os-")
return
}
================================================
FILE: cmd/control/console_init.go
================================================
package control
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path"
"strconv"
"strings"
"syscall"
"text/template"
"github.com/burmilla/os/cmd/cloudinitexecute"
"github.com/burmilla/os/config"
"github.com/burmilla/os/config/cmdline"
"github.com/burmilla/os/pkg/compose"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
"github.com/codegangsta/cli"
"golang.org/x/crypto/ssh/terminal"
"golang.org/x/sys/unix"
)
const (
consoleDone = "/run/console-done"
dockerHome = "/home/docker"
gettyCmd = "/sbin/agetty"
rancherHome = "/home/rancher"
startScript = "/opt/rancher/bin/start.sh"
runLockDir = "/run/lock"
sshdFile = "/etc/ssh/sshd_config"
sshdTplFile = "/etc/ssh/sshd_config.tpl"
)
type symlink struct {
oldname, newname string
}
func consoleInitAction(c *cli.Context) error {
return consoleInitFunc()
}
func createHomeDir(homedir string, uid, gid int) {
if _, err := os.Stat(homedir); os.IsNotExist(err) {
if err := os.MkdirAll(homedir, 0755); err != nil {
log.Error(err)
}
if err := os.Chown(homedir, uid, gid); err != nil {
log.Error(err)
}
}
}
func enableBashRC(homedir string, uid, gid int) {
if _, err := os.Stat(homedir + "/.bash_logout"); os.IsNotExist(err) {
if err := util.FileCopy("/etc/skel/.bash_logout", homedir+"/.bash_logout"); err != nil {
log.Error(err)
}
if err := os.Chown(homedir+"/.bash_logout", uid, gid); err != nil {
log.Error(err)
}
}
if _, err := os.Stat(homedir + "/.bashrc"); os.IsNotExist(err) {
if err := util.FileCopy("/etc/skel/.bashrc", homedir+"/.bashrc"); err != nil {
log.Error(err)
}
if err := os.Chown(homedir+"/.bashrc", uid, gid); err != nil {
log.Error(err)
}
}
if _, err := os.Stat(homedir + "/.profile"); os.IsNotExist(err) {
if err := util.FileCopy("/etc/skel/.profile", homedir+"/.profile"); err != nil {
log.Error(err)
}
if err := os.Chown(homedir+"/.profile", uid, gid); err != nil {
log.Error(err)
}
}
}
func consoleInitFunc() error {
cfg := config.LoadConfig()
// Now that we're booted, stop writing debug messages to the console
cmd := exec.Command("sudo", "dmesg", "--console-off")
if err := cmd.Run(); err != nil {
log.Error(err)
}
createHomeDir(rancherHome, 1100, 1100)
createHomeDir(dockerHome, 1101, 1101)
// who & w command need this file
if _, err := os.Stat("/run/utmp"); os.IsNotExist(err) {
f, err := os.OpenFile("/run/utmp", os.O_RDWR|os.O_CREATE, 0644)
if err != nil {
log.Error(err)
}
defer f.Close()
}
// last command need this file
if _, err := os.Stat("/var/log/wtmp"); os.IsNotExist(err) {
f, err := os.OpenFile("/var/log/wtmp", os.O_RDWR|os.O_CREATE, 0644)
if err != nil {
log.Error(err)
}
defer f.Close()
}
// some software need this dir, like open-iscsi
if _, err := os.Stat(runLockDir); os.IsNotExist(err) {
if err = os.Mkdir(runLockDir, 0755); err != nil {
log.Error(err)
}
}
ignorePassword := false
for _, d := range cfg.Rancher.Disable {
if d == "password" {
ignorePassword = true
break
}
}
password := cmdline.GetCmdline("rancher.password")
if !ignorePassword && password != "" {
cmd := exec.Command("chpasswd")
cmd.Stdin = strings.NewReader(fmt.Sprint("rancher:", password))
if err := cmd.Run(); err != nil {
log.Error(err)
}
cmd = exec.Command("bash", "-c", `sed -E -i 's/(rancher:.*:).*(:.*:.*:.*:.*:.*:.*)$/\1\2/' /etc/shadow`)
if err := cmd.Run(); err != nil {
log.Error(err)
}
}
const pollInfo = `#!/bin/sh
export TERM=xterm-256color
echo "
$(tput setaf 3)
--------------------------------------------------
| Dear Burmilla OS user, |
| Please, answer to poll in $(tput setaf 4)burmillaos.org/poll$(tput setaf 3) |
| about your main Burmilla OS use case. |
| |
| Thank you advance. |
| |
| You can disable this message with command: |
| $(tput setaf 5)sudo chmod a-x /etc/update-motd.d/1-burmillaos-1$(tput setaf 3) |
--------------------------------------------------
$(tput sgr0)
"
`
if _, err := os.Stat("/etc/update-motd.d/1-burmillaos-1"); os.IsNotExist(err) {
if err := ioutil.WriteFile("/etc/update-motd.d/1-burmillaos-1", []byte(pollInfo), 0755); err != nil {
log.Error(err)
}
}
if err := setupSSH(cfg); err != nil {
log.Error(err)
}
if err := writeRespawn("rancher", cfg.Rancher.SSH.Daemon, false); err != nil {
log.Error(err)
}
if err := modifySshdConfig(cfg); err != nil {
log.Error(err)
}
p, err := compose.GetProject(cfg, false, true)
if err != nil {
log.Error(err)
}
// check the multi engine service & generate the multi engine script
for _, key := range p.ServiceConfigs.Keys() {
serviceConfig, ok := p.ServiceConfigs.Get(key)
if !ok {
log.Errorf("Failed to get service config from the project")
continue
}
if _, ok := serviceConfig.Labels[config.UserDockerLabel]; ok {
err = util.GenerateDindEngineScript(serviceConfig.Labels[config.UserDockerLabel])
if err != nil {
log.Errorf("Failed to generate engine script: %v", err)
continue
}
}
}
// create Docker CLI plugins folder
if _, err := os.Stat("/usr/libexec/docker/cli-plugins"); os.IsNotExist(err) {
if err = os.MkdirAll("/usr/libexec/docker/cli-plugins", 0755); err != nil {
log.Error(err)
}
}
baseSymlink := symLinkEngineBinary()
if _, err := os.Stat(dockerCompletionFile); err == nil {
baseSymlink = append(baseSymlink, symlink{
dockerCompletionFile, dockerCompletionLinkFile,
})
}
for _, link := range baseSymlink {
syscall.Unlink(link.newname)
if err := os.Symlink(link.oldname, link.newname); err != nil {
log.Error(err)
}
}
// mount systemd cgroups
if err := os.MkdirAll("/sys/fs/cgroup/systemd", 0555); err != nil {
log.Error(err)
}
if err := unix.Mount("cgroup", "/sys/fs/cgroup/systemd", "cgroup", 0, "none,name=systemd"); err != nil {
log.Error(err)
}
// font backslashes need to be escaped for when issue is output! (but not the others..)
if err := ioutil.WriteFile("/etc/issue", []byte(config.Banner), 0644); err != nil {
log.Error(err)
}
// write out a profile.d file for the proxy settings.
// maybe write these on the host and bindmount into everywhere?
proxyLines := []string{}
for _, k := range []string{"http_proxy", "HTTP_PROXY", "https_proxy", "HTTPS_PROXY", "no_proxy", "NO_PROXY"} {
if v, ok := cfg.Rancher.Environment[k]; ok {
proxyLines = append(proxyLines, fmt.Sprintf("export %s=%q", k, v))
}
}
if len(proxyLines) > 0 {
proxyString := strings.Join(proxyLines, "\n")
proxyString = fmt.Sprintf("#!/bin/sh\n%s\n", proxyString)
if err := ioutil.WriteFile("/etc/profile.d/proxy.sh", []byte(proxyString), 0755); err != nil {
log.Error(err)
}
}
// write out a profile.d file for the PATH settings.
pathLines := []string{}
for _, k := range []string{"PATH", "path"} {
if v, ok := cfg.Rancher.Environment[k]; ok {
for _, p := range strings.Split(v, ",") {
pathLines = append(pathLines, fmt.Sprintf("export PATH=$PATH:%s", strings.TrimSpace(p)))
}
}
}
if len(pathLines) > 0 {
pathString := strings.Join(pathLines, "\n")
pathString = fmt.Sprintf("#!/bin/sh\n%s\n", pathString)
if err := ioutil.WriteFile("/etc/profile.d/path.sh", []byte(pathString), 0755); err != nil {
log.Error(err)
}
}
cmd = exec.Command("bash", "-c", `echo $(/sbin/ifconfig | grep -B1 "inet" |awk '{ if ( $1 == "inet" ) { print $2 } else if ( $3 == "mtu" ) { printf "%s:" ,$1 } }' |awk -F: '{ print $1 ": " $3}') >> /etc/issue`)
if err := cmd.Run(); err != nil {
log.Error(err)
}
cloudinitexecute.ApplyConsole(cfg)
if err := util.RunScript(config.CloudConfigScriptFile); err != nil {
log.Error(err)
}
if err := util.RunScript(startScript); err != nil {
log.Error(err)
}
if err := ioutil.WriteFile(consoleDone, []byte(CurrentConsole()), 0644); err != nil {
log.Error(err)
}
// Check if user Docker has ever run in this installation yet and switch to latest/user defined version if not
if _, err := os.Stat("/var/lib/docker/engine-id"); os.IsNotExist(err) {
dockerVersion := "latest"
if cfg.Rancher.Docker.Engine != dockerVersion {
dockerVersion = cfg.Rancher.Docker.Engine
}
log.Warn("User Docker does not exist, switching to " + dockerVersion)
cmd := exec.Command("/usr/bin/ros", "engine", "switch", dockerVersion)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Error(err)
}
}
if err := util.RunScript("/etc/rc.local"); err != nil {
log.Error(err)
}
if err := util.RunScript("/etc/init.d/apparmor", "start"); err != nil {
log.Error(err)
}
// Enable Bash colors
enableBashRC("/root", 0, 0)
enableBashRC(rancherHome, 1100, 1100)
enableBashRC(dockerHome, 1101, 1101)
os.Setenv("TERM", "linux")
respawnBinPath, err := exec.LookPath("respawn")
if err != nil {
return err
}
return syscall.Exec(respawnBinPath, []string{"respawn", "-f", "/etc/respawn.conf"}, os.Environ())
}
func generateRespawnConf(cmdline, user string, sshd, recovery bool) string {
var respawnConf bytes.Buffer
autologinBin := "/usr/bin/autologin"
if recovery {
autologinBin = "/usr/bin/recovery"
}
config := config.LoadConfig()
allowAutoLogin := true
for _, d := range config.Rancher.Disable {
if d == "autologin" {
allowAutoLogin = false
break
}
}
for i := 1; i < 7; i++ {
tty := fmt.Sprintf("tty%d", i)
if !istty(tty) {
continue
}
respawnConf.WriteString(gettyCmd)
if allowAutoLogin && strings.Contains(cmdline, fmt.Sprintf("rancher.autologin=%s", tty)) {
respawnConf.WriteString(fmt.Sprintf(" -n -l %s -o %s:tty%d", autologinBin, user, i))
}
respawnConf.WriteString(fmt.Sprintf(" --noclear %s linux\n", tty))
}
for _, tty := range []string{"ttyS0", "ttyS1", "ttyS2", "ttyS3", "ttyAMA0"} {
if !strings.Contains(cmdline, fmt.Sprintf("console=%s", tty)) {
continue
}
if !istty(tty) {
continue
}
respawnConf.WriteString(gettyCmd)
if allowAutoLogin && strings.Contains(cmdline, fmt.Sprintf("rancher.autologin=%s", tty)) {
respawnConf.WriteString(fmt.Sprintf(" -n -l %s -o %s:%s", autologinBin, user, tty))
}
respawnConf.WriteString(fmt.Sprintf(" %s\n", tty))
}
if sshd {
respawnConf.WriteString("/usr/sbin/sshd -D")
}
return respawnConf.String()
}
func writeRespawn(user string, sshd, recovery bool) error {
cmdline, err := ioutil.ReadFile("/proc/cmdline")
if err != nil {
return err
}
respawn := generateRespawnConf(string(cmdline), user, sshd, recovery)
files, err := ioutil.ReadDir("/etc/respawn.conf.d")
if err == nil {
for _, f := range files {
p := path.Join("/etc/respawn.conf.d", f.Name())
content, err := ioutil.ReadFile(p)
if err != nil {
log.Errorf("Failed to read %s: %v", p, err)
continue
}
respawn += fmt.Sprintf("\n%s", string(content))
}
} else if !os.IsNotExist(err) {
log.Error(err)
}
return ioutil.WriteFile("/etc/respawn.conf", []byte(respawn), 0644)
}
func modifySshdConfig(cfg *config.CloudConfig) error {
_, err := os.Stat(sshdTplFile)
if err == nil {
os.Remove(sshdFile)
sshdTpl, err := template.ParseFiles(sshdTplFile)
if err != nil {
return err
}
f, err := os.OpenFile(sshdFile, os.O_WRONLY|os.O_CREATE, 0644)
if err != nil {
return err
}
defer f.Close()
config := map[string]string{}
if cfg.Rancher.SSH.Port > 0 && cfg.Rancher.SSH.Port < 65355 {
config["Port"] = strconv.Itoa(cfg.Rancher.SSH.Port)
}
if cfg.Rancher.SSH.ListenAddress != "" {
config["ListenAddress"] = cfg.Rancher.SSH.ListenAddress
}
return sshdTpl.Execute(f, config)
} else if os.IsNotExist(err) {
return nil
}
return err
}
func setupSSH(cfg *config.CloudConfig) error {
for _, keyType := range []string{"rsa", "ed25519"} {
outputFile := fmt.Sprintf("/etc/ssh/ssh_host_%s_key", keyType)
outputFilePub := fmt.Sprintf("/etc/ssh/ssh_host_%s_key.pub", keyType)
if _, err := os.Stat(outputFile); err == nil {
continue
}
saved, savedExists := cfg.Rancher.SSH.Keys[keyType]
pub, pubExists := cfg.Rancher.SSH.Keys[keyType+"-pub"]
if savedExists && pubExists {
// TODO check permissions
if err := util.WriteFileAtomic(outputFile, []byte(saved), 0600); err != nil {
return err
}
if err := util.WriteFileAtomic(outputFilePub, []byte(pub), 0600); err != nil {
return err
}
continue
}
cmd := exec.Command("bash", "-c", fmt.Sprintf("ssh-keygen -f %s -N '' -t %s", outputFile, keyType))
if err := cmd.Run(); err != nil {
return err
}
savedBytes, err := ioutil.ReadFile(outputFile)
if err != nil {
return err
}
pubBytes, err := ioutil.ReadFile(outputFilePub)
if err != nil {
return err
}
config.Set(fmt.Sprintf("rancher.ssh.keys.%s", keyType), string(savedBytes))
config.Set(fmt.Sprintf("rancher.ssh.keys.%s-pub", keyType), string(pubBytes))
}
return os.MkdirAll("/var/run/sshd", 0644)
}
func istty(name string) bool {
if f, err := os.Open(fmt.Sprintf("/dev/%s", name)); err == nil {
return terminal.IsTerminal(int(f.Fd()))
}
return false
}
================================================
FILE: cmd/control/dev.go
================================================
package control
import (
"fmt"
"github.com/burmilla/os/pkg/util"
"github.com/codegangsta/cli"
)
func devAction(c *cli.Context) error {
if len(c.Args()) > 0 {
fmt.Println(util.ResolveDevice(c.Args()[0]))
}
return nil
}
================================================
FILE: cmd/control/docker_init.go
================================================
package control
import (
"fmt"
"io/ioutil"
"os"
"path"
"strings"
"syscall"
"time"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
"github.com/codegangsta/cli"
)
const (
dockerConf = "/var/lib/rancher/conf/docker"
dockerDone = "/run/docker-done"
dockerLog = "/var/log/docker.log"
dockerCompletionLinkFile = "/usr/share/bash-completion/completions/docker"
dockerCompletionFile = "/var/lib/rancher/engine/completion"
)
func dockerInitAction(c *cli.Context) error {
// TODO: this should be replaced by a "Console ready event watcher"
for {
if _, err := os.Stat(consoleDone); err == nil {
break
}
time.Sleep(200 * time.Millisecond)
}
if _, err := os.Stat(dockerCompletionFile); err != nil {
if _, err := os.Readlink(dockerCompletionLinkFile); err == nil {
syscall.Unlink(dockerCompletionLinkFile)
}
}
dockerBin := ""
dockerPaths := []string{
"/usr/bin",
"/opt/bin",
"/usr/local/bin",
"/var/lib/rancher/docker",
}
for _, binPath := range dockerPaths {
if util.ExistsAndExecutable(path.Join(binPath, "dockerd")) {
dockerBin = path.Join(binPath, "dockerd")
break
}
}
if dockerBin == "" {
for _, binPath := range dockerPaths {
if util.ExistsAndExecutable(path.Join(binPath, "docker")) {
dockerBin = path.Join(binPath, "docker")
break
}
}
}
if dockerBin == "" {
err := fmt.Errorf("Failed to find either dockerd or docker binaries")
log.Error(err)
return err
}
log.Infof("Found %s", dockerBin)
if err := syscall.Mount("", "/", "", syscall.MS_SHARED|syscall.MS_REC, ""); err != nil {
log.Error(err)
}
if err := syscall.Mount("", "/run", "", syscall.MS_SHARED|syscall.MS_REC, ""); err != nil {
log.Error(err)
}
mountInfo, err := ioutil.ReadFile("/proc/self/mountinfo")
if err != nil {
return err
}
for _, mount := range strings.Split(string(mountInfo), "\n") {
if strings.Contains(mount, "/var/lib/user-docker /var/lib/docker") && strings.Contains(mount, "rootfs") {
os.Setenv("DOCKER_RAMDISK", "true")
}
}
cfg := config.LoadConfig()
for _, link := range symLinkEngineBinary() {
syscall.Unlink(link.newname)
if _, err := os.Stat(link.oldname); err == nil {
if err := os.Symlink(link.oldname, link.newname); err != nil {
log.Error(err)
}
}
}
err = checkZfsBackingFS(cfg.Rancher.Docker.StorageDriver, cfg.Rancher.Docker.DataRoot)
if err != nil {
log.Fatal(err)
}
args := []string{
"bash",
"-c",
fmt.Sprintf(`[ -e %s ] && source %s; exec /usr/bin/dockerlaunch %s %s $DOCKER_OPTS >> %s 2>&1`, dockerConf, dockerConf, dockerBin, strings.Join(c.Args(), " "), dockerLog),
}
// TODO: this should be replaced by a "Docker ready event watcher"
if err := ioutil.WriteFile(dockerDone, []byte(CurrentEngine()), 0644); err != nil {
log.Error(err)
}
return syscall.Exec("/bin/bash", args, os.Environ())
}
================================================
FILE: cmd/control/engine.go
================================================
package control
import (
"fmt"
"io/ioutil"
"net"
"os"
"path"
"sort"
"strconv"
"strings"
"github.com/burmilla/os/cmd/control/service"
"github.com/burmilla/os/cmd/control/service/app"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/compose"
"github.com/burmilla/os/pkg/docker"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
"github.com/burmilla/os/pkg/util/network"
"github.com/burmilla/os/pkg/util/versions"
yaml "github.com/cloudfoundry-incubator/candiedyaml"
"github.com/codegangsta/cli"
"github.com/docker/docker/reference"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
composeConfig "github.com/docker/libcompose/config"
"github.com/docker/libcompose/project/options"
composeYaml "github.com/docker/libcompose/yaml"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
func engineSubcommands() []cli.Command {
return []cli.Command{
{
Name: "switch",
Usage: "switch user Docker engine without a reboot",
Action: engineSwitch,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "force, f",
Usage: "do not prompt for input",
},
cli.BoolFlag{
Name: "no-pull",
Usage: "don't pull console image",
},
},
},
{
Name: "create",
Usage: "create Dind engine without a reboot",
Description: "must switch user docker to 17.12.1 or earlier if using Dind",
ArgsUsage: "<name>",
Before: preFlightValidate,
Action: engineCreate,
Flags: []cli.Flag{
cli.StringFlag{
Name: "version, v",
Value: config.DefaultDind,
Usage: fmt.Sprintf("set the version for the engine, %s are available", config.SupportedDinds),
},
cli.StringFlag{
Name: "network",
Usage: "set the network for the engine",
},
cli.StringFlag{
Name: "fixed-ip",
Usage: "set the fixed ip for the engine",
},
cli.StringFlag{
Name: "ssh-port",
Usage: "set the ssh port for the engine",
},
cli.StringFlag{
Name: "authorized-keys",
Usage: "set the ssh authorized_keys absolute path for the engine",
},
},
},
{
Name: "rm",
Usage: "remove Dind engine without a reboot",
ArgsUsage: "<name>",
Before: func(c *cli.Context) error {
if len(c.Args()) != 1 {
return errors.New("Must specify exactly one Docker engine to remove")
}
return nil
},
Action: dindEngineRemove,
Flags: []cli.Flag{
cli.IntFlag{
Name: "timeout,t",
Usage: "specify a shutdown timeout in seconds",
Value: 10,
},
cli.BoolFlag{
Name: "force, f",
Usage: "do not prompt for input",
},
},
},
{
Name: "enable",
Usage: "set user Docker engine to be switched on next reboot",
Action: engineEnable,
},
{
Name: "list",
Usage: "list available Docker engines (include the Dind engines)",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "update, u",
Usage: "update engine cache",
},
},
Action: engineList,
},
}
}
func engineSwitch(c *cli.Context) error {
if len(c.Args()) != 1 {
log.Fatal("Must specify exactly one Docker engine to switch to")
}
newEngine := c.Args()[0]
cfg := config.LoadConfig()
if newEngine == "latest" {
engines := availableEngines(cfg, true)
newEngine = engines[len(engines)-1]
currentEngine := CurrentEngine()
if newEngine == currentEngine {
log.Infof("Latest engine %s is already running", newEngine)
return nil
}
log.Infof("Switching to engine %s", newEngine)
} else {
validateEngine(newEngine, cfg)
}
project, err := compose.GetProject(cfg, true, false)
if err != nil {
log.Fatal(err)
}
if err = project.Stop(context.Background(), 10, "docker"); err != nil {
log.Fatal(err)
}
if err = compose.LoadSpecialService(project, cfg, "docker", newEngine); err != nil {
log.Fatal(err)
}
if err = project.Up(context.Background(), options.Up{}, "docker"); err != nil {
log.Fatal(err)
}
if err := config.Set("rancher.docker.engine", newEngine); err != nil {
log.Errorf("Failed to update rancher.docker.engine: %v", err)
}
return nil
}
func engineCreate(c *cli.Context) error {
name := c.Args()[0]
version := c.String("version")
sshPort, _ := strconv.Atoi(c.String("ssh-port"))
if sshPort <= 0 {
sshPort = randomSSHPort()
}
authorizedKeys := c.String("authorized-keys")
network := c.String("network")
fixedIP := c.String("fixed-ip")
// generate & create engine compose
err := generateEngineCompose(name, version, sshPort, authorizedKeys, network, fixedIP)
if err != nil {
return err
}
// stage engine service
cfg := config.LoadConfig()
var enabledServices []string
if val, ok := cfg.Rancher.ServicesInclude[name]; !ok || !val {
cfg.Rancher.ServicesInclude[name] = true
enabledServices = append(enabledServices, name)
}
if len(enabledServices) > 0 {
if err := compose.StageServices(cfg, enabledServices...); err != nil {
log.Fatal(err)
}
if err := config.Set("rancher.services_include", cfg.Rancher.ServicesInclude); err != nil {
log.Fatal(err)
}
}
// generate engine script
err = util.GenerateDindEngineScript(name)
if err != nil {
log.Fatal(err)
}
return nil
}
func dindEngineRemove(c *cli.Context) error {
if !c.Bool("force") {
if !yes("Continue") {
return nil
}
}
// app.ProjectDelete needs to use this flag
// Allow deletion of the Dind engine
c.Set("force", "true")
// Remove volumes associated with the Dind engine container
c.Set("v", "true")
name := c.Args()[0]
cfg := config.LoadConfig()
p, err := compose.GetProject(cfg, true, false)
if err != nil {
log.Fatalf("Get project failed: %v", err)
}
// 1. service stop
err = app.ProjectStop(p, c)
if err != nil {
log.Fatalf("Stop project service failed: %v", err)
}
// 2. service delete
err = app.ProjectDelete(p, c)
if err != nil {
log.Fatalf("Delete project service failed: %v", err)
}
// 3. service delete
if _, ok := cfg.Rancher.ServicesInclude[name]; !ok {
log.Fatalf("Failed to found enabled service %s", name)
}
delete(cfg.Rancher.ServicesInclude, name)
if err = config.Set("rancher.services_include", cfg.Rancher.ServicesInclude); err != nil {
log.Fatal(err)
}
// 4. remove service from file
err = RemoveEngineFromCompose(name)
if err != nil {
log.Fatal(err)
}
// 5. remove dind engine script
err = util.RemoveDindEngineScript(name)
if err != nil {
return err
}
return nil
}
func engineEnable(c *cli.Context) error {
if len(c.Args()) != 1 {
log.Fatal("Must specify exactly one Docker engine to enable")
}
newEngine := c.Args()[0]
cfg := config.LoadConfig()
validateEngine(newEngine, cfg)
if err := compose.StageServices(cfg, newEngine); err != nil {
return err
}
if err := config.Set("rancher.docker.engine", newEngine); err != nil {
log.Errorf("Failed to update 'rancher.docker.engine': %v", err)
}
return nil
}
func engineList(c *cli.Context) error {
cfg := config.LoadConfig()
engines := availableEngines(cfg, c.Bool("update"))
currentEngine := CurrentEngine()
i := 1
for _, engine := range engines {
if engine == currentEngine {
if i == len(engines) {
fmt.Printf("current %s (latest)\n", engine)
} else {
fmt.Printf("current %s\n", engine)
}
} else if engine == cfg.Rancher.Docker.Engine {
if i == len(engines) {
fmt.Printf("enabled %s (latest)\n", engine)
} else {
fmt.Printf("enabled %s\n", engine)
}
} else {
if i == len(engines) {
fmt.Printf("disabled %s (latest)\n", engine)
} else {
fmt.Printf("disabled %s\n", engine)
}
}
i++
}
// check the dind container
client, err := docker.NewSystemClient()
if err != nil {
log.Warnf("Failed to detect dind: %v", err)
return nil
}
filter := filters.NewArgs()
filter.Add("label", config.UserDockerLabel)
opts := types.ContainerListOptions{
All: true,
Filter: filter,
}
containers, err := client.ContainerList(context.Background(), opts)
if err != nil {
log.Warnf("Failed to detect dind: %v", err)
return nil
}
for _, c := range containers {
if c.State == "running" {
fmt.Printf("enabled %s\n", c.Labels[config.UserDockerLabel])
} else {
fmt.Printf("disabled %s\n", c.Labels[config.UserDockerLabel])
}
}
return nil
}
func validateEngine(engine string, cfg *config.CloudConfig) {
engines := availableEngines(cfg, false)
if !service.IsLocalOrURL(engine) && !util.Contains(engines, engine) {
log.Fatalf("%s is not a valid engine", engine)
}
}
func availableEngines(cfg *config.CloudConfig, update bool) []string {
if update {
err := network.UpdateCaches(cfg.Rancher.Repositories.ToArray(), "engines")
if err != nil {
log.Debugf("Failed to update engine caches: %v", err)
}
}
engines, err := network.GetEngines(cfg.Rancher.Repositories.ToArray())
if err != nil {
log.Fatal(err)
}
sort.Strings(engines)
return engines
}
// CurrentEngine gets the name of the docker that's running
func CurrentEngine() (engine string) {
// sudo system-docker inspect --format "{{.Config.Image}}" docker
client, err := docker.NewSystemClient()
if err != nil {
log.Warnf("Failed to detect current docker: %v", err)
return
}
info, err := client.ContainerInspect(context.Background(), "docker")
if err != nil {
log.Warnf("Failed to detect current docker: %v", err)
return
}
// parse image name, then remove os- prefix and the engine suffix
image, err := reference.ParseNamed(info.Config.Image)
if err != nil {
log.Warnf("Failed to detect current docker(%s): %v", info.Config.Image, err)
return
}
if t, ok := image.(reference.NamedTagged); ok {
tag := t.Tag()
// compatible with some patch image tags, such as 17.12.1-1,17.06.2-1,...
tag = strings.SplitN(tag, "-", 2)[0]
if !strings.HasPrefix(tag, "1.") && versions.LessThan(tag, "18.09.0") {
// >= 18.09.0, docker-<version>
// < 18.09.0 and >= 16.03, docker-<version>-ce
// < 17.03, docker-<version>
tag = tag + "-ce"
}
return "docker-" + tag
}
return
}
func preFlightValidate(c *cli.Context) error {
if len(c.Args()) != 1 {
return errors.New("Must specify one engine name")
}
name := c.Args()[0]
if name == "" {
return errors.New("Must specify one engine name")
}
version := c.String("version")
if version == "" {
return errors.New("Must specify one engine version")
}
authorizedKeys := c.String("authorized-keys")
if authorizedKeys != "" {
if _, err := os.Stat(authorizedKeys); os.IsNotExist(err) {
return errors.New("The authorized-keys should be an exist file, recommended to put in the /opt or /var/lib/rancher directory")
}
}
network := c.String("network")
if network == "" {
return errors.New("Must specify network")
}
userDefineNetwork, err := CheckUserDefineNetwork(network)
if err != nil {
return err
}
fixedIP := c.String("fixed-ip")
if fixedIP == "" {
return errors.New("Must specify fix ip")
}
err = CheckUserDefineIPv4Address(fixedIP, *userDefineNetwork)
if err != nil {
return err
}
isVersionMatch := false
for _, v := range config.SupportedDinds {
if v == version {
isVersionMatch = true
break
}
}
if !isVersionMatch {
return errors.Errorf("Engine version not supported only %v are supported", config.SupportedDinds)
}
if c.String("ssh-port") != "" {
port, err := strconv.Atoi(c.String("ssh-port"))
if err != nil {
return errors.Wrap(err, "Failed to convert ssh port to Int")
}
if port > 0 {
addr, err := net.ResolveTCPAddr("tcp", "localhost:"+strconv.Itoa(port))
if err != nil {
return errors.Errorf("Failed to resolve tcp addr: %v", err)
}
l, err := net.ListenTCP("tcp", addr)
if err != nil {
return errors.Errorf("Failed to listen tcp: %v", err)
}
defer l.Close()
}
}
return nil
}
func randomSSHPort() int {
addr, err := net.ResolveTCPAddr("tcp", "localhost:0")
if err != nil {
log.Errorf("Failed to resolve tcp addr: %v", err)
return 0
}
l, err := net.ListenTCP("tcp", addr)
if err != nil {
return 0
}
defer l.Close()
return l.Addr().(*net.TCPAddr).Port
}
func generateEngineCompose(name, version string, sshPort int, authorizedKeys, network, fixedIP string) error {
if err := os.MkdirAll(path.Dir(config.MultiDockerConfFile), 0700); err != nil && !os.IsExist(err) {
log.Errorf("Failed to create directory for file %s: %v", config.MultiDockerConfFile, err)
return err
}
composeConfigs := map[string]composeConfig.ServiceConfigV1{}
if _, err := os.Stat(config.MultiDockerConfFile); err == nil {
// read from engine compose
bytes, err := ioutil.ReadFile(config.MultiDockerConfFile)
if err != nil {
return err
}
err = yaml.Unmarshal(bytes, &composeConfigs)
if err != nil {
return err
}
}
if err := os.MkdirAll(config.MultiDockerDataDir+"/"+name, 0700); err != nil && !os.IsExist(err) {
log.Errorf("Failed to create directory for file %s: %v", config.MultiDockerDataDir+"/"+name, err)
return err
}
volumes := []string{
"/lib/modules:/lib/modules",
config.MultiDockerDataDir + "/" + name + ":" + config.MultiDockerDataDir + "/" + name,
}
if authorizedKeys != "" {
volumes = append(volumes, authorizedKeys+":/root/.ssh/authorized_keys")
}
composeConfigs[name] = composeConfig.ServiceConfigV1{
Image: "${REGISTRY_DOMAIN}/" + version,
Restart: "always",
Privileged: true,
Net: network,
Ports: []string{strconv.Itoa(sshPort) + ":22"},
Volumes: volumes,
VolumesFrom: []string{},
Command: composeYaml.Command{
"--storage-driver=overlay2",
"--data-root=" + config.MultiDockerDataDir + "/" + name,
"--host=unix://" + config.MultiDockerDataDir + "/" + name + "/docker-" + name + ".sock",
},
Labels: composeYaml.SliceorMap{
"io.rancher.os.scope": "system",
"io.rancher.os.after": "console",
config.UserDockerLabel: name,
config.UserDockerNetLabel: network,
config.UserDockerFIPLabel: fixedIP,
},
}
bytes, err := yaml.Marshal(composeConfigs)
if err != nil {
return err
}
return ioutil.WriteFile(config.MultiDockerConfFile, bytes, 0640)
}
func RemoveEngineFromCompose(name string) error {
composeConfigs := map[string]composeConfig.ServiceConfigV1{}
if _, err := os.Stat(config.MultiDockerConfFile); err == nil {
// read from engine compose
bytes, err := ioutil.ReadFile(config.MultiDockerConfFile)
if err != nil {
return err
}
err = yaml.Unmarshal(bytes, &composeConfigs)
if err != nil {
return err
}
}
delete(composeConfigs, name)
bytes, err := yaml.Marshal(composeConfigs)
if err != nil {
return err
}
return ioutil.WriteFile(config.MultiDockerConfFile, bytes, 0640)
}
func CheckUserDefineNetwork(name string) (*types.NetworkResource, error) {
systemClient, err := docker.NewSystemClient()
if err != nil {
return nil, err
}
networks, err := systemClient.NetworkList(context.Background(), types.NetworkListOptions{})
if err != nil {
return nil, err
}
for _, network := range networks {
if network.Name == name {
return &network, nil
}
}
return nil, errors.Errorf("Failed to found the user define network: %s", name)
}
func CheckUserDefineIPv4Address(ipv4 string, network types.NetworkResource) error {
for _, config := range network.IPAM.Config {
_, ipnet, _ := net.ParseCIDR(config.Subnet)
if ipnet.Contains(net.ParseIP(ipv4)) {
return nil
}
}
return errors.Errorf("IP %s is not in the specified cidr", ipv4)
}
================================================
FILE: cmd/control/entrypoint.go
================================================
package control
import (
"os"
"os/exec"
"syscall"
"github.com/burmilla/os/cmd/cloudinitexecute"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/docker"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
"github.com/codegangsta/cli"
"golang.org/x/net/context"
)
const (
ca = "/etc/ssl/certs/ca-certificates.crt"
caBase = "/etc/ssl/certs/ca-certificates.crt.rancher"
)
func entrypointAction(c *cli.Context) error {
if _, err := os.Stat("/host/dev"); err == nil {
cmd := exec.Command("mount", "--rbind", "/host/dev", "/dev")
if err := cmd.Run(); err != nil {
log.Errorf("Failed to mount /dev: %v", err)
}
}
if err := util.FileCopy(caBase, ca); err != nil && !os.IsNotExist(err) {
log.Error(err)
}
cfg := config.LoadConfig()
shouldWriteFiles := false
for _, file := range cfg.WriteFiles {
if file.Container != "" {
shouldWriteFiles = true
}
}
if shouldWriteFiles {
writeFiles(cfg)
}
setupCommandSymlinks()
if len(os.Args) < 3 {
return nil
}
binary, err := exec.LookPath(os.Args[2])
if err != nil {
return err
}
return syscall.Exec(binary, os.Args[2:], os.Environ())
}
func writeFiles(cfg *config.CloudConfig) error {
id, err := util.GetCurrentContainerID()
if err != nil {
return err
}
client, err := docker.NewSystemClient()
if err != nil {
return err
}
info, err := client.ContainerInspect(context.Background(), id)
if err != nil {
return err
}
cloudinitexecute.WriteFiles(cfg, info.Name[1:])
return nil
}
func setupCommandSymlinks() {
for _, link := range []symlink{
{config.RosBin, "/usr/bin/autologin"},
{config.RosBin, "/usr/bin/recovery"},
{config.RosBin, "/usr/bin/cloud-init-execute"},
{config.RosBin, "/usr/bin/cloud-init-save"},
{config.RosBin, "/usr/bin/dockerlaunch"},
{config.RosBin, "/usr/bin/respawn"},
{config.RosBin, "/usr/sbin/netconf"},
{config.RosBin, "/usr/sbin/wait-for-docker"},
{config.RosBin, "/usr/sbin/poweroff"},
{config.RosBin, "/usr/sbin/reboot"},
{config.RosBin, "/usr/sbin/halt"},
{config.RosBin, "/usr/sbin/shutdown"},
{config.RosBin, "/sbin/poweroff"},
{config.RosBin, "/sbin/reboot"},
{config.RosBin, "/sbin/halt"},
{config.RosBin, "/sbin/shutdown"},
} {
os.Remove(link.newname)
if err := os.Symlink(link.oldname, link.newname); err != nil {
log.Error(err)
}
}
}
================================================
FILE: cmd/control/env.go
================================================
package control
import (
"log"
"os"
"os/exec"
"syscall"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/util"
"github.com/codegangsta/cli"
)
func envAction(c *cli.Context) error {
cfg := config.LoadConfig()
args := c.Args()
if len(args) == 0 {
return nil
}
osEnv := os.Environ()
envMap := make(map[string]string, len(cfg.Rancher.Environment)+len(osEnv))
for k, v := range cfg.Rancher.Environment {
envMap[k] = v
}
for k, v := range util.KVPairs2Map(osEnv) {
envMap[k] = v
}
if cmd, err := exec.LookPath(args[0]); err != nil {
log.Fatal(err)
} else {
args[0] = cmd
}
if err := syscall.Exec(args[0], args, util.Map2KVPairs(envMap)); err != nil {
log.Fatal(err)
}
return nil
}
================================================
FILE: cmd/control/install/grub.go
================================================
package install
import (
"html/template"
"os"
"os/exec"
"path/filepath"
"github.com/burmilla/os/pkg/log"
)
func RunGrub(baseName, device string) error {
log.Debugf("installGrub")
//grub-install --boot-directory=${baseName}/boot ${device}
cmd := exec.Command("grub-install", "--boot-directory="+baseName+"/boot", device)
if err := cmd.Run(); err != nil {
log.Errorf("%s", err)
return err
}
return nil
}
func grubConfig(menu BootVars) error {
log.Debugf("grubConfig")
filetmpl, err := template.New("grub2config").Parse(`{{define "grub2menu"}}menuentry "{{.Name}}" {
set root=(hd0,msdos1)
linux /{{.bootDir}}vmlinuz-{{.Version}}-rancheros {{.KernelArgs}} {{.Append}}
initrd /{{.bootDir}}initrd-{{.Version}}-rancheros
}
{{end}}
set default="0"
set timeout="{{.Timeout}}"
{{if .Fallback}}set fallback={{.Fallback}}{{end}}
{{- range .Entries}}
{{template "grub2menu" .}}
{{- end}}
`)
if err != nil {
log.Errorf("grub2config %s", err)
return err
}
cfgFile := filepath.Join(menu.BaseName, menu.BootDir+"grub/grub.cfg")
log.Debugf("grubConfig written to %s", cfgFile)
f, err := os.Create(cfgFile)
if err != nil {
return err
}
err = filetmpl.Execute(f, menu)
if err != nil {
return err
}
return nil
}
func PvGrubConfig(menu BootVars) error {
log.Debugf("pvGrubConfig")
filetmpl, err := template.New("grublst").Parse(`{{define "grubmenu"}}
title BurmillaOS {{.Version}}-({{.Name}})
root (hd0)
kernel /${bootDir}vmlinuz-{{.Version}}-rancheros {{.KernelArgs}} {{.Append}}
initrd /${bootDir}initrd-{{.Version}}-rancheros
{{end}}
default 0
timeout {{.Timeout}}
{{if .Fallback}}fallback {{.Fallback}}{{end}}
hiddenmenu
{{- range .Entries}}
{{template "grubmenu" .}}
{{- end}}
`)
if err != nil {
log.Errorf("pv grublst: %s", err)
return err
}
cfgFile := filepath.Join(menu.BaseName, menu.BootDir+"grub/menu.lst")
log.Debugf("grubMenu written to %s", cfgFile)
f, err := os.Create(cfgFile)
if err != nil {
log.Errorf("Create(%s) %s", cfgFile, err)
return err
}
err = filetmpl.Execute(f, menu)
if err != nil {
log.Errorf("execute %s", err)
return err
}
return nil
}
================================================
FILE: cmd/control/install/install.go
================================================
package install
import (
"os"
"os/exec"
"path/filepath"
"strings"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
)
type MenuEntry struct {
Name, BootDir, Version, KernelArgs, Append string
}
type BootVars struct {
BaseName, BootDir string
Timeout uint
Fallback int
Entries []MenuEntry
}
func MountDevice(baseName, device, partition string, raw bool) (string, string, error) {
log.Debugf("mountdevice %s, raw %v", partition, raw)
if partition == "" {
if raw {
log.Debugf("util.Mount (raw) %s, %s", partition, baseName)
cmd := exec.Command("lsblk", "-no", "pkname", partition)
log.Debugf("Run(%v)", cmd)
cmd.Stderr = os.Stderr
device := ""
// TODO: out can == "" - this is used to "detect software RAID" which is terrible
if out, err := cmd.Output(); err == nil {
device = "/dev/" + strings.TrimSpace(string(out))
}
log.Debugf("mountdevice return -> d: %s, p: %s", device, partition)
return device, partition, util.Mount(partition, baseName, "", "")
}
//rootfs := partition
// Don't use ResolveDevice - it can fail, whereas `blkid -L LABEL` works more often
d, _, err := util.Blkid("RANCHER_BOOT")
if err != nil {
log.Errorf("Failed to run blkid: %s", err)
}
if d != "" {
partition = d
baseName = filepath.Join(baseName, config.BootDir)
} else {
partition = GetStatePartition()
}
cmd := exec.Command("lsblk", "-no", "pkname", partition)
log.Debugf("Run(%v)", cmd)
cmd.Stderr = os.Stderr
// TODO: out can == "" - this is used to "detect software RAID" which is terrible
if out, err := cmd.Output(); err == nil {
device = "/dev/" + strings.TrimSpace(string(out))
}
}
os.MkdirAll(baseName, 0755)
cmd := exec.Command("mount", partition, baseName)
//cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
log.Debugf("mountdevice return2 -> d: %s, p: %s", device, partition)
return device, partition, cmd.Run()
}
func GetStatePartition() string {
cfg := config.LoadConfig()
if dev := util.ResolveDevice(cfg.Rancher.State.Dev); dev != "" {
// try the rancher.state.dev setting
return dev
}
d, _, err := util.Blkid("RANCHER_STATE")
if err != nil {
log.Errorf("Failed to run blkid: %s", err)
}
return d
}
func GetDefaultPartition(device string) string {
if strings.Contains(device, "nvme") {
return device + "p1"
}
return device + "1"
}
================================================
FILE: cmd/control/install/service.go
================================================
package install
import (
"io/ioutil"
"os"
"strings"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
"github.com/burmilla/os/pkg/util/network"
yaml "github.com/cloudfoundry-incubator/candiedyaml"
)
type ImageConfig struct {
Image string `yaml:"image,omitempty"`
}
func GetCacheImageList(cloudconfig string, oldcfg *config.CloudConfig) []string {
savedImages := make([]string, 0)
bytes, err := readConfigFile(cloudconfig)
if err != nil {
log.WithFields(log.Fields{"err": err}).Fatal("Failed to read cloud-config")
return savedImages
}
r := make(map[interface{}]interface{})
if err := yaml.Unmarshal(bytes, &r); err != nil {
log.WithFields(log.Fields{"err": err}).Fatal("Failed to unmarshal cloud-config")
return savedImages
}
newcfg := &config.CloudConfig{}
if err := util.Convert(r, newcfg); err != nil {
log.WithFields(log.Fields{"err": err}).Fatal("Failed to convert cloud-config")
return savedImages
}
// services_include
for key, value := range newcfg.Rancher.ServicesInclude {
if value {
serviceImage := getServiceImage(key, "", oldcfg, newcfg)
if serviceImage != "" {
savedImages = append(savedImages, serviceImage)
}
}
}
// console
newConsole := newcfg.Rancher.Console
if newConsole != "" && newConsole != "default" {
consoleImage := getServiceImage(newConsole, "console", oldcfg, newcfg)
if consoleImage != "" {
savedImages = append(savedImages, consoleImage)
}
}
// docker engine
newEngine := newcfg.Rancher.Docker.Engine
if newEngine != "" && newEngine != oldcfg.Rancher.Docker.Engine {
engineImage := getServiceImage(newEngine, "docker", oldcfg, newcfg)
if engineImage != "" {
savedImages = append(savedImages, engineImage)
}
}
return savedImages
}
func getServiceImage(service, svctype string, oldcfg, newcfg *config.CloudConfig) string {
var (
serviceImage string
bytes []byte
err error
)
if len(newcfg.Rancher.Repositories.ToArray()) > 0 {
bytes, err = network.LoadServiceResource(service, true, newcfg)
} else {
bytes, err = network.LoadServiceResource(service, true, oldcfg)
}
if err != nil {
log.WithFields(log.Fields{"err": err}).Fatal("Failed to load service resource")
return serviceImage
}
imageConfig := map[interface{}]ImageConfig{}
if err = yaml.Unmarshal(bytes, &imageConfig); err != nil {
log.WithFields(log.Fields{"err": err}).Fatal("Failed to unmarshal service")
return serviceImage
}
switch svctype {
case "console":
serviceImage = formatImage(imageConfig["console"].Image, oldcfg, newcfg)
case "docker":
serviceImage = formatImage(imageConfig["docker"].Image, oldcfg, newcfg)
default:
serviceImage = formatImage(imageConfig[service].Image, oldcfg, newcfg)
}
return serviceImage
}
func RunCacheScript(partition string, images []string) error {
return util.RunScript("/scripts/cache-services.sh", partition, strings.Join(images, " "))
}
func readConfigFile(file string) ([]byte, error) {
content, err := ioutil.ReadFile(file)
if err != nil {
if os.IsNotExist(err) {
err = nil
content = []byte{}
} else {
return nil, err
}
}
return content, err
}
func formatImage(image string, oldcfg, newcfg *config.CloudConfig) string {
registryDomain := newcfg.Rancher.Environment["REGISTRY_DOMAIN"]
if registryDomain == "" {
registryDomain = oldcfg.Rancher.Environment["REGISTRY_DOMAIN"]
}
image = strings.Replace(image, "${REGISTRY_DOMAIN}", registryDomain, -1)
image = strings.Replace(image, "${SUFFIX}", config.Suffix, -1)
return image
}
================================================
FILE: cmd/control/install/syslinux.go
================================================
package install
import (
"bufio"
"bytes"
"html/template"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/burmilla/os/pkg/log"
)
func syslinuxConfig(menu BootVars) error {
log.Debugf("syslinuxConfig")
filetmpl, err := template.New("syslinuxconfig").Parse(`{{define "syslinuxmenu"}}
LABEL {{.Name}}
LINUX ../vmlinuz-{{.Version}}-rancheros
APPEND {{.KernelArgs}} {{.Append}}
INITRD ../initrd-{{.Version}}-rancheros
{{end}}
TIMEOUT 20 #2 seconds
DEFAULT BurmillaOS-current
{{- range .Entries}}
{{template "syslinuxmenu" .}}
{{- end}}
`)
if err != nil {
log.Errorf("syslinuxconfig %s", err)
return err
}
cfgFile := filepath.Join(menu.BaseName, menu.BootDir+"syslinux/syslinux.cfg")
log.Debugf("syslinuxConfig written to %s", cfgFile)
f, err := os.Create(cfgFile)
if err != nil {
log.Errorf("Create(%s) %s", cfgFile, err)
return err
}
err = filetmpl.Execute(f, menu)
if err != nil {
return err
}
return nil
}
func ReadGlobalCfg(globalCfg string) (string, error) {
append := ""
buf, err := ioutil.ReadFile(globalCfg)
if err != nil {
return append, err
}
s := bufio.NewScanner(bytes.NewReader(buf))
for s.Scan() {
line := strings.TrimSpace(s.Text())
if strings.HasPrefix(line, "APPEND") {
append = strings.TrimSpace(strings.TrimPrefix(line, "APPEND"))
}
}
return append, nil
}
func ReadSyslinuxCfg(currentCfg string) (string, string, error) {
vmlinuzFile := ""
initrdFile := ""
// Need to parse currentCfg for the lines:
// KERNEL ../vmlinuz-4.9.18-rancher^M
// INITRD ../initrd-41e02e6-dirty^M
buf, err := ioutil.ReadFile(currentCfg)
if err != nil {
return vmlinuzFile, initrdFile, err
}
DIST := filepath.Dir(currentCfg)
s := bufio.NewScanner(bytes.NewReader(buf))
for s.Scan() {
line := strings.TrimSpace(s.Text())
if strings.HasPrefix(line, "KERNEL") {
vmlinuzFile = strings.TrimSpace(strings.TrimPrefix(line, "KERNEL"))
vmlinuzFile = filepath.Join(DIST, filepath.Base(vmlinuzFile))
}
if strings.HasPrefix(line, "INITRD") {
initrdFile = strings.TrimSpace(strings.TrimPrefix(line, "INITRD"))
initrdFile = filepath.Join(DIST, filepath.Base(initrdFile))
}
}
return vmlinuzFile, initrdFile, err
}
================================================
FILE: cmd/control/install.go
================================================
package control
import (
"bufio"
"bytes"
"crypto/md5"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"github.com/burmilla/os/cmd/control/install"
"github.com/burmilla/os/cmd/power"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/dfs" // TODO: move CopyFile into util or something.
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
"github.com/codegangsta/cli"
"github.com/pkg/errors"
)
var installCommand = cli.Command{
Name: "install",
Usage: "install BurmillaOS to disk",
HideHelp: true,
Action: installAction,
Flags: []cli.Flag{
cli.StringFlag{
// TODO: need to validate ? -i burmilla/os:v0.3.1 just sat there.
Name: "image, i",
Usage: `install from a certain image (e.g., 'rancher/os:v0.7.0')
use 'ros os list' to see what versions are available.`,
},
cli.StringFlag{
Name: "install-type, t",
Usage: `generic: (Default) Creates 1 ext4 partition and installs BurmillaOS (syslinux)
amazon-ebs: Installs BurmillaOS and sets up PV-GRUB
gptsyslinux: partition and format disk (gpt), then install BurmillaOS and setup Syslinux
`,
},
cli.StringFlag{
Name: "cloud-config, c",
Usage: "cloud-config yml file - needed for SSH authorized keys",
},
cli.StringFlag{
Name: "device, d",
Usage: "storage device",
},
cli.StringFlag{
Name: "partition, p",
Usage: "partition to install to",
},
cli.StringFlag{
Name: "statedir",
Usage: "install to rancher.state.directory",
},
cli.BoolFlag{
Name: "force, f",
Usage: "[ DANGEROUS! Data loss can happen ] partition/format without prompting",
},
cli.BoolFlag{
Name: "no-reboot",
Usage: "do not reboot after install",
},
cli.StringFlag{
Name: "append, a",
Usage: "append additional kernel parameters",
},
cli.StringFlag{
Name: "rollback, r",
Usage: "rollback version",
Hidden: true,
},
cli.BoolFlag{
Name: "isoinstallerloaded",
Usage: "INTERNAL use only: mount the iso to get kernel and initrd",
Hidden: true,
},
cli.BoolFlag{
Name: "kexec, k",
Usage: "reboot using kexec",
},
cli.BoolFlag{
Name: "save, s",
Usage: "save services and images for next booting",
},
cli.BoolFlag{
Name: "debug",
Usage: "Run installer with debug output",
},
},
}
func installAction(c *cli.Context) error {
log.InitLogger()
debug := c.Bool("debug")
if debug {
log.Info("Log level is debug")
originalLevel := log.GetLevel()
defer log.SetLevel(originalLevel)
log.SetLevel(log.DebugLevel)
}
if runtime.GOARCH != "amd64" {
log.Fatalf("ros install / upgrade only supported on 'amd64', not '%s'", runtime.GOARCH)
}
if c.Args().Present() {
log.Fatalf("invalid arguments %v", c.Args())
}
kappend := strings.TrimSpace(c.String("append"))
force := c.Bool("force")
kexec := c.Bool("kexec")
reboot := !c.Bool("no-reboot")
isoinstallerloaded := c.Bool("isoinstallerloaded")
image := c.String("image")
cfg := config.LoadConfig()
if image == "" {
image = fmt.Sprintf("%s:%s%s",
cfg.Rancher.Upgrade.Image,
config.Version,
config.Suffix)
image = formatImage(image, cfg)
}
installType := c.String("install-type")
if installType == "" {
log.Info("No install type specified...defaulting to generic")
installType = "generic"
}
if installType == "rancher-upgrade" ||
installType == "upgrade" {
installType = "upgrade" // rancher-upgrade is redundant!
force = true // the os.go upgrade code already asks
reboot = false
isoinstallerloaded = true // OMG this flag is aweful - kill it with fire
}
device := c.String("device")
partition := c.String("partition")
statedir := c.String("statedir")
if statedir != "" && installType != "noformat" {
log.Fatalf("--statedir %s requires --type noformat", statedir)
}
if installType != "noformat" &&
installType != "raid" &&
installType != "bootstrap" &&
installType != "upgrade" {
// These can use RANCHER_BOOT or RANCHER_STATE labels..
if device == "" {
log.Fatal("Can not proceed without -d <dev> specified")
}
}
cloudConfig := c.String("cloud-config")
if cloudConfig == "" {
if installType != "upgrade" {
// TODO: I wonder if its plausible to merge a new cloud-config into an existing one on upgrade - so for now, i'm only turning off the warning
log.Warn("Cloud-config not provided: you might need to provide cloud-config on boot with ssh_authorized_keys")
}
} else {
os.MkdirAll("/opt", 0755)
uc := "/opt/user_config.yml"
if strings.HasPrefix(cloudConfig, "http://") || strings.HasPrefix(cloudConfig, "https://") {
if err := util.HTTPDownloadToFile(cloudConfig, uc); err != nil {
log.WithFields(log.Fields{"cloudConfig": cloudConfig, "error": err}).Fatal("Failed to http get cloud-config")
}
} else {
if err := util.FileCopy(cloudConfig, uc); err != nil {
log.WithFields(log.Fields{"cloudConfig": cloudConfig, "error": err}).Fatal("Failed to copy cloud-config")
}
}
cloudConfig = uc
}
savedImages := []string{}
if c.Bool("save") && cloudConfig != "" && installType != "upgrade" {
savedImages = install.GetCacheImageList(cloudConfig, cfg)
log.Debugf("Will cache these images: %s", savedImages)
}
if err := runInstall(image, installType, cloudConfig, device, partition, statedir, kappend, force, kexec, isoinstallerloaded, debug, savedImages); err != nil {
log.WithFields(log.Fields{"err": err}).Fatal("Failed to run install")
return err
}
if !kexec && reboot && (force || yes("Continue with reboot")) {
log.Info("Rebooting")
power.Reboot()
}
return nil
}
func runInstall(image, installType, cloudConfig, device, partition, statedir, kappend string, force, kexec, isoinstallerloaded, debug bool, savedImages []string) error {
fmt.Printf("Installing from %s\n", image)
if !force {
if util.IsRunningInTty() && !yes("Continue") {
log.Infof("Not continuing with installation due to user not saying 'yes'")
os.Exit(1)
}
}
useIso := false
// --isoinstallerloaded is used if the ros has created the installer container from and image that was on the booted iso
if !isoinstallerloaded {
log.Infof("start !isoinstallerloaded")
if _, err := os.Stat("/dist/initrd-" + config.Version); os.IsNotExist(err) {
deviceName, deviceType, err := getBootIso()
if err != nil {
log.Errorf("Failed to get boot iso: %v", err)
fmt.Println("There is no boot iso drive, terminate the task")
return err
}
if err = mountBootIso(deviceName, deviceType); err != nil {
log.Debugf("Failed to mountBootIso: %v", err)
} else {
log.Infof("trying to load /bootiso/rancheros/installer.tar.gz")
if _, err := os.Stat("/bootiso/rancheros/"); err == nil {
cmd := exec.Command("system-docker", "load", "-i", "/bootiso/rancheros/installer.tar.gz")
cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
if err := cmd.Run(); err != nil {
log.Infof("failed to load images from /bootiso/rancheros: %v", err)
} else {
log.Infof("Loaded images from /bootiso/rancheros/installer.tar.gz")
//TODO: add if os-installer:latest exists - we might have loaded a full installer?
useIso = true
// now use the installer image
cfg := config.LoadConfig()
if image == cfg.Rancher.Upgrade.Image+":"+config.Version+config.Suffix {
// TODO: fix the fullinstaller Dockerfile to use the ${VERSION}${SUFFIX}
image = cfg.Rancher.Upgrade.Image + "-installer" + ":latest"
}
}
}
// TODO: also poke around looking for the /boot/vmlinuz and initrd...
}
log.Infof("starting installer container for %s (new)", image)
installerCmd := []string{
"run", "--rm", "--net=host", "--privileged",
// bind mount host fs to access its ros, vmlinuz, initrd and /dev (udev isn't running in container)
"-v", "/:/host",
"--volumes-from=all-volumes",
image,
// "install",
"-t", installType,
"-d", device,
"-i", image, // TODO: this isn't used - I'm just using it to over-ride the defaulting
}
// Need to call the inner container with force - the outer one does the "are you sure"
installerCmd = append(installerCmd, "-f")
// The outer container does the reboot (if needed)
installerCmd = append(installerCmd, "--no-reboot")
if cloudConfig != "" {
installerCmd = append(installerCmd, "-c", cloudConfig)
}
if kappend != "" {
installerCmd = append(installerCmd, "-a", kappend)
}
if useIso {
installerCmd = append(installerCmd, "--isoinstallerloaded=1")
}
if kexec {
installerCmd = append(installerCmd, "--kexec")
}
if debug {
installerCmd = append(installerCmd, "--debug")
}
if partition != "" {
installerCmd = append(installerCmd, "--partition", partition)
}
if statedir != "" {
installerCmd = append(installerCmd, "--statedir", statedir)
}
if len(savedImages) > 0 {
installerCmd = append(installerCmd, "--save")
}
// TODO: mount at /mnt for shared mount?
if useIso {
util.Unmount("/bootiso")
}
cmd := exec.Command("system-docker", installerCmd...)
log.Debugf("Run(%v)", cmd)
cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
return cmd.Run()
}
}
log.Debugf("running installation")
if partition == "" {
if installType == "generic" ||
installType == "syslinux" ||
installType == "gptsyslinux" {
diskType := "msdos"
if installType == "gptsyslinux" {
diskType = "gpt"
}
log.Debugf("running setDiskpartitions")
err := setDiskpartitions(device, diskType)
if err != nil {
log.Errorf("error setDiskpartitions %s", err)
return err
}
// use the bind mounted host filesystem to get access to the /dev/vda1 device that udev on the host sets up (TODO: can we run a udevd inside the container? `mknod b 253 1 /dev/vda1` doesn't work)
device = "/host" + device
//# TODO: Change this to a number so that users can specify.
//# Will need to make it so that our builds and packer APIs remain consistent.
partition = install.GetDefaultPartition(device)
}
}
if installType == "upgrade" {
isoinstallerloaded = false
}
if isoinstallerloaded {
log.Debugf("running isoinstallerloaded...")
// TODO: detect if its not mounted and then optionally mount?
deviceName, deviceType, err := getBootIso()
if err != nil {
log.Errorf("Failed to get boot iso: %v", err)
fmt.Println("There is no boot iso drive, terminate the task")
return err
}
if err := mountBootIso(deviceName, deviceType); err != nil {
log.Errorf("error mountBootIso %s", err)
//return err
}
}
err := layDownOS(image, installType, cloudConfig, device, partition, statedir, kappend, kexec)
if err != nil {
log.Errorf("error layDownOS %s", err)
return err
}
if len(savedImages) > 0 {
return install.RunCacheScript(partition, savedImages)
}
return nil
}
func getDeviceByLabel(label string) (string, string) {
d, t, err := util.Blkid(label)
if err != nil {
log.Warnf("Failed to run blkid for %s", label)
return "", ""
}
return d, t
}
func getBootIso() (string, string, error) {
deviceName := "/dev/sr0"
deviceType := "iso9660"
// Our ISO LABEL is RancherOS
// But some tools(like rufus) will change LABEL to RANCHEROS
for _, label := range []string{"RancherOS", "RANCHEROS"} {
d, t := getDeviceByLabel(label)
if d != "" {
deviceName = d
deviceType = t
continue
}
}
// Check the sr deive if exist
if _, err := os.Stat(deviceName); os.IsNotExist(err) {
return "", "", err
}
return deviceName, deviceType, nil
}
func mountBootIso(deviceName, deviceType string) error {
mountsFile, err := os.Open("/proc/mounts")
if err != nil {
return errors.Wrap(err, "Failed to read /proc/mounts")
}
defer mountsFile.Close()
if partitionMounted(deviceName, mountsFile) {
return nil
}
os.MkdirAll("/bootiso", 0755)
cmd := exec.Command("mount", "-t", deviceType, deviceName, "/bootiso")
log.Debugf("mount (%#v)", cmd)
var outBuf, errBuf bytes.Buffer
cmd.Stdout = &outBuf
cmd.Stderr = &errBuf
err = cmd.Run()
if err != nil {
return errors.Wrapf(err, "Tried and failed to mount %s: stderr output: %s", deviceName, errBuf.String())
}
log.Debugf("Mounted %s, output: %s", deviceName, outBuf.String())
return nil
}
func layDownOS(image, installType, cloudConfig, device, partition, statedir, kappend string, kexec bool) error {
// ENV == installType
//[[ "$ARCH" == "arm" && "$ENV" != "upgrade" ]] && ENV=arm
// image == burmilla/os:v0.7.0_arm
// TODO: remove the _arm suffix (but watch out, its not always there..)
VERSION := image[strings.Index(image, ":")+1:]
var FILES []string
DIST := "/dist" //${DIST:-/dist}
//cloudConfig := SCRIPTS_DIR + "/conf/empty.yml" //${cloudConfig:-"${SCRIPTS_DIR}/conf/empty.yml"}
CONSOLE := "tty0"
baseName := "/mnt/new_img"
kernelArgs := "printk.devkmsg=on rancher.state.dev=LABEL=RANCHER_STATE rancher.state.wait transparent_hugepage=madvise iommu=pt intel_iommu=off scsi_mod.use_blk_mq=1 apparmor=1 security=apparmor panic=10" // console="+CONSOLE
if statedir != "" {
kernelArgs = kernelArgs + " rancher.state.directory=" + statedir
}
// unmount on trap
defer util.Unmount(baseName)
diskType := "msdos"
if installType == "gptsyslinux" {
diskType = "gpt"
}
switch installType {
case "syslinux":
fallthrough
case "gptsyslinux":
fallthrough
case "generic":
log.Debugf("formatAndMount")
var err error
device, _, err = formatAndMount(baseName, device, partition)
if err != nil {
log.Errorf("formatAndMount %s", err)
return err
}
err = installSyslinux(device, baseName, diskType)
if err != nil {
log.Errorf("installSyslinux %s", err)
return err
}
err = seedData(baseName, cloudConfig, FILES)
if err != nil {
log.Errorf("seedData %s", err)
return err
}
case "arm":
var err error
_, _, err = formatAndMount(baseName, device, partition)
if err != nil {
return err
}
seedData(baseName, cloudConfig, FILES)
case "amazon-ebs-pv":
fallthrough
case "amazon-ebs-hvm":
CONSOLE = "ttyS0"
var err error
device, _, err = formatAndMount(baseName, device, partition)
if err != nil {
return err
}
if installType == "amazon-ebs-hvm" {
installSyslinux(device, baseName, diskType)
}
//# AWS Networking recommends disabling.
seedData(baseName, cloudConfig, FILES)
case "googlecompute":
CONSOLE = "ttyS0"
var err error
device, _, err = formatAndMount(baseName, device, partition)
if err != nil {
return err
}
installSyslinux(device, baseName, diskType)
seedData(baseName, cloudConfig, FILES)
case "noformat":
var err error
device, _, err = install.MountDevice(baseName, device, partition, false)
if err != nil {
return err
}
installSyslinux(device, baseName, diskType)
if err := os.MkdirAll(filepath.Join(baseName, statedir), 0755); err != nil {
return err
}
err = seedData(baseName, cloudConfig, FILES)
if err != nil {
log.Errorf("seedData %s", err)
return err
}
case "raid":
var err error
device, _, err = install.MountDevice(baseName, device, partition, false)
if err != nil {
return err
}
installSyslinux(device, baseName, diskType)
case "bootstrap":
CONSOLE = "ttyS0"
var err error
_, _, err = install.MountDevice(baseName, device, partition, true)
if err != nil {
return err
}
kernelArgs = kernelArgs + " rancher.cloud_init.datasources=[ec2,gce]"
case "rancher-upgrade":
installType = "upgrade" // rancher-upgrade is redundant
fallthrough
case "upgrade":
var err error
device, _, err = install.MountDevice(baseName, device, partition, false)
if err != nil {
return err
}
log.Debugf("upgrading - %s, %s, %s", device, baseName, diskType)
// TODO: detect pv-grub, and don't kill it with syslinux
upgradeBootloader(device, baseName, diskType)
default:
return fmt.Errorf("unexpected install type %s", installType)
}
kernelArgs = kernelArgs + " console=" + CONSOLE
if kappend == "" {
preservedAppend, _ := ioutil.ReadFile(filepath.Join(baseName, config.BootDir, "append"))
kappend = string(preservedAppend)
} else {
ioutil.WriteFile(filepath.Join(baseName, config.BootDir, "append"), []byte(kappend), 0644)
}
if installType == "amazon-ebs-pv" {
menu := install.BootVars{
BaseName: baseName,
BootDir: config.BootDir,
Timeout: 0,
Fallback: 0, // need to be conditional on there being a 'rollback'?
Entries: []install.MenuEntry{
install.MenuEntry{
Name: "BurmillaOS-current",
BootDir: config.BootDir,
Version: VERSION,
KernelArgs: kernelArgs,
Append: kappend,
},
},
}
install.PvGrubConfig(menu)
}
log.Debugf("installRancher")
_, err := installRancher(baseName, VERSION, DIST, kernelArgs+" "+kappend)
if err != nil {
log.Errorf("%s", err)
return err
}
log.Debugf("installRancher done")
if kexec {
power.Kexec(false, filepath.Join(baseName, config.BootDir), kernelArgs+" "+kappend)
}
return nil
}
// files is an array of 'sourcefile:destination' - but i've not seen any examples of it being used.
func seedData(baseName, cloudData string, files []string) error {
log.Debugf("seedData")
_, err := os.Stat(baseName)
if err != nil {
return err
}
stateSeedDir := "state_seed"
cloudConfigBase := "/var/lib/rancher/conf/cloud-config.d"
cloudConfigDir := ""
// If there is a separate boot partition, cloud-config should be written to RANCHER_STATE partition.
bootPartition, _, err := util.Blkid("RANCHER_BOOT")
if err != nil {
log.Errorf("Failed to run blkid: %s", err)
}
if bootPartition != "" {
stateSeedFullPath := filepath.Join(baseName, stateSeedDir)
if err = os.MkdirAll(stateSeedFullPath, 0700); err != nil {
return err
}
defer util.Unmount(stateSeedFullPath)
statePartition := install.GetStatePartition()
cmd := exec.Command("mount", statePartition, stateSeedFullPath)
//cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
log.Debugf("seedData: mount %s to %s", statePartition, stateSeedFullPath)
if err = cmd.Run(); err != nil {
return err
}
cloudConfigDir = filepath.Join(baseName, stateSeedDir, cloudConfigBase)
} else {
cloudConfigDir = filepath.Join(baseName, cloudConfigBase)
}
if err = os.MkdirAll(cloudConfigDir, 0700); err != nil {
return err
}
if !strings.HasSuffix(cloudData, "empty.yml") {
if err = dfs.CopyFile(cloudData, cloudConfigDir, filepath.Base(cloudData)); err != nil {
return err
}
}
for _, f := range files {
e := strings.Split(f, ":")
if err = dfs.CopyFile(e[0], baseName, e[1]); err != nil {
return err
}
}
return nil
}
// set-disk-partitions is called with device == **/dev/sda**
func setDiskpartitions(device, diskType string) error {
log.Debugf("setDiskpartitions")
d := strings.Split(device, "/")
if len(d) != 3 {
return fmt.Errorf("bad device name (%s)", device)
}
deviceName := d[2]
file, err := os.Open("/proc/partitions")
if err != nil {
log.Debugf("failed to read /proc/partitions %s", err)
return err
}
defer file.Close()
exists := false
haspartitions := false
scanner := bufio.NewScanner(file)
for scanner.Scan() {
str := scanner.Text()
last := strings.LastIndex(str, " ")
if last > -1 {
dev := str[last+1:]
if strings.HasPrefix(dev, deviceName) {
if dev == deviceName {
exists = true
} else {
haspartitions = true
}
}
}
}
if !exists {
return fmt.Errorf("disk %s not found: %s", device, err)
}
if haspartitions {
log.Debugf("device %s already partitioned - checking if any are mounted", device)
file, err := os.Open("/proc/mounts")
if err != nil {
log.Errorf("failed to read /proc/mounts %s", err)
return err
}
defer file.Close()
if partitionMounted(device, file) {
err = fmt.Errorf("partition %s mounted, cannot repartition", device)
log.Errorf("%s", err)
return err
}
cmd := exec.Command("system-docker", "ps", "-q")
var outb bytes.Buffer
cmd.Stdout = &outb
if err := cmd.Run(); err != nil {
log.Printf("ps error: %s", err)
return err
}
for _, image := range strings.Split(outb.String(), "\n") {
if image == "" {
continue
}
r, w := io.Pipe()
go func() {
// TODO: consider a timeout
// TODO:some of these containers don't have cat / shell
cmd := exec.Command("system-docker", "exec", image, "cat /proc/mount")
cmd.Stdout = w
if err := cmd.Run(); err != nil {
log.Debugf("%s cat %s", image, err)
}
w.Close()
}()
if partitionMounted(device, r) {
err = fmt.Errorf("partition %s mounted in %s, cannot repartition", device, image)
log.Errorf("k? %s", err)
return err
}
}
}
//do it!
log.Debugf("running dd device: %s", device)
cmd := exec.Command("dd", "if=/dev/zero", "of="+device, "bs=512", "count=2048")
//cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
if err := cmd.Run(); err != nil {
log.Errorf("dd error %s", err)
return err
}
log.Debugf("running partprobe: %s", device)
cmd = exec.Command("partprobe", device)
//cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
if err := cmd.Run(); err != nil {
log.Errorf("Failed to partprobe device %s: %v", device, err)
return err
}
log.Debugf("making single RANCHER_STATE partition, device: %s", device)
cmd = exec.Command("parted", "-s", "-a", "optimal", device,
"mklabel "+diskType, "--",
"mkpart primary ext4 1 -1")
cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
if err := cmd.Run(); err != nil {
log.Errorf("Failed to parted device %s: %v", device, err)
return err
}
return setBootable(device, diskType)
}
func partitionMounted(device string, file io.Reader) bool {
scanner := bufio.NewScanner(file)
for scanner.Scan() {
str := scanner.Text()
// /dev/sdb1 /data ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
ele := strings.Split(str, " ")
if len(ele) > 5 {
if strings.HasPrefix(ele[0], device) {
return true
}
}
if err := scanner.Err(); err != nil {
log.Errorf("scanner %s", err)
return false
}
}
return false
}
func formatdevice(device, partition string) error {
log.Debugf("formatdevice %s", partition)
//mkfs.ext4 -F -i 4096 -L RANCHER_STATE ${partition}
// -O ^64bit: for syslinux: http://www.syslinux.org/wiki/index.php?title=Filesystem#ext
cmd := exec.Command("mkfs.ext4", "-F", "-i", "4096", "-O", "^64bit", "-L", "RANCHER_STATE", partition)
log.Debugf("Run(%v)", cmd)
cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
if err := cmd.Run(); err != nil {
log.Errorf("mkfs.ext4: %s", err)
return err
}
return nil
}
func formatAndMount(baseName, device, partition string) (string, string, error) {
log.Debugf("formatAndMount")
err := formatdevice(device, partition)
if err != nil {
log.Errorf("formatdevice %s", err)
return device, partition, err
}
device, partition, err = install.MountDevice(baseName, device, partition, false)
if err != nil {
log.Errorf("mountdevice %s", err)
return device, partition, err
}
return device, partition, nil
}
func setBootable(device, diskType string) error {
// TODO make conditional - if there is a bootable device already, don't break it
// TODO: make RANCHER_BOOT bootable - it might not be device 1
bootflag := "boot"
if diskType == "gpt" {
bootflag = "legacy_boot"
}
log.Debugf("making device 1 on %s bootable as %s", device, diskType)
cmd := exec.Command("parted", "-s", "-a", "optimal", device, "set 1 "+bootflag+" on")
cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
if err := cmd.Run(); err != nil {
log.Errorf("parted: %s", err)
return err
}
return nil
}
func upgradeBootloader(device, baseName, diskType string) error {
log.Debugf("start upgradeBootloader")
grubDir := filepath.Join(baseName, config.BootDir, "grub")
if _, err := os.Stat(grubDir); os.IsNotExist(err) {
log.Debugf("%s does not exist - no need to upgrade bootloader", grubDir)
// we've already upgraded
// TODO: in v0.9.0, need to detect what version syslinux we have
return nil
}
// deal with systems which were previously upgraded, then rolled back, and are now being re-upgraded
grubBackup := filepath.Join(baseName, config.BootDir, "grub_backup")
if err := os.RemoveAll(grubBackup); err != nil {
log.Errorf("RemoveAll (%s): %s", grubBackup, err)
return err
}
backupSyslinuxDir := filepath.Join(baseName, config.BootDir, "syslinux_backup")
if _, err := os.Stat(backupSyslinuxDir); !os.IsNotExist(err) {
backupSyslinuxLdlinuxSys := filepath.Join(backupSyslinuxDir, "ldlinux.sys")
if _, err := os.Stat(backupSyslinuxLdlinuxSys); !os.IsNotExist(err) {
//need a privileged container that can chattr -i ldlinux.sys
cmd := exec.Command("chattr", "-i", backupSyslinuxLdlinuxSys)
if err := cmd.Run(); err != nil {
log.Errorf("%s", err)
return err
}
}
if err := os.RemoveAll(backupSyslinuxDir); err != nil {
log.Errorf("RemoveAll (%s): %s", backupSyslinuxDir, err)
return err
}
}
if err := os.Rename(grubDir, grubBackup); err != nil {
log.Errorf("Rename(%s): %s", grubDir, err)
return err
}
syslinuxDir := filepath.Join(baseName, config.BootDir, "syslinux")
// it seems that v0.5.0 didn't have a syslinux dir, while 0.7 does
if _, err := os.Stat(syslinuxDir); !os.IsNotExist(err) {
if err := os.Rename(syslinuxDir, backupSyslinuxDir); err != nil {
log.Infof("error Rename(%s, %s): %s", syslinuxDir, backupSyslinuxDir, err)
} else {
//mv the old syslinux into linux-previous.cfg
oldSyslinux, err := ioutil.ReadFile(filepath.Join(backupSyslinuxDir, "syslinux.cfg"))
if err != nil {
log.Infof("error read(%s / syslinux.cfg): %s", backupSyslinuxDir, err)
} else {
cfg := string(oldSyslinux)
//DEFAULT BurmillaOS-current
//
//LABEL BurmillaOS-current
// LINUX ../vmlinuz-v0.7.1-rancheros
// APPEND rancher.state.dev=LABEL=RANCHER_STATE rancher.state.wait console=tty0 rancher.password=rancher
// INITRD ../initrd-v0.7.1-rancheros
cfg = strings.Replace(cfg, "current", "previous", -1)
// TODO consider removing the APPEND line - as the global.cfg should have the same result
ioutil.WriteFile(filepath.Join(baseName, config.BootDir, "linux-current.cfg"), []byte(cfg), 0644)
lines := strings.Split(cfg, "\n")
for _, line := range lines {
line = strings.TrimSpace(line)
if strings.HasPrefix(line, "APPEND") {
log.Errorf("write new (%s) %s", filepath.Join(baseName, config.BootDir, "global.cfg"), err)
// TODO: need to append any extra's the user specified
ioutil.WriteFile(filepath.Join(baseName, config.BootDir, "global.cfg"), []byte(cfg), 0644)
break
}
}
}
}
}
return installSyslinux(device, baseName, diskType)
}
func installSyslinux(device, baseName, diskType string) error {
log.Debugf("installSyslinux(%s)", device)
mbrFile := "mbr.bin"
if diskType == "gpt" {
mbrFile = "gptmbr.bin"
}
//dd bs=440 count=1 if=/usr/lib/syslinux/mbr/mbr.bin of=${device}
// ubuntu: /usr/lib/syslinux/mbr/mbr.bin
// alpine: /usr/share/syslinux/mbr.bin
if device == "/dev/" {
log.Debugf("installSyslinuxRaid(%s)", device)
//RAID - assume sda&sdb
//TODO: fix this - not sure how to detect what disks should have mbr - perhaps we need a param
// perhaps just assume and use the devices that make up the raid - mdadm
device = "/dev/sda"
if err := setBootable(device, diskType); err != nil {
log.Errorf("setBootable(%s, %s): %s", device, diskType, err)
//return err
}
cmd := exec.Command("dd", "bs=440", "count=1", "if=/usr/share/syslinux/"+mbrFile, "of="+device)
if err := cmd.Run(); err != nil {
log.Errorf("%s", err)
return err
}
device = "/dev/sdb"
if err := setBootable(device, diskType); err != nil {
log.Errorf("setBootable(%s, %s): %s", device, diskType, err)
//return err
}
cmd = exec.Command("dd", "bs=440", "count=1", "if=/usr/share/syslinux/"+mbrFile, "of="+device)
if err := cmd.Run(); err != nil {
log.Errorf("%s", err)
return err
}
} else {
if err := setBootable(device, diskType); err != nil {
log.Errorf("setBootable(%s, %s): %s", device, diskType, err)
//return err
}
log.Debugf("installSyslinux(%s)", device)
cmd := exec.Command("dd", "bs=440", "count=1", "if=/usr/share/syslinux/"+mbrFile, "of="+device)
log.Debugf("Run(%v)", cmd)
if err := cmd.Run(); err != nil {
log.Errorf("dd: %s", err)
return err
}
}
sysLinuxDir := filepath.Join(baseName, config.BootDir, "syslinux")
if err := os.MkdirAll(sysLinuxDir, 0755); err != nil {
log.Errorf("MkdirAll(%s)): %s", sysLinuxDir, err)
//return err
}
//cp /usr/lib/syslinux/modules/bios/* ${baseName}/${bootDir}syslinux
files, _ := ioutil.ReadDir("/usr/share/syslinux/")
for _, file := range files {
if file.IsDir() {
continue
}
if err := dfs.CopyFile(filepath.Join("/usr/share/syslinux/", file.Name()), sysLinuxDir, file.Name()); err != nil {
log.Errorf("copy syslinux: %s", err)
return err
}
}
//extlinux --install ${baseName}/${bootDir}syslinux
cmd := exec.Command("extlinux", "--install", sysLinuxDir)
if device == "/dev/" {
//extlinux --install --raid ${baseName}/${bootDir}syslinux
cmd = exec.Command("extlinux", "--install", "--raid", sysLinuxDir)
}
//cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
log.Debugf("Run(%v)", cmd)
if err := cmd.Run(); err != nil {
log.Errorf("extlinux: %s", err)
return err
}
return nil
}
func different(existing, new string) bool {
// assume existing file exists
if _, err := os.Stat(new); os.IsNotExist(err) {
return true
}
data, err := ioutil.ReadFile(existing)
if err != nil {
return true
}
newData, err := ioutil.ReadFile(new)
if err != nil {
return true
}
md5sum := md5.Sum(data)
newmd5sum := md5.Sum(newData)
if md5sum != newmd5sum {
return true
}
return false
}
func installRancher(baseName, VERSION, DIST, kappend string) (string, error) {
log.Debugf("installRancher")
// detect if there already is a linux-current.cfg, if so, move it to linux-previous.cfg,
currentCfg := filepath.Join(baseName, config.BootDir, "linux-current.cfg")
if _, err := os.Stat(currentCfg); !os.IsNotExist(err) {
existingCfg := filepath.Join(DIST, "linux-current.cfg")
// only remove previous if there is a change to the current
if different(currentCfg, existingCfg) {
previousCfg := filepath.Join(baseName, config.BootDir, "linux-previous.cfg")
if _, err := os.Stat(previousCfg); !os.IsNotExist(err) {
if err := os.Remove(previousCfg); err != nil {
return currentCfg, err
}
}
os.Rename(currentCfg, previousCfg)
// TODO: now that we're parsing syslinux.cfg files, maybe we can delete old kernels and initrds
}
}
// The image/ISO have all the files in it - the syslinux cfg's and the kernel&initrd, so we can copy them all from there
files, _ := ioutil.ReadDir(DIST)
for _, file := range files {
if file.IsDir() {
continue
}
// TODO: should overwrite anything other than the global.cfg
overwrite := true
if file.Name() == "global.cfg" {
overwrite = false
}
if err := dfs.CopyFileOverwrite(filepath.Join(DIST, file.Name()), filepath.Join(baseName, config.BootDir), file.Name(), overwrite); err != nil {
log.Errorf("copy %s: %s", file.Name(), err)
//return err
}
}
// the general INCLUDE syslinuxcfg
isolinuxFile := filepath.Join(DIST, "isolinux", "isolinux.cfg")
syslinuxDir := filepath.Join(baseName, config.BootDir, "syslinux")
if err := dfs.CopyFileOverwrite(isolinuxFile, syslinuxDir, "syslinux.cfg", true); err != nil {
log.Errorf("copy global syslinux.cfgS%s: %s", "syslinux.cfg", err)
//return err
} else {
log.Debugf("installRancher copy global syslinux.cfgS OK")
}
// The global.cfg INCLUDE - useful for over-riding the APPEND line
globalFile := filepath.Join(baseName, config.BootDir, "global.cfg")
if _, err := os.Stat(globalFile); !os.IsNotExist(err) {
err := ioutil.WriteFile(globalFile, []byte("APPEND "+kappend), 0644)
if err != nil {
log.Errorf("write (%s) %s", "global.cfg", err)
return currentCfg, err
}
}
return currentCfg, nil
}
================================================
FILE: cmd/control/os.go
================================================
package control
import (
"fmt"
"io/ioutil"
"net/url"
"os"
"runtime"
"strings"
"github.com/burmilla/os/cmd/power"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/compose"
"github.com/burmilla/os/pkg/docker"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
"github.com/burmilla/os/pkg/util/network"
yaml "github.com/cloudfoundry-incubator/candiedyaml"
"github.com/codegangsta/cli"
dockerClient "github.com/docker/engine-api/client"
composeConfig "github.com/docker/libcompose/config"
"github.com/docker/libcompose/project/options"
"golang.org/x/net/context"
)
type Images struct {
Current string `yaml:"current,omitempty"`
Available []string `yaml:"available,omitempty"`
}
func osSubcommands() []cli.Command {
return []cli.Command{
{
Name: "upgrade",
Usage: "upgrade to latest version",
Action: osUpgrade,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "stage, s",
Usage: "Only stage the new upgrade, don't apply it",
},
cli.StringFlag{
Name: "image, i",
Usage: "upgrade to a certain image",
},
cli.BoolFlag{
Name: "force, f",
Usage: "do not prompt for input",
},
cli.BoolFlag{
Name: "no-reboot",
Usage: "do not reboot after upgrade",
},
cli.BoolFlag{
Name: "kexec, k",
Usage: "reboot using kexec",
},
cli.StringFlag{
Name: "append",
Usage: "append additional kernel parameters",
},
cli.BoolFlag{
Name: "upgrade-console",
Usage: "upgrade console even if persistent",
},
cli.BoolFlag{
Name: "debug",
Usage: "Run installer with debug output",
},
},
},
{
Name: "list",
Usage: "list the current available versions",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "update, u",
Usage: "update engine cache",
},
},
Action: osMetaDataGet,
},
{
Name: "version",
Usage: "show the currently installed version",
Action: osVersion,
},
}
}
func getImages(update bool) (*Images, error) {
upgradeURL, err := getUpgradeURL()
if err != nil {
return nil, err
}
var body []byte
if strings.HasPrefix(upgradeURL, "/") {
body, err = ioutil.ReadFile(upgradeURL)
if err != nil {
return nil, err
}
} else {
u, err := url.Parse(upgradeURL)
if err != nil {
return nil, err
}
q := u.Query()
q.Set("current", config.Version)
if hypervisor := util.GetHypervisor(); hypervisor == "" {
q.Set("hypervisor", hypervisor)
}
u.RawQuery = q.Encode()
upgradeURL = u.String()
if update {
_, err := network.UpdateCache(upgradeURL)
if err != nil {
log.Errorf("Failed to update os caches: %v", err)
}
}
body, err = network.LoadFromNetwork(upgradeURL)
if err != nil {
return nil, err
}
}
images, err := parseBody(body)
if err != nil {
return nil, err
}
cfg := config.LoadConfig()
images.Current = formatImage(images.Current, cfg)
for i := len(images.Available) - 1; i >= 0; i-- {
images.Available[i] = formatImage(images.Available[i], cfg)
}
return images, nil
}
func osMetaDataGet(c *cli.Context) error {
images, err := getImages(c.Bool("update"))
if err != nil {
log.Fatal(err)
}
client, err := docker.NewSystemClient()
if err != nil {
log.Fatal(err)
}
cfg := config.LoadConfig()
runningName := cfg.Rancher.Upgrade.Image + ":" + config.Version
runningName = formatImage(runningName, cfg)
foundRunning := false
for i := len(images.Available) - 1; i >= 0; i-- {
image := images.Available[i]
_, _, err := client.ImageInspectWithRaw(context.Background(), image, false)
local := "local"
if dockerClient.IsErrImageNotFound(err) {
local = "remote"
}
available := "available"
if image == images.Current {
available = "latest"
}
var running string
if image == runningName {
foundRunning = true
running = "running"
}
fmt.Println(image, local, available, running)
}
if !foundRunning {
fmt.Println(config.Version, "running")
}
return nil
}
func getLatestImage() (string, error) {
images, err := getImages(false)
if err != nil {
return "", err
}
return images.Current, nil
}
func osUpgrade(c *cli.Context) error {
if runtime.GOARCH != "amd64" {
log.Fatalf("ros install / upgrade only supported on 'amd64', not '%s'", runtime.GOARCH)
}
if isExist := checkGlobalCfg(); !isExist {
log.Fatalf("ros upgrade cannot be supported")
}
image := c.String("image")
if image == "" {
var err error
image, err = getLatestImage()
if err != nil {
log.Fatal(err)
}
if image == "" {
log.Fatal("Failed to find latest image")
}
}
if c.Args().Present() {
log.Fatalf("invalid arguments %v", c.Args())
}
if err := startUpgradeContainer(
image,
c.Bool("stage"),
c.Bool("force"),
!c.Bool("no-reboot"),
c.Bool("kexec"),
c.Bool("upgrade-console"),
c.Bool("debug"),
c.String("append"),
); err != nil {
log.Fatal(err)
}
return nil
}
func osVersion(c *cli.Context) error {
fmt.Println(config.Version)
return nil
}
func startUpgradeContainer(image string, stage, force, reboot, kexec, upgradeConsole, debug bool, kernelArgs string) error {
command := []string{
"-t", "rancher-upgrade",
"-r", config.Version,
}
if kexec {
command = append(command, "--kexec")
}
if debug {
command = append(command, "--debug")
}
kernelArgs = strings.TrimSpace(kernelArgs)
if kernelArgs != "" {
command = append(command, "-a", kernelArgs)
}
if upgradeConsole {
if err := config.Set("rancher.force_console_rebuild", true); err != nil {
log.Fatal(err)
}
}
fmt.Printf("Upgrading to %s\n", image)
confirmation := "Continue"
imageSplit := strings.Split(image, ":")
if len(imageSplit) > 1 && imageSplit[1] == config.Version+config.Suffix {
confirmation = fmt.Sprintf("Already at version %s. Continue anyway", imageSplit[1])
}
if !force && !yes(confirmation) {
os.Exit(1)
}
container, err := compose.CreateService(nil, "os-upgrade", &composeConfig.ServiceConfigV1{
LogDriver: "json-file",
Privileged: true,
Net: "host",
Pid: "host",
Image: image,
Labels: map[string]string{
config.ScopeLabel: config.System,
},
Command: command,
})
if err != nil {
return err
}
client, err := docker.NewSystemClient()
if err != nil {
return err
}
// Only pull image if not found locally
if _, _, err := client.ImageInspectWithRaw(context.Background(), image, false); err != nil {
if err := container.Pull(context.Background()); err != nil {
return err
}
}
if !stage {
// If there is already an upgrade container, delete it
// Up() should to this, but currently does not due to a bug
if err := container.Delete(context.Background(), options.Delete{}); err != nil {
return err
}
if err := container.Up(context.Background(), options.Up{}); err != nil {
return err
}
if err := container.Log(context.Background(), true); err != nil {
return err
}
if err := container.Delete(context.Background(), options.Delete{}); err != nil {
return err
}
if reboot && (force || yes("Continue with reboot")) {
log.Info("Rebooting")
power.Reboot()
}
}
return nil
}
func parseBody(body []byte) (*Images, error) {
update := &Images{}
err := yaml.Unmarshal(body, update)
if err != nil {
return nil, err
}
return update, nil
}
func getUpgradeURL() (string, error) {
cfg := config.LoadConfig()
return cfg.Rancher.Upgrade.URL, nil
}
================================================
FILE: cmd/control/preload.go
================================================
package control
import (
"compress/gzip"
"context"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"regexp"
"strings"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/docker"
"github.com/burmilla/os/pkg/log"
"github.com/codegangsta/cli"
dockerClient "github.com/docker/engine-api/client"
"github.com/docker/engine-api/types"
)
const (
userImagesPreloadDirectory = "/var/lib/rancher/preload/docker"
)
func preloadImagesAction(c *cli.Context) error {
err := PreloadImages(docker.NewDefaultClient, userImagesPreloadDirectory)
if err != nil {
log.Errorf("Failed to preload user images: %v", err)
}
return err
}
func shouldLoad(file string) bool {
if strings.HasSuffix(file, ".done") {
return false
}
if _, err := os.Stat(fmt.Sprintf("%s.done", file)); err == nil {
return false
}
return true
}
func PreloadImages(clientFactory func() (dockerClient.APIClient, error), imagesDir string) error {
var client dockerClient.APIClient
clientInitialized := false
if _, err := os.Stat(imagesDir); os.IsNotExist(err) {
if err = os.MkdirAll(imagesDir, 0755); err != nil {
return err
}
} else if err != nil {
return err
}
// try to load predefined user images
if imagesDir == userImagesPreloadDirectory {
oldUserImgName := path.Join(config.ImagesPath, config.UserImages)
userImgfile, err := os.Stat(oldUserImgName)
if err == nil {
newUserImgName := path.Join(userImagesPreloadDirectory, userImgfile.Name())
if _, err = os.Stat(newUserImgName); os.IsNotExist(err) {
if err := os.Symlink(oldUserImgName, newUserImgName); err != nil {
log.Error(err)
}
}
}
}
files, err := ioutil.ReadDir(imagesDir)
if err != nil {
return err
}
for _, file := range files {
filename := path.Join(imagesDir, file.Name())
if !shouldLoad(filename) {
log.Infof("Skipping to preload the file: %s", filename)
continue
}
image, err := os.Open(filename)
if err != nil {
return err
}
defer image.Close()
var imageReader io.Reader
imageReader = image
match, err := regexp.MatchString(".t?gz$", file.Name())
if err != nil {
return err
}
if match {
imageReader, err = gzip.NewReader(image)
if err != nil {
return err
}
}
if !clientInitialized {
client, err = clientFactory()
if err != nil {
return err
}
clientInitialized = true
}
var imageLoadResponse types.ImageLoadResponse
if imageLoadResponse, err = client.ImageLoad(context.Background(), imageReader, false); err != nil {
return err
}
cfg := config.LoadConfig()
if cfg.Rancher.PreloadWait {
if _, err := ioutil.ReadAll(imageLoadResponse.Body); err != nil {
return err
}
}
log.Infof("Finished to load image %s", filename)
log.Infof("Creating done stamp file for image %s", filename)
doneStamp, err := os.Create(fmt.Sprintf("%s.done", filename))
if err != nil {
return err
}
defer doneStamp.Close()
log.Infof("Finished to created the done stamp file for image %s", filename)
}
return nil
}
================================================
FILE: cmd/control/recovery_init.go
================================================
package control
import (
"os"
"os/exec"
"syscall"
"github.com/burmilla/os/pkg/log"
"github.com/codegangsta/cli"
)
func recoveryInitAction(c *cli.Context) error {
if err := writeRespawn("root", false, true); err != nil {
log.Error(err)
}
respawnBinPath, err := exec.LookPath("respawn")
if err != nil {
return err
}
return syscall.Exec(respawnBinPath, []string{"respawn", "-f", "/etc/respawn.conf"}, os.Environ())
}
================================================
FILE: cmd/control/service/app/app.go
================================================
package app
import (
"fmt"
"os"
"os/signal"
"strings"
"syscall"
"github.com/burmilla/os/pkg/log"
"github.com/codegangsta/cli"
"github.com/docker/libcompose/project"
"github.com/docker/libcompose/project/options"
"golang.org/x/net/context"
)
func ProjectPs(p project.APIProject, c *cli.Context) error {
qFlag := c.Bool("q")
allInfo, err := p.Ps(context.Background(), qFlag, c.Args()...)
if err != nil {
return cli.NewExitError(err.Error(), 1)
}
os.Stdout.WriteString(allInfo.String(!qFlag))
return nil
}
func ProjectStop(p project.APIProject, c *cli.Context) error {
err := p.Stop(context.Background(), c.Int("timeout"), c.Args()...)
if err != nil {
return cli.NewExitError(err.Error(), 1)
}
return nil
}
func ProjectDown(p project.APIProject, c *cli.Context) error {
options := options.Down{
RemoveVolume: c.Bool("volumes"),
RemoveImages: options.ImageType(c.String("rmi")),
RemoveOrphans: c.Bool("remove-orphans"),
}
err := p.Down(context.Background(), options, c.Args()...)
if err != nil {
return cli.NewExitError(err.Error(), 1)
}
return nil
}
func ProjectBuild(p project.APIProject, c *cli.Context) error {
config := options.Build{
NoCache: c.Bool("no-cache"),
ForceRemove: c.Bool("force-rm"),
Pull: c.Bool("pull"),
}
err := p.Build(context.Background(), config, c.Args()...)
if err != nil {
return cli.NewExitError(err.Error(), 1)
}
return nil
}
func ProjectCreate(p project.APIProject, c *cli.Context) error {
options := options.Create{
NoRecreate: c.Bool("no-recreate"),
ForceRecreate: c.Bool("force-recreate"),
NoBuild: c.Bool("no-build"),
}
err := p.Create(context.Background(), options, c.Args()...)
if err != nil {
return cli.NewExitError(err.Error(), 1)
}
return nil
}
func ProjectUp(p project.APIProject, c *cli.Context) error {
options := options.Up{
Create: options.Create{
NoRecreate: c.Bool("no-recreate"),
ForceRecreate: c.Bool("force-recreate"),
NoBuild: c.Bool("no-build"),
},
}
ctx, cancelFun := context.WithCancel(context.Background())
err := p.Up(ctx, options, c.Args()...)
if err != nil {
return cli.NewExitError(err.Error(), 1)
}
if c.Bool("foreground") {
signalChan := make(chan os.Signal, 1)
cleanupDone := make(chan bool)
signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)
errChan := make(chan error)
go func() {
errChan <- p.Log(ctx, true, c.Args()...)
}()
go func() {
select {
case <-signalChan:
fmt.Printf("\nGracefully stopping...\n")
cancelFun()
ProjectStop(p, c)
cleanupDone <- true
case err := <-errChan:
if err != nil {
log.Fatal(err)
}
cleanupDone <- true
}
}()
<-cleanupDone
return nil
}
return nil
}
func ProjectStart(p project.APIProject, c *cli.Context) error {
err := p.Start(context.Background(), c.Args()...)
if err != nil {
return cli.NewExitError(err.Error(), 1)
}
return nil
}
func ProjectRestart(p project.APIProject, c *cli.Context) error {
err := p.Restart(context.Background(), c.Int("timeout"), c.Args()...)
if err != nil {
return cli.NewExitError(err.Error(), 1)
}
return nil
}
func ProjectLog(p project.APIProject, c *cli.Context) error {
err := p.Log(context.Background(), c.Bool("follow"), c.Args()...)
if err != nil {
return cli.NewExitError(err.Error(), 1)
}
return nil
}
func ProjectPull(p project.APIProject, c *cli.Context) error {
err := p.Pull(context.Background(), c.Args()...)
if err != nil && !c.Bool("ignore-pull-failures") {
return cli.NewExitError(err.Error(), 1)
}
return nil
}
func ProjectDelete(p project.APIProject, c *cli.Context) error {
options := options.Delete{
RemoveVolume: c.Bool("v"),
}
if !c.Bool("force") {
options.BeforeDeleteCallback = func(stoppedContainers []string) bool {
fmt.Printf("Going to remove %v\nAre you sure? [yN]\n", strings.Join(stoppedContainers, ", "))
var answer string
_, err := fmt.Scanln(&answer)
if err != nil {
log.Error(err)
return false
}
if answer != "y" && answer != "Y" {
return false
}
return true
}
}
err := p.Delete(context.Background(), options, c.Args()...)
if err != nil {
return cli.NewExitError(err.Error(), 1)
}
return nil
}
func ProjectKill(p project.APIProject, c *cli.Context) error {
err := p.Kill(context.Background(), c.String("signal"), c.Args()...)
if err != nil {
return cli.NewExitError(err.Error(), 1)
}
return nil
}
================================================
FILE: cmd/control/service/command/command.go
================================================
package command
import (
"errors"
"github.com/burmilla/os/cmd/control/service/app"
"github.com/codegangsta/cli"
composeApp "github.com/docker/libcompose/cli/app"
)
func verifyOneOrMoreServices(c *cli.Context) error {
if len(c.Args()) == 0 {
return errors.New("Must specify one or more services")
}
return nil
}
func CreateCommand(factory composeApp.ProjectFactory) cli.Command {
return cli.Command{
Name: "create",
Usage: "Create services",
Before: verifyOneOrMoreServices,
Action: composeApp.WithProject(factory, app.ProjectCreate),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "no-recreate",
Usage: "If containers already exist, don't recreate them. Incompatible with --force-recreate.",
},
cli.BoolFlag{
Name: "force-recreate",
Usage: "Recreate containers even if their configuration and image haven't changed. Incompatible with --no-recreate.",
},
cli.BoolFlag{
Name: "no-build",
Usage: "Don't build an image, even if it's missing.",
},
},
}
}
func BuildCommand(factory composeApp.ProjectFactory) cli.Command {
return cli.Command{
Name: "build",
Usage: "Build or rebuild services",
Before: verifyOneOrMoreServices,
Action: composeApp.WithProject(factory, app.ProjectBuild),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "no-cache",
Usage: "Do not use cache when building the image",
},
cli.BoolFlag{
Name: "force-rm",
Usage: "Always remove intermediate containers",
},
cli.BoolFlag{
Name: "pull",
Usage: "Always attempt to pull a newer version of the image",
},
},
}
}
func PsCommand(factory composeApp.ProjectFactory) cli.Command {
return cli.Command{
Name: "ps",
Usage: "List containers",
Action: composeApp.WithProject(factory, app.ProjectPs),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "q",
Usage: "Only display IDs",
},
},
}
}
func UpCommand(factory composeApp.ProjectFactory) cli.Command {
return cli.Command{
Name: "up",
Usage: "Create and start containers",
Before: verifyOneOrMoreServices,
Action: composeApp.WithProject(factory, app.ProjectUp),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "foreground",
Usage: "Run in foreground and log",
},
cli.BoolFlag{
Name: "no-build",
Usage: "Don't build an image, even if it's missing.",
},
cli.BoolFlag{
Name: "no-recreate",
Usage: "If containers already exist, don't recreate them. Incompatible with --force-recreate.",
},
cli.BoolFlag{
Name: "force-recreate",
Usage: "Recreate containers even if their configuration and image haven't changed. Incompatible with --no-recreate.",
},
},
}
}
func StartCommand(factory composeApp.ProjectFactory) cli.Command {
return cli.Command{
Name: "start",
Usage: "Start services",
Before: verifyOneOrMoreServices,
Action: composeApp.WithProject(factory, app.ProjectStart),
Flags: []cli.Flag{
cli.BoolTFlag{
Name: "foreground",
Usage: "Run in foreground and log",
},
},
}
}
func PullCommand(factory composeApp.ProjectFactory) cli.Command {
return cli.Command{
Name: "pull",
Usage: "Pulls service images",
Before: verifyOneOrMoreServices,
Action: composeApp.WithProject(factory, app.ProjectPull),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "ignore-pull-failures",
Usage: "Pull what it can and ignores images with pull failures.",
},
},
}
}
func LogsCommand(factory composeApp.ProjectFactory) cli.Command {
return cli.Command{
Name: "logs",
Usage: "View output from containers",
Before: verifyOneOrMoreServices,
Action: composeApp.WithProject(factory, app.ProjectLog),
Flags: []cli.Flag{
cli.IntFlag{
Name: "lines",
Usage: "number of lines to tail",
Value: 100,
},
cli.BoolFlag{
Name: "follow, f",
Usage: "Follow log output.",
},
},
}
}
func RestartCommand(factory composeApp.ProjectFactory) cli.Command {
return cli.Command{
Name: "restart",
Usage: "Restart services",
Before: verifyOneOrMoreServices,
Action: composeApp.WithProject(factory, app.ProjectRestart),
Flags: []cli.Flag{
cli.IntFlag{
Name: "timeout,t",
Usage: "Specify a shutdown timeout in seconds.",
Value: 10,
},
},
}
}
func StopCommand(factory composeApp.ProjectFactory) cli.Command {
return cli.Command{
Name: "stop",
Usage: "Stop services",
Before: verifyOneOrMoreServices,
Action: composeApp.WithProject(factory, app.ProjectStop),
Flags: []cli.Flag{
cli.IntFlag{
Name: "timeout,t",
Usage: "Specify a shutdown timeout in seconds.",
Value: 10,
},
},
}
}
func DownCommand(factory composeApp.ProjectFactory) cli.Command {
return cli.Command{
Name: "down",
Usage: "Stop and remove containers, networks, images, and volumes",
Before: verifyOneOrMoreServices,
Action: composeApp.WithProject(factory, app.ProjectDown),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "volumes,v",
Usage: "Remove data volumes",
},
cli.StringFlag{
Name: "rmi",
Usage: "Remove images, type may be one of: 'all' to remove all images, or 'local' to remove only images that don't have an custom name set by the `image` field",
},
cli.BoolFlag{
Name: "remove-orphans",
Usage: "Remove containers for services not defined in the Compose file",
},
},
}
}
func RmCommand(factory composeApp.ProjectFactory) cli.Command {
return cli.Command{
Name: "rm",
Usage: "Delete services",
Before: verifyOneOrMoreServices,
Action: composeApp.WithProject(factory, app.ProjectDelete),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "force,f",
Usage: "Allow deletion of all services",
},
cli.BoolFlag{
Name: "v",
Usage: "Remove volumes associated with containers",
},
},
}
}
func KillCommand(factory composeApp.ProjectFactory) cli.Command {
return cli.Command{
Name: "kill",
Usage: "Kill containers",
Before: verifyOneOrMoreServices,
Action: composeApp.WithProject(factory, app.ProjectKill),
Flags: []cli.Flag{
cli.StringFlag{
Name: "signal,s",
Usage: "SIGNAL to send to the container",
Value: "SIGKILL",
},
},
}
}
================================================
FILE: cmd/control/service/service.go
================================================
package service
import (
"fmt"
"strings"
"github.com/burmilla/os/cmd/control/service/command"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/compose"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
"github.com/burmilla/os/pkg/util/network"
"github.com/codegangsta/cli"
dockerApp "github.com/docker/libcompose/cli/docker/app"
"github.com/docker/libcompose/project"
)
type projectFactory struct {
}
func (p *projectFactory) Create(c *cli.Context) (project.APIProject, error) {
cfg := config.LoadConfig()
return compose.GetProject(cfg, true, false)
}
func beforeApp(c *cli.Context) error {
if c.GlobalBool("verbose") {
log.SetLevel(log.DebugLevel)
}
return nil
}
func Commands() cli.Command {
factory := &projectFactory{}
app := cli.Command{}
app.Name = "service"
app.ShortName = "s"
app.Before = beforeApp
app.Flags = append(dockerApp.DockerClientFlags(), cli.BoolFlag{
Name: "verbose,debug",
})
app.Subcommands = append(serviceSubCommands(),
command.BuildCommand(factory),
command.CreateCommand(factory),
command.UpCommand(factory),
command.StartCommand(factory),
command.LogsCommand(factory),
command.RestartCommand(factory),
command.StopCommand(factory),
command.RmCommand(factory),
command.PullCommand(factory),
command.KillCommand(factory),
command.PsCommand(factory),
)
return app
}
func serviceSubCommands() []cli.Command {
return []cli.Command{
{
Name: "enable",
Usage: "turn on an service",
Action: enable,
},
{
Name: "disable",
Usage: "turn off an service",
Action: disable,
},
{
Name: "list",
Usage: "list services and state",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "all, a",
Usage: "list all services and state",
},
cli.BoolFlag{
Name: "update, u",
Usage: "update service cache",
},
},
Action: list,
},
{
Name: "delete",
Usage: "delete a service",
Action: del,
},
}
}
func updateIncludedServices(cfg *config.CloudConfig) error {
return config.Set("rancher.services_include", cfg.Rancher.ServicesInclude)
}
func disable(c *cli.Context) error {
changed := false
cfg := config.LoadConfig()
for _, service := range c.Args() {
validateService(service, cfg)
if _, ok := cfg.Rancher.ServicesInclude[service]; !ok {
continue
}
cfg.Rancher.ServicesInclude[service] = false
changed = true
}
if changed {
if err := updateIncludedServices(cfg); err != nil {
log.Fatal(err)
}
}
return nil
}
func del(c *cli.Context) error {
changed := false
cfg := config.LoadConfig()
for _, service := range c.Args() {
validateService(service, cfg)
if _, ok := cfg.Rancher.ServicesInclude[service]; !ok {
continue
}
delete(cfg.Rancher.ServicesInclude, service)
changed = true
}
if changed {
if err := updateIncludedServices(cfg); err != nil {
log.Fatal(err)
}
}
return nil
}
func enable(c *cli.Context) error {
cfg := config.LoadConfig()
var enabledServices []string
for _, service := range c.Args() {
validateService(service, cfg)
if val, ok := cfg.Rancher.ServicesInclude[service]; !ok || !val {
if isLocal(service) && !strings.HasPrefix(service, "/var/lib/rancher/conf") {
log.Fatalf("ERROR: Service should be in path /var/lib/rancher/conf")
}
cfg.Rancher.ServicesInclude[service] = true
enabledServices = append(enabledServices, service)
}
}
if len(enabledServices) > 0 {
if err := compose.StageServices(cfg, enabledServices...); err != nil {
log.Fatal(err)
}
if err := updateIncludedServices(cfg); err != nil {
log.Fatal(err)
}
}
return nil
}
func list(c *cli.Context) error {
cfg := config.LoadConfig()
clone := make(map[string]bool)
for service, enabled := range cfg.Rancher.ServicesInclude {
clone[service] = enabled
}
services := availableService(cfg, c.Bool("update"))
if c.Bool("all") {
for service := range cfg.Rancher.Services {
fmt.Printf("enabled %s\n", service)
}
}
for _, service := range services {
if enabled, ok := clone[service]; ok {
delete(clone, service)
if enabled {
fmt.Printf("enabled %s\n", service)
} else {
fmt.Printf("disabled %s\n", service)
}
} else {
fmt.Printf("disabled %s\n", service)
}
}
for service, enabled := range clone {
if enabled {
fmt.Printf("enabled %s\n", service)
} else {
fmt.Printf("disabled %s\n", service)
}
}
return nil
}
func isLocal(service string) bool {
return strings.HasPrefix(service, "/")
}
func IsLocalOrURL(service string) bool {
return isLocal(service) || strings.HasPrefix(service, "http:/") || strings.HasPrefix(service, "https:/")
}
// ValidService checks to see if the service definition exists
func ValidService(service string, cfg *config.CloudConfig) bool {
services := availableService(cfg, false)
if !IsLocalOrURL(service) && !util.Contains(services, service) {
return false
}
return true
}
func validateService(service string, cfg *config.CloudConfig) {
if !ValidService(service, cfg) {
log.Fatalf("%s is not a valid service", service)
}
}
func availableService(cfg *config.CloudConfig, update bool) []string {
if update {
err := network.UpdateCaches(cfg.Rancher.Repositories.ToArray(), "services")
if err != nil {
log.Debugf("Failed to update service caches: %v", err)
}
}
services, err := network.GetServices(cfg.Rancher.Repositories.ToArray())
if err != nil {
log.Fatalf("Failed to get services: %v", err)
}
return services
}
================================================
FILE: cmd/control/switch_console.go
================================================
package control
import (
"errors"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/compose"
"github.com/burmilla/os/pkg/log"
"github.com/codegangsta/cli"
"github.com/docker/libcompose/project/options"
"golang.org/x/net/context"
)
func switchConsoleAction(c *cli.Context) error {
if len(c.Args()) != 1 {
return errors.New("Must specify exactly one existing container")
}
newConsole := c.Args()[0]
cfg := config.LoadConfig()
project, err := compose.GetProject(cfg, true, false)
if err != nil {
return err
}
// stop docker and console to avoid zombie process
if err = project.Stop(context.Background(), 10, "docker"); err != nil {
log.Errorf("Failed to stop Docker: %v", err)
}
if err = project.Stop(context.Background(), 10, "console"); err != nil {
log.Errorf("Failed to stop console: %v", err)
}
if newConsole != "default" {
if err = compose.LoadSpecialService(project, cfg, "console", newConsole); err != nil {
return err
}
}
if err = config.Set("rancher.console", newConsole); err != nil {
log.Errorf("Failed to update 'rancher.console': %v", err)
}
if err = project.Up(context.Background(), options.Up{
Log: true,
}, "console"); err != nil {
return err
}
if err = project.Start(context.Background(), "docker"); err != nil {
log.Errorf("Failed to start Docker: %v", err)
}
return nil
}
================================================
FILE: cmd/control/tlsconf.go
================================================
package control
import (
"io/ioutil"
"os"
"path/filepath"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
"github.com/codegangsta/cli"
machineUtil "github.com/docker/machine/utils"
)
const (
NAME string = "rancher"
BITS int = 2048
ServerTLSPath string = "/etc/docker/tls"
ClientTLSPath string = "/home/rancher/.docker"
Cert string = "cert.pem"
Key string = "key.pem"
ServerCert string = "server-cert.pem"
ServerKey string = "server-key.pem"
CaCert string = "ca.pem"
CaKey string = "ca-key.pem"
)
func tlsConfCommands() []cli.Command {
return []cli.Command{
{
Name: "generate",
ShortName: "gen",
Usage: "generates new set of TLS configuration certs",
Action: tlsConfCreate,
Flags: []cli.Flag{
cli.StringSliceFlag{
Name: "hostname, H",
Usage: "the hostname for which you want to generate the certificate",
Value: &cli.StringSlice{"localhost"},
},
cli.BoolFlag{
Name: "server, s",
Usage: "generate the server keys instead of client keys",
},
cli.StringFlag{
Name: "dir, d",
Usage: "the directory to save/read the certs to/from",
Value: "",
},
},
},
}
}
func writeCerts(generateServer bool, hostname []string, certPath, keyPath, caCertPath, caKeyPath string) error {
if !generateServer {
return machineUtil.GenerateCert([]string{""}, certPath, keyPath, caCertPath, caKeyPath, NAME, BITS)
}
if err := machineUtil.GenerateCert(hostname, certPath, keyPath, caCertPath, caKeyPath, NAME, BITS); err != nil {
return err
}
cert, err := ioutil.ReadFile(certPath)
if err != nil {
return err
}
key, err := ioutil.ReadFile(keyPath)
if err != nil {
return err
}
// certPath, keyPath are already written to by machineUtil.GenerateCert()
if err := config.Set("rancher.docker.server_cert", string(cert)); err != nil {
return err
}
return config.Set("rancher.docker.server_key", string(key))
}
func writeCaCerts(cfg *config.CloudConfig, caCertPath, caKeyPath string) error {
if cfg.Rancher.Docker.CACert == "" {
if err := machineUtil.GenerateCACertificate(caCertPath, caKeyPath, NAME, BITS); err != nil {
return err
}
caCert, err := ioutil.ReadFile(caCertPath)
if err != nil {
return err
}
caKey, err := ioutil.ReadFile(caKeyPath)
if err != nil {
return err
}
// caCertPath, caKeyPath are already written to by machineUtil.GenerateCACertificate()
if err := config.Set("rancher.docker.ca_cert", string(caCert)); err != nil {
return err
}
if err := config.Set("rancher.docker.ca_key", string(caKey)); err != nil {
return err
}
} else {
cfg = config.LoadConfig()
if err := util.WriteFileAtomic(caCertPath, []byte(cfg.Rancher.Docker.CACert), 0400); err != nil {
return err
}
if err := util.WriteFileAtomic(caKeyPath, []byte(cfg.Rancher.Docker.CAKey), 0400); err != nil {
return err
}
}
return nil
}
func tlsConfCreate(c *cli.Context) error {
err := generate(c)
if err != nil {
log.Fatal(err)
}
return nil
}
func generate(c *cli.Context) error {
generateServer := c.Bool("server")
outDir := c.String("dir")
hostnames := c.StringSlice("hostname")
return Generate(generateServer, outDir, hostnames)
}
func Generate(generateServer bool, outDir string, hostnames []string) error {
if outDir == "" {
if generateServer {
outDir = ServerTLSPath
} else {
outDir = ClientTLSPath
}
log.Infof("Out directory (-d, --dir) not specified, using default: %s", outDir)
}
caCertPath := filepath.Join(outDir, CaCert)
caKeyPath := filepath.Join(outDir, CaKey)
certPath := filepath.Join(outDir, Cert)
keyPath := filepath.Join(outDir, Key)
if generateServer {
certPath = filepath.Join(outDir, ServerCert)
keyPath = filepath.Join(outDir, ServerKey)
}
if _, err := os.Stat(outDir); os.IsNotExist(err) {
if err := os.MkdirAll(outDir, 0700); err != nil {
return err
}
}
cfg := config.LoadConfig()
if err := writeCaCerts(cfg, caCertPath, caKeyPath); err != nil {
return err
}
if err := writeCerts(generateServer, hostnames, certPath, keyPath, caCertPath, caKeyPath); err != nil {
return err
}
if !generateServer {
if err := filepath.Walk(outDir, func(path string, info os.FileInfo, err error) error {
return os.Chown(path, 1100, 1100) // rancher:rancher
}); err != nil {
return err
}
}
return nil
}
================================================
FILE: cmd/control/udevsettle.go
================================================
package control
import (
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/log"
"github.com/codegangsta/cli"
)
func udevSettleAction(c *cli.Context) {
if err := extraRules(); err != nil {
log.Error(err)
}
if err := UdevSettle(); err != nil {
log.Fatal(err)
}
}
func extraRules() error {
cfg := config.LoadConfig()
if len(cfg.Rancher.Network.ModemNetworks) > 0 {
rules, err := ioutil.ReadDir(config.UdevRulesExtrasDir)
if err != nil {
return err
}
for _, r := range rules {
if r.IsDir() || filepath.Ext(r.Name()) != ".rules" {
continue
}
err := os.Symlink(filepath.Join(config.UdevRulesExtrasDir, r.Name()), filepath.Join(config.UdevRulesDir, r.Name()))
if err != nil {
return err
}
}
} else {
rules, err := ioutil.ReadDir(config.UdevRulesDir)
if err != nil {
return err
}
for _, r := range rules {
if r.IsDir() || (filepath.Ext(r.Name()) != ".rules") || (r.Mode()&os.ModeSymlink != 0) {
continue
}
err := os.Remove(filepath.Join(config.UdevRulesDir, r.Name()))
if err != nil {
return err
}
}
}
return nil
}
func UdevSettle() error {
cmd := exec.Command("udevd", "--daemon")
defer exec.Command("killall", "udevd").Run()
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return err
}
cmd = exec.Command("udevadm", "trigger", "--action=add")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return err
}
cmd = exec.Command("udevadm", "settle")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
}
================================================
FILE: cmd/control/user_docker.go
================================================
package control
import (
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"syscall"
"time"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/compose"
rosDocker "github.com/burmilla/os/pkg/docker"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/util"
"github.com/codegangsta/cli"
composeClient "github.com/docker/libcompose/docker/client"
"github.com/docker/libcompose/project"
"golang.org/x/net/context"
)
const (
defaultStorageContext = "console"
dockerPidFile = "/var/run/docker.pid"
sourceDirectory = "/engine"
destDirectory = "/var/lib/rancher/engine"
pluginsSourceDirectory = "/engine-plugins"
pluginsDestDirectory = "/var/lib/rancher/engine-plugins"
dockerCompletionFName = "completion"
)
var (
dockerCommand = []string{
"ros",
"docker-init",
}
)
func userDockerAction(c *cli.Context) error {
if err := copyBinaries(sourceDirectory, destDirectory); err != nil {
return err
}
if err := copyBinaries(pluginsSourceDirectory, pluginsDestDirectory); err != nil {
return err
}
if err := syscall.Mount("/host/sys", "/sys", "", syscall.MS_BIND|syscall.MS_REC, ""); err != nil {
return err
}
cfg := config.LoadConfig()
return startDocker(cfg)
}
func copyBinaries(source, dest string) error {
if err := os.MkdirAll(dest, 0755); err != nil {
return err
}
files, err := ioutil.ReadDir(dest)
if err != nil {
return err
}
for _, file := range files {
if err = os.RemoveAll(path.Join(dest, file.Name())); err != nil {
return err
}
}
files, err = ioutil.ReadDir(source)
if err != nil {
return err
}
for _, file := range files {
sourceFile := path.Join(source, file.Name())
destFile := path.Join(dest, file.Name())
in, err := os.Open(sourceFile)
if err != nil {
return err
}
out, err := os.Create(destFile)
if err != nil {
return err
}
if _, err = io.Copy(out, in); err != nil {
return err
}
if err = out.Sync(); err != nil {
return err
}
if err = in.Close(); err != nil {
return err
}
if err = out.Close(); err != nil {
return err
}
if file.Name() == dockerCompletionFName {
if err := os.Chmod(destFile, 0644); err != nil {
return err
}
} else {
if err := os.Chmod(destFile, 0751); err != nil {
return err
}
}
}
return nil
}
func writeConfigCerts(cfg *config.CloudConfig) error {
outDir := ServerTLSPath
if err := os.MkdirAll(outDir, 0700); err != nil {
return err
}
caCertPath := filepath.Join(outDir, CaCert)
caKeyPath := filepath.Join(outDir, CaKey)
serverCertPath := filepath.Join(outDir, ServerCert)
serverKeyPath := filepath.Join(outDir, ServerKey)
if cfg.Rancher.Docker.CACert != "" {
if err := util.WriteFileAtomic(caCertPath, []byte(cfg.Rancher.Docker.CACert), 0400); err != nil {
return err
}
if err := util.WriteFileAtomic(caKeyPath, []byte(cfg.Rancher.Docker.CAKey), 0400); err != nil {
return err
}
}
if cfg.Rancher.Docker.ServerCert != "" {
if err := util.WriteFileAtomic(serverCertPath, []byte(cfg.Rancher.Docker.ServerCert), 0400); err != nil {
return err
}
if err := util.WriteFileAtomic(serverKeyPath, []byte(cfg.Rancher.Docker.ServerKey), 0400); err != nil {
return err
}
}
return nil
}
func startDocker(cfg *config.CloudConfig) error {
storageContext := cfg.Rancher.Docker.StorageContext
if storageContext == "" {
storageContext = defaultStorageContext
}
log.Infof("Starting Docker in context: %s", storageContext)
p, err := compose.GetProject(cfg, true, false)
if err != nil {
return err
}
pid, err := waitForPid(storageContext, p)
if err != nil {
return err
}
log.Infof("%s PID %d", storageContext, pid)
client, err := rosDocker.NewSystemClient()
if err != nil {
return err
}
dockerCfg := cfg.Rancher.Docker
args := dockerCfg.FullArgs()
log.Debugf("User Docker args: %v", args)
if dockerCfg.TLS {
if err := writeConfigCerts(cfg); err != nil {
return err
}
}
info, err := client.ContainerInspect(context.Background(), storageContext)
if err != nil {
return err
}
cmd := []string{"system-docker-runc", "exec", "--", info.ID, "env"}
log.Info(dockerCfg.AppendEnv())
cmd = append(cmd, dockerCfg.AppendEnv()...)
cmd = append(cmd, dockerCommand...)
cmd = append(cmd, args...)
log.Infof("Running %v", cmd)
return syscall.Exec("/usr/bin/system-docker-runc", cmd, os.Environ())
}
func waitForPid(service string, project *project.Project) (int, error) {
log.Infof("Getting PID for service: %s", service)
for {
if pid, err := getPid(service, project); err != nil || pid == 0 {
log.Infof("Waiting for %s : %d : %v", service, pid, err)
time.Sleep(1 * time.Second)
} else {
return pid, err
}
}
}
func getPid(service string, project *project.Project) (int, error) {
s, err := project.CreateService(service)
if err != nil {
return 0, err
}
containers, err := s.Containers(context.Background())
if err != nil {
return 0, err
}
if len(containers) == 0 {
return 0, nil
}
client, err := composeClient.Create(composeClient.Options{
Host: config.SystemDockerHost,
})
if err != nil {
return 0, err
}
id, err := containers[0].ID()
if err != nil {
return 0, err
}
info, err := client.ContainerInspect(context.Background(), id)
if err != nil || info.ID == "" {
return 0, err
}
if info.State.Running {
return info.State.Pid, nil
}
return 0, nil
}
================================================
FILE: cmd/control/util.go
================================================
package control
import (
"bufio"
"fmt"
"io/ioutil"
"os"
"strings"
"time"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/log"
"github.com/pkg/errors"
)
func yes(question string) bool {
fmt.Printf("%s [y/N]: ", question)
in := bufio.NewReader(os.Stdin)
line, err := in.ReadString('\n')
if err != nil {
log.Fatal(err)
}
return strings.ToLower(line[0:1]) == "y"
}
func formatImage(image string, cfg *config.CloudConfig) string {
domainRegistry := cfg.Rancher.Environment["REGISTRY_DOMAIN"]
if domainRegistry != "docker.io" && domainRegistry != "" {
return fmt.Sprintf("%s/%s", domainRegistry, image)
}
return image
}
func symLinkEngineBinary() []symlink {
baseSymlink := []symlink{
{"/usr/share/ros/os-release", "/usr/lib/os-release"},
{"/usr/share/ros/os-release", "/etc/os-release"},
{"/var/lib/rancher/engine/docker", "/usr/bin/docker"},
{"/var/lib/rancher/engine/dockerd", "/usr/bin/dockerd"},
{"/var/lib/rancher/engine/docker-init", "/usr/bin/docker-init"},
{"/var/lib/rancher/engine/docker-proxy", "/usr/bin/docker-proxy"},
// >= 18.09.0
{"/var/lib/rancher/engine/containerd", "/usr/bin/containerd"},
{"/var/lib/rancher/engine/ctr", "/usr/bin/ctr"},
{"/var/lib/rancher/engine/containerd-shim", "/usr/bin/containerd-shim"},
{"/var/lib/rancher/engine/runc", "/usr/bin/runc"},
// < 18.09.0
{"/var/lib/rancher/engine/docker-containerd", "/usr/bin/docker-containerd"},
{"/var/lib/rancher/engine/docker-containerd-ctr", "/usr/bin/docker-containerd-ctr"},
{"/var/lib/rancher/engine/docker-containerd-shim", "/usr/bin/docker-containerd-shim"},
{"/var/lib/rancher/engine/docker-runc", "/usr/bin/docker-runc"},
// Docker CLI plugins
{"/var/lib/rancher/engine-plugins/docker-compose", "/usr/bin/docker-compose"},
{"/var/lib/rancher/engine-plugins/docker-compose", "/usr/libexec/docker/cli-plugins/docker-compose"},
{"/var/lib/rancher/engine-plugins/docker-buildx", "/usr/libexec/docker/cli-plugins/docker-buildx"},
}
return baseSymlink
}
func checkZfsBackingFS(driver, dir string) error {
if driver != "zfs" {
return nil
}
for i := 0; i < 4; i++ {
mountInfo, err := ioutil.ReadFile("/proc/self/mountinfo")
if err != nil {
continue
}
for _, mount := range strings.Split(string(mountInfo), "\n") {
if strings.Contains(mount, dir) && strings.Contains(mount, driver) {
return nil
}
}
time.Sleep(1 * time.Second)
}
return errors.Errorf("BackingFS: %s not match storage-driver: %s", dir, driver)
}
func checkGlobalCfg() bool {
_, err := os.Stat("/proc/1/root/boot/global.cfg")
if err == nil || os.IsExist(err) {
return true
}
return false
}
================================================
FILE: cmd/init/init.go
================================================
//go:build linux
// +build linux
package init
import (
"fmt"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/dfs"
"github.com/burmilla/os/pkg/init/b2d"
"github.com/burmilla/os/pkg/init/cloudinit"
"github.com/burmilla/os/pkg/init/configfiles"
"github.com/burmilla/os/pkg/init/debug"
"github.com/burmilla/os/pkg/init/docker"
"github.com/burmilla/os/pkg/init/env"
"github.com/burmilla/os/pkg/init/fsmount"
"github.com/burmilla/os/pkg/init/hypervisor"
"github.com/burmilla/os/pkg/init/modules"
"github.com/burmilla/os/pkg/init/one"
"github.com/burmilla/os/pkg/init/prepare"
"github.com/burmilla/os/pkg/init/recovery"
"github.com/burmilla/os/pkg/init/sharedroot"
"github.com/burmilla/os/pkg/init/switchroot"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/sysinit"
)
func MainInit() {
log.InitLogger()
// TODO: this breaks and does nothing if the cfg is invalid (or is it due to threading?)
defer func() {
if r := recover(); r != nil {
fmt.Printf("Starting Recovery console: %v\n", r)
recovery.Recovery(nil)
}
}()
if err := RunInit(); err != nil {
log.Fatal(err)
}
}
func RunInit() error {
initFuncs := config.CfgFuncs{
{Name: "set env", Func: env.Init},
{Name: "preparefs", Func: prepare.FS},
{Name: "save init cmdline", Func: prepare.SaveCmdline},
{Name: "mount OEM", Func: fsmount.MountOem},
{Name: "debug save cfg", Func: debug.PrintAndLoadConfig},
{Name: "load modules", Func: modules.LoadModules},
{Name: "recovery console", Func: recovery.LoadRecoveryConsole},
{Name: "b2d env", Func: b2d.B2D},
{Name: "mount STATE and bootstrap", Func: fsmount.MountStateAndBootstrap},
{Name: "cloud-init", Func: cloudinit.CloudInit},
{Name: "read cfg and log files", Func: configfiles.ReadConfigFiles},
{Name: "switchroot", Func: switchroot.SwitchRoot},
{Name: "mount OEM2", Func: fsmount.MountOem},
{Name: "mount BOOT", Func: fsmount.MountBoot},
{Name: "write cfg and log files", Func: configfiles.WriteConfigFiles},
{Name: "b2d Env", Func: b2d.Env},
{Name: "hypervisor tools", Func: hypervisor.Tools},
{Name: "preparefs2", Func: prepare.FS},
{Name: "load modules2", Func: modules.LoadModules},
{Name: "set proxy env", Func: env.Proxy},
{Name: "setupSharedRoot", Func: sharedroot.Setup},
{Name: "sysinit", Func: sysinit.RunSysInit},
}
cfg, err := config.ChainCfgFuncs(nil, initFuncs)
if err != nil {
recovery.Recovery(err)
}
launchConfig, args := docker.GetLaunchConfig(cfg, &cfg.Rancher.SystemDocker)
launchConfig.Fork = !cfg.Rancher.SystemDocker.Exec
//launchConfig.NoLog = true
log.Info("Launching System Docker")
_, err = dfs.LaunchDocker(launchConfig, config.SystemDockerBin, args...)
if err != nil {
log.Errorf("Error Launching System Docker: %s", err)
recovery.Recovery(err)
return err
}
// Code never gets here - rancher.system_docker.exec=true
return one.PidOne()
}
================================================
FILE: cmd/network/network.go
================================================
package network
import (
"fmt"
"io/ioutil"
"os"
"os/signal"
"path/filepath"
"strconv"
"syscall"
"text/template"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/docker"
"github.com/burmilla/os/pkg/hostname"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/netconf"
"github.com/docker/libnetwork/resolvconf"
"golang.org/x/net/context"
)
var funcMap = template.FuncMap{
"addFunc": func(a, b int) string {
return strconv.Itoa(a + b)
},
}
func Main() {
log.InitLogger()
cfg := config.LoadConfig()
ApplyNetworkConfig(cfg)
log.Infof("Restart syslog")
client, err := docker.NewSystemClient()
if err != nil {
log.Error(err)
}
if err := client.ContainerRestart(context.Background(), "syslog", 10); err != nil {
log.Error(err)
}
signalChan := make(chan os.Signal, 1)
signal.Notify(signalChan, syscall.SIGTERM)
<-signalChan
log.Info("Received SIGTERM, shutting down")
netconf.StopWpaSupplicant()
netconf.StopDhcpcd()
}
func ApplyNetworkConfig(cfg *config.CloudConfig) {
log.Infof("Apply Network Config")
userSetDNS := len(cfg.Rancher.Network.DNS.Nameservers) > 0 || len(cfg.Rancher.Network.DNS.Search) > 0
if err := hostname.SetHostnameFromCloudConfig(cfg); err != nil {
log.Errorf("Failed to set hostname from cloud config: %v", err)
}
userSetHostname := cfg.Hostname != ""
if cfg.Rancher.Network.DHCPTimeout <= 0 {
cfg.Rancher.Network.DHCPTimeout = cfg.Rancher.Defaults.Network.DHCPTimeout
}
// Always generate dhcpcd.conf to support NTP and hostname configuration coming from DHCP
generateDhcpcdFiles(cfg)
// In order to handle the STATIC mode in Wi-Fi network, we have to update the dhcpcd.conf file.
// https://wiki.archlinux.org/index.php/dhcpcd#Static_profile
if len(cfg.Rancher.Network.WifiNetworks) > 0 {
generateWpaFiles(cfg)
}
dhcpSetDNS, err := netconf.ApplyNetworkConfigs(&cfg.Rancher.Network, userSetHostname, userSetDNS)
if err != nil {
log.Errorf("Failed to apply network configs(by netconf): %v", err)
}
if dhcpSetDNS {
log.Infof("DNS set by DHCP")
}
if !userSetDNS && !dhcpSetDNS {
// only write 8.8.8.8,8.8.4.4 as a last resort
log.Infof("Writing default resolv.conf - no user setting, and no DHCP setting")
if _, err := resolvconf.Build("/etc/resolv.conf",
cfg.Rancher.Defaults.Network.DNS.Nameservers,
cfg.Rancher.Defaults.Network.DNS.Search,
nil); err != nil {
log.Errorf("Failed to write resolv.conf (!userSetDNS and !dhcpSetDNS): %v", err)
}
}
if userSetDNS {
if _, err := resolvconf.Build("/etc/resolv.conf", cfg.Rancher.Network.DNS.Nameservers, cfg.Rancher.Network.DNS.Search, nil); err != nil {
log.Errorf("Failed to write resolv.conf (userSetDNS): %v", err)
} else {
log.Infof("writing to /etc/resolv.conf: nameservers: %v, search: %v", cfg.Rancher.Network.DNS.Nameservers, cfg.Rancher.Network.DNS.Search)
}
}
resolve, err := ioutil.ReadFile("/etc/resolv.conf")
log.Debugf("Resolve.conf == [%s], %v", resolve, err)
log.Infof("Apply Network Config SyncHostname")
if err := hostname.SyncHostname(); err != nil {
log.Errorf("Failed to sync hostname: %v", err)
}
}
func generateDhcpcdFiles(cfg *config.CloudConfig) {
networks := cfg.Rancher.Network.WifiNetworks
interfaces := cfg.Rancher.Network.Interfaces
configs := make(map[string]netconf.WifiNetworkConfig)
for k, v := range interfaces {
if c, ok := networks[v.WifiNetwork]; ok && c.Address != "" {
configs[k] = c
}
}
f, err := os.Create(config.DHCPCDConfigFile)
defer f.Close()
if err != nil {
log.Errorf("Failed to open file: %s err: %v", config.DHCPCDConfigFile, err)
}
templateFiles := []string{config.DHCPCDTemplateFile}
templateName := filepath.Base(templateFiles[0])
p := template.Must(template.New(templateName).ParseFiles(templateFiles...))
if err = p.Execute(f, configs); err != nil {
log.Errorf("Failed to wrote wpa configuration to %s: %v", config.DHCPCDConfigFile, err)
}
}
func generateWpaFiles(cfg *config.CloudConfig) {
networks := cfg.Rancher.Network.WifiNetworks
interfaces := cfg.Rancher.Network.Interfaces
for k, v := range interfaces {
if v.WifiNetwork != "" {
configs := make(map[string]netconf.WifiNetworkConfig)
filename := fmt.Sprintf(config.WPAConfigFile, k)
f, err := os.Create(filename)
if err != nil {
log.Errorf("Failed to open file: %s err: %v", filename, err)
}
if c, ok := networks[v.WifiNetwork]; ok {
configs[v.WifiNetwork] = c
}
templateFiles :=
gitextract_wmx6zcva/
├── .dockerignore
├── .github/
│ ├── ISSUE_TEMPLATE.md
│ └── workflows/
│ ├── create-release.yml
│ └── pull-request-validation.yml
├── .gitignore
├── Dockerfile.dapper
├── LICENSE
├── Makefile
├── README.md
├── assets/
│ ├── rancher.key
│ ├── rancher.key.pub
│ └── scripts_ssh_config
├── cmd/
│ ├── cloudinitexecute/
│ │ ├── authorize_ssh_keys.go
│ │ └── cloudinitexecute.go
│ ├── cloudinitsave/
│ │ └── cloudinitsave.go
│ ├── control/
│ │ ├── autologin.go
│ │ ├── bootstrap.go
│ │ ├── cli.go
│ │ ├── config.go
│ │ ├── config_test.go
│ │ ├── console.go
│ │ ├── console_init.go
│ │ ├── dev.go
│ │ ├── docker_init.go
│ │ ├── engine.go
│ │ ├── entrypoint.go
│ │ ├── env.go
│ │ ├── install/
│ │ │ ├── grub.go
│ │ │ ├── install.go
│ │ │ ├── service.go
│ │ │ └── syslinux.go
│ │ ├── install.go
│ │ ├── os.go
│ │ ├── preload.go
│ │ ├── recovery_init.go
│ │ ├── service/
│ │ │ ├── app/
│ │ │ │ └── app.go
│ │ │ ├── command/
│ │ │ │ └── command.go
│ │ │ └── service.go
│ │ ├── switch_console.go
│ │ ├── tlsconf.go
│ │ ├── udevsettle.go
│ │ ├── user_docker.go
│ │ └── util.go
│ ├── init/
│ │ └── init.go
│ ├── network/
│ │ └── network.go
│ ├── power/
│ │ ├── power.go
│ │ └── shutdown.go
│ ├── respawn/
│ │ └── respawn.go
│ ├── sysinit/
│ │ └── sysinit.go
│ └── wait/
│ └── wait.go
├── config/
│ ├── cloudinit/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── CONTRIBUTING.md
│ │ ├── DCO
│ │ ├── Documentation/
│ │ │ ├── cloud-config-deprecated.md
│ │ │ ├── cloud-config-locations.md
│ │ │ ├── cloud-config-oem.md
│ │ │ ├── cloud-config.md
│ │ │ ├── config-drive.md
│ │ │ ├── debian-interfaces.md
│ │ │ └── vmware-guestinfo.md
│ │ ├── LICENSE
│ │ ├── MAINTAINERS
│ │ ├── NOTICE
│ │ ├── README.md
│ │ ├── build
│ │ ├── config/
│ │ │ ├── config.go
│ │ │ ├── config_test.go
│ │ │ ├── decode.go
│ │ │ ├── etc_hosts.go
│ │ │ ├── etcd.go
│ │ │ ├── etcd2.go
│ │ │ ├── file.go
│ │ │ ├── file_test.go
│ │ │ ├── flannel.go
│ │ │ ├── fleet.go
│ │ │ ├── ignition.go
│ │ │ ├── locksmith.go
│ │ │ ├── locksmith_test.go
│ │ │ ├── oem.go
│ │ │ ├── script.go
│ │ │ ├── unit.go
│ │ │ ├── unit_test.go
│ │ │ ├── update.go
│ │ │ ├── update_test.go
│ │ │ ├── user.go
│ │ │ └── validate/
│ │ │ ├── context.go
│ │ │ ├── context_test.go
│ │ │ ├── node.go
│ │ │ ├── node_test.go
│ │ │ ├── report.go
│ │ │ ├── report_test.go
│ │ │ ├── rules.go
│ │ │ ├── rules_test.go
│ │ │ ├── validate.go
│ │ │ └── validate_test.go
│ │ ├── cover
│ │ ├── datasource/
│ │ │ ├── configdrive/
│ │ │ │ ├── configdrive.go
│ │ │ │ └── configdrive_test.go
│ │ │ ├── datasource.go
│ │ │ ├── file/
│ │ │ │ └── file.go
│ │ │ ├── metadata/
│ │ │ │ ├── aliyun/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── azure/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── cloudstack/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── digitalocean/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── ec2/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── exoscale/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── gce/
│ │ │ │ │ ├── metadata.go
│ │ │ │ │ └── metadata_test.go
│ │ │ │ ├── metadata.go
│ │ │ │ ├── metadata_test.go
│ │ │ │ ├── packet/
│ │ │ │ │ └── metadata.go
│ │ │ │ └── test/
│ │ │ │ └── test.go
│ │ │ ├── proccmdline/
│ │ │ │ ├── proc_cmdline.go
│ │ │ │ └── proc_cmdline_test.go
│ │ │ ├── proxmox/
│ │ │ │ ├── proxmox.go
│ │ │ │ └── proxmox_test.go
│ │ │ ├── test/
│ │ │ │ ├── filesystem.go
│ │ │ │ └── filesystem_test.go
│ │ │ ├── tftp/
│ │ │ │ ├── tftp.go
│ │ │ │ └── tftp_test.go
│ │ │ ├── url/
│ │ │ │ └── url.go
│ │ │ └── vmware/
│ │ │ ├── vmware.go
│ │ │ ├── vmware_amd64.go
│ │ │ ├── vmware_test.go
│ │ │ └── vmware_unsupported.go
│ │ ├── initialize/
│ │ │ ├── env.go
│ │ │ ├── env_test.go
│ │ │ ├── github.go
│ │ │ ├── ssh_keys.go
│ │ │ ├── ssh_keys_test.go
│ │ │ ├── user_data.go
│ │ │ ├── user_data_test.go
│ │ │ └── workspace.go
│ │ ├── network/
│ │ │ ├── debian.go
│ │ │ ├── debian_test.go
│ │ │ ├── interface.go
│ │ │ ├── interface_test.go
│ │ │ ├── is_go15_false_test.go
│ │ │ ├── is_go15_true_test.go
│ │ │ ├── packet.go
│ │ │ ├── stanza.go
│ │ │ ├── stanza_test.go
│ │ │ ├── vmware.go
│ │ │ └── vmware_test.go
│ │ ├── pkg/
│ │ │ ├── http_client.go
│ │ │ └── http_client_test.go
│ │ ├── system/
│ │ │ ├── env.go
│ │ │ ├── env_file.go
│ │ │ ├── env_file_test.go
│ │ │ ├── env_test.go
│ │ │ ├── etc_hosts.go
│ │ │ ├── etc_hosts_test.go
│ │ │ ├── etcd.go
│ │ │ ├── etcd2.go
│ │ │ ├── etcd_test.go
│ │ │ ├── file.go
│ │ │ ├── file_test.go
│ │ │ ├── flannel.go
│ │ │ ├── flannel_test.go
│ │ │ ├── fleet.go
│ │ │ ├── fleet_test.go
│ │ │ ├── locksmith.go
│ │ │ ├── locksmith_test.go
│ │ │ ├── oem.go
│ │ │ ├── oem_test.go
│ │ │ ├── ssh_key.go
│ │ │ ├── unit.go
│ │ │ ├── unit_test.go
│ │ │ ├── update.go
│ │ │ ├── update_test.go
│ │ │ └── user.go
│ │ ├── test
│ │ ├── units/
│ │ │ ├── 90-configdrive.rules
│ │ │ ├── 90-ovfenv.rules
│ │ │ ├── media-configdrive.mount
│ │ │ ├── media-configvirtfs.mount
│ │ │ ├── media-ovfenv.mount
│ │ │ ├── system-cloudinit@.service
│ │ │ ├── system-config.target
│ │ │ ├── user-cloudinit-proc-cmdline.service
│ │ │ ├── user-cloudinit@.path
│ │ │ ├── user-cloudinit@.service
│ │ │ ├── user-config-ovfenv.service
│ │ │ ├── user-config.target
│ │ │ ├── user-configdrive.service
│ │ │ └── user-configvirtfs.service
│ │ └── vendor.manifest
│ ├── cmdline/
│ │ └── cmdline.go
│ ├── config.go
│ ├── config_test.go
│ ├── data_funcs.go
│ ├── disk.go
│ ├── docker_config.go
│ ├── docker_config_test.go
│ ├── metadata_test.go
│ ├── schema.go
│ ├── types.go
│ ├── validate.go
│ ├── validate_test.go
│ └── yaml/
│ └── command.go
├── images/
│ ├── 00-rootfs/
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ └── prebuild.sh
│ ├── 01-base/
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── etc/
│ │ │ ├── dhcpcd.conf.tpl
│ │ │ ├── dhcpcd.enter-hook
│ │ │ ├── inputrc
│ │ │ └── wpa_supplicant.conf.tpl
│ │ └── usr/
│ │ ├── bin/
│ │ │ ├── growpart
│ │ │ └── start_ntp.sh
│ │ ├── lib/
│ │ │ ├── dhcpcd/
│ │ │ │ ├── dhcpcd-hooks/
│ │ │ │ │ └── 10-mtu
│ │ │ │ └── dhcpcd-run-hooks
│ │ │ └── udev/
│ │ │ └── rules-extras.d/
│ │ │ ├── 50-firmware.rules
│ │ │ ├── 70-uaccess.rules
│ │ │ ├── 73-special-net-names.rules
│ │ │ ├── 73-usb-net-by-mac.rules
│ │ │ ├── 77-mm-cinterion-port-types.rules
│ │ │ ├── 77-mm-dell-port-types.rules
│ │ │ ├── 77-mm-ericsson-mbm.rules
│ │ │ ├── 77-mm-haier-port-types.rules
│ │ │ ├── 77-mm-huawei-net-port-types.rules
│ │ │ ├── 77-mm-longcheer-port-types.rules
│ │ │ ├── 77-mm-mtk-port-types.rules
│ │ │ ├── 77-mm-nokia-port-types.rules
│ │ │ ├── 77-mm-pcmcia-device-blacklist.rules
│ │ │ ├── 77-mm-platform-serial-whitelist.rules
│ │ │ ├── 77-mm-qdl-device-blacklist.rules
│ │ │ ├── 77-mm-simtech-port-types.rules
│ │ │ ├── 77-mm-telit-port-types.rules
│ │ │ ├── 77-mm-usb-device-blacklist.rules
│ │ │ ├── 77-mm-usb-serial-adapters-greylist.rules
│ │ │ ├── 77-mm-x22x-port-types.rules
│ │ │ ├── 77-mm-zte-port-types.rules
│ │ │ └── 80-mm-candidate.rules
│ │ └── share/
│ │ └── logrotate/
│ │ └── logrotate.d/
│ │ └── dhcpcd.debug
│ ├── 02-acpid/
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ └── etc/
│ │ └── acpi/
│ │ ├── events/
│ │ │ └── lid
│ │ └── suspend.sh
│ ├── 02-bootstrap/
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── od-1m0
│ │ └── usr/
│ │ └── sbin/
│ │ └── auto-format.sh
│ ├── 02-console/
│ │ ├── Dockerfile
│ │ ├── iscsid.conf
│ │ ├── prebuild.sh
│ │ └── sshd_config.append.tpl
│ ├── 02-logrotate/
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── etc/
│ │ │ └── logrotate.conf
│ │ └── usr/
│ │ ├── bin/
│ │ │ └── entrypoint.sh
│ │ └── share/
│ │ └── logrotate/
│ │ └── logrotate.d/
│ │ └── docker
│ └── 02-syslog/
│ ├── .dockerignore
│ ├── Dockerfile
│ └── usr/
│ ├── bin/
│ │ └── entrypoint.sh
│ └── share/
│ └── logrotate/
│ └── logrotate.d/
│ └── syslog
├── main.go
├── os-config.tpl.yml
├── pkg/
│ ├── compose/
│ │ ├── project.go
│ │ └── reload.go
│ ├── dfs/
│ │ └── scratch.go
│ ├── docker/
│ │ ├── auth.go
│ │ ├── client.go
│ │ ├── client_factory.go
│ │ ├── env.go
│ │ ├── service.go
│ │ ├── service_factory.go
│ │ └── util.go
│ ├── hostname/
│ │ └── hostname.go
│ ├── init/
│ │ ├── b2d/
│ │ │ └── b2d.go
│ │ ├── bootstrap/
│ │ │ └── bootstrap.go
│ │ ├── cloudinit/
│ │ │ └── cloudinit.go
│ │ ├── configfiles/
│ │ │ └── configfiles.go
│ │ ├── debug/
│ │ │ └── debug.go
│ │ ├── docker/
│ │ │ └── docker.go
│ │ ├── env/
│ │ │ └── env.go
│ │ ├── fsmount/
│ │ │ └── fsmount.go
│ │ ├── hypervisor/
│ │ │ └── hypervisor.go
│ │ ├── modules/
│ │ │ └── modules.go
│ │ ├── one/
│ │ │ └── one.go
│ │ ├── prepare/
│ │ │ └── prepare.go
│ │ ├── recovery/
│ │ │ └── recovery.go
│ │ ├── sharedroot/
│ │ │ └── sharedroot.go
│ │ └── switchroot/
│ │ └── switchroot.go
│ ├── log/
│ │ ├── log.go
│ │ └── showuserlog.go
│ ├── netconf/
│ │ ├── bonding.go
│ │ ├── bridge.go
│ │ ├── ipv4ll_linux.go
│ │ ├── netconf_linux.go
│ │ ├── netconf_linux_test.go
│ │ ├── types.go
│ │ └── vlan.go
│ ├── sysinit/
│ │ └── sysinit.go
│ └── util/
│ ├── backoff.go
│ ├── cutil.go
│ ├── network/
│ │ ├── cache.go
│ │ ├── network.go
│ │ ├── network_test.go
│ │ └── route.go
│ ├── term.go
│ ├── util.go
│ ├── util_linux.go
│ ├── util_test.go
│ └── versions/
│ ├── compare.go
│ └── compare_test.go
├── scripts/
│ ├── build
│ ├── build-host
│ ├── build-images
│ ├── build-moby
│ ├── build-target
│ ├── checksums
│ ├── ci
│ ├── clean
│ ├── copy-latest.sh
│ ├── copy-release.sh
│ ├── create-installed
│ ├── default
│ ├── dev
│ ├── entry
│ ├── global.cfg
│ ├── hash-initrd
│ ├── help
│ ├── hosting/
│ │ ├── burmillaos.ipxe
│ │ ├── digitalocean/
│ │ │ ├── cloud-config.yml
│ │ │ ├── fedora-symbiote.yml
│ │ │ └── host.sh
│ │ └── packet/
│ │ ├── packet.sh
│ │ ├── test.expect
│ │ └── test.sh
│ ├── images/
│ │ └── raspberry-pi-hypriot64/
│ │ ├── .dockerignore
│ │ ├── .gitignore
│ │ ├── README.md
│ │ └── scripts/
│ │ └── build.sh
│ ├── inline_schema.go
│ ├── installer/
│ │ ├── BaseDockerfile.amd64
│ │ ├── BaseDockerfile.arm64
│ │ ├── Dockerfile.amd64
│ │ ├── Dockerfile.arm64
│ │ ├── README.md
│ │ ├── cache-services.sh
│ │ ├── conf/
│ │ │ ├── cloud-config-local.yml
│ │ │ ├── empty.yml
│ │ │ └── vagrant.yml
│ │ └── kexec/
│ │ └── Dockerfile.dapper
│ ├── isolinux.cfg
│ ├── isolinux_label.cfg
│ ├── layout
│ ├── layout-initrd
│ ├── layout-kernel
│ ├── moby/
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ └── rancheros.yml
│ ├── package
│ ├── package-initrd
│ ├── package-installer
│ ├── package-iso
│ ├── package-rootfs
│ ├── prepare
│ ├── release
│ ├── release-4glte
│ ├── release-amd64
│ ├── release-arm64
│ ├── release-build
│ ├── release-rpi64
│ ├── ros
│ ├── run
│ ├── run-common
│ ├── run-install
│ ├── run-moby
│ ├── schema.json
│ ├── schema_template
│ ├── shell
│ ├── ssh
│ ├── tar-images
│ ├── template
│ ├── test
│ ├── tools/
│ │ ├── collect_rancheros_info.sh
│ │ ├── flush_crt_iso.sh
│ │ └── flush_crt_nbd.sh
│ ├── validate
│ └── version
├── trash.conf
└── vendor/
├── github.com/
│ ├── Microsoft/
│ │ └── go-winio/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── backup.go
│ │ ├── file.go
│ │ ├── fileinfo.go
│ │ ├── pipe.go
│ │ ├── privilege.go
│ │ ├── reparse.go
│ │ ├── sd.go
│ │ ├── syscall.go
│ │ └── zsyscall.go
│ ├── SvenDowideit/
│ │ └── cpuid/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── cpuid.go
│ │ ├── cpuid_386.s
│ │ ├── cpuid_amd64.s
│ │ ├── detect_intel.go
│ │ ├── detect_ref.go
│ │ ├── generate.go
│ │ └── private-gen.go
│ ├── cloudfoundry-incubator/
│ │ └── candiedyaml/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── api.go
│ │ ├── decode.go
│ │ ├── emitter.go
│ │ ├── encode.go
│ │ ├── libyaml-LICENSE
│ │ ├── parser.go
│ │ ├── reader.go
│ │ ├── resolver.go
│ │ ├── run_parser.go
│ │ ├── scanner.go
│ │ ├── tags.go
│ │ ├── writer.go
│ │ ├── yaml_definesh.go
│ │ ├── yaml_privateh.go
│ │ └── yamlh.go
│ ├── codegangsta/
│ │ └── cli/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── app.go
│ │ ├── appveyor.yml
│ │ ├── category.go
│ │ ├── cli.go
│ │ ├── command.go
│ │ ├── context.go
│ │ ├── errors.go
│ │ ├── flag.go
│ │ ├── funcs.go
│ │ ├── help.go
│ │ └── runtests
│ ├── coreos/
│ │ └── yaml/
│ │ ├── LICENSE
│ │ ├── LICENSE.libyaml
│ │ ├── README.md
│ │ ├── apic.go
│ │ ├── decode.go
│ │ ├── emitterc.go
│ │ ├── encode.go
│ │ ├── parserc.go
│ │ ├── readerc.go
│ │ ├── resolve.go
│ │ ├── scannerc.go
│ │ ├── sorter.go
│ │ ├── writerc.go
│ │ ├── yaml.go
│ │ ├── yamlh.go
│ │ └── yamlprivateh.go
│ ├── davecgh/
│ │ └── go-spew/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── cov_report.sh
│ │ ├── spew/
│ │ │ ├── bypass.go
│ │ │ ├── bypasssafe.go
│ │ │ ├── common.go
│ │ │ ├── config.go
│ │ │ ├── doc.go
│ │ │ ├── dump.go
│ │ │ ├── format.go
│ │ │ └── spew.go
│ │ └── test_coverage.txt
│ ├── docker/
│ │ ├── containerd/
│ │ │ ├── .gitignore
│ │ │ ├── CONTRIBUTING.md
│ │ │ ├── Dockerfile
│ │ │ ├── LICENSE.code
│ │ │ ├── LICENSE.docs
│ │ │ ├── MAINTAINERS
│ │ │ ├── Makefile
│ │ │ ├── NOTICE
│ │ │ ├── README.md
│ │ │ ├── osutils/
│ │ │ │ ├── fds.go
│ │ │ │ ├── prctl.go
│ │ │ │ ├── prctl_solaris.go
│ │ │ │ └── reaper.go
│ │ │ ├── subreaper/
│ │ │ │ ├── exec/
│ │ │ │ │ ├── copy.go
│ │ │ │ │ └── wrapper.go
│ │ │ │ └── reaper.go
│ │ │ └── trash.conf
│ │ ├── distribution/
│ │ │ ├── .gitignore
│ │ │ ├── .mailmap
│ │ │ ├── AUTHORS
│ │ │ ├── CONTRIBUTING.md
│ │ │ ├── Dockerfile
│ │ │ ├── LICENSE
│ │ │ ├── MAINTAINERS
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── ROADMAP.md
│ │ │ ├── blobs.go
│ │ │ ├── circle.yml
│ │ │ ├── context/
│ │ │ │ ├── context.go
│ │ │ │ ├── doc.go
│ │ │ │ ├── http.go
│ │ │ │ ├── logger.go
│ │ │ │ ├── trace.go
│ │ │ │ ├── util.go
│ │ │ │ └── version.go
│ │ │ ├── coverpkg.sh
│ │ │ ├── digest/
│ │ │ │ ├── digest.go
│ │ │ │ ├── digester.go
│ │ │ │ ├── doc.go
│ │ │ │ ├── set.go
│ │ │ │ └── verifiers.go
│ │ │ ├── doc.go
│ │ │ ├── errors.go
│ │ │ ├── manifests.go
│ │ │ ├── reference/
│ │ │ │ ├── reference.go
│ │ │ │ └── regexp.go
│ │ │ ├── registry/
│ │ │ │ ├── api/
│ │ │ │ │ ├── errcode/
│ │ │ │ │ │ ├── errors.go
│ │ │ │ │ │ ├── handler.go
│ │ │ │ │ │ └── register.go
│ │ │ │ │ └── v2/
│ │ │ │ │ ├── descriptors.go
│ │ │ │ │ ├── doc.go
│ │ │ │ │ ├── errors.go
│ │ │ │ │ ├── routes.go
│ │ │ │ │ └── urls.go
│ │ │ │ ├── client/
│ │ │ │ │ ├── auth/
│ │ │ │ │ │ ├── api_version.go
│ │ │ │ │ │ ├── authchallenge.go
│ │ │ │ │ │ └── session.go
│ │ │ │ │ ├── blob_writer.go
│ │ │ │ │ ├── errors.go
│ │ │ │ │ ├── repository.go
│ │ │ │ │ └── transport/
│ │ │ │ │ ├── http_reader.go
│ │ │ │ │ └── transport.go
│ │ │ │ └── storage/
│ │ │ │ └── cache/
│ │ │ │ ├── cache.go
│ │ │ │ ├── cachedblobdescriptorstore.go
│ │ │ │ └── memory/
│ │ │ │ └── memory.go
│ │ │ ├── registry.go
│ │ │ ├── tags.go
│ │ │ └── uuid/
│ │ │ └── uuid.go
│ │ ├── docker/
│ │ │ ├── .dockerignore
│ │ │ ├── .gitignore
│ │ │ ├── Dockerfile.dapper
│ │ │ ├── LICENSE
│ │ │ ├── Makefile
│ │ │ ├── NOTICE
│ │ │ ├── builder/
│ │ │ │ ├── builder.go
│ │ │ │ ├── context.go
│ │ │ │ ├── context_unix.go
│ │ │ │ ├── dockerignore/
│ │ │ │ │ └── dockerignore.go
│ │ │ │ ├── dockerignore.go
│ │ │ │ ├── git.go
│ │ │ │ ├── remote.go
│ │ │ │ └── tarsum.go
│ │ │ ├── cliconfig/
│ │ │ │ └── config.go
│ │ │ ├── daemon/
│ │ │ │ └── graphdriver/
│ │ │ │ ├── counter.go
│ │ │ │ ├── driver.go
│ │ │ │ ├── driver_freebsd.go
│ │ │ │ ├── driver_linux.go
│ │ │ │ ├── driver_unsupported.go
│ │ │ │ ├── fsdiff.go
│ │ │ │ ├── plugin.go
│ │ │ │ ├── plugin_unsupported.go
│ │ │ │ └── proxy.go
│ │ │ ├── image/
│ │ │ │ ├── fs.go
│ │ │ │ ├── image.go
│ │ │ │ ├── rootfs.go
│ │ │ │ ├── rootfs_unix.go
│ │ │ │ ├── store.go
│ │ │ │ └── v1/
│ │ │ │ └── imagev1.go
│ │ │ ├── layer/
│ │ │ │ ├── empty.go
│ │ │ │ ├── filestore.go
│ │ │ │ ├── layer.go
│ │ │ │ ├── layer_store.go
│ │ │ │ ├── layer_unix.go
│ │ │ │ ├── migration.go
│ │ │ │ ├── mounted_layer.go
│ │ │ │ └── ro_layer.go
│ │ │ ├── opts/
│ │ │ │ ├── hosts.go
│ │ │ │ ├── hosts_unix.go
│ │ │ │ ├── ip.go
│ │ │ │ ├── opts.go
│ │ │ │ └── opts_unix.go
│ │ │ ├── pkg/
│ │ │ │ ├── README.md
│ │ │ │ ├── archive/
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── archive.go
│ │ │ │ │ ├── archive_unix.go
│ │ │ │ │ ├── changes.go
│ │ │ │ │ ├── changes_linux.go
│ │ │ │ │ ├── changes_other.go
│ │ │ │ │ ├── changes_unix.go
│ │ │ │ │ ├── copy.go
│ │ │ │ │ ├── copy_unix.go
│ │ │ │ │ ├── diff.go
│ │ │ │ │ ├── example_changes.go
│ │ │ │ │ ├── time_linux.go
│ │ │ │ │ ├── time_unsupported.go
│ │ │ │ │ ├── whiteouts.go
│ │ │ │ │ └── wrap.go
│ │ │ │ ├── chrootarchive/
│ │ │ │ │ ├── archive.go
│ │ │ │ │ ├── archive_unix.go
│ │ │ │ │ ├── diff.go
│ │ │ │ │ ├── diff_unix.go
│ │ │ │ │ └── init_unix.go
│ │ │ │ ├── fileutils/
│ │ │ │ │ ├── fileutils.go
│ │ │ │ │ └── fileutils_unix.go
│ │ │ │ ├── gitutils/
│ │ │ │ │ └── gitutils.go
│ │ │ │ ├── homedir/
│ │ │ │ │ └── homedir.go
│ │ │ │ ├── httputils/
│ │ │ │ │ ├── httputils.go
│ │ │ │ │ ├── mimetype.go
│ │ │ │ │ └── resumablerequestreader.go
│ │ │ │ ├── idtools/
│ │ │ │ │ ├── idtools.go
│ │ │ │ │ ├── idtools_unix.go
│ │ │ │ │ ├── usergroupadd_linux.go
│ │ │ │ │ └── usergroupadd_unsupported.go
│ │ │ │ ├── ioutils/
│ │ │ │ │ ├── bytespipe.go
│ │ │ │ │ ├── fmt.go
│ │ │ │ │ ├── multireader.go
│ │ │ │ │ ├── readers.go
│ │ │ │ │ ├── scheduler.go
│ │ │ │ │ ├── scheduler_gccgo.go
│ │ │ │ │ ├── temp_unix.go
│ │ │ │ │ ├── writeflusher.go
│ │ │ │ │ └── writers.go
│ │ │ │ ├── jsonlog/
│ │ │ │ │ ├── jsonlog.go
│ │ │ │ │ ├── jsonlog_marshalling.go
│ │ │ │ │ ├── jsonlogbytes.go
│ │ │ │ │ └── time_marshalling.go
│ │ │ │ ├── jsonmessage/
│ │ │ │ │ └── jsonmessage.go
│ │ │ │ ├── mflag/
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── README.md
│ │ │ │ │ └── flag.go
│ │ │ │ ├── mount/
│ │ │ │ │ ├── flags.go
│ │ │ │ │ ├── flags_freebsd.go
│ │ │ │ │ ├── flags_linux.go
│ │ │ │ │ ├── flags_unsupported.go
│ │ │ │ │ ├── mount.go
│ │ │ │ │ ├── mounter_freebsd.go
│ │ │ │ │ ├── mounter_linux.go
│ │ │ │ │ ├── mounter_unsupported.go
│ │ │ │ │ ├── mountinfo.go
│ │ │ │ │ ├── mountinfo_freebsd.go
│ │ │ │ │ ├── mountinfo_linux.go
│ │ │ │ │ ├── mountinfo_unsupported.go
│ │ │ │ │ └── sharedsubtree_linux.go
│ │ │ │ ├── plugins/
│ │ │ │ │ ├── client.go
│ │ │ │ │ ├── discovery.go
│ │ │ │ │ ├── errors.go
│ │ │ │ │ ├── plugins.go
│ │ │ │ │ └── transport/
│ │ │ │ │ ├── http.go
│ │ │ │ │ └── transport.go
│ │ │ │ ├── pools/
│ │ │ │ │ └── pools.go
│ │ │ │ ├── progress/
│ │ │ │ │ ├── progress.go
│ │ │ │ │ └── progressreader.go
│ │ │ │ ├── promise/
│ │ │ │ │ └── promise.go
│ │ │ │ ├── random/
│ │ │ │ │ └── random.go
│ │ │ │ ├── reexec/
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── command_freebsd.go
│ │ │ │ │ ├── command_linux.go
│ │ │ │ │ ├── command_unsupported.go
│ │ │ │ │ └── reexec.go
│ │ │ │ ├── signal/
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── signal.go
│ │ │ │ │ ├── signal_darwin.go
│ │ │ │ │ ├── signal_freebsd.go
│ │ │ │ │ ├── signal_linux.go
│ │ │ │ │ ├── signal_unix.go
│ │ │ │ │ ├── signal_unsupported.go
│ │ │ │ │ └── trap.go
│ │ │ │ ├── stdcopy/
│ │ │ │ │ └── stdcopy.go
│ │ │ │ ├── streamformatter/
│ │ │ │ │ └── streamformatter.go
│ │ │ │ ├── stringid/
│ │ │ │ │ ├── README.md
│ │ │ │ │ └── stringid.go
│ │ │ │ ├── symlink/
│ │ │ │ │ ├── LICENSE.APACHE
│ │ │ │ │ ├── LICENSE.BSD
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── fs.go
│ │ │ │ │ └── fs_unix.go
│ │ │ │ ├── system/
│ │ │ │ │ ├── chtimes.go
│ │ │ │ │ ├── chtimes_unix.go
│ │ │ │ │ ├── errors.go
│ │ │ │ │ ├── filesys.go
│ │ │ │ │ ├── lstat.go
│ │ │ │ │ ├── meminfo.go
│ │ │ │ │ ├── meminfo_linux.go
│ │ │ │ │ ├── meminfo_unsupported.go
│ │ │ │ │ ├── mknod.go
│ │ │ │ │ ├── path_unix.go
│ │ │ │ │ ├── stat.go
│ │ │ │ │ ├── stat_freebsd.go
│ │ │ │ │ ├── stat_linux.go
│ │ │ │ │ ├── stat_openbsd.go
│ │ │ │ │ ├── stat_solaris.go
│ │ │ │ │ ├── stat_unsupported.go
│ │ │ │ │ ├── syscall_unix.go
│ │ │ │ │ ├── umask.go
│ │ │ │ │ ├── utimes_darwin.go
│ │ │ │ │ ├── utimes_freebsd.go
│ │ │ │ │ ├── utimes_linux.go
│ │ │ │ │ ├── utimes_unsupported.go
│ │ │ │ │ ├── xattrs_linux.go
│ │ │ │ │ └── xattrs_unsupported.go
│ │ │ │ ├── tarsum/
│ │ │ │ │ ├── builder_context.go
│ │ │ │ │ ├── fileinfosums.go
│ │ │ │ │ ├── tarsum.go
│ │ │ │ │ ├── tarsum_spec.md
│ │ │ │ │ ├── versioning.go
│ │ │ │ │ └── writercloser.go
│ │ │ │ ├── term/
│ │ │ │ │ ├── ascii.go
│ │ │ │ │ ├── tc_linux_cgo.go
│ │ │ │ │ ├── tc_other.go
│ │ │ │ │ ├── term.go
│ │ │ │ │ ├── termios_darwin.go
│ │ │ │ │ ├── termios_freebsd.go
│ │ │ │ │ ├── termios_linux.go
│ │ │ │ │ └── termios_openbsd.go
│ │ │ │ ├── urlutil/
│ │ │ │ │ └── urlutil.go
│ │ │ │ └── version/
│ │ │ │ └── version.go
│ │ │ ├── reference/
│ │ │ │ ├── reference.go
│ │ │ │ └── store.go
│ │ │ ├── registry/
│ │ │ │ ├── auth.go
│ │ │ │ ├── config.go
│ │ │ │ ├── config_unix.go
│ │ │ │ ├── endpoint_v1.go
│ │ │ │ ├── reference.go
│ │ │ │ ├── registry.go
│ │ │ │ ├── service.go
│ │ │ │ ├── service_v1.go
│ │ │ │ ├── service_v2.go
│ │ │ │ ├── session.go
│ │ │ │ └── types.go
│ │ │ ├── runconfig/
│ │ │ │ └── opts/
│ │ │ │ ├── envfile.go
│ │ │ │ ├── opts.go
│ │ │ │ ├── parse.go
│ │ │ │ ├── throttledevice.go
│ │ │ │ ├── ulimit.go
│ │ │ │ └── weightdevice.go
│ │ │ └── trash.conf
│ │ ├── engine-api/
│ │ │ ├── .travis.yml
│ │ │ ├── CHANGELOG.md
│ │ │ ├── CONTRIBUTING.md
│ │ │ ├── LICENSE
│ │ │ ├── MAINTAINERS
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── appveyor.yml
│ │ │ ├── client/
│ │ │ │ ├── client.go
│ │ │ │ ├── client_darwin.go
│ │ │ │ ├── client_unix.go
│ │ │ │ ├── client_windows.go
│ │ │ │ ├── container_attach.go
│ │ │ │ ├── container_commit.go
│ │ │ │ ├── container_copy.go
│ │ │ │ ├── container_create.go
│ │ │ │ ├── container_diff.go
│ │ │ │ ├── container_exec.go
│ │ │ │ ├── container_export.go
│ │ │ │ ├── container_inspect.go
│ │ │ │ ├── container_kill.go
│ │ │ │ ├── container_list.go
│ │ │ │ ├── container_logs.go
│ │ │ │ ├── container_pause.go
│ │ │ │ ├── container_remove.go
│ │ │ │ ├── container_rename.go
│ │ │ │ ├── container_resize.go
│ │ │ │ ├── container_restart.go
│ │ │ │ ├── container_start.go
│ │ │ │ ├── container_stats.go
│ │ │ │ ├── container_stop.go
│ │ │ │ ├── container_top.go
│ │ │ │ ├── container_unpause.go
│ │ │ │ ├── container_update.go
│ │ │ │ ├── container_wait.go
│ │ │ │ ├── errors.go
│ │ │ │ ├── events.go
│ │ │ │ ├── hijack.go
│ │ │ │ ├── image_build.go
│ │ │ │ ├── image_create.go
│ │ │ │ ├── image_history.go
│ │ │ │ ├── image_import.go
│ │ │ │ ├── image_inspect.go
│ │ │ │ ├── image_list.go
│ │ │ │ ├── image_load.go
│ │ │ │ ├── image_pull.go
│ │ │ │ ├── image_push.go
│ │ │ │ ├── image_remove.go
│ │ │ │ ├── image_save.go
│ │ │ │ ├── image_search.go
│ │ │ │ ├── image_tag.go
│ │ │ │ ├── info.go
│ │ │ │ ├── interface.go
│ │ │ │ ├── login.go
│ │ │ │ ├── network_connect.go
│ │ │ │ ├── network_create.go
│ │ │ │ ├── network_disconnect.go
│ │ │ │ ├── network_inspect.go
│ │ │ │ ├── network_list.go
│ │ │ │ ├── network_remove.go
│ │ │ │ ├── privileged.go
│ │ │ │ ├── request.go
│ │ │ │ ├── transport/
│ │ │ │ │ ├── cancellable/
│ │ │ │ │ │ ├── canceler.go
│ │ │ │ │ │ ├── canceler_go14.go
│ │ │ │ │ │ └── cancellable.go
│ │ │ │ │ ├── client.go
│ │ │ │ │ └── transport.go
│ │ │ │ ├── version.go
│ │ │ │ ├── volume_create.go
│ │ │ │ ├── volume_inspect.go
│ │ │ │ ├── volume_list.go
│ │ │ │ └── volume_remove.go
│ │ │ └── types/
│ │ │ ├── auth.go
│ │ │ ├── blkiodev/
│ │ │ │ └── blkio.go
│ │ │ ├── client.go
│ │ │ ├── configs.go
│ │ │ ├── container/
│ │ │ │ ├── config.go
│ │ │ │ ├── host_config.go
│ │ │ │ ├── hostconfig_unix.go
│ │ │ │ └── hostconfig_windows.go
│ │ │ ├── filters/
│ │ │ │ └── parse.go
│ │ │ ├── network/
│ │ │ │ └── network.go
│ │ │ ├── registry/
│ │ │ │ └── registry.go
│ │ │ ├── seccomp.go
│ │ │ ├── stats.go
│ │ │ ├── strslice/
│ │ │ │ └── strslice.go
│ │ │ ├── time/
│ │ │ │ └── timestamp.go
│ │ │ └── types.go
│ │ ├── go-connections/
│ │ │ ├── CONTRIBUTING.md
│ │ │ ├── LICENSE
│ │ │ ├── MAINTAINERS
│ │ │ ├── README.md
│ │ │ ├── circle.yml
│ │ │ ├── nat/
│ │ │ │ ├── nat.go
│ │ │ │ ├── parse.go
│ │ │ │ └── sort.go
│ │ │ ├── sockets/
│ │ │ │ ├── README.md
│ │ │ │ ├── inmem_socket.go
│ │ │ │ ├── proxy.go
│ │ │ │ ├── sockets.go
│ │ │ │ ├── sockets_unix.go
│ │ │ │ ├── sockets_windows.go
│ │ │ │ ├── tcp_socket.go
│ │ │ │ └── unix_socket.go
│ │ │ └── tlsconfig/
│ │ │ ├── config.go
│ │ │ ├── config_client_ciphers.go
│ │ │ └── config_legacy_client_ciphers.go
│ │ ├── go-units/
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── circle.yml
│ │ │ ├── duration.go
│ │ │ ├── size.go
│ │ │ └── ulimit.go
│ │ ├── libcompose/
│ │ │ ├── .dockerignore
│ │ │ ├── .gitignore
│ │ │ ├── CHANGELOG.md
│ │ │ ├── CONTRIBUTING.md
│ │ │ ├── Dockerfile
│ │ │ ├── Jenkinsfile
│ │ │ ├── LICENSE
│ │ │ ├── MAINTAINERS
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── cli/
│ │ │ │ ├── app/
│ │ │ │ │ ├── app.go
│ │ │ │ │ ├── types.go
│ │ │ │ │ └── version.go
│ │ │ │ ├── docker/
│ │ │ │ │ └── app/
│ │ │ │ │ ├── commands.go
│ │ │ │ │ └── factory.go
│ │ │ │ └── logger/
│ │ │ │ ├── color_logger.go
│ │ │ │ └── colors.go
│ │ │ ├── config/
│ │ │ │ ├── convert.go
│ │ │ │ ├── hash.go
│ │ │ │ ├── interpolation.go
│ │ │ │ ├── merge.go
│ │ │ │ ├── merge_v1.go
│ │ │ │ ├── merge_v2.go
│ │ │ │ ├── schema.go
│ │ │ │ ├── schema_helpers.go
│ │ │ │ ├── types.go
│ │ │ │ ├── utils.go
│ │ │ │ └── validation.go
│ │ │ ├── docker/
│ │ │ │ ├── auth.go
│ │ │ │ ├── builder/
│ │ │ │ │ └── builder.go
│ │ │ │ ├── client/
│ │ │ │ │ └── client.go
│ │ │ │ ├── container.go
│ │ │ │ ├── context.go
│ │ │ │ ├── convert.go
│ │ │ │ ├── functions.go
│ │ │ │ ├── image.go
│ │ │ │ ├── name.go
│ │ │ │ ├── project.go
│ │ │ │ ├── service.go
│ │ │ │ └── service_factory.go
│ │ │ ├── labels/
│ │ │ │ └── labels.go
│ │ │ ├── logger/
│ │ │ │ ├── null.go
│ │ │ │ └── types.go
│ │ │ ├── lookup/
│ │ │ │ ├── composable.go
│ │ │ │ ├── envfile.go
│ │ │ │ ├── file.go
│ │ │ │ └── simple_env.go
│ │ │ ├── project/
│ │ │ │ ├── client_factory.go
│ │ │ │ ├── container.go
│ │ │ │ ├── context.go
│ │ │ │ ├── empty.go
│ │ │ │ ├── events/
│ │ │ │ │ └── events.go
│ │ │ │ ├── info.go
│ │ │ │ ├── interface.go
│ │ │ │ ├── listener.go
│ │ │ │ ├── options/
│ │ │ │ │ └── types.go
│ │ │ │ ├── project.go
│ │ │ │ ├── service-wrapper.go
│ │ │ │ ├── service.go
│ │ │ │ └── utils.go
│ │ │ ├── utils/
│ │ │ │ └── util.go
│ │ │ ├── version/
│ │ │ │ └── version.go
│ │ │ └── yaml/
│ │ │ └── types_yaml.go
│ │ ├── libnetwork/
│ │ │ ├── .dockerignore
│ │ │ ├── .gitignore
│ │ │ ├── CHANGELOG.md
│ │ │ ├── Dockerfile.build
│ │ │ ├── LICENSE
│ │ │ ├── MAINTAINERS
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── ROADMAP.md
│ │ │ ├── Vagrantfile
│ │ │ ├── circle.yml
│ │ │ ├── machines
│ │ │ ├── resolvconf/
│ │ │ │ ├── README.md
│ │ │ │ ├── dns/
│ │ │ │ │ └── resolvconf.go
│ │ │ │ └── resolvconf.go
│ │ │ └── wrapmake.sh
│ │ └── machine/
│ │ ├── .dockerignore
│ │ ├── .gitignore
│ │ ├── .godir
│ │ ├── .travis.yml
│ │ ├── CHANGELOG.md
│ │ ├── CONTRIBUTING.md
│ │ ├── Dockerfile
│ │ ├── LICENSE
│ │ ├── MAINTAINERS
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── ROADMAP.md
│ │ ├── log/
│ │ │ ├── log.go
│ │ │ └── terminal.go
│ │ └── utils/
│ │ ├── b2d.go
│ │ ├── certs.go
│ │ └── utils.go
│ ├── fatih/
│ │ └── structs/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── field.go
│ │ ├── structs.go
│ │ └── tags.go
│ ├── flynn/
│ │ └── go-shlex/
│ │ ├── COPYING
│ │ ├── Makefile
│ │ ├── README.md
│ │ └── shlex.go
│ ├── gorilla/
│ │ ├── context/
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── context.go
│ │ │ └── doc.go
│ │ └── mux/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── mux.go
│ │ ├── regexp.go
│ │ └── route.go
│ ├── opencontainers/
│ │ └── runc/
│ │ ├── .gitignore
│ │ ├── CONTRIBUTING.md
│ │ ├── Dockerfile
│ │ ├── LICENSE
│ │ ├── MAINTAINERS
│ │ ├── MAINTAINERS_GUIDE.md
│ │ ├── Makefile
│ │ ├── NOTICE
│ │ ├── PRINCIPLES.md
│ │ ├── README.md
│ │ └── libcontainer/
│ │ ├── README.md
│ │ ├── SPEC.md
│ │ └── user/
│ │ ├── MAINTAINERS
│ │ ├── lookup.go
│ │ ├── lookup_unix.go
│ │ ├── lookup_unsupported.go
│ │ └── user.go
│ ├── packethost/
│ │ └── packngo/
│ │ ├── .drone.yml
│ │ ├── .gitignore
│ │ ├── LICENSE.txt
│ │ ├── README.md
│ │ └── metadata/
│ │ └── metadata.go
│ ├── pin/
│ │ └── tftp/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── backoff.go
│ │ ├── client.go
│ │ ├── netascii/
│ │ │ └── netascii.go
│ │ ├── packet.go
│ │ ├── receiver.go
│ │ ├── sender.go
│ │ └── server.go
│ ├── pkg/
│ │ └── errors/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── appveyor.yml
│ │ ├── errors.go
│ │ └── stack.go
│ ├── pmezard/
│ │ └── go-difflib/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── difflib/
│ │ └── difflib.go
│ ├── ryanuber/
│ │ └── go-glob/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── glob.go
│ ├── sigma/
│ │ ├── bdoor/
│ │ │ ├── LICENSE
│ │ │ ├── README
│ │ │ └── check.go
│ │ ├── vmw-guestinfo/
│ │ │ ├── CDDL.txt
│ │ │ ├── LGPL.txt
│ │ │ ├── LICENSE
│ │ │ ├── README
│ │ │ ├── rpcvmx/
│ │ │ │ └── rpcvmx.go
│ │ │ └── vmcheck/
│ │ │ ├── vmcheck.go
│ │ │ ├── vmcheck_386.s
│ │ │ ├── vmcheck_amd64.s
│ │ │ ├── vmcheck_general.go
│ │ │ └── vmcheck_linux.go
│ │ └── vmw-ovflib/
│ │ ├── LICENSE
│ │ ├── README
│ │ └── ovf.go
│ ├── stretchr/
│ │ └── testify/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENCE.txt
│ │ ├── README.md
│ │ ├── assert/
│ │ │ ├── assertions.go
│ │ │ ├── doc.go
│ │ │ ├── errors.go
│ │ │ ├── forward_assertions.go
│ │ │ └── http_assertions.go
│ │ └── require/
│ │ ├── doc.go
│ │ ├── forward_requirements.go
│ │ └── requirements.go
│ ├── tredoe/
│ │ └── term/
│ │ ├── AUTHORS.md
│ │ ├── CONTRIBUTORS.md
│ │ ├── LICENSE-MPL.txt
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── sys/
│ │ │ ├── doc.go
│ │ │ ├── key_unix.go
│ │ │ ├── sys_bsd.go
│ │ │ ├── sys_linux.go
│ │ │ ├── sys_unix.go
│ │ │ ├── z-sys_darwin_386.go
│ │ │ ├── z-sys_darwin_amd64.go
│ │ │ ├── z-sys_freebsd.go
│ │ │ ├── z-sys_linux.go
│ │ │ ├── z-sys_netbsd.go
│ │ │ └── z-sys_openbsd.go
│ │ ├── term.go
│ │ ├── term_unix.go
│ │ └── util_unix.go
│ ├── vbatts/
│ │ └── tar-split/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── archive/
│ │ │ └── tar/
│ │ │ ├── common.go
│ │ │ ├── reader.go
│ │ │ ├── stat_atim.go
│ │ │ ├── stat_atimespec.go
│ │ │ ├── stat_unix.go
│ │ │ └── writer.go
│ │ └── tar/
│ │ ├── asm/
│ │ │ ├── README.md
│ │ │ ├── assemble.go
│ │ │ ├── disassemble.go
│ │ │ └── doc.go
│ │ └── storage/
│ │ ├── doc.go
│ │ ├── entry.go
│ │ ├── getter.go
│ │ └── packer.go
│ ├── vishvananda/
│ │ ├── netlink/
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── addr.go
│ │ │ ├── addr_linux.go
│ │ │ ├── bpf_linux.go
│ │ │ ├── bridge_linux.go
│ │ │ ├── class.go
│ │ │ ├── class_linux.go
│ │ │ ├── conntrack_linux.go
│ │ │ ├── conntrack_unspecified.go
│ │ │ ├── filter.go
│ │ │ ├── filter_linux.go
│ │ │ ├── genetlink_linux.go
│ │ │ ├── genetlink_unspecified.go
│ │ │ ├── gtp_linux.go
│ │ │ ├── handle_linux.go
│ │ │ ├── handle_unspecified.go
│ │ │ ├── link.go
│ │ │ ├── link_linux.go
│ │ │ ├── link_tuntap_linux.go
│ │ │ ├── neigh.go
│ │ │ ├── neigh_linux.go
│ │ │ ├── netlink.go
│ │ │ ├── netlink_linux.go
│ │ │ ├── netlink_unspecified.go
│ │ │ ├── nl/
│ │ │ │ ├── addr_linux.go
│ │ │ │ ├── bridge_linux.go
│ │ │ │ ├── conntrack_linux.go
│ │ │ │ ├── genetlink_linux.go
│ │ │ │ ├── link_linux.go
│ │ │ │ ├── mpls_linux.go
│ │ │ │ ├── nl_linux.go
│ │ │ │ ├── nl_unspecified.go
│ │ │ │ ├── route_linux.go
│ │ │ │ ├── syscall.go
│ │ │ │ ├── tc_linux.go
│ │ │ │ ├── xfrm_linux.go
│ │ │ │ ├── xfrm_monitor_linux.go
│ │ │ │ ├── xfrm_policy_linux.go
│ │ │ │ └── xfrm_state_linux.go
│ │ │ ├── order.go
│ │ │ ├── protinfo.go
│ │ │ ├── protinfo_linux.go
│ │ │ ├── qdisc.go
│ │ │ ├── qdisc_linux.go
│ │ │ ├── route.go
│ │ │ ├── route_linux.go
│ │ │ ├── route_unspecified.go
│ │ │ ├── rule.go
│ │ │ ├── rule_linux.go
│ │ │ ├── socket.go
│ │ │ ├── socket_linux.go
│ │ │ ├── xfrm.go
│ │ │ ├── xfrm_monitor_linux.go
│ │ │ ├── xfrm_policy.go
│ │ │ ├── xfrm_policy_linux.go
│ │ │ ├── xfrm_state.go
│ │ │ └── xfrm_state_linux.go
│ │ └── netns/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── netns.go
│ │ ├── netns_linux.go
│ │ └── netns_unspecified.go
│ ├── vmware/
│ │ └── vmw-guestinfo/
│ │ ├── LICENSE
│ │ ├── README
│ │ ├── bdoor/
│ │ │ ├── bdoor.go
│ │ │ ├── bdoor_386.go
│ │ │ ├── bdoor_386.s
│ │ │ ├── bdoor_amd64.go
│ │ │ ├── bdoor_amd64.s
│ │ │ └── word.go
│ │ ├── go.mod
│ │ ├── message/
│ │ │ ├── log.go
│ │ │ └── message.go
│ │ └── rpcout/
│ │ └── rpcout.go
│ └── xeipuuv/
│ ├── gojsonpointer/
│ │ ├── LICENSE-APACHE-2.0.txt
│ │ ├── README.md
│ │ └── pointer.go
│ ├── gojsonreference/
│ │ ├── LICENSE-APACHE-2.0.txt
│ │ ├── README.md
│ │ └── reference.go
│ └── gojsonschema/
│ ├── .gitignore
│ ├── .travis.yml
│ ├── LICENSE-APACHE-2.0.txt
│ ├── README.md
│ ├── errors.go
│ ├── format_checkers.go
│ ├── glide.yaml
│ ├── internalLog.go
│ ├── jsonContext.go
│ ├── jsonLoader.go
│ ├── locales.go
│ ├── result.go
│ ├── schema.go
│ ├── schemaPool.go
│ ├── schemaReferencePool.go
│ ├── schemaType.go
│ ├── subSchema.go
│ ├── types.go
│ ├── utils.go
│ └── validation.go
└── golang.org/
└── x/
├── crypto/
│ ├── .gitattributes
│ ├── .gitignore
│ ├── AUTHORS
│ ├── CONTRIBUTING.md
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ ├── README
│ ├── codereview.cfg
│ └── ssh/
│ └── terminal/
│ ├── terminal.go
│ ├── util.go
│ ├── util_bsd.go
│ ├── util_linux.go
│ └── util_windows.go
├── net/
│ ├── .gitattributes
│ ├── .gitignore
│ ├── AUTHORS
│ ├── CONTRIBUTING.md
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ ├── README.md
│ ├── codereview.cfg
│ ├── context/
│ │ ├── context.go
│ │ ├── go17.go
│ │ ├── go19.go
│ │ ├── pre_go17.go
│ │ └── pre_go19.go
│ ├── go.mod
│ ├── go.sum
│ ├── internal/
│ │ └── socks/
│ │ ├── client.go
│ │ └── socks.go
│ └── proxy/
│ ├── dial.go
│ ├── direct.go
│ ├── per_host.go
│ ├── proxy.go
│ └── socks5.go
└── sys/
├── .gitattributes
├── .gitignore
├── AUTHORS
├── CONTRIBUTING.md
├── CONTRIBUTORS
├── LICENSE
├── PATENTS
├── README.md
├── codereview.cfg
├── go.mod
├── internal/
│ └── unsafeheader/
│ └── unsafeheader.go
├── unix/
│ ├── .gitignore
│ ├── README.md
│ ├── affinity_linux.go
│ ├── aliases.go
│ ├── asm_aix_ppc64.s
│ ├── asm_darwin_386.s
│ ├── asm_darwin_amd64.s
│ ├── asm_darwin_arm.s
│ ├── asm_darwin_arm64.s
│ ├── asm_dragonfly_amd64.s
│ ├── asm_freebsd_386.s
│ ├── asm_freebsd_amd64.s
│ ├── asm_freebsd_arm.s
│ ├── asm_freebsd_arm64.s
│ ├── asm_linux_386.s
│ ├── asm_linux_amd64.s
│ ├── asm_linux_arm.s
│ ├── asm_linux_arm64.s
│ ├── asm_linux_mips64x.s
│ ├── asm_linux_mipsx.s
│ ├── asm_linux_ppc64x.s
│ ├── asm_linux_riscv64.s
│ ├── asm_linux_s390x.s
│ ├── asm_netbsd_386.s
│ ├── asm_netbsd_amd64.s
│ ├── asm_netbsd_arm.s
│ ├── asm_netbsd_arm64.s
│ ├── asm_openbsd_386.s
│ ├── asm_openbsd_amd64.s
│ ├── asm_openbsd_arm.s
│ ├── asm_openbsd_arm64.s
│ ├── asm_solaris_amd64.s
│ ├── bluetooth_linux.go
│ ├── cap_freebsd.go
│ ├── constants.go
│ ├── dev_aix_ppc.go
│ ├── dev_aix_ppc64.go
│ ├── dev_darwin.go
│ ├── dev_dragonfly.go
│ ├── dev_freebsd.go
│ ├── dev_linux.go
│ ├── dev_netbsd.go
│ ├── dev_openbsd.go
│ ├── dirent.go
│ ├── endian_big.go
│ ├── endian_little.go
│ ├── env_unix.go
│ ├── errors_freebsd_386.go
│ ├── errors_freebsd_amd64.go
│ ├── errors_freebsd_arm.go
│ ├── errors_freebsd_arm64.go
│ ├── fcntl.go
│ ├── fcntl_darwin.go
│ ├── fcntl_linux_32bit.go
│ ├── fdset.go
│ ├── gccgo.go
│ ├── gccgo_c.c
│ ├── gccgo_linux_amd64.go
│ ├── ioctl.go
│ ├── mkall.sh
│ ├── mkasm_darwin.go
│ ├── mkerrors.sh
│ ├── mkmerge.go
│ ├── mkpost.go
│ ├── mksyscall.go
│ ├── mksyscall_aix_ppc.go
│ ├── mksyscall_aix_ppc64.go
│ ├── mksyscall_solaris.go
│ ├── mksysctl_openbsd.go
│ ├── mksysnum.go
│ ├── pagesize_unix.go
│ ├── pledge_openbsd.go
│ ├── race.go
│ ├── race0.go
│ ├── readdirent_getdents.go
│ ├── readdirent_getdirentries.go
│ ├── sockcmsg_dragonfly.go
│ ├── sockcmsg_linux.go
│ ├── sockcmsg_unix.go
│ ├── sockcmsg_unix_other.go
│ ├── str.go
│ ├── syscall.go
│ ├── syscall_aix.go
│ ├── syscall_aix_ppc.go
│ ├── syscall_aix_ppc64.go
│ ├── syscall_bsd.go
│ ├── syscall_darwin.1_12.go
│ ├── syscall_darwin.1_13.go
│ ├── syscall_darwin.go
│ ├── syscall_darwin_386.1_11.go
│ ├── syscall_darwin_386.go
│ ├── syscall_darwin_amd64.1_11.go
│ ├── syscall_darwin_amd64.go
│ ├── syscall_darwin_arm.1_11.go
│ ├── syscall_darwin_arm.go
│ ├── syscall_darwin_arm64.1_11.go
│ ├── syscall_darwin_arm64.go
│ ├── syscall_darwin_libSystem.go
│ ├── syscall_dragonfly.go
│ ├── syscall_dragonfly_amd64.go
│ ├── syscall_freebsd.go
│ ├── syscall_freebsd_386.go
│ ├── syscall_freebsd_amd64.go
│ ├── syscall_freebsd_arm.go
│ ├── syscall_freebsd_arm64.go
│ ├── syscall_illumos.go
│ ├── syscall_linux.go
│ ├── syscall_linux_386.go
│ ├── syscall_linux_amd64.go
│ ├── syscall_linux_amd64_gc.go
│ ├── syscall_linux_arm.go
│ ├── syscall_linux_arm64.go
│ ├── syscall_linux_gc.go
│ ├── syscall_linux_gc_386.go
│ ├── syscall_linux_gccgo_386.go
│ ├── syscall_linux_gccgo_arm.go
│ ├── syscall_linux_mips64x.go
│ ├── syscall_linux_mipsx.go
│ ├── syscall_linux_ppc64x.go
│ ├── syscall_linux_riscv64.go
│ ├── syscall_linux_s390x.go
│ ├── syscall_linux_sparc64.go
│ ├── syscall_netbsd.go
│ ├── syscall_netbsd_386.go
│ ├── syscall_netbsd_amd64.go
│ ├── syscall_netbsd_arm.go
│ ├── syscall_netbsd_arm64.go
│ ├── syscall_openbsd.go
│ ├── syscall_openbsd_386.go
│ ├── syscall_openbsd_amd64.go
│ ├── syscall_openbsd_arm.go
│ ├── syscall_openbsd_arm64.go
│ ├── syscall_solaris.go
│ ├── syscall_solaris_amd64.go
│ ├── syscall_unix.go
│ ├── syscall_unix_gc.go
│ ├── syscall_unix_gc_ppc64x.go
│ ├── timestruct.go
│ ├── types_aix.go
│ ├── types_darwin.go
│ ├── types_dragonfly.go
│ ├── types_freebsd.go
│ ├── types_netbsd.go
│ ├── types_openbsd.go
│ ├── types_solaris.go
│ ├── unveil_openbsd.go
│ ├── xattr_bsd.go
│ ├── zerrors_aix_ppc.go
│ ├── zerrors_aix_ppc64.go
│ ├── zerrors_darwin_386.go
│ ├── zerrors_darwin_amd64.go
│ ├── zerrors_darwin_arm.go
│ ├── zerrors_darwin_arm64.go
│ ├── zerrors_dragonfly_amd64.go
│ ├── zerrors_freebsd_386.go
│ ├── zerrors_freebsd_amd64.go
│ ├── zerrors_freebsd_arm.go
│ ├── zerrors_freebsd_arm64.go
│ ├── zerrors_linux.go
│ ├── zerrors_linux_386.go
│ ├── zerrors_linux_amd64.go
│ ├── zerrors_linux_arm.go
│ ├── zerrors_linux_arm64.go
│ ├── zerrors_linux_mips.go
│ ├── zerrors_linux_mips64.go
│ ├── zerrors_linux_mips64le.go
│ ├── zerrors_linux_mipsle.go
│ ├── zerrors_linux_ppc64.go
│ ├── zerrors_linux_ppc64le.go
│ ├── zerrors_linux_riscv64.go
│ ├── zerrors_linux_s390x.go
│ ├── zerrors_linux_sparc64.go
│ ├── zerrors_netbsd_386.go
│ ├── zerrors_netbsd_amd64.go
│ ├── zerrors_netbsd_arm.go
│ ├── zerrors_netbsd_arm64.go
│ ├── zerrors_openbsd_386.go
│ ├── zerrors_openbsd_amd64.go
│ ├── zerrors_openbsd_arm.go
│ ├── zerrors_openbsd_arm64.go
│ ├── zerrors_solaris_amd64.go
│ ├── zptrace_armnn_linux.go
│ ├── zptrace_linux_arm64.go
│ ├── zptrace_mipsnn_linux.go
│ ├── zptrace_mipsnnle_linux.go
│ ├── zptrace_x86_linux.go
│ ├── zsyscall_aix_ppc.go
│ ├── zsyscall_aix_ppc64.go
│ ├── zsyscall_aix_ppc64_gc.go
│ ├── zsyscall_aix_ppc64_gccgo.go
│ ├── zsyscall_darwin_386.1_11.go
│ ├── zsyscall_darwin_386.1_13.go
│ ├── zsyscall_darwin_386.1_13.s
│ ├── zsyscall_darwin_386.go
│ ├── zsyscall_darwin_386.s
│ ├── zsyscall_darwin_amd64.1_11.go
│ ├── zsyscall_darwin_amd64.1_13.go
│ ├── zsyscall_darwin_amd64.1_13.s
│ ├── zsyscall_darwin_amd64.go
│ ├── zsyscall_darwin_amd64.s
│ ├── zsyscall_darwin_arm.1_11.go
│ ├── zsyscall_darwin_arm.1_13.go
│ ├── zsyscall_darwin_arm.1_13.s
│ ├── zsyscall_darwin_arm.go
│ ├── zsyscall_darwin_arm.s
│ ├── zsyscall_darwin_arm64.1_11.go
│ ├── zsyscall_darwin_arm64.1_13.go
│ ├── zsyscall_darwin_arm64.1_13.s
│ ├── zsyscall_darwin_arm64.go
│ ├── zsyscall_darwin_arm64.s
│ ├── zsyscall_dragonfly_amd64.go
│ ├── zsyscall_freebsd_386.go
│ ├── zsyscall_freebsd_amd64.go
│ ├── zsyscall_freebsd_arm.go
│ ├── zsyscall_freebsd_arm64.go
│ ├── zsyscall_illumos_amd64.go
│ ├── zsyscall_linux.go
│ ├── zsyscall_linux_386.go
│ ├── zsyscall_linux_amd64.go
│ ├── zsyscall_linux_arm.go
│ ├── zsyscall_linux_arm64.go
│ ├── zsyscall_linux_mips.go
│ ├── zsyscall_linux_mips64.go
│ ├── zsyscall_linux_mips64le.go
│ ├── zsyscall_linux_mipsle.go
│ ├── zsyscall_linux_ppc64.go
│ ├── zsyscall_linux_ppc64le.go
│ ├── zsyscall_linux_riscv64.go
│ ├── zsyscall_linux_s390x.go
│ ├── zsyscall_linux_sparc64.go
│ ├── zsyscall_netbsd_386.go
│ ├── zsyscall_netbsd_amd64.go
│ ├── zsyscall_netbsd_arm.go
│ ├── zsyscall_netbsd_arm64.go
│ ├── zsyscall_openbsd_386.go
│ ├── zsyscall_openbsd_amd64.go
│ ├── zsyscall_openbsd_arm.go
│ ├── zsyscall_openbsd_arm64.go
│ ├── zsyscall_solaris_amd64.go
│ ├── zsysctl_openbsd_386.go
│ ├── zsysctl_openbsd_amd64.go
│ ├── zsysctl_openbsd_arm.go
│ ├── zsysctl_openbsd_arm64.go
│ ├── zsysnum_darwin_386.go
│ ├── zsysnum_darwin_amd64.go
│ ├── zsysnum_darwin_arm.go
│ ├── zsysnum_darwin_arm64.go
│ ├── zsysnum_dragonfly_amd64.go
│ ├── zsysnum_freebsd_386.go
│ ├── zsysnum_freebsd_amd64.go
│ ├── zsysnum_freebsd_arm.go
│ ├── zsysnum_freebsd_arm64.go
│ ├── zsysnum_linux_386.go
│ ├── zsysnum_linux_amd64.go
│ ├── zsysnum_linux_arm.go
│ ├── zsysnum_linux_arm64.go
│ ├── zsysnum_linux_mips.go
│ ├── zsysnum_linux_mips64.go
│ ├── zsysnum_linux_mips64le.go
│ ├── zsysnum_linux_mipsle.go
│ ├── zsysnum_linux_ppc64.go
│ ├── zsysnum_linux_ppc64le.go
│ ├── zsysnum_linux_riscv64.go
│ ├── zsysnum_linux_s390x.go
│ ├── zsysnum_linux_sparc64.go
│ ├── zsysnum_netbsd_386.go
│ ├── zsysnum_netbsd_amd64.go
│ ├── zsysnum_netbsd_arm.go
│ ├── zsysnum_netbsd_arm64.go
│ ├── zsysnum_openbsd_386.go
│ ├── zsysnum_openbsd_amd64.go
│ ├── zsysnum_openbsd_arm.go
│ ├── zsysnum_openbsd_arm64.go
│ ├── ztypes_aix_ppc.go
│ ├── ztypes_aix_ppc64.go
│ ├── ztypes_darwin_386.go
│ ├── ztypes_darwin_amd64.go
│ ├── ztypes_darwin_arm.go
│ ├── ztypes_darwin_arm64.go
│ ├── ztypes_dragonfly_amd64.go
│ ├── ztypes_freebsd_386.go
│ ├── ztypes_freebsd_amd64.go
│ ├── ztypes_freebsd_arm.go
│ ├── ztypes_freebsd_arm64.go
│ ├── ztypes_linux.go
│ ├── ztypes_linux_386.go
│ ├── ztypes_linux_amd64.go
│ ├── ztypes_linux_arm.go
│ ├── ztypes_linux_arm64.go
│ ├── ztypes_linux_mips.go
│ ├── ztypes_linux_mips64.go
│ ├── ztypes_linux_mips64le.go
│ ├── ztypes_linux_mipsle.go
│ ├── ztypes_linux_ppc64.go
│ ├── ztypes_linux_ppc64le.go
│ ├── ztypes_linux_riscv64.go
│ ├── ztypes_linux_s390x.go
│ ├── ztypes_linux_sparc64.go
│ ├── ztypes_netbsd_386.go
│ ├── ztypes_netbsd_amd64.go
│ ├── ztypes_netbsd_arm.go
│ ├── ztypes_netbsd_arm64.go
│ ├── ztypes_openbsd_386.go
│ ├── ztypes_openbsd_amd64.go
│ ├── ztypes_openbsd_arm.go
│ ├── ztypes_openbsd_arm64.go
│ └── ztypes_solaris_amd64.go
└── windows/
├── aliases.go
├── dll_windows.go
├── empty.s
├── env_windows.go
├── eventlog.go
├── exec_windows.go
├── memory_windows.go
├── mkerrors.bash
├── mkknownfolderids.bash
├── mksyscall.go
├── race.go
├── race0.go
├── security_windows.go
├── service.go
├── str.go
├── syscall.go
├── syscall_windows.go
├── types_windows.go
├── types_windows_386.go
├── types_windows_amd64.go
├── types_windows_arm.go
├── zerrors_windows.go
├── zknownfolderids_windows.go
└── zsyscall_windows.go
Showing preview only (6,810K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (83110 symbols across 1075 files)
FILE: cmd/cloudinitexecute/authorize_ssh_keys.go
constant sshDirName (line 15) | sshDirName = ".ssh"
constant authorizedKeysFileName (line 16) | authorizedKeysFileName = "authorized_keys"
function authorizeSSHKeys (line 19) | func authorizeSSHKeys(username string, authorizedKeys []string, name str...
function authorizeSSHKey (line 71) | func authorizeSSHKey(authorizedKey, authorizedKeysFile string, uid, gid ...
FILE: cmd/cloudinitexecute/cloudinitexecute.go
constant resizeStamp (line 23) | resizeStamp = "/var/lib/rancher/resizefs.done"
constant sshKeyName (line 24) | sshKeyName = "rancheros-cloud-config"
function init (line 33) | func init() {
function Main (line 39) | func Main() {
function ApplyConsole (line 60) | func ApplyConsole(cfg *rancherConfig.CloudConfig) {
function WriteFiles (line 119) | func WriteFiles(cfg *rancherConfig.CloudConfig, container string) {
function applyPreConsole (line 149) | func applyPreConsole(cfg *rancherConfig.CloudConfig) {
function resizeDevice (line 183) | func resizeDevice(cfg *rancherConfig.CloudConfig) error {
FILE: cmd/cloudinitsave/cloudinitsave.go
constant datasourceInterval (line 56) | datasourceInterval = 100 * time.Millisecond
constant datasourceMaxInterval (line 57) | datasourceMaxInterval = 30 * time.Second
constant datasourceTimeout (line 58) | datasourceTimeout = 5 * time.Minute
function Main (line 61) | func Main() {
function saveCloudConfig (line 79) | func saveCloudConfig() error {
function saveFiles (line 104) | func saveFiles(cloudConfigBytes, scriptBytes []byte, metadata datasource...
function fetchAndSave (line 168) | func fetchAndSave(ds datasource.Datasource) error {
function getDatasources (line 220) | func getDatasources(datasources []string) []datasource.Datasource {
function enableDoLinkLocal (line 289) | func enableDoLinkLocal() {
function selectDatasource (line 313) | func selectDatasource(sources []datasource.Datasource) datasource.Dataso...
function isCompose (line 367) | func isCompose(content string) bool {
function composeToCloudConfig (line 371) | func composeToCloudConfig(bytes []byte) ([]byte, error) {
constant gzipMagicBytes (line 385) | gzipMagicBytes = "\x1f\x8b"
function decompressIfGzip (line 387) | func decompressIfGzip(userdataBytes []byte) ([]byte, error) {
FILE: cmd/control/autologin.go
function AutologinMain (line 16) | func AutologinMain() {
function autologinAction (line 31) | func autologinAction(c *cli.Context) error {
FILE: cmd/control/bootstrap.go
function BootstrapMain (line 17) | func BootstrapMain() {
function mdadmScan (line 87) | func mdadmScan() error {
function vgchange (line 94) | func vgchange() error {
function cryptsetup (line 101) | func cryptsetup() error {
function runRngd (line 133) | func runRngd() error {
function runStateScript (line 144) | func runStateScript(script string) error {
function waitForRoot (line 161) | func waitForRoot(cfg *config.CloudConfig) {
function autoformat (line 181) | func autoformat(autoformatDevices []string) error {
FILE: cmd/control/cli.go
function Main (line 14) | func Main() {
FILE: cmd/control/config.go
function configSubcommands (line 24) | func configSubcommands() []cli.Command {
function imagesFromConfig (line 102) | func imagesFromConfig(cfg *config.CloudConfig) []string {
function runImages (line 122) | func runImages(c *cli.Context) error {
function runGenerate (line 133) | func runGenerate(c *cli.Context) error {
function genTpl (line 140) | func genTpl(in io.Reader, out io.Writer) error {
function env2map (line 149) | func env2map(env []string) map[string]string {
function editSyslinux (line 158) | func editSyslinux(c *cli.Context) error {
function configSet (line 185) | func configSet(c *cli.Context) error {
function configGet (line 204) | func configGet(c *cli.Context) error {
function merge (line 236) | func merge(c *cli.Context) error {
function export (line 257) | func export(c *cli.Context) error {
function validate (line 276) | func validate(c *cli.Context) error {
function inputBytes (line 291) | func inputBytes(c *cli.Context) ([]byte, error) {
FILE: cmd/control/config_test.go
function TestGenTpl (line 12) | func TestGenTpl(t *testing.T) {
FILE: cmd/control/console.go
function consoleSubcommands (line 23) | func consoleSubcommands() []cli.Command {
function consoleSwitch (line 59) | func consoleSwitch(c *cli.Context) error {
function consoleEnable (line 112) | func consoleEnable(c *cli.Context) error {
function consoleList (line 134) | func consoleList(c *cli.Context) error {
function validateConsole (line 152) | func validateConsole(console string, cfg *config.CloudConfig) {
function availableConsoles (line 159) | func availableConsoles(cfg *config.CloudConfig, update bool) []string {
function CurrentConsole (line 177) | func CurrentConsole() (console string) {
FILE: cmd/control/console_init.go
constant consoleDone (line 28) | consoleDone = "/run/console-done"
constant dockerHome (line 29) | dockerHome = "/home/docker"
constant gettyCmd (line 30) | gettyCmd = "/sbin/agetty"
constant rancherHome (line 31) | rancherHome = "/home/rancher"
constant startScript (line 32) | startScript = "/opt/rancher/bin/start.sh"
constant runLockDir (line 33) | runLockDir = "/run/lock"
constant sshdFile (line 34) | sshdFile = "/etc/ssh/sshd_config"
constant sshdTplFile (line 35) | sshdTplFile = "/etc/ssh/sshd_config.tpl"
type symlink (line 38) | type symlink struct
function consoleInitAction (line 42) | func consoleInitAction(c *cli.Context) error {
function createHomeDir (line 46) | func createHomeDir(homedir string, uid, gid int) {
function enableBashRC (line 57) | func enableBashRC(homedir string, uid, gid int) {
function consoleInitFunc (line 86) | func consoleInitFunc() error {
function generateRespawnConf (line 331) | func generateRespawnConf(cmdline, user string, sshd, recovery bool) stri...
function writeRespawn (line 385) | func writeRespawn(user string, sshd, recovery bool) error {
function modifySshdConfig (line 411) | func modifySshdConfig(cfg *config.CloudConfig) error {
function setupSSH (line 441) | func setupSSH(cfg *config.CloudConfig) error {
function istty (line 486) | func istty(name string) bool {
FILE: cmd/control/dev.go
function devAction (line 11) | func devAction(c *cli.Context) error {
FILE: cmd/control/docker_init.go
constant dockerConf (line 20) | dockerConf = "/var/lib/rancher/conf/docker"
constant dockerDone (line 21) | dockerDone = "/run/docker-done"
constant dockerLog (line 22) | dockerLog = "/var/log/docker.log"
constant dockerCompletionLinkFile (line 23) | dockerCompletionLinkFile = "/usr/share/bash-completion/completions/docker"
constant dockerCompletionFile (line 24) | dockerCompletionFile = "/var/lib/rancher/engine/completion"
function dockerInitAction (line 27) | func dockerInitAction(c *cli.Context) error {
FILE: cmd/control/engine.go
function engineSubcommands (line 35) | func engineSubcommands() []cli.Command {
function engineSwitch (line 125) | func engineSwitch(c *cli.Context) error {
function engineCreate (line 170) | func engineCreate(c *cli.Context) error {
function dindEngineRemove (line 214) | func dindEngineRemove(c *cli.Context) error {
function engineEnable (line 272) | func engineEnable(c *cli.Context) error {
function engineList (line 292) | func engineList(c *cli.Context) error {
function validateEngine (line 350) | func validateEngine(engine string, cfg *config.CloudConfig) {
function availableEngines (line 357) | func availableEngines(cfg *config.CloudConfig, update bool) []string {
function CurrentEngine (line 374) | func CurrentEngine() (engine string) {
function preFlightValidate (line 410) | func preFlightValidate(c *cli.Context) error {
function randomSSHPort (line 484) | func randomSSHPort() int {
function generateEngineCompose (line 499) | func generateEngineCompose(name, version string, sshPort int, authorized...
function RemoveEngineFromCompose (line 562) | func RemoveEngineFromCompose(name string) error {
function CheckUserDefineNetwork (line 587) | func CheckUserDefineNetwork(name string) (*types.NetworkResource, error) {
function CheckUserDefineIPv4Address (line 607) | func CheckUserDefineIPv4Address(ipv4 string, network types.NetworkResour...
FILE: cmd/control/entrypoint.go
constant ca (line 19) | ca = "/etc/ssl/certs/ca-certificates.crt"
constant caBase (line 20) | caBase = "/etc/ssl/certs/ca-certificates.crt.rancher"
function entrypointAction (line 23) | func entrypointAction(c *cli.Context) error {
function writeFiles (line 62) | func writeFiles(cfg *config.CloudConfig) error {
function setupCommandSymlinks (line 80) | func setupCommandSymlinks() {
FILE: cmd/control/env.go
function envAction (line 15) | func envAction(c *cli.Context) error {
FILE: cmd/control/install.go
function installAction (line 99) | func installAction(c *cli.Context) error {
function runInstall (line 201) | func runInstall(image, installType, cloudConfig, device, partition, stat...
function getDeviceByLabel (line 358) | func getDeviceByLabel(label string) (string, string) {
function getBootIso (line 367) | func getBootIso() (string, string, error) {
function mountBootIso (line 390) | func mountBootIso(deviceName, deviceType string) error {
function layDownOS (line 416) | func layDownOS(image, installType, cloudConfig, device, partition, state...
function seedData (line 583) | func seedData(baseName, cloudData string, files []string) error {
function setDiskpartitions (line 640) | func setDiskpartitions(device, diskType string) error {
function partitionMounted (line 749) | func partitionMounted(device string, file io.Reader) bool {
function formatdevice (line 768) | func formatdevice(device, partition string) error {
function formatAndMount (line 783) | func formatAndMount(baseName, device, partition string) (string, string,...
function setBootable (line 799) | func setBootable(device, diskType string) error {
function upgradeBootloader (line 817) | func upgradeBootloader(device, baseName, diskType string) error {
function installSyslinux (line 896) | func installSyslinux(device, baseName, diskType string) error {
function different (line 979) | func different(existing, new string) bool {
function installRancher (line 1000) | func installRancher(baseName, VERSION, DIST, kappend string) (string, er...
FILE: cmd/control/install/grub.go
function RunGrub (line 12) | func RunGrub(baseName, device string) error {
function grubConfig (line 24) | func grubConfig(menu BootVars) error {
function PvGrubConfig (line 62) | func PvGrubConfig(menu BootVars) error {
FILE: cmd/control/install/install.go
type MenuEntry (line 14) | type MenuEntry struct
type BootVars (line 17) | type BootVars struct
function MountDevice (line 24) | func MountDevice(baseName, device, partition string, raw bool) (string, ...
function GetStatePartition (line 72) | func GetStatePartition() string {
function GetDefaultPartition (line 86) | func GetDefaultPartition(device string) string {
FILE: cmd/control/install/service.go
type ImageConfig (line 16) | type ImageConfig struct
function GetCacheImageList (line 20) | func GetCacheImageList(cloudconfig string, oldcfg *config.CloudConfig) [...
function getServiceImage (line 70) | func getServiceImage(service, svctype string, oldcfg, newcfg *config.Clo...
function RunCacheScript (line 102) | func RunCacheScript(partition string, images []string) error {
function readConfigFile (line 106) | func readConfigFile(file string) ([]byte, error) {
function formatImage (line 119) | func formatImage(image string, oldcfg, newcfg *config.CloudConfig) string {
FILE: cmd/control/install/syslinux.go
function syslinuxConfig (line 15) | func syslinuxConfig(menu BootVars) error {
function ReadGlobalCfg (line 51) | func ReadGlobalCfg(globalCfg string) (string, error) {
function ReadSyslinuxCfg (line 68) | func ReadSyslinuxCfg(currentCfg string) (string, string, error) {
FILE: cmd/control/os.go
type Images (line 27) | type Images struct
function osSubcommands (line 32) | func osSubcommands() []cli.Command {
function getImages (line 92) | func getImages(update bool) (*Images, error) {
function osMetaDataGet (line 146) | func osMetaDataGet(c *cli.Context) error {
function getLatestImage (line 187) | func getLatestImage() (string, error) {
function osUpgrade (line 196) | func osUpgrade(c *cli.Context) error {
function osVersion (line 236) | func osVersion(c *cli.Context) error {
function startUpgradeContainer (line 241) | func startUpgradeContainer(image string, stage, force, reboot, kexec, up...
function parseBody (line 330) | func parseBody(body []byte) (*Images, error) {
function getUpgradeURL (line 340) | func getUpgradeURL() (string, error) {
FILE: cmd/control/preload.go
constant userImagesPreloadDirectory (line 24) | userImagesPreloadDirectory = "/var/lib/rancher/preload/docker"
function preloadImagesAction (line 27) | func preloadImagesAction(c *cli.Context) error {
function shouldLoad (line 35) | func shouldLoad(file string) bool {
function PreloadImages (line 45) | func PreloadImages(clientFactory func() (dockerClient.APIClient, error),...
FILE: cmd/control/recovery_init.go
function recoveryInitAction (line 13) | func recoveryInitAction(c *cli.Context) error {
FILE: cmd/control/service/app/app.go
function ProjectPs (line 18) | func ProjectPs(p project.APIProject, c *cli.Context) error {
function ProjectStop (line 28) | func ProjectStop(p project.APIProject, c *cli.Context) error {
function ProjectDown (line 36) | func ProjectDown(p project.APIProject, c *cli.Context) error {
function ProjectBuild (line 49) | func ProjectBuild(p project.APIProject, c *cli.Context) error {
function ProjectCreate (line 62) | func ProjectCreate(p project.APIProject, c *cli.Context) error {
function ProjectUp (line 75) | func ProjectUp(p project.APIProject, c *cli.Context) error {
function ProjectStart (line 117) | func ProjectStart(p project.APIProject, c *cli.Context) error {
function ProjectRestart (line 125) | func ProjectRestart(p project.APIProject, c *cli.Context) error {
function ProjectLog (line 133) | func ProjectLog(p project.APIProject, c *cli.Context) error {
function ProjectPull (line 141) | func ProjectPull(p project.APIProject, c *cli.Context) error {
function ProjectDelete (line 149) | func ProjectDelete(p project.APIProject, c *cli.Context) error {
function ProjectKill (line 175) | func ProjectKill(p project.APIProject, c *cli.Context) error {
FILE: cmd/control/service/command/command.go
function verifyOneOrMoreServices (line 12) | func verifyOneOrMoreServices(c *cli.Context) error {
function CreateCommand (line 19) | func CreateCommand(factory composeApp.ProjectFactory) cli.Command {
function BuildCommand (line 42) | func BuildCommand(factory composeApp.ProjectFactory) cli.Command {
function PsCommand (line 65) | func PsCommand(factory composeApp.ProjectFactory) cli.Command {
function UpCommand (line 79) | func UpCommand(factory composeApp.ProjectFactory) cli.Command {
function StartCommand (line 106) | func StartCommand(factory composeApp.ProjectFactory) cli.Command {
function PullCommand (line 121) | func PullCommand(factory composeApp.ProjectFactory) cli.Command {
function LogsCommand (line 136) | func LogsCommand(factory composeApp.ProjectFactory) cli.Command {
function RestartCommand (line 156) | func RestartCommand(factory composeApp.ProjectFactory) cli.Command {
function StopCommand (line 172) | func StopCommand(factory composeApp.ProjectFactory) cli.Command {
function DownCommand (line 188) | func DownCommand(factory composeApp.ProjectFactory) cli.Command {
function RmCommand (line 211) | func RmCommand(factory composeApp.ProjectFactory) cli.Command {
function KillCommand (line 230) | func KillCommand(factory composeApp.ProjectFactory) cli.Command {
FILE: cmd/control/service/service.go
type projectFactory (line 19) | type projectFactory struct
method Create (line 22) | func (p *projectFactory) Create(c *cli.Context) (project.APIProject, e...
function beforeApp (line 27) | func beforeApp(c *cli.Context) error {
function Commands (line 34) | func Commands() cli.Command {
function serviceSubCommands (line 61) | func serviceSubCommands() []cli.Command {
function updateIncludedServices (line 96) | func updateIncludedServices(cfg *config.CloudConfig) error {
function disable (line 100) | func disable(c *cli.Context) error {
function del (line 124) | func del(c *cli.Context) error {
function enable (line 148) | func enable(c *cli.Context) error {
function list (line 179) | func list(c *cli.Context) error {
function isLocal (line 219) | func isLocal(service string) bool {
function IsLocalOrURL (line 223) | func IsLocalOrURL(service string) bool {
function ValidService (line 228) | func ValidService(service string, cfg *config.CloudConfig) bool {
function validateService (line 236) | func validateService(service string, cfg *config.CloudConfig) {
function availableService (line 242) | func availableService(cfg *config.CloudConfig, update bool) []string {
FILE: cmd/control/switch_console.go
function switchConsoleAction (line 15) | func switchConsoleAction(c *cli.Context) error {
FILE: cmd/control/tlsconf.go
constant NAME (line 17) | NAME string = "rancher"
constant BITS (line 18) | BITS int = 2048
constant ServerTLSPath (line 19) | ServerTLSPath string = "/etc/docker/tls"
constant ClientTLSPath (line 20) | ClientTLSPath string = "/home/rancher/.docker"
constant Cert (line 21) | Cert string = "cert.pem"
constant Key (line 22) | Key string = "key.pem"
constant ServerCert (line 23) | ServerCert string = "server-cert.pem"
constant ServerKey (line 24) | ServerKey string = "server-key.pem"
constant CaCert (line 25) | CaCert string = "ca.pem"
constant CaKey (line 26) | CaKey string = "ca-key.pem"
function tlsConfCommands (line 29) | func tlsConfCommands() []cli.Command {
function writeCerts (line 56) | func writeCerts(generateServer bool, hostname []string, certPath, keyPat...
function writeCaCerts (line 82) | func writeCaCerts(cfg *config.CloudConfig, caCertPath, caKeyPath string)...
function tlsConfCreate (line 120) | func tlsConfCreate(c *cli.Context) error {
function generate (line 129) | func generate(c *cli.Context) error {
function Generate (line 137) | func Generate(generateServer bool, outDir string, hostnames []string) er...
FILE: cmd/control/udevsettle.go
function udevSettleAction (line 15) | func udevSettleAction(c *cli.Context) {
function extraRules (line 25) | func extraRules() error {
function UdevSettle (line 59) | func UdevSettle() error {
FILE: cmd/control/user_docker.go
constant defaultStorageContext (line 25) | defaultStorageContext = "console"
constant dockerPidFile (line 26) | dockerPidFile = "/var/run/docker.pid"
constant sourceDirectory (line 27) | sourceDirectory = "/engine"
constant destDirectory (line 28) | destDirectory = "/var/lib/rancher/engine"
constant pluginsSourceDirectory (line 29) | pluginsSourceDirectory = "/engine-plugins"
constant pluginsDestDirectory (line 30) | pluginsDestDirectory = "/var/lib/rancher/engine-plugins"
constant dockerCompletionFName (line 31) | dockerCompletionFName = "completion"
function userDockerAction (line 41) | func userDockerAction(c *cli.Context) error {
function copyBinaries (line 59) | func copyBinaries(source, dest string) error {
function writeConfigCerts (line 118) | func writeConfigCerts(cfg *config.CloudConfig) error {
function startDocker (line 148) | func startDocker(cfg *config.CloudConfig) error {
function waitForPid (line 200) | func waitForPid(service string, project *project.Project) (int, error) {
function getPid (line 212) | func getPid(service string, project *project.Project) (int, error) {
FILE: cmd/control/util.go
function yes (line 17) | func yes(question string) bool {
function formatImage (line 28) | func formatImage(image string, cfg *config.CloudConfig) string {
function symLinkEngineBinary (line 36) | func symLinkEngineBinary() []symlink {
function checkZfsBackingFS (line 66) | func checkZfsBackingFS(driver, dir string) error {
function checkGlobalCfg (line 85) | func checkGlobalCfg() bool {
FILE: cmd/init/init.go
function MainInit (line 29) | func MainInit() {
function RunInit (line 44) | func RunInit() error {
FILE: cmd/network/network.go
function Main (line 29) | func Main() {
function ApplyNetworkConfig (line 53) | func ApplyNetworkConfig(cfg *config.CloudConfig) {
function generateDhcpcdFiles (line 111) | func generateDhcpcdFiles(cfg *config.CloudConfig) {
function generateWpaFiles (line 133) | func generateWpaFiles(cfg *config.CloudConfig) {
FILE: cmd/power/power.go
function runDocker (line 30) | func runDocker(name string) error {
function reboot (line 129) | func reboot(name string, force bool, code uint) {
function shutDownContainers (line 215) | func shutDownContainers() error {
FILE: cmd/power/shutdown.go
function Shutdown (line 27) | func Shutdown() {
function Kexec (line 154) | func Kexec(previous bool, bootDir, append string) error {
function Reboot (line 193) | func Reboot() {
function shutdown (line 198) | func shutdown(c *cli.Context) error {
FILE: cmd/respawn/respawn.go
function Main (line 28) | func Main() {
function setupSigterm (line 53) | func setupSigterm() {
function run (line 63) | func run(c *cli.Context) error {
function addProcess (line 101) | func addProcess(process *os.Process) {
function removeProcess (line 107) | func removeProcess(process *os.Process) {
function termPids (line 113) | func termPids() {
function execute (line 124) | func execute(line string, doneChannel chan string) {
FILE: cmd/sysinit/sysinit.go
function Main (line 11) | func Main() {
FILE: cmd/wait/wait.go
function Main (line 11) | func Main() {
FILE: config/cloudinit/config/config.go
type CloudConfig (line 30) | type CloudConfig struct
method Decode (line 74) | func (cc *CloudConfig) Decode() error {
method String (line 87) | func (cc CloudConfig) String() string {
type CoreOS (line 39) | type CoreOS struct
function IsCloudConfig (line 50) | func IsCloudConfig(userdata string) bool {
function NewCloudConfig (line 62) | func NewCloudConfig(contents string) (*CloudConfig, error) {
function IsZero (line 101) | func IsZero(c interface{}) bool {
type ErrorValid (line 105) | type ErrorValid struct
method Error (line 111) | func (e ErrorValid) Error() string {
function AssertStructValid (line 118) | func AssertStructValid(c interface{}) error {
function AssertValid (line 137) | func AssertValid(value reflect.Value, valid string) *ErrorValid {
function isZero (line 153) | func isZero(v reflect.Value) bool {
function isFieldExported (line 168) | func isFieldExported(f reflect.StructField) bool {
FILE: config/cloudinit/config/config_test.go
function TestNewCloudConfig (line 25) | func TestNewCloudConfig(t *testing.T) {
function TestNewCloudConfigDecode (line 77) | func TestNewCloudConfigDecode(t *testing.T) {
function TestIsZero (line 121) | func TestIsZero(t *testing.T) {
function TestAssertStructValid (line 143) | func TestAssertStructValid(t *testing.T) {
function TestConfigCompile (line 183) | func TestConfigCompile(t *testing.T) {
function TestCloudConfigUnknownKeys (line 210) | func TestCloudConfigUnknownKeys(t *testing.T) {
function TestCloudConfigEmpty (line 252) | func TestCloudConfigEmpty(t *testing.T) {
function TestCloudConfig (line 273) | func TestCloudConfig(t *testing.T) {
function TestCloudConfigKeysNotList (line 380) | func TestCloudConfigKeysNotList(t *testing.T) {
function TestCloudConfigSerializationHeader (line 396) | func TestCloudConfigSerializationHeader(t *testing.T) {
function TestCloudConfigUsers (line 405) | func TestCloudConfigUsers(t *testing.T) {
function TestCloudConfigUsersGithubUser (line 496) | func TestCloudConfigUsersGithubUser(t *testing.T) {
function TestCloudConfigUsersSSHImportURL (line 523) | func TestCloudConfigUsersSSHImportURL(t *testing.T) {
FILE: config/cloudinit/config/decode.go
function DecodeBase64Content (line 10) | func DecodeBase64Content(content string) ([]byte, error) {
function DecodeGzipContent (line 20) | func DecodeGzipContent(content string) ([]byte, error) {
function DecompressGzip (line 25) | func DecompressGzip(content []byte) ([]byte, error) {
function DecodeContent (line 39) | func DecodeContent(content string, encoding string) ([]byte, error) {
FILE: config/cloudinit/config/etc_hosts.go
type EtcHosts (line 17) | type EtcHosts
FILE: config/cloudinit/config/etcd.go
type Etcd (line 17) | type Etcd struct
FILE: config/cloudinit/config/etcd2.go
type Etcd2 (line 17) | type Etcd2 struct
FILE: config/cloudinit/config/file.go
type File (line 17) | type File struct
FILE: config/cloudinit/config/file_test.go
function TestEncodingValid (line 21) | func TestEncodingValid(t *testing.T) {
function TestRawFilePermissionsValid (line 48) | func TestRawFilePermissionsValid(t *testing.T) {
FILE: config/cloudinit/config/flannel.go
type Flannel (line 17) | type Flannel struct
FILE: config/cloudinit/config/fleet.go
type Fleet (line 17) | type Fleet struct
FILE: config/cloudinit/config/ignition.go
function IsIgnitionConfig (line 21) | func IsIgnitionConfig(userdata string) bool {
FILE: config/cloudinit/config/locksmith.go
type Locksmith (line 17) | type Locksmith struct
FILE: config/cloudinit/config/locksmith_test.go
function TestRebootWindowStart (line 21) | func TestRebootWindowStart(t *testing.T) {
function TestRebootWindowLength (line 57) | func TestRebootWindowLength(t *testing.T) {
FILE: config/cloudinit/config/oem.go
type OEM (line 17) | type OEM struct
FILE: config/cloudinit/config/script.go
type Script (line 21) | type Script
function IsScript (line 23) | func IsScript(userdata string) bool {
function NewScript (line 28) | func NewScript(userdata string) (*Script, error) {
FILE: config/cloudinit/config/unit.go
type Unit (line 17) | type Unit struct
type UnitDropIn (line 27) | type UnitDropIn struct
FILE: config/cloudinit/config/unit_test.go
function TestCommandValid (line 23) | func TestCommandValid(t *testing.T) {
FILE: config/cloudinit/config/update.go
type Update (line 17) | type Update struct
FILE: config/cloudinit/config/update_test.go
function TestRebootStrategyValid (line 23) | func TestRebootStrategyValid(t *testing.T) {
FILE: config/cloudinit/config/user.go
type User (line 17) | type User struct
FILE: config/cloudinit/config/validate/context.go
type Context (line 24) | type Context struct
method Increment (line 31) | func (c *Context) Increment() {
function NewContext (line 48) | func NewContext(content []byte) Context {
FILE: config/cloudinit/config/validate/context_test.go
function TestNewContext (line 22) | func TestNewContext(t *testing.T) {
function TestIncrement (line 52) | func TestIncrement(t *testing.T) {
FILE: config/cloudinit/config/validate/node.go
type Node (line 28) | type Node struct
method Child (line 38) | func (n Node) Child(name string) Node {
method HumanType (line 49) | func (n Node) HumanType() string {
function NewNode (line 61) | func NewNode(value interface{}, context Context) Node {
function toNode (line 69) | func toNode(v interface{}, c Context, n *Node) {
function findKey (line 135) | func findKey(key string, context Context) (Context, bool) {
function findElem (line 143) | func findElem(context Context) (Context, bool) {
function find (line 147) | func find(exp *regexp.Regexp, key string, context Context) (Context, boo...
FILE: config/cloudinit/config/validate/node_test.go
function TestChild (line 22) | func TestChild(t *testing.T) {
function TestHumanType (line 62) | func TestHumanType(t *testing.T) {
function TestToNode (line 93) | func TestToNode(t *testing.T) {
function TestFindKey (line 201) | func TestFindKey(t *testing.T) {
function TestFindElem (line 243) | func TestFindElem(t *testing.T) {
function nodesEqual (line 271) | func nodesEqual(a, b Node) bool {
FILE: config/cloudinit/config/validate/report.go
type Report (line 23) | type Report struct
method Error (line 28) | func (r *Report) Error(line int, message string) {
method Warning (line 33) | func (r *Report) Warning(line int, message string) {
method Info (line 38) | func (r *Report) Info(line int, message string) {
method Entries (line 43) | func (r *Report) Entries() []Entry {
type Entry (line 48) | type Entry struct
method String (line 55) | func (e Entry) String() string {
method MarshalJSON (line 61) | func (e Entry) MarshalJSON() ([]byte, error) {
type entryKind (line 69) | type entryKind
method String (line 77) | func (k entryKind) String() string {
constant entryError (line 72) | entryError entryKind = iota
constant entryWarning (line 73) | entryWarning
constant entryInfo (line 74) | entryInfo
FILE: config/cloudinit/config/validate/report_test.go
function TestEntry (line 23) | func TestEntry(t *testing.T) {
function TestReport (line 61) | func TestReport(t *testing.T) {
FILE: config/cloudinit/config/validate/rules.go
type rule (line 27) | type rule
function checkDiscoveryURL (line 40) | func checkDiscoveryURL(cfg Node, report *Report) {
function checkEncoding (line 53) | func checkEncoding(cfg Node, report *Report) {
function checkStructure (line 70) | func checkStructure(cfg Node, report *Report) {
function checkNodeStructure (line 75) | func checkNodeStructure(n, g Node, r *Report) {
function isCompatible (line 109) | func isCompatible(n, g reflect.Kind) bool {
function checkValidity (line 126) | func checkValidity(cfg Node, report *Report) {
function checkNodeValidity (line 131) | func checkNodeValidity(n, g Node, r *Report) {
function checkWriteFiles (line 158) | func checkWriteFiles(cfg Node, report *Report) {
function checkWriteFilesUnderCoreos (line 175) | func checkWriteFilesUnderCoreos(cfg Node, report *Report) {
FILE: config/cloudinit/config/validate/rules_test.go
function TestCheckDiscoveryURL (line 22) | func TestCheckDiscoveryURL(t *testing.T) {
function TestCheckEncoding (line 55) | func TestCheckEncoding(t *testing.T) {
function TestCheckStructure (line 101) | func TestCheckStructure(t *testing.T) {
function TestCheckValidity (line 280) | func TestCheckValidity(t *testing.T) {
function TestCheckWriteFiles (line 339) | func TestCheckWriteFiles(t *testing.T) {
function TestCheckWriteFilesUnderCoreos (line 376) | func TestCheckWriteFilesUnderCoreos(t *testing.T) {
FILE: config/cloudinit/config/validate/validate.go
function Validate (line 37) | func Validate(userdataBytes []byte) (Report, error) {
function validateCloudConfig (line 56) | func validateCloudConfig(config []byte, rules []rule) (report Report, er...
function parseCloudConfig (line 77) | func parseCloudConfig(cfg []byte, report *Report) (Node, error) {
function coerceNodes (line 137) | func coerceNodes(w, s Node) Node {
function normalizeNodeNames (line 154) | func normalizeNodeNames(node Node, report *Report) Node {
FILE: config/cloudinit/config/validate/validate_test.go
function TestParseCloudConfig (line 23) | func TestParseCloudConfig(t *testing.T) {
function TestValidateCloudConfig (line 54) | func TestValidateCloudConfig(t *testing.T) {
function TestValidate (line 104) | func TestValidate(t *testing.T) {
function BenchmarkValidate (line 137) | func BenchmarkValidate(b *testing.B) {
FILE: config/cloudinit/datasource/configdrive/configdrive.go
constant configDevName (line 33) | configDevName = "config-2"
constant configDev (line 34) | configDev = "LABEL=" + configDevName
constant configDevMountPoint (line 35) | configDevMountPoint = "/media/config-2"
constant openstackAPIVersion (line 36) | openstackAPIVersion = "latest"
type ConfigDrive (line 39) | type ConfigDrive struct
method IsAvailable (line 50) | func (cd *ConfigDrive) IsAvailable() bool {
method Finish (line 67) | func (cd *ConfigDrive) Finish() error {
method String (line 71) | func (cd *ConfigDrive) String() string {
method AvailabilityChanges (line 78) | func (cd *ConfigDrive) AvailabilityChanges() bool {
method ConfigRoot (line 82) | func (cd *ConfigDrive) ConfigRoot() string {
method FetchMetadata (line 86) | func (cd *ConfigDrive) FetchMetadata() (metadata datasource.Metadata, ...
method FetchUserdata (line 113) | func (cd *ConfigDrive) FetchUserdata() ([]byte, error) {
method Type (line 117) | func (cd *ConfigDrive) Type() string {
method openstackRoot (line 121) | func (cd *ConfigDrive) openstackRoot() string {
method openstackVersionRoot (line 125) | func (cd *ConfigDrive) openstackVersionRoot() string {
method tryReadFile (line 129) | func (cd *ConfigDrive) tryReadFile(filename string) ([]byte, error) {
function NewDatasource (line 46) | func NewDatasource(root string) *ConfigDrive {
function MountConfigDrive (line 149) | func MountConfigDrive() error {
function UnmountConfigDrive (line 167) | func UnmountConfigDrive() error {
FILE: config/cloudinit/datasource/configdrive/configdrive_test.go
function TestFetchMetadata (line 25) | func TestFetchMetadata(t *testing.T) {
function TestFetchUserdata (line 70) | func TestFetchUserdata(t *testing.T) {
function TestConfigRoot (line 104) | func TestConfigRoot(t *testing.T) {
function TestNewDatasource (line 125) | func TestNewDatasource(t *testing.T) {
FILE: config/cloudinit/datasource/datasource.go
type Datasource (line 23) | type Datasource interface
type Metadata (line 35) | type Metadata struct
FILE: config/cloudinit/datasource/file/file.go
type LocalFile (line 25) | type LocalFile struct
method IsAvailable (line 34) | func (f *LocalFile) IsAvailable() bool {
method Finish (line 39) | func (f *LocalFile) Finish() error {
method String (line 43) | func (f *LocalFile) String() string {
method AvailabilityChanges (line 47) | func (f *LocalFile) AvailabilityChanges() bool {
method ConfigRoot (line 51) | func (f *LocalFile) ConfigRoot() string {
method FetchMetadata (line 55) | func (f *LocalFile) FetchMetadata() (datasource.Metadata, error) {
method FetchUserdata (line 59) | func (f *LocalFile) FetchUserdata() ([]byte, error) {
method Type (line 63) | func (f *LocalFile) Type() string {
function NewDatasource (line 30) | func NewDatasource(path string) *LocalFile {
FILE: config/cloudinit/datasource/metadata/aliyun/metadata.go
constant DefaultAddress (line 14) | DefaultAddress = "http://100.100.100.200/"
constant apiVersion (line 15) | apiVersion = "2016-01-01/"
constant userdataPath (line 16) | userdataPath = apiVersion + "user-data/"
constant metadataPath (line 17) | metadataPath = apiVersion + "meta-data/"
type MetadataService (line 20) | type MetadataService struct
method AvailabilityChanges (line 31) | func (ms MetadataService) AvailabilityChanges() bool {
method FetchMetadata (line 36) | func (ms MetadataService) FetchMetadata() (metadata datasource.Metadat...
method Type (line 82) | func (ms MetadataService) Type() string {
function NewDatasource (line 24) | func NewDatasource(root string) *MetadataService {
FILE: config/cloudinit/datasource/metadata/aliyun/metadata_test.go
function TestType (line 14) | func TestType(t *testing.T) {
function TestFetchMetadata (line 21) | func TestFetchMetadata(t *testing.T) {
function Error (line 73) | func Error(err error) string {
FILE: config/cloudinit/datasource/metadata/azure/metadata.go
constant metadataHeader (line 15) | metadataHeader = "true"
constant metadataVersion (line 16) | metadataVersion = "2019-02-01"
constant metadataEndpoint (line 17) | metadataEndpoint = "http://169.254.169.254/metadata/"
type MetadataService (line 20) | type MetadataService struct
method ConfigRoot (line 31) | func (ms MetadataService) ConfigRoot() string {
method AvailabilityChanges (line 35) | func (ms MetadataService) AvailabilityChanges() bool {
method FetchMetadata (line 40) | func (ms MetadataService) FetchMetadata() (datasource.Metadata, error) {
method FetchUserdata (line 129) | func (ms MetadataService) FetchUserdata() ([]byte, error) {
method Type (line 137) | func (ms MetadataService) Type() string {
method MetadataURL (line 141) | func (ms MetadataService) MetadataURL() string {
method UserdataURL (line 146) | func (ms MetadataService) UserdataURL() string {
function NewDatasource (line 24) | func NewDatasource(root string) *MetadataService {
function assembleHeader (line 151) | func assembleHeader() http.Header {
FILE: config/cloudinit/datasource/metadata/azure/metadata_test.go
function TestType (line 14) | func TestType(t *testing.T) {
function TestMetadataURL (line 21) | func TestMetadataURL(t *testing.T) {
function TestUserdataURL (line 29) | func TestUserdataURL(t *testing.T) {
function TestFetchMetadata (line 37) | func TestFetchMetadata(t *testing.T) {
function TestFetchUserdata (line 127) | func TestFetchUserdata(t *testing.T) {
function Error (line 161) | func Error(err error) string {
FILE: config/cloudinit/datasource/metadata/cloudstack/metadata.go
constant apiVersion (line 30) | apiVersion = "latest/"
constant userdataPath (line 31) | userdataPath = apiVersion + "user-data"
constant metadataPath (line 32) | metadataPath = apiVersion + "meta-data/"
constant serverIdentifier (line 34) | serverIdentifier = "dhcp_server_identifier"
type MetadataService (line 37) | type MetadataService struct
method AvailabilityChanges (line 72) | func (ms MetadataService) AvailabilityChanges() bool {
method FetchMetadata (line 77) | func (ms MetadataService) FetchMetadata() (datasource.Metadata, error) {
method Type (line 110) | func (ms MetadataService) Type() string {
function NewDatasource (line 41) | func NewDatasource(root string) []*MetadataService {
FILE: config/cloudinit/datasource/metadata/cloudstack/metadata_test.go
function TestType (line 29) | func TestType(t *testing.T) {
function TestFetchMetadata (line 36) | func TestFetchMetadata(t *testing.T) {
function Error (line 97) | func Error(err error) string {
FILE: config/cloudinit/datasource/metadata/digitalocean/metadata.go
constant DefaultAddress (line 29) | DefaultAddress = "http://169.254.169.254/"
constant apiVersion (line 30) | apiVersion = "metadata/v1"
constant userdataURL (line 31) | userdataURL = apiVersion + "/user-data"
constant metadataPath (line 32) | metadataPath = apiVersion + ".json"
type Address (line 35) | type Address struct
type Interface (line 42) | type Interface struct
type Interfaces (line 50) | type Interfaces struct
type DNS (line 55) | type DNS struct
type Metadata (line 59) | type Metadata struct
type MetadataService (line 66) | type MetadataService struct
method AvailabilityChanges (line 77) | func (ms MetadataService) AvailabilityChanges() bool {
method FetchMetadata (line 98) | func (ms *MetadataService) FetchMetadata() (metadata datasource.Metada...
method Type (line 191) | func (ms MetadataService) Type() string {
function NewDatasource (line 70) | func NewDatasource(root string) *MetadataService {
function ipmask (line 83) | func ipmask(addr *Address) string {
FILE: config/cloudinit/datasource/metadata/digitalocean/metadata_test.go
function TestType (line 30) | func TestType(t *testing.T) {
function TestFetchMetadata (line 37) | func TestFetchMetadata(t *testing.T) {
function Error (line 136) | func Error(err error) string {
FILE: config/cloudinit/datasource/metadata/ec2/metadata.go
constant DefaultAddress (line 30) | DefaultAddress = "http://169.254.169.254/"
constant apiVersion (line 31) | apiVersion = "latest/"
constant userdataPath (line 32) | userdataPath = apiVersion + "user-data"
constant metadataPath (line 33) | metadataPath = apiVersion + "meta-data/"
constant defaultXVRootDisk (line 35) | defaultXVRootDisk = "/dev/xvda"
constant defaultNVMeRootDisk (line 36) | defaultNVMeRootDisk = "/dev/nvme0n1"
type MetadataService (line 43) | type MetadataService struct
method AvailabilityChanges (line 54) | func (ms MetadataService) AvailabilityChanges() bool {
method FetchMetadata (line 59) | func (ms MetadataService) FetchMetadata() (datasource.Metadata, error) {
method Type (line 163) | func (ms MetadataService) Type() string {
function NewDatasource (line 47) | func NewDatasource(root string) *MetadataService {
FILE: config/cloudinit/datasource/metadata/ec2/metadata_test.go
function TestType (line 30) | func TestType(t *testing.T) {
function TestFetchMetadata (line 37) | func TestFetchMetadata(t *testing.T) {
function Error (line 133) | func Error(err error) string {
FILE: config/cloudinit/datasource/metadata/exoscale/metadata.go
constant defaultAddress (line 15) | defaultAddress = "http://169.254.169.254/"
constant apiVersion (line 16) | apiVersion = "1.0/"
constant userdataPath (line 17) | userdataPath = apiVersion + "user-data"
constant metadataPath (line 18) | metadataPath = apiVersion + "meta-data/"
type MetadataService (line 21) | type MetadataService struct
method IsAvailable (line 42) | func (ms MetadataService) IsAvailable() bool {
method AvailabilityChanges (line 52) | func (ms MetadataService) AvailabilityChanges() bool {
method FetchMetadata (line 57) | func (ms MetadataService) FetchMetadata() (datasource.Metadata, error) {
method Type (line 90) | func (ms MetadataService) Type() string {
function NewDatasource (line 25) | func NewDatasource(root string) *MetadataService {
FILE: config/cloudinit/datasource/metadata/exoscale/metadata_test.go
function TestType (line 15) | func TestType(t *testing.T) {
function TestFetchMetadata (line 22) | func TestFetchMetadata(t *testing.T) {
function Error (line 83) | func Error(err error) string {
FILE: config/cloudinit/datasource/metadata/gce/metadata.go
constant DefaultAddress (line 29) | DefaultAddress = "http://metadata.google.internal/"
constant apiVersion (line 30) | apiVersion = "computeMetadata/v1/"
constant metadataPath (line 31) | metadataPath = apiVersion
constant userdataPath (line 32) | userdataPath = apiVersion + "instance/attributes/user-data"
type MetadataService (line 35) | type MetadataService struct
method FetchMetadata (line 46) | func (ms MetadataService) FetchMetadata() (datasource.Metadata, error) {
method Type (line 120) | func (ms MetadataService) Type() string {
method fetchString (line 124) | func (ms MetadataService) fetchString(key string) (string, error) {
method fetchIP (line 133) | func (ms MetadataService) fetchIP(key string) (net.IP, error) {
method FetchUserdata (line 149) | func (ms MetadataService) FetchUserdata() ([]byte, error) {
function NewDatasource (line 39) | func NewDatasource(root string) *MetadataService {
FILE: config/cloudinit/datasource/metadata/gce/metadata_test.go
function TestType (line 29) | func TestType(t *testing.T) {
function TestFetchMetadata (line 36) | func TestFetchMetadata(t *testing.T) {
function Error (line 109) | func Error(err error) string {
FILE: config/cloudinit/datasource/metadata/metadata.go
type Service (line 28) | type Service struct
method IsAvailable (line 52) | func (ms Service) IsAvailable() bool {
method Finish (line 61) | func (ms *Service) Finish() error {
method String (line 65) | func (ms *Service) String() string {
method AvailabilityChanges (line 69) | func (ms Service) AvailabilityChanges() bool {
method ConfigRoot (line 73) | func (ms Service) ConfigRoot() string {
method FetchUserdata (line 77) | func (ms Service) FetchUserdata() ([]byte, error) {
method FetchData (line 81) | func (ms Service) FetchData(url string) ([]byte, error) {
method MetadataURL (line 91) | func (ms Service) MetadataURL() string {
method UserdataURL (line 95) | func (ms Service) UserdataURL() string {
method FetchAttributes (line 99) | func (ms Service) FetchAttributes(key string) ([]string, error) {
method FetchAttribute (line 113) | func (ms Service) FetchAttribute(key string) (string, error) {
function NewDatasource (line 40) | func NewDatasource(root, apiVersion, userdataPath, metadataPath string, ...
function NewDatasourceWithCheckPath (line 45) | func NewDatasourceWithCheckPath(root, apiVersion, isAvailableCheckPath, ...
FILE: config/cloudinit/datasource/metadata/metadata_test.go
function TestAvailabilityChanges (line 27) | func TestAvailabilityChanges(t *testing.T) {
function TestIsAvailable (line 34) | func TestIsAvailable(t *testing.T) {
function TestFetchUserdata (line 66) | func TestFetchUserdata(t *testing.T) {
function TestURLs (line 109) | func TestURLs(t *testing.T) {
function TestNewDatasource (line 152) | func TestNewDatasource(t *testing.T) {
function TestFetchAttributes (line 181) | func TestFetchAttributes(t *testing.T) {
function TestFetchAttribute (line 235) | func TestFetchAttribute(t *testing.T) {
function Error (line 289) | func Error(err error) string {
FILE: config/cloudinit/datasource/metadata/packet/metadata.go
constant DefaultAddress (line 32) | DefaultAddress = "https://metadata.packet.net/"
constant apiVersion (line 33) | apiVersion = ""
constant userdataURL (line 34) | userdataURL = "userdata"
constant metadataPath (line 35) | metadataPath = "metadata"
type MetadataService (line 38) | type MetadataService struct
method FetchMetadata (line 50) | func (ms *MetadataService) FetchMetadata() (metadata datasource.Metada...
method Type (line 139) | func (ms MetadataService) Type() string {
function NewDatasource (line 42) | func NewDatasource(root string) *MetadataService {
FILE: config/cloudinit/datasource/metadata/test/test.go
type HTTPClient (line 23) | type HTTPClient struct
method GetRetry (line 28) | func (t *HTTPClient) GetRetry(url string) ([]byte, error) {
method Get (line 38) | func (t *HTTPClient) Get(url string) ([]byte, error) {
FILE: config/cloudinit/datasource/proccmdline/proc_cmdline.go
constant ProcCmdlineLocation (line 29) | ProcCmdlineLocation = "/proc/cmdline"
constant ProcCmdlineCloudConfigFlag (line 30) | ProcCmdlineCloudConfigFlag = "cloud-config-url"
type ProcCmdline (line 33) | type ProcCmdline struct
method IsAvailable (line 42) | func (c *ProcCmdline) IsAvailable() bool {
method Finish (line 54) | func (c *ProcCmdline) Finish() error {
method String (line 58) | func (c *ProcCmdline) String() string {
method AvailabilityChanges (line 62) | func (c *ProcCmdline) AvailabilityChanges() bool {
method ConfigRoot (line 66) | func (c *ProcCmdline) ConfigRoot() string {
method FetchMetadata (line 70) | func (c *ProcCmdline) FetchMetadata() (datasource.Metadata, error) {
method FetchUserdata (line 74) | func (c *ProcCmdline) FetchUserdata() ([]byte, error) {
method Type (line 95) | func (c *ProcCmdline) Type() string {
function NewDatasource (line 38) | func NewDatasource() *ProcCmdline {
function findCloudConfigURL (line 99) | func findCloudConfigURL(input string) (url string, err error) {
FILE: config/cloudinit/datasource/proccmdline/proc_cmdline_test.go
function TestParseCmdlineCloudConfigFound (line 26) | func TestParseCmdlineCloudConfigFound(t *testing.T) {
function TestProcCmdlineAndFetchConfig (line 68) | func TestProcCmdlineAndFetchConfig(t *testing.T) {
FILE: config/cloudinit/datasource/proxmox/proxmox.go
constant configDev (line 18) | configDev = "/dev/sr0"
constant configDevMountPoint (line 19) | configDevMountPoint = "/media/pve-config"
type Proxmox (line 22) | type Proxmox struct
method IsAvailable (line 33) | func (pve *Proxmox) IsAvailable() bool {
method Finish (line 48) | func (pve *Proxmox) Finish() error {
method String (line 52) | func (pve *Proxmox) String() string {
method AvailabilityChanges (line 59) | func (pve *Proxmox) AvailabilityChanges() bool {
method ConfigRoot (line 63) | func (pve *Proxmox) ConfigRoot() string {
method FetchMetadata (line 67) | func (pve *Proxmox) FetchMetadata() (metadata datasource.Metadata, err...
method FetchUserdata (line 71) | func (pve *Proxmox) FetchUserdata() ([]byte, error) {
method Type (line 75) | func (pve *Proxmox) Type() string {
method tryReadFile (line 79) | func (pve *Proxmox) tryReadFile(filename string) ([]byte, error) {
function NewDataSource (line 29) | func NewDataSource(root string) *Proxmox {
function MountConfigDrive (line 99) | func MountConfigDrive() error {
function UnmountConfigDrive (line 112) | func UnmountConfigDrive() error {
FILE: config/cloudinit/datasource/proxmox/proxmox_test.go
function TestFetchUserdata (line 9) | func TestFetchUserdata(t *testing.T) {
function TestConfigRoot (line 37) | func TestConfigRoot(t *testing.T) {
function TestNewDataSource (line 58) | func TestNewDataSource(t *testing.T) {
FILE: config/cloudinit/datasource/test/filesystem.go
type MockFilesystem (line 23) | type MockFilesystem
method ReadFile (line 31) | func (m MockFilesystem) ReadFile(filename string) ([]byte, error) {
type File (line 25) | type File struct
function NewMockFilesystem (line 41) | func NewMockFilesystem(files ...File) MockFilesystem {
FILE: config/cloudinit/datasource/test/filesystem_test.go
function TestReadFile (line 24) | func TestReadFile(t *testing.T) {
function TestNewMockFilesystem (line 63) | func TestNewMockFilesystem(t *testing.T) {
FILE: config/cloudinit/datasource/tftp/tftp.go
type Client (line 15) | type Client interface
type RemoteFile (line 19) | type RemoteFile struct
method IsAvailable (line 48) | func (f *RemoteFile) IsAvailable() bool {
method Finish (line 53) | func (f *RemoteFile) Finish() error {
method String (line 57) | func (f *RemoteFile) String() string {
method AvailabilityChanges (line 61) | func (f *RemoteFile) AvailabilityChanges() bool {
method ConfigRoot (line 65) | func (f *RemoteFile) ConfigRoot() string {
method FetchMetadata (line 69) | func (f *RemoteFile) FetchMetadata() (datasource.Metadata, error) {
method FetchUserdata (line 73) | func (f *RemoteFile) FetchUserdata() ([]byte, error) {
method Type (line 81) | func (f *RemoteFile) Type() string {
function NewDatasource (line 27) | func NewDatasource(hostAndPath string) *RemoteFile {
FILE: config/cloudinit/datasource/tftp/tftp_test.go
type mockClient (line 10) | type mockClient struct
method Receive (line 22) | func (c mockClient) Receive(filename string, mode string) (io.WriterTo...
type mockReceiver (line 13) | type mockReceiver struct
method WriteTo (line 16) | func (r mockReceiver) WriteTo(w io.Writer) (n int64, err error) {
function TestNewDatasource (line 31) | func TestNewDatasource(t *testing.T) {
function TestIsAvailable (line 55) | func TestIsAvailable(t *testing.T) {
function TestFetchUserdata (line 75) | func TestFetchUserdata(t *testing.T) {
function TestType (line 86) | func TestType(t *testing.T) {
FILE: config/cloudinit/datasource/url/url.go
type RemoteFile (line 25) | type RemoteFile struct
method IsAvailable (line 34) | func (f *RemoteFile) IsAvailable() bool {
method Finish (line 41) | func (f *RemoteFile) Finish() error {
method String (line 45) | func (f *RemoteFile) String() string {
method AvailabilityChanges (line 49) | func (f *RemoteFile) AvailabilityChanges() bool {
method ConfigRoot (line 63) | func (f *RemoteFile) ConfigRoot() string {
method FetchMetadata (line 67) | func (f *RemoteFile) FetchMetadata() (datasource.Metadata, error) {
method FetchUserdata (line 71) | func (f *RemoteFile) FetchUserdata() ([]byte, error) {
method Type (line 76) | func (f *RemoteFile) Type() string {
function NewDatasource (line 30) | func NewDatasource(url string) *RemoteFile {
FILE: config/cloudinit/datasource/vmware/vmware.go
type readConfigFunction (line 28) | type readConfigFunction
type urlDownloadFunction (line 29) | type urlDownloadFunction
type VMWare (line 31) | type VMWare struct
method Finish (line 38) | func (v VMWare) Finish() error {
method String (line 42) | func (v VMWare) String() string {
method AvailabilityChanges (line 46) | func (v VMWare) AvailabilityChanges() bool {
method ConfigRoot (line 50) | func (v VMWare) ConfigRoot() string {
method read (line 54) | func (v VMWare) read(keytmpl string, args ...interface{}) (string, err...
method FetchMetadata (line 59) | func (v VMWare) FetchMetadata() (metadata datasource.Metadata, err err...
method FetchUserdata (line 193) | func (v VMWare) FetchUserdata() ([]byte, error) {
method Type (line 226) | func (v VMWare) Type() string {
FILE: config/cloudinit/datasource/vmware/vmware_amd64.go
type ovfWrapper (line 30) | type ovfWrapper struct
method readConfig (line 34) | func (ovf ovfWrapper) readConfig(key string) (string, error) {
function NewDatasource (line 41) | func NewDatasource(fileName string) *VMWare {
method IsAvailable (line 77) | func (v VMWare) IsAvailable() bool {
function readConfig (line 93) | func readConfig(key string) (string, error) {
function getOvfReadConfig (line 103) | func getOvfReadConfig(ovfEnv []byte) readConfigFunction {
function urlDownload (line 113) | func urlDownload(url string) ([]byte, error) {
method checkGuestInfo (line 118) | func (v VMWare) checkGuestInfo() bool {
FILE: config/cloudinit/datasource/vmware/vmware_test.go
type MockHypervisor (line 33) | type MockHypervisor
method ReadConfig (line 35) | func (h MockHypervisor) ReadConfig(key string) (string, error) {
function TestFetchMetadata (line 52) | func TestFetchMetadata(t *testing.T) {
function TestFetchUserdata (line 207) | func TestFetchUserdata(t *testing.T) {
function TestFetchUserdataError (line 275) | func TestFetchUserdataError(t *testing.T) {
function TestOvfTransport (line 284) | func TestOvfTransport(t *testing.T) {
FILE: config/cloudinit/datasource/vmware/vmware_unsupported.go
function NewDatasource (line 20) | func NewDatasource(fileName string) *VMWare {
method IsAvailable (line 24) | func (v VMWare) IsAvailable() bool {
FILE: config/cloudinit/initialize/env.go
constant DefaultSSHKeyName (line 29) | DefaultSSHKeyName = "coreos-cloudinit"
type Environment (line 31) | type Environment struct
method Workspace (line 56) | func (e *Environment) Workspace() string {
method Root (line 60) | func (e *Environment) Root() string {
method ConfigRoot (line 64) | func (e *Environment) ConfigRoot() string {
method SSHKeyName (line 68) | func (e *Environment) SSHKeyName() string {
method SetSSHKeyName (line 72) | func (e *Environment) SetSSHKeyName(name string) {
method Apply (line 79) | func (e *Environment) Apply(data string) string {
method DefaultEnvironmentFile (line 92) | func (e *Environment) DefaultEnvironmentFile() *system.EnvFile {
function NewEnvironment (line 40) | func NewEnvironment(root, configRoot, workspace, sshKeyName string, meta...
FILE: config/cloudinit/initialize/env_test.go
function TestEnvironmentApply (line 28) | func TestEnvironmentApply(t *testing.T) {
function TestEnvironmentFile (line 106) | func TestEnvironmentFile(t *testing.T) {
function TestEnvironmentFileNil (line 139) | func TestEnvironmentFileNil(t *testing.T) {
FILE: config/cloudinit/initialize/github.go
function SSHImportGithubUser (line 23) | func SSHImportGithubUser(systemUser string, githubUser string) error {
FILE: config/cloudinit/initialize/ssh_keys.go
type UserKey (line 25) | type UserKey struct
function SSHImportKeysFromURL (line 30) | func SSHImportKeysFromURL(systemUser string, url string) error {
function fetchUserKeys (line 40) | func fetchUserKeys(url string) ([]string, error) {
FILE: config/cloudinit/initialize/ssh_keys_test.go
function TestCloudConfigUsersURLMarshal (line 24) | func TestCloudConfigUsersURLMarshal(t *testing.T) {
FILE: config/cloudinit/initialize/user_data.go
function ParseUserData (line 28) | func ParseUserData(contents string) (interface{}, error) {
FILE: config/cloudinit/initialize/user_data_test.go
function TestParseHeaderCRLF (line 23) | func TestParseHeaderCRLF(t *testing.T) {
function TestParseConfigCRLF (line 49) | func TestParseConfigCRLF(t *testing.T) {
function TestParseConfigEmpty (line 67) | func TestParseConfigEmpty(t *testing.T) {
FILE: config/cloudinit/initialize/workspace.go
function PrepWorkspace (line 26) | func PrepWorkspace(workspace string) error {
function PersistScriptInWorkspace (line 35) | func PersistScriptInWorkspace(script config.Script, workspace string) (s...
function PersistUnitNameInWorkspace (line 54) | func PersistUnitNameInWorkspace(name string, workspace string) error {
FILE: config/cloudinit/network/debian.go
function ProcessDebianNetconf (line 22) | func ProcessDebianNetconf(config []byte) ([]InterfaceGenerator, error) {
function formatConfig (line 43) | func formatConfig(config string) []string {
FILE: config/cloudinit/network/debian_test.go
function TestFormatConfigs (line 21) | func TestFormatConfigs(t *testing.T) {
function TestProcessDebianNetconf (line 36) | func TestProcessDebianNetconf(t *testing.T) {
FILE: config/cloudinit/network/interface.go
type InterfaceGenerator (line 25) | type InterfaceGenerator interface
type networkInterface (line 35) | type networkInterface interface
type logicalInterface (line 41) | type logicalInterface struct
method Name (line 49) | func (i *logicalInterface) Name() string {
method Network (line 53) | func (i *logicalInterface) Network() string {
method Link (line 93) | func (i *logicalInterface) Link() string {
method Netdev (line 97) | func (i *logicalInterface) Netdev() string {
method Filename (line 101) | func (i *logicalInterface) Filename() string {
method Children (line 109) | func (i *logicalInterface) Children() []networkInterface {
method ModprobeParams (line 113) | func (i *logicalInterface) ModprobeParams() string {
method setConfigDepth (line 117) | func (i *logicalInterface) setConfigDepth(depth int) {
type physicalInterface (line 121) | type physicalInterface struct
method Type (line 125) | func (p *physicalInterface) Type() string {
type bondInterface (line 129) | type bondInterface struct
method Netdev (line 135) | func (b *bondInterface) Netdev() string {
method Type (line 149) | func (b *bondInterface) Type() string {
method ModprobeParams (line 153) | func (b *bondInterface) ModprobeParams() string {
type vlanInterface (line 162) | type vlanInterface struct
method Netdev (line 168) | func (v *vlanInterface) Netdev() string {
method Type (line 184) | func (v *vlanInterface) Type() string {
function buildInterfaces (line 188) | func buildInterfaces(stanzas []*stanzaInterface) []InterfaceGenerator {
function createInterfaces (line 201) | func createInterfaces(stanzas []*stanzaInterface) map[string]networkInte...
function linkAncestors (line 274) | func linkAncestors(interfaceMap map[string]networkInterface) {
function markConfigDepths (line 302) | func markConfigDepths(interfaceMap map[string]networkInterface) {
function setDepth (line 318) | func setDepth(iface networkInterface) int {
function sortedKeys (line 329) | func sortedKeys(m map[string]string) (keys []string) {
function sortedInterfaces (line 337) | func sortedInterfaces(m map[string]networkInterface) (keys []string) {
FILE: config/cloudinit/network/interface_test.go
function TestInterfaceGenerators (line 23) | func TestInterfaceGenerators(t *testing.T) {
function TestModprobeParams (line 123) | func TestModprobeParams(t *testing.T) {
function TestBuildInterfacesLo (line 154) | func TestBuildInterfacesLo(t *testing.T) {
function TestBuildInterfacesBlindBond (line 170) | func TestBuildInterfacesBlindBond(t *testing.T) {
function TestBuildInterfacesBlindVLAN (line 207) | func TestBuildInterfacesBlindVLAN(t *testing.T) {
function TestBuildInterfaces (line 245) | func TestBuildInterfaces(t *testing.T) {
function TestFilename (line 353) | func TestFilename(t *testing.T) {
FILE: config/cloudinit/network/is_go15_false_test.go
constant isGo15 (line 6) | isGo15 = false
FILE: config/cloudinit/network/is_go15_true_test.go
constant isGo15 (line 6) | isGo15 = true
FILE: config/cloudinit/network/packet.go
function ProcessPacketNetconf (line 23) | func ProcessPacketNetconf(netdata netconf.NetworkConfig) ([]InterfaceGen...
function parseNetwork (line 40) | func parseNetwork(netdata netconf.NetworkConfig, nameservers []net.IP) (...
FILE: config/cloudinit/network/stanza.go
type stanza (line 24) | type stanza interface
type stanzaAuto (line 26) | type stanzaAuto struct
type stanzaInterface (line 30) | type stanzaInterface struct
type interfaceKind (line 38) | type interfaceKind
constant interfaceBond (line 41) | interfaceBond = interfaceKind(iota)
constant interfacePhysical (line 42) | interfacePhysical
constant interfaceVLAN (line 43) | interfaceVLAN
type route (line 46) | type route struct
type configMethod (line 51) | type configMethod interface
type configMethodStatic (line 53) | type configMethodStatic struct
type configMethodLoopback (line 61) | type configMethodLoopback struct
type configMethodManual (line 63) | type configMethodManual struct
type configMethodDHCP (line 65) | type configMethodDHCP struct
function parseStanzas (line 69) | func parseStanzas(lines []string) (stanzas []stanza, err error) {
function splitStanzas (line 105) | func splitStanzas(lines []string) ([][]string, error) {
function isStanzaStart (line 128) | func isStanzaStart(line string) bool {
function parseStanza (line 145) | func parseStanza(rawStanza []string) (stanza, error) {
function parseAutoStanza (line 167) | func parseAutoStanza(attributes []string, options []string) (*stanzaAuto...
function parseInterfaceStanza (line 171) | func parseInterfaceStanza(attributes []string, options []string) (*stanz...
function parseHwaddress (line 302) | func parseHwaddress(options map[string][]string, iface string) (net.Hard...
function parseBondStanza (line 315) | func parseBondStanza(iface string, conf configMethod, attributes []strin...
function parsePhysicalStanza (line 319) | func parsePhysicalStanza(iface string, conf configMethod, attributes []s...
function parseVLANStanza (line 323) | func parseVLANStanza(iface string, conf configMethod, attributes []strin...
FILE: config/cloudinit/network/stanza_test.go
function TestSplitStanzasNoParent (line 24) | func TestSplitStanzasNoParent(t *testing.T) {
function TestBadParseStanzas (line 33) | func TestBadParseStanzas(t *testing.T) {
function TestBadParseInterfaceStanza (line 47) | func TestBadParseInterfaceStanza(t *testing.T) {
function TestBadParseVLANStanzas (line 69) | func TestBadParseVLANStanzas(t *testing.T) {
function TestSplitStanzas (line 80) | func TestSplitStanzas(t *testing.T) {
function TestParseStanzaNil (line 110) | func TestParseStanzaNil(t *testing.T) {
function TestParseStanzaSuccess (line 119) | func TestParseStanzaSuccess(t *testing.T) {
function TestParseAutoStanza (line 130) | func TestParseAutoStanza(t *testing.T) {
function TestParseBondStanzaNoSlaves (line 141) | func TestParseBondStanzaNoSlaves(t *testing.T) {
function TestParseBondStanza (line 151) | func TestParseBondStanza(t *testing.T) {
function TestParsePhysicalStanza (line 171) | func TestParsePhysicalStanza(t *testing.T) {
function TestParseVLANStanzas (line 195) | func TestParseVLANStanzas(t *testing.T) {
function TestParseInterfaceStanzaStaticAddress (line 209) | func TestParseInterfaceStanzaStaticAddress(t *testing.T) {
function TestParseInterfaceStanzaStaticGateway (line 231) | func TestParseInterfaceStanzaStaticGateway(t *testing.T) {
function TestParseInterfaceStanzaStaticDNS (line 256) | func TestParseInterfaceStanzaStaticDNS(t *testing.T) {
function TestBadParseInterfaceStanzasStaticPostUp (line 276) | func TestBadParseInterfaceStanzasStaticPostUp(t *testing.T) {
function TestParseInterfaceStanzaStaticPostUp (line 301) | func TestParseInterfaceStanzaStaticPostUp(t *testing.T) {
function TestParseInterfaceStanzaLoopback (line 356) | func TestParseInterfaceStanzaLoopback(t *testing.T) {
function TestParseInterfaceStanzaManual (line 366) | func TestParseInterfaceStanzaManual(t *testing.T) {
function TestParseInterfaceStanzaDHCP (line 376) | func TestParseInterfaceStanzaDHCP(t *testing.T) {
function TestParseInterfaceStanzaPostUpOption (line 386) | func TestParseInterfaceStanzaPostUpOption(t *testing.T) {
function TestParseInterfaceStanzaPreDownOption (line 402) | func TestParseInterfaceStanzaPreDownOption(t *testing.T) {
function TestParseInterfaceStanzaEmptyOption (line 418) | func TestParseInterfaceStanzaEmptyOption(t *testing.T) {
function TestParseInterfaceStanzaOptions (line 431) | func TestParseInterfaceStanzaOptions(t *testing.T) {
function TestParseInterfaceStanzaHwaddress (line 451) | func TestParseInterfaceStanzaHwaddress(t *testing.T) {
function TestParseInterfaceStanzaBond (line 490) | func TestParseInterfaceStanzaBond(t *testing.T) {
function TestParseInterfaceStanzaVLANName (line 500) | func TestParseInterfaceStanzaVLANName(t *testing.T) {
function TestParseInterfaceStanzaVLANOption (line 510) | func TestParseInterfaceStanzaVLANOption(t *testing.T) {
function TestParseStanzasNone (line 520) | func TestParseStanzasNone(t *testing.T) {
function TestParseStanzas (line 530) | func TestParseStanzas(t *testing.T) {
FILE: config/cloudinit/network/vmware.go
function ProcessVMwareNetconf (line 23) | func ProcessVMwareNetconf(config map[string]string) ([]InterfaceGenerato...
function processAddressConfig (line 117) | func processAddressConfig(config map[string]string, prefix string) (addr...
function processRouteConfig (line 139) | func processRouteConfig(config map[string]string, prefix string) (routes...
function processDHCPConfig (line 172) | func processDHCPConfig(config map[string]string, prefix string) (dhcp bo...
FILE: config/cloudinit/network/vmware_test.go
function mustParseMac (line 24) | func mustParseMac(mac net.HardwareAddr, err error) net.HardwareAddr {
function TestProcessVMwareNetconf (line 31) | func TestProcessVMwareNetconf(t *testing.T) {
function TestProcessAddressConfig (line 173) | func TestProcessAddressConfig(t *testing.T) {
function TestProcessRouteConfig (line 260) | func TestProcessRouteConfig(t *testing.T) {
function TestProcessDHCPConfig (line 330) | func TestProcessDHCPConfig(t *testing.T) {
FILE: config/cloudinit/pkg/http_client.go
constant HTTP2xx (line 30) | HTTP2xx = 2
constant HTTP4xx (line 31) | HTTP4xx = 4
type Err (line 34) | type Err
type ErrTimeout (line 36) | type ErrTimeout struct
type ErrNotFound (line 40) | type ErrNotFound struct
type ErrInvalid (line 44) | type ErrInvalid struct
type ErrServer (line 48) | type ErrServer struct
type ErrNetwork (line 52) | type ErrNetwork struct
type HTTPClient (line 56) | type HTTPClient struct
method GetRetry (line 104) | func (h *HTTPClient) GetRetry(rawurl string) ([]byte, error) {
method Get (line 146) | func (h *HTTPClient) Get(dataURL string) ([]byte, error) {
type Getter (line 72) | type Getter interface
function NewHTTPClient (line 77) | func NewHTTPClient() *HTTPClient {
function NewHTTPClientHeader (line 81) | func NewHTTPClientHeader(header http.Header) *HTTPClient {
function ExpBackoff (line 95) | func ExpBackoff(interval, max time.Duration) time.Duration {
FILE: config/cloudinit/pkg/http_client_test.go
function TestExpBackoff (line 27) | func TestExpBackoff(t *testing.T) {
function TestGetURLExpBackOff (line 43) | func TestGetURLExpBackOff(t *testing.T) {
function TestGetURL4xx (line 84) | func TestGetURL4xx(t *testing.T) {
function TestGetURL2xx (line 104) | func TestGetURL2xx(t *testing.T) {
function TestGetMalformedURL (line 135) | func TestGetMalformedURL(t *testing.T) {
FILE: config/cloudinit/system/env.go
function serviceContents (line 26) | func serviceContents(e interface{}) string {
function getEnvVars (line 39) | func getEnvVars(e interface{}) []string {
FILE: config/cloudinit/system/env_file.go
type EnvFile (line 27) | type EnvFile struct
function mergeEnvContents (line 43) | func mergeEnvContents(old []byte, pending map[string]string) []byte {
function WriteEnvFile (line 74) | func WriteEnvFile(ef *EnvFile, root string) error {
function keys (line 108) | func keys(m map[string]string) (s []string) {
FILE: config/cloudinit/system/env_file_test.go
constant base (line 29) | base = "# a file\nFOO=base\n\nBAR= hi there\n"
constant baseNoNewline (line 30) | baseNoNewline = "# a file\nFOO=base\n\nBAR= hi there"
constant baseDos (line 31) | baseDos = "# a file\r\nFOO=base\r\n\r\nBAR= hi there\r\n"
constant expectUpdate (line 32) | expectUpdate = "# a file\nFOO=test\n\nBAR= hi there\nNEW=a value\n"
constant expectCreate (line 33) | expectCreate = "FOO=test\nNEW=a value\n"
function TestWriteEnvFileUpdate (line 50) | func TestWriteEnvFileUpdate(t *testing.T) {
function TestWriteEnvFileUpdateNoNewline (line 97) | func TestWriteEnvFileUpdateNoNewline(t *testing.T) {
function TestWriteEnvFileCreate (line 144) | func TestWriteEnvFileCreate(t *testing.T) {
function TestWriteEnvFileNoop (line 176) | func TestWriteEnvFileNoop(t *testing.T) {
function TestWriteEnvFileUpdateDos (line 223) | func TestWriteEnvFileUpdateDos(t *testing.T) {
function TestWriteEnvFileDos2Unix (line 272) | func TestWriteEnvFileDos2Unix(t *testing.T) {
function TestWriteEnvFileEmpty (line 320) | func TestWriteEnvFileEmpty(t *testing.T) {
function TestWriteEnvFileEmptyNoCreate (line 368) | func TestWriteEnvFileEmptyNoCreate(t *testing.T) {
function SvenBrokeTestWriteEnvFilePermFailure (line 398) | func SvenBrokeTestWriteEnvFilePermFailure(t *testing.T) {
function TestWriteEnvFileNameFailure (line 422) | func TestWriteEnvFileNameFailure(t *testing.T) {
FILE: config/cloudinit/system/env_test.go
function TestServiceContents (line 21) | func TestServiceContents(t *testing.T) {
FILE: config/cloudinit/system/etc_hosts.go
constant DefaultIpv4Address (line 26) | DefaultIpv4Address = "127.0.0.1"
type EtcHosts (line 28) | type EtcHosts struct
method generateEtcHosts (line 32) | func (eh EtcHosts) generateEtcHosts() (out string, err error) {
method File (line 47) | func (eh EtcHosts) File() (*File, error) {
FILE: config/cloudinit/system/etc_hosts_test.go
function TestEtcdHostsFile (line 26) | func TestEtcdHostsFile(t *testing.T) {
FILE: config/cloudinit/system/etcd.go
type Etcd (line 23) | type Etcd struct
method Units (line 28) | func (ee Etcd) Units() []Unit {
FILE: config/cloudinit/system/etcd2.go
type Etcd2 (line 23) | type Etcd2 struct
method Units (line 28) | func (ee Etcd2) Units() []Unit {
FILE: config/cloudinit/system/etcd_test.go
function TestEtcdUnits (line 24) | func TestEtcdUnits(t *testing.T) {
FILE: config/cloudinit/system/file.go
type File (line 31) | type File struct
method Permissions (line 35) | func (f *File) Permissions() (os.FileMode, error) {
function WriteFile (line 49) | func WriteFile(f *File, root string) (string, error) {
function EnsureDirectoryExists (line 102) | func EnsureDirectoryExists(dir string) error {
FILE: config/cloudinit/system/file_test.go
function TestWriteFileUnencodedContent (line 26) | func TestWriteFileUnencodedContent(t *testing.T) {
function TestWriteFileInvalidPermission (line 68) | func TestWriteFileInvalidPermission(t *testing.T) {
function TestDecimalFilePermissions (line 86) | func TestDecimalFilePermissions(t *testing.T) {
function TestWriteFilePermissions (line 118) | func TestWriteFilePermissions(t *testing.T) {
function TestWriteFileInvalidEncodedContent (line 150) | func TestWriteFileInvalidEncodedContent(t *testing.T) {
function TestWriteFileUnknownEncodedContent (line 181) | func TestWriteFileUnknownEncodedContent(t *testing.T) {
FILE: config/cloudinit/system/flannel.go
type Flannel (line 26) | type Flannel struct
method envVars (line 30) | func (fl Flannel) envVars() string {
method File (line 34) | func (fl Flannel) File() (*File, error) {
FILE: config/cloudinit/system/flannel_test.go
function TestFlannelEnvVars (line 24) | func TestFlannelEnvVars(t *testing.T) {
function TestFlannelFile (line 49) | func TestFlannelFile(t *testing.T) {
FILE: config/cloudinit/system/fleet.go
type Fleet (line 23) | type Fleet struct
method Units (line 29) | func (fe Fleet) Units() []Unit {
FILE: config/cloudinit/system/fleet_test.go
function TestFleetUnits (line 24) | func TestFleetUnits(t *testing.T) {
FILE: config/cloudinit/system/locksmith.go
type Locksmith (line 23) | type Locksmith struct
method Units (line 28) | func (ee Locksmith) Units() []Unit {
FILE: config/cloudinit/system/locksmith_test.go
function TestLocksmithUnits (line 24) | func TestLocksmithUnits(t *testing.T) {
FILE: config/cloudinit/system/oem.go
type OEM (line 26) | type OEM struct
method File (line 30) | func (oem OEM) File() (*File, error) {
FILE: config/cloudinit/system/oem_test.go
function TestOEMFile (line 24) | func TestOEMFile(t *testing.T) {
FILE: config/cloudinit/system/ssh_key.go
function AuthorizeSSHKeys (line 27) | func AuthorizeSSHKeys(user string, keysName string, keys []string) error {
FILE: config/cloudinit/system/unit.go
type UnitManager (line 26) | type UnitManager interface
type Unit (line 39) | type Unit struct
method Type (line 45) | func (u Unit) Type() string {
method Group (line 52) | func (u Unit) Group() string {
method Destination (line 64) | func (u Unit) Destination(root string) string {
method DropInDestination (line 72) | func (u Unit) DropInDestination(root string, dropIn config.UnitDropIn)...
method prefix (line 76) | func (u Unit) prefix(root string) string {
FILE: config/cloudinit/system/unit_test.go
function TestType (line 23) | func TestType(t *testing.T) {
function TestGroup (line 45) | func TestGroup(t *testing.T) {
function TestDestination (line 68) | func TestDestination(t *testing.T) {
function TestDropInDestination (line 100) | func TestDropInDestination(t *testing.T) {
FILE: config/cloudinit/system/update.go
constant locksmithUnit (line 31) | locksmithUnit = "locksmithd.service"
constant updateEngineUnit (line 32) | updateEngineUnit = "update-engine.service"
type Update (line 39) | type Update struct
method File (line 58) | func (uc Update) File() (*File, error) {
method Units (line 117) | func (uc Update) Units() []Unit {
function DefaultReadConfig (line 44) | func DefaultReadConfig() (io.Reader, error) {
function sortedKeys (line 145) | func sortedKeys(m map[string]string) (keys []string) {
FILE: config/cloudinit/system/update_test.go
function testReadConfig (line 26) | func testReadConfig(config string) func() (io.Reader, error) {
function TestUpdateUnits (line 32) | func TestUpdateUnits(t *testing.T) {
function TestUpdateFile (line 89) | func TestUpdateFile(t *testing.T) {
FILE: config/cloudinit/system/user.go
function UserExists (line 27) | func UserExists(u *config.User) bool {
function CreateUser (line 32) | func CreateUser(u *config.User) error {
function SetUserPassword (line 88) | func SetUserPassword(user, hash string) error {
FILE: config/cmdline/cmdline.go
function Read (line 13) | func Read(parseAll bool) (m map[interface{}]interface{}, err error) {
function GetCmdline (line 28) | func GetCmdline(key string) interface{} {
function GetOrSetVal (line 39) | func GetOrSetVal(args string, data map[interface{}]interface{}, value in...
function reverseReplacement (line 96) | func reverseReplacement(result interface{}) interface{} {
function UnmarshalOrReturnString (line 118) | func UnmarshalOrReturnString(value string) (result interface{}) {
function splitCmdLine (line 130) | func splitCmdLine(cmdLine string) []string {
function Parse (line 152) | func Parse(cmdLine string, parseAll bool) map[interface{}]interface{} {
FILE: config/config.go
constant Banner (line 12) | Banner = `
function Merge (line 23) | func Merge(bytes []byte) error {
function Export (line 35) | func Export(private, full bool) (string, error) {
function filterPrivateKeys (line 45) | func filterPrivateKeys(data map[interface{}]interface{}) map[interface{}...
function filterAdditional (line 53) | func filterAdditional(data map[interface{}]interface{}) map[interface{}]...
function Get (line 61) | func Get(key string) (interface{}, error) {
function Set (line 73) | func Set(key string, value interface{}) error {
function GetKernelVersion (line 89) | func GetKernelVersion() string {
FILE: config/config_test.go
function TestFilterKey (line 13) | func TestFilterKey(t *testing.T) {
function TestUnmarshalOrReturnString (line 58) | func TestUnmarshalOrReturnString(t *testing.T) {
function TestCmdlineParse (line 104) | func TestCmdlineParse(t *testing.T) {
function TestGet (line 187) | func TestGet(t *testing.T) {
function TestSet (line 214) | func TestSet(t *testing.T) {
type OuterData (line 262) | type OuterData struct
type Data (line 266) | type Data struct
function TestMapMerge (line 271) | func TestMapMerge(t *testing.T) {
function TestUserDocker (line 296) | func TestUserDocker(t *testing.T) {
FILE: config/data_funcs.go
type CfgFunc (line 8) | type CfgFunc
type CfgFuncData (line 9) | type CfgFuncData struct
type CfgFuncs (line 14) | type CfgFuncs
function ChainCfgFuncs (line 16) | func ChainCfgFuncs(cfg *CloudConfig, cfgFuncs CfgFuncs) (*CloudConfig, e...
function filterKey (line 37) | func filterKey(data map[interface{}]interface{}, key []string) (filtered...
FILE: config/disk.go
function ReadConfig (line 24) | func ReadConfig(bytes []byte, substituteMetadataVars bool, files ...stri...
function loadRawDiskConfig (line 39) | func loadRawDiskConfig(dirPrefix string, full bool) map[interface{}]inte...
function loadRawDiskConfigWithError (line 52) | func loadRawDiskConfigWithError(dirPrefix string, full bool) (map[interf...
function loadRawConfig (line 67) | func loadRawConfig(dirPrefix string, full bool) map[interface{}]interfac...
function loadRawConfigWithError (line 79) | func loadRawConfigWithError(dirPrefix string, full bool) (map[interface{...
function LoadConfig (line 94) | func LoadConfig() *CloudConfig {
function LoadConfigWithError (line 106) | func LoadConfigWithError() (*CloudConfig, *gojsonschema.Result, error) {
function LoadConfigWithPrefix (line 121) | func LoadConfigWithPrefix(dirPrefix string) *CloudConfig {
function Insert (line 146) | func Insert(m interface{}, args ...interface{}) interface{} {
function SaveInitCmdline (line 161) | func SaveInitCmdline(cmdLineArgs string) {
function CloudConfigDirFiles (line 175) | func CloudConfigDirFiles(dirPrefix string) []string {
function applyDebugFlags (line 199) | func applyDebugFlags(rawCfg map[interface{}]interface{}) map[interface{}...
function mergeMetadata (line 221) | func mergeMetadata(rawCfg map[interface{}]interface{}, md datasource.Met...
function readMetadata (line 263) | func readMetadata() datasource.Metadata {
function readElidedCmdline (line 271) | func readElidedCmdline(rawCfg map[interface{}]interface{}) map[interface...
function amendNils (line 285) | func amendNils(c *CloudConfig) *CloudConfig {
function amendContainerNames (line 308) | func amendContainerNames(c *CloudConfig) *CloudConfig {
function WriteToFile (line 320) | func WriteToFile(data interface{}, filename string) error {
function readConfigs (line 333) | func readConfigs(bytes []byte, substituteMetadataVars, returnErr bool, f...
function readConfigFile (line 408) | func readConfigFile(file string) ([]byte, error) {
function substituteVars (line 423) | func substituteVars(userDataBytes []byte, metadata datasource.Metadata) ...
FILE: config/docker_config.go
method FullArgs (line 10) | func (d *DockerConfig) FullArgs() []string {
method AppendEnv (line 26) | func (d *DockerConfig) AppendEnv() []string {
function generateEngineOptsSlice (line 30) | func generateEngineOptsSlice(opts EngineOpts) []string {
FILE: config/docker_config_test.go
function testContains (line 9) | func testContains(t *testing.T, s string, substrs ...string) {
function TestGenerateEngineOptsString (line 17) | func TestGenerateEngineOptsString(t *testing.T) {
FILE: config/metadata_test.go
function TestSubstituteUserDataVars (line 25) | func TestSubstituteUserDataVars(t *testing.T) {
FILE: config/types.go
constant OemDir (line 16) | OemDir = "/usr/share/ros/oem"
constant BootDir (line 17) | BootDir = "/boot"
constant StateDir (line 18) | StateDir = "/state"
constant RosBin (line 19) | RosBin = "/usr/bin/ros"
constant SysInitBin (line 20) | SysInitBin = "/usr/bin/ros-sysinit"
constant SystemDockerHost (line 21) | SystemDockerHost = "unix:///var/run/system-docker.sock"
constant DockerHost (line 22) | DockerHost = "unix:///var/run/docker.sock"
constant ImagesPath (line 23) | ImagesPath = "/usr/share/ros"
constant InitImages (line 24) | InitImages = "images-init.tar"
constant SystemImages (line 25) | SystemImages = "images-system.tar"
constant UserImages (line 26) | UserImages = "images-user.tar"
constant Debug (line 27) | Debug = false
constant SystemDockerBin (line 28) | SystemDockerBin = "/usr/bin/system-dockerd"
constant DefaultDind (line 29) | DefaultDind = "burmilla/os-dind:17.12.1"
constant DetachLabel (line 31) | DetachLabel = "io.rancher.os.detach"
constant CreateOnlyLabel (line 32) | CreateOnlyLabel = "io.rancher.os.createonly"
constant ReloadConfigLabel (line 33) | ReloadConfigLabel = "io.rancher.os.reloadconfig"
constant ConsoleLabel (line 34) | ConsoleLabel = "io.rancher.os.console"
constant ScopeLabel (line 35) | ScopeLabel = "io.rancher.os.scope"
constant RebuildLabel (line 36) | RebuildLabel = "io.docker.compose.rebuild"
constant UserDockerLabel (line 37) | UserDockerLabel = "io.rancher.user_docker.name"
constant UserDockerNetLabel (line 38) | UserDockerNetLabel = "io.rancher.user_docker.net"
constant UserDockerFIPLabel (line 39) | UserDockerFIPLabel = "io.rancher.user_docker.fix_ip"
constant System (line 40) | System = "system"
constant OsConfigFile (line 42) | OsConfigFile = "/usr/share/ros/os-config.yml"
constant VarRancherDir (line 43) | VarRancherDir = "/var/lib/rancher"
constant CloudConfigDir (line 44) | CloudConfigDir = "/var/lib/rancher/conf/cloud-config.d"
constant CloudConfigInitFile (line 45) | CloudConfigInitFile = "/var/lib/rancher/conf/cloud-config.d/init.yml"
constant CloudConfigBootFile (line 46) | CloudConfigBootFile = "/var/lib/rancher/conf/cloud-config.d/boot.yml"
constant CloudConfigNetworkFile (line 47) | CloudConfigNetworkFile = "/var/lib/rancher/conf/cloud-config.d/network.yml"
constant CloudConfigScriptFile (line 48) | CloudConfigScriptFile = "/var/lib/rancher/conf/cloud-config-script"
constant MetaDataFile (line 49) | MetaDataFile = "/var/lib/rancher/conf/metadata"
constant CloudConfigFile (line 50) | CloudConfigFile = "/var/lib/rancher/conf/cloud-config.yml"
constant EtcResolvConfFile (line 51) | EtcResolvConfFile = "/etc/resolv.conf"
constant WPAConfigFile (line 52) | WPAConfigFile = "/etc/wpa_supplicant-%s.conf"
constant WPATemplateFile (line 53) | WPATemplateFile = "/etc/wpa_supplicant.conf.tpl"
constant DHCPCDConfigFile (line 54) | DHCPCDConfigFile = "/etc/dhcpcd.conf"
constant DHCPCDTemplateFile (line 55) | DHCPCDTemplateFile = "/etc/dhcpcd.conf.tpl"
constant MultiDockerConfFile (line 56) | MultiDockerConfFile = "/var/lib/rancher/conf.d/m-user-docker.yml"
constant MultiDockerDataDir (line 57) | MultiDockerDataDir = "/var/lib/m-user-docker"
constant UdevRulesDir (line 58) | UdevRulesDir = "/etc/udev/rules.d"
constant UdevRulesExtrasDir (line 59) | UdevRulesExtrasDir = "/lib/udev/rules-extras.d"
function init (line 88) | func init() {
type Repository (line 103) | type Repository struct
type Repositories (line 107) | type Repositories
method ToArray (line 239) | func (r Repositories) ToArray() []string {
type CloudConfig (line 109) | type CloudConfig struct
type File (line 119) | type File struct
type RancherConfig (line 124) | type RancherConfig struct
type UpgradeConfig (line 159) | type UpgradeConfig struct
type EngineOpts (line 166) | type EngineOpts struct
type DockerConfig (line 187) | type DockerConfig struct
type SSHConfig (line 203) | type SSHConfig struct
type StateConfig (line 210) | type StateConfig struct
type CloudInit (line 228) | type CloudInit struct
type Defaults (line 232) | type Defaults struct
FILE: config/validate.go
function ConvertKeysToStrings (line 10) | func ConvertKeysToStrings(item interface{}) interface{} {
function ValidateBytes (line 34) | func ValidateBytes(bytes []byte) (*gojsonschema.Result, error) {
function ValidateRawCfg (line 42) | func ValidateRawCfg(rawCfg interface{}) (*gojsonschema.Result, error) {
FILE: config/validate_test.go
function testValidate (line 13) | func testValidate(t *testing.T, cfg []byte, contains string) {
function TestValidate (line 28) | func TestValidate(t *testing.T) {
FILE: config/yaml/command.go
type StringandSlice (line 7) | type StringandSlice struct
method UnmarshalYAML (line 14) | func (s *StringandSlice) UnmarshalYAML(tag string, value interface{}) ...
function toStrings (line 31) | func toStrings(s []interface{}) ([]string, error) {
FILE: main.go
function main (line 41) | func main() {
FILE: pkg/compose/project.go
function CreateService (line 26) | func CreateService(cfg *config.CloudConfig, name string, serviceConfig *...
function CreateServiceSet (line 41) | func CreateServiceSet(name string, cfg *config.CloudConfig, configs map[...
function RunServiceSet (line 52) | func RunServiceSet(name string, cfg *config.CloudConfig, configs map[str...
function GetProject (line 62) | func GetProject(cfg *config.CloudConfig, networkingAvailable, loadConsol...
function newProject (line 66) | func newProject(name string, cfg *config.CloudConfig, environmentLookup ...
function preprocessServiceMap (line 103) | func preprocessServiceMap(serviceMap composeConfig.RawServiceMap) (compo...
function preprocess (line 122) | func preprocess(item interface{}, replaceTypes bool) interface{} {
function addServices (line 151) | func addServices(p *project.Project, enabled map[interface{}]interface{}...
function adjustContainerNames (line 177) | func adjustContainerNames(m map[interface{}]interface{}) map[interface{}...
function newCoreServiceProject (line 190) | func newCoreServiceProject(cfg *config.CloudConfig, useNetwork, loadCons...
function StageServices (line 222) | func StageServices(cfg *config.CloudConfig, services ...string) error {
FILE: pkg/compose/reload.go
function LoadService (line 16) | func LoadService(p *project.Project, cfg *config.CloudConfig, useNetwork...
function LoadSpecialService (line 54) | func LoadSpecialService(p *project.Project, cfg *config.CloudConfig, ser...
function loadConsoleService (line 71) | func loadConsoleService(cfg *config.CloudConfig, p *project.Project) err...
function loadEngineService (line 78) | func loadEngineService(cfg *config.CloudConfig, p *project.Project) error {
function projectReload (line 85) | func projectReload(p *project.Project, useNetwork *bool, loadConsole boo...
FILE: pkg/dfs/scratch.go
constant defaultPrefix (line 24) | defaultPrefix = "/usr"
constant iptables (line 25) | iptables = "/sbin/iptables"
constant modprobe (line 26) | modprobe = "/sbin/modprobe"
constant distSuffix (line 27) | distSuffix = ".dist"
type Config (line 44) | type Config struct
function createMounts (line 61) | func createMounts(mounts ...[]string) error {
function createDirs (line 73) | func createDirs(dirs ...string) error {
function mountCgroups (line 87) | func mountCgroups(hierarchyConfig map[string]string) error {
function CreateSymlinks (line 133) | func CreateSymlinks(pathSets [][]string) error {
function CreateSymlink (line 143) | func CreateSymlink(src, dest string) error {
function mountCgroup (line 154) | func mountCgroup(cgroup string) error {
function execDocker (line 175) | func execDocker(config *Config, docker, cmd string, args []string) (*exe...
function copyDefault (line 206) | func copyDefault(folder, name string) error {
function copyDefaultFolder (line 211) | func copyDefaultFolder(folder string) error {
function defaultFiles (line 230) | func defaultFiles(files ...string) error {
function defaultFolders (line 242) | func defaultFolders(folders ...string) error {
function CopyFile (line 252) | func CopyFile(src, folder, name string) error {
function CopyFileOverwrite (line 256) | func CopyFileOverwrite(src, folder, name string, overwrite bool) error {
function tryCreateFile (line 307) | func tryCreateFile(name, content string) error {
function createPasswd (line 319) | func createPasswd() error {
function createGroup (line 323) | func createGroup() error {
function setupNetworking (line 327) | func setupNetworking(cfg *Config) error {
function GetValue (line 376) | func GetValue(index int, args []string) string {
function ParseConfig (line 388) | func ParseConfig(config *Config, args ...string) []string {
function PrepareFs (line 433) | func PrepareFs(config *Config) error {
function touchSocket (line 451) | func touchSocket(path string) error {
function touchSockets (line 458) | func touchSockets(args ...string) error {
function createDaemonConfig (line 482) | func createDaemonConfig(config *Config) error {
function cleanupFiles (line 498) | func cleanupFiles(dataRootDirectory string) {
function createLayout (line 516) | func createLayout(config *Config) error {
function firstPrepare (line 554) | func firstPrepare() error {
function secondPrepare (line 578) | func secondPrepare(config *Config, docker string, args ...string) error {
function expand (line 607) | func expand(bin string) string {
function setupBin (line 615) | func setupBin(config *Config, bin string) error {
function setupLogging (line 630) | func setupLogging(config *Config) error {
function setUlimit (line 650) | func setUlimit(cfg *Config) error {
function runOrExec (line 664) | func runOrExec(config *Config, docker string, args ...string) (*exec.Cmd...
function LaunchDocker (line 681) | func LaunchDocker(config *Config, docker string, args ...string) (*exec....
function Main (line 689) | func Main() {
FILE: pkg/docker/auth.go
type ConfigAuthLookup (line 18) | type ConfigAuthLookup struct
method SetConfig (line 51) | func (c *ConfigAuthLookup) SetConfig(cfg *config.CloudConfig) {
method SetContext (line 55) | func (c *ConfigAuthLookup) SetContext(context *docker.Context) {
method Lookup (line 60) | func (c *ConfigAuthLookup) Lookup(repoInfo *registry.RepositoryInfo) t...
method All (line 75) | func (c *ConfigAuthLookup) All() map[string]types.AuthConfig {
function NewConfigAuthLookup (line 24) | func NewConfigAuthLookup(cfg *config.CloudConfig) *ConfigAuthLookup {
function populateRemaining (line 30) | func populateRemaining(authConfig *types.AuthConfig) error {
FILE: pkg/docker/client.go
function NewSystemClient (line 10) | func NewSystemClient() (dockerClient.APIClient, error) {
function NewDefaultClient (line 14) | func NewDefaultClient() (dockerClient.APIClient, error) {
function NewClient (line 18) | func NewClient(endpoint string) (dockerClient.APIClient, error) {
FILE: pkg/docker/client_factory.go
type ClientFactory (line 17) | type ClientFactory struct
method Create (line 47) | func (c *ClientFactory) Create(service project.Service) dockerclient.A...
function NewClientFactory (line 24) | func NewClientFactory(opts composeClient.Options) (project.ClientFactory...
function waitFor (line 57) | func waitFor(once *sync.Once, client dockerclient.APIClient, endpoint st...
function ClientOK (line 69) | func ClientOK(endpoint string, test func() bool) error {
FILE: pkg/docker/env.go
type ConfigEnvironment (line 13) | type ConfigEnvironment struct
method SetConfig (line 77) | func (c *ConfigEnvironment) SetConfig(cfg *config.CloudConfig) {
method Lookup (line 81) | func (c *ConfigEnvironment) Lookup(key, serviceName string, serviceCon...
function NewConfigEnvironment (line 17) | func NewConfigEnvironment(cfg *config.CloudConfig) *ConfigEnvironment {
function appendEnv (line 23) | func appendEnv(array []string, key, value string) []string {
function environmentFromCloudConfig (line 32) | func environmentFromCloudConfig(cfg *config.CloudConfig) map[string]stri...
function lookupKeys (line 53) | func lookupKeys(cfg *config.CloudConfig, keys ...string) []string {
FILE: pkg/docker/service.go
type Service (line 21) | type Service struct
method DependentServices (line 37) | func (s *Service) DependentServices() []project.ServiceRelationship {
method missingImage (line 55) | func (s *Service) missingImage() bool {
method requiresSyslog (line 86) | func (s *Service) requiresSyslog() bool {
method requiresUserDocker (line 90) | func (s *Service) requiresUserDocker() bool {
method shouldRebuild (line 103) | func (s *Service) shouldRebuild(ctx context.Context) (bool, error) {
method Up (line 156) | func (s *Service) Up(ctx context.Context, options options.Up) error {
method checkReload (line 210) | func (s *Service) checkReload(labels map[string]string) error {
method Create (line 217) | func (s *Service) Create(ctx context.Context, options options.Create) ...
method getContainer (line 221) | func (s *Service) getContainer(ctx context.Context) (dockerclient.APIC...
method wait (line 242) | func (s *Service) wait(ctx context.Context) error {
method rename (line 255) | func (s *Service) rename(ctx context.Context) error {
function NewService (line 28) | func NewService(factory *ServiceFactory, name string, serviceConfig *com...
function appendLink (line 94) | func appendLink(deps []project.ServiceRelationship, name string, optiona...
FILE: pkg/docker/service_factory.go
type ServiceFactory (line 11) | type ServiceFactory struct
method Create (line 16) | func (s *ServiceFactory) Create(project *project.Project, name string,...
FILE: pkg/docker/util.go
function IsSystemContainer (line 9) | func IsSystemContainer(serviceConfig *composeConfig.ServiceConfig) bool {
FILE: pkg/hostname/hostname.go
function SetHostnameFromCloudConfig (line 13) | func SetHostnameFromCloudConfig(cc *config.CloudConfig) error {
function SyncHostname (line 29) | func SyncHostname() error {
FILE: pkg/init/b2d/b2d.go
constant boot2DockerMagic (line 13) | boot2DockerMagic string = "boot2docker, please format-me"
function B2D (line 20) | func B2D(cfg *config.CloudConfig) (*config.CloudConfig, error) {
function Env (line 68) | func Env(cfg *config.CloudConfig) (*config.CloudConfig, error) {
FILE: pkg/init/bootstrap/bootstrap.go
function bootstrapServices (line 12) | func bootstrapServices(cfg *config.CloudConfig) (*config.CloudConfig, er...
function Bootstrap (line 23) | func Bootstrap(cfg *config.CloudConfig) error {
FILE: pkg/init/cloudinit/cloudinit.go
function CloudInit (line 16) | func CloudInit(cfg *config.CloudConfig) (*config.CloudConfig, error) {
function runCloudInitServices (line 106) | func runCloudInitServices(cfg *config.CloudConfig) error {
function runCloudInitServiceSet (line 122) | func runCloudInitServiceSet(cfg *config.CloudConfig) (*config.CloudConfi...
function onlyConfigDrive (line 128) | func onlyConfigDrive(datasources []string) bool {
function onlyDigitalOcean (line 141) | func onlyDigitalOcean(datasources []string) bool {
function onlyExoscale (line 154) | func onlyExoscale() (bool, error) {
function onlyProxmox (line 163) | func onlyProxmox() (bool, error) {
FILE: pkg/init/configfiles/configfiles.go
function ReadConfigFiles (line 18) | func ReadConfigFiles(cfg *config.CloudConfig) (*config.CloudConfig, erro...
function WriteConfigFiles (line 61) | func WriteConfigFiles(cfg *config.CloudConfig) (*config.CloudConfig, err...
FILE: pkg/init/debug/debug.go
function PrintAndLoadConfig (line 8) | func PrintAndLoadConfig(_ *config.CloudConfig) (*config.CloudConfig, err...
function PrintConfig (line 15) | func PrintConfig() {
FILE: pkg/init/docker/docker.go
function Start (line 10) | func Start(cfg *config.CloudConfig) (chan interface{}, error) {
function Stop (line 32) | func Stop(c chan interface{}) error {
function GetLaunchConfig (line 39) | func GetLaunchConfig(cfg *config.CloudConfig, dockerCfg *config.DockerCo...
FILE: pkg/init/env/env.go
function Init (line 12) | func Init(c *config.CloudConfig) (*config.CloudConfig, error) {
function Proxy (line 25) | func Proxy(cfg *config.CloudConfig) (*config.CloudConfig, error) {
FILE: pkg/init/fsmount/fsmount.go
constant tmpfsMagic (line 16) | tmpfsMagic int64 = 0x01021994
constant ramfsMagic (line 17) | ramfsMagic int64 = 0x858458f6
function MountOem (line 24) | func MountOem(cfg *config.CloudConfig) (*config.CloudConfig, error) {
function MountBoot (line 34) | func MountBoot(cfg *config.CloudConfig) (*config.CloudConfig, error) {
function mountConfigured (line 57) | func mountConfigured(display, dev, fsType, target string) error {
function mountState (line 81) | func mountState(cfg *config.CloudConfig) error {
function tryMountState (line 85) | func tryMountState(cfg *config.CloudConfig) error {
function tryMountStateAndBootstrap (line 100) | func tryMountStateAndBootstrap(cfg *config.CloudConfig) (*config.CloudCo...
function IsInitrd (line 114) | func IsInitrd() bool {
function MountStateAndBootstrap (line 120) | func MountStateAndBootstrap(cfg *config.CloudConfig) (*config.CloudConfi...
FILE: pkg/init/hypervisor/hypervisor.go
function Tools (line 9) | func Tools(cfg *config.CloudConfig) (*config.CloudConfig, error) {
function enableHypervisorService (line 14) | func enableHypervisorService(cfg *config.CloudConfig, hypervisorName str...
FILE: pkg/init/modules/modules.go
function LoadModules (line 14) | func LoadModules(cfg *config.CloudConfig) (*config.CloudConfig, error) {
FILE: pkg/init/one/one.go
function PidOne (line 12) | func PidOne() error {
FILE: pkg/init/prepare/prepare.go
function FS (line 23) | func FS(c *config.CloudConfig) (*config.CloudConfig, error) {
function SaveCmdline (line 27) | func SaveCmdline(c *config.CloudConfig) (*config.CloudConfig, error) {
FILE: pkg/init/recovery/recovery.go
function LoadRecoveryConsole (line 49) | func LoadRecoveryConsole(cfg *config.CloudConfig) (*config.CloudConfig, ...
function Recovery (line 56) | func Recovery(initFailure error) {
function recoveryServices (line 100) | func recoveryServices(cfg *config.CloudConfig) (*config.CloudConfig, err...
FILE: pkg/init/sharedroot/sharedroot.go
function Setup (line 12) | func Setup(c *config.CloudConfig) (*config.CloudConfig, error) {
FILE: pkg/init/switchroot/switchroot.go
function SwitchRoot (line 19) | func SwitchRoot(cfg *config.CloudConfig) (*config.CloudConfig, error) {
function cleanupTarget (line 30) | func cleanupTarget(rootfs, targetUsr, usr, usrVer, tmpDir string) (bool,...
function copyMoveRoot (line 54) | func copyMoveRoot(rootfs string, rmUsr bool) error {
function switchRoot (line 115) | func switchRoot(rootfs, subdir string, rmUsr bool) error {
FILE: pkg/log/log.go
type Fields (line 22) | type Fields
type Level (line 23) | type Level
type Logger (line 24) | type Logger
constant PanicLevel (line 29) | PanicLevel Level = iota
constant FatalLevel (line 32) | FatalLevel
constant ErrorLevel (line 35) | ErrorLevel
constant WarnLevel (line 37) | WarnLevel
constant InfoLevel (line 40) | InfoLevel
constant DebugLevel (line 42) | DebugLevel
function SetOutput (line 45) | func SetOutput(out io.Writer) {
function SetDefaultLevel (line 48) | func SetDefaultLevel(level Level) {
function SetLevel (line 51) | func SetLevel(level Level) {
function GetLevel (line 59) | func GetLevel() Level {
function Debugf (line 66) | func Debugf(format string, args ...interface{}) {
function Infof (line 69) | func Infof(format string, args ...interface{}) {
function Printf (line 72) | func Printf(format string, args ...interface{}) {
function Warnf (line 75) | func Warnf(format string, args ...interface{}) {
function Warningf (line 78) | func Warningf(format string, args ...interface{}) {
function Errorf (line 81) | func Errorf(format string, args ...interface{}) {
function Fatalf (line 84) | func Fatalf(format string, args ...interface{}) {
function Panicf (line 87) | func Panicf(format string, args ...interface{}) {
function Debug (line 91) | func Debug(args ...interface{}) {
function Info (line 94) | func Info(args ...interface{}) {
function Print (line 97) | func Print(args ...interface{}) {
function Warn (line 100) | func Warn(args ...interface{}) {
function Warning (line 103) | func Warning(args ...interface{}) {
function Error (line 106) | func Error(args ...interface{}) {
function Fatal (line 109) | func Fatal(args ...interface{}) {
function Panic (line 112) | func Panic(args ...interface{}) {
function WithField (line 116) | func WithField(key string, value interface{}) *logrus.Entry {
function WithFields (line 119) | func WithFields(fields Fields) *logrus.Entry {
function InitLogger (line 124) | func InitLogger() {
function logTheseApps (line 138) | func logTheseApps() bool {
function InitDeferedLogger (line 151) | func InitDeferedLogger() {
function innerInit (line 170) | func innerInit(deferedHook bool) {
function AddRSyslogHook (line 189) | func AddRSyslogHook() {
function FsReady (line 215) | func FsReady() {
function AddUserHook (line 235) | func AddUserHook(deferedHook bool) error {
FILE: pkg/log/showuserlog.go
type ShowuserlogHook (line 14) | type ShowuserlogHook struct
method Fire (line 27) | func (hook *ShowuserlogHook) Fire(entry *logrus.Entry) error {
method Levels (line 51) | func (hook *ShowuserlogHook) Levels() []logrus.Level {
method NotUsedYetLogSystemReady (line 63) | func (hook *ShowuserlogHook) NotUsedYetLogSystemReady() error {
function NewShowuserlogHook (line 22) | func NewShowuserlogHook(l logrus.Level, app string) (*ShowuserlogHook, e...
FILE: pkg/netconf/bonding.go
constant base (line 16) | base = "/sys/class/net/"
constant bondingMasters (line 17) | bondingMasters = "/sys/class/net/bonding_masters"
type Bonding (line 20) | type Bonding struct
method init (line 24) | func (b *Bonding) init() error {
method linkDown (line 60) | func (b *Bonding) linkDown() error {
method ListSlaves (line 69) | func (b *Bonding) ListSlaves() ([]string, error) {
method RemoveSlave (line 85) | func (b *Bonding) RemoveSlave(slave string) error {
method AddSlave (line 97) | func (b *Bonding) AddSlave(slave string) error {
method Opt (line 109) | func (b *Bonding) Opt(key, value string) error {
function contains (line 45) | func contains(file, word string) (bool, error) {
function Bond (line 130) | func Bond(name string) (*Bonding, error) {
FILE: pkg/netconf/bridge.go
type Bridge (line 9) | type Bridge struct
method init (line 18) | func (b *Bridge) init() error {
method AddLink (line 33) | func (b *Bridge) AddLink(link netlink.Link) error {
function NewBridge (line 13) | func NewBridge(name string) (*Bridge, error) {
FILE: pkg/netconf/ipv4ll_linux.go
function AssignLinkLocalIP (line 16) | func AssignLinkLocalIP(link netlink.Link) error {
function RemoveLinkLocalIP (line 62) | func RemoveLinkLocalIP(link netlink.Link) error {
function getNewIPV4LLAddr (line 80) | func getNewIPV4LLAddr(randomNum uint32) net.IP {
function getPseudoRandomGenerator (line 86) | func getPseudoRandomGenerator(haAddr []byte) (*rand.Source, error) {
function getLinkAddrs (line 92) | func getLinkAddrs(link netlink.Link) ([]netlink.Addr, error) {
FILE: pkg/netconf/netconf_linux.go
constant CONF (line 21) | CONF = "/var/lib/rancher/conf"
constant MODE (line 22) | MODE = "mode"
function createInterfaces (line 32) | func createInterfaces(netCfg *NetworkConfig) {
function createSlaveInterfaces (line 70) | func createSlaveInterfaces(netCfg *NetworkConfig) {
function findMatch (line 97) | func findMatch(link netlink.Link, netCfg *NetworkConfig) (InterfaceConfi...
function populateDefault (line 150) | func populateDefault(netCfg *NetworkConfig) {
function ApplyNetworkConfigs (line 171) | func ApplyNetworkConfigs(netCfg *NetworkConfig, userSetHostname, userSet...
function applyOuter (line 217) | func applyOuter(link netlink.Link, netCfg *NetworkConfig, userSetHostnam...
function GetDhcpLease (line 259) | func GetDhcpLease(iface string) (lease map[string]string) {
function getDhcpLeaseString (line 276) | func getDhcpLeaseString(iface string) []byte {
function hasDhcp (line 290) | func hasDhcp(iface string) bool {
function runDhcp (line 295) | func runDhcp(netCfg *NetworkConfig, iface string, argstr string, setHost...
function runWifiDhcp (line 334) | func runWifiDhcp(netCfg *NetworkConfig, link netlink.Link, network strin...
function linkUp (line 353) | func linkUp(link netlink.Link, netConf InterfaceConfig) error {
function applyAddress (line 362) | func applyAddress(address string, link netlink.Link, netConf InterfaceCo...
function removeAddress (line 378) | func removeAddress(addr netlink.Addr, link netlink.Link) error {
function setGateway (line 392) | func setGateway(gateway string, add bool) error {
function applyInterfaceConfig (line 428) | func applyInterfaceConfig(link netlink.Link, netConf InterfaceConfig) er...
function runCmds (line 529) | func runCmds(cmds []string, iface string) {
function GetValidLinkList (line 555) | func GetValidLinkList() ([]netlink.Link, error) {
function StopDhcpcd (line 573) | func StopDhcpcd() {
function StopWpaSupplicant (line 582) | func StopWpaSupplicant() {
FILE: pkg/netconf/netconf_linux_test.go
type mockLink (line 10) | type mockLink struct
method Attrs (line 15) | func (l mockLink) Attrs() *netlink.LinkAttrs {
method Type (line 19) | func (l mockLink) Type() string {
function TestFindMatch (line 23) | func TestFindMatch(t *testing.T) {
FILE: pkg/netconf/types.go
type NetworkConfig (line 3) | type NetworkConfig struct
type InterfaceConfig (line 16) | type InterfaceConfig struct
type DNSConfig (line 35) | type DNSConfig struct
type WifiNetworkConfig (line 40) | type WifiNetworkConfig struct
type ModemNetworkConfig (line 62) | type ModemNetworkConfig struct
FILE: pkg/netconf/vlan.go
type VlanDefinition (line 11) | type VlanDefinition struct
type Vlan (line 16) | type Vlan struct
method init (line 35) | func (v *Vlan) init() error {
function NewVlan (line 22) | func NewVlan(link netlink.Link, name string, id int) (*Vlan, error) {
function ParseVlanDefinitions (line 52) | func ParseVlanDefinitions(vlans string) ([]VlanDefinition, error) {
FILE: pkg/sysinit/sysinit.go
constant systemImagesPreloadDirectory (line 25) | systemImagesPreloadDirectory = "/var/lib/rancher/preload/system-docker"
constant systemImagesLoadStamp (line 26) | systemImagesLoadStamp = "/var/lib/rancher/.sysimages_%s_loaded.done"
function hasImage (line 29) | func hasImage(name string) bool {
function getImagesArchive (line 37) | func getImagesArchive(bootstrap bool) string {
function LoadBootstrapImages (line 48) | func LoadBootstrapImages(cfg *config.CloudConfig) (*config.CloudConfig, ...
function LoadSystemImages (line 52) | func LoadSystemImages(cfg *config.CloudConfig) (*config.CloudConfig, err...
function loadImages (line 63) | func loadImages(cfg *config.CloudConfig, bootstrap bool) (*config.CloudC...
function SysInit (line 95) | func SysInit() error {
function loadServicesCache (line 128) | func loadServicesCache() {
function RunSysInit (line 153) | func RunSysInit(c *config.CloudConfig) (*config.CloudConfig, error) {
FILE: pkg/util/backoff.go
type Backoff (line 5) | type Backoff struct
method Start (line 11) | func (b *Backoff) Start() <-chan bool {
method Close (line 18) | func (b *Backoff) Close() error {
method backoff (line 23) | func (b *Backoff) backoff() {
FILE: pkg/util/cutil.go
function ResolveDevice (line 21) | func ResolveDevice(spec string) string {
function GetFsType (line 29) | func GetFsType(device string) (string, error) {
FILE: pkg/util/network/cache.go
constant cacheDirectory (line 14) | cacheDirectory = "/var/lib/rancher/cache/"
function locationHash (line 17) | func locationHash(location string) string {
function cacheLookup (line 22) | func cacheLookup(location string) []byte {
function cacheAdd (line 32) | func cacheAdd(location string, data []byte) {
function cacheMove (line 48) | func cacheMove(location string) (string, error) {
function cacheMoveBack (line 57) | func cacheMoveBack(name string) error {
FILE: pkg/util/network/network.go
function GetServices (line 24) | func GetServices(urls []string) ([]string, error) {
function GetConsoles (line 28) | func GetConsoles(urls []string) ([]string, error) {
function GetEngines (line 32) | func GetEngines(urls []string) ([]string, error) {
function getServices (line 36) | func getServices(urls []string, key string) ([]string, error) {
function SetProxyEnvironmentVariables (line 62) | func SetProxyEnvironmentVariables() {
function LoadFromNetworkWithCache (line 96) | func LoadFromNetworkWithCache(location string) ([]byte, error) {
function LoadFromNetwork (line 104) | func LoadFromNetwork(location string) ([]byte, error) {
function LoadResource (line 128) | func LoadResource(location string, network bool) ([]byte, error) {
function serviceURL (line 141) | func serviceURL(url, name string) string {
function LoadServiceResource (line 145) | func LoadServiceResource(name string, useNetwork bool, cfg *config.Cloud...
function LoadMultiEngineResource (line 168) | func LoadMultiEngineResource(name string) ([]byte, error) {
function UpdateCaches (line 195) | func UpdateCaches(urls []string, key string) error {
function UpdateCache (line 219) | func UpdateCache(location string) ([]byte, error) {
FILE: pkg/util/network/network_test.go
function NoTestLoadResourceSimple (line 10) | func NoTestLoadResourceSimple(t *testing.T) {
FILE: pkg/util/network/route.go
constant DefaultRoutesCheckTimeout (line 15) | DefaultRoutesCheckTimeout = 20000
constant ipv4RouteFile (line 17) | ipv4RouteFile = "/proc/net/route"
constant ipv6RouteFile (line 18) | ipv6RouteFile = "/proc/net/ipv6_route"
constant ipv4DefaultGWFlags (line 20) | ipv4DefaultGWFlags = "0003"
constant ipv6DefaultGWFlags (line 21) | ipv6DefaultGWFlags = "00450003"
function checkIPv4GW (line 24) | func checkIPv4GW() bool {
function checkIPv6GW (line 54) | func checkIPv6GW() bool {
function checkAllDefaultGW (line 80) | func checkAllDefaultGW() bool {
function AllDefaultGWOK (line 84) | func AllDefaultGWOK(timeout int) error {
FILE: pkg/util/term.go
function IsRunningInTty (line 8) | func IsRunningInTty() bool {
FILE: pkg/util/util.go
constant dockerCgroupsFile (line 21) | dockerCgroupsFile = "/proc/self/cgroup"
type AnyMap (line 24) | type AnyMap
function Contains (line 26) | func Contains(values []string, value string) bool {
type ReturnsErr (line 40) | type ReturnsErr
function FileCopy (line 42) | func FileCopy(src, dest string) error {
function HTTPDownloadToFile (line 50) | func HTTPDownloadToFile(url, dest string) error {
function WriteFileAtomic (line 63) | func WriteFileAtomic(filename string, data []byte, perm os.FileMode) err...
function Convert (line 84) | func Convert(from, to interface{}) error {
function ConvertIgnoreOmitEmpty (line 93) | func ConvertIgnoreOmitEmpty(from, to interface{}) error {
function Copy (line 108) | func Copy(d interface{}) interface{} {
function Merge (line 119) | func Merge(left, right map[interface{}]interface{}) map[interface{}]inte...
function MapCopy (line 143) | func MapCopy(data map[interface{}]interface{}) map[interface{}]interface...
function SliceCopy (line 151) | func SliceCopy(data []interface{}) []interface{} {
function RemoveString (line 159) | func RemoveString(slice []string, s string) []string {
function ToStrings (line 169) | func ToStrings(data []interface{}) []string {
function Map2KVPairs (line 177) | func Map2KVPairs(m map[string]string) []string {
function KVPairs2Map (line 185) | func KVPairs2Map(kvs []string) map[string]string {
function TrimSplitN (line 194) | func TrimSplitN(str, sep string, count int) []string {
function TrimSplit (line 203) | func TrimSplit(str, sep string) []string {
function GetCurrentContainerID (line 207) | func GetCurrentContainerID() (string, error) {
function UnescapeKernelParams (line 239) | func UnescapeKernelParams(s string) string {
function ExistsAndExecutable (line 245) | func ExistsAndExecutable(path string) bool {
function RunScript (line 255) | func RunScript(path string, args ...string) error {
function RunCommandSequence (line 281) | func RunCommandSequence(commandSequence []osYaml.StringandSlice) error {
function GenerateDindEngineScript (line 300) | func GenerateDindEngineScript(name string) error {
function RemoveDindEngineScript (line 315) | func RemoveDindEngineScript(name string) error {
FILE: pkg/util/util_linux.go
function mountProc (line 19) | func mountProc() error {
function Mount (line 35) | func Mount(device, target, fsType, options string) error {
function Unmount (line 93) | func Unmount(target string) error {
function Blkid (line 97) | func Blkid(label string) (deviceName, deviceType string, err error) {
function BlkidType (line 123) | func BlkidType(deviceType string) (deviceNames []string, err error) {
function GetHypervisor (line 146) | func GetHypervisor() string {
FILE: pkg/util/util_test.go
type testCloudConfig (line 9) | type testCloudConfig struct
function TestConvertMergesLeftIntoRight (line 15) | func TestConvertMergesLeftIntoRight(t *testing.T) {
function NoTestCopyPointer (line 24) | func NoTestCopyPointer(t *testing.T) {
function TestMapCopy (line 35) | func TestMapCopy(t *testing.T) {
function TestSliceCopy (line 51) | func TestSliceCopy(t *testing.T) {
function TestMerge (line 67) | func TestMerge(t *testing.T) {
function TestCmdLineStr (line 94) | func TestCmdLineStr(t *testing.T) {
FILE: pkg/util/versions/compare.go
function compare (line 10) | func compare(v1, v2 string) int {
function LessThan (line 40) | func LessThan(v, other string) bool {
function LessThanOrEqualTo (line 45) | func LessThanOrEqualTo(v, other string) bool {
function GreaterThan (line 50) | func GreaterThan(v, other string) bool {
function GreaterThanOrEqualTo (line 55) | func GreaterThanOrEqualTo(v, other string) bool {
function Equal (line 60) | func Equal(v, other string) bool {
FILE: pkg/util/versions/compare_test.go
function assertVersion (line 7) | func assertVersion(t *testing.T, a, b string, result int) {
function TestCompareVersion (line 13) | func TestCompareVersion(t *testing.T) {
FILE: scripts/inline_schema.go
function main (line 9) | func main() {
FILE: vendor/github.com/Microsoft/go-winio/backup.go
constant BackupData (line 19) | BackupData = uint32(iota + 1)
constant BackupEaData (line 20) | BackupEaData
constant BackupSecurity (line 21) | BackupSecurity
constant BackupAlternateData (line 22) | BackupAlternateData
constant BackupLink (line 23) | BackupLink
constant BackupPropertyData (line 24) | BackupPropertyData
constant BackupObjectId (line 25) | BackupObjectId
constant BackupReparseData (line 26) | BackupReparseData
constant BackupSparseBlock (line 27) | BackupSparseBlock
constant BackupTxfsData (line 28) | BackupTxfsData
constant StreamSparseAttributes (line 30) | StreamSparseAttributes = uint32(8)
type BackupHeader (line 34) | type BackupHeader struct
type win32StreamId (line 42) | type win32StreamId struct
type BackupStreamReader (line 51) | type BackupStreamReader struct
method Next (line 63) | func (r *BackupStreamReader) Next() (*BackupHeader, error) {
method Read (line 96) | func (r *BackupStreamReader) Read(b []byte) (int, error) {
function NewBackupStreamReader (line 57) | func NewBackupStreamReader(r io.Reader) *BackupStreamReader {
type BackupStreamWriter (line 114) | type BackupStreamWriter struct
method WriteHeader (line 125) | func (w *BackupStreamWriter) WriteHeader(hdr *BackupHeader) error {
method Write (line 158) | func (w *BackupStreamWriter) Write(b []byte) (int, error) {
function NewBackupStreamWriter (line 120) | func NewBackupStreamWriter(w io.Writer) *BackupStreamWriter {
type BackupFileReader (line 168) | type BackupFileReader struct
method Read (line 183) | func (r *BackupFileReader) Read(b []byte) (int, error) {
method Close (line 197) | func (r *BackupFileReader) Close() error {
function NewBackupFileReader (line 176) | func NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileRe...
type BackupFileWriter (line 206) | type BackupFileWriter struct
method Write (line 221) | func (w *BackupFileWriter) Write(b []byte) (int, error) {
method Close (line 235) | func (w *BackupFileWriter) Close() error {
function NewBackupFileWriter (line 214) | func NewBackupFileWriter(f *os.File, includeSecurity bool) *BackupFileWr...
FILE: vendor/github.com/Microsoft/go-winio/file.go
constant cFILE_SKIP_COMPLETION_PORT_ON_SUCCESS (line 19) | cFILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1
constant cFILE_SKIP_SET_EVENT_ON_HANDLE (line 20) | cFILE_SKIP_SET_EVENT_ON_HANDLE = 2
type timeoutError (line 28) | type timeoutError struct
method Error (line 30) | func (e *timeoutError) Error() string { return "i/o timeout" }
method Timeout (line 31) | func (e *timeoutError) Timeout() bool { return true }
method Temporary (line 32) | func (e *timeoutError) Temporary() bool { return true }
type ioResult (line 38) | type ioResult struct
type ioOperation (line 44) | type ioOperation struct
function initIo (line 49) | func initIo() {
type win32File (line 60) | type win32File struct
method closeHandle (line 89) | func (f *win32File) closeHandle() {
method Close (line 102) | func (f *win32File) Close() error {
method prepareIo (line 109) | func (f *win32File) prepareIo() (*ioOperation, error) {
method asyncIo (line 137) | func (f *win32File) asyncIo(c *ioOperation, deadline time.Time, bytes ...
method Read (line 181) | func (f *win32File) Read(b []byte) (int, error) {
method Write (line 201) | func (f *win32File) Write(b []byte) (int, error) {
method SetReadDeadline (line 211) | func (f *win32File) SetReadDeadline(t time.Time) error {
method SetWriteDeadline (line 216) | func (f *win32File) SetWriteDeadline(t time.Time) error {
function makeWin32File (line 69) | func makeWin32File(h syscall.Handle) (*win32File, error) {
function MakeOpenFile (line 84) | func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error) {
function ioCompletionProcessor (line 120) | func ioCompletionProcessor(h syscall.Handle) {
FILE: vendor/github.com/Microsoft/go-winio/fileinfo.go
type FileBasicInfo (line 12) | type FileBasicInfo struct
function GetFileBasicInfo (line 17) | func GetFileBasicInfo(f *os.File) (*FileBasicInfo, error) {
function SetFileBasicInfo (line 25) | func SetFileBasicInfo(f *os.File, bi *FileBasicInfo) error {
FILE: vendor/github.com/Microsoft/go-winio/pipe.go
type securityAttributes (line 20) | type securityAttributes struct
constant cERROR_PIPE_BUSY (line 27) | cERROR_PIPE_BUSY = syscall.Errno(231)
constant cERROR_PIPE_CONNECTED (line 28) | cERROR_PIPE_CONNECTED = syscall.Errno(535)
constant cERROR_SEM_TIMEOUT (line 29) | cERROR_SEM_TIMEOUT = syscall.Errno(121)
constant cPIPE_ACCESS_DUPLEX (line 31) | cPIPE_ACCESS_DUPLEX = 0x3
constant cFILE_FLAG_FIRST_PIPE_INSTANCE (line 32) | cFILE_FLAG_FIRST_PIPE_INSTANCE = 0x80000
constant cSECURITY_SQOS_PRESENT (line 33) | cSECURITY_SQOS_PRESENT = 0x100000
constant cSECURITY_ANONYMOUS (line 34) | cSECURITY_ANONYMOUS = 0
constant cPIPE_REJECT_REMOTE_CLIENTS (line 36) | cPIPE_REJECT_REMOTE_CLIENTS = 0x8
constant cPIPE_UNLIMITED_INSTANCES (line 38) | cPIPE_UNLIMITED_INSTANCES = 255
constant cNMPWAIT_USE_DEFAULT_WAIT (line 40) | cNMPWAIT_USE_DEFAULT_WAIT = 0
constant cNMPWAIT_NOWAIT (line 41) | cNMPWAIT_NOWAIT = 1
constant cPIPE_TYPE_MESSAGE (line 43) | cPIPE_TYPE_MESSAGE = 4
constant cPIPE_READMODE_MESSAGE (line 45) | cPIPE_READMODE_MESSAGE = 2
type win32Pipe (line 56) | type win32Pipe struct
method LocalAddr (line 69) | func (f *win32Pipe) LocalAddr() net.Addr {
method RemoteAddr (line 73) | func (f *win32Pipe) RemoteAddr() net.Addr {
method SetDeadline (line 77) | func (f *win32Pipe) SetDeadline(t time.Time) error {
type win32MessageBytePipe (line 61) | type win32MessageBytePipe struct
method CloseWrite (line 84) | func (f *win32MessageBytePipe) CloseWrite() error {
method Write (line 98) | func (f *win32MessageBytePipe) Write(b []byte) (int, error) {
method Read (line 110) | func (f *win32MessageBytePipe) Read(b []byte) (int, error) {
type pipeAddress (line 67) | type pipeAddress
method Network (line 126) | func (s pipeAddress) Network() string {
method String (line 130) | func (s pipeAddress) String() string {
function DialPipe (line 137) | func DialPipe(path string, timeout *time.Duration) (net.Conn, error) {
type acceptResponse (line 202) | type acceptResponse struct
type win32PipeListener (line 207) | type win32PipeListener struct
method makeServerPipe (line 240) | func (l *win32PipeListener) makeServerPipe() (*win32File, error) {
method listenerRoutine (line 253) | func (l *win32PipeListener) listenerRoutine() {
method Accept (line 367) | func (l *win32PipeListener) Accept() (net.Conn, error) {
method Close (line 387) | func (l *win32PipeListener) Close() error {
method Addr (line 396) | func (l *win32PipeListener) Addr() net.Addr {
function makeServerPipeHandle (line 217) | func makeServerPipeHandle(path string, securityDescriptor []byte, c *Pip...
type PipeConfig (line 294) | type PipeConfig struct
function ListenPipe (line 315) | func ListenPipe(path string, c *PipeConfig) (net.Listener, error) {
function connectPipe (line 354) | func connectPipe(p *win32File) error {
FILE: vendor/github.com/Microsoft/go-winio/privilege.go
constant SE_PRIVILEGE_ENABLED (line 22) | SE_PRIVILEGE_ENABLED = 2
constant ERROR_NOT_ALL_ASSIGNED (line 24) | ERROR_NOT_ALL_ASSIGNED syscall.Errno = 1300
constant SeBackupPrivilege (line 26) | SeBackupPrivilege = "SeBackupPrivilege"
constant SeRestorePrivilege (line 27) | SeRestorePrivilege = "SeRestorePrivilege"
constant securityAnonymous (line 31) | securityAnonymous = iota
constant securityIdentification (line 32) | securityIdentification
constant securityImpersonation (line 33) | securityImpersonation
constant securityDelegation (line 34) | securityDelegation
type PrivilegeError (line 37) | type PrivilegeError struct
method Error (line 41) | func (e *PrivilegeError) Error() string {
function RunWithPrivilege (line 59) | func RunWithPrivilege(name string, fn func() error) error {
function RunWithPrivileges (line 63) | func RunWithPrivileges(names []string, fn func() error) error {
function adjustPrivileges (line 87) | func adjustPrivileges(token syscall.Handle, privileges []uint64) error {
function getPrivilegeName (line 106) | func getPrivilegeName(luid uint64) string {
function newThreadToken (line 125) | func newThreadToken() (syscall.Handle, error) {
function releaseThreadToken (line 144) | func releaseThreadToken(h syscall.Handle) {
FILE: vendor/github.com/Microsoft/go-winio/reparse.go
constant reparseTagMountPoint (line 13) | reparseTagMountPoint = 0xA0000003
constant reparseTagSymlink (line 14) | reparseTagSymlink = 0xA000000C
type reparseDataBuffer (line 17) | type reparseDataBuffer struct
type ReparsePoint (line 28) | type ReparsePoint struct
type UnsupportedReparsePointError (line 35) | type UnsupportedReparsePointError struct
method Error (line 39) | func (e *UnsupportedReparsePointError) Error() string {
function DecodeReparsePoint (line 45) | func DecodeReparsePoint(b []byte) (*ReparsePoint, error) {
function isDriveLetter (line 68) | func isDriveLetter(c byte) bool {
function EncodeReparsePoint (line 74) | func EncodeReparsePoint(rp *ReparsePoint) []byte {
FILE: vendor/github.com/Microsoft/go-winio/sd.go
constant cERROR_NONE_MAPPED (line 16) | cERROR_NONE_MAPPED = syscall.Errno(1332)
type AccountLookupError (line 19) | type AccountLookupError struct
method Error (line 24) | func (e *AccountLookupError) Error() string {
type SddlConversionError (line 38) | type SddlConversionError struct
method Error (line 43) | func (e *SddlConversionError) Error() string {
function LookupSidByName (line 48) | func LookupSidByName(name string) (sid string, err error) {
function SddlToSecurityDescriptor (line 74) | func SddlToSecurityDescriptor(sddl string) ([]byte, error) {
function SecurityDescriptorToSddl (line 86) | func SecurityDescriptorToSddl(sd []byte) (string, error) {
FILE: vendor/github.com/Microsoft/go-winio/zsyscall.go
function cancelIoEx (line 46) | func cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) {
function createIoCompletionPort (line 58) | func createIoCompletionPort(file syscall.Handle, port syscall.Handle, ke...
function getQueuedCompletionStatus (line 71) | func getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *...
function setFileCompletionNotificationModes (line 83) | func setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (...
function timeBeginPeriod (line 95) | func timeBeginPeriod(period uint32) (n int32) {
function connectNamedPipe (line 101) | func connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err e...
function createNamedPipe (line 113) | func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInst...
function _createNamedPipe (line 122) | func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxIn...
function createFile (line 135) | func createFile(name string, access uint32, mode uint32, sa *securityAtt...
function _createFile (line 144) | func _createFile(name *uint16, access uint32, mode uint32, sa *securityA...
function waitNamedPipe (line 157) | func waitNamedPipe(name string, timeout uint32) (err error) {
function _waitNamedPipe (line 166) | func _waitNamedPipe(name *uint16, timeout uint32) (err error) {
function getNamedPipeInfo (line 178) | func getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint3...
function getNamedPipeHandleState (line 190) | func getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInst...
function lookupAccountName (line 202) | func lookupAccountName(systemName *uint16, accountName string, sid *byte...
function _lookupAccountName (line 211) | func _lookupAccountName(systemName *uint16, accountName *uint16, sid *by...
function convertSidToStringSid (line 223) | func convertSidToStringSid(sid *byte, str **uint16) (err error) {
function convertStringSecurityDescriptorToSecurityDescriptor (line 235) | func convertStringSecurityDescriptorToSecurityDescriptor(str string, rev...
function _convertStringSecurityDescriptorToSecurityDescriptor (line 244) | func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, r...
function convertSecurityDescriptorToStringSecurityDescriptor (line 256) | func convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revis...
function localFree (line 268) | func localFree(mem uintptr) {
function getSecurityDescriptorLength (line 273) | func getSecurityDescriptorLength(sd uintptr) (len uint32) {
function getFileInformationByHandleEx (line 279) | func getFileInformationByHandleEx(h syscall.Handle, class uint32, buffer...
function setFileInformationByHandle (line 291) | func setFileInformationByHandle(h syscall.Handle, class uint32, buffer *...
function adjustTokenPrivileges (line 303) | func adjustTokenPrivileges(token syscall.Handle, releaseAll bool, input ...
function impersonateSelf (line 322) | func impersonateSelf(level uint32) (err error) {
function revertToSelf (line 334) | func revertToSelf() (err error) {
function openThreadToken (line 346) | func openThreadToken(thread syscall.Handle, accessMask uint32, openAsSel...
function getCurrentThread (line 364) | func getCurrentThread() (h syscall.Handle) {
function lookupPrivilegeValue (line 370) | func lookupPrivilegeValue(systemName string, name string, luid *uint64) ...
function _lookupPrivilegeValue (line 384) | func _lookupPrivilegeValue(systemName *uint16, name *uint16, luid *uint6...
function lookupPrivilegeName (line 396) | func lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16...
function _lookupPrivilegeName (line 405) | func _lookupPrivilegeName(systemName *uint16, luid *uint64, buffer *uint...
function lookupPrivilegeDisplayName (line 417) | func lookupPrivilegeDisplayName(systemName string, name *uint16, buffer ...
function _lookupPrivilegeDisplayName (line 426) | func _lookupPrivilegeDisplayName(systemName *uint16, name *uint16, buffe...
function backupRead (line 438) | func backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort boo...
function backupWrite (line 466) | func backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort...
FILE: vendor/github.com/SvenDowideit/cpuid/cpuid.go
type Vendor (line 18) | type Vendor
constant Other (line 21) | Other Vendor = iota
constant Intel (line 22) | Intel
constant AMD (line 23) | AMD
constant VIA (line 24) | VIA
constant Transmeta (line 25) | Transmeta
constant NSC (line 26) | NSC
constant KVM (line 27) | KVM
constant MSVM (line 28) | MSVM
constant VMware (line 29) | VMware
constant XenHVM (line 30) | XenHVM
constant CMOV (line 34) | CMOV = 1 << iota
constant NX (line 35) | NX
constant AMD3DNOW (line 36) | AMD3DNOW
constant AMD3DNOWEXT (line 37) | AMD3DNOWEXT
constant MMX (line 38) | MMX
constant MMXEXT (line 39) | MMXEXT
constant SSE (line 40) | SSE
constant SSE2 (line 41) | SSE2
constant SSE3 (line 42) | SSE3
constant SSSE3 (line 43) | SSSE3
constant SSE4 (line 44) | SSE4
constant SSE4A (line 45) | SSE4A
constant SSE42 (line 46) | SSE42
constant AVX (line 47) | AVX
constant AVX2 (line 48) | AVX2
constant FMA3 (line 49) | FMA3
constant FMA4 (line 50) | FMA4
constant XOP (line 51) | XOP
constant F16C (line 52) | F16C
constant BMI1 (line 53) | BMI1
constant BMI2 (line 54) | BMI2
constant TBM (line 55) | TBM
constant LZCNT (line 56) | LZCNT
constant POPCNT (line 57) | POPCNT
constant AESNI (line 58) | AESNI
constant CLMUL (line 59) | CLMUL
constant HTT (line 60) | HTT
constant HLE (line 61) | HLE
constant RTM (line 62) | RTM
constant RDRAND (line 63) | RDRAND
constant RDSEED (line 64) | RDSEED
constant ADX (line 65) | ADX
constant SHA (line 66) | SHA
constant AVX512F (line 67) | AVX512F
constant AVX512DQ (line 68) | AVX512DQ
constant AVX512IFMA (line 69) | AVX512IFMA
constant AVX512PF (line 70) | AVX512PF
constant AVX512ER (line 71) | AVX512ER
constant AVX512CD (line 72) | AVX512CD
constant AVX512BW (line 73) | AVX512BW
constant AVX512VL (line 74) | AVX512VL
constant AVX512VBMI (line 75) | AVX512VBMI
constant MPX (line 76) | MPX
constant ERMS (line 77) | ERMS
constant RDTSCP (line 78) | RDTSCP
constant CX16 (line 79) | CX16
constant SGX (line 80) | SGX
constant SSE2SLOW (line 83) | SSE2SLOW
constant SSE3SLOW (line 84) | SSE3SLOW
constant ATOM (line 85) | ATOM
type CPUInfo (line 145) | type CPUInfo struct
method Cmov (line 210) | func (c CPUInfo) Cmov() bool {
method Amd3dnow (line 215) | func (c CPUInfo) Amd3dnow() bool {
method Amd3dnowExt (line 220) | func (c CPUInfo) Amd3dnowExt() bool {
method MMX (line 225) | func (c CPUInfo) MMX() bool {
method MMXExt (line 231) | func (c CPUInfo) MMXExt() bool {
method SSE (line 236) | func (c CPUInfo) SSE() bool {
method SSE2 (line 241) | func (c CPUInfo) SSE2() bool {
method SSE3 (line 246) | func (c CPUInfo) SSE3() bool {
method SSSE3 (line 251) | func (c CPUInfo) SSSE3() bool {
method SSE4 (line 256) | func (c CPUInfo) SSE4() bool {
method SSE42 (line 261) | func (c CPUInfo) SSE42() bool {
method AVX (line 267) | func (c CPUInfo) AVX() bool {
method AVX2 (line 272) | func (c CPUInfo) AVX2() bool {
method FMA3 (line 277) | func (c CPUInfo) FMA3() bool {
method FMA4 (line 282) | func (c CPUInfo) FMA4() bool {
method XOP (line 287) | func (c CPUInfo) XOP() bool {
method F16C (line 292) | func (c CPUInfo) F16C() bool {
method BMI1 (line 297) | func (c CPUInfo) BMI1() bool {
method BMI2 (line 302) | func (c CPUInfo) BMI2() bool {
method TBM (line 308) | func (c CPUInfo) TBM() bool {
method Lzcnt (line 313) | func (c CPUInfo) Lzcnt() bool {
method Popcnt (line 318) | func (c CPUInfo) Popcnt() bool {
method HTT (line 323) | func (c CPUInfo) HTT() bool {
method SSE2Slow (line 328) | func (c CPUInfo) SSE2Slow() bool {
method SSE3Slow (line 333) | func (c CPUInfo) SSE3Slow() bool {
method AesNi (line 339) | func (c CPUInfo) AesNi() bool {
method Clmul (line 345) | func (c CPUInfo) Clmul() bool {
method NX (line 350) | func (c CPUInfo) NX() bool {
method SSE4A (line 355) | func (c CPUInfo) SSE4A() bool {
method HLE (line 360) | func (c CPUInfo) HLE() bool {
method RTM (line 365) | func (c CPUInfo) RTM() bool {
method Rdrand (line 370) | func (c CPUInfo) Rdrand() bool {
method Rdseed (line 375) | func (c CPUInfo) Rdseed() bool {
method ADX (line 380) | func (c CPUInfo) ADX() bool {
method SHA (line 385) | func (c CPUInfo) SHA() bool {
method AVX512F (line 390) | func (c CPUInfo) AVX512F() bool {
method AVX512DQ (line 395) | func (c CPUInfo) AVX512DQ() bool {
method AVX512IFMA (line 400) | func (c CPUInfo) AVX512IFMA() bool {
method AVX512PF (line 405) | func (c CPUInfo) AVX512PF() bool {
method AVX512ER (line 410) | func (c CPUInfo) AVX512ER() bool {
method AVX512CD (line 415) | func (c CPUInfo) AVX512CD() bool {
method AVX512BW (line 420) | func (c CPUInfo) AVX512BW() bool {
method AVX512VL (line 425) | func (c CPUInfo) AVX512VL() bool {
method AVX512VBMI (line 430) | func (c CPUInfo) AVX512VBMI() bool {
method MPX (line 435) | func (c CPUInfo) MPX() bool {
method ERMS (line 440) | func (c CPUInfo) ERMS() bool {
method RDTSCP (line 444) | func (c CPUInfo) RDTSCP() bool {
method CX16 (line 448) | func (c CPUInfo) CX16() bool {
method Atom (line 453) | func (c CPUInfo) Atom() bool {
method Intel (line 458) | func (c CPUInfo) Intel() bool {
method AMD (line 463) | func (c CPUInfo) AMD() bool {
method Transmeta (line 468) | func (c CPUInfo) Transmeta() bool {
method NSC (line 473) | func (c CPUInfo) NSC() bool {
method VIA (line 478) | func (c CPUInfo) VIA() bool {
method RTCounter (line 485) | func (c CPUInfo) RTCounter() uint64 {
method Ia32TscAux (line 497) | func (c CPUInfo) Ia32TscAux() uint32 {
method LogicalCPU (line 509) | func (c CPUInfo) LogicalCPU() int {
method VM (line 520) | func (c CPUInfo) VM() bool {
method cacheSize (line 736) | func (c *CPUInfo) cacheSize() {
function init (line 179) | func init() {
function Detect (line 191) | func Detect() {
type Flags (line 529) | type Flags
method String (line 533) | func (f Flags) String() string {
method Strings (line 538) | func (f Flags) Strings() []string {
function maxExtendedFunction (line 551) | func maxExtendedFunction() uint32 {
function maxFunctionID (line 556) | func maxFunctionID() uint32 {
function isHypervisorActive (line 561) | func isHypervisorActive() bool {
function getHypervisorCpuid (line 566) | func getHypervisorCpuid(ax uint32) string {
function hypervisorName (line 574) | func hypervisorName() string {
function hypervisorVendorName (line 597) | func hypervisorVendorName() string {
function brandName (line 605) | func brandName() string {
function threadsPerCore (line 617) | func threadsPerCore() int {
function logicalCores (line 646) | func logicalCores() int {
function familyModel (line 672) | func familyModel() (int, int) {
function physicalCores (line 682) | func physicalCores() int {
function vendorID (line 711) | func vendorID() Vendor {
function cacheLine (line 721) | func cacheLine() int {
type SGXSupport (line 800) | type SGXSupport struct
function sgx (line 808) | func sgx(available bool) (rval SGXSupport) {
function support (line 824) | func support() Flags {
function valAsString (line 1050) | func valAsString(values ...uint32) []byte {
FILE: vendor/github.com/SvenDowideit/cpuid/detect_intel.go
function asmCpuid (line 7) | func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32)
function asmCpuidex (line 8) | func asmCpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32)
function asmXgetbv (line 9) | func asmXgetbv(index uint32) (eax, edx uint32)
function asmRdtscpAsm (line 10) | func asmRdtscpAsm() (eax, ebx, ecx, edx uint32)
function initCPU (line 12) | func initCPU() {
FILE: vendor/github.com/SvenDowideit/cpuid/detect_ref.go
function initCPU (line 7) | func initCPU() {
FILE: vendor/github.com/SvenDowideit/cpuid/private-gen.go
function main (line 39) | func main() {
function copyFile (line 139) | func copyFile(src, dst string) (err error) {
function copyFileContents (line 170) | func copyFileContents(src, dst string) (err error) {
type rewrite (line 193) | type rewrite
function initRewrite (line 196) | func initRewrite(rewriteRule string) rewrite {
function parseExpr (line 211) | func parseExpr(s, what string) ast.Expr {
function rewriteFile (line 230) | func rewriteFile(pattern, replace ast.Expr, p *ast.File) *ast.File {
function set (line 258) | func set(x, y reflect.Value) {
function apply (line 290) | func apply(f func(reflect.Value) reflect.Value, val reflect.Value) refle...
function isWildcard (line 325) | func isWildcard(s string) bool {
function match (line 333) | func match(m map[string]reflect.Value, pattern, val reflect.Value) bool {
function subst (line 421) | func subst(m map[string]reflect.Value, pattern reflect.Value, pos reflec...
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/api.go
function yaml_parser_initialize (line 25) | func yaml_parser_initialize(parser *yaml_parser_t) bool {
function yaml_parser_delete (line 37) | func yaml_parser_delete(parser *yaml_parser_t) {
function yaml_string_read_handler (line 45) | func yaml_string_read_handler(parser *yaml_parser_t, buffer []byte) (int...
function yaml_file_read_handler (line 59) | func yaml_file_read_handler(parser *yaml_parser_t, buffer []byte) (int, ...
function yaml_parser_set_input_string (line 67) | func yaml_parser_set_input_string(parser *yaml_parser_t, input []byte) {
function yaml_parser_set_input_reader (line 81) | func yaml_parser_set_input_reader(parser *yaml_parser_t, reader io.Reade...
function yaml_parser_set_input (line 94) | func yaml_parser_set_input(parser *yaml_parser_t, handler yaml_read_hand...
function yaml_parser_set_encoding (line 106) | func yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encod...
function yaml_emitter_initialize (line 118) | func yaml_emitter_initialize(emitter *yaml_emitter_t) {
function yaml_emitter_delete (line 127) | func yaml_emitter_delete(emitter *yaml_emitter_t) {
function yaml_string_write_handler (line 135) | func yaml_string_write_handler(emitter *yaml_emitter_t, buffer []byte) e...
function yaml_writer_write_handler (line 144) | func yaml_writer_write_handler(emitter *yaml_emitter_t, buffer []byte) e...
function yaml_emitter_set_output_string (line 153) | func yaml_emitter_set_output_string(emitter *yaml_emitter_t, buffer *[]b...
function yaml_emitter_set_output_writer (line 166) | func yaml_emitter_set_output_writer(emitter *yaml_emitter_t, w io.Writer) {
function yaml_emitter_set_output (line 179) | func yaml_emitter_set_output(emitter *yaml_emitter_t, handler yaml_write...
function yaml_emitter_set_encoding (line 191) | func yaml_emitter_set_encoding(emitter *yaml_emitter_t, encoding yaml_en...
function yaml_emitter_set_canonical (line 203) | func yaml_emitter_set_canonical(emitter *yaml_emitter_t, canonical bool) {
function yaml_emitter_set_indent (line 211) | func yaml_emitter_set_indent(emitter *yaml_emitter_t, indent int) {
function yaml_emitter_set_width (line 222) | func yaml_emitter_set_width(emitter *yaml_emitter_t, width int) {
function yaml_emitter_set_unicode (line 233) | func yaml_emitter_set_unicode(emitter *yaml_emitter_t, unicode bool) {
function yaml_emitter_set_break (line 241) | func yaml_emitter_set_break(emitter *yaml_emitter_t, line_break yaml_bre...
function yaml_stream_start_event_initialize (line 334) | func yaml_stream_start_event_initialize(event *yaml_event_t, encoding ya...
function yaml_stream_end_event_initialize (line 345) | func yaml_stream_end_event_initialize(event *yaml_event_t) {
function yaml_document_start_event_initialize (line 355) | func yaml_document_start_event_initialize(event *yaml_event_t,
function yaml_document_end_event_initialize (line 371) | func yaml_document_end_event_initialize(event *yaml_event_t, implicit bo...
function yaml_alias_event_initialize (line 382) | func yaml_alias_event_initialize(event *yaml_event_t, anchor []byte) {
function yaml_scalar_event_initialize (line 393) | func yaml_scalar_event_initialize(event *yaml_event_t,
function yaml_sequence_start_event_initialize (line 414) | func yaml_sequence_start_event_initialize(event *yaml_event_t,
function yaml_sequence_end_event_initialize (line 429) | func yaml_sequence_end_event_initialize(event *yaml_event_t) {
function yaml_mapping_start_event_initialize (line 439) | func yaml_mapping_start_event_initialize(event *yaml_event_t,
function yaml_mapping_end_event_initialize (line 454) | func yaml_mapping_end_event_initialize(event *yaml_event_t) {
function yaml_event_delete (line 464) | func yaml_event_delete(event *yaml_event_t) {
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/decode.go
type Unmarshaler (line 28) | type Unmarshaler interface
type Number (line 33) | type Number
method String (line 36) | func (n Number) String() string { return string(n) }
method Float64 (line 39) | func (n Number) Float64() (float64, error) {
method Int64 (line 44) | func (n Number) Int64() (int64, error) {
type Decoder (line 48) | type Decoder struct
method Decode (line 115) | func (d *Decoder) Decode(v interface{}) (err error) {
method UseNumber (line 137) | func (d *Decoder) UseNumber() { d.useNumber = true }
method error (line 139) | func (d *Decoder) error(err error) {
method nextEvent (line 143) | func (d *Decoder) nextEvent() {
method document (line 176) | func (d *Decoder) document(rv reflect.Value) {
method parse (line 191) | func (d *Decoder) parse(rv reflect.Value) {
method begin_anchor (line 224) | func (d *Decoder) begin_anchor(anchor string) {
method end_anchor (line 231) | func (d *Decoder) end_anchor(anchor string) {
method indirect (line 247) | func (d *Decoder) indirect(v reflect.Value, decodingNull bool) (Unmars...
method sequence (line 290) | func (d *Decoder) sequence(v reflect.Value) {
method mapping (line 381) | func (d *Decoder) mapping(v reflect.Value) {
method mappingStruct (line 446) | func (d *Decoder) mappingStruct(v reflect.Value) {
method scalar (line 499) | func (d *Decoder) scalar(v reflect.Value) {
method alias (line 526) | func (d *Decoder) alias(rv reflect.Value) {
method valueInterface (line 537) | func (d *Decoder) valueInterface() interface{} {
method scalarInterface (line 568) | func (d *Decoder) scalarInterface() interface{} {
method sequenceInterface (line 576) | func (d *Decoder) sequenceInterface() []interface{} {
method mappingInterface (line 599) | func (d *Decoder) mappingInterface() map[interface{}]interface{} {
type ParserError (line 58) | type ParserError struct
method Error (line 66) | func (e *ParserError) Error() string {
type UnexpectedEventError (line 70) | type UnexpectedEventError struct
method Error (line 76) | func (e *UnexpectedEventError) Error() string {
function recovery (line 80) | func recovery(err *error) {
function Unmarshal (line 100) | func Unmarshal(data []byte, v interface{}) error {
function NewDecoder (line 105) | func NewDecoder(r io.Reader) *Decoder {
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/emitter.go
function flush (line 30) | func flush(emitter *yaml_emitter_t) bool {
function put (line 40) | func put(emitter *yaml_emitter_t, value byte) bool {
function put_break (line 55) | func put_break(emitter *yaml_emitter_t) bool {
function write (line 81) | func write(emitter *yaml_emitter_t, src []byte, src_pos *int) bool {
function write_break (line 94) | func write_break(emitter *yaml_emitter_t, src []byte, src_pos *int) bool {
function yaml_emitter_set_emitter_error (line 115) | func yaml_emitter_set_emitter_error(emitter *yaml_emitter_t, problem str...
function yaml_emitter_emit (line 125) | func yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool {
function yaml_emitter_need_more_events (line 150) | func yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool {
function yaml_emitter_append_tag_directive (line 191) | func yaml_emitter_append_tag_directive(emitter *yaml_emitter_t,
function yaml_emitter_increase_indent (line 218) | func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow bool, in...
function yaml_emitter_state_machine (line 239) | func yaml_emitter_state_machine(emitter *yaml_emitter_t, event *yaml_eve...
function yaml_emitter_emit_stream_start (line 305) | func yaml_emitter_emit_stream_start(emitter *yaml_emitter_t, event *yaml...
function yaml_emitter_emit_document_start (line 358) | func yaml_emitter_emit_document_start(emitter *yaml_emitter_t,
function yaml_emitter_emit_document_content (line 485) | func yaml_emitter_emit_document_content(emitter *yaml_emitter_t, event *...
function yaml_emitter_emit_document_end (line 495) | func yaml_emitter_emit_document_end(emitter *yaml_emitter_t, event *yaml...
function yaml_emitter_emit_flow_sequence_item (line 527) | func yaml_emitter_emit_flow_sequence_item(emitter *yaml_emitter_t, event...
function yaml_emitter_emit_flow_mapping_key (line 579) | func yaml_emitter_emit_flow_mapping_key(emitter *yaml_emitter_t,
function yaml_emitter_emit_flow_mapping_value (line 644) | func yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t,
function yaml_emitter_emit_block_sequence_item (line 669) | func yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t,
function yaml_emitter_emit_block_mapping_key (line 705) | func yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t,
function yaml_emitter_emit_block_mapping_value (line 746) | func yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t,
function yaml_emitter_emit_node (line 770) | func yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t,
function yaml_emitter_emit_alias (line 802) | func yaml_emitter_emit_alias(emitter *yaml_emitter_t, event *yaml_event_...
function yaml_emitter_emit_scalar (line 817) | func yaml_emitter_emit_scalar(emitter *yaml_emitter_t, event *yaml_event...
function yaml_emitter_emit_sequence_start (line 846) | func yaml_emitter_emit_sequence_start(emitter *yaml_emitter_t, event *ya...
function yaml_emitter_emit_mapping_start (line 869) | func yaml_emitter_emit_mapping_start(emitter *yaml_emitter_t, event *yam...
function yaml_emitter_check_empty_document (line 892) | func yaml_emitter_check_empty_document(emitter *yaml_emitter_t) bool {
function yaml_emitter_check_empty_sequence (line 900) | func yaml_emitter_check_empty_sequence(emitter *yaml_emitter_t) bool {
function yaml_emitter_check_empty_mapping (line 913) | func yaml_emitter_check_empty_mapping(emitter *yaml_emitter_t) bool {
function yaml_emitter_check_simple_key (line 926) | func yaml_emitter_check_simple_key(emitter *yaml_emitter_t) bool {
function yaml_emitter_select_scalar_style (line 975) | func yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *ya...
function yaml_emitter_process_anchor (line 1038) | func yaml_emitter_process_anchor(emitter *yaml_emitter_t) bool {
function yaml_emitter_process_tag (line 1058) | func yaml_emitter_process_tag(emitter *yaml_emitter_t) bool {
function yaml_emitter_process_scalar (line 1096) | func yaml_emitter_process_scalar(emitter *yaml_emitter_t) bool {
function yaml_emitter_analyze_version_directive (line 1132) | func yaml_emitter_analyze_version_directive(emitter *yaml_emitter_t,
function yaml_emitter_analyze_tag_directive (line 1146) | func yaml_emitter_analyze_tag_directive(emitter *yaml_emitter_t,
function yaml_emitter_analyze_anchor (line 1185) | func yaml_emitter_analyze_anchor(emitter *yaml_emitter_t,
function yaml_emitter_analyze_tag (line 1215) | func yaml_emitter_analyze_tag(emitter *yaml_emitter_t, tag []byte) bool {
function yaml_emitter_analyze_scalar (line 1239) | func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) ...
function yaml_emitter_analyze_event (line 1403) | func yaml_emitter_analyze_event(emitter *yaml_emitter_t, event *yaml_eve...
function yaml_emitter_write_bom (line 1470) | func yaml_emitter_write_bom(emitter *yaml_emitter_t) bool {
function yaml_emitter_write_indent (line 1483) | func yaml_emitter_write_indent(emitter *yaml_emitter_t) bool {
function yaml_emitter_write_indicator (line 1508) | func yaml_emitter_write_indicator(emitter *yaml_emitter_t,
function yaml_emitter_write_anchor (line 1531) | func yaml_emitter_write_anchor(emitter *yaml_emitter_t, value []byte) bo...
function yaml_emitter_write_tag_handle (line 1545) | func yaml_emitter_write_tag_handle(emitter *yaml_emitter_t, value []byte...
function yaml_emitter_write_tag_content (line 1565) | func yaml_emitter_write_tag_content(emitter *yaml_emitter_t, value []byte,
function yaml_emitter_write_plain_scalar (line 1625) | func yaml_emitter_write_plain_scalar(emitter *yaml_emitter_t, value []byte,
function yaml_emitter_write_single_quoted_scalar (line 1686) | func yaml_emitter_write_single_quoted_scalar(emitter *yaml_emitter_t, va...
function yaml_emitter_write_double_quoted_scalar (line 1752) | func yaml_emitter_write_double_quoted_scalar(emitter *yaml_emitter_t, va...
function yaml_emitter_write_block_scalar_hints (line 1925) | func yaml_emitter_write_block_scalar_hints(emitter *yaml_emitter_t, valu...
function yaml_emitter_write_literal_scalar (line 1971) | func yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []...
function yaml_emitter_write_folded_scalar (line 2014) | func yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []b...
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/encode.go
type Marshaler (line 49) | type Marshaler interface
type Encoder (line 54) | type Encoder struct
method Encode (line 84) | func (e *Encoder) Encode(v interface{}) (err error) {
method emit (line 102) | func (e *Encoder) emit() {
method marshal (line 108) | func (e *Encoder) marshal(tag string, v reflect.Value, allowAddr bool) {
method emitMap (line 157) | func (e *Encoder) emitMap(tag string, v reflect.Value) {
method emitStruct (line 168) | func (e *Encoder) emitStruct(tag string, v reflect.Value) {
method emitTime (line 190) | func (e *Encoder) emitTime(tag string, v reflect.Value) {
method mapping (line 214) | func (e *Encoder) mapping(tag string, f func()) {
method emitSlice (line 230) | func (e *Encoder) emitSlice(tag string, v reflect.Value) {
method emitBase64 (line 254) | func (e *Encoder) emitBase64(tag string, v reflect.Value) {
method emitString (line 268) | func (e *Encoder) emitString(tag string, v reflect.Value) {
method emitBool (line 298) | func (e *Encoder) emitBool(tag string, v reflect.Value) {
method emitInt (line 303) | func (e *Encoder) emitInt(tag string, v reflect.Value) {
method emitUint (line 308) | func (e *Encoder) emitUint(tag string, v reflect.Value) {
method emitFloat (line 313) | func (e *Encoder) emitFloat(tag string, v reflect.Value) {
method emitNil (line 331) | func (e *Encoder) emitNil() {
method emitScalar (line 335) | func (e *Encoder) emitScalar(value, anchor, tag string, style yaml_sca...
method emitMarshaler (line 350) | func (e *Encoder) emitMarshaler(tag string, v reflect.Value) {
method emitAddrMarshaler (line 373) | func (e *Encoder) emitAddrMarshaler(tag string, v reflect.Value) {
function Marshal (line 64) | func Marshal(v interface{}) ([]byte, error) {
function NewEncoder (line 72) | func NewEncoder(w io.Writer) *Encoder {
function isEmptyValue (line 196) | func isEmptyValue(v reflect.Value) bool {
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/parser.go
function peek_token (line 64) | func peek_token(parser *yaml_parser_t) *yaml_token_t {
function skip_token (line 74) | func skip_token(parser *yaml_parser_t) {
function yaml_parser_parse (line 85) | func yaml_parser_parse(parser *yaml_parser_t, event *yaml_event_t) bool {
function yaml_parser_set_parser_error (line 105) | func yaml_parser_set_parser_error(parser *yaml_parser_t,
function yaml_parser_set_parser_error_context (line 114) | func yaml_parser_set_parser_error_context(parser *yaml_parser_t,
function yaml_parser_state_machine (line 130) | func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_...
function yaml_parser_parse_stream_start (line 211) | func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_e...
function yaml_parser_parse_document_start (line 242) | func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml...
function yaml_parser_parse_document_content (line 335) | func yaml_parser_parse_document_content(parser *yaml_parser_t, event *ya...
function yaml_parser_parse_document_end (line 363) | func yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_e...
function yaml_parser_parse_node (line 421) | func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t,
function yaml_parser_parse_block_sequence_entry (line 656) | func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t,
function yaml_parser_parse_indentless_sequence_entry (line 713) | func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t,
function yaml_parser_parse_block_mapping_key (line 762) | func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t,
function yaml_parser_parse_block_mapping_value (line 824) | func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t,
function yaml_parser_parse_flow_sequence_entry (line 867) | func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t,
function yaml_parser_parse_flow_sequence_entry_mapping_key (line 936) | func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_pars...
function yaml_parser_parse_flow_sequence_entry_mapping_value (line 962) | func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_pa...
function yaml_parser_parse_flow_sequence_entry_mapping_end (line 991) | func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_pars...
function yaml_parser_parse_flow_mapping_key (line 1022) | func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t,
function yaml_parser_parse_flow_mapping_value (line 1094) | func yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t,
function yaml_parser_process_empty_scalar (line 1128) | func yaml_parser_process_empty_scalar(parser *yaml_parser_t, event *yaml...
function yaml_parser_process_directives (line 1146) | func yaml_parser_process_directives(parser *yaml_parser_t,
function yaml_parser_append_tag_directive (line 1216) | func yaml_parser_append_tag_directive(parser *yaml_parser_t,
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/reader.go
function yaml_parser_set_reader_error (line 25) | func yaml_parser_set_reader_error(parser *yaml_parser_t, problem string,
constant BOM_UTF8 (line 39) | BOM_UTF8 = "\xef\xbb\xbf"
constant BOM_UTF16LE (line 40) | BOM_UTF16LE = "\xff\xfe"
constant BOM_UTF16BE (line 41) | BOM_UTF16BE = "\xfe\xff"
function yaml_parser_determine_encoding (line 49) | func yaml_parser_determine_encoding(parser *yaml_parser_t) bool {
function yaml_parser_update_raw_buffer (line 88) | func yaml_parser_update_raw_buffer(parser *yaml_parser_t) bool {
function yaml_parser_update_buffer (line 131) | func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool {
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/resolver.go
function init (line 42) | func init() {
function resolve (line 63) | func resolve(event yaml_event_t, v reflect.Value, useNumber bool) (strin...
function hasBinaryTag (line 118) | func hasBinaryTag(event yaml_event_t) bool {
function decode_binary (line 127) | func decode_binary(value []byte, event yaml_event_t) ([]byte, error) {
function resolve_string (line 136) | func resolve_string(val string, v reflect.Value, event yaml_event_t) (st...
function resolve_bool (line 150) | func resolve_bool(val string, v reflect.Value, event yaml_event_t) (stri...
function resolve_int (line 160) | func resolve_int(val string, v reflect.Value, useNumber bool, event yaml...
function resolve_uint (line 220) | func resolve_uint(val string, v reflect.Value, useNumber bool, event yam...
function resolve_float (line 269) | func resolve_float(val string, v reflect.Value, useNumber bool, event ya...
function resolve_time (line 315) | func resolve_time(val string, v reflect.Value, event yaml_event_t) (stri...
function resolveInterface (line 365) | func resolveInterface(event yaml_event_t, useNumber bool) (string, inter...
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/run_parser.go
function Run_parser (line 22) | func Run_parser(cmd string, args []string) {
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/scanner.go
function cache (line 501) | func cache(parser *yaml_parser_t, length int) bool {
function skip (line 512) | func skip(parser *yaml_parser_t) {
function skip_line (line 519) | func skip_line(parser *yaml_parser_t) {
function read (line 539) | func read(parser *yaml_parser_t, s []byte) []byte {
function read_line (line 564) | func read_line(parser *yaml_parser_t, s []byte) []byte {
function yaml_parser_scan (line 601) | func yaml_parser_scan(parser *yaml_parser_t, token *yaml_token_t) bool {
function yaml_parser_set_scanner_error (line 637) | func yaml_parser_set_scanner_error(parser *yaml_parser_t, context string,
function yaml_parser_set_scanner_tag_error (line 648) | func yaml_parser_set_scanner_tag_error(parser *yaml_parser_t, directive ...
function yaml_parser_fetch_more_tokens (line 661) | func yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool {
function yaml_parser_fetch_next_token (line 719) | func yaml_parser_fetch_next_token(parser *yaml_parser_t) bool {
function yaml_parser_stale_simple_keys (line 931) | func yaml_parser_stale_simple_keys(parser *yaml_parser_t) bool {
function yaml_parser_save_simple_key (line 967) | func yaml_parser_save_simple_key(parser *yaml_parser_t) bool {
function yaml_parser_remove_simple_key (line 1011) | func yaml_parser_remove_simple_key(parser *yaml_parser_t) bool {
function yaml_parser_increase_flow_level (line 1035) | func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {
function yaml_parser_decrease_flow_level (line 1051) | func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool {
function yaml_parser_roll_indent (line 1067) | func yaml_parser_roll_indent(parser *yaml_parser_t, column int,
function yaml_parser_unroll_indent (line 1107) | func yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool {
function yaml_parser_reset_indent (line 1150) | func yaml_parser_reset_indent(parser *yaml_parser_t) bool {
function yaml_parser_fetch_stream_start (line 1181) | func yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool {
function yaml_parser_fetch_stream_end (line 1213) | func yaml_parser_fetch_stream_end(parser *yaml_parser_t) bool {
function yaml_parser_fetch_directive (line 1251) | func yaml_parser_fetch_directive(parser *yaml_parser_t) bool {
function yaml_parser_fetch_document_indicator (line 1282) | func yaml_parser_fetch_document_indicator(parser *yaml_parser_t,
function yaml_parser_fetch_flow_collection_start (line 1328) | func yaml_parser_fetch_flow_collection_start(parser *yaml_parser_t,
function yaml_parser_fetch_flow_collection_end (line 1372) | func yaml_parser_fetch_flow_collection_end(parser *yaml_parser_t,
function yaml_parser_fetch_flow_entry (line 1416) | func yaml_parser_fetch_flow_entry(parser *yaml_parser_t) bool {
function yaml_parser_fetch_block_entry (line 1451) | func yaml_parser_fetch_block_entry(parser *yaml_parser_t) bool {
function yaml_parser_fetch_key (line 1510) | func yaml_parser_fetch_key(parser *yaml_parser_t) bool {
function yaml_parser_fetch_value (line 1562) | func yaml_parser_fetch_value(parser *yaml_parser_t) bool {
function yaml_parser_fetch_anchor (line 1644) | func yaml_parser_fetch_anchor(parser *yaml_parser_t, token_type yaml_tok...
function yaml_parser_fetch_tag (line 1671) | func yaml_parser_fetch_tag(parser *yaml_parser_t) bool {
function yaml_parser_fetch_block_scalar (line 1697) | func yaml_parser_fetch_block_scalar(parser *yaml_parser_t, literal bool)...
function yaml_parser_fetch_flow_scalar (line 1723) | func yaml_parser_fetch_flow_scalar(parser *yaml_parser_t, single bool) b...
function yaml_parser_fetch_plain_scalar (line 1750) | func yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool {
function yaml_parser_scan_to_next_token (line 1776) | func yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool {
function yaml_parser_scan_directive (line 1857) | func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token...
function yaml_parser_scan_directive_name (line 1970) | func yaml_parser_scan_directive_name(parser *yaml_parser_t,
function yaml_parser_scan_version_directive_value (line 2016) | func yaml_parser_scan_version_directive_value(parser *yaml_parser_t,
constant MAX_NUMBER_LENGTH (line 2055) | MAX_NUMBER_LENGTH = 9
function yaml_parser_scan_version_directive_number (line 2067) | func yaml_parser_scan_version_directive_number(parser *yaml_parser_t,
function yaml_parser_scan_tag_directive_value (line 2116) | func yaml_parser_scan_tag_directive_value(parser *yaml_parser_t,
function yaml_parser_scan_anchor (line 2183) | func yaml_parser_scan_anchor(parser *yaml_parser_t, token *yaml_token_t,
function yaml_parser_scan_tag (line 2245) | func yaml_parser_scan_tag(parser *yaml_parser_t, token *yaml_token_t) bo...
function yaml_parser_scan_tag_handle (line 2353) | func yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool,
function yaml_parser_scan_tag_uri (line 2412) | func yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool,
function yaml_parser_scan_uri_escapes (line 2484) | func yaml_parser_scan_uri_escapes(parser *yaml_parser_t, directive bool,
function yaml_parser_scan_block_scalar (line 2541) | func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_to...
function yaml_parser_scan_block_scalar_breaks (line 2775) | func yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t,
function yaml_parser_scan_flow_scalar (line 2844) | func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_tok...
function yaml_parser_scan_plain_scalar (line 3142) | func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_to...
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/tags.go
type field (line 26) | type field struct
type byName (line 38) | type byName
method Len (line 40) | func (x byName) Len() int { return len(x) }
method Swap (line 42) | func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
method Less (line 44) | func (x byName) Less(i, j int) bool {
type byIndex (line 58) | type byIndex
method Len (line 60) | func (x byIndex) Len() int { return len(x) }
method Swap (line 62) | func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
method Less (line 64) | func (x byIndex) Less(i, j int) bool {
function typeFields (line 79) | func typeFields(t reflect.Type) []field {
function dominantField (line 197) | func dominantField(fields []field) (field, bool) {
function cachedTypeFields (line 235) | func cachedTypeFields(t reflect.Type) []field {
type tagOptions (line 261) | type tagOptions
method Contains (line 343) | func (o tagOptions) Contains(optionName string) bool {
function isValidTag (line 263) | func isValidTag(s string) bool {
function fieldByIndex (line 282) | func fieldByIndex(v reflect.Value, index []int) reflect.Value {
function typeByIndex (line 295) | func typeByIndex(t reflect.Type, index []int) reflect.Type {
type stringValues (line 307) | type stringValues
method Len (line 309) | func (sv stringValues) Len() int { return len(sv) }
method Swap (line 310) | func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] }
method Less (line 311) | func (sv stringValues) Less(i, j int) bool {
function getElem (line 321) | func getElem(v reflect.Value) (reflect.Value, reflect.Kind) {
function parseTag (line 333) | func parseTag(tag string) (string, tagOptions) {
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/writer.go
function yaml_emitter_set_writer_error (line 21) | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem stri...
function yaml_emitter_flush (line 32) | func yaml_emitter_flush(emitter *yaml_emitter_t) bool {
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/yaml_definesh.go
constant yaml_VERSION_MAJOR (line 18) | yaml_VERSION_MAJOR = 0
constant yaml_VERSION_MINOR (line 19) | yaml_VERSION_MINOR = 1
constant yaml_VERSION_PATCH (line 20) | yaml_VERSION_PATCH = 6
constant yaml_VERSION_STRING (line 21) | yaml_VERSION_STRING = "0.1.6"
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/yaml_privateh.go
constant INPUT_RAW_BUFFER_SIZE (line 18) | INPUT_RAW_BUFFER_SIZE = 1024
constant INPUT_BUFFER_SIZE (line 25) | INPUT_BUFFER_SIZE = (INPUT_RAW_BUFFER_SIZE * 3)
constant OUTPUT_BUFFER_SIZE (line 31) | OUTPUT_BUFFER_SIZE = 512
constant OUTPUT_RAW_BUFFER_SIZE (line 39) | OUTPUT_RAW_BUFFER_SIZE = (OUTPUT_BUFFER_SIZE*2 + 2)
constant INITIAL_STACK_SIZE (line 41) | INITIAL_STACK_SIZE = 16
constant INITIAL_QUEUE_SIZE (line 42) | INITIAL_QUEUE_SIZE = 16
function width (line 45) | func width(b byte) int {
function copy_bytes (line 65) | func copy_bytes(dest []byte, dest_pos *int, src []byte, src_pos *int) {
function is_alpha (line 91) | func is_alpha(b byte) bool {
function is_digit (line 102) | func is_digit(b byte) bool {
function as_digit (line 110) | func as_digit(b byte) int {
function is_hex (line 118) | func is_hex(b byte) bool {
function as_hex (line 129) | func as_hex(b byte) int {
function is_blankz_at (line 150) | func is_blankz_at(b []byte, i int) bool {
function is_break_at (line 157) | func is_break_at(b []byte, i int) bool {
function is_breakz_at (line 165) | func is_breakz_at(b []byte, i int) bool {
function is_crlf_at (line 169) | func is_crlf_at(b []byte, i int) bool {
function is_z (line 176) | func is_z(b byte) bool {
function is_space (line 183) | func is_space(b byte) bool {
function is_tab (line 191) | func is_tab(b byte) bool {
function is_blank (line 198) | func is_blank(b byte) bool {
function is_ascii (line 205) | func is_ascii(b byte) bool {
function is_printable_at (line 212) | func is_printable_at(b []byte, i int) bool {
function insert_token (line 224) | func insert_token(parser *yaml_parser_t, pos int, token *yaml_token_t) {
function is_bom_at (line 248) | func is_bom_at(b []byte, i int) bool {
FILE: vendor/github.com/cloudfoundry-incubator/candiedyaml/yamlh.go
type yaml_version_directive_t (line 23) | type yaml_version_directive_t struct
type yaml_tag_directive_t (line 29) | type yaml_tag_directive_t struct
type yaml_encoding_t (line 35) | type yaml_encoding_t
constant yaml_ANY_ENCODING (line 39) | yaml_ANY_ENCODING yaml_encoding_t = iota
constant yaml_UTF8_ENCODING (line 41) | yaml_UTF8_ENCODING
constant yaml_UTF16LE_ENCODING (line 43) | yaml_UTF16LE_ENCODING
constant yaml_UTF16BE_ENCODING (line 45) | yaml_UTF16BE_ENCODING
type yaml_break_t (line 49) | type yaml_break_t
constant yaml_ANY_BREAK (line 52) | yaml_ANY_BREAK yaml_break_t = iota
constant yaml_CR_BREAK (line 53) | yaml_CR_BREAK
constant yaml_LN_BREAK (line 54) | yaml_LN_BREAK
constant yaml_CRLN_BREAK (line 55) | yaml_CRLN_BREAK
type YAML_error_type_t (line 59) | type YAML_error_type_t
constant yaml_NO_ERROR (line 63) | yaml_NO_ERROR YAML_error_type_t = iota
constant yaml_MEMORY_ERROR (line 66) | yaml_MEMORY_ERROR
constant yaml_READER_ERROR (line 69) | yaml_READER_ERROR
constant yaml_SCANNER_ERROR (line 71) | yaml_SCANNER_ERROR
constant yaml_PARSER_ERROR (line 73) | yaml_PARSER_ERROR
constant yaml_COMPOSER_ERROR (line 75) | yaml_COMPOSER_ERROR
constant yaml_WRITER_ERROR (line 78) | yaml_WRITER_ERROR
constant yaml_EMITTER_ERROR (line 80) | yaml_EMITTER_ERROR
type YAML_mark_t (line 84) | type YAML_mark_t struct
method String (line 95) | func (m YAML_mark_t) String() string {
type yaml_style_t (line 106) | type yaml_style_t
type yaml_scalar_style_t (line 109) | type yaml_scalar_style_t
constant yaml_ANY_SCALAR_STYLE (line 113) | yaml_ANY_SCALAR_STYLE yaml_scalar_style_t = iota
constant yaml_PLAIN_SCALAR_STYLE (line 116) | yaml_PLAIN_SCALAR_STYLE
constant yaml_SINGLE_QUOTED_SCALAR_STYLE (line 119) | yaml_SINGLE_QUOTED_SCALAR_STYLE
constant yaml_DOUBLE_QUOTED_SCALAR_STYLE (line 121) | yaml_DOUBLE_QUOTED_SCALAR_STYLE
constant yaml_LITERAL_SCALAR_STYLE (line 124) | yaml_LITERAL_SCALAR_STYLE
constant yaml_FOLDED_SCALAR_STYLE (line 126) | yaml_FOLDED_SCALAR_STYLE
type yaml_sequence_style_t (line 130) | type yaml_sequence_style_t
constant yaml_ANY_SEQUENCE_STYLE (line 134) | yaml_ANY_SEQUENCE_STYLE yaml_sequence_style_t = iota
constant yaml_BLOCK_SEQUENCE_STYLE (line 137) | yaml_BLOCK_SEQUENCE_STYLE
constant yaml_FLOW_SEQUENCE_STYLE (line 139) | yaml_FLOW_SEQUENCE_STYLE
type yaml_mapping_style_t (line 143) | type yaml_mapping_style_t
constant yaml_ANY_MAPPING_STYLE (line 147) | yaml_ANY_MAPPING_STYLE yaml_mapping_style_t = iota
constant yaml_BLOCK_MAPPING_STYLE (line 150) | yaml_BLOCK_MAPPING_STYLE
constant yaml_FLOW_MAPPING_STYLE (line 152) | yaml_FLOW_MAPPING_STYLE
type yaml_token_type_t (line 165) | type yaml_token_type_t
constant yaml_NO_TOKEN (line 169) | yaml_NO_TOKEN yaml_token_type_t = iota
constant yaml_STREAM_START_TOKEN (line 172) | yaml_STREAM_START_TOKEN
constant yaml_STREAM_END_TOKEN (line 174) | yaml_STREAM_END_TOKEN
constant yaml_VERSION_DIRECTIVE_TOKEN (line 177) | yaml_VERSION_DIRECTIVE_TOKEN
constant yaml_TAG_DIRECTIVE_TOKEN (line 179) | yaml_TAG_DIRECTIVE_TOKEN
constant yaml_DOCUMENT_START_TOKEN (line 181) | yaml_DOCUMENT_START_TOKEN
constant yaml_DOCUMENT_END_TOKEN (line 183) | yaml_DOCUMENT_END_TOKEN
constant yaml_BLOCK_SEQUENCE_START_TOKEN (line 186) | yaml_BLOCK_SEQUENCE_START_TOKEN
constant yaml_BLOCK_MAPPING_START_TOKEN (line 188) | yaml_BLOCK_MAPPING_START_TOKEN
constant yaml_BLOCK_END_TOKEN (line 190) | yaml_BLOCK_END_TOKEN
constant yaml_FLOW_SEQUENCE_START_TOKEN (line 193) | yaml_FLOW_SEQUENCE_START_TOKEN
constant yaml_FLOW_SEQUENCE_END_TOKEN (line 195) | yaml_FLOW_SEQUENCE_END_TOKEN
constant yaml_FLOW_MAPPING_START_TOKEN (line 197) | yaml_FLOW_MAPPING_START_TOKEN
constant yaml_FLOW_MAPPING_END_TOKEN (line 199) | yaml_FLOW_MAPPING_END_TOKEN
constant yaml_BLOCK_ENTRY_TOKEN (line 202) | yaml_BLOCK_ENTRY_TOKEN
constant yaml_FLOW_ENTRY_TOKEN (line 204) | yaml_FLOW_ENTRY_TOKEN
constant yaml_KEY_TOKEN (line 206) | yaml_KEY_TOKEN
constant yaml_VALUE_TOKEN (line 208) | yaml_VALUE_TOKEN
constant yaml_ALIAS_TOKEN (line 211) | yaml_ALIAS_TOKEN
constant yaml_ANCHOR_TOKEN (line 213) | yaml_ANCHOR_TOKEN
constant yaml_TAG_TOKEN (line 215) | yaml_TAG_TOKEN
constant yaml_SCALAR_TOKEN (line 217) | yaml_SCALAR_TOKEN
type yaml_token_t (line 221) | type yaml_token_t struct
type yaml_event_type_t (line 262) | type yaml_event_type_t
constant yaml_NO_EVENT (line 266) | yaml_NO_EVENT yaml_event_type_t = iota
constant yaml_STREAM_START_EVENT (line 269) | yaml_STREAM_START_EVENT
constant yaml_STREAM_END_EVENT (line 271) | yaml_STREAM_END_EVENT
constant yaml_DOCUMENT_START_EVENT (line 274) | yaml_DOCUMENT_START_EVENT
constant yaml_DOCUMENT_END_EVENT (line 276) | yaml_DOCUMENT_END_EVENT
constant yaml_ALIAS_EVENT (line 279) | yaml_ALIAS_EVENT
constant yaml_SCALAR_EVENT (line 281) | yaml_SCALAR_EVENT
constant yaml_SEQUENCE_START_EVENT (line 284) | yaml_SEQUENCE_START_EVENT
constant yaml_SEQUENCE_END_EVENT (line 286) | yaml_SEQUENCE_END_EVENT
constant yaml_MAPPING_START_EVENT (line 289) | yaml_MAPPING_START_EVENT
constant yaml_MAPPING_END_EVENT (line 291) | yaml_MAPPING_END_EVENT
type yaml_event_t (line 295) | type yaml_event_t struct
constant yaml_NULL_TAG (line 344) | yaml_NULL_TAG = "tag:yaml.org,2002:null"
constant yaml_BOOL_TAG (line 346) | yaml_BOOL_TAG = "tag:yaml.org,2002:bool"
constant yaml_STR_TAG (line 348) | yaml_STR_TAG = "tag:yaml.org,2002:str"
constant yaml_INT_TAG (line 350) | yaml_INT_TAG = "tag:yaml.org,2002:int"
constant yaml_FLOAT_TAG (line 352) | yaml_FLOAT_TAG = "tag:yaml.org,2002:float"
constant yaml_TIMESTAMP_TAG (line 354) | yaml_TIMESTAMP_TAG = "tag:yaml.org,2002:timestamp"
constant yaml_SEQ_TAG (line 357) | yaml_SEQ_TAG = "tag:yaml.org,2002:seq"
constant yaml_MAP_TAG (line 359) | yaml_MAP_TAG = "tag:yaml.org,2002:map"
constant yaml_DEFAULT_SCALAR_TAG (line 362) | yaml_DEFAULT_SCALAR_TAG = yaml_STR_TAG
constant yaml_DEFAULT_SEQUENCE_TAG (line 364) | yaml_DEFAULT_SEQUENCE_TAG = yaml_SEQ_TAG
constant yaml_DEFAULT_MAPPING_TAG (line 366) | yaml_DEFAULT_MAPPING_TAG = yaml_MAP_TAG
constant yaml_BINARY_TAG (line 368) | yaml_BINARY_TAG = "tag:yaml.org,2002:binary"
type yaml_node_type_t (line 372) | type yaml_node_type_t
constant yaml_NO_NODE (line 376) | yaml_NO_NODE yaml_node_type_t = iota
constant yaml_SCALAR_NODE (line 379) | yaml_SCALAR_NODE
constant yaml_SEQUENCE_NODE (line 381) | yaml_SEQUENCE_NODE
constant yaml_MAPPING_NODE (line 383) | yaml_MAPPING_NODE
type yaml_node_item_t (line 387) | type yaml_node_item_t
type yaml_node_pair_t (line 390) | type yaml_node_pair_t struct
type yaml_node_t (line 398) | type yaml_node_t struct
type yaml_document_t (line 437) | type yaml_document_t struct
type yaml_read_handler_t (line 477) | type yaml_read_handler_t
type yaml_simple_key_t (line 483) | type yaml_simple_key_t struct
type yaml_parser_state_t (line 500) | type yaml_parser_state_t
constant yaml_PARSE_STREAM_START_STATE (line 504) | yaml_PARSE_STREAM_START_STATE yaml_parser_state_t = iota
constant yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE (line 506) | yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE
constant yaml_PARSE_DOCUMENT_START_STATE (line 508) | yaml_PARSE_DOCUMENT_START_STATE
constant yaml_PARSE_DOCUMENT_CONTENT_STATE (line 510) | yaml_PARSE_DOCUMENT_CONTENT_STATE
constant yaml_PARSE_DOCUMENT_END_STATE (line 512) | yaml_PARSE_DOCUMENT_END_STATE
constant yaml_PARSE_BLOCK_NODE_STATE (line 514) | yaml_PARSE_BLOCK_NODE_STATE
constant yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE (line 516) | yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE
constant yaml_PARSE_FLOW_NODE_STATE (line 518) | yaml_PARSE_FLOW_NODE_STATE
constant yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE (line 520) | yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE
constant yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE (line 522) | yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE
constant yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE (line 524) | yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE
constant yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE (line 526) | yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE
constant yaml_PARSE_BLOCK_MAPPING_KEY_STATE (line 528) | yaml_PARSE_BLOCK_MAPPING_KEY_STATE
constant yaml_PARSE_BLOCK_MAPPING_VALUE_STATE (line 530) | yaml_PARSE_BLOCK_MAPPING_VALUE_STATE
constant yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE (line 532) | yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE
constant yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE (line 534) | yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE
constant yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE (line 536) | yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE
constant yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE (line 538) | yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE
constant yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE (line 540) | yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE
constant yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE (line 542) | yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE
constant yaml_PARSE_FLOW_MAPPING_KEY_STATE (line 544) | yaml_PARSE_FLOW_MAPPING_KEY_STATE
constant yaml_PARSE_FLOW_MAPPING_VALUE_STATE (line 546) | yaml_PARSE_FLOW_MAPPING_VALUE_STATE
constant yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE (line 548) | yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE
constant yaml_PARSE_END_STATE (line 550) | yaml_PARSE_END_STATE
type yaml_alias_data_t (line 557) | type yaml_alias_data_t struct
type yaml_parser_t (line 573) | type yaml_parser_t struct
type yaml_write_handler_t (line 733) | type yaml_write_handler_t
type yaml_emitter_state_t (line 736) | type yaml_emitter_state_t
constant yaml_EMIT_STREAM_START_STATE (line 740) | yaml_EMIT_STREAM_START_STATE yaml_emitter_state_t = iota
constant yaml_EMIT_FIRST_DOCUMENT_START_STATE (line 742) | yaml_EMIT_FIRST_DOCUMENT_START_STATE
constant yaml_EMIT_DOCUMENT_START_STATE (line 744) | yaml_EMIT_DOCUMENT_START_STATE
constant yaml_EMIT_DOCUMENT_CONTENT_STATE (line 746) | yaml_EMIT_DOCUMENT_CONTENT_STATE
constant yaml_EMIT_DOCUMENT_END_STATE (line 748) | yaml_EMIT_DOCUMENT_END_STATE
constant yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE (line 750) | yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE
constant yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE (line 752) | yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE
constant yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE (line 754) | yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE
constant yaml_EMIT_FLOW_MAPPING_KEY_STATE (line 756) | yaml_EMIT_FLOW_MAPPING_KEY_STATE
constant yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE (line 758) | yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE
constant yaml_EMIT_FLOW_MAPPING_VALUE_STATE (line 760) | yaml_EMIT_FLOW_MAPPING_VALUE_STATE
constant yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE (line 762) | yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE
constant yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE (line 764) | yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE
constant yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE (line 766) | yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE
constant yaml_EMIT_BLOCK_MAPPING_KEY_STATE (line 768) | yaml_EMIT_BLOCK_MAPPING_KEY_STATE
constant yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE (line 770) | yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE
constant yaml_EMIT_BLOCK_MAPPING_VALUE_STATE (line 772) | yaml_EMIT_BLOCK_MAPPING_VALUE_STATE
constant yaml_EMIT_END_STATE (line 774) | yaml_EMIT_END_STATE
type yaml_emitter_t (line 784) | type yaml_emitter_t struct
FILE: vendor/github.com/codegangsta/cli/app.go
type App (line 32) | type App struct
method Setup (line 123) | func (a *App) Setup() {
method Run (line 167) | func (a *App) Run(arguments []string) (err error) {
method RunAndExitOnError (line 247) | func (a *App) RunAndExitOnError() {
method RunAsSubcommand (line 256) | func (a *App) RunAsSubcommand(ctx *Context) (err error) {
method Command (line 364) | func (a *App) Command(name string) *Command {
method Categories (line 375) | func (a *App) Categories() CommandCategories {
method VisibleCategories (line 381) | func (a *App) VisibleCategories() []*CommandCategory {
method VisibleCommands (line 399) | func (a *App) VisibleCommands() []Command {
method VisibleFlags (line 410) | func (a *App) VisibleFlags() []Flag {
method hasFlag (line 414) | func (a *App) hasFlag(flag Flag) bool {
method errWriter (line 424) | func (a *App) errWriter() io.Writer {
method appendFlag (line 434) | func (a *App) appendFlag(flag Flag) {
function compileTime (line 96) | func compileTime() time.Time {
function NewApp (line 106) | func NewApp() *App {
type Author (line 441) | type Author struct
method String (line 447) | func (a Author) String() string {
function HandleAction (line 460) | func HandleAction(action interface{}, context *Context) (err error) {
FILE: vendor/github.com/codegangsta/cli/category.go
type CommandCategories (line 4) | type CommandCategories
method Less (line 12) | func (c CommandCategories) Less(i, j int) bool {
method Len (line 16) | func (c CommandCategories) Len() int {
method Swap (line 20) | func (c CommandCategories) Swap(i, j int) {
method AddCommand (line 25) | func (c CommandCategories) AddCommand(category string, command Command...
type CommandCategory (line 7) | type CommandCategory struct
method VisibleCommands (line 36) | func (c *CommandCategory) VisibleCommands() []Command {
FILE: vendor/github.com/codegangsta/cli/command.go
type Command (line 11) | type Command struct
method FullName (line 61) | func (c Command) FullName() string {
method Run (line 72) | func (c Command) Run(ctx *Context) (err error) {
method Names (line 195) | func (c Command) Names() []string {
method HasName (line 206) | func (c Command) HasName(name string) bool {
method startApp (line 215) | func (c Command) startApp(ctx *Context) error {
method VisibleFlags (line 277) | func (c Command) VisibleFlags() []Flag {
type Commands (line 69) | type Commands
FILE: vendor/github.com/codegangsta/cli/context.go
type Context (line 15) | type Context struct
method Int (line 30) | func (c *Context) Int(name string) int {
method Int64 (line 35) | func (c *Context) Int64(name string) int64 {
method Uint (line 40) | func (c *Context) Uint(name string) uint {
method Uint64 (line 45) | func (c *Context) Uint64(name string) uint64 {
method Duration (line 51) | func (c *Context) Duration(name string) time.Duration {
method Float64 (line 57) | func (c *Context) Float64(name string) float64 {
method Bool (line 62) | func (c *Context) Bool(name string) bool {
method BoolT (line 67) | func (c *Context) BoolT(name string) bool {
method String (line 72) | func (c *Context) String(name string) string {
method StringSlice (line 78) | func (c *Context) StringSlice(name string) []string {
method IntSlice (line 84) | func (c *Context) IntSlice(name string) []int {
method Int64Slice (line 90) | func (c *Context) Int64Slice(name string) []int64 {
method Generic (line 96) | func (c *Context) Generic(name string) interface{} {
method GlobalInt (line 101) | func (c *Context) GlobalInt(name string) int {
method GlobalInt64 (line 109) | func (c *Context) GlobalInt64(name string) int64 {
method GlobalUint (line 117) | func (c *Context) GlobalUint(name string) uint {
method GlobalUint64 (line 125) | func (c *Context) GlobalUint64(name string) uint64 {
method GlobalFloat64 (line 134) | func (c *Context) GlobalFloat64(name string) float64 {
method GlobalDuration (line 143) | func (c *Context) GlobalDuration(name string) time.Duration {
method GlobalBool (line 152) | func (c *Context) GlobalBool(name string) bool {
method GlobalBoolT (line 161) | func (c *Context) GlobalBoolT(name string) bool {
method GlobalString (line 170) | func (c *Context) GlobalString(name string) string {
method GlobalStringSlice (line 179) | func (c *Context) GlobalStringSlice(name string) []string {
method GlobalIntSlice (line 188) | func (c *Context) GlobalIntSlice(name string) []int {
method GlobalInt64Slice (line 197) | func (c *Context) GlobalInt64Slice(name string) []int64 {
method GlobalGeneric (line 206) | func (c *Context) GlobalGeneric(name string) interface{} {
method NumFlags (line 214) | func (c *Context) NumFlags() int {
method Set (line 219) | func (c *Context) Set(name, value string) error {
method GlobalSet (line 224) | func (c *Context) GlobalSet(name, value string) error {
method IsSet (line 229) | func (c *Context) IsSet(name string) bool {
method GlobalIsSet (line 240) | func (c *Context) GlobalIsSet(name string) bool {
method FlagNames (line 257) | func (c *Context) FlagNames() (names []string) {
method GlobalFlagNames (line 269) | func (c *Context) GlobalFlagNames() (names []string) {
method Parent (line 281) | func (c *Context) Parent() *Context {
method Args (line 289) | func (c *Context) Args() Args {
method NArg (line 295) | func (c *Context) NArg() int {
function NewContext (line 25) | func NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context {
type Args (line 286) | type Args
method Get (line 300) | func (a Args) Get(n int) string {
method First (line 308) | func (a Args) First() string {
method Tail (line 314) | func (a Args) Tail() []string {
method Present (line 322) | func (a Args) Present() bool {
method Swap (line 327) | func (a Args) Swap(from, to int) error {
function globalContext (line 335) | func globalContext(ctx *Context) *Context {
function lookupGlobalFlagSet (line 348) | func lookupGlobalFlagSet(name string, ctx *Context) *flag.FlagSet {
function lookupInt (line 360) | func lookupInt(name string, set *flag.FlagSet) int {
function lookupInt64 (line 373) | func lookupInt64(name string, set *flag.FlagSet) int64 {
function lookupUint (line 386) | func lookupUint(name string, set *flag.FlagSet) uint {
function lookupUint64 (line 399) | func lookupUint64(name string, set *flag.FlagSet) uint64 {
function lookupDuration (line 412) | func lookupDuration(name string, set *flag.FlagSet) time.Duration {
function lookupFloat64 (line 424) | func lookupFloat64(name string, set *flag.FlagSet) float64 {
function lookupString (line 437) | func lookupString(name string, set *flag.FlagSet) string {
function lookupStringSlice (line 446) | func lookupStringSlice(name string, set *flag.FlagSet) []string {
function lookupIntSlice (line 456) | func lookupIntSlice(name string, set *flag.FlagSet) []int {
function lookupInt64Slice (line 466) | func lookupInt64Slice(name string, set *flag.FlagSet) []int64 {
function lookupGeneric (line 476) | func lookupGeneric(name string, set *flag.FlagSet) interface{} {
function lookupBool (line 484) | func lookupBool(name string, set *flag.FlagSet) bool {
function lookupBoolT (line 497) | func lookupBoolT(name string, set *flag.FlagSet) bool {
function copyFlag (line 510) | func copyFlag(name string, ff *flag.Flag, set *flag.FlagSet) {
function normalizeFlags (line 518) | func normalizeFlags(flags []Flag, set *flag.FlagSet) error {
FILE: vendor/github.com/codegangsta/cli/errors.go
type MultiError (line 18) | type MultiError struct
method Error (line 28) | func (m MultiError) Error() string {
function NewMultiError (line 23) | func NewMultiError(err ...error) MultiError {
type ExitCoder (line 39) | type ExitCoder interface
type ExitError (line 45) | type ExitError struct
method Error (line 60) | func (ee *ExitError) Error() string {
method ExitCode (line 66) | func (ee *ExitError) ExitCode() int {
function NewExitError (line 51) | func NewExitError(message string, exitCode int) *ExitError {
function HandleExitCoder (line 74) | func HandleExitCoder(err error) {
FILE: vendor/github.com/codegangsta/cli/flag.go
constant defaultPlaceholder (line 14) | defaultPlaceholder = "value"
type Flag (line 43) | type Flag interface
function flagSet (line 50) | func flagSet(name string, flags []Flag) *flag.FlagSet {
function eachName (line 59) | func eachName(longName string, fn func(string)) {
type Generic (line 68) | type Generic interface
type GenericFlag (line 74) | type GenericFlag struct
method String (line 85) | func (f GenericFlag) String() string {
method Apply (line 91) | func (f GenericFlag) Apply(set *flag.FlagSet) {
method GetName (line 109) | func (f GenericFlag) GetName() string {
type StringSlice (line 114) | type StringSlice
method Set (line 117) | func (f *StringSlice) Set(value string) error {
method String (line 123) | func (f *StringSlice) String() string {
method Value (line 128) | func (f *StringSlice) Value() []string {
type StringSliceFlag (line 134) | type StringSliceFlag struct
method String (line 143) | func (f StringSliceFlag) String() string {
method Apply (line 148) | func (f StringSliceFlag) Apply(set *flag.FlagSet) {
method GetName (line 173) | func (f StringSliceFlag) GetName() string {
type IntSlice (line 178) | type IntSlice
method Set (line 181) | func (f *IntSlice) Set(value string) error {
method String (line 191) | func (f *IntSlice) String() string {
method Value (line 196) | func (f *IntSlice) Value() []int {
type IntSliceFlag (line 202) | type IntSliceFlag struct
method String (line 211) | func (f IntSliceFlag) String() string {
method Apply (line 216) | func (f IntSliceFlag) Apply(set *flag.FlagSet) {
method GetName (line 244) | func (f IntSliceFlag) GetName() string {
type Int64Slice (line 249) | type Int64Slice
method Set (line 252) | func (f *Int64Slice) Set(value string) error {
method String (line 262) | func (f *Int64Slice) String() string {
method Value (line 267) | func (f *Int64Slice) Value() []int64 {
type Int64SliceFlag (line 273) | type Int64SliceFlag struct
method String (line 282) | func (f Int64SliceFlag) String() string {
method Apply (line 287) | func (f Int64SliceFlag) Apply(set *flag.FlagSet) {
method GetName (line 315) | func (f Int64SliceFlag) GetName() string {
type BoolFlag (line 320) | type BoolFlag struct
method String (line 329) | func (f BoolFlag) String() string {
method Apply (line 334) | func (f BoolFlag) Apply(set *flag.FlagSet) {
method GetName (line 359) | func (f BoolFlag) GetName() string {
type BoolTFlag (line 365) | type BoolTFlag struct
method String (line 374) | func (f BoolTFlag) String() string {
method Apply (line 379) | func (f BoolTFlag) Apply(set *flag.FlagSet) {
method GetName (line 404) | func (f BoolTFlag) GetName() string {
type StringFlag (line 409) | type StringFlag struct
method String (line 419) | func (f StringFlag) String() string {
method Apply (line 424) | func (f StringFlag) Apply(set *flag.FlagSet) {
method GetName (line 445) | func (f StringFlag) GetName() string {
type IntFlag (line 450) | type IntFlag struct
method String (line 460) | func (f IntFlag) String() string {
method Apply (line 465) | func (f IntFlag) Apply(set *flag.FlagSet) {
method GetName (line 489) | func (f IntFlag) GetName() string {
type Int64Flag (line 494) | type Int64Flag struct
method String (line 504) | func (f Int64Flag) String() string {
method Apply (line 509) | func (f Int64Flag) Apply(set *flag.FlagSet) {
method GetName (line 533) | func (f Int64Flag) GetName() string {
type UintFlag (line 538) | type UintFlag struct
method String (line 548) | func (f UintFlag) String() string {
method Apply (line 553) | func (f UintFlag) Apply(set *flag.FlagSet) {
method GetName (line 577) | func (f UintFlag) GetName() string {
type Uint64Flag (line 582) | type Uint64Flag struct
method String (line 592) | func (f Uint64Flag) String() string {
method Apply (line 597) | func (f Uint64Flag) Apply(set *flag.FlagSet) {
method GetName (line 621) | func (f Uint64Flag) GetName() string {
type DurationFlag (line 627) | type DurationFlag struct
method String (line 637) | func (f DurationFlag) String() string {
method Apply (line 642) | func (f DurationFlag) Apply(set *flag.FlagSet) {
method GetName (line 666) | func (f DurationFlag) GetName() string {
type Float64Flag (line 671) | type Float64Flag struct
method String (line 681) | func (f Float64Flag) String() string {
method Apply (line 686) | func (f Float64Flag) Apply(set *flag.FlagSet) {
method GetName (line 709) | func (f Float64Flag) GetName() string {
function visibleFlags (line 713) | func visibleFlags(fl []Flag) []Flag {
function prefixFor (line 723) | func prefixFor(name string) (prefix string) {
function unquoteUsage (line 734) | func unquoteUsage(usage string) (string, string) {
function prefixedNames (line 750) | func prefixedNames(fullName, placeholder string) string {
function withEnvHint (line 766) | func withEnvHint(envVar, str string) string {
function flagValue (line 782) | func flagValue(f Flag) reflect.Value {
function stringifyFlag (line 790) | func stringifyFlag(f Flag) string {
function stringifyIntSliceFlag (line 834) | func stringifyIntSliceFlag(f IntSliceFlag) string {
function stringifyInt64SliceFlag (line 845) | func stringifyInt64SliceFlag(f Int64SliceFlag) string {
function stringifyStringSliceFlag (line 856) | func stringifyStringSliceFlag(f StringSliceFlag) string {
function stringifySliceFlag (line 869) | func stringifySliceFlag(usage, name string, defaultVals []string) string {
FILE: vendor/github.com/codegangsta/cli/funcs.go
type BashCompleteFunc (line 4) | type BashCompleteFunc
type BeforeFunc (line 8) | type BeforeFunc
type AfterFunc (line 12) | type AfterFunc
type ActionFunc (line 15) | type ActionFunc
type CommandNotFoundFunc (line 18) | type CommandNotFoundFunc
type OnUsageErrorFunc (line 24) | type OnUsageErrorFunc
type FlagStringFunc (line 28) | type FlagStringFunc
FILE: vendor/github.com/codegangsta/cli/help.go
type helpPrinter (line 109) | type helpPrinter
function ShowAppHelp (line 120) | func ShowAppHelp(c *Context) error {
function DefaultAppComplete (line 126) | func DefaultAppComplete(c *Context) {
function ShowCommandHelp (line 138) | func ShowCommandHelp(ctx *Context, command string) error {
function ShowSubcommandHelp (line 161) | func ShowSubcommandHelp(c *Context) error {
function ShowVersion (line 166) | func ShowVersion(c *Context) {
function printVersion (line 170) | func printVersion(c *Context) {
function ShowCompletions (line 175) | func ShowCompletions(c *Context) {
function ShowCommandCompletions (line 183) | func ShowCommandCompletions(ctx *Context, command string) {
function printHelp (line 190) | func printHelp(out io.Writer, templ string, data interface{}) {
function checkVersion (line 209) | func checkVersion(c *Context) bool {
function checkHelp (line 221) | func checkHelp(c *Context) bool {
function checkCommandHelp (line 233) | func checkCommandHelp(c *Context, name string) bool {
function checkSubcommandHelp (line 242) | func checkSubcommandHelp(c *Context) bool {
function checkCompletions (line 251) | func checkCompletions(c *Context) bool {
function checkCommandCompletions (line 260) | func checkCommandCompletions(c *Context, name string) bool {
FILE: vendor/github.com/coreos/yaml/apic.go
function yaml_insert_token (line 8) | func yaml_insert_token(parser *yaml_parser_t, pos int, token *yaml_token...
function yaml_parser_initialize (line 28) | func yaml_parser_initialize(parser *yaml_parser_t) bool {
function yaml_parser_delete (line 37) | func yaml_parser_delete(parser *yaml_parser_t) {
function yaml_string_read_handler (line 42) | func yaml_string_read_handler(parser *yaml_parser_t, buffer []byte) (n i...
function yaml_file_read_handler (line 52) | func yaml_file_read_handler(parser *yaml_parser_t, buffer []byte) (n int...
function yaml_parser_set_input_string (line 57) | func yaml_parser_set_input_string(parser *yaml_parser_t, input []byte) {
function yaml_parser_set_input_file (line 67) | func yaml_parser_set_input_file(parser *yaml_parser_t, file *os.File) {
function yaml_parser_set_encoding (line 76) | func yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encod...
function yaml_emitter_initialize (line 84) | func yaml_emitter_initialize(emitter *yaml_emitter_t) bool {
function yaml_emitter_delete (line 95) | func yaml_emitter_delete(emitter *yaml_emitter_t) {
function yaml_string_write_handler (line 100) | func yaml_string_write_handler(emitter *yaml_emitter_t, buffer []byte) e...
function yaml_file_write_handler (line 106) | func yaml_file_write_handler(emitter *yaml_emitter_t, buffer []byte) err...
function yaml_emitter_set_output_string (line 112) | func yaml_emitter_set_output_string(emitter *yaml_emitter_t, output_buff...
function yaml_emitter_set_output_file (line 121) | func yaml_emitter_set_output_file(emitter *yaml_emitter_t, file io.Write...
function yaml_emitter_set_encoding (line 130) | func yaml_emitter_set_encoding(emitter *yaml_emitter_t, encoding yaml_en...
function yaml_emitter_set_canonical (line 138) | func yaml_emitter_set_canonical(emitter *yaml_emitter_t, canonical bool) {
function yaml_emitter_set_indent (line 143) | func yaml_emitter_set_indent(emitter *yaml_emitter_t, indent int) {
function yaml_emitter_set_width (line 15
Copy disabled (too large)
Download .json
Condensed preview — 1572 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (11,576K chars).
[
{
"path": ".dockerignore",
"chars": 212,
"preview": ".DS_Store\n.idea\n.trash-cache\nbin\nstate\nbuild\nimages/*/build\nscripts/images/*/dist/\ndist\ntests/integration/.venv*\ntests/i"
},
{
"path": ".github/ISSUE_TEMPLATE.md",
"chars": 586,
"preview": "**BurmillaOS Version: (ros os version)**\n\n**Where are you running BurmillaOS? (docker-machine, AWS, GCE, baremetal, etc."
},
{
"path": ".github/workflows/create-release.yml",
"chars": 1143,
"preview": "name: release\n\non:\n workflow_dispatch:\n\njobs:\n build:\n runs-on: ubuntu-22.04\n steps:\n - uses: actions/checkou"
},
{
"path": ".github/workflows/pull-request-validation.yml",
"chars": 182,
"preview": "name: PR\non: pull_request\n\njobs:\n build:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v2\n\n - n"
},
{
"path": ".gitignore",
"chars": 393,
"preview": ".DS_Store\n/assets/ca.crt\n/state\n/bin\n/build\n/dist\n/gopath\n/images/*/build\n/scripts/images/vmware/assets\n.dockerfile\n*.sw"
},
{
"path": "Dockerfile.dapper",
"chars": 5877,
"preview": "FROM ubuntu:bionic\n# FROM arm64=arm64v8/ubuntu:bionic\n\n# get the apt-cacher proxy set\nARG APTPROXY=\nARG APT_ARCHIVE_SOUR"
},
{
"path": "LICENSE",
"chars": 10174,
"preview": "\n Apache License\n Version 2.0, January 2004\n "
},
{
"path": "Makefile",
"chars": 1798,
"preview": "TARGETS := $(shell ls scripts | grep -vE 'clean|run|help|release*|build-moby|run-moby')\n\n.dapper:\n\t@echo Downloading dap"
},
{
"path": "README.md",
"chars": 2457,
"preview": "# BurmillaOS\n\nBurmillaOS is successor of [RancherOS](//github.com/rancher/os) which reached end of life.\n\n and accept contributions via\nGitHub pull request"
},
{
"path": "config/cloudinit/DCO",
"chars": 1422,
"preview": "Developer Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n660 Yor"
},
{
"path": "config/cloudinit/Documentation/cloud-config-deprecated.md",
"chars": 998,
"preview": "# Deprecated Cloud-Config Features\n\n## Retrieving SSH Authorized Keys\n\n### From a GitHub User\n\nUsing the `coreos-ssh-imp"
},
{
"path": "config/cloudinit/Documentation/cloud-config-locations.md",
"chars": 2486,
"preview": "# Cloud-Config Locations\n\nOn every boot, coreos-cloudinit looks for a config file to configure your host. Here is a list"
},
{
"path": "config/cloudinit/Documentation/cloud-config-oem.md",
"chars": 1372,
"preview": "## OEM configuration\n\nThe `coreos.oem.*` parameters follow the [os-release spec][os-release], but have been repurposed a"
},
{
"path": "config/cloudinit/Documentation/cloud-config.md",
"chars": 21690,
"preview": "# Using Cloud-Config\n\nCoreOS allows you to declaratively customize various OS-level items, such as network configuration"
},
{
"path": "config/cloudinit/Documentation/config-drive.md",
"chars": 1268,
"preview": "# Distribution via Config Drive\n\nCoreOS supports providing configuration data via [config drive][config-drive]\ndisk imag"
},
{
"path": "config/cloudinit/Documentation/debian-interfaces.md",
"chars": 825,
"preview": "#Debian Interfaces#\n**WARNING**: This option is EXPERIMENTAL and may change or be removed at any\npoint. \nThere is basic"
},
{
"path": "config/cloudinit/Documentation/vmware-guestinfo.md",
"chars": 2089,
"preview": "# VMWare Guestinfo Interface\n\n## Cloud-Config VMWare Guestinfo Variables\n\ncoreos-cloudinit accepts configuration from th"
},
{
"path": "config/cloudinit/LICENSE",
"chars": 11325,
"preview": "Apache License\n Version 2.0, January 2004\n http://www.apache.org/licens"
},
{
"path": "config/cloudinit/MAINTAINERS",
"chars": 111,
"preview": "Alex Crawford <alex.crawford@coreos.com> (@crawford)\nJonathan Boulle <jonathan.boulle@coreos.com> (@jonboulle)\n"
},
{
"path": "config/cloudinit/NOTICE",
"chars": 126,
"preview": "CoreOS Project\nCopyright 2014 CoreOS, Inc\n\nThis product includes software developed at CoreOS, Inc.\n(http://www.coreos.c"
},
{
"path": "config/cloudinit/README.md",
"chars": 2961,
"preview": "**NOTE**: This project has been superseded by [Ignition][ignition] and is no longer under active development. Please dir"
},
{
"path": "config/cloudinit/build",
"chars": 435,
"preview": "#!/bin/bash -e\n\nNAME=\"coreos-cloudinit\"\nORG_PATH=\"github.com/coreos\"\nREPO_PATH=\"${ORG_PATH}/${NAME}\"\nVERSION=$(git descr"
},
{
"path": "config/cloudinit/config/config.go",
"chars": 4682,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/config_test.go",
"chars": 13987,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/decode.go",
"chars": 1208,
"preview": "package config\n\nimport (\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"encoding/base64\"\n\t\"fmt\"\n)\n\nfunc DecodeBase64Content(content string)"
},
{
"path": "config/cloudinit/config/etc_hosts.go",
"chars": 627,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/etcd.go",
"chars": 6442,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/etcd2.go",
"chars": 4905,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/file.go",
"chars": 947,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/file_test.go",
"chars": 1928,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/flannel.go",
"chars": 1431,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/fleet.go",
"chars": 2231,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/ignition.go",
"chars": 934,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/locksmith.go",
"chars": 1475,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/locksmith_test.go",
"chars": 2191,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/oem.go",
"chars": 819,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/script.go",
"chars": 870,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/unit.go",
"chars": 1075,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/unit_test.go",
"chars": 1297,
"preview": "/*\n Copyright 2014 CoreOS, Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use"
},
{
"path": "config/cloudinit/config/update.go",
"chars": 865,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/update_test.go",
"chars": 1181,
"preview": "/*\n Copyright 2014 CoreOS, Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use"
},
{
"path": "config/cloudinit/config/user.go",
"chars": 1717,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/validate/context.go",
"chars": 1577,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/validate/context_test.go",
"chars": 2587,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/validate/node.go",
"chars": 4493,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/validate/node_test.go",
"chars": 5272,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/validate/report.go",
"chars": 2228,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/validate/report_test.go",
"chars": 2309,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/validate/rules.go",
"chars": 5479,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/validate/rules_test.go",
"chars": 10393,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/validate/validate.go",
"chars": 5536,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/config/validate/validate_test.go",
"chars": 3918,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/cover",
"chars": 480,
"preview": "#!/bin/bash -e\n#\n# Generate coverage HTML for a package\n# e.g. PKG=./initialize ./cover\n#\n\nif [ -z \"$PKG\" ]; then\n\techo "
},
{
"path": "config/cloudinit/datasource/configdrive/configdrive.go",
"chars": 4429,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/configdrive/configdrive_test.go",
"chars": 3867,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/datasource.go",
"chars": 1330,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/file/file.go",
"chars": 1495,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/metadata/aliyun/metadata.go",
"chars": 1994,
"preview": "package aliyun\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n\n\t\"github.com/burmilla/os/config/cloudinit/datasource\"\n\t\"github.com/bu"
},
{
"path": "config/cloudinit/datasource/metadata/aliyun/metadata_test.go",
"chars": 2248,
"preview": "package aliyun\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/burmilla/os/config/cloudinit/datasource\"\n\t\"github.co"
},
{
"path": "config/cloudinit/datasource/metadata/azure/metadata.go",
"chars": 5342,
"preview": "package azure\n\nimport (\n\t\"encoding/json\"\n\t\"net\"\n\t\"net/http\"\n\t\"strconv\"\n\n\t\"github.com/burmilla/os/config/cloudinit/config"
},
{
"path": "config/cloudinit/datasource/metadata/azure/metadata_test.go",
"chars": 4061,
"preview": "package azure\n\nimport (\n\t\"bytes\"\n\t\"net\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/burmilla/os/config/cloudinit/datasource\"\n\t\"g"
},
{
"path": "config/cloudinit/datasource/metadata/cloudstack/metadata.go",
"chars": 3380,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/metadata/cloudstack/metadata_test.go",
"chars": 3077,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/metadata/digitalocean/metadata.go",
"chars": 5346,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/metadata/digitalocean/metadata_test.go",
"chars": 3653,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/metadata/ec2/metadata.go",
"chars": 5721,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/metadata/ec2/metadata_test.go",
"chars": 4396,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/metadata/exoscale/metadata.go",
"chars": 2246,
"preview": "package exoscale\n\nimport (\n\t\"net\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/burmilla/os/config/cloudinit/datasource\"\n\t\"github."
},
{
"path": "config/cloudinit/datasource/metadata/exoscale/metadata_test.go",
"chars": 2453,
"preview": "package exoscale\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/burmilla/os/config/cloudinit/datasource\"\n\t\""
},
{
"path": "config/cloudinit/datasource/metadata/gce/metadata.go",
"chars": 4345,
"preview": "// Copyright 2016 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/metadata/gce/metadata_test.go",
"chars": 3327,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/metadata/metadata.go",
"chars": 3414,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/metadata/metadata_test.go",
"chars": 6920,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/metadata/packet/metadata.go",
"chars": 3987,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/metadata/test/test.go",
"chars": 1066,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/proccmdline/proc_cmdline.go",
"chars": 2698,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/proccmdline/proc_cmdline_test.go",
"chars": 2457,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/proxmox/proxmox.go",
"chars": 2472,
"preview": "package proxmox\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"syscall\"\n\n\t\"github.com/burmilla/os/config/cloudinit/dataso"
},
{
"path": "config/cloudinit/datasource/proxmox/proxmox_test.go",
"chars": 1670,
"preview": "package proxmox\n\nimport (\n\t\"testing\"\n\n\t\"github.com/burmilla/os/config/cloudinit/datasource/test\"\n)\n\nfunc TestFetchUserda"
},
{
"path": "config/cloudinit/datasource/test/filesystem.go",
"chars": 1460,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/test/filesystem_test.go",
"chars": 2805,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/tftp/tftp.go",
"chars": 1609,
"preview": "package tftp\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/burmilla/os/config/cloudinit/datasource\""
},
{
"path": "config/cloudinit/datasource/tftp/tftp_test.go",
"chars": 2160,
"preview": "package tftp\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"testing\"\n)\n\ntype mockClient struct {\n}\n\ntype mockReceiver struct {\n}\n\nf"
},
{
"path": "config/cloudinit/datasource/url/url.go",
"chars": 1985,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/vmware/vmware.go",
"chars": 5688,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/vmware/vmware_amd64.go",
"chars": 3516,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/datasource/vmware/vmware_test.go",
"chars": 11062,
"preview": "//go:build amd64\n// +build amd64\n\n// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (t"
},
{
"path": "config/cloudinit/datasource/vmware/vmware_unsupported.go",
"chars": 762,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/initialize/env.go",
"chars": 3444,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/initialize/env_test.go",
"chars": 3971,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/initialize/github.go",
"chars": 1000,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/initialize/ssh_keys.go",
"chars": 1451,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/initialize/ssh_keys_test.go",
"chars": 4215,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/initialize/user_data.go",
"chars": 1393,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/initialize/user_data_test.go",
"chars": 1880,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/initialize/workspace.go",
"chars": 1743,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/network/debian.go",
"chars": 1629,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/network/debian_test.go",
"chars": 1608,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/network/interface.go",
"chars": 8120,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/network/interface_test.go",
"chars": 10200,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/network/is_go15_false_test.go",
"chars": 74,
"preview": "//go:build !go1.5\n// +build !go1.5\n\npackage network\n\nconst isGo15 = false\n"
},
{
"path": "config/cloudinit/network/is_go15_true_test.go",
"chars": 71,
"preview": "//go:build go1.5\n// +build go1.5\n\npackage network\n\nconst isGo15 = true\n"
},
{
"path": "config/cloudinit/network/packet.go",
"chars": 3129,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/network/stanza.go",
"chars": 8875,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/network/stanza_test.go",
"chars": 14920,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/network/vmware.go",
"chars": 4636,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/network/vmware_test.go",
"chars": 10790,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/pkg/http_client.go",
"chars": 3773,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/pkg/http_client_test.go",
"chars": 3985,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/env.go",
"chars": 1371,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/env_file.go",
"chars": 3129,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/env_file_test.go",
"chars": 10006,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/env_test.go",
"chars": 1457,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/etc_hosts.go",
"chars": 1441,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/etc_hosts_test.go",
"chars": 1465,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/etcd.go",
"chars": 1135,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/etcd2.go",
"chars": 1142,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/etcd_test.go",
"chars": 2025,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/file.go",
"chars": 2895,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/file_test.go",
"chars": 4766,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/flannel.go",
"chars": 1223,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/flannel_test.go",
"chars": 1905,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/fleet.go",
"chars": 1171,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/fleet_test.go",
"chars": 1430,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/locksmith.go",
"chars": 1171,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/locksmith_test.go",
"chars": 1474,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/oem.go",
"chars": 1350,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/oem_test.go",
"chars": 1637,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/ssh_key.go",
"chars": 1736,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/unit.go",
"chars": 2476,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/unit_test.go",
"chars": 3013,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/update.go",
"chars": 3713,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/update_test.go",
"chars": 4393,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/system/user.go",
"chars": 2321,
"preview": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "config/cloudinit/test",
"chars": 442,
"preview": "#!/bin/bash -e\n\nsource build\n\nSRC=$(find . -name '*.go' \\\n\t-not -path \"./vendor/*\")\n\nPKG=$(cd gopath/src/${REPO_PATH}; g"
},
{
"path": "config/cloudinit/units/90-configdrive.rules",
"chars": 526,
"preview": "# Automatically trigger configdrive mounting.\n\nACTION!=\"add|change\", GOTO=\"coreos_configdrive_end\"\n\n# A normal config dr"
},
{
"path": "config/cloudinit/units/90-ovfenv.rules",
"chars": 324,
"preview": "# Automatically trigger ovfenv mounting.\n\nACTION!=\"add|change\", GOTO=\"coreos_ovfenv_end\"\n\n# A normal config drive. Block"
},
{
"path": "config/cloudinit/units/media-configdrive.mount",
"chars": 409,
"preview": "[Unit]\nWants=user-configdrive.service\nBefore=user-configdrive.service\n# Only mount config drive block devices automatica"
},
{
"path": "config/cloudinit/units/media-configvirtfs.mount",
"chars": 646,
"preview": "[Unit]\nWants=user-configvirtfs.service\nBefore=user-configvirtfs.service\n# Only mount config drive block devices automati"
},
{
"path": "config/cloudinit/units/media-ovfenv.mount",
"chars": 240,
"preview": "[Unit]\nWants=user-config-ovfenv.service\nBefore=user-config-ovfenv.service\n# Only mount ovfenv drive block devices automa"
},
{
"path": "config/cloudinit/units/system-cloudinit@.service",
"chars": 251,
"preview": "[Unit]\nDescription=Load cloud-config from %f\nRequires=dbus.service\nAfter=dbus.service\nBefore=system-config.target\nCondit"
},
{
"path": "config/cloudinit/units/system-config.target",
"chars": 326,
"preview": "[Unit]\nDescription=Load system-provided cloud configs\n\n# Generate /etc/environment\nRequires=coreos-setup-environment.ser"
},
{
"path": "config/cloudinit/units/user-cloudinit-proc-cmdline.service",
"chars": 400,
"preview": "[Unit]\nDescription=Load cloud-config from url defined in /proc/cmdline\nRequires=coreos-setup-environment.service\nAfter=c"
},
{
"path": "config/cloudinit/units/user-cloudinit@.path",
"chars": 72,
"preview": "[Unit]\nDescription=Watch for a cloud-config at %f\n\n[Path]\nPathExists=%f\n"
},
{
"path": "config/cloudinit/units/user-cloudinit@.service",
"chars": 350,
"preview": "[Unit]\nDescription=Load cloud-config from %f\nRequires=coreos-setup-environment.service\nAfter=coreos-setup-environment.se"
},
{
"path": "config/cloudinit/units/user-config-ovfenv.service",
"chars": 399,
"preview": "[Unit]\nDescription=Load cloud-config from /media/ovfenv\nRequires=coreos-setup-environment.service\nAfter=coreos-setup-env"
},
{
"path": "config/cloudinit/units/user-config.target",
"chars": 370,
"preview": "[Unit]\nDescription=Load user-provided cloud configs\nRequires=system-config.target\nAfter=system-config.target\n\n# Watch fo"
},
{
"path": "config/cloudinit/units/user-configdrive.service",
"chars": 1020,
"preview": "[Unit]\nDescription=Load cloud-config from /media/configdrive\nRequires=coreos-setup-environment.service\nAfter=coreos-setu"
},
{
"path": "config/cloudinit/units/user-configvirtfs.service",
"chars": 339,
"preview": "[Unit]\nDescription=Load cloud-config from /media/configvirtfs\nRequires=coreos-setup-environment.service\nAfter=coreos-set"
},
{
"path": "config/cloudinit/vendor.manifest",
"chars": 876,
"preview": "# If you manipulate the contents of vendor/, amend this accordingly.\n# pkg version\n"
},
{
"path": "config/cmdline/cmdline.go",
"chars": 4259,
"preview": "package cmdline\n\nimport (\n\t\"io/ioutil\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/burmilla/os/pkg/util\"\n\n\tyaml \"github.com/clou"
},
{
"path": "config/config.go",
"chars": 2293,
"preview": "package config\n\nimport (\n\t\"io/ioutil\"\n\t\"strings\"\n\n\t\"github.com/burmilla/os/config/cmdline\"\n\t\"github.com/burmilla/os/pkg/"
},
{
"path": "config/config_test.go",
"chars": 9590,
"preview": "package config\n\nimport (\n\t\"testing\"\n\n\t\"github.com/burmilla/os/config/cmdline\"\n\t\"github.com/burmilla/os/pkg/util\"\n\n\tyaml "
},
{
"path": "config/data_funcs.go",
"chars": 1346,
"preview": "package config\n\nimport (\n\t\"github.com/burmilla/os/pkg/log\"\n\t\"github.com/burmilla/os/pkg/util\"\n)\n\ntype CfgFunc func(*Clou"
},
{
"path": "config/disk.go",
"chars": 11571,
"preview": "package config\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/burmill"
},
{
"path": "config/docker_config.go",
"chars": 1412,
"preview": "package config\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/fatih/structs\"\n)\n\nfunc (d *DockerConfig) FullArgs() []string {\n\targs"
}
]
// ... and 1372 more files (download for full content)
About this extraction
This page contains the full source code of the burmilla/os GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1572 files (10.2 MB), approximately 2.8M tokens, and a symbol index with 83110 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.