wiki:Docs/825gen2/Dev/DevVMTechnical

Version 64 (modified by Don Wilson, 8 days ago) ( diff )

--

Development VM Technical Information

Fedora Packages

The development VM has a number of pre-installed packages. Due to new features that are added to the library it may be necessary to install some additional packages.

The json-c library is now used for graphical CUPS ticket formatting. From a terminal window type:

sudo dnf install json-c-devel

The libesmtp library will be used to allow sending tickets as emails.

sudo dnf install libesmtp-devel

The following table is a list of packages that should be installed in the VM. These should normally already be installed except the above.

package nameNotes
gdk-pixbuf2-modules-extraWithout this Eclipse splash screen may not appear correctly
pcre-toolsPerl-compatible regular expressions
expat-devel
libuuid-devel
libXdmcp-devel
libdrm-devel
libgbm-devel
pcre-develPerl-compatible regular expressions development
libcurl-develcURL network data transfer development
gstreamer1-develPipeline-based multimedia framework development
mariadb-develMariaDB (MySQL compatible) database development
cmake
wxGTK3GIMP ToolKit for GUIs
wxGTK-develGIMP ToolKit development
sqlite-develSQLite database development
cups-develCUPS (Common Unix Printing System) development
libarchive-develRead/Write compressed archive development
libattr-devel
libunistring-devel
libacl-develLibrary for access control lists development
lzo-develData compression development
NetworkManager-libnm-develLibrary for networking configuration development
libudev-develDevice manager development
subversionSVN source control
ffmpeg
unixODBCOpen Database Connectivity
freetdsSQL Server connectivity
freetds-develSQL Server connectivity development
httdApache Web Server
php-cliPHP language
php-fpmPHP language
json-c-develJSON manipulation development
libesmtp-develSMTP email client development

Utilities and taskbar links should already be configured in the VM. For reference these are the packages:

package nameNotes
sqlitebrowserDB Browser for SQLite databases
meldDifference tool
puttyTerminal utility
chromiumWeb browser
flatpakAlternative package manager
snapdAlternative package manager

GIMP Graphics editor:

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.gimp.GIMP

MySQL Workbench

sudo ln -s /var/lib/snapd/snap /snap
sudo snap install mysql-workbench-community

From application menu right-click gimp and "Pin to task manager"

From application menu select "Development", right-click "DB Browser for SQLite" and "Pin to task manager"

From application menu select "Development", right-click "MySQL Workbench" and "Pin to task manager" From application menu select "Development", right-click "Meld" and "Pin to task manager"

From application menu select "Internet", right-click "Putty" and "Pin to task manager"

From application menu select "Internet", right-click "Chromium" and "Pin to task manager"

From application menu select "Utilities", right-click "KCalc" and "Pin to task manager"

Eclipse Projects

The following projects may be checked out into the Eclipse workspace workspace_825.

Libraries

lib825evhttp://tech.825spectrum.com/svn/arm825beta/libraries/lib825ev/trunk Library for newer style event based applications
lib825langhttp://tech.825spectrum.com/svn/arm825beta/libraries/lib825lang/trunk Library for 825 apps to handle multiple languages. A SQLite database holds a common set of strings to be used by multiple apps. Upon first run of an app strings are imported into the database from a UTF-8 CSV file. Read strings are cached into an STL map so database lookup is not required every time the string is needed again. 825 web pages may also retrieve language specific strings by reading the SQLite database using PHP.
lib825sqlhttp://tech.825spectrum.com/svn/arm825beta/libraries/lib825sql/trunk New apps wanting to use C++ wrapper functions for sqlite should use this instead of libsql3_7_9 or libsql. This library provides the C++ wrapper but does not have sqlite3 static code included. Apps using this will use /usr/lib/libsqlite3.so library dynamically loaded. This is a much more current version of sqlite3.
lib825dbhttp://tech.825spectrum.com/svn/arm825beta/libraries/lib825db/trunk Wrapper code to allow apps to use common code for SQLite and MySQL. Apps may add a configuration screen to select database type and settings. App startup code can then open the database based on the settings. This may become a replacement for lib825sql for new app development.
lib825http://tech.825spectrum.com/svn/arm825beta/libraries/lib825/trunk Library for old style application compatibility. Should not be used for new applications
libapphttp://tech.825spectrum.com/svn/arm825beta/libraries/libapp/trunk Library for old style application compatibility. Should not be used for new applications
libsqlhttp://tech.825spectrum.com/svn/arm825beta/libraries/libsql/trunk Library for SQLite 3.6.12 and includes C++ wrapper code. Should not be used for new applications
libsql3_7_9http://tech.825spectrum.com/svn/arm825beta/libraries/libsql3_7_9/trunk Library for SQLite 3.7.9 (newer than libsql) and includes C++ wrapper code. Should not be used for new applications

