summaryrefslogtreecommitdiffstats
path: root/move/tree/mdk_totem
diff options
context:
space:
mode:
Diffstat (limited to 'move/tree/mdk_totem')
-rwxr-xr-xmove/tree/mdk_totem125
1 files changed, 0 insertions, 125 deletions
diff --git a/move/tree/mdk_totem b/move/tree/mdk_totem
deleted file mode 100755
index 0a54248ac..000000000
--- a/move/tree/mdk_totem
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/perl
-
-use lib qw(../../perl-install /usr/lib/libDrakX);
-use common;
-use interactive;
-
-sub busy_pids_and_files() {
- my @pids = grep { $_ ne $$ && /^(\d+)$/ } all('/proc');
-
- map {
-
- my @l1 = grep {
- $_ && !m!^(/proc/|/dev/|pipe:|socket:)!;
- } map { readlink($_) } "/proc/$_/exe", glob_("/proc/$_/fd/*");
-
- my @l2 = grep { $_ } map { (split)[5] } cat_("/proc/$_/maps");
-
- if (my @l = grep { m!^/(image(_boot)?|cdrom/live_tree)/! } @l1, @l2) {
- my $cmdline = join(' ', split('\0', cat_("/proc/$_/cmdline")));
- my $exe = readlink("/proc/$_/exe");
- { pid => $_, cmdline => $cmdline, exe => $exe, files => [ sort(uniq(@l)) ] };
- } else {
- ();
- }
- } @pids;
-}
-
-my @to_restart_progs = qw(kded kdesktop kicker);
-my $restart_progs = join(";", @to_restart_progs);
-my @simple_daemons = qw(kdesud kio_uiserver klaptopdaemon artsd portmap);
-sub simple_daemon {
- my ($e) = @_;
- my $re = join('|', @to_restart_progs, @simple_daemons);
- $e->{cmdline} =~ m!\b($re)\b!
-}
-
-my $in = interactive->vnew;
-
-my @busy = busy_pids_and_files();
-
-my $needed_processes = join('|', map { quotemeta }
- 'init',
- 'xfs',
- 'kdeinit: Running...',
- '/etc/X11/X',
- '/sbin/devfsd',
- );
-
-if (!$ENV{DEBUG} && find { $_->{cmdline} =~ /^($needed_processes)/ } @busy) {
- exec 'totem' if $in->ask_okcancel('', N("You can only run with no CDROM support"));
- $in->exit(1);
-}
-
-my ($simple_daemons, $bad_busy) = partition { simple_daemon($_) } @busy;
-if (@$bad_busy) {
- warn '*' x 80, "\n";
- warn join("\n", "$_->{exe} ($_->{cmdline}) =>", map { " $_" } @{$_->{files}}) . "\n" foreach @$bad_busy;
- warn '*' x 80, "\n";
-
- my @progs = map {
- my $s = $_->{cmdline};
- $s =~ s!^/usr/bin/perl\s+([^-]\S*).*!$1!;
- $s =~ s!/.*/!!;
- $s =~ s!^kdeinit:\s+(\S+).*!$1!;
- $s =~ s!\s.*!!;
- $s;
- } @$bad_busy;
-
- my $choice = 'quit';
- my @l = my %l = (
- kill => N("Kill those programs"),
- keep => N("No CDROM support"),
- );
-
- $in->ask_from_({
- title => N("Read carefully!"),
- messages => N("You can not use another CDROM when the following programs are running:
-%s", join(", ", uniq(sort @progs))) },
- [ { type => 'list', val => \$choice, list => first(list2kv(@l)), format => sub { $l{$_[0]} } } ]) or $in->exit;
-
- if ($choice eq 'keep') {
- exec 'totem' or $in->exit;
- } else {
- system('sudo', 'kill', map { $_->{pid} } @$bad_busy);
- sleep 2;
- system('sudo', 'kill', '-9', map { $_->{pid} } @$bad_busy);
- }
-}
-
-kill 15, map { $_->{pid} } @$simple_daemons;
-sleep 1;
-
-@busy = busy_pids_and_files(); #- update list
-if (@busy) {
- system($restart_progs);
- exec 'totem' if $in->ask_okcancel('', N("You can only run with no CDROM support"));
- $in->exit(1);
-}
-
-my %file2loop = do {
- my $_w = $in->wait_message('', N("Copying to memory to allow removing the CDROM"));
- `GIVE_LOOP=1 mdk_move_loop to_memory always always_i18n totem nvidia` =~ /(.*?)=(.*)/g;
-};
-
-ugtk2::gtkset_mousecursor_normal(); #- for restoring a normal in any case
-ugtk2::flush();
-
-my ($lang) = map { if_(/live_tree_i18n_(.*)\.clp/, $1) } keys %file2loop;
-my $totem_pid = $$;
-
-if (my $pid = fork()) {
- $ENV{MDKMOVE} = $pid;
- $ENV{G_BROKEN_FILENAMES} = 1;
- exec 'totem';
-} else {
- exec 'sudo', 'mdk_behind_totem',
- '--lang', $lang,
- '--i18n-loop', $file2loop{"live_tree_i18n_$lang.clp"},
- '--boot-loop', $file2loop{'live_tree_boot.clp'},
- '--boot-loop', $file2loop{'live_tree_boot.clp'},
- '--main-loop', $file2loop{'live_tree.clp'},
- '--totem-pid', $totem_pid,
- '--user', $ENV{USER},
- '--restore-cmd', $restart_progs;
-}
' href='#n271'>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 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523
package harddrake::sound;
# lists filled with Danny Tholen help, enhanced by Thierry Vignaud
#
# No ALSA for OSS's 
#    o isa cards: msnd_pinnacle, pas2, 
#    o pci cards: ad1889, sam9407
# No OSS for ALSA's
#    o pci cards: snd_als4000, snd_es968, snd_hdsp
#    o isa cards: snd_azt2320, snd_cs4231, snd_cs4236, 
#      snd_dt0197h, snd_korg1212, snd_rme32
#    o pcmcia cards: snd_vxp440 snd_vxpocket

# TODO: 
#    o ensure sound is not user (either dsp/midi/sequencer/mixer)
#    o fix sound/alsa services

use strict;
use common;
use run_program;
use modules;
use list_modules;
use detect_devices;
use log;