Age | Commit message (Collapse) | Author |
|
|
|
The brillo folks wanted this in a shell script they're porting over
(so I've only implemented the fd style they wanted, not the named file
style).
|
|
|
|
Adds XVFORK() macro, teaches xpopen_both() to call /proc/self/exe with NULL
argv (and converts cpio -p to use that), adds TOYBOX_FORK guards to some
unconverted commands.
|
|
Note: vfork(), like fork(), can return -1 if too many processes, and
we should notice and fail loudly.
|
|
|
|
|
|
overwritten before we set up signal handlers.
|
|
pgpgin and pgpgout in /proc/vmstat are in kbytes, not pages.
(see http://lxr.free-electrons.com/source/mm/vmstat.c?v=4.2#L1310).
Remove the extra * page_kb for io_in and io_out.
|
|
|
|
Modifying the headers pointer when printing the headers causes
a buffer overrun the second time they are printed. Use a local
header pointer that is reset to the beginning of the buffer for
each loop.
|
|
it's how the kernel signals that ctrl-alt-delete has been pressed;
thus, setting it as the signal for reboot prevents ctrlaltdel scripts
from working.
SIGTERM is what Busybox uses, so we might as well be compatible.
|
|
|
|
|
|
|
|
Add the MS_MOVE of cwd to / and chroot into it. chdir is also
called to ensure cwd does not point outside the chroot.
The switch_root toy was also blocking any case where NEW_ROOT/init
did not exist, even though NEW_INIT was a required parameter and
did not have to be '/init'. Change it to handle any NEW_INIT
passed as either a relative or absolute path.
With this change, the switch_root toy actually works from initramfs.
|
|
|
|
|
|
scans /proc/partitions).
|
|
|
|
init: use SIGINT, use xsignal()
Now that oneit supports the same signals as our "sysv"-init for shutdown,
make reboot et al. signal pid 1 with the appropriate signal.
Of these signals, only SIGINT works with sysvinit 2.88, causing a reboot.
The others are only supported in Busybox init.
Also, make init accept SIGINT and use xsignal().
|
|
before failing.
|
|
|
|
Only tested that it compiled so far.
|
|
|
|
|
|
A minor nit, but for some reason this really stands out every time I
run ifconfig...
|
|
|
|
ioprio_set takes a "prio" argument that combines class and level. Although
bionic (via the uapi headers) includes the appropriate constants and even
a convenience macro, glibc doesn't, so just hard-code the encoding.
Also fix the sense of a conditional so we actually execute the provided
command.
|
|
|
|
|
|
|
|
(Easier to genericize logic and reuse later in less or vi...)
|
|
|
|
|
|
to greppable TODO annotations in the individual files. (grep -riw TODO)
|
|
Change-Id: I0ad65a40bf380d789c4396ebdc01be217901a2e3
|
|
terminal reset escape sequence) and add gettty() function to lib so terminal
gets reset even when we redirect stdout/stderr. (This is apparently the
expected behavior.)
|
|
And yes, I tested $PWD/私はガラスを食べられま す。それは私を傷つけません。
as a name and made it work. If you throw newlines or ascii escapes in the
name it'll use the fancy printing logic for chars, otherwise it does the
full utf8 fontmetrics deal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Test is 'echo "AAA c 1 0 0 2 5 0 0 1" | makedevs' makes AAA not AAA0.
|
|
Calling unshare(2) immediately puts us in the new namespace
with the "overflow" user and group ID. By calling geteuid()
and getegid() in handle_r() after calling unshare(), we try
to map that to root, which Linux refuses to let us do.
What we really want to map to root is the caller's uid/gid
in the original namespace. So we have to save them before
calling unshare().
|
|
confusing update-alternatives, the paths of the links installed by toybox should
match those installed by busybox. This is accomplished by changing the flags
of a few tools within toybox.
|
|
|
|
|