Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

.dmg -----> .iso

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
eleanor
l33t
l33t
User avatar
Posts: 666
Joined: Mon Nov 01, 2004 4:23 am

.dmg -----> .iso

  • Quote

Post by eleanor » Fri Nov 25, 2005 3:05 pm

Can I ask you how to convert an .dmg file into an .iso file, so that I would be able to burn it on the cd?

And ideas?
Top
kasperhans
Tux's lil' helper
Tux's lil' helper
Posts: 90
Joined: Tue Nov 04, 2003 12:44 pm
Location: Hansestadt Bremen - Germany

  • Quote

Post by kasperhans » Fri Nov 25, 2005 3:16 pm

[/quote] 20. Convert .dmg files to .iso [Computer Tips]

Use this terminal command to convert a .dmg to .iso:

Code: Select all

hdiutil convert /path/to/file.dmg -format UDTO -o /path/to/file.iso 
http://convertiso.fehsiso.com/convertdmgiso/
http://convertiso.fehsiso.com/toconvertdmgtoiso/

Code: Select all

hdiutil convert /dev/disk1s1s2 -format UDTO -o ~/Desktop/CD Name hdiutil burn ~/Desktop/CDName.dmg -noverifyburn -noeject creating data dvds mkisofs -V Disk Label -J -r -o myimage.iso data_dir ...

btw simple google search featuring the following words "dmg to iso linux" would have solved your problem within some seconds ...
stay high and life the all day flight
Top
eleanor
l33t
l33t
User avatar
Posts: 666
Joined: Mon Nov 01, 2004 4:23 am

  • Quote

Post by eleanor » Fri Nov 25, 2005 5:03 pm

Yes I tried that before and it said, that hdiutil command not found. When I tried to emerge it it says:
Searching...
[ Results for search key : hdiutil ]
[ Applications found : 0 ]
Top
krazykit
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Sat Aug 28, 2004 5:12 pm

  • Quote

Post by krazykit » Fri Nov 25, 2005 5:06 pm

I found this perl script mirrored... somewhere... using Google. Credits go to Jeff Mahoney (the script writer, I assume)
dmg2iso.pl

Code: Select all

#!/usr/bin/perl -w

# Changes:
#
# Tue Apr 26 15:49:53 EDT 2005 Jeff Mahoney <jeff.mahoney@gmail.com>
# * read/writes now do so in 4k blocks rather than allocate
#   huge chunks of memory

use MIME::Base64;
use strict ;
local ($^W) = 1; #use warnings ;
use Compress::Zlib ;
my $x = inflateInit()
   or die "ERROR: Cannot create inflation stream. Is Compress::zlib installed?\n" ;
my $zfblock="\x00"; for (0..8) { $zfblock.=$zfblock; }
my $indxbeg=0;
my $indxend=0;
my $blocksz = 4096;
my @plist;
print "dmg2iso v0.2a by vu1tur (vu1tur\@gmx.de)\n\n";
if (@ARGV."" != 2) { die "Syntax: dmg2iso.pl filename.dmg filename.iso\n"; }
my $zeroblock = "\x00";
for (0..8) { $zeroblock.=$zeroblock; }
my $tmp;
my ($output,$status);
my $buffer;
open(FINPUT,$ARGV[0]) or die "ERROR: Can't open input file\n";

