How do I rebuild an ISO to remove files from its mounted image?
flight
I built an ISO which contains:
Directory listing of /
d--------- 0 0 0 2048 Mar 19 2015 [ 29 02] .
d--------- 0 0 0 2048 Mar 19 2015 [ 29 02] ..
d--------- 0 0 0 4096 Mar 19 2015 [ 32 02] target-rpms
d--------- 0 0 0 2048 Mar 19 2015 [ 34 02] vat
Directory listing of /target-rpms/
d--------- 0 0 0 4096 Mar 19 2015 [ 32 02] .
d--------- 0 0 0 2048 Mar 19 2015 [ 29 02] ..
---------- 0 0 0 32435902 Mar 18 2015 [ 85 00] file1.rpm
---------- 0 0 0 2055833 Mar 18 2015 [ 15923 00] file2.rpm
Directory listing of /vat/
d--------- 0 0 0 2048 Mar 19 2015 [ 44 02] .
d--------- 0 0 0 2048 Mar 19 2015 [ 29 02] ..
---------- 0 0 0 0 Apr 20 2015 [ 56633 00] file1.txt
I wanted to add/remove files from an ISO mounted image, so I did this:
sudo mount -o loop,ro /full/path/to/file.iso /mounted/path
For adding files, I found this method:
mkdir /path/where/put/addedFile/vat/
cp prova.txt /path/where/put/addedFile/vat/prova.txt
mkisofs -o /tmp/test.iso -A test-1.0 -copyright 'Test' -joliet-long -RU
-uid 0 -gid 0 -iso-level 4 /mounted/path /path/where/put/addedFile
Files can mkisofs
be merged into a directory and test.iso
include all required files.
I need some help on how to create test.iso
(for example) target-rpms/file2.rpm
.
I know I can do this using the following process:
mkdir /path/where/rebuildIso
cp -R /mounted/path /path/where/rebuildIso
rm /path/where/rebuildIso/target-rpms/file2.rpm
mkisofs -o /tmp/test.iso -A test-1.0 -copyright 'Test' -joliet-long -RU
-uid 0 -gid 0 -iso-level 4 /path/where/rebuildIso
However, because of the isometric size, I would like to avoid using cp
commands.
I'm using mkisofs 2.01 (i686-pc-linux-gnu) on Red Hat Enterprise Linux AS version 3 (Taroon Update 2)
Lambert
Actually mkisofs 2.01 points to genisoimage:
$ mkisofs --version
mkisofs 2.01 is not what you see here. This line is only a fake for too clever
GUIs and other frontend applications. In fact, this program is:
genisoimage 1.1.11 (Linux)
From man genisoimage
here you can try the following -m
options:
-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 multiple 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.
-exclude-list file
A file containing a list of shell wildcards to be excluded. See -m.