Last active
March 13, 2016 21:16
-
-
Save davidlohr/83df4897e5c405a46a5f to your computer and use it in GitHub Desktop.
Revisions
-
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,17 +15,17 @@ # before cloning) # [--cleanup] (removes cloned working directory once done) # # notes: # o defaults will always be master branch on Linus' tree. # o the script does everything inside working directory where called. # examples: # ./kbuid-auto.sh --config /boot/config-4.5.0-rc5 # ./kbuid-auto.sh --repo rcu --config /boot/config-4.5.0-rc5 # ./kbuid-auto.sh --config /boot/config-4.5.0-rc5 --kernels v4.4,v4.5 --force # # TODO (wishlist): # o Change (grub) bootloader default. # o When available, use bkp protocol if default git:// fails. # o --repo-url <url> option, for non-tagged repositories. # -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -115,5 +115,5 @@ do done if [ "$GIT_REPO_CLEANUP" = "yes" ]; then cd .. && rm -rf $GIT_REPO_ALIAS fi -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 12 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,9 @@ # kbuild-auto.sh --config <config-file> # [--kernels <master,v4.5,v4.5-rc1,...>] # [--repo <linux|tip|rcu|next|...>] # [--force] (removes any exising repository directory # before cloning) # [--cleanup] (removes cloned working directory once done) # # (defaults will always be Linus' master tree). # @@ -31,6 +33,7 @@ KERNEL_DOTCONFIG="" # non-optional arg GIT_REPO_ALIAS="linux" KERNEL_STR="master" GIT_REPO_FORCE=0 # do not overwrite an existing repo GIT_REPO_CLEANUP=0 # cleanup after ourselves NUMCPUS=$(grep -c '^processor' /proc/cpuinfo) MAKE="make -j$((NUMCPUS*2))" @@ -60,6 +63,10 @@ while [ "$1" != "" ]; do GIT_REPO_ALIAS=$2 shift 2 ;; --cleanup) GIT_REPO_CLEANUP="yes" shift 1 ;; --force) GIT_REPO_FORCE="yes" shift 1 @@ -106,3 +113,7 @@ do # ^^ can return (ignorable) symbol warnings. $MAKE && $MAKE modules && $MAKE modules_install && $MAKE install done if [ "$GIT_REPO_CLEANUP" = "yes" ]; then cd .. && rm -rf fi -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,6 +42,7 @@ GIT_REPO_ARR["next"]=git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-ne GIT_REPO_ARR["rcu"]=git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git GIT_REPO_ARR["net"]=git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git GIT_REPO_ARR["block"]=git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git # -- akpm GIT_REPO_ARR["mmotm"]=git://git.cmpxchg.org/linux-mmotm.git GIT_REPO_ARR["mmots"]=git://git.cmpxchg.org/linux-mmots.git -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -79,7 +79,6 @@ fi # zypper in -y git-core gcc openssl-devel GIT_CLONE_REPO=${GIT_REPO_ARR[$GIT_REPO_ALIAS]} if [ "$GIT_CLONE_REPO" = "" ]; then echo "$0: '$GIT_REPO_ALIAS' is not a valid repository alias (--repo)" @@ -98,6 +97,7 @@ cp $KERNEL_DOTCONFIG $GIT_REPO_ALIAS/.config && cd $GIT_REPO_ALIAS # # Lets do it! # IFS=',' read -a KERNEL_ARR <<< "$KERNEL_STR" for KERNEL in ${KERNEL_ARR[@]} do # echo "Checking out and building '${KERNEL}'" -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,6 +40,8 @@ GIT_REPO_ARR["linux"]=git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin GIT_REPO_ARR["tip"]=git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git GIT_REPO_ARR["next"]=git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git GIT_REPO_ARR["rcu"]=git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git GIT_REPO_ARR["net"]=git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git GIT_REPO_ARR["block"]=git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git GIT_REPO_ARR["mmotm"]=git://git.cmpxchg.org/linux-mmotm.git GIT_REPO_ARR["mmots"]=git://git.cmpxchg.org/linux-mmots.git -
davidlohr revised this gist
Mar 13, 2016 . No changes.There are no files selected for viewing
-
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -81,8 +81,7 @@ IFS=',' read -a KERNEL_ARR <<< "$KERNEL_STR" if [ "$GIT_CLONE_REPO" = "" ]; then echo "$0: '$GIT_REPO_ALIAS' is not a valid repository alias (--repo)" echo "$0: Available repositories are: ${!GIT_REPO_ARR[@]}" exit 1 fi -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,20 +10,21 @@ # Usage: # kbuild-auto.sh --config <config-file> # [--kernels <master,v4.5,v4.5-rc1,...>] # [--repo <linux|tip|rcu|next|...>] # [--force] # # (defaults will always be Linus' master tree). # # examples: # ./kbuid-auto.sh --config /boot/config-4.5.0-rc5 # ./kbuid-auto.sh --repo rcu --config /boot/config-4.5.0-rc5 # ./kbuid-auto.sh --config /boot/config-4.5.0-rc5 --kernels v4.4,v4.5 --force # # TODO (wishlist): # o Change (grub) bootloader default. # o Way changing git protocol if default (git://) fails. # o Machine reboot option? # o --repo-url <url> option, for non-tagged repositories. # KERNEL_DOTCONFIG="" # non-optional arg @@ -80,7 +81,7 @@ IFS=',' read -a KERNEL_ARR <<< "$KERNEL_STR" if [ "$GIT_CLONE_REPO" = "" ]; then echo "$0: '$GIT_REPO_ALIAS' is not a valid repository alias (--repo)" echo -ne "$0: Available repositories are:" echo "$0: ${!GIT_REPO_ARR[@]}" exit 1 fi -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -81,9 +81,7 @@ IFS=',' read -a KERNEL_ARR <<< "$KERNEL_STR" if [ "$GIT_CLONE_REPO" = "" ]; then echo "$0: '$GIT_REPO_ALIAS' is not a valid repository alias (--repo)" echo "$0: Available repositories are:" echo "$0: ${!GIT_REPO_ARR[@]}" exit 1 fi -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -82,7 +82,7 @@ if [ "$GIT_CLONE_REPO" = "" ]; then echo "$0: '$GIT_REPO_ALIAS' is not a valid repository alias (--repo)" echo "$0: Available repositories are:" for alias in "${GIT_REPO_ARR[@]}"; do echo "0: ${GIT_REPO_ARR[$alias]} --- $alias"; done exit 1 fi -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -82,7 +82,7 @@ if [ "$GIT_CLONE_REPO" = "" ]; then echo "$0: '$GIT_REPO_ALIAS' is not a valid repository alias (--repo)" echo "$0: Available repositories are:" for alias in "${GIT_REPO_ARR[@]}"; do echo "0:\t$alias --- ${GIT_REPO_ARR[$alias]}"; done exit 1 fi -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -81,7 +81,7 @@ IFS=',' read -a KERNEL_ARR <<< "$KERNEL_STR" if [ "$GIT_CLONE_REPO" = "" ]; then echo "$0: '$GIT_REPO_ALIAS' is not a valid repository alias (--repo)" echo "$0: Available repositories are:" for alias in "${GIT_REPO_ARR[@]}"; do echo "0:\t$alias --- ${GIT_REPO_ARR[$i]}"; done exit 1 -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -81,8 +81,8 @@ IFS=',' read -a KERNEL_ARR <<< "$KERNEL_STR" if [ "$GIT_CLONE_REPO" = "" ]; then echo "$0: '$GIT_REPO_ALIAS' is not a valid repository alias (--repo)" echo "$0: Available repositories are:" for alias in "${KGIT_REPO_ARR[@]}"; do echo "0:\t$alias --- ${GIT_REPO_ARR[$i]}"; done exit 1 fi -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,6 +39,8 @@ GIT_REPO_ARR["linux"]=git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin GIT_REPO_ARR["tip"]=git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git GIT_REPO_ARR["next"]=git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git GIT_REPO_ARR["rcu"]=git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git GIT_REPO_ARR["mmotm"]=git://git.cmpxchg.org/linux-mmotm.git GIT_REPO_ARR["mmots"]=git://git.cmpxchg.org/linux-mmots.git while [ "$1" != "" ]; do case "$1" in @@ -72,11 +74,16 @@ if [ ! -f $KERNEL_DOTCONFIG ] || [ "$KERNEL_DOTCONFIG" = "" ]; then exit 1 fi # zypper in -y git-core gcc openssl-devel GIT_CLONE_REPO=${GIT_REPO_ARR[$GIT_REPO_ALIAS]} IFS=',' read -a KERNEL_ARR <<< "$KERNEL_STR" if [ "$GIT_CLONE_REPO" = "" ]; then echo "$0: '$GIT_REPO_ALIAS' is not a valid repository alias (--repo)" echo "$0: Available repositories are:" for i in "${!KERNEL_ARR[@]}"; do echo "\t$i --- ${KERNEL_ARR[$i]}"; done exit 1 fi @@ -91,7 +98,6 @@ cp $KERNEL_DOTCONFIG $GIT_REPO_ALIAS/.config && cd $GIT_REPO_ALIAS # # Lets do it! # for KERNEL in ${KERNEL_ARR[@]} do # echo "Checking out and building '${KERNEL}'" -
davidlohr revised this gist
Mar 13, 2016 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,9 +3,9 @@ # Copyright (C) 2016 Davidlohr Bueso. # # Download and build/install one or more flavors of the Linux kernel. # Do what you please with this, but you better be root if you expect # it to do anything useful. Also, probably very SUSE specific, this # is my only working env. # # Usage: # kbuild-auto.sh --config <config-file> -
davidlohr revised this gist
Mar 12, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ # Usage: # kbuild-auto.sh --config <config-file> # [--kernels <master,v4.5,v4.5-rc1,...>] # [--repo <linux|tip|rcu|next>] # [--repo-url <url>] # [--force] # @@ -86,7 +86,7 @@ if [ "$GIT_REPO_FORCE" = "yes" ]; then fi git clone $GIT_CLONE_REPO $GIT_REPO_ALIAS cp $KERNEL_DOTCONFIG $GIT_REPO_ALIAS/.config && cd $GIT_REPO_ALIAS # # Lets do it! -
davidlohr revised this gist
Mar 12, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ # # Download and build/install one or more flavors of the Linux kernel. # Do what you please with this, but expect you better be root if you # expect it to do anything useful. Also, probably very SUSE specific, # this is my only working env. # # Usage: -
davidlohr created this gist
Mar 12, 2016 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,101 @@ #!/bin/bash # # Copyright (C) 2016 Davidlohr Bueso. # # Download and build/install one or more flavors of the Linux kernel. # Do what you please with this, but expect you better be root if you # expect it to do anything useful. # Also, probably very SUSE specific, # this is my only working env. # # Usage: # kbuild-auto.sh --config <config-file> # [--kernels <master,v4.5,v4.5-rc1,...>] # [--repo <linux|tip|rcu|next]>] # [--repo-url <url>] # [--force] # # (defaults will always be Linus' master tree). # # examples: # ./kbuid-auto.sh --config /boot/config-4.5.0-rc5 # ./kbuid-auto.sh --repo rcu --config /boot/config-4.5.0-rc5 # # TODO (wishlist): # o Change (grub) bootloader default. # o Way changing git protocol if default (git://) fails. # o Machine reboot option? # KERNEL_DOTCONFIG="" # non-optional arg GIT_REPO_ALIAS="linux" KERNEL_STR="master" GIT_REPO_FORCE=0 # do not overwrite an existing repo NUMCPUS=$(grep -c '^processor' /proc/cpuinfo) MAKE="make -j$((NUMCPUS*2))" # Linus' and other common used trees for kernel development. declare -A GIT_REPO_ARR GIT_REPO_ARR["linux"]=git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git GIT_REPO_ARR["tip"]=git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git GIT_REPO_ARR["next"]=git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git GIT_REPO_ARR["rcu"]=git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git while [ "$1" != "" ]; do case "$1" in --config) KERNEL_DOTCONFIG=$2 shift 2 ;; --kernels) KERNEL_STR=$2 shift 2 ;; --repo) GIT_REPO_ALIAS=$2 shift 2 ;; --force) GIT_REPO_FORCE="yes" shift 1 ;; *) echo Unrecognised option: $1 shift esac done # # Input sanitation # if [ ! -f $KERNEL_DOTCONFIG ] || [ "$KERNEL_DOTCONFIG" = "" ]; then echo "$0: Must pass a valid base configuration file (--config)" exit 1 fi # zypper in -y git-core gcc GIT_CLONE_REPO=${GIT_REPO_ARR[$GIT_REPO_ALIAS]} if [ "$GIT_CLONE_REPO" = "" ]; then echo "$0: '$GIT_REPO_ALIAS' is not a valid repository alias (--repo)" exit 1 fi if [ "$GIT_REPO_FORCE" = "yes" ]; then echo "$0: Deleting any previous '$GIT_REPO_ALIAS' directory" rm -rf $GIT_REPO_ALIAS # do not bother checking if it exists fi git clone $GIT_CLONE_REPO $GIT_REPO_ALIAS cp $KERNEL_DOTCONFIG "$GIT_REPO_ALIAS/.config" && cd $GIT_REPO_ALIAS # # Lets do it! # IFS=',' read -a KERNEL_ARR <<< "$KERNEL_STR" for KERNEL in ${KERNEL_ARR[@]} do # echo "Checking out and building '${KERNEL}'" git checkout $KERNEL && make olddefconfig # ^^ can return (ignorable) symbol warnings. $MAKE && $MAKE modules && $MAKE modules_install && $MAKE install done