forked from arduino/ArduinoCore-mbed
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bfg_nano33ble.sh
38 lines (31 loc) · 1.26 KB
/
bfg_nano33ble.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
#!/bin/bash -ex
# Extract nrf core history from main repo
cd /tmp
wget https://search.maven.org/classic/remote_content?g=com.madgag\&a=bfg\&v=LATEST -O bfg.jar
mkdir ArduinoCore-nRF52-mbed.git
cd ArduinoCore-nRF52-mbed.git
git init --bare
cd ..
git clone [email protected]:bcmi-labs/ArduinoCore-mbed
cd ArduinoCore-mbed
git remote add nrf52 /tmp/ArduinoCore-nRF52-mbed.git
#don't mess with origin
git remote remove origin
rm -rf variants/ENVIE*
rm -rf variants/MBED*
rm -rf examples*
rm -rf cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_ENVIE
rm -rf libraries/WiFi*
sed -i '/.*envie.*$/ d' boards.txt
sed -i '/.*odin.*$/ d' boards.txt
sed -i 's/ENVIE_M4//g' platform.txt
rm bfg*
git commit -am "Add nano33 target"
git push nrf52 master
cd ..
java -jar bfg.jar --strip-blobs-bigger-than 50M --delete-folders "{ENVIE_M4,MBED_CONNECT_ODIN,MTB_UBLOX_ODIN_W2,DISCO_F429ZI,TARGET_ENVIE,openamp,OpenAMP,adafruit-nrfutil,rpclib,WiFi*,*OnMbed}" --delete-files="{RPC.*,RPC_*,bfg*,boards.txt}" /tmp/ArduinoCore-nRF52-mbed.git
cd /tmp/ArduinoCore-nRF52-mbed.git
git filter-branch --prune-empty
git reflog expire --expire=now --all && git gc --prune=now --aggressive
git remote add origin [email protected]:bcmi-labs/ArduinoCore-nRF52-mbed
git push origin master