Re: [gentoo-user] [OT] dmg2img hfs+ disk image

2019-02-23 Thread Mick
On Saturday, 23 February 2019 10:32:20 GMT Andrew Udvare wrote:
> On 23/02/2019 04:30, Mick wrote:
> > # mount -t hfsplus -o loop 4.hfs /media/dmg
> > mount: /media/dmg: failed to setup loop device for 4.hfs.
> 
> What does dmesg show? It should give more detail about the problem. Also
> try with `mount -v`.

I think the above message indicates there is no 4.hfs to be mounted.  No 
messages are reported in dmesg, or syslog.


> Normally 7z gets into the partition and extracts the files within, but
> only if the 'Method' is supported, like 'Zero0 Copy Zero2 ZLIB CRC'.
> Yours is 'Copy Zero2 ZLIB CRC'.

Should I be using a different incantation with 7z to apply the correct method?  
I've tried various things, but I can't come up with the correct syntax.


> Also you might want to try https://github.com/darlinghq/darling-dmg with
> the DMG file itself. This is far more active than the kernel module.

Thanks, I'll take a look at this too.

-- 
Regards,
Mick

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] [OT] dmg2img hfs+ disk image

2019-02-23 Thread Andrew Udvare
On 23/02/2019 04:30, Mick wrote:
> # mount -t hfsplus -o loop 4.hfs /media/dmg
> mount: /media/dmg: failed to setup loop device for 4.hfs.

What does dmesg show? It should give more detail about the problem. Also
try with `mount -v`.

Normally 7z gets into the partition and extracts the files within, but
only if the 'Method' is supported, like 'Zero0 Copy Zero2 ZLIB CRC'.
Yours is 'Copy Zero2 ZLIB CRC'.

Also you might want to try https://github.com/darlinghq/darling-dmg with
the DMG file itself. This is far more active than the kernel module.



Re: [gentoo-user] [OT] dmg2img hfs+ disk image

2019-02-23 Thread Mick
On Saturday, 23 February 2019 00:57:45 GMT Andrew Udvare wrote:
> > On Feb 22, 2019, at 19:00, Mick  wrote:
> > 
> > Hi All,
> > 
> > A bit off topic, but given I'm trying this on a gentoo system and the high
> > cumulative knowledge of contributors to this M/L, I thought I might as
> > well
> > ask here.  I'm trying to access the various partitions within a .dmg
> > archive,
> This way using the kernel HFS+ driver:
> 
> https://github.com/nickl-/xchain-ios#prepare-your-prefix-no-mac
> 
> This way without the driver:
> 
> https://github.com/Tatsh/xchain#prepare-your-prefix-no-mac

WOW!  I should have posted earlier.  ;-)

Thanks Andrew.  I tried with the kernel driver, since I have it built in the 
kernel and also have sys-fs/diskdev_cmds and sys-fs/hfsplusutils already 
installed, but don't have java available.  It won't work:

=
# 7z x BaseSystem.dmg 

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_GB.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs 
Intel(R) Core(TM) i7 CPU   Q 720  @ 1.60GHz (106E5),ASM)

Scanning the drive for archives:
1 file, 482126050 bytes (460 MiB)

Extracting archive: BaseSystem.dmg
--
Path = BaseSystem.dmg
Type = Dmg
Physical Size = 482126050
Method = Copy Zero2 ZLIB CRC
Blocks = 590

Path = 4.hfs
Size = 2013085696
Packed Size = 482080513
Comment = disk image (Apple_HFS : 4)
Method = Copy Zero2 ZLIB CRC
--
Path = 4.hfs
Type = HFS
Physical Size = 2013085696
Method = HFS+
Cluster Size = 4096
Free Space = 740196352
Created = 2018-10-24 02:10:14
Modified = 2018-10-24 09:23:00

Everything is Ok   

Folders: 10639
Files: 39974
Size:   1121934759
Compressed: 482126050

# ls -la
total 470844
drwxr-xr-x  3 michael michael  4096 Feb 23 08:43  .
drwxr-xr-x  7 michael michael  4096 Feb 22 19:22  ..
-rw-r--r--  1 michael michael 482126050 Feb 22 19:25  BaseSystem.dmg
drwx-- 16 rootroot 4096 Oct 24 10:14 'OS X Base System'

