Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Writeable tarfs?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Slippery Jim
Apprentice
Apprentice


Joined: 08 Jan 2005
Posts: 178

PostPosted: Mon Dec 17, 2012 6:58 pm    Post subject: Writeable tarfs? Reply with quote

I'm looking for something that will let me mount a tarball, and then read and write it like a filesystem; something like tarfs, but writeable.

Is there an ebuild of something like that?
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4630
Location: Theux (Belgium)

PostPosted: Mon Dec 17, 2012 11:16 pm    Post subject: Reply with quote

All compressed filesystems I know of won't allow writing... except BTRFS. On the other hand you can use lesspipe (I think it's enabled by default in Gentoo) to list the contents of a tarball archive, compressed or not. I sometimes find myself browsing archive contents using mc (midnight commander). Quite handy. But I don't know if it addresses your needs.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
lxg
Veteran
Veteran


Joined: 12 Nov 2005
Posts: 1019
Location: Aachen, Germany

PostPosted: Mon Dec 17, 2012 11:22 pm    Post subject: Reply with quote

I'm afraid this doesn't exist, due to the way tar works.

If you're looking for a filesystem in a single file, you might want to use a loopback file, maybe in combination with SquashFS for compression.
_________________
lxg.de – codebits and tech talk
Back to top
View user's profile Send private message
Slippery Jim
Apprentice
Apprentice


Joined: 08 Jan 2005
Posts: 178

PostPosted: Tue Dec 18, 2012 12:25 am    Post subject: Reply with quote

VinzC wrote:
All compressed filesystems I know of won't allow writing... except BTRFS.


It doesn't have to be compressed. Actually, all it needs to do is let a non-privileged user set ownership and mode information on its files, the same way you can set them in tar with the --owner=, --group=, and mode= options, when you add a file to the archive.

This all started because I'm having problems emerging binary packages (using the -B flag), as a normal user with FEATURES="fakeroot" turned on. I'm beginning to think fakeroot is really broken, and the obvious transparent workaround is to have some kind of filesystem front end on tar, mounted and populated by ebuild in the intstall phase, and then unmounted into a tarball in the package phase.
Back to top
View user's profile Send private message
fturco
Apprentice
Apprentice


Joined: 08 Dec 2010
Posts: 240
Location: Italy

PostPosted: Tue Dec 18, 2012 11:46 am    Post subject: Reply with quote

I never tried it myself, but I read about AVFS.
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4630
Location: Theux (Belgium)

PostPosted: Tue Dec 18, 2012 2:05 pm    Post subject: Reply with quote

VinzC wrote:
All compressed filesystems I know of won't allow writing... except BTRFS.


Slippery Jim wrote:
It doesn't have to be compressed. Actually, all it needs to do is let a non-privileged user set ownership and mode information on its files, the same way you can set them in tar with the --owner=, --group=, and mode= options, when you add a file to the archive.

This all started because I'm having problems emerging binary packages (using the -B flag), as a normal user with FEATURES="fakeroot" turned on. I'm beginning to think fakeroot is really broken, and the obvious transparent workaround is to have some kind of filesystem front end on tar, mounted and populated by ebuild in the intstall phase, and then unmounted into a tarball in the package phase.

I'm not quite used to the fakeroot feature but I'd then highly recommend you filed a bug against that very problem on Gentoo Bugzilla if you haven't yet. Other than that, a loop disk image (as suggested above) will do, just like a RAMdisk. You can create one of these with qemu_img, cpio, dd, whatever...
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
Slippery Jim
Apprentice
Apprentice


Joined: 08 Jan 2005
Posts: 178

PostPosted: Tue Dec 18, 2012 4:23 pm    Post subject: Reply with quote

Yeah, I opened bug#447638 yesterday.

We can't use just any filesystem though, because you need to be able to chown files to arbitrary users, including root (obviously, without actually doing it).

According to its man page, the fakeroot utility does this by overriding some file ops in glibc using the LD_PRELOAD feature, or something like that.

Whatever we end up using, it has to store ownership and mode metadata on top of the regular metadata, so that when tar adds the file to the archive, it get's the correct ownership settings, instead of the settings of the user running emerge.
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Sat Dec 22, 2012 9:42 am    Post subject: Reply with quote

VinzC wrote:
except BTRFS.


LOLOLOLOLOLOL!!!
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4630
Location: Theux (Belgium)

PostPosted: Sat Dec 22, 2012 11:08 am    Post subject: Reply with quote

VinzC wrote:
except BTRFS.

________________________0 wrote:

LOLOLOLOLOLOL!!!
:?:
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Sat Dec 22, 2012 4:56 pm    Post subject: Reply with quote

VinzC wrote:
VinzC wrote:
except BTRFS.

________________________0 wrote:

LOLOLOLOLOLOL!!!
:?:


oops I read it wrong. I understood as a subtle stab at btrfs buggy state. 'they all ALLOW except btrfs' (implying btrfs corrupts your files, which happens all the time here).

my bad.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum