LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-10-2011, 11:34 AM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Excluding subtrees with mkisofs


I'm trying to build an ISO image from a large file tree. But I want to exclude a portion of that tree from the ISO. When I try to construct the tree selectively using each of the names within the tree (except the ones to be excluded), mkisofs flattens the tree out and reports conflicts of like names from different sources. Even with graft points used, the same happens.

Does this program even have the capability to specify that? The man page doesn't show anything.

My workaround is to reconstruct the tree in another location, less the excluded parts, and run mkisofs on that. When one name is given to mkisofs it works fine. But this reconstructing takes time to build.
 
Old 01-10-2011, 08:32 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
From the man page :-

Quote:
-m glob
Exclude files matching glob, a shell wildcard pattern, from
being written to CD-ROM. glob may match either the filename
component or the full pathname. This option may be used multi-
ple times. For example:

genisoimage -o rom -m '*.o' -m core -m foobar

would exclude all files ending in ‘.o’, or called core or foobar
from the image. Note that if you had a directory called foobar,
it too (and of course all its descendants) would be excluded.
cheers
 
Old 01-11-2011, 06:40 AM   #3
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
The -m option didn't work. I tried it with both a directory name, and a directory name with "*" appended.

Apparently some other form not shown in the example is needed to match the entire tree. Maybe it is as complex as rsync, but with a different syntax.

Last edited by Skaperen; 01-11-2011 at 06:50 AM. Reason: add Apparently ...
 
Old 01-11-2011, 07:53 AM   #4
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
The problem appears to be that there is no syntax for -m to provide for "top of the path" matching. I tried a leading ^ (regexp) and a leading / (glob) character, but no joy. Without this, the string matches blindly at all levels.
 
Old 01-11-2011, 04:13 PM   #5
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Wouldn't a simple "-m '*pattern*'" work ?

<edit> just ran a test.. results as follows:

[me@xxxxxx tmp]$ ls -R1 blah/
blah/:
test

blah/test:
anotherthing
something
test2

blah/test/anotherthing:

blah/test/something:

blah/test/test2:
crapola

blah/test/test2/crapola:

[me@xxxxxx tmp]$ mkisofs -r -m '*test2*' -o test.iso blah
I: -input-charset not specified, using utf-8 (detected in locale settings)
Total translation table size: 0
Total rockridge attributes bytes: 812
Total directory bytes: 6496
Path table size(bytes): 54
Max brk space used 22000
178 extents written (0 MB)

[me@xxxxxx tmp]$ sudo mount -o loop ./test.iso /mnt/iso
[me@xxxxxx tmp]$ ls -R1 /mnt/iso/
/mnt/iso/:
test

/mnt/iso/test:
anotherthing
something

/mnt/iso/test/anotherthing:

/mnt/iso/test/something:

So it seems to work for me ... cheers </edit>

Last edited by kbp; 01-11-2011 at 04:27 PM.
 
Old 01-13-2011, 09:27 AM   #6
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
The problem is if you have "xyzzy" as a top level directory, and also have "xyzzy" as a subdirectory under some other top levels, then -m "*xyzzy" omits all of them. I want to make a pattern that specifically matches only the top level, and not the subdirectories. In grep I would prefix it with the ^ character.
 
Old 01-13-2011, 03:39 PM   #7
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Yes, that is a problem .. it's only a shell glob not a regex. Wouldn't that mean you're trying to create an iso from an entire filesystem - from / down ?

Last edited by kbp; 01-13-2011 at 03:42 PM.
 
Old 01-14-2011, 10:19 AM   #8
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by kbp View Post
Yes, that is a problem .. it's only a shell glob not a regex. Wouldn't that mean you're trying to create an iso from an entire filesystem - from / down ?
Not from / down, but from a specific directory and down, but I want to omit a few subdirectories without having to make a copy where I could just rm them.

If the directory is writable and not being used elsewhere at the time, you could mv the undesired subtrees away, build the ISO, and mv them back. Try that on a read/only mount (like another DVD).
 
Old 01-15-2011, 06:52 PM   #9
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Then couldn't you make the glob longer ?

Modifying my previous test:
Code:
mkisofs -r -m '*blah/test/test2*' -o test.iso blah
 
Old 01-17-2011, 07:57 AM   #10
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by kbp View Post
Then couldn't you make the glob longer ?

Modifying my previous test:
Code:
mkisofs -r -m '*blah/test/test2*' -o test.iso blah
That still does not do what I want. This example will omit anything with "blah/test/test2" in the path. That's not what I want. What I want is to omit things ONLY where the TOP of the path begins with the specified string, and NOT omit things where that string exists in only in a lower part of the path. If I want to omit the entire tree that begins with directory "foo", making the glob longer will possibly fail to omit that entire tree.

I'm concluding that mkisofs simply does not have this capability.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] mkisofs returns error "mkisofs: Uh oh, I cant find the boot catalog directory " gajbooks Linux - Software 3 11-18-2010 06:43 PM
Excluding Folders with CP Luke_C Linux - General 17 07-27-2006 04:22 AM
moving /subtrees to their own partitions on new installation John Velman Slackware - Installation 3 08-26-2005 04:39 PM
[apache] disable htpasswd in subtrees? yapp Linux - Networking 4 01-13-2005 11:22 PM
excluding an I.P. or domain with php dave4545 Programming 4 11-27-2003 10:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration