File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
file.include/etc/systemd/system Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description =Import debug container image
3+ ConditionPathExists =|/opt/dbgimage/debug.tar
4+ ConditionFirstBoot =yes
5+ After =containerd.service
6+ Requires =containerd.service
7+
8+ [Service]
9+ ExecStart =/bin/sh -c 'ctr image import --base-name "$(cat /opt/dbgimage/debug.tar.name)" /opt/dbgimage/debug.tar && rm -f /opt/dbgimage/debug.tar && rm -f /opt/dbgimage/debug.tar.name && rm -f /opt/dbgimage/image'
10+ Type =oneshot
11+
12+ [Install]
13+ WantedBy =multi-user.target
Original file line number Diff line number Diff line change @@ -94,6 +94,20 @@ if [ "$ENABLE_HUGEPAGE_SETUP" = "true" ]; then
9494 objcopy --add-section .cmdline=/tmp/cmdlinef --change-section-vma .cmdline=$( printf 0x%x $offs ) $addon " $addon_dir /hugepages.addon.efi"
9595fi
9696
97+ # debug container
98+ DBG_CONTAINER_IMPORT=" /sysroot/opt/dbgimage"
99+ DBG_CONTAINER_IMAGE_DUMP=" debug.tar"
100+ DBG_CONTAINER_FILE=" /sysroot/opt/dbgimage/image"
101+
102+ mkdir -p " $DBG_CONTAINER_IMPORT "
103+ if [ -f " $DBG_CONTAINER_FILE " ]; then
104+ oras backup --output " $DBG_CONTAINER_IMPORT /$DBG_CONTAINER_IMAGE_DUMP " " $( cat " $DBG_CONTAINER_FILE " ) "
105+ cat " $DBG_CONTAINER_FILE " | cut -d: -f 1 > " $DBG_CONTAINER_IMPORT /$DBG_CONTAINER_IMAGE_DUMP .name"
106+ else
107+ echo " no container image file provided, skipping..."
108+ fi
109+
110+
97111# Network config generation
98112if [[ -x /sysroot/opt/persist/network_up.sh ]]; then
99113 chroot /sysroot /opt/persist/network_up.sh
You can’t perform that action at this time.
0 commit comments