diff --git a/snapcraft_legacy/plugins/v2/_initrd_build.py b/snapcraft_legacy/plugins/v2/_initrd_build.py index ba3af7d6d0..018da243a1 100644 --- a/snapcraft_legacy/plugins/v2/_initrd_build.py +++ b/snapcraft_legacy/plugins/v2/_initrd_build.py @@ -232,11 +232,11 @@ def _make_initrd_cmd( cmd_prepare_modules_feature.extend( [ 'echo "Configuring ubuntu-core-initramfs.conf with supported modules"', - 'echo "If module is not included in initrd, do not include it"', + 'echo "If module does not exist, do not include it"', "initramfs_conf_dir=${uc_initrd_feature_kernel_modules}/usr/lib/modules-load.d", "mkdir -p ${initramfs_conf_dir}", "initramfs_conf=${initramfs_conf_dir}/ubuntu-core-initramfs.conf", - 'echo "# configures modules" > ${initramfs_conf}', + 'echo "# configured modules" > ${initramfs_conf}', " ".join( [ "for", @@ -250,7 +250,7 @@ def _make_initrd_cmd( [ "\tif [", "-n", - f'"$(modprobe -n -q --show-depends -d {install_dir} -S "${{KERNEL_RELEASE}}" ${{m}})"', + f'"$(modprobe -n -q --show-depends -d {stage_dir} -S "${{KERNEL_RELEASE}}" ${{m}})"', "]; then", ] ), diff --git a/tests/legacy/unit/plugins/v2/test_initrd.py b/tests/legacy/unit/plugins/v2/test_initrd.py index 7b5ff41586..1a28df7c8c 100755 --- a/tests/legacy/unit/plugins/v2/test_initrd.py +++ b/tests/legacy/unit/plugins/v2/test_initrd.py @@ -623,11 +623,11 @@ def _is_sub_array(array, sub_array): ], ), 'echo "Configuring ubuntu-core-initramfs.conf with supported modules"', - 'echo "If module is not included in initrd, do not include it"', + 'echo "If module does not exist, do not include it"', "initramfs_conf_dir=${uc_initrd_feature_kernel_modules}/usr/lib/modules-load.d", "mkdir -p ${initramfs_conf_dir}", "initramfs_conf=${initramfs_conf_dir}/ubuntu-core-initramfs.conf", - 'echo "# configures modules" > ${initramfs_conf}', + 'echo "# configured modules" > ${initramfs_conf}', "for m in $(cat ${initramfs_ko_modules_conf})", "do", " ".join( @@ -635,7 +635,7 @@ def _is_sub_array(array, sub_array): "\tif", "[ -n", '"$(modprobe -n -q --show-depends', - "-d ${SNAPCRAFT_PART_INSTALL}", + "-d ${SNAPCRAFT_STAGE}", '-S "${KERNEL_RELEASE}"', '${m})" ]; then', ], diff --git a/tests/unit/parts/plugins/test_initrd.py b/tests/unit/parts/plugins/test_initrd.py index 6f696c99da..ddcd8f4c2a 100644 --- a/tests/unit/parts/plugins/test_initrd.py +++ b/tests/unit/parts/plugins/test_initrd.py @@ -803,11 +803,11 @@ def _is_sub_array(array, sub_array): ], ), 'echo "Configuring ubuntu-core-initramfs.conf with supported modules"', - 'echo "If module is not included in initrd, do not include it"', + 'echo "If module does not exist, do not include it"', "initramfs_conf_dir=${uc_initrd_feature_kernel_modules}/usr/lib/modules-load.d", "mkdir -p ${initramfs_conf_dir}", "initramfs_conf=${initramfs_conf_dir}/ubuntu-core-initramfs.conf", - 'echo "# configures modules" > ${initramfs_conf}', + 'echo "# configured modules" > ${initramfs_conf}', "for m in ${initrd_configured_kernel_modules}", "do", " ".join( @@ -815,7 +815,7 @@ def _is_sub_array(array, sub_array): "\tif", "[ -n", '"$(modprobe -n -q --show-depends', - "-d ${CRAFT_PART_INSTALL}", + "-d ${CRAFT_STAGE}", '-S "${KERNEL_RELEASE}"', '${m})" ]; then', ],