title: Script to compile kernel from source with 'make xconfig'
body: <p>I'm trying to automate compiling from <a href="https://www.kernel.org/" rel="nofollow">kernel.org</a> with a bash script. Originally I was using the ncurses menu but I'd like to move to <code>xconfig</code>.</p>
  
  <p>The relevant section of code that is causing me difficulty:</p>
  
  <pre><code>echo -e "Extracting kernel source."
  tar xf $OUTPUT -C ./$FOLDER || { echo "Error extracting the archive." &gt;&amp;2; exit 1; }
  EXTRACTED=$(ls $FOLDER/)
  echo -e "    Extracted Folder:\t${FOLDER}/${EXTRACTED}\n"
  
  pushd $FOLDER/linux*
  
  echo -e "Launching \"make xconfig\"."
  $SUDO make xconfig 2&gt;/dev/null || { echo "Error running \"make xconfig\"."; exit 1; } 
  </code></pre>
  
  <p>When it hits the <code>make xconfig</code>, it compiles and a GUI is presented but it is blank. If I test the command directly in the shell (i.e. not through the bash script) the menu populates properly.</p>
  
  <p>I've tried all the things I can think of at the moment, including trying to execute both with <code>sudo</code> as well as <code>su</code> to no avail. </p>
  
  <h3>UPDATE</h3>
  
  <p>The scripts are now posted on github. I thought I'd update this post with a reference for anyone else to use. Enjoy!</p>
  
  <p><a href="https://github.com/mtompkins/linux-kernel-utilities" rel="nofollow">Linux Kernel Utilities</a></p>