diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-10-28 23:57:21 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-10-28 23:57:21 +0000 |
commit | 208f1e470d70eec5f372b26c7c467c3e080c90d6 (patch) | |
tree | efc69d592fc277559433b3fabc1821e679d9107a | |
parent | 445348796f67ee14f85d84291877d766834237a9 (diff) | |
download | drakiso-208f1e470d70eec5f372b26c7c467c3e080c90d6.tar drakiso-208f1e470d70eec5f372b26c7c467c3e080c90d6.tar.gz drakiso-208f1e470d70eec5f372b26c7c467c3e080c90d6.tar.bz2 drakiso-208f1e470d70eec5f372b26c7c467c3e080c90d6.tar.xz drakiso-208f1e470d70eec5f372b26c7c467c3e080c90d6.zip |
rename loop hash as loop_types
-rwxr-xr-x | draklive | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -185,8 +185,8 @@ sub nls_modules { } my $loop_number = 0; -my %loop; -%loop = ( +my %loop_types; +%loop_types = ( squashfs => { read_only => 1, is_loopback => 1, @@ -194,7 +194,7 @@ my %loop; extension => '-lzma.sqfs', build => sub { my ($live, $dir) = @_; - my $dest = $live->get_builddir . $live->{prefix}{build}{loopbacks} . $dir->{path} . $loop{squashfs}{extension}; + my $dest = $live->get_builddir . $live->{prefix}{build}{loopbacks} . $dir->{path} . $loop_types{squashfs}{extension}; mkdir_p(dirname($dest)); my $root = $dir->{root} || $live->get_system_root; my $src = $root . $dir->{build_from}; @@ -223,7 +223,7 @@ my %loop; $dir->{loop} = "/dev/loop" . $loop_number++; my $media_loopbacks = $live->get_media_prefix('loopbacks'); ( - "/bin/losetup $dir->{loop} $live->{prefix}{live}{mnt}$live->{prefix}{media}{mnt}${media_loopbacks}$dir->{path}$loop{squashfs}{extension}", + "/bin/losetup $dir->{loop} $live->{prefix}{live}{mnt}$live->{prefix}{media}{mnt}${media_loopbacks}$dir->{path}$loop_types{squashfs}{extension}", "nash-mount -o ro -t squashfs $dir->{loop} $live->{prefix}{live}{mnt}$dir->{mountpoint}", ); }, @@ -243,7 +243,7 @@ my %loop; extension => '.loop', build => sub { my ($live, $dir) = @_; - my $dest = $live->get_builddir . $live->{prefix}{build}{loopbacks} . $dir->{path} . $loop{loopfs}{extension}; + my $dest = $live->get_builddir . $live->{prefix}{build}{loopbacks} . $dir->{path} . $loop_types{loopfs}{extension}; mkdir_p(dirname($dest)); MDV::Draklive::Utils::device_allocate_file($dest, $dir->{pre_allocate}); MDV::Draklive::Utils::device_mkfs($dest, $dir->{fs}) if !defined $dir->{min_size}; @@ -254,7 +254,7 @@ my %loop; my $fsck = "chroot </dev/tty1 $live->{prefix}{live}{mnt}$dir_distrib_sqfs->{mountpoint} /sbin/fsck $dir->{loop}"; my $media_loopbacks = $live->get_media_prefix('loopbacks'); ( - "losetup $dir->{loop} $live->{prefix}{live}{mnt}$live->{prefix}{media}{mnt}${media_loopbacks}$dir->{path}$loop{loopfs}{extension}", + "losetup $dir->{loop} $live->{prefix}{live}{mnt}$live->{prefix}{media}{mnt}${media_loopbacks}$dir->{path}$loop_types{loopfs}{extension}", qq(sh -c "$fsck -a || $fsck -y"), "nash-mount -t $dir->{fs} $dir->{loop} $live->{prefix}{live}{mnt}$dir->{mountpoint}", ); @@ -297,7 +297,7 @@ my %overlay = ( map { $_->{list} ? "\$(cat $live->{prefix}{live}{mnt}/$_->{list})" : "$live->{prefix}{live}{mnt}$_->{mountpoint}=" . - (!$loop{$_->{type}}{read_only} && !$_->{read_only} ? 'rw' : 'ro'); + (!$loop_types{$_->{type}}{read_only} && !$_->{read_only} ? 'rw' : 'ro'); } reverse grep { !$_->{fallback} } @{$live->{mount}{dirs} || []}); "sh -c 'mount -o dirs=$dirs -t unionfs unionfs $live->{prefix}{live}{mnt}$live->{mount}{root}'"; }, @@ -391,7 +391,7 @@ sub create_initrd_for_media { my @loop_types = uniq(map { $_->{type} } @{$live->{mount}{dirs}}); inst_initrd_bin($live->get_system_root, $initrd_tree, $_) foreach MDV::Draklive::StorageFS::get_files($fs), - (map { @{$loop{$_} && $loop{$_}{files} || []} } @loop_types); + (map { @{$loop_types{$_} && $loop_types{$_}{files} || []} } @loop_types); output_p($initrd_tree . '/etc/fstab', ''); output_p($initrd_tree . '/etc/mtab', ''); @@ -421,7 +421,7 @@ sub create_initrd_for_media { nls_modules($live), $media->get_media_fs_module, @{$media->get_media_setting('extra_modules') || []}, - (map { @{$loop{$_}{modules} || []} } uniq(map { $_->{type} } @{$live->{mount}{dirs} || []})), + (map { @{$loop_types{$_}{modules} || []} } uniq(map { $_->{type} } @{$live->{mount}{dirs} || []})), ($live->{mount}{overlay} ? @{$overlay{$live->{mount}{overlay}}{modules} || []} : ()); my @additional_modules = map { if_(m!([^/]+)\.ko(?:\.gz)?!, list_modules::filename2modname($1)) } @{$live->{system}{additional_modules}}; @@ -477,8 +477,8 @@ sub create_initrd_scriptlet { my $fs = $media->get_media_setting('fs'); my $rrpt_dev = $media->get_media_setting('rereadpt'); my $debug_shell = "sh -c 'if grep -q initrd_debug /proc/cmdline; then exec sh </dev/console >/dev/console 2>/dev/console; fi'"; - my ($mount_first, $mount_last) = partition { !$loop{$_->{type}}{delay_mount} } - grep { exists $loop{$_->{type}}{mount} } @{$live->{mount}{dirs} || []}; + my ($mount_first, $mount_last) = partition { !$loop_types{$_->{type}}{delay_mount} } + grep { exists $loop_types{$_->{type}}{mount} } @{$live->{mount}{dirs} || []}; output_with_perm($live->get_builddir . $live->{prefix}{build}{initrd} . '/' . $media->{storage} . '/linuxrc', 0755, join("\n", @@ -499,7 +499,7 @@ sub create_initrd_scriptlet { "mkdevices /dev", "showlabels --removable", MDV::Draklive::StorageFS::get_mount($fs)->($live, $media), - (map { $loop{$_->{type}}{mount}->($live, $_) } @$mount_first, @$mount_last), + (map { $loop_types{$_->{type}}{mount}->($live, $_) } @$mount_first, @$mount_last), ($live->{mount}{overlay} ? $overlay{$live->{mount}{overlay}}{mount}->($live) : ()), if_($live->{system}{initrd_pre_pivot}, deref_array($live->{system}{initrd_pre_pivot})), qq(splashy_update "chroot $target"), @@ -915,16 +915,16 @@ sub create_loopback_files { my @excluded_files = expand_file_list($live, @{$live->{loopbacks}{exclude}{files} || []}); my @modules_files = expand_file_list($live, @{$live->{loopbacks}{modules} || []}); - foreach (grep { exists $loop{$_->{type}}{build} } @{$live->{mount}{dirs} || []}) { + foreach (grep { exists $loop_types{$_->{type}}{build} } @{$live->{mount}{dirs} || []}) { local $_->{exclude} = [ @excluded_files, @modules_files ]; - $loop{$_->{type}}{build}->($live, $_); + $loop_types{$_->{type}}{build}->($live, $_); } foreach my $module (list_loopback_modules($live)) { my $copy_tree = $live->get_system_root . "/tmp/draklive/loop/$module->{name}"; eval { rm_rf($copy_tree) }; hardlink_filtered($live->get_system_root, $copy_tree, $module->{files}); - my $loop = $loop{$module->{type}}; + my $loop = $loop_types{$module->{type}}; $loop->{build}->($live, { path => "$live->{prefix}{build}{modules}/$module->{name}$loop->{extension}", root => $copy_tree, exclude => \@excluded_files }); eval { rm_rf($copy_tree) }; } @@ -938,12 +938,12 @@ sub create_loopback_files { my $copy_tree = $live->get_system_root . "/tmp/draklive/excluded/$module->{name}"; eval { rm_rf($copy_tree) }; hardlink_filtered($excluded_tree, $copy_tree, $module->{files}); - my $loop = $loop{$module->{type}}; + my $loop = $loop_types{$module->{type}}; $loop->{build}->($live, { path => "$live->{prefix}{build}{modules}/excluded-$module->{name}$loop->{extension}", root => $copy_tree }); eval { rm_rf($copy_tree) }; } - my $loop = $loop{$live->{loopbacks}{exclude}{type}}; + my $loop = $loop_types{$live->{loopbacks}{exclude}{type}}; $loop->{build}->($live, { path => "/excluded$loop->{extension}", root => $excluded_tree, exclude => \@modules_files }); eval { rm_rf($excluded_tree) }; @@ -952,7 +952,7 @@ sub create_loopback_files { sub list_selected_loopbacks { my ($live) = @_; - (map { $loop{$_->{type}}{is_loopback} && $_->{path} ? $_->{path} . $loop{$_->{type}}{extension} : () } @{$live->{mount}{dirs} || []}), + (map { $loop_types{$_->{type}}{is_loopback} && $_->{path} ? $_->{path} . $loop_types{$_->{type}}{extension} : () } @{$live->{mount}{dirs} || []}), (map { $live->{prefix}{build}{modules} . '/' . $_ } $live->{settings}{pack} ? @{$live->{packs}{$live->{settings}{pack}} || []} : ()); } |