/snap/core24/1643/usr/lib/python3/dist-packages/cloudinit/distros
NameSizeModeActions
package_management/-0755rm
parsers/-0755rm
__pycache__/-0755rm
almalinux.py1510644editdlrm
alpine.py249320644editdlrm
amazon.py9070644editdlrm
aosc.py44820644editdlrm
arch.py50370644editdlrm
azurelinux.py24050644editdlrm
bsd.py64900644editdlrm
bsd_utils.py14400644editdlrm
centos.py1510644editdlrm
cloudlinux.py1510644editdlrm
cos.py2470644editdlrm
debian.py108570644editdlrm
dragonflybsd.py2300644editdlrm
eurolinux.py1510644editdlrm
fedora.py4370644editdlrm
freebsd.py87350644editdlrm
gentoo.py49900644editdlrm
mariner.py17400644editdlrm
miraclelinux.py1510644editdlrm
netbsd.py56470644editdlrm
networking.py110700644editdlrm
openbsd.py24230644editdlrm
OpenCloudOS.py2770644editdlrm
openeuler.py2750644editdlrm
openmandriva.py2370644editdlrm
opensuse-leap.py2470644editdlrm
opensuse-microos.py2470644editdlrm
opensuse-tumbleweed.py2470644editdlrm
opensuse.py102010644editdlrm
photon.py54860644editdlrm
raspberry_pi_os.py22570644editdlrm
rhel.py81720644editdlrm
rhel_util.py14300644editdlrm
rocky.py1510644editdlrm
sle-micro.py2470644editdlrm
sles.py2470644editdlrm
sle_hpc.py2470644editdlrm
suse.py810644editdlrm
TencentOS.py2770644editdlrm
ubuntu.py23740644editdlrm
ug_util.py100010644editdlrm
virtuozzo.py1510644editdlrm
__init__.py675420644editdlrm
Edit: /snap/core24/1643/usr/lib/python3/dist-packages/cloudinit/distros/raspberry_pi_os.py (2257B)
# Copyright (C) 2024-2025 Raspberry Pi Ltd. All rights reserved. # # Author: Paul Oberosler # # This file is part of cloud-init. See LICENSE file for license information. import logging from cloudinit import subp from cloudinit.distros import debian LOG = logging.getLogger(__name__) class Distro(debian.Distro): def set_keymap(self, layout: str, model: str, variant: str, options: str): """Currently Raspberry Pi OS sys-mods only supports setting the layout""" subp.subp( [ "/usr/lib/raspberrypi-sys-mods/imager_custom", "set_keymap", layout, ] ) def apply_locale(self, locale, out_fn=None, keyname="LANG"): try: subp.subp( [ "/usr/bin/raspi-config", "nonint", "do_change_locale", f"{locale}", ] ) except subp.ProcessExecutionError: if not locale.endswith(".UTF-8"): LOG.info("Trying to set locale %s.UTF-8", locale) subp.subp( [ "/usr/bin/raspi-config", "nonint", "do_change_locale", f"{locale}.UTF-8", ] ) else: LOG.error("Failed to set locale %s") def add_user(self, name, **kwargs) -> bool: """ Add a user to the system using standard GNU tools This should be overridden on distros where useradd is not desirable or not available. Returns False if user already exists, otherwise True. """ result = super().add_user(name, **kwargs) if not result: return result try: subp.subp( [ "/usr/bin/rename-user", "-f", "-s", ], update_env={"SUDO_USER": name}, ) except subp.ProcessExecutionError as e: LOG.error("Failed to setup user: %s", e) return False return True