aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/install/module/install_data/module.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2016-11-06 15:41:59 +0100
committerTristan Darricau <github@nicofuma.fr>2016-11-06 15:41:59 +0100
commitcd348b200a6d3711eee6b8f028d9c7caef268e5f (patch)
tree0a3655b1870d81339c3679cc584de2d3c005f748 /phpBB/phpbb/install/module/install_data/module.php
parentecb81894ccefd6b6de3bee6c192497c59524da4e (diff)
parentdc32b900c58943df25ae5085c96ad47fc6e67c61 (diff)
downloadforums-cd348b200a6d3711eee6b8f028d9c7caef268e5f.tar
forums-cd348b200a6d3711eee6b8f028d9c7caef268e5f.tar.gz
forums-cd348b200a6d3711eee6b8f028d9c7caef268e5f.tar.bz2
forums-cd348b200a6d3711eee6b8f028d9c7caef268e5f.tar.xz
forums-cd348b200a6d3711eee6b8f028d9c7caef268e5f.zip
Merge branch '3.1.x' into 3.2.x
* 3.1.x: [ticket/11483] Add tests for generating user act key on force reactivate [ticket/11483] Generate user act key if database entry is empty
Diffstat (limited to 'phpBB/phpbb/install/module/install_data/module.php')
0 files changed, 0 insertions, 0 deletions
' href='#n60'>60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
package fs::format; # $Id: format.pm 268842 2010-05-17 06:54:44Z pterjan $

use diagnostics;
use strict;
use String::ShellQuote;

use run_program;
use common;
use fs::type;
use fs::loopback;
use log;

my %cmds = (
    ext2     => [ 'e2fsprogs', 'mkfs.ext2', '-F' ],
    ext3     => [ 'e2fsprogs', 'mkfs.ext3', '-F' ],
    ext4     => [ 'e2fsprogs', 'mkfs.ext4', '-F' ],
    reiserfs => [ 'reiserfsprogs', 'mkfs.reiserfs', '-ff' ],
    reiser4  => [ 'reiser4progs', 'mkfs.reiser4', '-f', '-y' ],
    xfs      => [ 'xfsprogs', 'mkfs.xfs', '-f', '-q' ],
    jfs      => [ 'jfsutils', 'mkfs.jfs', '-f' ],
    hfs      => [ 'hfsutils', 'hformat' ],
    dos      => [ 'dosfstools', 'mkdosfs' ],
    vfat     => [ 'dosfstools', 'mkdosfs', '-F', '32' ],
    swap     => [ 'util-linux', 'mkswap' ],
    ntfs     => [ 'ntfsprogs', 'mkntfs', '--fast' ],
   'ntfs-3g' => [ 'ntfsprogs', 'mkntfs', '--fast' ],
    btrfs    => [ 'btrfs-progs', 'mkfs.btrfs' ],
    nilfs2   => [ 'nilfs-utils', 'mkfs.nilfs2' ],
);

my %LABELs = ( #- option, length, handled_by_mount
    ext2     => [ '-L', 16, 1 ],
    ext3     => [ '-L', 16, 1 ],
    ext4     => [ '-L', 16, 1 ],
    reiserfs => [ '-l', 16, 1 ],
    reiser4  => [ '-L', 16, 1 ],
    xfs      => [ '-L', 12, 1 ],
    jfs      => [ '-L', 16, 1 ],
    hfs      => [ '-l', 27, 0 ],
    dos      => [ '-n', 11, 0 ],
    vfat     => [ '-n', 11, 0 ],
    swap     => [ '-L', 15, 1 ],
    ntfs     => [ '-L', 128, 0 ],
   'ntfs-3g' => [ '-L', 128, 0 ],
    btrfs    => [ '-L', 256, 1 ],
    nilfs2   => [ '-L', 16, 1 ],
);

my %edit_LABEL = ( # package, command, option
# If option is defined, run <command> <option> <label> <device>
# If no option, run <command> <device> <label>
    ext2     => [ 'e2fsprogs', 'tune2fs', '-L' ],
    ext3     => [ 'e2fsprogs', 'tune2fs', '-L' ],
    ext4     => [ 'e2fsprogs', 'tune2fs', '-L' ],
    reiserfs => [ 'reiserfsprogs', 'reiserfstune', '-l' ],
#    reiser4
    xfs      => [ 'xfsprogs', 'xfs_admin', '-L' ],
    jfs      => [ 'jfsutils', 'jfs_tune', '-L' ],
#    hfs
    dos      => [ 'mtools', 'mlabel', '-i' ],
    vfat     => [ 'mtools', 'mlabel', '-i' ],
    swap     => [ 'util-linux', 'swaplabel', '-L' ],
    ntfs     => [ 'ntfsprogs', 'ntfslabel' ],
   'ntfs-3g' => [ 'ntfsprogs', 'ntfslabel' ],
    btrfs => [ 'btrfs-progs', 'btrfs', 'filesystem', 'label' ],
    nilfs2 => [ 'nilfs-utils', 'nilfs-tune', '-L' ],
);

# Preserve UUID on fs where we couldn't enforce it while formatting
my %preserve_UUID = ( # package, commande
    #btrfs    => [ 'btrfs-progs', 'FIXME' ],
    jfs      => [ 'jfsutils', 'jfs_tune', ],
    xfs      => [ 'xfsprogs', 'xfs_admin' ],
    nilfs2   => [ 'nilfs-utils', 'nilfs-tune' ],
);
 
sub package_needed_for_partition_type {
    my ($part) = @_;
    my $l = $cmds{$part->{fs_type}} or return;
    $l->[0];
}

sub known_type {
    my ($part) = @_;
    to_bool($cmds{$part->{fs_type}});
}

sub check_package_is_installed_format {
    my ($do_pkgs, $fs_type) = @_;

    my ($pkg, $binary) = @{$cmds{$fs_type} || return};
    whereis_binary($binary) || $do_pkgs->ensure_binary_is_installed($pkg, $binary); #- ensure_binary_is_installed checks binary chrooted, whereas we run the binary non-chrooted (pb for Mageia One)
}

sub check_package_is_installed_label {
    my ($do_pkgs, $fs_type) = @_;

    my ($pkg, $binary) = @{$edit_LABEL{$fs_type} || return};