adding ability to let setup script download and install kernel

This commit is contained in:
Jake Day 2018-06-06 22:15:26 -04:00
parent 2a7df275b4
commit 8606d9a2a8
2 changed files with 23 additions and 4 deletions

View file

@ -44,9 +44,9 @@ You will need to download the image, headers and libc-dev deb files for the vers
### Instructions ### Instructions
0. (Prep) Install Git: 0. (Prep) Install Dependencies:
``` ```
sudo apt install git sudo apt install git curl wget sed
``` ```
1. Clone the linux-surface repo: 1. Clone the linux-surface repo:
``` ```
@ -60,11 +60,13 @@ You will need to download the image, headers and libc-dev deb files for the vers
``` ```
sudo sh setup.sh sudo sh setup.sh
``` ```
4. Install the headers, kernel and libc-dev (make sure you cd to your download location first): 5. Reboot on installed kernel.
The setup script will handle installing the latest kernel for you. You can also choose to download any version you want and install yourself:
Install the headers, kernel and libc-dev (make sure you cd to your download location first):
``` ```
sudo dpkg -i linux-headers-[VERSION].deb linux-image-[VERSION].deb linux-libc-dev-[VERSION].deb sudo dpkg -i linux-headers-[VERSION].deb linux-image-[VERSION].deb linux-libc-dev-[VERSION].deb
``` ```
5. Reboot on installed kernel.
### Compiling the Kernel from Source ### Compiling the Kernel from Source

View file

@ -139,4 +139,21 @@ echo "Installing marvell firmware...\n"
mkdir -p /lib/firmware/mrvl/ mkdir -p /lib/firmware/mrvl/
unzip -o firmware/mrvl_firmware.zip -d /lib/firmware/mrvl/ unzip -o firmware/mrvl_firmware.zip -d /lib/firmware/mrvl/
read -rp "Do you want this script to download and install the latest kernel for you? (type yes or no) " autoinstallkernel;echo
if [ "$autoinstallkernel" = "yes" ]; then
echo "Downloading latest kernel...\n"
urls=$(curl --silent "https://api.github.com/repos/jakeday/linux-surface/releases/latest" | grep '"browser_download_url":' | sed -E 's/.*"([^"]+)".*/\1/')
resp=$(wget -P tmp $urls)
echo "Installing latest kernel...\n"
dpkg -i tmp/*.deb
rm -rf tmp
else
echo "Not downloading latest kernel"
fi
echo "\nAll done! Please reboot." echo "\nAll done! Please reboot."