mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Merge branch 'master' into handle-menu-sizing-better
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
# TS100 Flasher for Linux by Alex Wigen (https://github.com/awigen)
|
# TS100 Flasher for Linux by Alex Wigen (https://github.com/awigen)
|
||||||
|
|
||||||
DIR_TMP="/tmp/ts100"
|
DIR_TMP="/tmp/ts100"
|
||||||
|
|
||||||
function usage() {
|
usage() {
|
||||||
echo
|
echo
|
||||||
echo "#################"
|
echo "#################"
|
||||||
echo "# TS100 Flasher #"
|
echo "# TS100 Flasher #"
|
||||||
@@ -18,36 +18,32 @@ function usage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GAUTOMOUNT=0
|
GAUTOMOUNT=0
|
||||||
function disable_gautomount {
|
disable_gautomount() {
|
||||||
GSETTINGS=$(which gsettings)
|
if ! GSETTINGS=$(which gsettings); then
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
gsettings get org.gnome.desktop.media-handling automount | grep true > /dev/null
|
if ! gsettings get org.gnome.desktop.media-handling automount | grep true > /dev/null; then
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
GAUTOMOUNT=1
|
GAUTOMOUNT=1
|
||||||
gsettings set org.gnome.desktop.media-handling automount false
|
gsettings set org.gnome.desktop.media-handling automount false
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function enable_gautomount {
|
enable_gautomount() {
|
||||||
if [ "$GAUTOMOUNT" -ne 0 ]; then
|
if [ "$GAUTOMOUNT" -ne 0 ]; then
|
||||||
gsettings set org.gnome.desktop.media-handling automount true
|
gsettings set org.gnome.desktop.media-handling automount true
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_attached {
|
is_attached() {
|
||||||
output=$(lsblk -b --raw --output NAME,MODEL | grep 'DFU.*Disk')
|
if ! output=$(lsblk -b --raw --output NAME,MODEL | grep 'DFU.*Disk'); then
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
DEVICE=$(echo $output | awk '{print "/dev/"$1}')
|
DEVICE=$(echo "$output" | awk '{print "/dev/"$1}')
|
||||||
}
|
}
|
||||||
|
|
||||||
instructions="not printed"
|
instructions="not printed"
|
||||||
function wait_for_ts100 {
|
wait_for_ts100() {
|
||||||
is_attached
|
while ! is_attached; do
|
||||||
while [ $? -ne 0 ]; do
|
|
||||||
if [ "$instructions" = "not printed" ]; then
|
if [ "$instructions" = "not printed" ]; then
|
||||||
echo
|
echo
|
||||||
echo "#####################################################"
|
echo "#####################################################"
|
||||||
@@ -60,29 +56,27 @@ function wait_for_ts100 {
|
|||||||
instructions="printed"
|
instructions="printed"
|
||||||
fi
|
fi
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
is_attached
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function mount_ts100 {
|
mount_ts100() {
|
||||||
mkdir -p "$DIR_TMP"
|
mkdir -p "$DIR_TMP"
|
||||||
sudo mount -t msdos -o uid=$UID "$DEVICE" "$DIR_TMP"
|
user="${UID:-$(id -u)}"
|
||||||
if [ $? -ne 0 ]; then
|
if ! sudo mount -t msdos -o uid=$user "$DEVICE" "$DIR_TMP"; then
|
||||||
echo "Failed to mount $DEVICE on $DIR_TMP"
|
echo "Failed to mount $DEVICE on $DIR_TMP"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function umount_ts100 {
|
umount_ts100() {
|
||||||
mountpoint "$DIR_TMP" > /dev/null && sudo umount "$DIR_TMP"
|
if ! mountpoint "$DIR_TMP" > /dev/null && sudo umount "$DIR_TMP"; then
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Failed to unmount $DIR_TMP"
|
echo "Failed to unmount $DIR_TMP"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
rmdir "$DIR_TMP"
|
rmdir "$DIR_TMP"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanup {
|
cleanup() {
|
||||||
enable_gautomount
|
enable_gautomount
|
||||||
if [ -d "$DIR_TMP" ]; then
|
if [ -d "$DIR_TMP" ]; then
|
||||||
umount_ts100
|
umount_ts100
|
||||||
@@ -102,7 +96,7 @@ if [ ! -f "$1" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $(head -c1 "$1") != ":" ] || [ $(tail -n1 "$1" | head -c1) != ":" ]; then
|
if [ "$(head -c1 "$1")" != ":" ] || [ "$(tail -n1 "$1" | head -c1)" != ":" ]; then
|
||||||
echo "'$1' doesn't look like a valid HEX file. Please provide a HEX file to flash"
|
echo "'$1' doesn't look like a valid HEX file. Please provide a HEX file to flash"
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
4
build.sh
4
build.sh
@@ -1,2 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
docker-compose run --rm builder /bin/bash /build/ci/buildAll.sh
|
docker-compose run --rm builder /bin/bash /build/ci/buildAll.sh
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
|
|||||||
8
setup.sh
8
setup.sh
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
# Setup shell file to setup the environment on an ubuntu machine
|
# Setup shell file to setup the environment on an ubuntu machine
|
||||||
sudo apt-get update && sudo apt-get install -y make bzip2 git python3 python3-pip wget dfu-util
|
sudo apt-get update && sudo apt-get install -y make bzip2 git python3 python3-pip wget dfu-util
|
||||||
python3 -m pip install bdflib black flake8
|
python3 -m pip install bdflib black flake8
|
||||||
sudo mkdir -p /build
|
sudo mkdir -p /build
|
||||||
cd /build
|
cd /build
|
||||||
@@ -12,7 +12,7 @@ cd /build
|
|||||||
MDPATH=${GITHUB_WORKSPACE:-/build/source/}
|
MDPATH=${GITHUB_WORKSPACE:-/build/source/}
|
||||||
sudo mkdir -p /build/cache
|
sudo mkdir -p /build/cache
|
||||||
cd /build/cache/
|
cd /build/cache/
|
||||||
if md5sum -c $MDPATH/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5; then
|
if md5sum -c "$MDPATH"/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5; then
|
||||||
echo "Good MD5 ARM"
|
echo "Good MD5 ARM"
|
||||||
else
|
else
|
||||||
echo "ARM MD5 Mismatch, downloading fresh"
|
echo "ARM MD5 Mismatch, downloading fresh"
|
||||||
@@ -20,7 +20,7 @@ else
|
|||||||
sudo wget -q "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2" -O gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
|
sudo wget -q "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2" -O gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if md5sum -c $MDPATH/ci/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5; then
|
if md5sum -c "$MDPATH"/ci/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5; then
|
||||||
echo "Good MD5 RISCV"
|
echo "Good MD5 RISCV"
|
||||||
else
|
else
|
||||||
echo "RISCV MD5 Mismatch, downloading fresh"
|
echo "RISCV MD5 Mismatch, downloading fresh"
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ echo "*********************************************"
|
|||||||
|
|
||||||
# Calculate available languages
|
# Calculate available languages
|
||||||
for f in "$TRANSLATION_DIR"/translation_*.json; do
|
for f in "$TRANSLATION_DIR"/translation_*.json; do
|
||||||
AVAILABLE_LANGUAGES+=($(echo $f | tr "[:lower:]" "[:upper:]" | sed "s/[^_]*_//" | sed "s/\.JSON//g"))
|
AVAILABLE_LANGUAGES+=("$(echo "$f" | tr "[:lower:]" "[:upper:]" | sed "s/[^_]*_//" | sed "s/\.JSON//g")")
|
||||||
done
|
done
|
||||||
|
|
||||||
# Checking requested language
|
# Checking requested language
|
||||||
@@ -124,8 +124,8 @@ if [ ${#BUILD_LANGUAGES[@]} -gt 0 ] && [ ${#BUILD_MODELS[@]} -gt 0 ]; then
|
|||||||
checkLastCommand
|
checkLastCommand
|
||||||
|
|
||||||
for model in "${BUILD_MODELS[@]}"; do
|
for model in "${BUILD_MODELS[@]}"; do
|
||||||
echo "Building firmware for $model in ${BUILD_LANGUAGES[@]}"
|
echo "Building firmware for $model in ${BUILD_LANGUAGES[*]}"
|
||||||
make -j$(nproc) model="$model" "${BUILD_LANGUAGES[@]/#/firmware-}" >/dev/null
|
make -j"$(nproc)" model="$model" "${BUILD_LANGUAGES[@]/#/firmware-}" >/dev/null
|
||||||
checkLastCommand
|
checkLastCommand
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
docker-compose run --rm builder
|
docker-compose run --rm builder
|
||||||
|
|||||||
Reference in New Issue
Block a user