-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathnewver.sh
48 lines (35 loc) · 921 Bytes
/
newver.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
#!/bin/bash
proc_ipk() {
file=$1
[ -d ./kk ] && rm -rf ./kk
mkdir ./kk
tar xzf $file -C ./kk/
cd kk
tar xf data.tar.gz
kv=$(ls ./lib/modules)
cd ..
if echo $file | grep -q 'x86_64'; then
machine=64
elif echo $file | grep -q 'i386_pentium4'; then
machine=generic
else
machine=legacy
fi
mkdir -p ventoy_openwrt/$kv/$machine
for ko in dm-mod.ko dax.ko; do
if [ -f kk/lib/modules/$kv/$ko ]; then
echo "copy ventoy_openwrt/$kv/$machine/$ko ..."
[ -f ventoy_openwrt/$kv/$machine/$ko ] && rm -f ventoy_openwrt/$kv/$machine/$ko
cp -a kk/lib/modules/$kv/$ko ventoy_openwrt/$kv/$machine/
fi
done
rm -rf ./kk
}
for i in $(ls *.ipk); do
proc_ipk $i
rm -f $i
done
sh pack.sh
echo ""
echo "======= SUCCESS ======="
echo ""