forked from RinCat/RTL88x2BU-Linux-Driver
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_chroot.sh
78 lines (74 loc) · 3.54 KB
/
build_chroot.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
#!/bin/bash
# This file is the install instruction for the CHROOT build
# We're using cloudsmith-cli to upload the file in CHROOT
sudo apt update
sudo apt install -y python3-pip ruby ruby-dev rubygems build-essential
gem install fpm
sudo pip3 install --upgrade cloudsmith-cli --break-system-packages
ls -a
API_KEY=$(cat cloudsmith_api_key.txt)
DISTRO=$(cat distro.txt)
FLAVOR=$(cat flavor.txt)
REPO=$(cat repo.txt)
CUSTOM=$(cat custom.txt)
ARCH=$(cat arch.txt)
echo ${DISTRO}
echo ${FLAVOR}
echo ${CUSTOM}
echo ${ARCH}
if [[ -e /etc/os-release && $(grep -c "Raspbian" /etc/os-release) -gt 0 ]]; then
sudo pip3 install --upgrade cloudsmith-cli
echo "building for the raspberry pi"
sudo apt update
sudo apt install -y build-essential flex bc bison dkms raspberrypi-kernel-headers
echo "___________________BUILDING-DRIVER___________________"
make KSRC=/usr/src/linux-headers-6.1.21-v7l+ O="" modules
mkdir -p package/lib/modules/6.1.21-v7l+/kernel/drivers/net/wireless/
cp *.ko package/lib/modules/6.1.21-v7l+/kernel/drivers/net/wireless/
ls -a
make clean
make KSRC=/usr/src/linux-headers-6.1.21-v7+ O="" modules
mkdir -p package/lib/modules/6.1.21-v7+/kernel/drivers/net/wireless/
cp *.ko package/lib/modules/6.1.21-v7+/kernel/drivers/net/wireless/
fpm -a armhf -s dir -t deb -n 88X2bu-rpi -v 2.5-evo-$(date '+%m%d%H%M') -C package -p 88X2bu-rpi.deb --before-install before-install-pi.sh --after-install after-install.sh
echo "copied deb file"
echo "push to cloudsmith"
git describe --exact-match HEAD >/dev/null 2>&1
echo "Pushing the package to OpenHD 2.5 repository"
ls -a
cloudsmith push deb --api-key "$API_KEY" openhd/release/raspbian/bullseye 88X2bu-rpi.deb || exit 1
elif [[ "$(lsb_release -cs)" == "noble" ]]; then
echo "building for ubuntu noble minimal"
sudo apt update
sudo apt install -y build-essential flex bc bison dkms
sudo apt install -y python3-pip
sudo apt remove -y python3-urllib3
sudo pip install cloudsmith-api --break-system-packages
sudo pip install cloudsmith-cli --break-system-packages
make KSRC=/usr/src/linux-headers-6.8.0-31-generic O="" modules
mkdir -p package/lib/modules/6.8.0-31-generic/kernel/drivers/net/wireless/
cp *.ko package/lib/modules/6.8.0-31-generic/kernel/drivers/net/wireless/
ls -a
fpm -a amd64 -s dir -t deb -n rtl88x2bu-x86 -v 2.5-evo-$(date '+%m%d%H%M') -C package -p rtl88x2bu-x86.deb --before-install before-install.sh --after-install after-install.sh
echo "copied deb file"
echo "push to cloudsmith"
git describe --exact-match HEAD >/dev/null 2>&1
echo "Pushing the package to OpenHD 2.5 repository"
cloudsmith push deb --api-key "$API_KEY" openhd/release/ubuntu/noble rtl88x2bu-x86.deb || exit 1
echo "---------------"
echo "_____________________________________________"
else
sudo apt update
sudo apt install -y build-essential flex bc bison dkms
make KSRC=/usr/src/linux-headers-6.3.13-060313-generic O="" modules
mkdir -p package/lib/modules/6.3.13-060313-generic/kernel/drivers/net/wireless/
cp *.ko package/lib/modules/6.3.13-060313-generic/kernel/drivers/net/wireless/
ls -a
fpm -a amd64 -s dir -t deb -n rtl88x2bu-x86 -v 2.5-evo-$(date '+%m%d%H%M') -C package -p rtl88x2bu-x86.deb --before-install before-install.sh --after-install after-install.sh
echo "copied deb file"
echo "push to cloudsmith"
git describe --exact-match HEAD >/dev/null 2>&1
echo "Pushing the package to OpenHD 2.5 repository"
ls -a
cloudsmith push deb --api-key "$API_KEY" openhd/release/ubuntu/lunar rtl88x2bu-x86.deb || exit 1
fi