binmode FINPUT;
sysseek(FINPUT,-0x200000,2);
print "reading property list...";
my $fpos = sysseek(FINPUT,0,1);
while(my $ar = sysread(FINPUT,$buffer,0x10000))
{
        my $fpos = sysseek(FINPUT,0,1)-$ar;
        if ($buffer =~ /(.*)<plist version=\"1.0\">/s)
        {
                $indxbeg = $fpos+length($1);
        }
        if ($buffer =~ /(.*)<\/plist>/s)
        {
                $indxend = $fpos+length($1)+8;
        }
}
open(FOUTPUT,">".$ARGV[1]) or die "ERROR: Can't open output file\n";
binmode FOUTPUT;
my $indxcur = $indxbeg + 0x28;
sysseek(FINPUT,$indxbeg,0);
sysread(FINPUT,$tmp,$indxend-$indxbeg);

if ($tmp =~ s/.*<key>blkx<\/key>.*?\s*<array>(.*?)<\/array>.*/$1/s)
{
        while ($tmp =~ s/.*?<data>(.*?)<\/data>//s)
        {
                my $t = $1;
                $t =~ s/\t//g;
                $t =~ s/^\n//g;
                push @plist,decode_base64($t);
        }
} else {
die "PropertyList is corrupted\n";
}
print "found ".@plist." partitions\n";
print "decompressing:\n";

my $t=0;
my $zoffs = 0;
my $tempzoffs = 0;
foreach (@plist)
{
        print "partition ".$t++."\n";
        s/^.{204}//s;
        while (s/^(.{8})(.{8})(.{8})(.{8})(.{8})//s)
        {
                $x = inflateInit();
                my $block_type = unpack("H*",$1);
                my $out_offs = 0x200*hex(unpack("H*",$2));
                my $out_size = 0x200*hex(unpack("H*",$3));
                my $in_offs = hex(unpack("H*",$4));
                my $in_size = hex(unpack("H*",$5));
                # $1 - block type, $2 - output offs $3 - output size $4 input offset $5 - input size
                sysseek(FINPUT,$in_offs+$zoffs,0);
                
                if ($block_type =~ /^80000005/ or $block_type =~ /^00000001/)
                {
                        do {
                                my ($toread, $res);
                                $toread = $blocksz;
                                $toread = $in_size if ($in_size < $blocksz);

                                $res = sysread (FINPUT, $tmp, $toread);
                                die "read failure" if ($res != $toread);
                                $output = $tmp;

                                # If compressed, inflate it
                                if ($block_type =~ /^80000005/) {
                                        ($output,$status) = $x->inflate($tmp);
                                        die "\nConversion failed.File may be corrupted.\n"
                                            if (!($status == Z_OK or $status == Z_STREAM_END));
                                }
                                print FOUTPUT $output;
                                $in_size -= $toread;
                        } while ($in_size > 0);
                }
                if ($block_type =~ /^00000002/)
                {
                        for(1..$out_size/0x200) 
                        {
                                syswrite(FOUTPUT,$zeroblock,0x200);
                        }
                }
                if ($block_type =~ /^FFFFFFFF/i)
                {
                        $zoffs += $tempzoffs;
                }
                $tempzoffs = $in_offs+$in_size;
        }
}

print "\nconversion successful\n";
Top
kasperhans
Tux's lil' helper
Tux's lil' helper
Posts: 90
Joined: Tue Nov 04, 2003 12:44 pm
Location: Hansestadt Bremen - Germany

  • Quote

Post by kasperhans » Fri Nov 25, 2005 5:21 pm

ok man good 4 ya :) reading is important now heres your solution
btw i remembered it because during my ipod shuffle isntall i read something about youre question content

this is how it should work we use a little pl script from gnupod , be sure to have pearl installed :)

Code: Select all

# Grab a working copy of dmg2iso.pl
wget http://blinkenlights.ch/gnupod/dmg2iso.pl
# Convert the dmg into iso
perl dmg2iso.pl yourfile.dmg yournewfile.iso
hope it works and makes you happy :) because its weekend and everyone should be happy haeh?
please post if worked

btw sry because of hdiutil is only avaible on mac :) forgot about this but with those 2 commands above it should work as well who someone else had same idea maybe even same script :)
stay high and life the all day flight
Top
eleanor
l33t
l33t
User avatar
Posts: 666
Joined: Mon Nov 01, 2004 4:23 am

  • Quote

Post by eleanor » Fri Nov 25, 2005 5:24 pm

Didn't work:
eleanor@localhost ~ $ perl /home/eleanor/dmg2iso.pl /home/eleanor/Desktop/macosx_10.4.3_8f1111_for_dtk_userdvd.dmg /home/eleanor/Desktop/mac.iso
Can't locate Compress/Zlib.pm in @INC (@INC contains: /etc/perl /usr/lib/perl5/site_perl/5.8.6/i386-linux /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.6/i386-linux /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.6/i386-linux /usr/lib/perl5/5.8.6 /usr/local/lib/site_perl .) at /home/eleanor/dmg2iso.pl line 15.
BEGIN failed--compilation aborted at /home/eleanor/dmg2iso.pl line 15.
Top
pjp
Administrator
Administrator
User avatar
Posts: 20668
Joined: Tue Apr 16, 2002 10:35 pm

  • Quote

Post by pjp » Fri Nov 25, 2005 7:13 pm

Moved from Installing Gentoo
Quis separabit? Quo animo?
Top
kasperhans
Tux's lil' helper
Tux's lil' helper
Posts: 90
Joined: Tue Nov 04, 2003 12:44 pm
Location: Hansestadt Bremen - Germany

  • Quote

Post by kasperhans » Fri Nov 25, 2005 8:39 pm

you need perl moudle Compress::Zlib ...

btw what do you actual plan to do for dmg to iso?
you plan to illegaly rip a macos dvd ???
stay high and life the all day flight
Top
eleanor
l33t
l33t
User avatar
Posts: 666
Joined: Mon Nov 01, 2004 4:23 am

  • Quote

Post by eleanor » Sat Nov 26, 2005 10:35 am

dmg2iso v0.2a by vu1tur (vu1tur@gmx.de)

reading property list...found 4 partitions
decompressing:
partition 0
partition 1

Conversion failed. File may be corrupted.
Any ideas? The only thing left for me is to download an iso, right?
Top
linuxtuxhellsinki
l33t
l33t
User avatar
Posts: 700
Joined: Mon Nov 15, 2004 1:56 pm
Location: Hellsinki

  • Quote

Post by linuxtuxhellsinki » Sat Nov 26, 2005 1:32 pm

My conversion went fine but it isn't show like .iso, so how-to make it bootable :?:

Code: Select all

mandrake ~ # file OS7.5.3.iso
OS7.5.3.iso: data
This is how it supposed to look like.

Code: Select all

mandrake ~ # file dsl-1.0.iso
dsl-1.0.iso: ISO 9660 CD-ROM filesystem data 'KNOPPIX                        ' (bootable)
Is there some way to mount it via the loop device & add the bootable option in it ? I remember that there was written that U loose the bootable option when making the conversion to .iso.
1st use 'Search' & lastly add [Solved] to
the subject of your first post in the thread.
Top
Post Reply

10 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic