Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve backup and restore procedure #320

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
83936e9
Squashed commit for Openvario merge request "improve backup and resto…
Jun 18, 2022
ddf511a
rearranging the menu items
Blaubart Jul 12, 2022
e3764bf
improve progress bar
Blaubart Jul 12, 2022
33dbddf
Moved system info functionality into new script system-info.sh. Exten…
7lima Jul 16, 2022
082b770
Update_Maps menu item moved from submenu_system to submenu_file
7lima Jul 17, 2022
783c803
Renaming, addition and reordering of backup/restore functions.
7lima Jul 17, 2022
92e7ca1
Complete rewrite and extension of lordfolken's transfer-xcsoar.sh.
7lima Jul 17, 2022
09b0114
Merge branch 'pull_request_315-branch' into pull_request_317-branch
7lima Jul 17, 2022
76ac512
Manually reverted my .gitignore customisations from former times.
7lima Jul 17, 2022
90e564a
Fixed newly introduced problems in menu code.
7lima Jul 17, 2022
4e8a82f
Update transfer-xcsoar.sh
Blaubart Aug 13, 2022
631f2cf
Update transfer-xcsoar.sh
Blaubart Aug 14, 2022
8ca99bc
Update transfer-xcsoar.sh
Blaubart Aug 15, 2022
dbc5ba2
Update transfer-xcsoar.sh
Blaubart Aug 15, 2022
72a56b3
implement automatic rotation after backup
Blaubart Mar 9, 2023
24cc85e
Update transfer-xcsoar.sh
Blaubart Mar 30, 2023
9a30677
bug fix - check if e2fsprogs is installed
Blaubart Mar 31, 2023
5878591
Bug fix - IP of eth0 and wlan0 was not found
Blaubart Apr 10, 2023
53a2c7c
add a new line at the end of the file
Blaubart Apr 10, 2023
8471ae1
removing double quote from the rotation value
Blaubart Apr 10, 2023
29a3061
Update openvario-image-testing.bb
Blaubart Apr 10, 2023
f48123e
restart tslib after restore
Blaubart Apr 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions meta-ov/recipes-apps/ovmenu-ng-skripts/files/system-info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/sh
#
# system-info.sh
# System info script gives an overview which packages and which versions are instaled
#
# Created by Blaubart, 2022-02-08
#

# collect info of system and more installed packages
IMAGE_VERSION=$(cat /etc/os-release | grep VERSION_ID | cut -d '=' -f 2)
KERNEL_VERSION=$(uname -r)
XCSOAR_MAPS_VERSION=$(opkg list-installed xcsoar-maps* | cut -d '-' -f 4)
XCSOAR_MENU=$(opkg list-installed xcsoar-menu* | cut -d '-' -f 3)
IP_ETH0=$(ip route | grep eth0 | head -n 1 | cut -d ' ' -f 8)
MAC=`ip li|grep -A 1 eth0|tail -n 1|cut -d ' ' -f 6`
HOSTNAME=$(cat /etc/hostname)
IP_WLAN=$(ip route | grep wlan0 | head -n 1| cut -d ' ' -f 8)
I2C_TOOLS=$(opkg list-installed i2c-tools | cut -d '-' -f 3)
E2FSPROGS=$(opkg list-installed e2fsprogs | cut -d '-' -f 2)
USB_MODESWITCH=$(opkg list-installed usb-modeswitch | cut -d '-' -f 3)

# collect status of SSH, variod and sensord
if /bin/systemctl --quiet is-enabled dropbear.socket
then
SSH_STATUS=enabled
else
SSH_STATUS=disabled
fi

Comment on lines +22 to +29
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit does three things:

  • move code to a new script (why?)
  • reformat the code
  • add new features

Doing 3 distinct things in 1 commit obscures the code changes, because one cannot see what was changed; the commitdiff is "remove 20 lines here, add 100 lines over there", but no diff possible.

if /bin/systemctl --quiet is-enabled variod
then
VARIOD_STATUS=enabled
else
VARIOD_STATUS=disabled
fi

if /bin/systemctl --quiet is-enabled sensord
then
SENSORD_STATUS=enabled
else
SENSORD_STATUS=disabled
fi

#print info of system and packages
echo ' Image: '$IMAGE_VERSION
echo ' Kernel: '$KERNEL_VERSION

