mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] Problems building kernel image with initramfs with no tty
@ 2019-02-18 16:11 Jon Ringle
  2019-02-22  8:11 ` [ptxdist] [PATCH] kernel: rework prepare stage Michael Olbrich
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Ringle @ 2019-02-18 16:11 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 3325 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 8570 bytes --]

[-- Attachment #2: Type: text/plain, Size: 91 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-22 17:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18 16:11 [ptxdist] Problems building kernel image with initramfs with no tty Jon Ringle
2019-02-22  8:11 ` [ptxdist] [PATCH] kernel: rework prepare stage Michael Olbrich
2019-02-22 17:23   ` Jon Ringle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox