forked from gapan/iso-creation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
09-kernel.sh
executable file
·54 lines (45 loc) · 990 Bytes
/
09-kernel.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
#
# This script extracts the kernel image files+friends from the kernel
# packages that have been previously downloaded and places them inside
# the kernels directory
if [ "$UID" -eq "0" ]; then
echo "Don't run this script as root"
exit 1
fi
set -e
if [ ! -f ARCH ]; then
echo "No ARCH file."
exit 1
else
arch=`cat ARCH`
fi
if [ ! -f VERSION ]; then
echo "No VERSION file."
exit 1
else
VER=`cat VERSION`
fi
REPO=https://download.salixos.org/$arch/slackware-$VER/kernels
rm -rf kernel/$arch
get_kernel() {
KERNEL=$1
mkdir -p kernel/$arch/$KERNEL
cd kernel/$arch/$KERNEL
wget --no-verbose $REPO/$KERNEL/bzImage
wget --no-verbose $REPO/$KERNEL/System.map.gz
wget --no-verbose $REPO/$KERNEL/config
cd ../../..
}
# get the slack kernel
echo "Getting the slackware kernel..."
if [[ "$arch" == "i486" ]]; then
get_kernel hugesmp.s
if [ -f iso/salix/kernels/kernel-huge-*-i586-*.txz ]; then
get_kernel huge.s
fi
else
get_kernel huge.s
fi
echo "DONE!"
set +e