handle each host kernel config
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
This commit is contained in:
parent
b2a26f3963
commit
f6394fdcbd
2 changed files with 9728 additions and 14 deletions
|
@ -6,7 +6,7 @@ CWD=$(pwd)
|
||||||
|
|
||||||
PRGNAM=$(basename $CWD)-$(hostname -s)
|
PRGNAM=$(basename $CWD)-$(hostname -s)
|
||||||
BUILD=${BUILD:-1}
|
BUILD=${BUILD:-1}
|
||||||
BRANCH=${BRANCH:-stable} # stable ; mainline
|
BRANCH=${BRANCH:-mainline} # stable ; mainline
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
|
|
||||||
TAG=gwh
|
TAG=gwh
|
||||||
|
@ -22,24 +22,29 @@ rm -fr $PKG
|
||||||
|
|
||||||
VERSION=${VERSION:-$(curl https://www.kernel.org/feeds/kdist.xml | grep -o "[0-9.rc-]*: $BRANCH" | head -n1 | cut -d: -f1)}
|
VERSION=${VERSION:-$(curl https://www.kernel.org/feeds/kdist.xml | grep -o "[0-9.rc-]*: $BRANCH" | head -n1 | cut -d: -f1)}
|
||||||
|
|
||||||
|
mkdir -p $PKG/usr/src/
|
||||||
|
if [ -e /usr/src/linux-$VERSION ]; then
|
||||||
|
cp -a /usr/src/linux-$VERSION $PKG/usr/src/
|
||||||
|
else
|
||||||
if [ $BRANCH == "stable" ]; then
|
if [ $BRANCH == "stable" ]; then
|
||||||
SRC_URL="https://cdn.kernel.org/pub/linux/kernel/v$(echo $VERSION | cut -d. -f1).x"
|
SRC_URL="https://cdn.kernel.org/pub/linux/kernel/v$(echo $VERSION | cut -d. -f1).x"
|
||||||
else
|
else
|
||||||
SRC_URL="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot"
|
SRC_URL="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ ! -e $CWD/linux-$VERSION.tar.?z* ] && wget -c "$SRC_URL/linux-$VERSION.tar.gz" -O $CWD/linux-$VERSION.tar.gz
|
[ ! -e $CWD/linux-$VERSION.tar.?z* ] && wget -c "$SRC_URL/linux-$VERSION.tar.gz" -O $CWD/linux-$VERSION.tar.gz
|
||||||
mkdir -p $PKG/usr/src/
|
|
||||||
tar xf $CWD/linux-$VERSION.tar.gz -C $PKG/usr/src/
|
tar xf $CWD/linux-$VERSION.tar.gz -C $PKG/usr/src/
|
||||||
|
fi
|
||||||
|
|
||||||
cd $PKG/usr/src/
|
cd $PKG/usr/src/
|
||||||
ln -s linux-$VERSION linux
|
ln -s linux-$VERSION linux
|
||||||
cd linux-$VERSION
|
cd linux-$VERSION
|
||||||
|
|
||||||
if [ -e $CWD/config-$VERSION ] ; then
|
if [ -e $CWD/config-$(hostname -s)-$VERSION ] ; then
|
||||||
cp $CWD/config-$VERSION .config
|
cp $CWD/config-$(hostname -s)-$VERSION .config
|
||||||
else
|
else
|
||||||
if [ -e $CWD/config ]; then
|
if [ -e $CWD/config-$(hostname -s) ] ; then
|
||||||
cp $CWD/config .config
|
cp $CWD/config-$(hostname -s) .config
|
||||||
else
|
else
|
||||||
zcat /proc/config.gz > .config
|
zcat /proc/config.gz > .config
|
||||||
fi
|
fi
|
||||||
|
@ -48,11 +53,12 @@ fi
|
||||||
make oldconfig $*
|
make oldconfig $*
|
||||||
|
|
||||||
make $NUMJOBS
|
make $NUMJOBS
|
||||||
|
make modules $NUMJOBS
|
||||||
|
make modules_install INSTALL_MOD_PATH=$PKG
|
||||||
if [[ "$ARCH" == "aarch64" ]]; then
|
if [[ "$ARCH" == "aarch64" ]]; then
|
||||||
make dtbs
|
make dtbs
|
||||||
make dtbs_install INSTALL_DTBS_PATH=$PKG/boot/dtb
|
make dtbs_install INSTALL_DTBS_PATH=$PKG/boot/dtb
|
||||||
fi
|
fi
|
||||||
make modules_install INSTALL_MOD_PATH=$PKG
|
|
||||||
|
|
||||||
if [ -z "${HEADERS_ARCH}" ]; then
|
if [ -z "${HEADERS_ARCH}" ]; then
|
||||||
case "$(uname -m)" in
|
case "$(uname -m)" in
|
||||||
|
@ -76,7 +82,6 @@ fi
|
||||||
find . -name ".??*" -exec rm -f {} \+
|
find . -name ".??*" -exec rm -f {} \+
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
VERSION=$(basename $(ls $PKG/lib/modules/ | head -n1))
|
VERSION=$(basename $(ls $PKG/lib/modules/ | head -n1))
|
||||||
|
|
||||||
mkdir -p $PKG/install
|
mkdir -p $PKG/install
|
||||||
|
|
9709
a/kernel-gwh/config-gwenhael
Normal file
9709
a/kernel-gwh/config-gwenhael
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue