Utilities icon indicating copy to clipboard operation
Utilities copied to clipboard

Create Live Media should handle split ISOs

Open probonopd opened this issue 4 years ago • 0 comments

We are now splitting ISOs when they become larger than 2 GB. The Create Live Media utility should be able to download and write such ISOs.

Manual workaround:

% sudo umount /dev/da0*
% cat hello-0.5.0_0E63-FreeBSD-13.0-amd64.iso.part1 >> hello-0.5.0_0E63-FreeBSD-13.0-amd64.iso.part0
% sudo dd if=hello-0.5.0_0E63-FreeBSD-13.0-amd64.iso.part0 of=/dev/da0 bs=4m status=progress

Possible approach:

import urllib.request
import shutil

self.current_offset = 0 # Increment this after each part that is being written

filename = archive[i]
with urllib.request.urlopen(url) as response, open(filename, 'wb') as out_file:
    fileObject.seek(self.current_offset, 0)
    shutil.copyfileobj(response, out_file) 

As a side effect of using shutil.copyfileobj we should also support writing local ISO files and local split ISO files like we currently do for Other... ISO URLs.

probonopd avatar Mar 31 '21 09:03 probonopd