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

learn more… | top users | synonyms

7
votes
4answers
3k 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
504 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
2answers
430 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 ...
6
votes
3answers
7k 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?
6
votes
3answers
3k 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
742 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 ...
5
votes
1answer
1k 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
1answer
377 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 ...
5
votes
1answer
211 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
1k 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
3answers
5k 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
4k 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
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 ...
3
votes
2answers
2k 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
443 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
220 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
2k 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
1answer
513 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
322 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
2answers
527 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
980 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
146 views

Rename files with spaces in a BusyBox shell

I'm trying to rename some files on my Synology Diskstation via SSH. The available shell is the BusyBox built-in shell: BusyBox v1.16.1 (2013-04-16 20:13:10 CST) built-in shell (ash) The move ...
3
votes
1answer
5k 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
312 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 ...
3
votes
1answer
111 views

Minimal Linux with kernel and BusyBox: /etc/inittab is ignored, only /init is executed

I managed to create a small and fully functional live Linux CD which contains only kernel (compiled with default options) and BusyBox (compiled with default options + static, all applets present, ...
2
votes
5answers
8k 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
1answer
276 views

Regex doesn't work with grep

I have a string like this TEST="/dev/sda1 on /media/sda1 type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,quiet)" (Result from mount | grep sda1) ...
2
votes
2answers
511 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
471 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
671 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
1answer
5k views

how to make read only filesystem writable on busybox?

I want to change some files on my router. Firstly i can change everything in /var, but i want to change /etc/fstab. when i try to change it, i get an error message that says filesystem is read only. ...
2
votes
2answers
312 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
493 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
509 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
93 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
3answers
465 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 ...
2
votes
2answers
142 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
2answers
2k views

What does ifup do when “/etc/network/interfaces” has an invalid netmask address?

The interfaces file looks like below: auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.0.130 netmask 250.255.255.0 gateway 192.168.0.254 As you can see ...
2
votes
1answer
230 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
373 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
872 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
2answers
72 views

How to remount as read-write a specific mount of device?

How to remount as read-write a specific mount of device? (one folder) The file is "Read-only file system", rw-r-r, so it not allow to change permissions. I need to replace that file, then change ...
2
votes
0answers
20 views

how to migrate a squashfs system to another filesystem that's read/write

Well, basically what i want to do is copy all of my router's files (even the dev file (because i'm running busybox)) to my usb flash drive and let my router by default boot from the usb device. it ...
2
votes
1answer
38 views

Debian installer - customize busybox and live system/environment

I'm trying to reinstall Debian on a netbook and do it without sloppy tricks so that I can repeat the process if necessary. Specifically, I'm trying to customize the installer to include the wifi ...
2
votes
1answer
139 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
236 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
0answers
140 views

Why is my /etc/hosts.deny file being ignored?

I am using a small embedded linux setup generated by buildroot to run on a x86 device. It was generated to use busybox init system and also runs dropbear so I can ssh into the device. I wanted to ...