Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
themylogin committed Dec 16, 2024
1 parent feebace commit 9e75503
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion scale_build/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def build_extensions(rootfs_image, dst_dir):
os.makedirs(chroot_base)
run(["unsquashfs", "-dest", chroot_base, rootfs_image])

for klass, name in [(DevToolsExtension, "dev-tools"), (NvidiaExtension, "nvidia")]:
for klass, name in [
#(DevToolsExtension, "dev-tools"),
(NvidiaExtension, "nvidia")]:
klass(rootfs_image, chroot_base, chroot).build(name, f"{dst_dir}/{name}.raw")


Expand Down
3 changes: 2 additions & 1 deletion scale_build/image/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def install_rootfs_packages():


def install_rootfs_packages_impl():
"""
os.makedirs(os.path.join(CHROOT_BASEDIR, 'etc/dpkg/dpkg.cfg.d'), exist_ok=True)
with open(os.path.join(CHROOT_BASEDIR, 'etc/dpkg/dpkg.cfg.d/force-unsafe-io'), 'w') as f:
f.write('force-unsafe-io')
Expand Down Expand Up @@ -115,8 +116,8 @@ def install_rootfs_packages_impl():
# Do any pruning of rootfs
clean_rootfs()
"""

umount_chroot_basedir()
build_extensions()

with open(os.path.join(CHROOT_BASEDIR, 'etc/apt/sources.list'), 'w') as f:
Expand Down
11 changes: 7 additions & 4 deletions scale_build/update_image.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import subprocess

import logging
import os

Expand Down Expand Up @@ -29,14 +31,15 @@ def build_update_image_impl():
os.makedirs(CHROOT_BASEDIR)
logger.debug('Bootstrapping TrueNAS rootfs [UPDATE] (%s/rootfs-bootstrap.log)', LOG_DIR)

with LoggingContext('rootfs-bootstrap', 'w'):
package_bootstrap_obj = RootfsBootstrapDir()
package_bootstrap_obj.setup()
#with LoggingContext('rootfs-bootstrap', 'w'):
# package_bootstrap_obj = RootfsBootstrapDir()
# package_bootstrap_obj.setup()
subprocess.run(['unsquashfs', '-d', CHROOT_BASEDIR, '/1'])

logger.debug('Installing TrueNAS rootfs package [UPDATE] (%s/rootfs-packages.log)', LOG_DIR)
try:
with LoggingContext('rootfs-packages', 'w'):
setup_chroot_basedir(package_bootstrap_obj)
#setup_chroot_basedir(package_bootstrap_obj)

# These files will be overwritten, so we should make sure that new build does not have any entities that
# are not in our reference files.
Expand Down

0 comments on commit 9e75503

Please sign in to comment.