Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 41166 - genkernel test $columns and $lines before starting menuconfig
Summary: genkernel test $columns and $lines before starting menuconfig
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: Inclusion
: 41181 (view as bug list)
Depends on: 41213
Blocks:
  Show dependency tree
 
Reported: 2004-02-10 14:16 UTC by Aaron Peterson
Modified: 2004-03-21 07:50 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
new function that gets called early only if menuconfig is as option (gen_configkernel.sh,2.26 KB, text/plain)
2004-02-11 02:18 UTC, Aaron Peterson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Peterson 2004-02-10 14:16:51 UTC
I'm posting a patch... er.. snippit in a second that will make genkernel die immediately if the terminal size is too small for menuconfig and menuconfig is set as an option

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Aaron Peterson 2004-02-10 16:18:32 UTC
ok.. This is more difficult that I thought it was, 

$COLUMNS and $ROWS dissapear from the system in that script..

and somebody at #bash told me to switch #!/bin/bash to #/bin/bash =ic but that didn't work

also there was fun with "urnary operator" errors...

can I use awk and stty to get this information?
Comment 2 Aaron Peterson 2004-02-11 00:54:57 UTC
#!/bin/bash
ROWS=[ stty -a | grep rows | awk '{ print $5 }' | sed s/\;//; ]
COLS=[ stty -a | grep rows | awk '{ print $7 }' | sed s/\;//; ]
echo $ROWS
echo $COLS

produces some errors but rows and cols get assigned right!
Comment 3 Martin Holzer (RETIRED) gentoo-dev 2004-02-11 01:19:27 UTC
*** Bug 41181 has been marked as a duplicate of this bug. ***
Comment 4 Aaron Peterson 2004-02-11 02:18:26 UTC
Created attachment 25390 [details]
new function that gets called early only if menuconfig is as option

Sorry, I don't know how to make a diff yet... well...actually I overwrote the
one that was there...

but the new function is called check_term_size()
and it is only called from config_kernel() once.

This took a whole day to develop, and it isn't elegant... but it's simple
enough, and it will keep the system from doing a superfelous make clean and
make mrproper if it wasn't going to work anyway.
Comment 5 Aaron Peterson 2004-02-11 02:27:51 UTC
I just realized!

It is now possible to redirect the output of make menuconfig to /dev/null.. so the whole thing will look way cleaner...


it could look something like this:

* ARCH: x86
* KERNEL VER: 2.6.3-rc2-gentoo
* kernel: configuring source
* kernel: running mrproper
* kernel: using config from /usr/share/genkernel/x86/kernel-config-2.6 -- prev backed up to .config.bak
* kernel: running oldconfig
* kernel: running clean
* kernel: running menuconfig 
* kernel: skipping make dep for non 2.4 kernels
* kernel: Starting compile of linux 2.6.3-rc2-gentoo bzImage
...

one problem though, one will want to know if the kernel configuration was saved or not... so there should be an additional

* kernel: config NOT saved
or
* kernel: config saved

we would be skipping stuff like:
 HOSTCC  scripts/fixdep
  SHIPPED scripts/kconfig/zconf.tab.h
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/mconf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/lex.zconf.c
  HOSTCC  -fPIC scripts/kconfig/zconf.tab.o
  HOSTLLD -shared scripts/kconfig/libkconfig.so
  HOSTLD  scripts/kconfig/mconf
  HOSTCC  scripts/lxdialog/checklist.o
  HOSTCC  scripts/lxdialog/inputbox.o
  HOSTCC  scripts/lxdialog/lxdialog.o
  HOSTCC  scripts/lxdialog/menubox.o
  HOSTCC  scripts/lxdialog/msgbox.o
  HOSTCC  scripts/lxdialog/textbox.o
  HOSTCC  scripts/lxdialog/util.o
  HOSTCC  scripts/lxdialog/yesno.o
  HOSTLD  scripts/lxdialog/lxdialog
scripts/kconfig/mconf arch/i386/Kconfig
#
# using defaults found in .config
#


Your kernel configuration changes were NOT saved.
Comment 6 Aaron Peterson 2004-02-11 22:05:09 UTC
that should be --no-menuconfig
Comment 7 Aaron Peterson 2004-02-17 23:52:33 UTC
gosh, no review... I guess resolved test-request was the wrong way to mark the bug.
Comment 8 Aaron Peterson 2004-03-02 02:25:55 UTC
bug 41328 incorperates this fix

If you don't want to incorperate this (which I think is very important, because makeing clean without building the source aftwerwards can screw lots of things up (emerging glibc for example)

and this prevents that...

anyway, if this isn't liked, bug 41328 will probably be liked less, but there are too many bugs open

*** This bug has been marked as a duplicate of 41328 ***
Comment 9 Aaron Peterson 2004-03-20 00:11:39 UTC
slowly learning bugzilla..
Comment 10 Aaron Peterson 2004-03-20 00:12:20 UTC
slowly learning bugzilla..
Comment 11 Tim Yamin (RETIRED) gentoo-dev 2004-03-21 07:50:37 UTC
This is implemented in genkernel-3.0.2_rc1. Thanks!

Sidenote: It's much better to check it when the command line options are parsed rather than when a lot more has been run which takes a longer execution path so time is lost.