-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable boot image download for iso images
* Implement fetch and extract boot image * Apply correct file permissions * Introduce and add tests for fetch_boot_image * Implement class for file extraction
- Loading branch information
1 parent
9268440
commit 3a4bdf8
Showing
7 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module Proxy | ||
class ArchiveExtract < Proxy::Util::CommandTask | ||
include Util | ||
|
||
def initialize(image_path, file_in_image, dst_path) | ||
|
||
args = [which('isoinfo')] | ||
|
||
# read the file | ||
args << "-R" | ||
# set image path | ||
args += ["-i", image_path.to_s] | ||
# set file path within the image | ||
args += ["-x", file_in_image.to_s] | ||
|
||
super(args, input=nil, output=dst_path) | ||
end | ||
|
||
def start | ||
lock = Proxy::FileLock.try_locking(File.join(File.dirname(@output), ".#{File.basename(@output)}.lock")) | ||
if lock.nil? | ||
false | ||
else | ||
super do | ||
Proxy::FileLock.unlock(lock) | ||
File.unlink(lock) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters