1 |
Dale wrote: |
2 |
> Nikos Chantziaras wrote: |
3 |
>> Dale wrote: |
4 |
>>> Nikos Chantziaras wrote: |
5 |
>>>> Dale wrote: |
6 |
>>>>> I try to keep a "up to date" stage 4 tarball here in my system just in |
7 |
>>>>> case. I basically did the creation just like I would if I were booted |
8 |
>>>>> from the CD. I created /mnt/gentoo/ on my system, extracted a stage 3 |
9 |
>>>>> there, then chroot in and create a stage 4 tarball. I have one weird |
10 |
>>>>> thing tho that has me confused. When it creates the stage 4 |
11 |
>>>>> tarball, it |
12 |
>>>>> is in /mnt/gentoo. Today I unpacked the stage 4 so that I could |
13 |
>>>>> update |
14 |
>>>>> it and when I do a tar xjpf stage4 -C /mnt/gentoo, it actually looks |
15 |
>>>>> like this, /mnt/gentoo/mnt/gentoo/ which is not what I am looking |
16 |
>>>>> for. It doesn't matter on a running system, but it would if I were |
17 |
>>>>> trying to |
18 |
>>>>> rescue myself. |
19 |
>>>>> |
20 |
>>>>> How do I tell tar when I am making the tarball to look at /mnt/gentoo/ |
21 |
>>>>> as it start point, root directory if you will? I read the man page |
22 |
>>>>> but |
23 |
>>>>> suspect I am missing it somewhere. There has to be a way since it is |
24 |
>>>>> done that way for the stage 3 tarball. |
25 |
>>>> You strip the leading directory during extraction using the |
26 |
>>>> "--strip=1" option ("1" means "strip 1 leading directory", which will |
27 |
>>>> ignore "gentoo/" during extraction.) |
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 |
>> To do this on creation, you can do use "-C /mnt/gentoo ." as options |
42 |
>> (translate: package the current directory of /mnt/gentoo). The |
43 |
>> top-level directory of the tarball will then be "./". |
44 |
>> |
45 |
>> |
46 |
>> |
47 |
> |
48 |
> I tried this but it didn't like it very much: |
49 |
> |
50 |
> root@smoker / # tar -cjfvp /data/Gentoo-stuff/stage4-x86-04-2009.bz2 -C |
51 |
> /mnt/gentoo/ |
52 |
> tar: Removing leading `/' from member names |
53 |
> tar: /data/Gentoo-stuff/stage4-x86-04-2009.bz2: Cannot stat: No such |
54 |
> file or directory |
55 |
> tar: Error exit delayed from previous errors |
56 |
> root@smoker / # |
57 |
> |
58 |
> I also tried reversing the thing, thought maybe I had it backwards, but |
59 |
> it didn't like that either. Maybe I'm getting to old for learning new |
60 |
> tricks. LOL |
61 |
> |
62 |
> Where am I wrong here? |
63 |
|
64 |
1) Better use -cjvpf ("f") takes an argument (the filename of that tar |
65 |
to be crated) so it must be at the end. |
66 |
|
67 |
2) You are forgetting the dot (= current directory) at the end of the |
68 |
command: |
69 |
|
70 |
tar -cjpf /data/Gentoo-stuff/stage4-x86-04-2009.tar.bz2 -C /mnt/gentoo . |