How to convert img files to iso files

This script allows you to convert from img files to iso files. To work it needs two standard commands included in most of Linux distribution:

mkisofs

dd

If you don’t have this tools installed you need to install them

#!/bin/sh
###############################################################################
# img to iso script                                                           #
# 2009 www.xAppSoftware.com                                                   #
# Luigi D’Andrea                                                              #
#——————————————————————————————————————————-#
# save this script, then chmod +x the script, the you are ready to run it     #
#—————————————————————————–—————————————————#
# Licence:                                                                    #
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS “AS IS” AND ANY   #
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED   #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE      #
# DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY #
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES  #
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;#
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND #
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  #
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF    #
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.           #
###############################################################################
case "$#" in
    0)      echo "Usage: `basename $0` <file_to_convert>";
    exit;;
esac
mount -o loop $1 /tmp

mkisofs -o ./cd.iso /tmp/

umount /tmp

 


Posted by at May 10, 2009
Filed in category: Bash Tip & Tricks, linux, UNIX TLC, xAppSoftware News, and tagged with: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <font color="" face="" size=""> <span style="">

Statistical data collected by Statpress SEOlution (blogcraft).