Remove STEPS, add TARGET, define debian + ubuntu
This commit is contained in:
parent
5479dde766
commit
9d1106dee1
@ -40,6 +40,12 @@ sudo bash kernel.sh 6.x 6.8.1
|
||||
|
||||
## CHANGELOG
|
||||
|
||||
### 2024-04-29
|
||||
|
||||
- Suppression du paramètre STEPS
|
||||
- Ajout du paramètre TARGET (afin de spécifier une distribution cible, ex: debian)
|
||||
- Cibles de compilation: debian, ubuntu
|
||||
|
||||
### 2024-04-26
|
||||
|
||||
- Gestion des versions du kernel
|
||||
|
59
kernel.sh
59
kernel.sh
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
UPDATED="2024-04-26"
|
||||
UPDATED="2024-04-29"
|
||||
|
||||
DISABLE=1 # disable some options
|
||||
ENABLE=1 # enable some options
|
||||
@ -53,13 +53,26 @@ doBuildSystem() {
|
||||
echo "v$UPDATED"
|
||||
}
|
||||
|
||||
# Get target distribution name
|
||||
doTargetName() {
|
||||
case ${TARGET} in
|
||||
debian)
|
||||
TARGETNAME="Debian"
|
||||
;;
|
||||
ubuntu)
|
||||
TARGETNAME="Ubuntu"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Display introduction
|
||||
doIntro() {
|
||||
echo
|
||||
doTargetName
|
||||
if [ $TESTING == 1 ]; then
|
||||
echo "Debian Kernel Builder: $HOSTNAME [TEST]"
|
||||
echo "$TARGETNAME Kernel Builder: $HOSTNAME [TEST]"
|
||||
else
|
||||
echo "Debian Kernel Builder: $HOSTNAME"
|
||||
echo "$TARGETNAME Kernel Builder: $HOSTNAME"
|
||||
fi
|
||||
doBuildSystem
|
||||
echo
|
||||
@ -98,12 +111,32 @@ BRANCH=$1
|
||||
BRANCH="${BRANCH:=help}"
|
||||
VERSION=$2
|
||||
VERSION="${VERSION:=help}"
|
||||
STEPS=$3
|
||||
STEPS="${STEPS:=help}"
|
||||
TARGET=$3
|
||||
TARGET="${TARGET:=debian}"
|
||||
WORKDIR=""
|
||||
|
||||
cd $CURRENT
|
||||
|
||||
# Perform specific distribution adjustments
|
||||
doDistribution() {
|
||||
case ${TARGET} in
|
||||
ubuntu)
|
||||
DISABLE=0
|
||||
PATCHES=0
|
||||
UARCH=0
|
||||
ARCH=
|
||||
CONFIGCLOUD=0
|
||||
CONFIGMOD=0
|
||||
CONFIGOLD=1
|
||||
SCRATCH=0
|
||||
;;
|
||||
debian)
|
||||
default)
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Force sync & flush
|
||||
doSync() {
|
||||
sync
|
||||
@ -125,10 +158,13 @@ doHelp() {
|
||||
echo ">>> Unspecified, unknown or invalid option specified!"
|
||||
echo
|
||||
fi
|
||||
echo "Usage: $SCRIPT 'branch' 'version'"
|
||||
echo "Usage: $SCRIPT 'branch' 'version' 'target'"
|
||||
echo
|
||||
echo "branch : Main branch (eg. 6.x)"
|
||||
echo "version: Full version tag (eg. 6.6.1)"
|
||||
echo "branch : Main branch (eg. 6.x) [*]"
|
||||
echo "version: Full version tag (eg. 6.6.1) [*]"
|
||||
echo "target: Target distribution (eg. debian/default, ubuntu)"
|
||||
echo
|
||||
echo " [*] : parameter required"
|
||||
echo
|
||||
}
|
||||
|
||||
@ -658,6 +694,8 @@ doCompile() {
|
||||
doKernel() {
|
||||
WORKDIR=$CURRENT/build/$BRANCH/$VERSION
|
||||
|
||||
doDistribution
|
||||
|
||||
doScratch
|
||||
if [ ! -d $WORKDIR ]; then
|
||||
mkdir -p $WORKDIR
|
||||
@ -669,11 +707,6 @@ doKernel() {
|
||||
fi
|
||||
touch $LOGFILE
|
||||
|
||||
if [ "$STEPS" != "compile" ]; then
|
||||
doDownload > >(tee -a $LOGFILE) 2>&1
|
||||
doUncompress > >(tee -a $LOGFILE) 2>&1
|
||||
fi
|
||||
|
||||
WORKDIR=$WORKDIR/linux-$VERSION
|
||||
|
||||
doCleanup > >(tee -a $LOGFILE) 2>&1
|
||||
|
Loading…
Reference in New Issue
Block a user