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
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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}=...
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)
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 -...
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]
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 ...
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 ...
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
...
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/...

slm♦
- 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 ...
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 '...
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 ...
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 ...
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 ...
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 ...
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" &...
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 ...
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 ...
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 ...
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)....
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
embedded × 722linux × 273
linux-kernel × 94
u-boot × 55
kernel × 49
arm × 41
busybox × 39
debian × 38
buildroot × 37
filesystems × 36
networking × 35
boot × 30
drivers × 30
usb × 25
yocto × 25
device-tree × 23
systemd × 21
flash-memory × 20
serial-port × 18
boot-loader × 17
cross-compilation × 17
hardware × 16
partition × 15
compiling × 15
sd-card × 15