Environment Variables

The development VM uses a number of environment variables. To review or edit these from a terminal window type kate /etc/profile.d/arm825env.sh

#Setup environment variables for ARM825 development

AARCH64=/opt/armv8a
export AARCH64

AARCH64MX8M=/opt/armv8a-mx8m
export AARCH64MX8M

export DSPWIDTH=1280
export DSPHEIGHT=800

export CUSTAPPS_DIR="/srv/nfs/arm825/mnt/nand/apps/"
export STDAPPS_DIR="/srv/nfs/arm825/usr/sbin/card/"

export UI_LIBS="wayland-client -lwayland-cursor -lxkbcommon -lffi -ljpeg -lpng -lpixman-1 -lfreetype -lz"
export CURL_LIBS="curl -lcrypto -lssl -lidn2 -lunistring"
export GLIB_LIBS="glib-2.0 -lgio-2.0 -lgmodule-2.0 -lgobject-2.0 -lpcre -lmount -lblkid"
export NM_LIBS="nm -lsmime3 -lnss3 -lnssutil3 -lnspr4 -lplds4 -lplc4 -ludev"
export CAIRO_LIBS="pango-1.0 -lpangocairo-1.0 -lharfbuzz -lfribidi -lcairo -lfontconfig -lGLESv2 -lEGL -lexpat -luuid -lGAL -lVSC -lwayland-server -ldrm -lgbm -lgbm_viv"
export CAIRO_SIM_LIBS="pango-1.0 -lpangocairo-1.0 -lharfbuzz -lfribidi -lcairo -lfontconfig -lGLESv2 -lEGL -lxcb-shm -lxcb -lxcb-render -lX11 -lXext -lXrender -lXau -lXdmcp -lexpat -luuid -lwayland-server -ldrm -lgbm"
export CUPS_LIBS="cups -lavahi-common -lavahi-client -ldbus-1 -lsystemd -lzstd -lcap"
export PRT_LIBS="cups -lavahi-common -lavahi-client -ldbus-1 -lsystemd -lzstd -lcap -ljson-c -lesmtp -lssl -lcrypto"
export PRT_SIM_LIBS="cups -ljson-c -lesmtp -lssl -lcrypto"

# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/opt/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/:/opt/freescale/usr/local/gcc-4.4.53-uclibc-0.9.53/m68k-uclinux/bin/

The PRT_LIBS and PRT_SIM_LIBS environment variables are new variables (2025-03-06) that contain the cups, json-c, esmtp, ssl, and crypto to facilitate the new ticket printing features for graphical tickets and emails.

After making changes to this it may be necessary to restart the VM.

Project helper setup_arm64lib

The folders /opt/arm64include and /opt/arm64lib contain symbolic links to various header and library files so that app projects can refer to these folders to reduce the complexity of project properties.

The file /home/user/bin/setup_arm64lib is a script used to update these folders:

