Commit aa491745 authored by hark's avatar hark
Browse files

grsec

parent e1ef9e1e
This diff is collapsed.
This diff is collapsed.
......@@ -8,6 +8,7 @@ function install_dependencies() {
sudo apt -y -qq install build-essential fakeroot libncurses5-dev libssl-dev ccache libelf-dev dirmngr gcc-6-plugin-dev
gpg --recv 647F28654894E3BD457199BE38DBBDC86092693E
gpg --recv F81962A54902300F72ECB83AA1FC1F6AD2D09049
}
function init() {
......@@ -63,11 +64,26 @@ stable_version="$1"
imagename="${stable_version}_$config_shasum.vmlinuz"
}
function get_specific_version() {
grsec_releases="http://ftp.lag/grsec/"
# stable_version=$(curl -s "${stable_releases}" | grep -E -o 'linux-([0-9]{1,}\.)+[0-9]{1,}' | sort -Vr | head -n 1 | cut -d '-' -f 2)
stable_version="$1"
stable_link="${grsec_releases}linux-${stable_version}_${stable_version}.orig.tar.gz"
stable_siglink="${grsec_releases}linux-${stable_version}_${stable_version}.orig.tar.gz.gpg"
stable_file="linux-${stable_version}_${stable_version}.orig.tar.gz"
stable_sigfile="linux-${stable_version}_${stable_version}.orig.tar.gz.gpg"
imagename="${stable_version}_$config_shasum.vmlinuz"
}
get_kernel() {
if [ "$KERNELVERSION" == "latest" ]
then
get_latest_version
elif [ "$KERNELVERSION" == *"-grsec" ]
get_grsec_version $KERNELVERSION
TYPE='grsec'
else
get_specific_version $KERNELVERSION
fi
......@@ -114,7 +130,24 @@ function download_and_unpack() {
fi
echo "checking sig"
if [[ $type == 'grsec ']]
then
if verify_signature ${stable_sigfile} ${stable_file}
then
echo "grsec sig verification good"
else
echo "grsec sig verification failed"
exit 23
fi
if [ ! -d ${kernel_name} ]
then
echo "unpacking"
tar -xvf ${stable_file}
fi
else
if verify_signature ${stable_sigfile} ${kernel_name}.tar
then
echo "sig verification good"
......@@ -122,12 +155,13 @@ function download_and_unpack() {
echo "sig verification failed"
exit 23
fi
if [ ! -d ${kernel_name} ]
then
echo "unpacking"
tar -xvf ${kernel_name}.tar
fi
fi
#tar xvf "${kernel_name}.tar.xz"
cd "${kernel_name}" || exit
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment