Adding drivers to already built CE 6.0 image - windows-ce

Is this possible? I am using a CE image from a manufacturer that won't release a custom image with an extra driver I need.
Give me some good news!

Yes, there is a possibility that you can add your driver over an existing image. You just need to place your driver dll(s) in the required folder (generally Windows folder) in your device where you want it to be and make some registry entries for it. If you already have a .reg file for the driver then you just need to import it on your device.
You can also make a CAB file to avoid the manual work.

It depends. You need to have permanent registry and storage. If you have, then you can configure registry entries to load your driver (at boot or when is detected by USB, SD, PCI etc.) and store it on the device. In some cases drivers are loaded from the image before any storage is mounted and this may prevent you from being able to load your driver at boot (or having your device detected if it's plugged in at boot).

Related

How do I run a Docker container on a USB drive?

Suppose we have the Linux OS installed on two identical machines that supports the version of latest Docker. Then suppose we build a container image based on this OS. We can assume this image will now run on either machine. We now put this image onto a USB drive and plug it in the other identical machine.
Now, the hard part... is it possible, using that image on the USB drive to run the container on the same USB drive itself while plugged into the machine?
I'm trying to save and/or minimize memory used by the host OS by utilizing the memory on the USB drive as much as possible.
If this is possible, how would I go about setting up a demo case?
I see this question as "how do I persist Docker data on a USB device?".
On your machines, you need to mount your USB device into /var/docker. And then restart your Docker service.
However, with this solution, when you unplug the USB device, all of the containers have to be stopped. Otherwise, data will be lost.

How does embedded linux detect file is modified through usb gadget & update files

I have an embedded linux device running a USB gadget kernel module to make the mmc available to the host PC(such as Windows or Linux).
When I update the file in mmc, it won't sync with host PC unless I rmmod and insmod again. Is there any better way to update new files? And how can I detect a file is modified by host PC? I'm using C programming on my linux device.
Thanks.
(1) There really isn't a better way to update new files. You need to take turns and only access the mmc from Linux or Windows, one at a time.
(2) You can't easily do that.
When you say "When I update the file in mmc", I assume that you have the mmc mounted in the linux device, and are updating files from linux at the same time that Windows has mounted the device. I don't think this is advisable. The host (Windows) may cache file and/or directory information from the mmc, and if the embedded Linux changes that information unexpectedly, it may produce errors from the Windows FS, and could corrupt the mmc.
If you want to share files between the embedded Linux and host Windows, and be able to modify them from either OS without taking turns, an alternative solution would be to use the network device gadget and run Samba file sharing on the embedded Linux side to export the filesystem where the mmc is mounted on the Linux side.

Where is g_multi configured in BeagleBone Black?

With the default Debian installation in a BeableBone Black you can access it via USB as different devices: mass storage device, virtual ethernet and virtual serial uart. This is accomplished with the g_multi module. You can review its configuration via files in /sys/module/g_multi/parameters/ .
I am trying to use it only as a mass storage device but with other disk/block device, not the second partition in the boot block device. I have checked that it is always the same partition not matter if it is /dev/mmcblk1p2 (when I have a microSD inserted on boot) or /dev/mmcblk0p2 (without it). I have tried removing g_multi after boot and modprobing g_multi or g_mass_storage with my own configuration, and it works OK.
But I don't want the default configuration to load on startup, so I need g_multi to not load at all, or to load with my own parameters.
I search for its configuration in every place I could think of: configuration for modules in /etc, configuration for systemd, parameters of uboot for kernel, decompiling dtbs, and even with a compiled kernel I searched for the manufacturer that the startup g_multi shows in its /sys/module/g_multi/parameters/iManufacturer in all the files.
I am not able to find anything. Could someone help me?
Thank you very much in advance.
I have finally found it. It is a bit hidden (in a Debian perspective).
It is configured in the /opt/scripts/boot/am335x_evm.sh script.
I had forgotten all those scripts and utilities for the Beagle platforms. I had to follow the major part of the boot proccess.

U-Boot script for choosing the most recent image

I have a u-boot which copies a multiimage (Linux kernel+rootfs+dts) from a serial FLASH to the DDR. The device is remotely powered. The device requires fail safe remote firmware upgrade which survives power failure. I always keep two images on the FLASH. While I write a new firmware to the FLASH there is always another, older, firmware image on the FLASH. U-boot after power up shall boot the most recent firmware.
Boot time is important, but not critical. For example, I thought to let u-boot to boot the first "valid" image. A Linux application would decide if a reboot is required and modify u-boot environment.
I can patch u-boot - add a command which finds the most recent firmware on the FLASH. I would expect that somebody somewhere already solved this problem and likely better than me. Is there a patch/script for u-boot which allows to automatically choose the latest firmware based on some metadata?
Any other approaches to the problem?
Yes.
Use Uboot's bootcount feature.
It increments every boot retry. and is supposed to be cleared by an application on the filesystem after the kernel was booted.
If it reached a a threshold. you can then boot another image from uboot.

Automatically enabling all ethernet, ATA, SATA, and SCSI drivers in the Linux .config file

I am compiling my own Linux kernel and userland tools for a PXE environment meant for cloning and reimaging. Right now, I'm sticking to a specific kernel version and using preconfigured .config's for building the Linux kernel.
I need to change from using preconfigured .config's to automatically generating the default configuration for the specified architecture, and then enabling all ethernet, ATA, SATA, and SCSI drivers.
The reason I want to do this is:
Updating the kernel means updating the preconfigured .config's, which takes too much time to manually do. The way I'm doing it now is using menuconfig, enabling the options I need, and saving the resulting .config to my repository.
I know the kernel I'm building is missing some drivers because I've encountered some PC's that were not able to mount the NFS share because Linux could not find an ethernet device (which I've verified by booting an Ubuntu CD, which did find the ethernet device). I want an automated way of building any Linux kernel version that will guarantee that ALL drivers I need are pulled in.
Using a distribution's configuration pulls in too many unnecessary drivers and features for my purposes. It lengthens the kernel build time from 10-15 mintues to an hour or more, and the resulting image is too big.
Does anyone know how to write a Bash script to accomplish this?
Have you considered using a text editor to modify the .config file.
Then you can modify it using search and replace.
Plus, there are other choices for configuring the kernel than the menu-driven "menuconfig".

Resources