Message ID | 20221020034140.3472638-1-liwang@redhat.com |
---|---|
State | Accepted |
Headers | show |
Series | kconfig: adding new config path | expand |
Hi Li > To make kconfig parsing on RHIVOS(Red Hat In-Vehicle Operating System) correctly. > > Before: > # ./sendto03 > tst_kconfig.c:65: TINFO: Couldn't locate kernel config! > tst_kconfig.c:201: TBROK: Cannot parse kernel .config > > After: > # ./sendto03 > tst_kconfig.c:88: TINFO: Parsing kernel config '/lib/modules/5.14.0-174.137.el9iv.aarch64/config' > tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s > sendto03.c:91: TPASS: setsockopt(PACKET_RESERVE) value is capped: EINVAL (22) > sendto03.c:197: TPASS: Nothing bad happened, probably > > Signed-off-by: Li Wang <liwang@redhat.com> > Cc: Brian Grech <bgrech@redhat.com> > --- > lib/tst_kconfig.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c > index ac13866e8..a97489564 100644 > --- a/lib/tst_kconfig.c > +++ b/lib/tst_kconfig.c > @@ -47,6 +47,12 @@ static const char *kconfig_path(char *path_buf, size_t path_buf_len) > /* Common install module path */ > snprintf(path_buf, path_buf_len, "/lib/modules/%s/build/.config", un.release); > > + if (!access(path_buf, F_OK)) > + return path_buf; > + > + /* RHIVOS config path */ > + snprintf(path_buf, path_buf_len, "/lib/modules/%s/config", un.release); This kconfig path is also common, so Reviewed-by: Yang Xu <xuyang2018.jy@fujitsu.com> ps: I guess RHIVOS doesn't have kconfig file in /boot directory, so it can't be parsed. Is it right? Best Regards Yang Xu > + > if (!access(path_buf, F_OK)) > return path_buf; >
On Thu, Oct 20, 2022 at 12:02 PM xuyang2018.jy@fujitsu.com < xuyang2018.jy@fujitsu.com> wrote: > Hi Li > > > To make kconfig parsing on RHIVOS(Red Hat In-Vehicle Operating System) > correctly. > > > > Before: > > # ./sendto03 > > tst_kconfig.c:65: TINFO: Couldn't locate kernel config! > > tst_kconfig.c:201: TBROK: Cannot parse kernel .config > > > > After: > > # ./sendto03 > > tst_kconfig.c:88: TINFO: Parsing kernel config > '/lib/modules/5.14.0-174.137.el9iv.aarch64/config' > > tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s > > sendto03.c:91: TPASS: setsockopt(PACKET_RESERVE) value is capped: > EINVAL (22) > > sendto03.c:197: TPASS: Nothing bad happened, probably > > > > Signed-off-by: Li Wang <liwang@redhat.com> > > Cc: Brian Grech <bgrech@redhat.com> > > --- > > lib/tst_kconfig.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c > > index ac13866e8..a97489564 100644 > > --- a/lib/tst_kconfig.c > > +++ b/lib/tst_kconfig.c > > @@ -47,6 +47,12 @@ static const char *kconfig_path(char *path_buf, > size_t path_buf_len) > > /* Common install module path */ > > snprintf(path_buf, path_buf_len, "/lib/modules/%s/build/.config", > un.release); > > > > + if (!access(path_buf, F_OK)) > > + return path_buf; > > + > > + /* RHIVOS config path */ > > + snprintf(path_buf, path_buf_len, "/lib/modules/%s/config", > un.release); > This kconfig path is also common, so > Reviewed-by: Yang Xu <xuyang2018.jy@fujitsu.com> > Thanks! > ps: I guess RHIVOS doesn't have kconfig file in /boot directory, so it > can't be parsed. Is it right? > That's right. And I would leave this patch one more day for others to review.
Hi Li, Reviewed-by: Petr Vorel <pvorel@suse.cz> + /* RHIVOS config path */ + snprintf(path_buf, path_buf_len, "/lib/modules/%s/config", un.release); FYI openSUSE Tumbleweed also moved config to this path, I'd remove the comment and mentioned also openSUSE Tumbleweed. In the end we add also symlinks to /boot (the usual place) so that Tumbleweed works without this patch, but I guess it's better to mention that it's not just RHIVOS specific. Kind regards, Petr > > ps: I guess RHIVOS doesn't have kconfig file in /boot directory, so it > > can't be parsed. Is it right? > That's right. And I would leave this patch one more day for others to > review.
Petr Vorel <pvorel@suse.cz> wrote: > FYI openSUSE Tumbleweed also moved config to this path, I'd remove the > comment > and mentioned also openSUSE Tumbleweed. In the end we add also symlinks to > /boot > (the usual place) so that Tumbleweed works without this patch, but I guess > it's > better to mention that it's not just RHIVOS specific. Thanks for the info, very useful! Modified and pushed.
diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c index ac13866e8..a97489564 100644 --- a/lib/tst_kconfig.c +++ b/lib/tst_kconfig.c @@ -47,6 +47,12 @@ static const char *kconfig_path(char *path_buf, size_t path_buf_len) /* Common install module path */ snprintf(path_buf, path_buf_len, "/lib/modules/%s/build/.config", un.release); + if (!access(path_buf, F_OK)) + return path_buf; + + /* RHIVOS config path */ + snprintf(path_buf, path_buf_len, "/lib/modules/%s/config", un.release); + if (!access(path_buf, F_OK)) return path_buf;
To make kconfig parsing on RHIVOS(Red Hat In-Vehicle Operating System) correctly. Before: # ./sendto03 tst_kconfig.c:65: TINFO: Couldn't locate kernel config! tst_kconfig.c:201: TBROK: Cannot parse kernel .config After: # ./sendto03 tst_kconfig.c:88: TINFO: Parsing kernel config '/lib/modules/5.14.0-174.137.el9iv.aarch64/config' tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s sendto03.c:91: TPASS: setsockopt(PACKET_RESERVE) value is capped: EINVAL (22) sendto03.c:197: TPASS: Nothing bad happened, probably Signed-off-by: Li Wang <liwang@redhat.com> Cc: Brian Grech <bgrech@redhat.com> --- lib/tst_kconfig.c | 6 ++++++ 1 file changed, 6 insertions(+)