Skip to content

Commit

Permalink
docs: adding how to add language packs in autoinstall.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-hagemann committed Sep 9, 2024
1 parent 8fbb5dd commit b0d9d29
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions docs/oem-provisioning-24_04_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,39 @@ autoinstall:
EOF
touch meta-data
```
#### Adding additional Language packs

The default Ubuntu ISO only has the English language pack seeded. To have additional languages available in Gnome Initial Setup, you will need to install additional language packs via the `autoinstall.yaml`

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 '
# Installing languages not in seed
# Add language codes of packs you with to install here
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
for pkg in $(check-language-support --show-installed -l "$lang" -p "ibus,gnome-user-docs,gvfs"); do
apt-get install -y "$pkg"
done
for pkg in $(check-language-support --show-installed -l "$lang" -p "libreoffice-common"); do
apt-get install -y "$pkg"
done
done'
```
#### Serve the cloud-init configuration over HTTP
Change into the directory where the cloud-init configuration was created and start a server:
Expand Down Expand Up @@ -187,6 +219,40 @@ EOF
touch meta-data
```

#### Adding additional Language packs

The default Ubuntu ISO only has the English language pack seeded. To have additional languages available in Gnome Initial Setup, you will need to install additional language packs via the `autoinstall.yaml`

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 '
# Installing languages not in seed
# Add language codes of packs you with to install here
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
for pkg in $(check-language-support --show-installed -l "$lang" -p "ibus,gnome-user-docs,gvfs"); do
apt-get install -y "$pkg"
done
for pkg in $(check-language-support --show-installed -l "$lang" -p "libreoffice-common"); do
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 b0d9d29

Please sign in to comment.