-
Notifications
You must be signed in to change notification settings - Fork 0
/
installscript.sh
114 lines (99 loc) · 2.27 KB
/
installscript.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
# Slackware server URL
server_url="http://mirrors.slackware.com/slackware/slackware64-current/"
# package names without version number
packages=(
nano
curl
git
nghttp2
brotli
cyrus-sasl
screen
bc
gc
glibc
gawk
kernel-headers
autoconf-archive
autoconf
automake
binutils
check
cmake
flex
gcc
gcc-g++
guile
libtool
m4
make
pkg-config
gettext
gettext-tools
strace
bison
patch
squashfs-tools
kmod
ncurses
infozip
rsync
libseccomp
libcap
util-linux
perl
python3
python-setuptools
gperf
eudev
libpciaccess
elfutils
lzo
lz4
xxHash
openssh
bzip2
xz
lzlib
)
# download FILELIST.TXT to get list of packages
wget -O /tmp/FILELIST.TXT "${server_url}/FILELIST.TXT"
# create packages directory
mkdir -p /tmp/packages
# loop through FILELIST.TXT for packages
for package_name in "${packages[@]}"
do
# find the package in FILELIST.TXT
package_file=$(grep -E "/${package_name//\+/\\\+}-[0-9]+" /tmp/FILELIST.TXT | awk '{print $8}' | grep -E "txz|tgz" | grep -v ".asc" | grep -Ev "/source/|/testing/" | grep -v "/patches/" | sed 's/^\.\///')
# download the package
if ! wget -P /tmp/packages/ "${server_url}${package_file}" ; then
echo "ERROR: Download from package: ${package_file##*/} failed!"
exit 1
fi
done
# install packages
cd /tmp/packages
installpkg *
cd /tmp
# install jq
jq_v=1.6
wget -O /tmp/jq-${jq_v}-x86_64-1alien.txz https://slackware.uk/people/alien/sbrepos/current/x86_64/jq/jq-${jq_v}-x86_64-1alien.txz
installpkg /tmp/jq-${jq_v}-x86_64-1alien.txz
# install squashfs-tools
wget -O /tmp/squashfs-tools-4.5-x86_64-2.txz https://slackware.uk/slackware/slackware64-15.0/slackware64/ap/squashfs-tools-4.5-x86_64-2.txz && \
installpkg /tmp/squashfs-tools-4.5-x86_64-2.txz
# install cpio 2.12 because cpio 2.13 is currently broken
wget -O /tmp/cpio-2.12-x86_64-1.txz https://slackware.uk/slackware/slackware64-14.2/slackware64/a/cpio-2.12-x86_64-1.txz
installpkg /tmp/cpio-2.12-x86_64-1.txz
# install lsdiff
wget -O /usr/bin/lsdiff https://github.com/ich777/runtimes/raw/master/lsdiff/lsdiff
chmod +x /usr/bin/lsdiff
# install Perl module: ProcessTable
cpan -i Proc::ProcessTable
# cleanup
rm -rf /tmp/*
# remove README from root directory
if [ -f /README ]; then
rm -f /README
fi