{"id":21039,"date":"2017-10-02T15:54:39","date_gmt":"2017-10-02T20:54:39","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=21039"},"modified":"2019-09-04T22:29:42","modified_gmt":"2019-09-05T03:29:42","slug":"using-opkg-with-mlinux","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/mlinux\/mlinux-building-images\/using-opkg-with-mlinux\/","title":{"rendered":"Using OPKG with mLinux"},"content":{"rendered":"<h3>Creating a Package Repository for OPKG<\/h3>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">A simple way to create a package repository is to use the\u00a0mLinux<sup>\u2122\u00a0<\/sup>build tree. To create a repository, place the packages needed into one of the directories under build\/tmp\/deploy\/ipk. Remove any ipk files that are not part of your recipe, and are normally a part of mLinux.<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">In this case we assume our custom recipe created packages in the directory arm926ejste:<\/span><\/p>\n<pre class=\"brush:shell\">$\u00a0cd\u00a0build\/tmp\/deploy\/ipk\/arm926ejste\r\n$\u00a0cp\u00a0my_ipk1.ipk\u00a0my_ipk2.ipk\u00a0~\/save\r\n$\u00a0rm\u00a0*.ipk\r\n$\u00a0cp\u00a0~\/save\/*.ipk\u00a0.\r\n$\u00a0bitbake\u00a0package-index\r\n$\u00a0ls -1\r\nmyipk1_2.9.3-r0.0_arm926ejste.ipk\r\nmyipk2_4.13-r0.0_arm926ejste.ipk\r\nPackages\r\nPackages.gz\r\nPackages.stamps<\/pre>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">The bitbake recipe package-index will create a new package index based on the ipk packages present in the directory.<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">The complete set of files compose the repository, and can be placed on a web server, or in a local directory on the device.<\/span><\/p>\n<h3><span style=\"color: #000000;\">Configuration<\/span><\/h3>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">Files Found in \/etc\/opkg<br \/>\n<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\"> \/etc\/opkg\/mlinux-feed.conf<br \/>\n<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\"> This lists the mlinux feed that is used to find packages. This file will be set to the current level of mLinux. If you wish to update packages because of a problem, you could set this to a newer level. Be aware that Multitech may release incompatible levels in the future. An incorrect upgrade could make your device not able to boot Linux, and you will need to re-flash your device.<br \/>\n<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\"> To use the mlinux-feed.conf file as is, the Conduit<sup>\u00ae\u00a0<\/sup>should be connected to the public internet.<br \/>\n<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\"> If the public internet is not available, the files may be mirrored on a local web server, and the URLs in mLinux.conf should be updated accordingly.<br \/>\n<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\"> \/etc\/opkg\/local.conf<br \/>\n<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\"> A local configuration file. You may create this file if you have your own repository with your own applications. You may add files named *.conf for additional repositories. Repositories may be on local storage. This could include a usb connected drive, or SD card if available (not possible on MTCAP).<br \/>\n<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\"> Example contents of \/etc\/opkd\/local.conf:<br \/>\n<\/span><\/p>\n<pre class=\"brush:shell\">src\/gz\u00a0local\u00a0file:\/\/\/var\/volatile\/myrepo<\/pre>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\"> Any repository placed in \/var\/volatile will be deleted on a reboot or power outage.<br \/>\n<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\"> Contents of the repository:<br \/>\n<\/span><\/p>\n<pre class=\"brush:shell\">$\u00a0ls\u00a0\/var\/volatile\/myrepo\r\nmyipk1_2.9.3-r0.0_arm926ejste.ipk\r\nmyipk2_4.13-r0.0_arm926ejste.ipk\r\nPackages\r\nPackages.gz\r\nPackages.stamps<\/pre>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\"><br \/>\n<\/span><\/p>\n<h3><span style=\"color: #000000;\">OPKG Cache<\/span><\/h3>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">Found in \/var\/lib\/opkg. These should not be modified.<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">The package lists with checksums are here:<\/span><\/p>\n<pre class=\"brush:shell\">local\r\nmlinux-arm926ejste\r\nmlinux-mtcap\r\nmlinux-all<\/pre>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">These are package lists from the repositories.<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">There is also an info directory with configuration files from each package, package install, and package removal instructions.<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">The lists directory has descriptions of packages.<\/span><\/p>\n<h3><span style=\"color: #000000;\">Enabling the package repositories<\/span><\/h3>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">After making the files available on the Conduit, either through a web server, or in a local directory, issue the package update command on the device:<\/span><\/p>\n<pre class=\"brush:shell\">$\u00a0opkg\u00a0update\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.9\/all\/Packages.gz.\r\nInflating\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.9\/all\/Packages.gz.\r\nUpdated\u00a0list\u00a0of\u00a0available\u00a0packages\u00a0in\u00a0\/var\/lib\/opkg\/mlinux-all.\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.9\/arm926ejste\/Packages.gz.\r\nInflating\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.9\/arm926ejste\/Packages.gz.\r\nUpdated\u00a0list\u00a0of\u00a0available\u00a0packages\u00a0in\u00a0\/var\/lib\/opkg\/mlinux-arm926ejste.\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.9\/mtcap\/Packages.gz.\r\nInflating\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.9\/mtcap\/Packages.gz.\r\nUpdated\u00a0list\u00a0of\u00a0available\u00a0packages\u00a0in\u00a0\/var\/lib\/opkg\/mlinux-mtcap.\r\nDownloading\u00a0file:\/\/\/var\/volatile\/myrepo\/Packages.gz.\r\nInflating\u00a0file:\/\/\/var\/volatile\/myrepo\/Packages.gz.\r\nUpdated\u00a0list\u00a0of\u00a0available\u00a0packages\u00a0in\u00a0\/var\/lib\/opkg\/local.<\/pre>\n<h3><span style=\"color: #000000;\">Package Revision Level Concerns and Checksums<\/span><\/h3>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">After you issue the package update command, bear in mind that the checksums in the package lists will be applied to all packages of the same name. This includes ipk packages that are not installed as part of the repositories.<\/span><\/p>\n<p><span style=\"color: #000000;\">If you need to make changes to a recipe that creates a package that is normally part of a repository, you should update the revision level of the package, so that opkg will use the latest revision, and not use the checksum from the older revision of the file which will cause your package to not install. The revision level of a package is set by the PR variable in a bitbake recipe.<\/span><\/p>\n<p><span style=\"color: #000000;\">If you intend on using a package that is already in a repository, you should not create your own of the same name. You should either install it from the repository, or copy the file from the repository to the device if you do not wish to install from the repository.<\/span><\/p>\n<p><span style=\"color: #000000;\">Do not use your own\u00a0mLinux build tree to create a new functionally identical package and attempt to install it. The file named Packages in each repository lists the package names from the repository. You can also browse the mLinux packages in the file \/etc\/opkg\/mlinux-feed.conf by using the URL in a browser:<\/span><\/p>\n<p><span style=\"color: #000000;\">http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste<\/span><\/p>\n<h3><span style=\"color: #000000;\">Upgrading packages<\/span><\/h3>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">If you are able to do the opkg update command you should be able to list the upgradable packages that are currently installed:<\/span><\/p>\n<pre class=\"brush:shell\">#\u00a0opkg\u00a0list-upgradable\r\nlibmts-io0\u00a0 -\u00a0\u00a00.6 - r0.0\u00a0 -\u00a0 1.0.1 - r0.0\r\nlora-network-server\u00a0 -\u00a0 1.0.36-r1.0\u00a0 \u00a0-\u00a0 1.0.40-r1.0\r\nradio-cmd\u00a0 -\u00a0 0.3-r0.0\u00a0 -\u00a0 0.4-r0.0\r\nmts-io\u00a0 -\u00a0 1.5.13-r9.0.0\u00a0 -\u00a0 1.5.16-r9.0.0\r\nsms-utils\u00a0-1.0.2-r0.0\u00a0 -\u00a0 1.0.4-r0.0\r\nppp\u00a0 -\u00a0 2.4.7-r8.1\u00a0 -\u00a0\u00a02.4.7-r9.0\r\nmlinux-scripts\u00a01.0-r5.0\u00a0 -\u00a01.1-r2.0\r\nradio-query\u00a00.2-r0.0\u00a0 -\u00a0 0.4-r0.0\r\nmlinux-version\u00a0- 1:3.3.9_0947d212fc4c10871c66b4d83c97c5634dc1b8c7-r2.0\u00a0\u00a0-\u00a0 1:3.3.12_110a59d3c27c7b5923b32c6430e681059128a26e-r2.0\r\nmts-id-eeprom\u00a0 -\u00a00.2.10-r0.0.1\u00a0- 0.3.3-r0.0.0<\/pre>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">To perform the upgrade you may either select individual packages or install all the upgrades:<\/span><\/p>\n<pre class=\"brush:shell\">#\u00a0opkg\u00a0upgrade\r\nUpgrading\u00a0libmts-io0\u00a0on\u00a0root\u00a0from\u00a00.6-r0.0\u00a0to\u00a01.0.1-r0.0...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/libmts-io0_1.0.1-r0.0_arm926ejste.ipk.\r\nUpgrading\u00a0radio-cmd\u00a0on\u00a0root\u00a0from\u00a00.3-r0.0\u00a0to\u00a00.4-r0.0...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/radio-cmd_0.4-r0.0_arm926ejste.ipk.\r\nUpgrading\u00a0mts-io\u00a0on\u00a0root\u00a0from\u00a01.5.13-r9.0.0\u00a0to\u00a01.5.16-r9.0.0...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/mtcap\/mts-io_1.5.16-r9.0.0_mtcap.ipk.\r\nUnloading\u00a0mts-io\u00a0module\r\n[INFO]\u00a0mts-io:cleanup:967:\u00a0 cleaning\u00a0up....\r\n[INFO]\u00a0mts-io:mts_io_exit:1050:\u00a0exiting\r\nupdate-rc.d:\u00a0\/etc\/init.d\/mts-io\u00a0exists\u00a0during\u00a0rc.d\u00a0purge\u00a0(continuing)\r\nRemoving\u00a0any\u00a0system\u00a0startup\u00a0links\u00a0for\u00a0mts-io\u00a0...\r\n\/etc\/rcS.d\/S39mts-io\r\nUpgrading\u00a0sms-utils\u00a0on\u00a0root\u00a0from\u00a01.0.2-r0.0\u00a0to\u00a01.0.4-r0.0...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/sms-utils_1.0.4-r0.0_arm926ejste.ipk.\r\nUpgrading\u00a0ppp\u00a0on\u00a0root\u00a0from\u00a02.4.7-r8.1\u00a0to\u00a02.4.7-r9.0...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/ppp_2.4.7-r9.0_arm926ejste.ipk.\r\nUpgrading\u00a0mlinux-scripts\u00a0on\u00a0root\u00a0from\u00a01.0-r5.0\u00a0to\u00a01.1-r2.0...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/mlinux-scripts_1.1-r2.0_arm926ejste.ipk.\r\nUpgrading\u00a0radio-query\u00a0on\u00a0root\u00a0from\u00a00.2-r0.0\u00a0to\u00a00.4-r0.0...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/radio-query_0.4-r0.0_arm926ejste.ipk.\r\nUpgrading\u00a0mlinux-version\u00a0on\u00a0root\u00a0from\r\n1:3.3.9_0947d212fc4c10871c66b4d83c97c5634dc1b8c7-r2.0\u00a0to\r\n1:3.3.12_110a59d3c27c7b5923b32c6430e681059128a26e-r2.0...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/mtcap\/mlinux-version_3.3.12_110a59d3c27c7b5923b32c6430e681059128a26e-r2.0_mtcap.ipk.\r\nUpgrading\u00a0mts-id-eeprom\u00a0on\u00a0root\u00a0from\u00a00.2.10-r0.0.1\u00a0to\u00a00.3.3-r0.0.0...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/mtcap\/mtsideeprom_0.3.3-r0.0.0_mtcap.ipk.\r\nConfiguring\u00a0libmts-io0.\r\n\u2026<\/pre>\n<h3><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\">Installing a Package<\/span><\/h3>\n<p><span style=\"font-family: arial, helvetica, sans-serif; color: #000000;\"> When installing a package, the opkg package manager will determine the dependencies. If the device is connected to the repository, these dependencies will be installed automatically. In this example, an install of gpsd brings in all of its dependencies:<br \/>\n<\/span><\/p>\n<pre class=\"brush:shell\">$\u00a0opkg\u00a0install\u00a0gpsd\r\nInstalling\u00a0gpsd\u00a0(3.16-m3.0) to\u00a0root...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/gpsd_3.16-m3.0_arm926ejste.ipk.\r\ngpsd:\u00a0unsatisfied\u00a0recommendation\u00a0for\u00a0gpsd-machine-conf\r\nInstalling\u00a0bluez4\u00a0(4.101-r10.0) to\u00a0root...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/bluez4_4.101-r10.0_arm926ejste.ipk.\r\nInstalling\u00a0libudev0\u00a0(182-r7.mlinux2.0)\u00a0to\u00a0root...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/mtcap\/libudev0_182-r7.mlinux2.0_mtcap.ipk.\r\nInstalling\u00a0libglib-2.0-0\u00a0(1:2.38.2-r0.0) to\u00a0root...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/libglib-2.0-0_2.38.2-r0.0_arm926ejste.ipk.\r\nInstalling\u00a0libffi6\u00a0(3.0.13-r0.0) to\u00a0root...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/libffi6_3.0.13-r0.0_arm926ejste.ipk.\r\nInstalling\u00a0libusb-0.14\u00a0(1:0.1.5-r0.0) to\u00a0root...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/libusb-0.14_0.1.5-r0.0_arm926ejste.ipk.\r\nInstalling\u00a0gpsd-gpsctl\u00a0(3.16-m3.0) to\u00a0root...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/gpsd-gpsctl_3.16-m3.0_arm926ejste.ipk.\r\nInstalling\u00a0gpsd-conf\u00a0(3.16-m3.0) to\u00a0root...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/gpsd-conf_3.16-m3.0_arm926ejste.ipk.\r\nInstalling\u00a0gpsd-udev\u00a0(3.16-m3.0) to\u00a0root...\r\nDownloading\u00a0http:\/\/multitech.net\/mlinux\/feeds\/3.3.12\/arm926ejste\/gpsd-udev_3.16-m3.0_arm926ejste.ipk.\r\nupdate-rc.d:\u00a0\/etc\/init.d\/gpsd\u00a0exists\u00a0during\u00a0rc.d\u00a0purge\u00a0(continuing)\r\nRemoving\u00a0any\u00a0system\u00a0startup\u00a0links\u00a0for\u00a0gpsd\u00a0...\r\nConfiguring\u00a0libusb-0.1-4.\r\nConfiguring\u00a0libffi6.\r\nConfiguring\u00a0gpsd-conf.\r\nupdate-alternatives:\r\nLinking\u00a0\/\/etc\/default\/gpsd\u00a0to\u00a0\/etc\/default\/gpsd.default\r\nConfiguring\u00a0libudev0.\r\nConfiguring\u00a0libglib-2.0-0.\r\nConfiguring\u00a0bluez4.\r\nConfiguring\u00a0gpsd-gpsctl.\r\nConfiguring\u00a0gpsd-udev.\r\nConfiguring\u00a0gpsd.\r\nAdding\u00a0system\u00a0startup\u00a0for\u00a0\/etc\/init.d\/gpsd.\r\n$<\/pre>\n<h3><span style=\"color: #000000;\">More Information<\/span><\/h3>\n<p><span style=\"color: #000000;\">For more information on OPKG:<\/span><\/p>\n<p><a href=\"https:\/\/wiki.openwrt.org\/doc\/techref\/opkg\">https:\/\/wiki.openwrt.org\/doc\/techref\/opkg<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a Package Repository for OPKG A simple way to create a package repository is to use the\u00a0mLinux\u2122\u00a0build tree. To create a repository, place the packages needed into one of the directories under build\/tmp\/deploy\/ipk. Remove any ipk files that are not part of your recipe, and are normally a part of mLinux. In this case [&hellip;]<\/p>\n","protected":false},"author":1478,"featured_media":0,"parent":9195,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-21039","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/21039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/users\/1478"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=21039"}],"version-history":[{"count":18,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/21039\/revisions"}],"predecessor-version":[{"id":21054,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/21039\/revisions\/21054"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/9195"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=21039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}