Installing packages from SD card

I am trying to automate configuration for the Yun since I will be deploying a large number of them with the same setup. I'm attempting to install "kmod-usb-hid" and "coreutils-sha256sum" from the SD card so that our intern won't have to battle network issues installing these packages.

I'm setting up a bash script to access .ipk files stored on the root of a pre-configured SD card.
In order to get the most recent files stored on the SD card, I downloaded them directly and saved them to the root:
http://downloads.arduino.cc/openwrtyun/1/packages/kmod-usb-hid_3.3.8-1_ar71xx.ipk
http://downloads.arduino.cc/openwrtyun/1/packages/kmod-hid_3.3.8-1_ar71xx.ipk
http://downloads.arduino.cc/openwrtyun/1/packages/kmod-input-core_3.3.8-1_ar71xx.ipk
http://downloads.arduino.cc/openwrtyun/1/packages/kmod-input-evdev_3.3.8-1_ar71xx.ipk
http://downloads.arduino.cc/openwrtyun/1/packages/coreutils-sha256sum_8.16-1_ar71xx.ipk
http://downloads.arduino.cc/openwrtyun/1/packages/coreutils_8.16-1_ar71xx.ipk

But when I try to install these individually, it gives me an error "pkg_init_from_file: Failed to extract control file from....... .ipk"

How do I make this work?

Uhm I regularly install packages from local files when I develop/test them and it works fine. Opkg needs a little help in resolving dependencies, so it's better to install them in the right order

Can you paste the complete output?

root@Arduino:~# opkg install /mnt/sda1/Util/kmod-usb-hid_3.3.8-1_ar71xx.ipk
Collected errors:

  • deb_extract: /mnt/sda1/Util/kmod-usb-hid_3.3.8-1_ar71xx.ipk: invalid magic
  • pkg_init_from_file: Failed to extract control file from /mnt/sda1/Util/kmod-usb-hid_3.3.8-1_ar71xx.ipk.
    root@Arduino:~#

invalid magic, looks like the file is broken. have you tried downloading it once more?

downloaded a fresh copy and the same thing happens.
The same thing is happening with the other packages as well, the same error. It seems unlikely that all of them would be corrupt

http://downloads.arduino.cc/openwrtyun/1/packages

<Error>
<Code>AccessDenied</Code>
</Error>

The directory browse is turn off which make download package painful.

Working directory browse example:

http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/

you think that might be the problem? I wouldn't be surprised. I'll try from a recent snapshot and see what happens.

edit: tried from the download link you gave, but that snapshot appears to be from the wrong kernel. I am able to download the files and they don't appear to be corrupt, BUT. They still give an error:

root@Arduino:~# opkg install /mnt/sda1/Util/kmod-input-core_3.10.36-1_ar71xx.ipk
Installing kmod-input-core (3.10.36-1) to root...
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-input-core:
 *      kernel (= 3.10.36-1-9956c8ccf213a466fa9c024a4d968410) *
 * opkg_install_cmd: Cannot install package kmod-input-core.
root@Arduino:~#

@Federico, if you could turn on directory browsing, it might fix the problem. It is possible that is why the files are downloading corrupt.

I'll try downloading from here:
http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/

edit 2: still getting a kernel error

I'll try downloading from here:
Index of /attitude_adjustment/12.09/ar71xx/generic/packages/

Not good idea to mix feed!

@sonnyyu
I thought attitude adjustment was the new distribution being used by Yun.
That was what Federico posted in the announcement anyway:

"We called this image OpenWrt Yún because it’s now based on the stable version of OpenWrt, OpenWrt 12.09 Attitude Adjustment."

http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/ alone is not help you much, what you ask is local/offline package sourcing.

Working example: Working directory browse example:

http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/

yeah. That's what I figured.

The local/offline package sourcing:

wget -r --no-parent http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/

worked

wget -r --no-parent http://downloads.arduino.cc/openwrtyun/1/packages/

failed, since directory browser is off.

scp every files to SD card "/mnt/sda1/packages"

nano /etc/opkg.conf
#src/gz attitude_adjustment http://downloads.arduino.cc/openwrtyun/1/packages
src/gz local file:////mnt/sda1/packages
opkg update

No internet is needed.

Hahaha, I was doing something similar on my end. I found that if I used wget I could get a non-corrupt copy of the .ipk.

so i downloaded the ones I needed directly to the SD card where I wanted them

wget "http://downloads.arduino.cc/openwrtyun/1/packages/kmod-usb-hid_3.3.8-1_ar71xx.ipk"
wget "http://downloads.arduino.cc/openwrtyun/1/packages/kmod-hid_3.3.8-1_ar71xx.ipk"
wget "http://downloads.arduino.cc/openwrtyun/1/packages/kmod-input-core_3.3.8-1_ar71xx.ipk"
wget "http://downloads.arduino.cc/openwrtyun/1/packages/kmod-input-evdev_3.3.8-1_ar71xx.ipk"

I am trying to automate configuration for the Yun since I will be deploying a large number of them with the same setup.

Good job.

The local/offline package sourcing is work around (not Kosher) , since it only take care install packages but not config file and customer files.

http://forum.arduino.cc/index.php?topic=214167.msg1569498#msg1569498

I agree, I would like to see what is happening inside the configuration it does when these are installed through LUCI.
I couldn't tell if it was just the simple installation or if there was something more. But fortunately everything SEEMS to be working so it should be OK for the time being.
I must admit I find it a bit odd that USB HID is not included in the deployment as I imagine connecting, mice and keyboards would be a first step for many people in their sketch.

Thanks a bunch for your help, btw!

Setup local packages repository

http://forum.arduino.cc/index.php?topic=237178.0