# collect info of installed packages, depending of testing or stable version is used
if [ -n "$(opkg list-installed xcsoar-testing)" ]
then
XCSOAR_VERSION=$(opkg list-installed xcsoar-testing | cut -d ' - ' -f 3)
echo ' XCSoar-testing: '$XCSOAR_VERSION
else
XCSOAR_VERSION=$(opkg list-installed xcsoar | cut -d '-' -f 2)
echo ' XCSoar:'$XCSOAR_VERSION
fi

echo ' Maps:'$XCSOAR_MAPS_VERSION
echo ' Menu:'$XCSOAR_MENU

if [ -n "$(opkg list-installed sensord-testing)" ]
then
SENSORD_VERSION=$(opkg list-installed sensord-testing | cut -d ' - ' -f 3)
echo ' sensord-testing: '$SENSORD_VERSION
else
SENSORD_VERSION=$(opkg list-installed sensord | cut -d '-' -f 2)
echo ' sensord:'$SENSORD_VERSION
fi

if [ -n "$(opkg list-installed variod-testing)" ]
then
VARIOD_VERSION=$(opkg list-installed variod-testing | cut -d ' - ' -f 3)
echo ' variod-testing: '$VARIOD_VERSION
else
VARIOD_VERSION=$(opkg list-installed variod | cut -d '-' -f 2)
echo ' variod:'$VARIOD_VERSION
fi

echo ' IP eth0: '$IP_ETH0
echo ' MAC-address eth0: '$MAC
echo ' Hostname: '$HOSTNAME
echo ' IP wlan0: '$IP_WLAN
echo -e '\n'
echo ' supplementary packages that are not included\n in every image:'
echo ' i2c-tools:'$I2C_TOOLS
echo ' e2fsprogs:'$E2FSPROGS
echo ' usb-modeswitch:'$USB_MODESWITCH
echo -e '\n'
echo ' Status of SSH, variod and sensord:'
echo ' SSH is '$SSH_STATUS
echo ' variod is '$VARIOD_STATUS
echo ' sensord is '$SENSORD_STATUS
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ SRC_URI = "\
file://update-system.sh \
file://download-igc.sh \
file://transfer-xcsoar.sh \
file://system-info.sh \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has nothing to do with rearranging menu items, and probably this fails the build because this script doesn't exist (yet).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right!

file://ov-calibrate-ts.sh \
"

Expand All @@ -41,6 +42,7 @@ do_install() {
${S}/update-system.sh \
${S}/download-igc.sh \
${S}/transfer-xcsoar.sh \
${S}/system-info.sh \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

${S}/ov-calibrate-ts.sh \
${D}${bindir}/
cd ${D}${bindir}
Expand Down
27 changes: 3 additions & 24 deletions meta-ov/recipes-apps/ovmenu-ng/files/ovmenu-ng.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,30 +100,9 @@ function submenu_system() {
esac
}

function show_info() {
### collect info of system
XCSOAR_VERSION=$(opkg list-installed xcsoar | awk -F' ' '{print $3}')
XCSOAR_MAPS_VERSION=$(opkg list-installed | grep "xcsoar-maps-" | awk -F' ' '{print $3}')
IMAGE_VERSION=$(cat /etc/os-release | grep VERSION_ID | awk -F'=' -F'"' '{print $2}')
SENSORD_VERSION=$(opkg list-installed sensord* | awk -F' ' '{print $3}')
VARIOD_VERSION=$(opkg list-installed variod* | awk -F' ' '{print $3}')
IP_ETH0=$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
IP_WLAN=$(/sbin/ifconfig wlan0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')

dialog --backtitle "OpenVario" \
--title "[ S Y S T E M I N F O ]" \
--begin 3 4 \
--msgbox " \
\n \
Image: $IMAGE_VERSION\n \
XCSoar: $XCSOAR_VERSION\n \
Maps: $XCSOAR_MAPS_VERSION\n \
sensord: $SENSORD_VERSION\n \
variod: $VARIOD_VERSION\n \
IP eth0: $IP_ETH0\n \
IP wlan0: $IP_WLAN\n \
" 15 50

function show_info() {
/usr/bin/system-info.sh >> /tmp/tail.$$ &
dialog --backtitle "OpenVario" --title "Result" --tailbox /tmp/tail.$$ 30 50
}

function submenu_settings() {
Expand Down
2 changes: 1 addition & 1 deletion meta-ov/recipes-core/images/openvario-image-testing.bb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ IMAGE_INSTALL += "\
xcsoar-menu \
xcsoar-profiles \
xcsoar-maps-default \
sensord-testing\
sensord-testing \
variod-testing \
ovmenu-ng \
"
Expand Down