diff mbox

[1/1] UBUNTU: 'fdr editconfig' change. Now produces a menu to choose a config to edit.

Message ID 4BFFBFB0.2020801@canonical.com
State Superseded
Delegated to: Andy Whitcroft
Headers show

Commit Message

Lee Jones May 28, 2010, 1:05 p.m. UTC
Hi all,

I have made the following changes to make it easier to edit
'per-flavour' configuration files. The old system forced the developer
to enter a menu system for each flavour until eventually landing in the
one you want/need to change. Now a menu is displayed allowing you to
jump immediately into menuconfig for your chosen flavour. If there are
any issues with it, let me know and I'll endeavor to right the wrongs. 

The following changes since commit f0819aaf4948e34a44d9d685615ddee74271cd70:
  Chase Douglas (1):
        UBUNTU: enforce CONFIG_TMPFS_POSIX_ACL=y

are available in the git repository at:

  git://kernel.ubuntu.com/lag/ubuntu-lucid.git editconfig

Lee Jones (1):
      UBUNTU: 'fdr editconfig' change. Now produces a menu to choose a
config to edit.

 debian/scripts/misc/kernelconfig |  123
++++++++++++++++++++++++++++----------
 1 files changed, 91 insertions(+), 32 deletions(-)


-
-       # Can we make this more robust by avoiding $tmpdir completely?
-       # This approach was used for now because I didn't want to change
-       # splitconfig.pl
-       (cd $archconfdir; $bindir/splitconfig.pl; mv config.common \
-        config.common.$arch; cp config.common.$arch $tmpdir)
+       run_splitconfig
 done
 
 rm -f $common_conf
@@ -130,7 +190,7 @@ rm -f $common_conf
 (
        cd $confdir;
        rm -f *-full
-       grep -v 'is UNMERGABLE' <$tmpdir/config.common >$common_conf
+       grep -v  'is UNMERGABLE' <$tmpdir/config.common >$common_conf
        for arch in $archs; do
                grep -v 'is UNMERGABLE' <$tmpdir/config.common.$arch \
                        >$arch/config.common.$arch
@@ -159,4 +219,3 @@ if [ "$fail" != 0 ]; then
 fi
 
 rm -rf build
-

Kind regards,
Lee

Comments

Lee Jones May 28, 2010, 1:44 p.m. UTC | #1
Ignore this for the moment. I still need to make a couple of changes.

Kind regards,
Lee
Lee Jones May 30, 2010, 9:55 a.m. UTC | #2
All,

Please ignore this now.

I have decided to go for a simpler solution with minimal code disruption
and very little function loss.

Please refer to: [PATCH 1/1] UBUNTU: 'fdr editconfig' modification.
Easily skip over unwanted menuconfigs.

Kind regards,
Lee
diff mbox

Patch

diff --git a/debian/scripts/misc/kernelconfig
b/debian/scripts/misc/kernelconfig
index 71c0f5e..9d8793a 100755 (executable)
--- a/debian/scripts/misc/kernelconfig
+++ b/debian/scripts/misc/kernelconfig
@@ -38,18 +38,93 @@  if [ "$mode" = "genconfig" ]; then
        test -d CONFIGS || mkdir CONFIGS
 fi
 
-for arch in $archs; do
-       rm -rf build
-       mkdir build
-
+map_arch()
+{
        # Map debian archs to kernel archs
        case "$arch" in
                amd64)  kernarch="x86_64"       ;;
                lpia)   kernarch="x86"          ;;
                sparc)  kernarch="sparc64"      ;;
                armel)  kernarch="arm"          ;;
-               *)      kernarch="$arch"        ;;
+               *)          kernarch="$arch"    ;;
        esac
+}
+
+save_config()
+{
+       cat build/.config > $archconfdir/$config
+       cat build/.config > "$tmpdir/CONFIGS/$arch-$config"
+       if [ "$keep" = "1" ]; then
+               cat build/.config > CONFIGS/$arch-$config
+       fi
+}
+
+run_splitconfig()
+{
+       echo "Running splitconfig.pl for $arch"
+       echo
+
+       # Can we make this more robust by avoiding $tmpdir completely?
+       # This approach was used for now because I didn't want to change
+       # splitconfig.pl
+       (cd $archconfdir; $bindir/splitconfig.pl; mv config.common \
+        config.common.$arch; cp config.common.$arch $tmpdir)
+}
+
+edit_config()
+{
+       inc=0
+       for arch in $archs; do
+               archconfdir=$confdir/$arch
+               archconfigs=$(cd $archconfdir && ls config.flavour.*)
+
+               fullarchconfigs=""
+               for archconfig in $archconfigs; do
+                       fullarchconfigs="$fullarchconfigs $arch/$archconfig"
+               done
+              
+               configs="$configs $fullarchconfigs"
+       done
+
+       echo -e "Which config would you like to edit?\n"
+       for config in $configs; do
+               echo "$inc) $config"
+               inc=$(($inc+1))
+       done
+
+       echo -ne "\n> "
+       read choice
+
+       inc=0
+       for config in $configs; do
+               if [ $inc -eq $choice ]; then
+                       echo "You choose: $config"
+                      
+                       arch=${config%/*}
+                       archconfdir=$confdir/$arch
+                       map_arch
+
+                       rm -rf build
+                       mkdir build
+                       cat "$confdir/$config" > build/.config
+                       make O=`pwd`/build ARCH=$kernarch menuconfig
+                       config=${config#*/}
+                       break
+               fi
+               inc=$(($inc+1))
+       done
+
+       save_config
+       run_splitconfig
+
+       exit
+}
+
+for arch in $archs; do
+       rm -rf build
+       mkdir build
+
+       map_arch
 
        echo ""
        echo "***************************************"
@@ -87,39 +162,24 @@  for arch in $archs; do
                        # Call oldconfig or menuconfig
                        case "$mode" in
                            oldconfig)
-                               # Weed out incorrect config parameters
-                               echo "* Run silentoldconfig on
$arch/$config ..."
-                               make O=`pwd`/build ARCH=$kernarch
silentoldconfig ;;
+                                   # Weed out incorrect config parameters
+                                       echo "* Run silentoldconfig on
$arch/$config ..."
+                                       make O=`pwd`/build
ARCH=$kernarch silentoldconfig ;;
                            defaultconfig)
-                               # Weed out incorrect config parameters
-                               echo "* Run oldconfig on $arch/$config ..."
-                               make O=`pwd`/build ARCH=$kernarch
oldconfig ;;
+                                   # Weed out incorrect config parameters
+                                       echo "* Run oldconfig on
$arch/$config ..."
+                                       make O=`pwd`/build
ARCH=$kernarch oldconfig ;;
                            editconfig)
-                               # Interactively edit config parameters
-                               echo " * Run menuconfig on
$arch/$config... Press a key."
-                               read
-                               make O=`pwd`/build ARCH=$kernarch
menuconfig ;;
-                           *)  # Bad!
+                                       edit_config ;;
+                               *)  # Bad!
                                exit 1 ;;
                        esac
-                       cat build/.config > $archconfdir/$config
-                       cat build/.config > "$tmpdir/CONFIGS/$arch-$config"
-                       if [ "$keep" = "1" ]; then
-                               cat build/.config > CONFIGS/$arch-$config
-                       fi
+                       save_config
                else
                        echo "!! Config not found $archconfdir/$config..."
                fi
        done
-
-       echo "Running splitconfig.pl for $arch"
-       echo