Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 49500 - Portage rescue tarballs are bz2, which can cause problems if you damage glibc
Summary: Portage rescue tarballs are bz2, which can cause problems if you damage glibc
Status: RESOLVED CANTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-30 07:24 UTC by Simon Farnsworth
Modified: 2004-05-20 11:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Farnsworth 2004-04-30 07:24:15 UTC
When I've needed to rescue my machine, it's been because core libraries like glibc are broken; would it be possible for Gentoo to change/add to the portage rescue tarballs, so that I have tar.gz format rescue packages for every dependency of portage? That way, I can boot using sash to get me into the system, and then use sash builtins to get into a state where I can fix up the system.

Reproducible: Always
Steps to Reproduce:
Comment 1 Nicholas Jones (RETIRED) gentoo-dev 2004-05-02 13:24:56 UTC
You'll need to explain more... sash has builtin tar/gz ?
Comment 2 Simon Farnsworth 2004-05-02 14:54:23 UTC
It does indeed have builtin, statically linked tar and gunzip. From the command itself:
Stand-alone shell (version 3.7)
$ help
alias      [name [command]]
aliasall
-ar        [txp]v arFileName fileName ...
cd         [dirName]
-chattr    [+i] [-i] [+a] [-a] fileName ...
-chgrp     gid fileName ...
-chmod     mode fileName ...
-chown     uid fileName ...
-cmp       fileName1 fileName2
-cp        srcName ... destName
-dd        if=name of=name [bs=n] [count=n] [skip=n] [seek=n]
-echo      [args] ...
-ed        [fileName]
exec       fileName [args]
exit
-file      fileName ...
-find      dirName [-xdev] [-type chars] [-name pattern] [-size minSize]
-grep      [-in] word fileName ...
-gunzip    fileName ... [-o outputPath]
-gzip      fileName ... [-o outputPath]
help       [word]
-kill      [-sig] pid ...
-ln        [-s] srcName ... destName
-ls        [-lidFC] fileName ...
-lsattr    fileName ...
-mkdir     dirName ...
-mknod     fileName type major minor
-more      fileName ...
-mount     [-t type] [-r] [-s] [-e] [-m] devName dirName
-mv        srcName ... destName
-printenv  [name]
prompt     string
-pwd
quit
-rm        fileName ...
-rmdir     dirName ...
setenv     name value
source     fileName
-sum       fileName ...
-sync
-tar       [cxtv]f tarFileName fileName ...
-touch     fileName ...
umask      [mask]
-umount    fileName
unalias    name
-where     program

Any command beginning with a - is a builtin version of something normally found external to the shell. I take it from what you're saying in bug 49499 that you're intending to get rid of the tbz2 portage rescues, but I'd like to have an alternative to connecting a CD drive to a killed machine and booting off a LiveCD.

Since app-shells/sash is a manual install anyway, I would be more than happy with a script to create a tar.gz format rescue archive that can be untarred over the root filesystem to return the system to a definitely working state.

I don't have time to learn enough about how portage works to write the script myself at the moment, but it'd do something like:
<code>
USE_ORDER=defaults emerge --emptytree --buildpkgonly portage
mkdir temporaryfakeroot
for each binary package:
  Extract to temporaryfakeroot
endfor
tar czf ../emergency.tar.gz .
</code>

The result is that I have a tar.gz that I can extract over my damaged rootfs to get me going again. I'd then have to fix any damage to /etc/make.conf and friends, before running "emerge -e portage" to get to a clean state.

This would mean that if I (say) built an unusable glibc, I could boot with the extra command "init=/bin/sash", and get control back without using a LiveCD. Also, if I'm logged in as root temporarily (via su or similar), I can run /bin/sash even without ld-linux or libc working. Without a tar.gz format rescue archive, I'm still dead in the water; with it, I can repair my system as long as I can get sash running as root.
Comment 3 Nicholas Jones (RETIRED) gentoo-dev 2004-05-20 11:16:50 UTC
Deps on python and other toolchains would require a lot more than just portage rescue tarballs in gz format.