Remove STEPS, add TARGET, define debian + ubuntu

This commit is contained in:
Olivier 2024-04-29 08:24:04 +02:00
parent 5479dde766
commit 9d1106dee1
2 changed files with 52 additions and 13 deletions

View File

@ -40,6 +40,12 @@ sudo bash kernel.sh 6.x 6.8.1
## CHANGELOG ## 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 ### 2024-04-26
- Gestion des versions du kernel - Gestion des versions du kernel

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
UPDATED="2024-04-26" UPDATED="2024-04-29"
DISABLE=1 # disable some options DISABLE=1 # disable some options
ENABLE=1 # enable some options ENABLE=1 # enable some options
@ -53,13 +53,26 @@ doBuildSystem() {
echo "v$UPDATED" echo "v$UPDATED"
} }
# Get target distribution name
doTargetName() {
case ${TARGET} in
debian)
TARGETNAME="Debian"
;;
ubuntu)
TARGETNAME="Ubuntu"
;;
esac
}
# Display introduction # Display introduction
doIntro() { doIntro() {
echo echo
doTargetName
if [ $TESTING == 1 ]; then if [ $TESTING == 1 ]; then
echo "Debian Kernel Builder: $HOSTNAME [TEST]" echo "$TARGETNAME Kernel Builder: $HOSTNAME [TEST]"
else else
echo "Debian Kernel Builder: $HOSTNAME" echo "$TARGETNAME Kernel Builder: $HOSTNAME"
fi fi
doBuildSystem doBuildSystem
echo echo
@ -98,12 +111,32 @@ BRANCH=$1
BRANCH="${BRANCH:=help}" BRANCH="${BRANCH:=help}"
VERSION=$2 VERSION=$2
VERSION="${VERSION:=help}" VERSION="${VERSION:=help}"
STEPS=$3 TARGET=$3
STEPS="${STEPS:=help}" TARGET="${TARGET:=debian}"
WORKDIR="" WORKDIR=""
cd $CURRENT 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 # Force sync & flush
doSync() { doSync() {
sync sync
@ -125,10 +158,13 @@ doHelp() {
echo ">>> Unspecified, unknown or invalid option specified!" echo ">>> Unspecified, unknown or invalid option specified!"
echo echo
fi fi
echo "Usage: $SCRIPT 'branch' 'version'" echo "Usage: $SCRIPT 'branch' 'version' 'target'"
echo echo
echo "branch : Main branch (eg. 6.x)" echo "branch : Main branch (eg. 6.x) [*]"
echo "version: Full version tag (eg. 6.6.1)" echo "version: Full version tag (eg. 6.6.1) [*]"
echo "target: Target distribution (eg. debian/default, ubuntu)"
echo
echo " [*] : parameter required"
echo echo
} }
@ -658,6 +694,8 @@ doCompile() {
doKernel() { doKernel() {
WORKDIR=$CURRENT/build/$BRANCH/$VERSION WORKDIR=$CURRENT/build/$BRANCH/$VERSION
doDistribution
doScratch doScratch
if [ ! -d $WORKDIR ]; then if [ ! -d $WORKDIR ]; then
mkdir -p $WORKDIR mkdir -p $WORKDIR
@ -669,11 +707,6 @@ doKernel() {
fi fi
touch $LOGFILE touch $LOGFILE
if [ "$STEPS" != "compile" ]; then
doDownload > >(tee -a $LOGFILE) 2>&1
doUncompress > >(tee -a $LOGFILE) 2>&1
fi
WORKDIR=$WORKDIR/linux-$VERSION WORKDIR=$WORKDIR/linux-$VERSION
doCleanup > >(tee -a $LOGFILE) 2>&1 doCleanup > >(tee -a $LOGFILE) 2>&1