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 mkisofsbe merged into a directory and test.isoinclude 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 cpcommands.

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 genisoimagehere you can try the following -moptions:

-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.

Related


How to find iso image based on mounted folder?

Venus I type df -hon linux terminal and it shows Filesystem Size Used Avail Use% Mounted on /dev/sr0 3.0G 3.0G 0 100% /media/SLE-11-SP1-SDK-DVD-x86_64.02.001 How can I find the source ISO image mounted on it /media/SLE-11-SP1

How to find iso image based on mounted folder?

Venus I type df -hon linux terminal and it shows Filesystem Size Used Avail Use% Mounted on /dev/sr0 3.0G 3.0G 0 100% /media/SLE-11-SP1-SDK-DVD-x86_64.02.001 How can I find the source ISO image mounted on it /media/SLE-11-SP1

How do I get Dockerhub to rebuild my image every day?

Dieter We have base images set up on Dockerhub and they will be rebuilt whenever the upstream repositories change. In our Dockerfiles, we installed several packages using apt-get. We want to always have the latest version of these packages. Since these package

How do I get Dockerhub to rebuild my image every day?

Dieter We have base images set up on Dockerhub and they will be rebuilt whenever the upstream repositories change. In our Dockerfiles, we installed several packages using apt-get. We want to always have the latest version of these packages. Since these package

How do I remove the background from this kind of image?

hans-t I want to remove the background of this image to get the person only. I have thousand of images like this, basically, a person and a somewhat whitish background. What I have done is to use edge detector like canny edge detector or sobel filter (from ski

Find the image file of the mounted ISO

neck When I mount the ISO file by double- clicking the ISO file (or a powershell command) C:\temp\demo.isoon Windows 10 and/or Windows Server , I can see the new disk (in this case it returned a new drive ):Mount-DiskImageI: Get-Volume I | fc class CimInstanc

How do I boot the Ubuntu ISO image on the drive?

username I can't boot to the Ubuntu 14.10 ISO I have on the drive (running Ubuntu 14.04 as the main OS). I added these lines to the bottom of /etc/grub.d/40_custom: menuentry 'ubuntu-iso' { set isofile="/boot/ubuntu-14.10-desktop-amd64.iso" loopback lo

How to copy files from mounted directory?

Miki Belavista I want to copy files from the installed directory to my HOME directory. my/mnt /mnt# ls '01 - Course Overview' '03 - Locating Elements & Navigating Dynamic Web Pages' '05 - Overcoming Challenges and Increasing Efficiency' '02 -

How to copy files from mounted directory?

Miki Belavista I want to copy files from the installed directory to my HOME directory. my/mnt /mnt# ls '01 - Course Overview' '03 - Locating Elements & Navigating Dynamic Web Pages' '05 - Overcoming Challenges and Increasing Efficiency' '02 -

How to copy files from mounted directory?

Miki Belavista I want to copy files from the installed directory to my HOME directory. my/mnt /mnt# ls '01 - Course Overview' '03 - Locating Elements & Navigating Dynamic Web Pages' '05 - Overcoming Challenges and Increasing Efficiency' '02 -

How do I rebuild PHP to a new version

Tamil Selvin C Today, I downloaded php-5.5.4-Win32-VC11-x86 (thread safe) and extracted it to a specific folder and changed httpd.conf as follows LoadModule php5_module "D:/Software/php-5.5.4-Win32-VC11-x86/php5apache2_4.dll" AddHandler application/x-httpd-php