TritonDataCenter / smartos-lx-img-builder

Build smartos lx images from userland tar files.
Mozilla Public License 2.0
6 stars 2 forks source link

Discover as much as possible #2

Closed bahamat closed 2 years ago

bahamat commented 2 years ago

This will derive most properties from the extracted tar (from etc/os-release) or fabricate somewhat-sane defaults.

~/smartos-lx-img-builder]# cargo run -- -h
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/smartos-lx-img-builder -h`
smartos-lx-img-builder 0.1.0

USAGE:
    smartos-lx-img-builder [OPTIONS] --tar <tar>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -d, --description <description>    text to append to the description of the image as it would appear in the manifest
                                       [default: ]
    -k, --kernel <kernel>              the kernel version [default: 5.10.0]
    -m, --min <min_platform>           the minimum platform required for the image [default: 20210826T002459Z]
    -t, --tar <tar>                    lx userland tar file
    -u, --url <url>                    the url to information about the image as it would appear in the manifest
                                       [default: https://docs.joyent.com/public-cloud/instances/infrastructure/images]
    -z, --zfs-parent <zfs_parent>      the parent zfs dataset to use when creating our temporary image [default: ]
bahamat commented 2 years ago

Example manifest output

{
  "description": "Container-native Devuan GNU/Linux 4 (chimaera) 64-bit image.",
  "files": [
    {
      "compression": "gzip",
      "sha1": "2e32e835ed9d434f8bb83a2101a5b04f3b9d743f",
      "size": "136208658"
    }
  ],
  "homepage": "https://docs.joyent.com/public-cloud/instances/infrastructure/images",
  "name": "devuan-4",
  "os": "linux",
  "owner": "00000000-0000-0000-0000-000000000000",
  "public": false,
  "published_at": "2022-03-04T21:08:03Z",
  "requirements": {
    "brand": "lx",
    "min_platform": {
      "7.0": "20210826T002459Z"
    },
    "networks": [
      {
        "description": "public",
        "name": "net0"
      }
    ]
  },
  "tags": {
    "kernel_version": "5.10.0",
    "role": "os"
  },
  "type": "lx-dataset",
  "uuid": "d0c1b8b7-80bf-496e-8814-e283f6e3f18a",
  "v": "2",
  "version": "20220304"
}