Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
-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.
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.
[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
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.
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 ?
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).
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.