-
Notifications
You must be signed in to change notification settings - Fork 13
/
apply_extra
43 lines (35 loc) · 1.01 KB
/
apply_extra
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
#!/bin/bash
set -e
# extract using the installer
#chmod +x mcuxpressoide.x86_64.deb.bin
#./mcuxpressoide.x86_64.deb.bin --noexec --keep --target ./
#rm -f mcuxpressoide.x86_64.deb.bin install.sh ProductLicense.txt
# extract deb package
_shell_installer_len=521
# extract ide
dd \
iflag=skip_bytes \
skip=$(head -n $_shell_installer_len mcuxpressoide.x86_64.deb.bin | wc -c ) \
if=mcuxpressoide.x86_64.deb.bin | \
bsdtar -Oxf - \
'./mcuxpressoide-*.x86_64.deb' | \
bsdtar -Oxf - 'data.tar*' | \
bsdtar -xf - \
--strip-components=2 \
--exclude=usr/share \
--exclude=lib/udev
rm -f mcuxpressoide.x86_64.deb.bin
install -dm755 docs lib
mv mcuxpressoide-*/* ./
rmdir mcuxpressoide-*
mv UdevRules docs/udev_rules
mv lib*.so* lib/
# extract jlink
bsdtar -Oxf JLink_Linux_x86_64.deb 'data.tar*' | \
bsdtar -xf - \
--strip-components=3 \
--exclude=./usr/bin
mv rules.d/* docs/udev_rules/
rmdir rules.d
rm -f JLink JLink_Linux_x86_64.deb
mv JLink* jlink