Re: [gentoo-user] Cloned partition won't emerge some packages
On Monday 10 January 2011 02:34:13 Alex Schuster wrote: I created two directories sys/ and usr/include/sys/, with normal and hidden files: wo...@weird ~/tmp/tar $ ls -a . sys usr/include/sys .: . .. sys usr sys: . .. .hidden visible usr/include/sys: . .. .hidden.h visible.h I tarred them as you did. Note that the hidden file is also excluded, although I did not exclude sys/.*, too: wo...@weird ~/tmp/tar $ tar cf ../foo.tar --exclude='sys/*' . wo...@weird ~/tmp/tar $ tar tf ../foo.tar ./ ./usr/ ./usr/include/ ./usr/include/sys/ ./sys/ As suggested, I added a './' to the exclude file list and tarred the directory. Seems to work: wo...@weird ~/tmp/tar $ tar cf ../foo.tar --exclude='./sys/*' . wo...@weird ~/tmp/tar $ tar tf ../foo.tar ./ ./usr/ ./usr/include/ ./usr/include/sys/ ./usr/include/sys/visible.h ./usr/include/sys/.hidden.h ./sys/ What shall I use for excluding all the contents of a directory, but not the directory itself? sed -i 's:^:./:g' file.list Thank you very much - I also repeated your findings. My confusion was whether the list passed to -X should be defined as an absolute path, or a pattern. When I originally tried /dir it didn't work, but as you say ./tmp does. Good trick about mount -o bind, too, I had forgotten about that. -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Cloned partition won't emerge some packages
On 9 January 2011 01:18, Daniel D Jones ddjo...@riddlemaster.org wrote: On Saturday, January 08, 2011 17:36:48 Mick wrote: However, I can't emerge some packages from it like gcc or subversion ... Looks to me like this is your issue: In file included from /usr/include/stdio.h:28, from conftest.c:10: /usr/include/features.h:347:25: error: sys/cdefs.h: No such file or directory Do you have /usr/include/sys/cdefs.h on your system? If the file isn't there, I'd copy it over and verify that all the other files which should be there are present. If the file is there, then gcc likely isn't looking in the right location for include files. I'm not sure off the top of my head where that's configured on Gentoo. On my system, there's no environmental variables set, so it's probably done by some other means. I'm sure that if that's your issue, someone here will chime in with the information. Yes, you're right! # ls -la /usr/include/sys/ total 40 drwxr-xr-x 2 root root48 Nov 13 09:28 . drwxr-xr-x 320 root root 40712 Jan 8 20:30 .. Why is this empty?!! Something to do with tar breakage? I tried this with different options, the last one being tar xvf (just in case the half broken tar sparse files option is not fixed yet) and still these files are missing ... O_O Why wouldn't these files have transferred over? What else might be missing? Very confused ... -- Regards, Mick
Re: [gentoo-user] Cloned partition won't emerge some packages
On Sunday 09 January 2011 11:28:01 you wrote: On 9 January 2011 01:18, Daniel D Jones ddjo...@riddlemaster.org wrote: On Saturday, January 08, 2011 17:36:48 Mick wrote: However, I can't emerge some packages from it like gcc or subversion ... Looks to me like this is your issue: In file included from /usr/include/stdio.h:28, from conftest.c:10: /usr/include/features.h:347:25: error: sys/cdefs.h: No such file or directory Do you have /usr/include/sys/cdefs.h on your system? If the file isn't there, I'd copy it over and verify that all the other files which should be there are present. If the file is there, then gcc likely isn't looking in the right location for include files. I'm not sure off the top of my head where that's configured on Gentoo. On my system, there's no environmental variables set, so it's probably done by some other means. I'm sure that if that's your issue, someone here will chime in with the information. Yes, you're right! # ls -la /usr/include/sys/ total 40 drwxr-xr-x 2 root root48 Nov 13 09:28 . drwxr-xr-x 320 root root 40712 Jan 8 20:30 .. Why is this empty?!! Something to do with tar breakage? I tried this with different options, the last one being tar xvf (just in case the half broken tar sparse files option is not fixed yet) and still these files are missing ... O_O Why wouldn't these files have transferred over? What else might be missing? Very confused ... Correction! I meant to type: tar cvf -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Cloned partition won't emerge some packages
Mick writes: I used: tar -X file.list -lcvSf - . | (cd /new_gentoo_partition; tar -xpvf - ) to clone a gentoo / partition to another partition on the same disk (I want to run some tests from it). The file.list has this is in it: tmp/* proc/* sys/* dev/* etc/mtab usr/portage/distfiles/* Which also excludes /usr/include/sys, not only /sys. And so on. You probably have to rewrite this as ./tmp/* , but I did not test this. And I just learnt that -l is no longer a synonym for --one-file-system, at least for tar 1.25. I'd do it with a bind mount this: mount -o bind / /mnt cd /mnt tar -cvSf - . | (cd /new_gentoo_partition; tar -xpvf - ) This way, the original /dev is being copied (including entries console and null), without the udev stuff that is mounted on top of /dev, while with --one-file-system only the empty /dev directory would be created. Wonko
Re: [gentoo-user] Cloned partition won't emerge some packages
On Sunday 09 January 2011 21:11:02 Alex Schuster wrote: Mick writes: I used: tar -X file.list -lcvSf - . | (cd /new_gentoo_partition; tar -xpvf - ) to clone a gentoo / partition to another partition on the same disk (I want to run some tests from it). The file.list has this is in it: tmp/* proc/* sys/* dev/* etc/mtab usr/portage/distfiles/* Which also excludes /usr/include/sys, not only /sys. And so on. You probably have to rewrite this as ./tmp/* , but I did not test this. And I just learnt that -l is no longer a synonym for --one-file-system, at least for tar 1.25. I'd do it with a bind mount this: mount -o bind / /mnt cd /mnt tar -cvSf - . | (cd /new_gentoo_partition; tar -xpvf - ) This way, the original /dev is being copied (including entries console and null), without the udev stuff that is mounted on top of /dev, while with --one-file-system only the empty /dev directory would be created. Thanks Wonko, it seems that I fell victim to my regex ignorance. I started with /tmp, but that would also exclude the directories and I didn't fancy creating them manually afterwards. Also dir/* does not include dir/.* What shall I use for excluding all the contents of a directory, but not the directory itself? I'll need to experiment some more. -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Cloned partition won't emerge some packages
Mick writes: On Sunday 09 January 2011 21:11:02 Alex Schuster wrote: Mick writes: I used: tar -X file.list -lcvSf - . | (cd /new_gentoo_partition; tar -xpvf - ) to clone a gentoo / partition to another partition on the same disk (I want to run some tests from it). The file.list has this is in it: tmp/* proc/* sys/* dev/* etc/mtab usr/portage/distfiles/* Which also excludes /usr/include/sys, not only /sys. And so on. You probably have to rewrite this as ./tmp/* , but I did not test this. And I just learnt that -l is no longer a synonym for --one-file-system, at least for tar 1.25. I'd do it with a bind mount this: mount -o bind / /mnt cd /mnt tar -cvSf - . | (cd /new_gentoo_partition; tar -xpvf - ) This way, the original /dev is being copied (including entries console and null), without the udev stuff that is mounted on top of /dev, while with --one-file-system only the empty /dev directory would be created. Thanks Wonko, it seems that I fell victim to my regex ignorance. I started with /tmp, but that would also exclude the directories and I didn't fancy creating them manually afterwards. Also dir/* does not include dir/.* What shall I use for excluding all the contents of a directory, but not the directory itself? Actually it does, although this is wrong in my opinion. But maybe what the user normally intends. I created two directories sys/ and usr/include/sys/, with normal and hidden files: wo...@weird ~/tmp/tar $ ls -a . sys usr/include/sys .: . .. sys usr sys: . .. .hidden visible usr/include/sys: . .. .hidden.h visible.h I tarred them as you did. Note that the hidden file is also excluded, although I did not exclude sys/.*, too: wo...@weird ~/tmp/tar $ tar cf ../foo.tar --exclude='sys/*' . wo...@weird ~/tmp/tar $ tar tf ../foo.tar ./ ./usr/ ./usr/include/ ./usr/include/sys/ ./sys/ As suggested, I added a './' to the exclude file list and tarred the directory. Seems to work: wo...@weird ~/tmp/tar $ tar cf ../foo.tar --exclude='./sys/*' . wo...@weird ~/tmp/tar $ tar tf ../foo.tar ./ ./usr/ ./usr/include/ ./usr/include/sys/ ./usr/include/sys/visible.h ./usr/include/sys/.hidden.h ./sys/ What shall I use for excluding all the contents of a directory, but not the directory itself? sed -i 's:^:./:g' file.list Wonko