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: Fri, 01 May 2009 00:34:23
Message-Id: 49FA433F.8040407@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 >>>> Nikos Chantziaras wrote:
6 >>>>> Dale wrote:
7 >>>>>> I try to keep a "up to date" stage 4 tarball here in my system
8 >>>>>> just in
9 >>>>>> case. I basically did the creation just like I would if I were
10 >>>>>> booted
11 >>>>>> from the CD. I created /mnt/gentoo/ on my system, extracted a
12 >>>>>> stage 3
13 >>>>>> there, then chroot in and create a stage 4 tarball. I have one
14 >>>>>> weird
15 >>>>>> thing tho that has me confused. When it creates the stage 4
16 >>>>>> tarball, it
17 >>>>>> is in /mnt/gentoo. Today I unpacked the stage 4 so that I could
18 >>>>>> update
19 >>>>>> it and when I do a tar xjpf stage4 -C /mnt/gentoo, it actually looks
20 >>>>>> like this, /mnt/gentoo/mnt/gentoo/ which is not what I am looking
21 >>>>>> for. It doesn't matter on a running system, but it would if I were
22 >>>>>> trying to
23 >>>>>> rescue myself.
24 >>>>>>
25 >>>>>> How do I tell tar when I am making the tarball to look at
26 >>>>>> /mnt/gentoo/
27 >>>>>> as it start point, root directory if you will? I read the man page
28 >>>>>> but
29 >>>>>> suspect I am missing it somewhere. There has to be a way since
30 >>>>>> it is
31 >>>>>> done that way for the stage 3 tarball.
32 >>>>> You strip the leading directory during extraction using the
33 >>>>> "--strip=1" option ("1" means "strip 1 leading directory", which will
34 >>>>> ignore "gentoo/" during extraction.)
35 >>>>>
36 >>>>>
37 >>>>>
38 >>>> OK. That makes sense, sort of. How do the people that make the
39 >>>> stage3
40 >>>> tarball do it? When I extract a stage3 tarball, it doesn't have
41 >>>> /mnt/gentoo on it at all. Are they using a "dedicated" install to
42 >>>> build
43 >>>> those tarballs on?
44 >>>>
45 >>>> Also, since I want it to ignore /mnt/gentoo, wouldn't I have to use
46 >>>> --strip=2 to remove both /mnt and the /gentoo after that? Just trying
47 >>>> to make sure I understand this correctly.
48 >>>>
49 >>>> I would like to do this on the creating part if possible.
50 >>> To do this on creation, you can do use "-C /mnt/gentoo ." as options
51 >>> (translate: package the current directory of /mnt/gentoo). The
52 >>> top-level directory of the tarball will then be "./".
53 >>>
54 >>>
55 >>>
56 >>
57 >> I tried this but it didn't like it very much:
58 >>
59 >> root@smoker / # tar -cjfvp /data/Gentoo-stuff/stage4-x86-04-2009.bz2 -C
60 >> /mnt/gentoo/
61 >> tar: Removing leading `/' from member names
62 >> tar: /data/Gentoo-stuff/stage4-x86-04-2009.bz2: Cannot stat: No such
63 >> file or directory
64 >> tar: Error exit delayed from previous errors
65 >> root@smoker / #
66 >>
67 >> I also tried reversing the thing, thought maybe I had it backwards, but
68 >> it didn't like that either. Maybe I'm getting to old for learning new
69 >> tricks. LOL
70 >>
71 >> Where am I wrong here?
72 >
73 > 1) Better use -cjvpf ("f") takes an argument (the filename of that
74 > tar to be crated) so it must be at the end.
75 >
76 > 2) You are forgetting the dot (= current directory) at the end of the
77 > command:
78 >
79 > tar -cjpf /data/Gentoo-stuff/stage4-x86-04-2009.tar.bz2 -C /mnt/gentoo .
80 >
81 >
82 >
83
84 Now that worked. Where are we told about that dot? I still don't see
85 it on the man page. It has examples in there but no dot on the end.
86
87 Cool stuff.
88
89 Dale
90
91 :-) :-)

Replies

Subject Author
Re: [gentoo-user] Re: Question about making a tarball Neil Bothwick <neil@××××××××××.uk>