BusyBox combines tiny versions of many common UNIX utilities into a single small executable.

learn more… | top users | synonyms

7
votes
4answers
2k views

How does one atomically change a symlink to a directory in busybox?

I am trying to (as close as possibly) atomically change a symlink. I've tried: ln -sf other_dir existing_symlink That just put the new symlink in the directory that existing_symlink pointed to. ln ...
7
votes
3answers
400 views

Generate new name for moved file to prevent overwriting?

How can I generate a new name for a file if there's an existing file With that same name? In a Desktop environment a new name is generated my appending a number to the end of the file name, but how ...
6
votes
3answers
3k views

How to generate initramfs image with busybox links?

Having been directed to initramfs by an answer to my earlier question (thanks!), I've been working on getting initramfs working. I can now boot the kernel and drop to a shell prompt, where I can ...
6
votes
3answers
2k views

Wake-on-LAN with BusyBox?

Is it possible to implement the wake-on-lan magic packet in bash? I'm using a old, customized BusyBox and don't have ether-wake. Is it possible to replace it with some other shell command, like: ...
6
votes
2answers
577 views

How to develop a small linux distro?

Since Linux uses open-source packages, I was wondering if I could develop my own Linux distro by compiling these packages. I tried to read the Linux From Scratch book but it's quite big and uses lots ...
6
votes
3answers
6k views

How do I check busybox version (from busybox)?

I'm using busybox in a embedded system, and I would like to check its version. How do I check the busybox version from within busybox?
5
votes
1answer
833 views

Search for a string in files recursively in BusyBox 1.0? [duplicate]

