45 votes

How to list the kernel Device Tree

If dtc is available on your platform (else, install the device-tree-compiler package), you can use: dtc -I fs /sys/firmware/devicetree/base
user avatar
39 votes
Accepted

What are the minimum root filesystem applications that are required to fully boot linux?

That entirely depends on what services you want to have on your device. Programs You can make Linux boot directly into a shell. It isn't very useful in production — who'd just want to have a shell ...
user avatar
33 votes
Accepted

Mount zip file as a read-only filesystem

fuse-zip is an option and claims to be faster than the competition. # fuse-zip -r archivetest.zip /mnt archivemount is another: # archivemount -o readonly archivetest.zip /mnt Both will probably ...
user avatar
  • 31.7k
27 votes
Accepted

Why do embedded systems need device tree while pcs don't?

Peripherals are connected to the main processor via a bus. Some bus protocols support enumeration (also called discovery), i.e. the main processor can ask “what devices are connected to this bus?” and ...
user avatar
22 votes
Accepted

Corruption-proof SD card filesystem for embedded Linux?

The best resistance against corruption on a single SD card would be offered by BTRFS in RAID1 mode with automatic scrub run every predefined period of time. The benefits: retaining ability to RW to ...
user avatar
  • 510
22 votes

Why do embedded systems need device tree while pcs don't?

PCs actually do need a device tree. They just call it something else. It is not correct to say that operating systems for the descendents of PC/AT compatibles assume the existence of things such as ...
user avatar
  • 62k
20 votes
Accepted

How to list the kernel Device Tree

The device tree is exposed as a hierarchy of directories and files in /proc. You can cat the files, eg: find /proc/device-tree/ -type f -exec head {} + | less Beware, most file content ends with a ...
user avatar
  • 45k
20 votes
Accepted

Make readonly /etc writeable

squashfs is a read-only compressed file system. It has no provision to make modification to it once it's been created. So you couldn't write to it even if the underlying block device could be made ...
user avatar
19 votes

Attaching USB-Serial device with custom PID to ttyUSB0 on embedded

You don't need to modify the kernel, you can automate the process like this: Add the following single line to /etc/udev/rules.d/99-ftdi.rules ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=...
user avatar
  • 191
17 votes

using cross-compiled Valgrind

Run this command in your target device export VALGRIND_LIB=~/valgrind/lib/valgrind/ where ./valgrind is installed directory path (given in ./configure)
user avatar
  • 171
16 votes

How to extract files from uImage?

U-Boot brings its own dumpimage tool (find it in the tools directory of your U-Boot tree) Of course it works with simple images, but it also supports the old-style multi images $ ~2/tools/dumpimage -...
user avatar
15 votes

Shell command to read device registers?

If you know the physical address of the device, you can use devmem2. devmem2 <physical address> <size (b/h/w)> [value]
user avatar
  • 151
13 votes

Defragging RAM / OOM failure

On your question 2 (defragmenting memory), quoting from https://www.kernel.org/doc/Documentation/sysctl/vm.txt : compact_memory Available only when CONFIG_COMPACTION is set. When 1 is written ...
user avatar
13 votes

Meaning of ?= and ??= in bitbake/yocto

As per this section of Bitbake manual ?= is: You can use the "?=" operator to achieve a "softer" assignment for a variable. This type of assignment allows you to define a variable if it is ...
user avatar
13 votes

Converting from binary to hex and back

Here's what I came up with (based on several online sources and some experimentation). Converting from hex to bin (hex2bin): #!/bin/sh sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' "$1" | xargs printf ...
user avatar
  • 8,837
10 votes
Accepted

Can I achieve functionality similar to interrupts in Linux userspace?

If I understand your question this articled sounds like what you're looking for. The article is titled: Device drivers in user space. excerpt UIO drivers Linux provides a standard UIO (User I/...
user avatar
  • 344k
9 votes
Accepted

Booting using initramfs instead of uramdisk

I think you should convert it to u-boot file like this and give it a try: mkimage -n 'Ramdisk Image' -A arm -O linux -T ramdisk -C gzip -d initramfs.cpio.gz initramfs.uImage This might be a valid ...
user avatar
  • 1,622
9 votes

Corruption-proof SD card filesystem for embedded Linux?

Well flash storage is more desirable than magnetic storage, for multiple reasons, but for this application I'll say mainly because there is no moving parts. That being said, I don't think there is a '...
user avatar
8 votes

Mount zip file as a read-only filesystem

You can use fuse-zip to mount zip as read only. 1 -- Install fuse-zip on your system. UBUNTU sudo apt-get install fuse-zip CENTOS/REDHAT/FEDORA yum install fuse-zip 2 -- Run below command to ...
user avatar
8 votes

What is the complementary command to 'rx' for xmodem transfer?

Wow, that has to be the first time this century that I've heard rx referred to as a "great little utility"! :-) Yet we can still dust the cobwebs off those old commands. XMODEM: rx for receiving, sx ...
user avatar
  • 40.9k
8 votes
Accepted

Remove SOME advertised link modes with ethtool

The thing with autonegotiation is that if you turn it off from one end, the other side can detect the speed but not the duplex mode, which defaults to half. Then you get a duplex mismatch, which is ...
user avatar
  • 115k
8 votes
Accepted

Reduce Boot time

The arch linux documentation Improving performance/Boot process may help you to learn how to improve the boot performance. Use systemd-analyze blame to check the timing for the enabled services, or ...
user avatar
  • 57.5k
7 votes

How can one force a re-scan of an SDIO bus from Linux user space?

As mentioned by 0andriy, you can use bind/unbind. I am doing something similar but this will be different as it depends on the hardware. To unbind my sdio wifi module I use: echo -n "2190000.usdhc" &...
user avatar
  • 171
7 votes

Corruption-proof SD card filesystem for embedded Linux?

Well, the problem you're having here is that using a "modern" filesystem such as the ext* is likely to wear your SD Card down ; from my experience that happens within a year, or the next ...
user avatar
  • 268
6 votes

What are the minimum root filesystem applications that are required to fully boot linux?

All you need is one statically linked executable, placed on the filesystem, in isolation. You do not need any other files. That executable is the init process. It can be busybox. That gives you a ...
user avatar
6 votes
Accepted

How to know free disk size witout df command?

The information that df produces comes from the statvfs() system call. If your embedded system does not have the df command installed, perhaps it has one of the common scripting languages, using which ...
user avatar
  • 40.9k
6 votes

How do I create small disk image with large partitions

The easiest way to do this is to create your backing file as a sparse file; that is, make it 1GB with truncate -s 1G disk.img instead of dd if=/dev/zero bs=1048576 count=1024 of=disk.img (or whatever)....
user avatar
  • 102k
6 votes
Accepted

Encrypt files (private key, etc.) in an embedded system

If your hardware is not physically secure, nothing you do in software will give you physical security. Don't bother encrypting unless you have a separate, secure location for the key. Full disk ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible