Nikos Chantziaras wrote:
> Dale wrote:
>> Nikos Chantziaras wrote:
>>> Dale wrote:
>>>> Nikos Chantziaras wrote:
>>>>> Dale wrote:
>>>>>> I try to keep a "up to date" stage 4 tarball here in my system
>>>>>> just in
>>>>>> case.  I basically did the creation just like I would if I were
>>>>>> booted
>>>>>> from the CD.  I created /mnt/gentoo/ on my system, extracted a
>>>>>> stage 3
>>>>>> there, then chroot in and create a stage 4 tarball.  I have one
>>>>>> weird
>>>>>> thing tho that has me confused.  When it creates the stage 4
>>>>>> tarball, it
>>>>>> is in /mnt/gentoo.  Today I unpacked the stage 4 so that I could
>>>>>> update
>>>>>> it and when I do a tar xjpf stage4 -C /mnt/gentoo, it actually looks
>>>>>> like this, /mnt/gentoo/mnt/gentoo/ which is not what I am looking
>>>>>> for. It doesn't matter on a running system, but it would if I were
>>>>>> trying to
>>>>>> rescue myself.
>>>>>>
>>>>>> How do I tell tar when I am making the tarball to look at
>>>>>> /mnt/gentoo/
>>>>>> as it start point, root directory if you will?  I read the man page
>>>>>> but
>>>>>> suspect I am missing it somewhere.  There has to be a way since
>>>>>> it is
>>>>>> done that way for the stage 3 tarball.
>>>>> You strip the leading directory during extraction using the
>>>>> "--strip=1" option ("1" means "strip 1 leading directory", which will
>>>>> ignore "gentoo/" during extraction.)
>>>>>
>>>>>
>>>>>
>>>> OK.  That makes sense, sort of.  How do the people that make the
>>>> stage3
>>>> tarball do it?  When I extract a stage3 tarball, it doesn't have
>>>> /mnt/gentoo on it at all.  Are they using a "dedicated" install to
>>>> build
>>>> those tarballs on?
>>>>
>>>> Also, since I want it to ignore /mnt/gentoo, wouldn't I have to use
>>>> --strip=2 to remove both /mnt and the /gentoo after that?  Just trying
>>>> to make sure I understand this correctly.
>>>>
>>>> I would like to do this on the creating part if possible.
>>> To do this on creation, you can do use "-C /mnt/gentoo ." as options
>>> (translate: package the current directory of /mnt/gentoo).  The
>>> top-level directory of the tarball will then be "./".
>>>
>>>
>>>
>>
>> I tried this but it didn't like it very much:
>>
>> r...@smoker / # tar -cjfvp /data/Gentoo-stuff/stage4-x86-04-2009.bz2 -C
>> /mnt/gentoo/
>> tar: Removing leading `/' from member names
>> tar: /data/Gentoo-stuff/stage4-x86-04-2009.bz2: Cannot stat: No such
>> file or directory
>> tar: Error exit delayed from previous errors
>> r...@smoker / #
>>
>> I also tried reversing the thing, thought maybe I had it backwards, but
>> it didn't like that either.  Maybe I'm getting to old for learning new
>> tricks.  LOL
>>
>> Where am I wrong here?
>
> 1) Better use -cjvpf  ("f") takes an argument (the filename of that
> tar to be crated) so it must be at the end.
>
> 2) You are forgetting the dot (= current directory) at the end of the
> command:
>
> tar -cjpf /data/Gentoo-stuff/stage4-x86-04-2009.tar.bz2 -C /mnt/gentoo .
>
>
>

Now that worked.  Where are we told about that dot?  I still don't see
it on the man page.  It has examples in there but no dot on the end.

Cool stuff.

Dale

:-)  :-) 

Reply via email to