On Tue, Mar 04, 2008 at 02:30:27PM +0100, Han Boetes wrote: > Raimo Niskanen wrote: > > I am writing a script that would be nice to be able to run > > with only the root partition mounted, and it works fine > > except that I find no way to read .gz compressed > > files without e.g /usr/bin/zcat. > > You can do it with something like this in single user mode: > > # mount /usr > # cd /usr/src/usr.bin/compress > # make LDSTATIC=-static > # cp compress /root/compress_static > # make clean > # umount /usr > # mkdir /usr/bin > # mv /root/compress_static /usr/bin/zcat > > As soon as you mount the /usr partition the contents of /usr will > be hidden.
That is nice. Another alternative would be to copy what ldd says: /usr/bin/zcat /usr/lib/libz.so* /usr/lib/libc.so* /usr/libexec/ld.so* to my mount point /usr from the partition that is supposed to be mounted there. > > > So my questions are: is there a program in /sbin:/bin > > that can decompress .gz compressed files? Or should > > there be? Would it not be nice to be able to untar > > e.g base43.tgz from single user mode without having > > to mount /usr? > > basexx.tgz will unpack files in /usr which is not mounted. So all > files will end up on the wrong partition. > Only if current working directory is /. I will only extract ./usr/mdec and not to /. > > > # Han -- / Raimo Niskanen, Erlang/OTP, Ericsson AB