summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-09-24 17:25:58 +0000
committerOlivier Blin <oblin@mandriva.com>2008-09-24 17:25:58 +0000
commit96084b481bee2efd6bb0b4f91001b9a6069a2f51 (patch)
treeb177c1788589ca328c6d7bc64d7ec11e8048c445
parent974bf7cdebc3c1f8dd889a28885d2482af054603 (diff)
downloaddraklive-96084b481bee2efd6bb0b4f91001b9a6069a2f51.tar
draklive-96084b481bee2efd6bb0b4f91001b9a6069a2f51.tar.gz
draklive-96084b481bee2efd6bb0b4f91001b9a6069a2f51.tar.bz2
draklive-96084b481bee2efd6bb0b4f91001b9a6069a2f51.tar.xz
draklive-96084b481bee2efd6bb0b4f91001b9a6069a2f51.zip
build compressed harddisk image (for now bzipped, could be extracted through partimage later)
-rwxr-xr-xdraklive28
1 files changed, 27 insertions, 1 deletions
diff --git a/draklive b/draklive
index 9bfcd53..f0c538f 100755
--- a/draklive
+++ b/draklive
@@ -158,6 +158,7 @@ my %storage = (
fs => 'ext3',
create => \&create_disk_master,
record => \&record_harddisk_master,
+ image => \&create_disk_image,
},
);
@@ -1616,6 +1617,29 @@ sub record_onthefly {
}
}
+sub get_disk_image_path {
+ my ($live) = @_;
+ get_disk_master_path($live) . '.bz2';
+}
+
+sub create_disk_image {
+ my ($live) = @_;
+ my $master =get_disk_master_path($live);
+ my $dest = get_disk_image_path($live);
+ mkdir_p(dirname($dest));
+ run_('bzip2', '>', $dest, '-f', '-k', '-c', $master);
+}
+
+sub create_image {
+ my ($live) = @_;
+
+ if (my $create = get_boot_setting($live->{media}, 'image')) {
+ $create->($live);
+ } else {
+ warn "not implemented yet\n";
+ }
+}
+
sub copy_wizard {
my ($live) = @_;
@@ -1836,11 +1860,12 @@ my @actions = (
{ name => 'boot', do => \&prepare_bootloader },
{ name => 'loop', do => \&create_loopback_files },
{ name => 'master', do => \&create_master },
+ { name => 'image', do => \&create_image },
{ name => 'format', do => \&format_device },
{ name => 'record', do => \&record_master },
{ name => 'record-onthefly', do => \&record_onthefly },
);
-my @all = qw(install boot loop master);
+my @all = qw(install boot loop master image);
die "you must be root to run this program\n" if $>;
@@ -1899,6 +1924,7 @@ draklive [options]
--boot prepare initrd and bootloader files
--loop build compressed loopback files
--master build master image
+ --image build compressed master image
--all run all steps, from installation to mastering