Skip to content

Conversation

@imobachgs
Copy link
Contributor

@imobachgs imobachgs commented May 28, 2025

Extend the unattended installation documentation. You can check the preview.

This is a first step toward having a decent documentation. It includes:

  • Description of most of the elements in the profile.
  • Reorganization of the whole "Unattended installation" section.

We could argue that loading/exporting a profile is not limited to the unattended installation. But we could agree that, at this point, both topics are closely related.

Formatting

I have formatted the files using prettier:

$ npx prettier --write --prose-wrap always --print-width 100 $FILE

@imobachgs imobachgs force-pushed the unattended branch 6 times, most recently from ac7d7c5 to fc05c6f Compare May 28, 2025 22:49
@imobachgs imobachgs marked this pull request as ready for review June 3, 2025 10:49
- `timeout`: specify how many seconds the bootloader should wait on the menu before booting the
default entry. Unlike AutoYaST, the timeout should be a positive number. If you want the
bootloader to stop indefinitely, just set `stopOnBootMenu` to `true`.
- `extraKernelParams`: additional kernel parameters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe I would explain here that if there is need for specific kernel parameter for kernel already for installation, then it will be reused in proposal. So it is mainly for parameters that are only for installed system and not installation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not get it, sorry.

Copy link
Contributor

@ancorgs ancorgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented some small things. Overall this is an outstanding work!

- `ports`: devices to be included in the bond.
- `mode`: bond mode. Possible values: `balance-rr` (default), `active-backup`, `balance-xor`,
`broadcast`, `802.3ad`, `balance-tlb`, `balance-alb`.
- `options`: additional options.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would welcome here what can be options. Probably link to NM documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure whether the NetworkManager documentation will help here.


- `patterns`: list of patterns to install (e.g., `gnome`, `kde`, `fips`, etc.). You can find a list
of patterns for your distribution using `zypper`.
- `packages`: list of packages to install (e.g., `neovim`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now after merge of extraRepositories it is three of them. Feel free to add it to this PR or I can add it separately. As I will need to enhance when new keys for GPG will be added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add it later, no problem.

@imobachgs imobachgs requested a review from ancorgs June 3, 2025 16:01
mvidner added a commit to agama-project/agama that referenced this pull request Jun 11, 2025
## Problem

The split between `agama config` and `agama profile` commands is
arbitrary, and the subcommands are not very consistent.

- https://trello.com/c/BtqeDyzZ


## Solution

Following a discussion:
- `agama profile import` is replaced by `agama config generate | agama
config load`
- `agama profile evaluate` and `agama profile autoyast` are replaced by
`agama config generate`
- `agama profile validate` renamed to `agama config validate`

More consistency in stdio handling, adding `--output` option

- [x] update `agama-auto`

Review suggestion:
- `service/test/integration/profile_itest.rb` is an integration test,
supposed to be human readable. Please suggest improvements both in
domain coverage and test readabililty. See
`service/test/integration/README.md` on how to run it

## Testing

- `service/test/integration/profile_itest.rb` extended
- manual test of `inst.auto=http://.../config.jsonnet` and `inst.auto=`
finding it on `OEMDRV` (see [a
gist](https://gist.github.com/mvidner/d377768d54ae0ba39cd1e62672eec99a)
for setup)


## Screenshots

*If the fix affects the UI attach some screenshots here.*

## Documentation

- [x] update [cli.md][] with `cargo xtask markdown`:
agama-project/agama-project.github.io#84
- [x] ~*.schema.json~
- [x] related:
agama-project/agama-project.github.io#81 (by
Imo)
- Run: `git ls-files '*.md'`

[cli.md]:
https://github.com/agama-project/agama-project.github.io/blob/main/docs/user/cli.md
Copy link
Contributor

@mvidner mvidner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I have some corrections and improvements.

user: {
fullName: "Jane Doe",
userName: "jane.doe",
password: "123456"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs is fine but let me take this opportunity to show that while I am validating all the examples in this PR, I have found a bug in the recent users PR.

The first object is what I paste in, the second one is agama output:

cc153869b9da:/checkout # agama config generate -
{
  user: {
    fullName: "Jane Doe",
    userName: "jane.doe",
    password: "123456"
  }
}

{
  "user": {
    "fullName": "Jane Doe",
    "userName": "jane.doe"
  }
}
✗ The profile is not valid. Please, check the following errors:

        * "password" is a required property. /user

✗ Internal error: the profile was made invalid by InstallSettings round trip

Including hashedPassword: false would hide the bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will check it.


Do not use any DES or MD5 based algorithms, these are considered insecure. Check `man 5 crypt`
manual page for details about the hashing methods and their strength.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP: openssl.rpm is IMHO more likely to be installed than whois.rpm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not write the original text, so I just moved from elsewhere. For me it is fine is someone comes with a proposal. :-)

|||
}
]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI, the InstallSettings round trip makes the remaining attributes explicit:

cc153869b9da:/checkout # agama config generate -
{
  files: [
    {
      url: "/motd",
      destination: "/etc/issue.d/welcome.issue",
      permissions: "0644",
    },
    {
      destination: "/etc/sysusers.d/myapp.conf",
      content: |||
        # Type Name ID GECOS Home
        u      myapp - "My Application" /var/lib/myapp
      |||
    }
  ]
}
{
  "files": [
    {
      "url": "file:///motd",
      "permissions": "0644",
      "user": "root",
      "group": "root",
      "destination": "/etc/issue.d/welcome.issue"
    },
    {
      "content": "# Type Name ID GECOS Home\nu      myapp - \"My Application\" /var/lib/myapp\n",
      "permissions": "0644",
      "user": "root",
      "group": "root",
      "destination": "/etc/sysusers.d/myapp.conf"
    }
  ]
}
✓ The profile is valid.

Copy link
Contributor Author

@imobachgs imobachgs Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which is wrong, although out of scope. We have the same problem in several places.

## Binary files

Although the intention is to work with text files, Agama does not impose any limitation of the kind
of files you can deploy. So using a URL to a binary file should work too.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was curious so I checked: not even Jsonnet can represent binary data, which makes sense once you realize it needs a JSON representation.

],
},
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI, with /testing_using_container.sh, this fails because there are no disks, and we may want to improve the error formatting:

cc153869b9da:/checkout # agama config generate -
// There are included also helpers to search this hardware tree. To see helpers check
// "/usr/share/agama-cli/agama.libsonnet"
local agama = import 'hw.libsonnet';

// Find the biggest disk which is suitable for installing the system.
local findBiggestDisk(disks) =
  local sizedDisks = std.filter(function(d) std.objectHas(d, 'size'), disks);
  local sorted = std.sort(sizedDisks, function(x) -x.size);
  sorted[0].logicalname;
// ^ sorted[0] makes it fail
...
{
  product: {...  },
...,
}
Error: Backend call failed with status 400 and text '{"error":"Could not evaluate the profile: Jsonnet evaluation failed:\nRUNTIME ERROR: Index 0 out of bounds, not within [0, 0)\n\tprofile.jsonnet:9:3-12\t\n\tprofile.jsonnet:34:17-73\tobject <anonymous>\n\tField \"search\"\t\n\tArray element 0\t\n\tField \"drives\"\t\n\tField \"storage\"\t\n\tDuring manifestation\t\n\n"}'

Copy link
Contributor

@mvidner mvidner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now

Copy link
Contributor

@ancorgs ancorgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All my (small) objections were addressed. So this LGTM.

@imobachgs imobachgs merged commit 7a6136a into main Jun 11, 2025
5 checks passed
@imobachgs imobachgs deleted the unattended branch June 11, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants