ryo_iso.tasks package¶
Submodules¶
ryo_iso.tasks.init module¶
-
ryo_iso.tasks.init.task_init()[source]¶ Initialize a new project
Create iso.yml config file in the current directory and install $XDG_CONFIG_HOME/ryo-iso/config.yml and $XDG_CONFIG_HOME/ryo-iso/iso_base.yml
Actions: Params: -f,--forceForce installation
Targets: Uptodate: - False
ryo_iso.tasks.main module¶
-
ryo_iso.tasks.main.task__base_efi_extract()[source]¶ Extract EFI partition from base ISO image
Extract EFI partition on Ubuntu Jammy or later…
Actions: - _logger.debug, [“extract EFI”]
ryo_iso.utils.profile_start()dd if=base_image.iso of=base_image.efiryo_iso.utils.profile_stop()
File_dep: - base_image.iso
Targets: - base_image.efi
Uptodate: - True
-
ryo_iso.tasks.main.task__base_image_check()[source]¶ Check base ISO image hash
Validate the base ISO image SHA256 checksum
Actions: - _logger.debug, [“validate base ISO”]
ryo_iso.utils.profile_start()- _ctx[‘config’].distro_base_image_check,
ryo_iso.config.Config.ubuntu_base_image_check()ryo_iso.utils.profile_stop()
Task_dep: Targets: - base_image.iso
Uptodate: - True
-
ryo_iso.tasks.main.task__base_image_download()[source]¶ Download base ISO images
The download directory for the base ISO image is configured in
$XDG_CONFIG_HOME/ryo-iso/config.yml; it defaults todistro_image_dir: ~/Downloadsand is symlinked tobase_image.isoin the project directory.Enable/disable progress indicator via the
progressparameter in ~/.config/ryo-iso/config.ymlActions: task__base_image_download.download_iso()
Uptodate: - _doit.tools.result_dep(
task__hash_version())
-
ryo_iso.tasks.main.task__base_image_extract()[source]¶ Extract files from base ISO image
Extract ISO image to
./imagein the project directoryActions: - _logger.debug, [“extract image”]
ryo_iso.utils.profile_start()sudo xorriso -osirrox on -indev base_image.iso -extract / imageryo_iso.utils.profile_stop()
File_dep: - base_image.iso
Targets: - image/.disk/base_installable
Uptodate: - True
-
ryo_iso.tasks.main.task__base_mbr_extract()[source]¶ Extract MBR partition from base ISO image
Extract MBR partition on Ubuntu Jammy or later…
Actions: - _logger.debug, [“extract MBR”]
ryo_iso.utils.profile_start()dd if=base_image.iso bs=1 count=446 of=base_image.mbrryo_iso.utils.profile_stop()
File_dep: - base_image.iso
Targets: - base_image.mbr
Uptodate: - True
-
ryo_iso.tasks.main.task__build_init()[source]¶ Setup build directories
Creates
./build/logand./build/backupActions: - _doit.tools.create_folder, [‘build/log’]
- _doit.tools.create_folder, [‘build/backup’]
Targets: - build/log
- build/backup
-
ryo_iso.tasks.main.task__chroot()[source]¶ Chrooted meta-task
Calls all of the sub-tasks applied inside the squashfs-root chroot
-
ryo_iso.tasks.main.task__chroot_apt_install()[source]¶ Chroot and install APT packages
Installs debian packages into squashfs-root chroot
-
ryo_iso.tasks.main.task__chroot_apt_purge()[source]¶ Chroot and purge APT packages
Purges debian packages from squashfs-root chroot
Actions: - _logger.debug, [“apt purge: “+pkg]
sudo chroot squashfs-root apt-get purge -y %s
Task_dep:
-
ryo_iso.tasks.main.task__chroot_apt_up()[source]¶ Chroot APT update & upgrade
Chroot into squashfs-root and run
apt updateandapt-upgradeActions: - _logger.debug, [“apt update/upgrade”]
ryo_iso.utils.profile_start()sudo chroot squashfs-root apt-get update -ysudo chroot squashfs-root apt-get upgrade -yryo_iso.utils.profile_stop()
Task_dep: Uptodate: - _doit.tools.check_timestamp_unchanged(‘squashfs-root/etc/apt’)
- _doit.tools.check_timestamp_unchanged(‘squashfs-root/etc/apt/sources.list.d’)
-
ryo_iso.tasks.main.task__chroot_dpkg_install()[source]¶ Chroot and install Debian packages
Installs local debian packages into squashfs-root chroot
Actions: - _logger.debug, [“dpkg Install: “+pkg]
sudo cp dpkg/%s squashfs-root%ssudo chroot squashfs-root dpkg -i %s/%s
Targets: - squashfs-root/var/cache/apt/archives/%s
Task_dep:
-
ryo_iso.tasks.main.task__chroot_patch()[source]¶ Apply patch script
If all else fails insert kludges here .. note:: The patch script is run outside of the chroot
- if (‘patch’ in _ctx[‘config’].iso_cfg.keys()):
actions: - _logger.debug, [“Applying patch script”]
patch.bash# as defined in iso.yml
- else:
actions: - None
Task_dep:
-
ryo_iso.tasks.main.task__chroot_pip_cache()[source]¶ Chroot and update pip cache
Pre-load Python packages into squashfs-root chroot pip cache
-
ryo_iso.tasks.main.task__chroot_pip_install()[source]¶ Chroot and install pip packages
Installs debian packages into squashfs-root chroot
-
ryo_iso.tasks.main.task__chroot_pip_local()[source]¶ Chroot and install local pip packages from wheels
Installs Python packages into squashfs-root chroot
-
ryo_iso.tasks.main.task__debug_config()[source]¶ Debug configuration information
Dump composited config
Actions: task__debug_config.print_debug()
-
ryo_iso.tasks.main.task__hash_cache()[source]¶ Cache latest upstream ISO hashes
Download SHA256SUMS* to $XDG_CACHE_HOME/ryo-iso/
Actions: - _ctx[‘config’].distro_hash_cache
ryo_iso.config.Config.ubuntu_hash_cache()
Task_dep: Targets: - ~/.cache/ryo-iso/SHA256SUMS
- ~/.cache/ryo-iso/SHA256SUMS.gpg
-
ryo_iso.tasks.main.task__hash_check()[source]¶ Check cached upstream ISO hashes
Validate GPG signature for checksums in $XDG_CACHE_HOME/ryo-iso/
Actions: - _ctx[‘config’].distro_hash_check
ryo_iso.config.Config.ubuntu_hash_check()
File_dep: - ‘~/.cache/ryo-iso/SHA256SUMS’
- ‘~/.cache/ryo-iso/SHA256SUMS.gpg’
Uptodate: - _doit.tools.result_dep(
task__hash_cache())
-
ryo_iso.tasks.main.task__hash_version()[source]¶ Extract latest version information from the hash
Locates the implicit full release version with fallback for archived releases
Actions: - _ctx[‘config’].distro_hash_version
ryo_iso.config.Config.ubuntu_hash_version()
Uptodate: - _doit.tools.result_dep(
task__hash_check())
-
ryo_iso.tasks.main.task__image()[source]¶ Setup image meta-task
Calls all of the sub-tasks for final setup of image
-
ryo_iso.tasks.main.task__image_checksum()[source]¶ Generate checksums for image
Generate md5sums for image contents
Uptodate: - _doit.tools.check_timestamp_unchanged(‘image/md5sum.txt’)
-
ryo_iso.tasks.main.task__image_preseed()[source]¶ Install preseed into image
Installs preseed configuration into the extracted image
Uptodate: - _doit.tools.check_timestamp_unchanged(‘image/preseed/ubuntu.seed’)
-
ryo_iso.tasks.main.task__image_squashfs_make()[source]¶ Make squashfs
Make image squashfs from squashfs-root
-
ryo_iso.tasks.main.task__image_squashfs_manifest()[source]¶ Store the squashfs manifest
Compute and store squashfs manifest
Uptodate: - _doit.tools.check_timestamp_unchanged(‘image/casper/filesystem.manifest’)
-
ryo_iso.tasks.main.task__image_squashfs_size()[source]¶ Store the uncompressed squash filesystem size
Compute and store squashfs size
Uptodate: - _doit.tools.check_timestamp_unchanged(‘image/casper/filesystem.size’)
-
ryo_iso.tasks.main.task__mount_dev()[source]¶ Mount pseudo-filesystems in squashfs-root
Mount /proc, /dev, /sys mountpoints inside squashfs-root
Actions: sudo mount %s %s %s
-
ryo_iso.tasks.main.task__reset_sudo_timestamp()[source]¶ Reset
sudotimestampInvalidate credential cache
Actions: sudo -ksudo true
-
ryo_iso.tasks.main.task__squashfs()[source]¶ Setup squashfs-root meta-task
Calls all of the sub-tasks for setup of squashfs-root
Task_dep:
-
ryo_iso.tasks.main.task__squashfs_apt_key()[source]¶ Install APT keys into squashfs
Installs APT keys from
./keysinto squashfs-root Migrate to keys in/usr/share/keyringsdeb [arch=amd64 signed-by=/usr/share/keyrings/repo-keyring.gpg] http://repo.example.org/ ubuntu jammy mainActions: sudo cp keys/*.gpg squashfs-root/...
Targets: squashfs-root/.../*.gpg
Uptodate: - True
-
ryo_iso.tasks.main.task__squashfs_apt_proxy()[source]¶ Enable APT proxy
Enable APT proxy while chrooted into squashfs-root
Actions: echo 'Acquire::http { Proxy "http://localhost:3142"; };' | sudo tee squashfs-root/etc/apt/apt.conf.d/01proxy
Targets: - squashfs-root/etc/apt/apt.conf.d/01proxy
Task_dep: Uptodate: - True
-
ryo_iso.tasks.main.task__squashfs_apt_repo()[source]¶ Install custom APT repositories
Add repositories to
/etc/aptin squashfs-root
-
ryo_iso.tasks.main.task__squashfs_backup()[source]¶ Backup files from image/squashfs
Backup files to be restored after updating image/squashfs
Actions: sudo cp image/preseed/ubuntu.seed build/backup/ubuntu.seedsudo cp squashfs-root/etc/apt/sources.list build/backup/sources.listsudo mv squashfs-root/etc/resolv.conf squashfs-root/etc/resolv.conf.orig
Targets: - build/backup/ubuntu.seed
- build/backup/sources.list
- squashfs-root/etc/resolv.conf.orig
Task_dep: Uptodate: - True
-
ryo_iso.tasks.main.task__squashfs_extract()[source]¶ Extract files from squashfs
Extract squashfs to
./squashfs-rootin project directoryActions: - _logger.debug, [“extract squashfs”]
ryo_iso.utils.profile_start()sudo unsquashfs image/casper/filesystem.squashfsryo_iso.utils.profile_stop()
File_dep: - base_image.iso
- image/.disk/base_installable
Targets: - squashfs-root/etc/os-release
-
ryo_iso.tasks.main.task__squashfs_modinfo()[source]¶ Patch
modinfoin squashfs-rootPatches
modinfoinside the chroot to report chrooted kernel versionActions: sudo mv squashfs-root/sbin/modinfo squashfs-root/bin/modinfotask__squashfs_modinfo.patch()sudo mv squashfs-root/tmp/modinfo squashfs-root/sbin/modinfo
Targets: - squashfs-root/bin/modinfo
Task_dep:
-
ryo_iso.tasks.main.task__squashfs_resolv()[source]¶ Install resolv.conf into squashfs-root
Installs the local resolv.conf into squashfs-root to enable chrooted networking.
Actions: sudo cp /etc/resolv.conf squashfs-root/etc/resolv.conf
Targets: - squashfs-root/etc/resolv.conf
Task_dep: Uptodate: - _doit.tools.check_timestamp_unchanged(‘squashfs-root/etc/resolv.conf’)
-
ryo_iso.tasks.main.task__squashfs_uname()[source]¶ Patch
unamein squashfs-rootMonkey patches
unameinside the chroot to report chrooted kernel versionActions: sudo cp squashfs-root/bin/uname squashfs-root/bin/uname.origtask__squashfs_uname.patch()sudo mv squashfs-root/tmp/uname squashfs-root/bin/uname
Targets: - squashfs-root/bin/uname.orig
Task_dep: