[kernel] naming more standard, requires '-gwh' in kernel config
This commit is contained in:
parent
d65bae3568
commit
de6e9fd908
2 changed files with 25 additions and 38 deletions
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -x
|
#set -x
|
||||||
|
|
||||||
CWD=$(pwd)
|
CWD=$(pwd)
|
||||||
PRGNAM=$(basename "$CWD")
|
PRGNAM=$(basename "$CWD")
|
||||||
BUILD=${BUILD:-14}
|
BUILD=${BUILD:-19}
|
||||||
BRANCH=${BRANCH:-stable} # stable ; mainline
|
BRANCH=${BRANCH:-stable} # stable ; mainline
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ OUTPUT=/tmp
|
||||||
|
|
||||||
NUMJOBS=${NUMJOBS:-$(nproc)}
|
NUMJOBS=${NUMJOBS:-$(nproc)}
|
||||||
|
|
||||||
ANEW=${ANEW:-true}
|
|
||||||
CONFIG=${CONFIG:-""}
|
CONFIG=${CONFIG:-""}
|
||||||
|
|
||||||
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/_repositories/$PRGNAM}
|
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/_repositories/$PRGNAM}
|
||||||
|
@ -28,22 +27,18 @@ mkdir -p "$REPOSITORY"
|
||||||
rm -fr "$PKG"
|
rm -fr "$PKG"
|
||||||
|
|
||||||
mkdir -p "$PKG/usr/src/"
|
mkdir -p "$PKG/usr/src/"
|
||||||
if [ -e "/usr/src/linux-$VERSION" ] && [[ "$ANEW" != "true" ]]; then
|
if [ "$BRANCH" == "stable" ]; then
|
||||||
cp -a "/usr/src/linux-$VERSION" "$PKG/usr/src/"
|
SRC_URL="https://cdn.kernel.org/pub/linux/kernel/v$(echo "$VERSION" | cut -d. -f1).x"
|
||||||
else
|
else
|
||||||
if [ "$BRANCH" == "stable" ]; then
|
SRC_URL="https://git.kernel.org/torvalds/t"
|
||||||
SRC_URL="https://cdn.kernel.org/pub/linux/kernel/v$(echo "$VERSION" | cut -d. -f1).x"
|
|
||||||
else
|
|
||||||
SRC_URL="https://git.kernel.org/torvalds/t"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ ! -e "$REPOSITORY"/linux-"$VERSION".tar.gz ] && wget -c "$SRC_URL/linux-$VERSION.tar.gz" -O "$REPOSITORY/linux-$VERSION.tar.gz"
|
|
||||||
tar xf "$REPOSITORY/linux-$VERSION.tar.gz" -C "$PKG/usr/src/"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ ! -e "$REPOSITORY"/linux-"$VERSION".tar.gz ] && wget -c "$SRC_URL/linux-$VERSION.tar.gz" -O "$REPOSITORY/linux-$VERSION.tar.gz"
|
||||||
|
tar xf "$REPOSITORY/linux-$VERSION.tar.gz" -C "$PKG/usr/src/"
|
||||||
|
|
||||||
cd "$PKG/usr/src/" || exit 1
|
cd "$PKG/usr/src/" || exit 1
|
||||||
mv "linux-$VERSION" "linux-${VERSION}-gwh"
|
mv "linux-$VERSION" "linux-gwh"
|
||||||
cd "linux-${VERSION}-gwh"
|
cd "linux-gwh" || exit 1
|
||||||
|
|
||||||
if [ -n "$CONFIG" ] && [ -e "$CONFIG" ]; then
|
if [ -n "$CONFIG" ] && [ -e "$CONFIG" ]; then
|
||||||
cat "$CONFIG" > .config
|
cat "$CONFIG" > .config
|
||||||
|
@ -52,8 +47,6 @@ if [ ! -f .config ]; then
|
||||||
zcat /proc/config.gz > .config
|
zcat /proc/config.gz > .config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# read
|
|
||||||
|
|
||||||
make oldconfig "$@"
|
make oldconfig "$@"
|
||||||
|
|
||||||
make -j"$NUMJOBS"
|
make -j"$NUMJOBS"
|
||||||
|
@ -86,29 +79,26 @@ fi
|
||||||
|
|
||||||
VERSION=$(basename "$(find "$PKG/lib/modules/" -type d -maxdepth 1 -mindepth 1 | head -n1)")
|
VERSION=$(basename "$(find "$PKG/lib/modules/" -type d -maxdepth 1 -mindepth 1 | head -n1)")
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
mv "$PKG/usr/src/linux-gwh" "$PKG/usr/src/linux-${VERSION}"
|
||||||
|
cd "$PKG/usr/src/linux-${VERSION}" || exit 1
|
||||||
|
|
||||||
# Fix build and source symlinks if they are pointing into $TMP:
|
# Fix build and source symlinks if they are pointing into $TMP:
|
||||||
( cd $PKG/lib/modules/${VERSION}
|
( cd "$PKG"/lib/modules/"${VERSION}"
|
||||||
for symlink in build ; do
|
target=$(readlink build)
|
||||||
target=$(readlink $symlink)
|
if echo "$target" | grep -q "^$PKG/" ; then
|
||||||
if echo $target | grep -q "^$PKG/" ; then
|
rm -f build
|
||||||
rm -f $symlink
|
ln -sf "/usr/src/linux-${VERSION}" build
|
||||||
ln -sf $(echo $target | sed "s|$PKG/|/|g") $symlink
|
fi
|
||||||
fi
|
|
||||||
done
|
|
||||||
)
|
)
|
||||||
|
|
||||||
mkdir -p "$PKG/boot/"
|
mkdir -p "$PKG/boot/"
|
||||||
cp System.map "$PKG/boot/System.map-gwh-$VERSION"
|
cp System.map "$PKG/boot/System.map-$VERSION"
|
||||||
cp .config "$PKG/boot/config-gwh-$VERSION"
|
cp .config "$PKG/boot/config-$VERSION"
|
||||||
cp "arch/${ARCH}/boot/bzImage" "$PKG/boot/vmlinuz-gwh-$VERSION"
|
cp "arch/${ARCH}/boot/bzImage" "$PKG/boot/vmlinuz-$VERSION"
|
||||||
|
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
cd "$PKG/boot/" || exit 1
|
|
||||||
ln -s "vmlinuz-gwh-$VERSION" vmlinuz-gwh
|
|
||||||
ln -s "config-gwh-$VERSION" config-gwh
|
|
||||||
ln -s "System.map-gwh-$VERSION" System.map-gwh
|
|
||||||
|
|
||||||
mkdir -p "$PKG/install"
|
mkdir -p "$PKG/install"
|
||||||
cat <<EOF > "$PKG/install/doinst.sh"
|
cat <<EOF > "$PKG/install/doinst.sh"
|
||||||
echo -n "updating grub... "
|
echo -n "updating grub... "
|
||||||
|
@ -119,12 +109,9 @@ echo -n "building initrd… "
|
||||||
cd /
|
cd /
|
||||||
UCODE=""
|
UCODE=""
|
||||||
[ -e /boot/intel-ucode.cpio ] && UCODE="-P /boot/intel-ucode.cpio"
|
[ -e /boot/intel-ucode.cpio ] && UCODE="-P /boot/intel-ucode.cpio"
|
||||||
eval "\$(/usr/share/mkinitrd/mkinitrd_command_generator.sh -k $VERSION -r | sed "s|/boot/initrd.gz|/boot/initrd-gwh-${VERSION}.gz|") \${UCODE}"
|
eval "\$(/usr/share/mkinitrd/mkinitrd_command_generator.sh -k $VERSION -r | sed "s|/boot/initrd.gz|/boot/initrd-${VERSION}-gwh.gz|") \${UCODE}"
|
||||||
echo "OK"
|
echo "OK"
|
||||||
|
|
||||||
[ -L /boot/initrd-gwh.gz ] && rm /boot/initrd-gwh.gz
|
|
||||||
ln -s /boot/initrd-gwh-${VERSION}.gz /boot/initrd-gwh.gz
|
|
||||||
|
|
||||||
grub-mkconfig -o /boot/grub/grub.cfg
|
grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
@ -93,4 +93,4 @@ $PRGNAM:
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# empaquetage
|
# empaquetage
|
||||||
/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT/$PRGNAM-${VERSION//-/}_${KERNEL_VERSION}-$ARCH-$BUILD$TAG.txz"
|
/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT/$PRGNAM-${VERSION//-/}_${KERNEL_VERSION//-/}-$ARCH-$BUILD$TAG.txz"
|
||||||
|
|
Loading…
Reference in a new issue