I've recently updated to ptxdist-2019.01.0 and have noted some changes with
my project that builds a kernel image with initramfs:

1) In rules/kernel.make, there is the following code:

#
# Don't keep the expanded path to INITRAMS_SOURCE in $(KERNEL_CONFIG),
# because it contains local workdir path which is not relevant to
# other developers.
#
ifdef KERNEL_INITRAMFS_SOURCE_y
        @sed -i -e
's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"# Automatically
set by PTXDist\",g' \
                "$(<)"
endif


However, this is no longer having the intended behavior. The
$(KERNEL_CONFIG) is being modified after doing a `ptxdist images`:

$ ptxdist print KERNEL_CONFIG
/home/local/GRIDPOINT/jringle/git/linux-initramfs/ptxconf/ec1k/kernelconfig-3.12
$ ptxdist print KERNEL_INITRAMFS_SOURCE_y
/home/local/GRIDPOINT/jringle/git/linux-initramfs/platform-ec1k/state/empty.cpio
$ git diff
diff --git a/ptxconf/ec1k/kernelconfig-3.12 b/ptxconf/ec1k/kernelconfig-3.12
index 247c3bb..c77037f 100644
--- a/ptxconf/ec1k/kernelconfig-3.12
+++ b/ptxconf/ec1k/kernelconfig-3.12
@@ -116,7 +116,7 @@ CONFIG_NET_NS=y
 # CONFIG_SYSFS_DEPRECATED is not set
 # CONFIG_RELAY is not set
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="# Automatically set by PTXDist"
+CONFIG_INITRAMFS_SOURCE="/home/local/GRIDPOINT/jringle/git/linux-initramfs/platform-ec1k/state/empty.cpio"
 CONFIG_INITRAMFS_ROOT_UID=0
 CONFIG_INITRAMFS_ROOT_GID=0
 # CONFIG_RD_GZIP is not set


2) As a result of the above, the build behavior is different between a
build with a tty, and a build without a tty (build by a CI build
environment), because the kernel config file has changed and
ptxd_make_kconfig_sync() in scripts/lib/ptxd_make_world_kconfig.sh is
called:

ptxd_make_kconfig_sync() {
    local mode
    if [ "${ptx_config_mode}" = run ]; then
        if tty -s; then
            ptx_config_mode=update
        else
            ptx_config_mode=check
        fi
    fi
    if [ -n "${ref_file_dotconfig}" ]; then
        file_dotconfig="${ref_file_dotconfig}" ptxd_normalize_config &&
        relative_ref_file_dotconfig="${relative_file_dotconfig}"
    fi &&
    ptxd_normalize_config &&
    ptxd_kconfig_sync_config "${ptx_config_mode}"
"${pkg_build_dir}/.config" \
        "${relative_file_dotconfig}" "${file_dotconfig}"
"${relative_ref_file_dotconfig}"
}


A build failure without a tty can be simulated with: `ssh localhost "cd
$(pwd); ptxdist images"`:

----------------------
target: kernel.prepare
----------------------

Using config file: 'linux-initramfs/ptxconf/ec1k/kernelconfig-3.12'

make[1]: Entering directory `/home/local/GRIDPOINT/jringle/git/linux'
scripts/kconfig/conf --oldconfig Kconfig
#
# configuration written to .config
#
make[1]: Leaving directory `/home/local/GRIDPOINT/jringle/git/linux'

ptxdist: error: Outdated config for 'linux-initramfs'
ptxdist: error: 'oldconfig' changes the file. Run 'oldconfig kernel' to
update.

make: ***
[/home/local/GRIDPOINT/jringle/git/linux-initramfs/platform-ec1k/state/kernel.prepare]
Error 1


I worked around this by modifying the ptxdist used by our build server so
that ptxd_make_kconfig_sync() always used ptx_config_mode=update even if
there is no tty. But I know that this is not the right solution. But I also
don't know what the proper solution should be.

Regards,
-Jon
_______________________________________________
ptxdist mailing list
[email protected]

Reply via email to