Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Question about making a tarball
Date: Thu, 30 Apr 2009 22:42:13
Message-Id: 49FA2931.9040900@gmail.com
In Reply to: [gentoo-user] Re: Question about making a tarball by Nikos Chantziaras
1 Nikos Chantziaras wrote:
2 > Dale wrote:
3 >> Nikos Chantziaras wrote:
4 >>> Dale wrote:
5 >>>> I try to keep a "up to date" stage 4 tarball here in my system just in
6 >>>> case. I basically did the creation just like I would if I were booted
7 >>>> from the CD. I created /mnt/gentoo/ on my system, extracted a stage 3
8 >>>> there, then chroot in and create a stage 4 tarball. I have one weird
9 >>>> thing tho that has me confused. When it creates the stage 4
10 >>>> tarball, it
11 >>>> is in /mnt/gentoo. Today I unpacked the stage 4 so that I could
12 >>>> update
13 >>>> it and when I do a tar xjpf stage4 -C /mnt/gentoo, it actually looks
14 >>>> like this, /mnt/gentoo/mnt/gentoo/ which is not what I am looking
15 >>>> for. It doesn't matter on a running system, but it would if I were
16 >>>> trying to
17 >>>> rescue myself.
18 >>>>
19 >>>> How do I tell tar when I am making the tarball to look at /mnt/gentoo/
20 >>>> as it start point, root directory if you will? I read the man page
21 >>>> but
22 >>>> suspect I am missing it somewhere. There has to be a way since it is
23 >>>> done that way for the stage 3 tarball.
24 >>> You strip the leading directory during extraction using the
25 >>> "--strip=1" option ("1" means "strip 1 leading directory", which will
26 >>> ignore "gentoo/" during extraction.)
27 >>>
28 >>>
29 >>>
30 >>
31 >> OK. That makes sense, sort of. How do the people that make the stage3
32 >> tarball do it? When I extract a stage3 tarball, it doesn't have
33 >> /mnt/gentoo on it at all. Are they using a "dedicated" install to build
34 >> those tarballs on?
35 >>
36 >> Also, since I want it to ignore /mnt/gentoo, wouldn't I have to use
37 >> --strip=2 to remove both /mnt and the /gentoo after that? Just trying
38 >> to make sure I understand this correctly.
39 >>
40 >> I would like to do this on the creating part if possible.
41 >
42 > To do this on creation, you can do use "-C /mnt/gentoo ." as options
43 > (translate: package the current directory of /mnt/gentoo). The
44 > top-level directory of the tarball will then be "./".
45 >
46 >
47 >
48
49 I tried this but it didn't like it very much:
50
51 root@smoker / # tar -cjfvp /data/Gentoo-stuff/stage4-x86-04-2009.bz2 -C
52 /mnt/gentoo/
53 tar: Removing leading `/' from member names
54 tar: /data/Gentoo-stuff/stage4-x86-04-2009.bz2: Cannot stat: No such
55 file or directory
56 tar: Error exit delayed from previous errors
57 root@smoker / #
58
59 I also tried reversing the thing, thought maybe I had it backwards, but
60 it didn't like that either. Maybe I'm getting to old for learning new
61 tricks. LOL
62
63 Where am I wrong here?
64
65 Dale
66
67 :-) :-)

Replies

Subject Author
[gentoo-user] Re: Question about making a tarball Nikos Chantziaras <realnc@×××××.de>