Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 105365 - genkernel section - zcat to nonexistent directory loses file
Summary: genkernel section - zcat to nonexistent directory loses file
Status: RESOLVED INVALID
Alias: None
Product: [OLD] Docs-user
Classification: Unclassified
Component: Handbook (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Docs Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-09 05:15 UTC by Whit Blauvelt
Modified: 2005-09-09 07:59 UTC (History)
1 user (show)

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 Whit Blauvelt 2005-09-09 05:15:26 UTC
Code listing 19:

(Only do this if you are going to configure a 2.6 kernel)
# zcat /proc/config.gz > /usr/share/genkernel/x86/kernel-config-2.6

Doing a stage 3 install in my case, the /usr/share/genkernel directory does not
yet exist. So zcat uncompresses config.gz, gives an error about the nonexistent
destination directory, and then there's no way to recover, since zcat has also
at that point removed the /proc/config.gz file.

Also, it's a bit vague just above that when it says "Next, if you are going to
configure a 2.6 kernel...." Does this mean that if you're using genkernel
without extra configuration (which is the point of genkernel, right?) that you
need to do this step? Or only if you're doing extra configuration beyond the
genkernel defaults?

Also, it talks about the "installation CD" here, but I'm not installing from an
installation CD. So does this even apply? Come to think of it, isn't that the
/proc directory from the underlying Linux install anyway, so it _shouldn't_
apply? If so, this should be specified in the Handbook.

Just as a note: Up to this point the handbook has been clear enough to me. But
if I were a novice there are at least a half-dozen other points where I would
have been seriously lost. It would be good for the authors to sit down and do a
usability study, watching a few novices work through it and noting what confused
them.



Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Whit Blauvelt 2005-09-09 05:18:54 UTC
Another problem:

If the genkernel script is even on the system at this point, it isn't in the
path. So the instruction on invoking it in Code Listing 20 will not, of course,
invoke it.
Comment 2 Łukasz Damentko (RETIRED) gentoo-dev 2005-09-09 05:33:24 UTC
> Just as a note: Up to this point the handbook has been clear enough to me. But
> if I were a novice there are at least a half-dozen other points where I would
> have been seriously lost. 

You can always join #gentoo on freenode, search or ask at forums.gentoo.org,
subscribe and send your questions to one of our mailing lists... We are more
than glad to help every new Gentoo user.

Comment 3 Jakub Moc (RETIRED) gentoo-dev 2005-09-09 06:13:19 UTC
(In reply to comment #0)
> So zcat uncompresses config.gz, gives an error about the nonexistent
> destination directory, and then there's no way to recover, since zcat has also
> at that point removed the /proc/config.gz file.

I'm sorry, but it is completely untrue, the above zcat command does *not* remove
anything.
Comment 4 Jan Kundrát (RETIRED) gentoo-dev 2005-09-09 06:35:10 UTC
(In reply to comment #0) 
> Code listing 19: 
>  
> (Only do this if you are going to configure a 2.6 kernel) 
> # zcat /proc/config.gz > /usr/share/genkernel/x86/kernel-config-2.6 
>  
> Doing a stage 3 install in my case, the /usr/share/genkernel directory does 
not 
> yet exist. So zcat uncompresses config.gz, gives an error about the 
nonexistent 
> destination directory, and then there's no way to recover, since zcat has 
also 
> at that point removed the /proc/config.gz file. 
 
Not true, `zcat` doesn't remove anything. Maybe you got confused by `gunzip`? 
 
>  
> Also, it's a bit vague just above that when it says "Next, if you are going 
to 
> configure a 2.6 kernel...." Does this mean that if you're using genkernel 
> without extra configuration (which is the point of genkernel, right?) that 
you 
> need to do this step? Or only if you're doing extra configuration beyond the 
> genkernel defaults? 
 
You didn't mention which document are you talking about (FYI, we have several 
Handbooks), so I'd guess that the sentence talks about differences between 2.4 
and 2.6 kernels. 
 
> Also, it talks about the "installation CD" here, but I'm not installing from 
an 
> installation CD. So does this even apply? 
 
You must be following wrong guide. If you're installing from 2005.1 Install CD 
*without* network, you should follow 2005.1 Handbook [1], if you are using 
network, use regular Handbook [2] and finally if you're using something else 
like Knoppix or existing Linux distribution (which seems to be your case), use 
Alternative Installation Method [3]. 
 
> Come to think of it, isn't that the 
> /proc directory from the underlying Linux install anyway, so it _shouldn't_ 
> apply? If so, this should be specified in the Handbook. 
 
Handbook is talking about Gentoo Install CDs. 
 
[1] http://www.gentoo.org/doc/en/handbook/2005.1/index.xml 
[2] http://www.gentoo.org/doc/en/handbook/ 
[3] http://www.gentoo.org/doc/en/altinstall.xml 
Comment 5 Whit Blauvelt 2005-09-09 07:32:31 UTC
Thanks for your fast responses.

The "Handbook" is the "Gentoo Linux x86 Handbook".

I don't generally use zcat, but did in this case. First I looked in /proc to see
if the file was there. It was. Then I pasted the command from the Handbook
directly. It gave the error about the destination directory not existing. Then I
created the destination directory and ran the zcat command (from the history)
again. This time it gave the error about the file not existing. So I looked, and
sure enough the /proc/config.gz file was not longer there. Whether this is
zcat's intended behavior or a bug uncovered by the circumstance, I don't know.
But it's what happened from following the Handbook explicitly. 

The nonexistence of the directory given as the destination in this instance is
_certainly_ a Handbook flaw. So _at least_ that part of this report is valid. 

The install method I'm using is not from CD, it's with the stage 3 file,
installing on a new drive alongside an older Gentoo installation, from a remote
ssh terminal. The Handbook I'm following does not say that it is inappropriate
to this method, see for instance "5.b. Default: Using a Stage from the
Internet." If the "altinstall" Handbook is required instead, it is a
documentation bug in this version not to present a clear statement about that. 

In any case, the directory "/usr/share/genkernel/x86/" does _not exist_ if you
are following this Handbook and section "5.b. Default: Using a Stage from the
Internet." I'm using the current stage 3 from the Internet here. That directory
does not exist in it. Therefore the genkernel instructions will fail. This is
not a dependency on whether I'm installing from CD or not -- it's a mismatch
between the existing directories in the stage 3 file, and the instructions which
say nothing about having to create the directory before zcat'ing the file to it.

Beyond that, in this circumstance zcat did make the original file disappear too
-- although I'm guessing (1) it probably was inappropriate to follow that
instruction in my circumstance, and (2) of course if that were a file mounted in
/proc from the CD, it could not be erased there (unless CD-RW perhaps). 

Comment 6 Jakub Moc (RETIRED) gentoo-dev 2005-09-09 07:39:42 UTC
(In reply to comment #5)
> Beyond that, in this circumstance zcat did make the original file disappear too

No again; zcat does *not* make anything disappear.

Please, post what changes you suggest, I'm still missing this.
Comment 7 Jan Kundrát (RETIRED) gentoo-dev 2005-09-09 07:48:52 UTC
(In reply to comment #5) 
> The "Handbook" is the "Gentoo Linux x86 Handbook". 
 
I will assume you're talking about 
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml 
 
> I don't generally use zcat, but did in this case. 
[...] 
 
If you are really sure that `zcat` from Gentoo-provided environment erased file 
*and* you can reproduce it, please open separate bugreport. 
 
> The nonexistence of the directory given as the destination in this instance 
is 
> _certainly_ a Handbook flaw. So _at least_ that part of this report is valid.  
 
See below. 
 
> The install method I'm using is not from CD, it's with the stage 3 file, 
> installing on a new drive alongside an older Gentoo installation, from a 
remote 
> ssh terminal.  
 
It's irrelevant where are you getting your stages from, important is 
availability of networking and the *medium* which is providing you the 
environment for chroot etc. 
 
> The Handbook I'm following does not say that it is inappropriate 
> to this method, see for instance "5.b. Default: Using a Stage from the 
> Internet."  
> 
> If the "altinstall" Handbook is required instead, it is a 
> documentation bug in this version not to present a clear statement about 
that.  
 
Please see 
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=1#doc_chap1_sect3 : 
 
"This document covers the installation using a Gentoo Installation CD or, in 
certain cases, NetBooting." 
 
> In any case, the directory "/usr/share/genkernel/x86/" does _not exist_ if 
you 
> are following this Handbook and section "5.b. Default: Using a Stage from the 
> Internet." I'm using the current stage 3 from the Internet here. That 
directory 
> does not exist in it. Therefore the genkernel instructions will fail. This is 
> not a dependency on whether I'm installing from CD or not -- it's a mismatch 
> between the existing directories in the stage 3 file, and the instructions 
which 
> say nothing about having to create the directory before zcat'ing the file to 
it. 
 
But that *do* say that you have to `emerge genkernel` first. Have you performed 
this step? Did it succeeded? 
 
> Beyond that, in this circumstance zcat did make the original file disappear 
too 
> -- although I'm guessing (1) it probably was inappropriate to follow that 
> instruction in my circumstance, and (2) of course if that were a file mounted 
in 
> /proc from the CD, it could not be erased there (unless CD-RW perhaps).  
 
FYI, procfs is memory-based "virtual" filesystem created on every boot (very 
simplified). For `zcat` talk, see above. 
 
Marking as invalid as I don't see any fault in docs, feel free to reopen & 
clarify if you oppose. 
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2005-09-09 07:59:13 UTC
$ equery f genkernel | grep x86/

/usr/share/genkernel/pkg/x86/README
/usr/share/genkernel/x86/busy-config
/usr/share/genkernel/x86/config.sh
/usr/share/genkernel/x86/kernel-config-2.4
/usr/share/genkernel/x86/kernel-config-2.6
/usr/share/genkernel/x86/modules_load
/usr/share/genkernel/x86/modules_load~

The only way how that directory can be missing is that you failed to emerge
genkernel first.

INVALID.