Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions olimage/core/setup/extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@ def setup(self):
Utils.shell.run('sed -i "s/^#SystemMaxUse=.*/SystemMaxUse=64M/g" {}/etc/systemd/journald.conf'.format(env.paths['build']))
Utils.shell.run('sed -i "s/^#RuntimeMaxFileSize=.*/RuntimeMaxFileSize=8M/g" {}/etc/systemd/journald.conf'.format(env.paths['build']))
Utils.shell.run('sed -i "s/^#RuntimeMaxUse=.*/RuntimeMaxUse=16M/g" {}/etc/systemd/journald.conf'.format(env.paths['build']))

for file in env.options['extra_file']:
with Console(f'Extra file: {file}'):
Utils.install(file)
for cmd in env.options['extra_cmd']:
with Console(f'Extra command: {cmd}'):
Utils.shell.chroot(cmd)
6 changes: 6 additions & 0 deletions olimage/filesystem/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ def verify_options():

env.options['release'] = release

# Verify any extra files exist in overlays
overlay_dir = env.paths['overlay']
for file in env.options['extra_file']:
if not os.path.isfile(f'{overlay_dir}/{file}'):
raise Exception(f"Extra file '{file}' not found in overlays")


@click.command(name="filesystem")
@parameters
Expand Down
5 changes: 5 additions & 0 deletions olimage/filesystem/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def _install_packages(self) -> None:
if self._release_packages:
packages += self._release_packages.get_variant(str(self._variant_packages))

# Append extra packages from command line option
for pkg in env.options['extra_package']:
with Console(f'Extra package: {pkg}'):
packages.append(pkg)

# Try 5 times to install packages
count = 5
_e = None
Expand Down
5 changes: 4 additions & 1 deletion olimage/filesystem/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
click.option("--keyboard-layout", default="English (UK)", help="Set default system keyboard locale"),
click.option("--locale", default="en_GB.UTF-8", help="Set default system locale"),
click.option("--ssh/--no-ssh", default=True, help="Enable/Disable ssh access"),
click.option("--timezone", default="Europe/London", help="Set default system timezone")
click.option("--timezone", default="Europe/London", help="Set default system timezone"),
click.option("--extra-file", multiple=True, default=[], help="Install an extra file from the overlay dir"),
click.option("--extra-cmd", multiple=True, default=[], help="Run an extra shell command after files installed"),
click.option("--extra-package", multiple=True, default=[], help="Add an extra package to be installed"),
]


Expand Down