Possible Duplicate: How to grep a text recursively on BusyBox 1.0? How can I search for a string in a file recursively in BusyBox 1.0 if find and grep are not available ? (I want to telnet ...
5
votes
2answers
360 views

Which sed version is not GNU sed 4.0?

I'm trying to figure out which version of sed that I've got on BusyBox 1.18.3. The --version output is cryptic. $ sed --version This is not GNU sed version 4.0 The following code is from the ...
5
votes
1answer
177 views

Using OGG/Vorbis, is there a way to continue to record to an existing audio file?

I am using Vorbis/ogg to record audio (using arecord and then pipping to oggenc). I have downloaded oggvideotools, which gave me oggCat, which will let me join two previously recorded audio files into ...
4
votes
2answers
6k views

Trouble getting busybox switch_root to work

I'm working on an embedded ARM Linux system that boots using initramfs. (Here's some background from a couple earlier questions, if you're interested.) So far, thanks in part to help received here, I ...
4
votes
1answer
779 views

updating `/etc/resolv.conf` on a read only filesystem

I currently have a busybox based embedded linux system. The filesystem is a readonly mounted jffs2 filesystem. One problem I've run into is that /etc/resolv.conf can't be updated by DHCP. Is it ...
4
votes
1answer
268 views

inittab '-' character in process field

I have a an inittab file with the following entry: console::askfirst:-/bin/ash According to this Man page a '+' character in the process field means init will not do utmp and wtmp accounting ...
4
votes
3answers
4k views

when does the system send a SIGTERM to a process?

My server program received a SIGTERM and stopped (with exit code 0). I am surprised by this, as I am pretty sure that there was plenty of memory for it. Under what conditions does linux (busybox) send ...
3
votes
5answers
3k views

Trying to set date on a Linux based machine from another machine

I am running busy box on an embedded platform. I would like to set the date on the box properly each time I reboot the hardware. I have no way to save the time persistently, so am reduced to setting ...
3
votes
2answers
1k views

How to get 3 minutes future date?

I want to get the date 3 minutes on the future. For example, if "now" is 01-Jan-70 00:00:00 GMT I want to get 01-Jan-80 00:03:00 GMT How should I do it? I'm working with busybox linux.
3
votes
3answers
325 views

How to remove a trailing CRLF from a file?

I have a binary file with a trailing CRLF (2 bytes total) that I want to remove. How should I do it? Please note that I'm using busybox and I don't have perl.
3
votes
1answer
206 views

ls pagination on MontaVista with BusyBox

I'm logged into an IP Phone running MontaVista with a very stripped down BusyBox binary (by stripped down, I mean the OEM has removed almost all of its functionality, except the basics like cat, ls ...
3
votes
1answer
408 views

Need to improve urlencode function

I need a way to URL encode strings with a shell script on a OpenWRT device running old version of busybox. Right now I ended up with the following code: urlencode() { echo "$@" | awk -v ORS="" '{ ...
3
votes
2answers
304 views

shell howto: save multiple binary data files (jpg) to one file with some additional data and separate again

I have a system with restricted calculational power (fritzbox) and functions (busybox) and an webcam, able to deliver JPG files. Now I'm looking for for a method (based on shell script) to download ...
3
votes
1answer
1k views

What are special prompt symbols for busybox's sh support?

I want to setup a time prompt on PS1. But, there is no document about what are symbols the busybox support. Is there any one know? Here are all which I knew. PS1='\u@\h: \w \$'
3
votes
2answers
445 views

How can I get the GNU screen command to automatically start with every BusyBox ash session?

On an embedded device with BusyBox installed I want to set it up so that the gnu screen command is automatically started when any BusyBox session is started. I have seen that I can add the screen ...
3
votes
1answer
921 views

How to enter into BusyBox when booting?

I have occasionally installed cloud-init package in Ubuntu, which blocks me from booting. Neither recovery mode works. Because cloud-init installed some upstart job configuration. So I want to enter ...
3
votes
1answer
3k views

Create and control start up scripts in BusyBox

I have compiled a custom linux kernel in BusyBox. BusyBox init does not support runlevels. When the kernel boots up in BusyBox, it first executes init which looks for the specified runlevel in ...
3
votes
1answer
279 views

Busybox NAS appliance

I have a NAS appliance that crashed last weekend. The IT guys apparently / maybe didn't recover it in the right way? There's about 50,000 directories in a "lost+found" directory each with a numeric ...
2
votes
5answers
5k views

Bash iterate over a list of strings

I have this bash script: for opt in string1 string2 string3 ... string99 do somestuff It works, but I would like to replace the explicit listing of my strings with a file which actually contains ...
2
votes
2answers
2k views

Sorting by date

Original: Jan 23 2011 10:42 SOMETHING 2007.12.20.avi Jun 26 2009 SOMETHING 2009.06.25.avi Feb 12 2010 SOMETHING 2010.02.11.avi Jan 29 2011 09:17 SOMETHING 2011.01.27.avi Feb 11 2011 20:06 SOMETHING ...
2
votes
2answers
417 views

No /proc in a Busybox-based embedded Linux distribution

I am making an embedded Linux distribution and my board is a Raspberry Pi. My kernel version is 3.2.27 without initramfs and my root file system as follows: /lib /* contains ...
2
votes
1answer
327 views

Chaining commands within `watch`

Ok, this is driving me a bit nuts. I'm trying to watch the number of files in a set of subdirectories. find . | wc -l correctly returns the number of sub-folders and files. However, watch 'find . | ...
2
votes
2answers
582 views

Remove 50GB oldest files in busybox when used capacity reaches 95%

Ok i have requested a code here but initial i didn't ask to make it busybox compatible. My bad. I'm new to linux and coding. The code needs to do the following: Delete 50GB of oldest data (dir ...
2
votes
2answers
290 views

non-case-sensitive sed - OpenWrt

the input would be like this in a file: <sCripT and the parsing looks like this: sed -i "s/<script//g" SOMETHING.html the "/gi" is not good, because OpenWrt doesn't knows it (busybox..): ...
2
votes
1answer
311 views

How to custom build debian's busybox?

I'm building an embedded system based on debian 7, and I'd like to make the most out of busybox that comes with debian. The problem is default busybox build in debian seems quite minimal, for example ...
2
votes
3answers
317 views

clone root directory tree using busybox

I have an TI DaVinci-based (ARM architecture kin to OMAP) system which netboots using TFTP and NFS-mounted root filesystem, and am trying to make it boot standalone without a netboot server. The ...
2
votes
1answer
73 views

How can I find the Secure Attention Key (SAK) on my system and can I disable it?

In answer to My process was killed but I cannot understand the kernel notice, I was pointed to some documentation on the Secure Attention Key (SAK) on Linux. I have a embedded system generated using ...
2
votes
2answers
96 views

How to have a chroot system mount shared with its host?

Say I chrooted into ~/myroot with its /mnt being bind-mounted from the host's /mnt. Now (from within the chroot environment) I want to e.g. mount /dev/something /mnt/something such that not only the ...
2
votes
1answer
219 views

Can I bypass crontab command by putting the file?

I need to create and put my cron file with cat cronfile1 cronfile2 > cronfile crontab cronfile -u myuser This works for me, but I want to know if I can do directly cat cronfile1 cronfile2 > ...
2
votes
1answer
72 views

Find the PID's of all threads of a process without ps or pidof

So the system I'm working on (BusyBox) has a ps that takes no command line arguments and pidof returns nothing even though it exists within /sbin and points to killall5. Another issue I had is that ...
2
votes
1answer
478 views

Unable to use busybox implementation of hwclock

I have a buildroot generated kernel (3.6.11) and root file system running on an x86 device. It uses busybox and I am trying to set the BIOS hardware clock using hwclock. I get this error whenever I ...
2
votes
1answer
1k views

Linux 2.6.32, busybox, Identify physical SD device

I have a USB card reader with two SD card interfaces and two USB ports (so it can also act as a USB hub) all on the same device. I am running an embedded Linux device that is unsupervised in its use ...
2
votes
1answer
33 views

udev triggers rule but script fails to execute properly

I am trying to automate a quick and dirty backup of a headless system. (I feel it is relevant to note that I am running Busybox utilities so this is the mount tool I have at my disposal) I have made a ...
2
votes
0answers
79 views

Number comparisons in BusyBox ash

I have the following script that extracts data from the EXIF command on my BusyBox ash-based system. I parse the date tag from the end of the file and use case as a final check to ensure the format ...
2
votes
2answers
354 views

busybox initramfs loop mount

I'm trying to loop mount my root filesystem (a loop file) within a busybox initramfs. I try to run the command: mount /rootfs.raw /root ... which works on my Ubuntu laptop, however, I simply get ...
2
votes
0answers
236 views

System cannot boot, continiously scanning btrfs filesystem

On the previous boot I installed HAL to make amazon prime video streaming work, which it did (mostly), but after reboot the system could not pull itself up all the way to BASH and drops to a failed ...
2
votes
0answers
101 views

Busybox exits instantly printing 'SIGUSR1'

I was tinkering with my router these days. It runs on MIPS core and the OS is based on Linux. But the builtin busybox is very limited. I managed to export a binary of busybox compiled for MIPS through ...
1
vote
3answers
2k views

bash merge 2 lists removing duplicated

I have an embedded linux system using Busybox (OpenWRT) - so commands are limited. I have two files that look like: first file aaaaaa bbbbbb cccccc mmmmmm nnnnnn second file mmmmmm nnnnnn ...
1
vote
2answers
584 views

Busy box Read file line by line

There is no read applet comming with busy box. Is there any way to read a txt file line by line using busybox? What I have now is while read line do echo $line done < "$InputFile"
1
vote
1answer
213 views

Check a bash variable against a file

I have a bash variable ($HTTP_COOKIE) which contains a string. I want to check if this string matches the content of a given file (token). I'm working on a busybox linux. How should I do?
1
vote
1answer
85 views

How to achieve `losetup -a` behaviour with busybox?

busybox (at least version 1.7, which I'm bound to use) to not provide the losetup -a switch to obtain a list of currently used loop devices plus the associated filename. Is there any way to obtain ...
1
vote
1answer
159 views

Using ncurses for basic GUI on a process started inside an init script

I have a custom written application that runs on a embedded setup (buildroot). My application has to run every time the target device boots up and so I wrote an init script to do this and it works ...
1
vote
1answer
1k views

How to chroot into busybox environment?

i have a filesystem build with buildroot, to compile code for a device using a old kernel and uClibc. Now i want to chroot into the fs. The problem is, i dont have /bin/bash, just /bin/busybox. How ...
1
vote
3answers
343 views

Script matching literal pattern over multiple lines?

I have a multi-line string in the variable $PAT. $PAT must be searched for within the file $FILE. If $PAT is in $FILE, it needs to print the file with $PAT removed. If $PAT is not found, then print ...