Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: adding how to add language packs in autoinstall.yaml #815

Merged
merged 6 commits into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions docs/oem-provisioning-24_04_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,37 @@ autoinstall:
EOF
touch meta-data
```
#### Adding additional Language packs

The default Ubuntu ISO seeds multiple languages, but only carries one to the target system. To have
additional languages available in Gnome Initial Setup, you will need to install additional language
packs via the `autoinstall.yaml` onto the target system

To install additional language packs, you can make use of [late commands](https://canonical-subiquity.readthedocs-hosted.com/en/latest/reference/autoinstall-reference.html#late-commands)
in the `autoinstall.yaml:

```yaml
#cloud-config
autoinstall:
version: 1
late-commands:
- |
curtin in-target --target=/target -- bash -c '
# Update the package list
apt-get update
# Installing extra languages
for lang in "fr" "de"; do
for pkg in $(check-language-support --show-installed -l "$lang"); do
# gimp: not installed by default
# fcitx5: not used by ubuntu as gnome is in use
# mozc-utils-gui: is in universe
if [ "${pkg%%-*}" = gimp ] || [ "${pkg%%-*}" = fcitx5 ] || [ "$pkg" = "mozc-utils-gui" ]; then
continue
fi
apt-get install -y "$pkg"
done
done'
```

#### Serve the cloud-init configuration over HTTP

Expand Down Expand Up @@ -187,6 +218,38 @@ EOF
touch meta-data
```

#### Adding additional Language packs

The default Ubuntu ISO seeds multiple languages, but only carries one to the target system. To have
additional languages available in Gnome Initial Setup, you will need to install additional language
packs via the `autoinstall.yaml` onto the target system

To install additional language packs, you can make use of [late commands](https://canonical-subiquity.readthedocs-hosted.com/en/latest/reference/autoinstall-reference.html#late-commands)
in the `autoinstall.yaml:

```yaml
#cloud-config
autoinstall:
version: 1
late-commands:
- |
curtin in-target --target=/target -- bash -c '
# Update the package list
apt-get update
# Installing extra languages
for lang in "fr" "de"; do
for pkg in $(check-language-support --show-installed -l "$lang"); do
# gimp: not installed by default
# fcitx5: not used by ubuntu as gnome is in use
# mozc-utils-gui: is in universe
if [ "${pkg%%-*}" = gimp ] || [ "${pkg%%-*}" = fcitx5 ] || [ "$pkg" = "mozc-utils-gui" ]; then
continue
fi
apt-get install -y "$pkg"
done
done'
```

#### Create an ISO to use as a cloud-init data source

Install utilities for working with cloud images:
Expand Down
Loading