Skip to content

Commit

Permalink
docs: adding how to add language packs in autoinstall.yaml (#815)
Browse files Browse the repository at this point in the history
Adding a section on how to install additional language packs to appear
in GIS via running late-commands in the `autoinstall.yaml`

This is doubled up as its applicable to two flow's
  • Loading branch information
matthew-hagemann authored Sep 10, 2024
2 parents 8fbb5dd + 67816a0 commit effca9c
Showing 1 changed file with 63 additions and 0 deletions.
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

0 comments on commit effca9c

Please sign in to comment.