Avatar von Fahim
  • Fahim

mehr als 1000 Beiträge seit 28.10.2007

Skript für Ubuntu

Weil die Kernel unter Ubuntu erst nach mehreren Monaten per Update installierbar sind, habe ich das Skript install_kernel_4.7.sh gemacht:

#!/bin/bash

# A simple script for installing an mainline Kernel under Ubuntu, modified by nobody0.
# It should be executed by a simple user, beause the root parts are with sudo. It can also be executed by root.
# The easy way is to set in /etc/sudoer the line for the example user nobody0 to: nobody0 ALL=(ALL) NOPASSWD: ALL
# or: username> ALL = NOPASSWD: ALL

echo "$(tput setaf 3)--- (www.ubuntumaniac.com) modified by nobody | Kernel 4.7 Lowlatency will be installed in an `uname -i` system ---$(tput sgr0)"

echo ""

sleep 1

read -p "Press Enter to continue, or abort by pressing CTRL+C" nothing

echo ""
echo ""

#i386 links

link1="http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.7/linux-headers-4.7.0-040700_4.7.0-040700.201608021801_all.deb"

link2="http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.7/linux-headers-4.7.0-040700-lowlatency_4.7.0-040700.201608021801_i386.deb"

link3="http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.7/linux-image-4.7.0-040700-lowlatency_4.7.0-040700.201608021801_i386.deb"

#amd64 links

url1="http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.7/linux-headers-4.7.0-040700-lowlatency_4.7.0-040700.201608021801_amd64.deb"

url2="http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.7/linux-image-4.7.0-040700-lowlatency_4.7.0-040700.201608021801_amd64.deb"

#System architecture

arch=`uname -m`
if [ $arch = i686 ] || [ $arch = i386 ]; then

TMPDIR=/tmp/kernel-i386

mkdir -p $TMPDIR

cd $TMPDIR

wget -c $link1
wget -c $link2
wget -c $link3

sudo dpkg -i $TMPDIR/*.deb

sudo rm -rf $TMPDIR

elif [ $arch = "x86_64" ]; then

TMPDIR=/tmp/kernel-amd64

mkdir -p $TMPDIR

cd $TMPDIR

wget -c $link1
wget -c $url1
wget -c $url2

sudo dpkg -i $TMPDIR/*.deb

sudo rm -rf $TMPDIR

else
echo "Unsupported Architecture"
fi

Bewerten
- +
Anzeige