From patchwork Fri May 28 13:05:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 53890 X-Patchwork-Delegate: apw@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id B49B9B7D1E for ; Fri, 28 May 2010 23:06:04 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OHzG9-00064c-85; Fri, 28 May 2010 14:05:57 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OHzG5-0005yo-Jq for kernel-team@lists.ubuntu.com; Fri, 28 May 2010 14:05:53 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1OHzG5-0006Vz-Db for ; Fri, 28 May 2010 14:05:53 +0100 Received: from cpc2-aztw21-0-0-cust264.aztw.cable.virginmedia.com ([77.100.97.9] helo=[192.168.0.130]) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OHzG5-0005uk-7e for kernel-team@lists.ubuntu.com; Fri, 28 May 2010 14:05:53 +0100 Message-ID: <4BFFBFB0.2020801@canonical.com> Date: Fri, 28 May 2010 14:05:52 +0100 From: Lee Jones User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: kernel-team Subject: [PATCH 1/1] UBUNTU: 'fdr editconfig' change. Now produces a menu to choose a config to edit. X-Enigmail-Version: 1.0.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com 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 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