#!/usr/bin/perl use lib "../perl-install"; use common; use pkgs; my @langs = map { /^../; $& } split /\s/, (cat_('move.pm') =~ /ALLOWED_LANGS = qw\((.*)\)/)[0]; @ARGV <= 1 or die "usage: make_live [live_location=/tmp/live_tree]\n"; sub installPackages { rename "/etc/rpm/macros", "/etc/rpm/macros."; output_p("/etc/rpm/macros", "%_install_langs " . join(":", @langs) . "\n"); mkdir_p("$::prefix/var/lib/rpm"); mkdir_p("$::prefix/root/drakx"); undef *install_any::setDefaultPackages; *install_any::setDefaultPackages = sub {}; undef *install_any::getFile; *install_any::getFile = sub { my ($f, $o_method) = @_; log::l("getFile $f:$o_method"); open(my $F, '/export/' . install_any::relGetFile($f)) or return; $F; }; install_any::setPackages(my $o = $::o = { prefix => $::prefix, meta_class => 'desktop', default_packages => [ qw(XFree86-server XFree86-xfs XFree86-FBDev), qw(acpi acpid), #- so that removing acpi=ht will work qw(mountloop), #- crypted folders qw(dnotify), #- notification of /etc changes qw(mandrake_doc-en), #- doesn't get installed by DOCS :/ qw(zcip dhcpcd ppp kdenetwork-kppp rp-pppoe pptp-adsl speedtouch speedtouch_mgmt nfs-utils-clients samba-client tmdns wireless-tools adiusbadsl), #- network conf ], }); my %compssUsersChoice = map { $_ => 1 } map { @{$_->{flags}} } values %{$o->{compssUsers}}; $compssUsersChoice{$_} = 1 foreach 'SYSTEM', 'DVD', 'USB', 'SOUND', 'BURNER', 'UTF8', 'DOCS', 'TV', '3D', 'INSTALL'; $compssUsersChoice{qq(LOCALES"$_")} = 1 foreach @langs; pkgs::setSelectedFromCompssList($o->{packages}, \%compssUsersChoice, 4, 0); my @toInstall = pkgs::packagesToInstall($o->{packages}); local $ENV{DURING_INSTALL} = 1; $ENV{LD_LIBRARY_PATH} = "/lib:/usr/lib:/usr/X11R6/lib:/usr/lib/qt3/lib"; pkgs::install($::prefix, 0, \@toInstall, $o->{packages}); eval { fs::umount("$::prefix/proc") }; unlink "/etc/rpm/macros"; rename "/etc/rpm/macros.", "/etc/rpm/macros"; } my $cwd = chomp_(`pwd`); $::prefix = $ARGV[0] || '/tmp/live_tree'; print "Making live in $::prefix directory.\n"; { eval { fs::umount("$::prefix/proc") }; # eval { rm_rf($::prefix) }; output_p("$::prefix/etc/fstab", "none /proc proc defaults 0 0\n"); installPackages(); run_program::rooted($::prefix, 'ldconfig'); touch("$::prefix/etc/menu/enable_simplified"); run_program::rooted($::prefix, 'update-menus'); run_program::rooted($::prefix, 'fc-cache'); #- generate cache in all directories mentioned in config file run_program::rooted($::prefix, 'kbuildsycoca', '--global'); eval { rm_rf("$::prefix/dev") }; # we don't need it, we use devfs eval { rm_rf("$::prefix/lib/i686") }; # de-complexify, use the default on any arch unlink "$::prefix/usr/share/autostart/$_.desktop" foreach 'klipper', 'korgac', 'kalarmd.autostart'; } update_gnomekderc("$::prefix/usr/share/config/kdesktoprc", ScreenSaver => (Lock => 'true')); symlinkf('/var/lib/xkb', "$::prefix/etc/X11/xkb/compiled"); # don't want the relative path, prefering the absolute path substInFile { #- /lib is ro, for the moment we don't save, we'll see later if we may want to save (using /var/dev-state for example) s|.*lib/dev-state.*||; } "$::prefix/etc/devfsd.conf"; substInFile { #- don't use shadow passwords since pwconv overwrites /etc/shadow hence contents will be lost for usb key s|\s*shadow||; } "$::prefix/etc/pam.d/system-auth";