[issue1287] Wishlist: script to run commands in target system
Joerg Dorchain
bts at bts.grml.org
Wed Dec 4 11:06:23 CET 2013
New submission from Joerg Dorchain <joerg at dorchain.net>:
Hello,
I am often in a situation to use grml to correct booting problems
or when the package system has been messed up beyond working.
Some of the commands work simplest when run from within the
target system, i .e. first chroot into it. However typically
there is more to it than just chroot: commands need /proc, /dev is
handled by udev, /var/run now is /run on tmpfs, and while at it
/sys might proove usefull as well.
So I am wondering whether it is possible to include a small
script in grml (e.g. named grml-rescuechroot)
#!/bin/sh
# mount all things a remote root needs and chroot into it
mount $1
cd $1
for i n proc sys dev run; do
mount --rbind /$i $i
done
# Sorry - zsh in not common everywhere
exec chroot . /bin/bash
Bye,
Joerg
----------
messages: 4691
nosy: joerg1
status: unread
title: Wishlist: script to run commands in target system
_____________________________________
GRML issue tracker <bts at bts.grml.org>
<http://bts.grml.org/grml/issue1287>
_____________________________________
More information about the Bugs-changes
mailing list