# mount -t hfsplus -o loop 4.hfs /media/dmg
mount: /media/dmg: failed to setup loop device for 4.hfs.

It seems the 4.hfs image is not extracted as a separate component?

-- 
Regards,
Mick

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] [OT] dmg2img hfs+ disk image

2019-02-22 Thread Andrew Udvare


> On Feb 22, 2019, at 19:00, Mick  wrote:
> 
> Hi All,
> 
> A bit off topic, but given I'm trying this on a gentoo system and the high 
> cumulative knowledge of contributors to this M/L, I thought I might as well 
> ask here.  I'm trying to access the various partitions within a .dmg archive, 

This way using the kernel HFS+ driver:

https://github.com/nickl-/xchain-ios#prepare-your-prefix-no-mac

This way without the driver:

https://github.com/Tatsh/xchain#prepare-your-prefix-no-mac

[gentoo-user] [OT] dmg2img hfs+ disk image

2019-02-22 Thread Mick
Hi All,

A bit off topic, but given I'm trying this on a gentoo system and the high 
cumulative knowledge of contributors to this M/L, I thought I might as well 
ask here.  I'm trying to access the various partitions within a .dmg archive, 
but I have so far failed to achieve this.  I decompressed it with dmg2img:


 $ dmg2img -v BaseSystem.dmg 

dmg2img v1.6.7 (c) vu1tur (t...@vu1tur.eu.org)

BaseSystem.dmg --> BaseSystem.img

reading property list, 44613 bytes from address 482080925 ...
partition 0: begin=203, size=430, decoded=284
partition 1: begin=948, size=430, decoded=284
partition 2: begin=1695, size=430, decoded=284
partition 3: begin=2424, size=430, decoded=284
partition 4: begin=3137, size=35000, decoded=23564
partition 5: begin=38420, size=430, decoded=284
partition 6: begin=39148, size=430, decoded=284
partition 7: begin=39893, size=430, decoded=284

decompressing:
opening partition 0 ... [2] 100.00%  ok
opening partition 1 ... [2] 100.00%  ok
opening partition 2 ... [2] 100.00%  ok
opening partition 3 ... [2] 100.00%  ok
opening partition 4 ...   [584] 100.00%  ok
opening partition 5 ... [2] 100.00%  ok
opening partition 6 ... [2] 100.00%  ok
opening partition 7 ... [2] 100.00%  ok

Archive successfully decompressed as BaseSystem.img
===

The above output from dmg2img indicates there are 8 partitions within this 
image.  Copying it on a USB stick:

# dd if=BaseSystem.img of=/dev/sdb
4194032+0 records in
4194032+0 records out
2147344384 bytes (2.1 GB, 2.0 GiB) copied, 586.076 s, 3.7 MB/s


However, gdisk has a different view:

[snip ...]
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 82509A33-366D-447F-9585-851F941276D8
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 4193998
Partitions will be aligned on 8-sector boundaries
Total free space is 262157 sectors (128.0 MiB)

Number  Start (sector)End (sector)  Size   Code  Name
   1  40 3931847   1.9 GiB AF00  disk image

gdisk only shows one partition, which I can mount on the USB stick as a single 
HFS+ partition.  

7z shows the filesystem contents within the dmg and img archive, but it does 
not output each partition:

Scanning the drive for archives:
1 file, 482126050 bytes (460 MiB)

Listing archive: BaseSystem.dmg

--
Path = BaseSystem.dmg
Type = Dmg
Physical Size = 482126050
Method = Copy Zero2 ZLIB CRC
Blocks = 590

Path = 4.hfs
Size = 2013085696
Packed Size = 482080513
Comment = disk image (Apple_HFS : 4)
Method = Copy Zero2 ZLIB CRC
--
Path = 4.hfs
Type = HFS
Physical Size = 2013085696
Method = HFS+
Cluster Size = 4096
Free Space = 740196352
Created = 2018-10-24 02:10:14
Modified = 2018-10-24 09:23:00

   Date  TimeAttr Size   Compressed  Name
--- -    
2018-10-24 09:14:13 DOS X Base System
2018-10-24 09:10:14 DOS X Base System/.HFS+ 
Private Directory Data
2018-08-17 21:54:02 DOS X Base System/.vol
[snip ...]


Any idea how I can access each partition within the disk image itself on 
Linux?

-- 
Regards,
Mick

signature.asc
Description: This is a digitally signed message part.