#!/bin/sh
DEST="/opt/arm64lib"
rm -f $DEST/*
ln -s $AARCH64/wayland/usr/lib/libwayland* $DEST
ln -s $AARCH64/mariadb/usr/lib/libmaria* $DEST
ln -s $AARCH64/mariadb/usr/lib/libmysql* $DEST
ln -s $AARCH64/libxkbcommon/usr/lib/libxkb* $DEST
ln -s $AARCH64/libffi/usr/lib/libffi* $DEST
ln -s $AARCH64/libxcb/usr/lib/libxcb* $DEST
ln -s $AARCH64/libjpeg-turbo/usr/lib/libjpeg* $DEST
#ln -s $AARCH64/libjpeg-turbo/usr/lib/turbojpeg* $DEST
ln -s $AARCH64/libpng/usr/lib/libpng* $DEST
ln -s $AARCH64/pixman/usr/lib/libpixman* $DEST
ln -s $AARCH64/zlib/usr/lib/libz* $DEST
ln -s $AARCH64/freetype/usr/lib/libfreetype* $DEST
ln -s $AARCH64/openssl/usr/lib/libcrypto* $DEST
ln -s $AARCH64/openssl/usr/lib/libssl* $DEST
ln -s $AARCH64/curl/usr/lib/libcurl* $DEST
ln -s $AARCH64/libidn2/usr/lib/libidn2* $DEST
ln -s $AARCH64/libunistring/usr/lib/libunistring* $DEST
ln -s $AARCH64/glib-2.0/usr/lib/libglib-2.0* $DEST
ln -s $AARCH64/glib-2.0/usr/lib/libgio-2.0* $DEST
ln -s $AARCH64/glib-2.0/usr/lib/libgmodule-2.0* $DEST
ln -s $AARCH64/glib-2.0/usr/lib/libgobject-2.0* $DEST
ln -s $AARCH64/glib-2.0/usr/lib/libgthread-2.0* $DEST

ln -s $AARCH64/sqlite3/usr/lib/libsqlite3* $DEST

ln -s $AARCH64/libpcre/usr/lib/libpcre* $DEST
ln -s $AARCH64/util-linux/usr/lib/libmount* $DEST
ln -s $AARCH64/util-linux/usr/lib/libfdisk* $DEST
ln -s $AARCH64/util-linux/usr/lib/libblkid* $DEST

ln -s $AARCH64/nss/usr/lib/libfreebl* $DEST
ln -s $AARCH64/nss/usr/lib/libnss* $DEST
ln -s $AARCH64/nss/usr/lib/libsmime* $DEST
ln -s $AARCH64/nss/usr/lib/libsoftokn* $DEST
ln -s $AARCH64/nss/usr/lib/libssl3* $DEST

ln -s $AARCH64/nspr/usr/lib/libnspr* $DEST
ln -s $AARCH64/nspr/usr/lib/libplc* $DEST
ln -s $AARCH64/nspr/usr/lib/libplds* $DEST

ln -s $AARCH64/systemd/lib/libsystemd* $DEST
ln -s $AARCH64/systemd/lib/libudev* $DEST
ln -s $AARCH64/systemd/lib/libnss* $DEST

ln -s $AARCH64/libarchive/usr/lib/libarchive* $DEST
ln -s $AARCH64/acl/usr/lib/libacl* $DEST
ln -s $AARCH64/lzo/usr/lib/liblzo* $DEST
ln -s $AARCH64/xz/usr/lib/liblzma* $DEST
ln -s $AARCH64/zstd/usr/lib/libzstd* $DEST
ln -s $AARCH64/attr/usr/lib/libattr* $DEST
ln -s $AARCH64/bzip2/usr/lib/libbz2* $DEST

ln -s $AARCH64/fontconfig/usr/lib/libfontconfig* $DEST
ln -s $AARCH64/cups/usr/lib/libcups* $DEST
ln -s $AARCH64/libxrender/usr/lib/libXrender* $DEST
ln -s $AARCH64/expat/usr/lib/libexpat* $DEST
ln -s $AARCH64/libxext/usr/lib/libXext* $DEST
ln -s $AARCH64/libx11/usr/lib/libX11* $DEST
ln -s $AARCH64/libxau/usr/lib/libXau* $DEST
ln -s $AARCH64/libxdmcp/usr/lib/libXdmcp* $DEST
ln -s $AARCH64/libcap/lib/libcap* $DEST
ln -s $AARCH64/dbus/usr/lib/libdbus* $DEST
ln -s $AARCH64/util-linux-libuuid/usr/lib/libuuid* $DEST
ln -s $AARCH64/avahi/usr/lib/libavahi* $DEST
ln -s $AARCH64/readline/usr/lib/libreadline* $DEST
ln -s $AARCH64/ncurses/usr/lib/libtinfo* $DEST
ln -s $AARCH64/ncurses/usr/lib/libncurses* $DEST
ln -s $AARCH64/ncurses/lib/libncurses* $DEST
ln -s $AARCH64/libevent/usr/lib/libevent* $DEST
ln -s $AARCH64/fribidi/usr/lib/libfribidi* $DEST

ln -s $AARCH64/json-c/usr/lib/libjson-c* $DEST
ln -s $AARCH64/libesmtp/usr/lib/libesmtp* $DEST

ln -s $AARCH64MX8M/gstreamer1.0/usr/lib/libgst* $DEST
ln -s $AARCH64MX8M/cairo/usr/lib/libcairo* $DEST
ln -s $AARCH64MX8M/libdrm/usr/lib/libdrm* $DEST
ln -s $AARCH64MX8M/imx-gpu-viv/usr/lib/libEGL* $DEST
ln -s $AARCH64MX8M/imx-gpu-viv/usr/lib/libGLESv2* $DEST
ln -s $AARCH64MX8M/imx-gpu-viv/usr/lib/libGAL* $DEST
ln -s $AARCH64MX8M/imx-gpu-viv/usr/lib/libgbm* $DEST
ln -s $AARCH64MX8M/imx-gpu-viv/usr/lib/libVSC* $DEST
ln -s $AARCH64MX8M/pango/usr/lib/libpango* $DEST
ln -s $AARCH64MX8M/harfbuzz/usr/lib/libharfbuzz* $DEST

ln -s /opt/networkmanager/usr/lib/libnm* $DEST


DESTINC="/opt/arm64include"
rm -f $DESTINC/*

ln -s ${AARCH64}/wayland/usr/include/* $DESTINC
ln -s ${AARCH64}/mariadb/usr/include/mysql/* $DESTINC
ln -s ${AARCH64}/sqlite3/usr/include/* $DESTINC
ln -s ${AARCH64}/curl/usr/include/* $DESTINC
ln -s ${AARCH64}/glib-2.0/usr/lib/glib-2.0/include/* $DESTINC
ln -s ${AARCH64}/util-linux/usr/include/libmount/* $DESTINC
ln -s ${AARCH64}/pixman/usr/include/pixman-1/* $DESTINC
ln -s ${AARCH64}/glib-2.0/usr/include/glib-2.0/* $DESTINC
#"${AARCH64}/glib-2.0/usr/lib/glib-2.0/include/"
# TODO Investigate this further - this seems to cause redundancy but is necessary for now
ln -s ${AARCH64}/freetype/usr/include/* $DESTINC
ln -s ${AARCH64}/freetype/usr/include/freetype2/* $DESTINC
ln -s ${AARCH64}/libpng/usr/include/* $DESTINC
ln -s ${AARCH64}/libjpeg-turbo/usr/include/* $DESTINC
ln -s ${AARCH64}/libxkbcommon/usr/include/* $DESTINC
ln -s ${AARCH64}/dbus/usr/include/dbus-1.0/* $DESTINC
#ln -s ${AARCH64}/dbus/usr/lib/dbus-1.0/include/dbus/dbus-arch-deps.h $DESTINC/dbus
#ln -s ${AARCH64}/dbus/usr/lib/dbus-1.0/* $DESTINC
ln -s ${AARCH64}/bluez5/usr/include/* $DESTINC
ln -s ${AARCH64}/ell/usr/include/* $DESTINC
ln -s ${AARCH64}/readline/usr/include/* $DESTINC

ln -s ${AARCH64}/openssl/usr/include/* $DESTINC

ln -s ${AARCH64}/cups/usr/include/* $DESTINC
ln -s ${AARCH64}/ncurses/usr/include/* $DESTINC
ln -s ${AARCH64}/libevent/usr/include/* $DESTINC
ln -s ${AARCH64}/fontconfig/usr/include/* $DESTINC

ln -s ${AARCH64}/json-c/usr/include/* $DESTINC
ln -s ${AARCH64}/libesmtp/usr/include/* $DESTINC

ln -s ${AARCH64MX8M}/pango/usr/include/pango-1.0/* $DESTINC
ln -s ${AARCH64MX8M}/harfbuzz/usr/include/harfbuzz/* $DESTINC
ln -s ${AARCH64MX8M}/imx-gpu-viv/usr/include/* $DESTINC


ln -s ${AARCH64MX8M}/gstreamer1.0/usr/include/gstreamer-1.0/* $DESTINC
ln -s ${AARCH64MX8M}/cairo/usr/include/cairo/* $DESTINC
ln -s ${AARCH64MX8M}/alsa-lib/usr/include/* $DESTINC

ln -s /opt/networkmanager/usr/include/libnm/* $DESTINC

The json-c and esmtp lines are recent additions (2025-03-06).

Any time changes are made to this from a terminal type:

setup_arm64lib

This will recreate the symbolic links in /opt/arm64include and /opt/arm64lib

MySQL Scripts

The directory /usr/sbin/util is added and some helper scripts are placed there. These scripts help with running 825 Gen2 apps that use MySQL in the simulator.

$ cat /usr/sbin/util/createdb
#!/bin/sh
if [ $# -ne 1 ]; then
  echo "Usage: createdb database"
else
  mysql -e "CREATE DATABASE $1";
fi
$ cat /usr/sbin/util/createdbuser
#!/bin/sh
if [ $# -ne 3 ]; then
  echo "Usage: createdbuser database username password"
else
  mysql -e "CREATE USER '%2'@'localhost' IDENTIFIED BY '$3';"
  mysql -e "GRANT ALL PRIVILEGES ON $1.* TO '$2'@'%' IDENTIFIED BY '$3'"
fi
$ cat /usr/sbin/util/deldbuser
#!/bin/sh
if [ $# -ne 1 ]; then
  echo "Usage: deldbuser username"
else
  mysql -e "DROP USER '%1'@'%';"
fi

Sudoers

Files are added to the VM /etc/sudoers.d directory

$ sudo cat /etc/sudoers.d/sudopath
Defaults secure_path="/usr/sbin/util:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
$ sudo cat /ect/sudoers.d/user

user ALL=NOPASSWD: /usr/bin/timedatectl *, /usr/bin/systemctl *, /usr/sbin/util/createdb *, /usr/sbin/util/createdbuser *, /usr/sbin/util/deldbuser *

This allows the MySQL scripts to run with sudo without prompting for a password. For example

sudo createdb xyz
sudo createdbuser xyz jim 123

This example creates a database named "xyz". A database user "jim" with password "123" is then created with permissions for database "xyz".

Note: See TracWiki for help on using the wiki.