diff options
40 files changed, 1177 insertions, 0 deletions
diff --git a/config/auto_inst.cfg.pl b/config/auto_inst.cfg.pl new file mode 100644 index 0000000..8ef41f8 --- /dev/null +++ b/config/auto_inst.cfg.pl @@ -0,0 +1,274 @@ +#!/usr/bin/perl -cw +# +# You should check the syntax of this file before using it in an auto-install. +# You can do this with 'perl -cw auto_inst.cfg.pl' or by executing this file +# (note the '#!/usr/bin/perl -cw' on the first line). + +my $distro_theme = + $ENV{DRAKLIVE_PRODUCT} =~ /liveusb-rw/i ? + 'Powerpack' : + 'LiveCD'; +my $distro_release = + $ENV{DRAKLIVE_PRODUCT} =~ /liveusb-rw/i ? + 'Liveusb-Rw' : + 'LiveCD'; +my $distro_config = lc($distro_release); + +my @desktops = split(/\|/, $ENV{DRAKLIVE_DESKTOP}); +my $has_kde = any { /^KDE/ } @desktops; +my $has_kde4 = member('KDE4', @desktops); +my $has_gnome = member('GNOME', @desktops); +my $has_xfce = member('xfce4', @desktops); +my $has_lxde = member('LXDE', @desktops); +my $has_moblin = member('Moblin', @desktops); + +$o = { + 'media' => [ + { + type => 'media_cfg', + url => 'drakx://media', + selected_names => join(',', + 'Main', 'Main Updates', + 'Contrib', 'Contrib Updates', + 'Non-free', 'Non-free Updates', + 'Restricted', 'Restricted Updates', + ), + }, + if_($ENV{DRAKLIVE_ADDITIONAL_REPOSITORY}, + { type => 'media', url => $ENV{DRAKLIVE_ADDITIONAL_REPOSITORY} }, + ), + ], + 'rpmsrate_flags_chosen' => { + LIVE => 1, + (map { ("CAT_$_" => 1) } ( + # office + qw(OFFICE SPELLCHECK PIM ARCHIVING PRINTER), + # multimedia + qw(AUDIO VIDEO GRAPHICS), + # internet + qw(NETWORKING_WWW NETWORKING_MAIL NETWORKING_NEWS COMMUNICATIONS NETWORKING_CHAT), + qw(NETWORKING_FILE_TRANSFER NETWORKING_IRC NETWORKING_INSTANT_MESSAGING NETWORKING_DNS), + # network + qw(NETWORKING_REMOTE_ACCESS NETWORKING_FILE), + qw(NETWORKING_REMOTE_ACCESS_SERVER), + # config + qw(CONFIG), + # console + qw(EDITORS TERMINALS TEXT_TOOLS SHELLS FILE_TOOLS), + # system + qw(SYSTEM MINIMAL_DOCS X ACCESSIBILITY THEMES), + if_($has_kde4, qw(KDE)), + if_($has_gnome, qw(GNOME)), + if_($has_xfce, qw(XFCE)), + if_($has_lxde, qw(LXDE)), + if_($ENV{DRAKLIVE_PRODUCT} =~ /gaming/i, qw(GAMES)), + )), + }, + # so that rpmsrate flags are really used + 'compssListLevel' => 5, # default from install_steps_interactive + 'skipped_packages' => [ + #- do not allow source dkms to be installed + 'dkms', + 'aspell', + 'aspell-en', + 'gstreamer0.10-plugins-ffmpeg', + 'gstreamer0.10-plugins-ugly', + + if_($ENV{DRAKLIVE_PRODUCT} !~ /guadec/i, 'gcc'), + "/^mageia-theme(?!-common|-$distro_theme(?:|-screensaver)-)/", + "/^mageia-release(?!-common|-$distro_release)-/", + if_($ENV{DRAKLIVE_ARCH} eq 'x86_64', + #- !TYPE"64bit" packages are selected by default for live + #- skip i586 ones if not relevant + 'libqca1-tls', + ), + if_($ENV{DRAKLIVE_PRODUCT} !~ /gaming/i, #- non-DVD products + #- from task-kde Suggests + #- skipping them prevents task-kde from being installed, + #- but its dependencies seems to be pulled correctly + 'kdeaddons', + 'kdenlive', + 'kdepim-kpilot', + 'konversation', + 'kerry', + 'kde-i18n-en_GB', 'openoffice.org-l10n-en_GB', 'mozilla-firefox-en_GB', + if_($ENV{DRAKLIVE_LANGS} !~ /\bpt\b/ && $ENV{DRAKLIVE_REGION} ne 'all', + #- do not install pt translations if only pt_BR is explicitely selected + 'kde-i18n-pt', 'kde4-l10n-pt', + 'mozilla-firefox-pt', + ), + if_($ENV{DRAKLIVE_PRODUCT} !~ /liveusb-rw/i, 'task-printing-scanning'), + 'qtradio', 'kradio', + if_(!$has_gnome && !$has_xfce, 'gnome-media'), + 'system-config-printer', + #if_(!$has_gnome, 'system-config-printer'), + 'poppler-data', 'tetex', + 'fglrx-control-center', + '/^gimp-help/', + '/^openoffice.org-help/', + 'openoffice.org-base', + if_(!$has_gnome, 'yelp'), + '/^nvidia.*-doc-html/', + if_($has_kde4, 'k3b', 'totem', 'liblm_sensors3', 'xpdf-common', 'nepomuk-scribo', 'htdig', 'mirrordir', 'acr38u'), + ($ENV{DRAKLIVE_PRODUCT} =~ /liveusb-rw/i + ? ('/openjdk/', 'java-1.5.0-gcj') + : '/java/'), + 'asihpi-firmware', 'hdsploader', 'mixartloader', 'pcxhrloader', 'usx2yloader', 'vxloader', + 'drakfax', 'efax', + ), + if_($ENV{DRAKLIVE_PRODUCT} !~ /gaming/i, + #- from task-kde Suggests + 'kdegames', 'kdegames4', + 'kdetoys', + ), + if_(!$ENV{DRAKLIVE_COMMERCIAL}, + 'skype', + ), + + #- bluez-pin provide + if_(!$has_kde4, 'kbluetooth'), + + if_(!$has_kde4, 'compiz-decorator-kde4'), #- provides compiz-decorator + if_(!$has_kde4, 'pinentry-qt4'), #- qt4 app + 'kdebase-kate', 'kdeaddons-kate', #- development tool + '/noatun/', #- prefer amarok + #- FIXME: this broken package should be removed from non-free + 'a320raid', + 'rxvt', + + if_($ENV{DRAKLIVE_PRODUCT} =~ /guadec/i, 'rfbdrake'), + + if_($has_kde4, 'gdb'), #- suggested by one of the kde4 base package + + #exclude some packages that are too big from the KDE4 Live CD + if_($ENV{DRAKLIVE_PRODUCT} !~ /liveusb-rw/i, + if_($has_kde4, 'digikam'), + if_($has_kde4, 'ufraw-gimp'), + if_($has_kde4, 'marble-common'), + if_($has_kde4, 'p7zip'), + if_($has_kde4, 'mozilla-thunderbird'), #- we have kmail + if_($has_gnome, 'mozilla-thunderbird', 'pan'), #- we have evolution + #'aspell-ro', # lack of space :( arbitrary choice + # since it's the biggest dict we have + 'cpqarrayd', + ), + + if_($has_gnome, 'beagle'), + if_($has_moblin, 'task-3ddesktop-gtk'), + '/^kernel-server-/', if_($ENV{DRAKLIVE_ARCH} ne 'x86_64', '/^kernel-deskop-/'), + ], + 'default_packages' => [ + if_($has_kde4, "$distro_config-kde4-config"), + if_($has_lxde, "mageia-lxde-config-$distro_release"), + if_($has_xfce, "mageia-xfce-config-$distro_release"), + + if_($has_moblin, 'task-moblin'), + + #- broken updates + if_($has_kde4, 'kde4-splash-mdv'), + + #- live resize/install/copy tools + if_($ENV{DRAKLIVE_MEDIA} eq 'usb', 'draklive-resize'), + + if_($ENV{DRAKLIVE_PRODUCT} =~ /gaming/i, 'task-games'), + + #- should be in x11-driver-video (#42909) + 'x11-driver-video-via', + 'x11-driver-video-psb', + + if_($has_gnome, 'gnome-shell'), + + if_($ENV{DRAKLIVE_PRODUCT} =~ /liveusb-rw/i, + 'samba-client', + 'RealPlayer', 'RealPlayer-rpnp', + 'java-1.6.0-sun', + 'mozilla-firefox-ext-google-toolbar', + 'filezilla', #- FIXME: bump to level 5 in rpmsrate? + 'nut-server', + 'mozilla-thunderbird', + if_($ENV{DRAKLIVE_REGION} eq 'all', map { "mozilla-thunderbird-$_" } qw(ca cs de el es es_AR eu fi fr gu_IN he hu it ja ko nb nl pa_IN pl pt_BR ru sk sl sv tr zh_CN)), + if_($ENV{DRAKLIVE_PRODUCT} =~ /guadec/i, + 'fonts-ttf-gurmukhi', + 'cheese', + 'anjuta', + ), + ), + ], + 'preferred_packages' => join(',', $has_kde4 ? 'kdm' : 'gdm'), + 'meta_class' => 'desktop', + 'desktop' => first(@desktops), + if_($ENV{DRAKLIVE_DEFAULT_USER}, 'autologin' => $ENV{DRAKLIVE_DEFAULT_USER}), + # explicitely specify the security level, so that environment of the build machine doesn't take precedence + 'security' => 1, + 'useSupermount' => 'magicdev', + 'users' => [ + if_($ENV{DRAKLIVE_DEFAULT_USER}, { + 'icon' => 'default', + 'realname' => '', + 'uid' => '', + 'groups' => [], + 'name' => $ENV{DRAKLIVE_DEFAULT_USER}, + 'shell' => '/bin/bash', + 'gid' => '' + }), + ], + 'locale' => { + 'country' => 'US', + 'IM' => undef, + 'lang' => 'en_US', + 'langs' => +{ + $ENV{DRAKLIVE_REGION} eq 'all' ? (all => 1) : (map { $_ => 1 } split(':', $ENV{DRAKLIVE_LANGS})) + }, + 'utf8' => 1 + }, + 'authentication' => { + 'shadow' => 1, + 'local' => 1, + 'md5' => 1 + }, + 'superuser' => { + 'pw' => '', + 'realname' => 'root', + 'uid' => '0', + 'shell' => '/bin/bash', + 'home' => '/root', + 'gid' => '0' + }, + 'keyboard' => { + 'GRP_TOGGLE' => '', + 'KBCHARSET' => 'C', + 'KEYBOARD' => 'us', + 'KEYTABLE' => 'us' + }, + 'timezone' => { + 'ntp' => undef, + 'timezone' => 'America/New_York', + 'UTC' => 1 + }, + 'X' => { disabled => 1 }, #- disable auto-configuration that may install unwanted packages + 'match_all_hardware' => 1, + 'excludedocs' => 0, + 'postInstall' => join(";", + "perl -pi -e 's/^id:3:initdefault:/id:5:initdefault:/' '/etc/inittab'", + #- FIXME: in any::set_autologin, unlink if gdm/kdm conf file and binary exist + if_($has_xfce || $has_lxde, "rm -f /etc/sysconfig/autologin"), + if_($distro_theme eq 'Liveusb-Rw', + #- set blue gtk theme for Liveusb-Rw in Gnome + "/usr/bin/gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.local-defaults/ --direct --type=string --set /apps/metacity/general/theme 'Ia Ora Blue'", + "/usr/bin/gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.local-defaults/ --direct --type=string --set /desktop/gnome/interface/gtk_theme 'Ia Ora Blue'", + #- set blue gtk theme for Liveusb-Rw in GTK + "perl -pi -e 's/META_CLASS=.*/META_CLASS=powerpack/' /etc/sysconfig/system", + "echo MDV_MENU_STYLE=discovery > /etc/sysconfig/menustyle", + ), + ), + 'autoExitInstall' => 1, + 'keep_unrequested_dependencies' => 0, + }; + +my $old = \&install::pkgs::empty_packages; +undef *install::pkgs::empty_packages; +*install::pkgs::empty_packages = sub { + my $packages = &$old; + $packages->{debug_URPM} = sub { log::l("XXX: $_[0]") }; + $packages; +}; diff --git a/config/live.cfg b/config/live.cfg new file mode 100644 index 0000000..af2e83e --- /dev/null +++ b/config/live.cfg @@ -0,0 +1,268 @@ +#!/usr/bin/perl -cw + +my $ooo_version = '3.0'; +my $use_modules = to_bool($live->{settings}{pack}); +my @user_config_dirs = ('/etc/skel', if_($live->{settings}{default_user}, '/home/' . $live->{settings}{default_user})); + +sub build_one_label { + my ($live) = @_; + + my ($version, $extra) = split(/-/, $live->{settings}{version}); + $version .= "S" if ($extra eq 'spring'); + "LABEL=" . join ("-", ucfirst($live->{settings}{product}), $version, $live->{settings}{desktop}); +} + +my $_l = { + workdir => $live->{settings}{workdir}, + system => { + root => $live->{settings}{chroot}, + repository => $live->{settings}{repository}, + auto_install => 'config/auto_inst.cfg.pl', + install_env => { + DRAKLIVE_DESKTOP => $live->{settings}{desktop}, + DRAKLIVE_MEDIA => $live->{settings}{media}, + DRAKLIVE_PRODUCT => $live->{settings}{product}, + DRAKLIVE_ARCH => $live->{settings}{arch}, + DRAKLIVE_ADDITIONAL_REPOSITORY => $live->{settings}{additional_repository}, + DRAKLIVE_COMMERCIAL => $live->{settings}{commercial}, + DRAKLIVE_DEFAULT_USER => $live->{settings}{default_user}, + }, + hide_media_dirs => to_bool($live->{settings}{product} =~ /liveusb-rw/i), + if_($live->{settings}{default_user}, preselect_kdm_user => $live->{settings}{default_user}), + langs_always => [ 'en_US' ], + files => [ + if_($live->{settings}{product} =~ /liveusb-rw/i && $live->{settings}{commercial}, + [ 'files/xdg-email-hook.sh', '/usr/bin/xdg-email-hook.sh', { mode => 0755, no_install => 1 } ], + [ 'files/portable-directories-liveusb-rw', '/etc/X11/xinit.d/portable-directories-liveusb-rw', { mode => 0755, no_install => 1 } ], + ), + if_($live->{settings}{media} eq 'usb', + [ 'files/99-live-disable-suspend-hibernate.fdi', '/etc/hal/fdi/policy/99-live-disable-suspend-hibernate.fdi', { mode => 0644, no_install => 1 } ], + [ 'files/desktop-directories-liveusb-rw', '/etc/X11/xinit.d/xx_desktop-directories-liveusb-rw', { mode => 0755, no_install => 1 } ], + [ 'files/draklive-install.usb', '/etc/sysconfig/draklive-install', { mode => 0755 } ], + [ 'files/draksnapshot.sysconfig', '/etc/skel/.draksnapshot', { mode => 0644, no_install => 1 } ], + ), + #- make cups the default spooler + [ 'files/defaultspooler', '/etc/foomatic/defaultspooler', { mode => 0644 } ], + if_($live->{settings}{media} eq 'cdrom', + #- eject eject cd medium before halt/reboot + [ 'files/halt.local.cdrom', '/sbin/halt.local', { mode => 0755 } ], + #- do not load usblp and trigger autosetupprintqueues in live since cups is not available + [ 'files/live.modprobe.cdrom', '/etc/modprobe.d/live', { mode => 0644, no_install => 1 } ], + ), + if_($live->{settings}{media} ne 'usb', #- FIXME + #- umount tmp rpm hack before /etc/init.d/halt tries and fails + [ 'files/halt.pre', '/sbin/halt.pre', { mode => 0755 } ], + ), + #- disable first boot wizard at live boot + [ 'files/firstboot', '/etc/sysconfig/firstboot', { mode => 0644 } ], + #- enable drakx-finish-install at live boot + [ "files/finish-install.$live->{settings}{media}", '/etc/sysconfig/finish-install', { mode => 0644 } ], + #- disable speedboot for first boot after disk installation + [ 'files/draklive-install.d/remove.d/disable-speedboot', '/etc/draklive-install.d/remove.d/disable-speedboot', { mode => 0644 } ], + if_($live->{settings}{desktop} eq 'KDE4', + [ 'files/draklive-install.d/run.d/generate-gtk-icon-cache.sh', '/etc/draklive-install.d/run.d/generate-gtk-icon-cache.sh', { mode => 755 } ]), + #- sysconfig files for first boot + [ $live->{settings}{media} eq 'usb' ? + "files/finish-install.$live->{settings}{media}" : + 'files/draklive-install.d/finish-install', + '/etc/draklive-install.d/sysconfig/finish-install', { mode => 0644 } ], + [ 'files/draklive-install.d/firstboot', '/etc/draklive-install.d/sysconfig/firstboot', { mode => 0644 } ], + [ 'files/draklive-install.d/services', '/etc/draklive-install.d/services', { mode => 0644 } ], + if_($live->{settings}{media} eq 'usb', + [ 'files/draklive-install.d/draklive-resize', '/etc/draklive-install.d/sysconfig/draklive-resize', { mode => 0644 } ], + ), + #- don't make kbluetoothrc display an annoying and useless popup window, and disable it by default + [ 'files/kbluetoothrc', '/etc/kde/kbluetoothrc', { mode => 0644 } ], + [ 'files/korgacrc', '/etc/kde/korgacrc', { mode => 0644 } ], + (map { [ 'files/mdkonlinerc', $_ . '/.MdkOnline/mdkonline', { mode => 0644 } ] } @user_config_dirs), + [ 'files/compute-ooo-dicts.pl', '/usr/sbin/compute-ooo-dicts.pl', { mode => 0755 } ], + [ 'files/compute-i18n-list.pl', '/usr/sbin/compute-i18n-list.pl', { mode => 0755 } ], + if_($live->{settings}{desktop} eq 'GNOME', + [ 'files/99dm-reload.xsetup', '/etc/X11/xsetup.d/', { mode => 0755 } ]), + if_($live->{settings}{product} =~ /guadec/i, + [ 'files/GUADEC-booklet.desktop', '/usr/share/nautilus/default-desktop/booklet.desktop' ], + ), + ], + remove_files => [ + (map { "/etc/modprobe.preload.d/$_" } qw(cpufreq pcmcia rfswitch)), + "/etc/udev/rules.d/70-persistent-*.rules", + "/var/lib/dbus/machine-id", + "/etc/ssh/ssh_host_*", + ], + module_options => { + loop => "max_loop=64", + }, + exclude_modules => [], + additional_modules => [ + #'modules/i586/unionfs.ko', + ], + stage2_updates => [ + # [ "files/pkgs.pm", "/usr/lib/libDrakX/install/pkgs.pm" ], + ], + patches => [ + #- following patches have to be merged in cooker + 'patches/finish-install-xsetup-gdm-lock.patch' + ], + erase_rpms => [ + ], + rpms => [ + ], + disable_services => [ + qw(bluetooth cpufreq cpufreqd laptop-mode pcmcia mdadm pcscd), + qw(cups hplip oki4daemon), # printing + qw(capi4linux ibod isdn4linux isdnlog bpalogin), + qw(cpqarrayd upsd upsmon), # uncommon hardware + qw(lisa ntpd snmpd), # unneeded software + #qw(acpi acpid apmd), # enabled by drakboot when needed + qw(dkms), # slows down live boot, reenabled after install + qw(anacron crond), # slows down basic usage and install, reenabled after install + qw(sshd), + qw(hcfpci hsf slmodemd), + qw(portmap nfs-common), + qw(kav4ws freshclam clamd), + if_($live->{settings}{media} eq 'cdrom', preload), + ], + vga_mode => 788, + gfxboot => $live->{settings}{media} ne 'usb', #- disable gfxboot on USB, buggy with grub on some systems + if_($live->{settings}{media} eq 'usb', + initrd_pre_pivot => + #- keep an unmodified live tree for draklive-install + #- hack: mount it rw with a dummy branch and remount it ro later, current unionfs fails to mount ro directly + #- hack: the union can not be "stacked" (i.e. mounted) over another union, so do it early in initrd, and use a tmpfs for the dummy branch, so it can be moved in the real root + join("\n", map { "sh -c '$_'" } + 'mkdir -p /live/source /live/dummy', + 'mount -o mode=755,rw -t tmpfs none /live/dummy', + 'mount -o dirs=/live/dummy=rw' . if_($use_modules, ':$(cat /live/modules.lst)') . ':/live/distrib=ro -t unionfs unionfs /live/source', + ), + ), + initrd_post => + join("\n", + if_($live->{settings}{media} eq 'usb', do { + my $tmp = "/live/tmp"; + my @sticky = qw(/var/tmp /tmp); + ( + "sh -c 'mkdir -p $tmp'", + "mount -t tmpfs none $tmp", + "mkdir $tmp/var", + (map { + ("mkdir $tmp$_", "mount -o dirs=$tmp$_=rw:/live/distrib$_=ro -t unionfs unionfs $_") + } (qw(/var/log), @sticky)), + "chmod 1777 @sticky", + ); + }), + ), + postInstall => join(';', + if_($live->{settings}{default_user}, "echo $live->{settings}{default_user} > /etc/draklive-install.d/user"), + "perl -pi -e 's,<DEFAULT_USER>,$live->{settings}{default_user},' /etc/draklive-install.d/sysconfig/finish-install", + 'find /usr/share/doc/HTML -mindepth 1 -maxdepth 1 -type d > /root/drakx/HTML.skipped', + #- used by liveusb-rw + "/usr/sbin/compute-i18n-list.pl --ooo=${ooo_version}", + if_($live->{settings}{product} =~ /liveusb-rw/i && $live->{settings}{desktop} =~ /^KDE/, + #- FIXME: check if still valid for KDE4 + "perl -pi -e 's,kde[/-]KMail,mageia-mozilla-thunderbird,' /var/lib/mageia/kde-profiles/common/share/config/kickerrc" + ), + #- fix user perms for copied files + if_($live->{settings}{default_user}, "chown -R " . + "$live->{settings}{default_user}.$live->{settings}{default_user}" . + " /home/$live->{settings}{default_user}"), + #- rpath removal will be "lost" on update + #- but not important since all packages files would be on the same loopback + #- should not be needed with latest unionfs which resolves /proc/self/exe correctly + #- FIXME: test with live USB r/w + #"chrpath -d /usr/lib/ooo-${ooo_version}/program/soffice.bin", + #- workaround rpm bug that leaves a corrupted rpm DB in chroot + "rm -f /var/lib/rpm/__db.*", + "rm -f /.readahead_collect", + if_($live->{settings}{desktop} eq 'KDE4', + "rm -f /usr/share/icons/*/icon-theme.cache"), + if_($live->{settings}{desktop} eq 'GNOME', + 'mkdir -p "/home/$live->{settings}{default_user}/.config/autostart/"; for file in "/etc/xdg/autostart/tracker*.desktop"; do sed "s/X-GNOME-Autostart-enabled=true/X-GNOME-Autostart-enabled=false/g" $file >"/home/$live->{settings}{default_user}/.config/autostart/$(basename $file)"; done'), + + + ), + additional_media => [ + if_($live->{settings}{updates_repository}, + { + name => 'main_testing', + path => $live->{settings}{updates_repository} . '/' . $live->{settings}{arch} . '/media/main/testing', + packages => [ + ], + }, + ), + ], + }, + loopbacks => { + exclude => { + type => 'squashfs', + files => [ + { path => '/root/drakx' }, + { source => '/root/drakx/HTML.skipped', rooted => 1 }, + (map { +{ path => "/usr/share/doc/$_" } } qw(net-snmp tvtime aria2 perl-SOAP-Lite nss)), + ], + }, + if_($use_modules, modules => [ + { type => 'squashfs', source => '/root/drakx/i18n-*.lst', rooted => 1 }, + ]), + }, + regions => { + #- the "all" region has a magical behavior and selects all langs + int => [qw(de en es fr it pl pt_BR ru)], + guadec => [qw(de en es fr it nb nn nl pl pt_BR ro ru tr)], + 'europe-americas' => [qw(bg cs da de el en es et fi fr hr hu it ky lt lv nb nl nn no pl pt pt_BR ro ru sv tr uk uz)], + #'africa-asia' => [qw(de en es fr it nb nn nl pl pt_BR ro ru tr ar he hi id ko ms zu ja zh_CN zh_TW)], + 'africa-asia' => [qw(aa af am ar as ber bn ha he hi id ig ja kn ko ks ml mr or pa sd ta th tn ts ve vi xh yo zh_CN zh_TW zu)], + 'europe1-americas' => [qw(de el en es fr it nl pt pt_BR tr)], + europe2 => [qw(bg cs da en et fi hr hu lt lv nb no nn pl ro ru sv uk uz)], + 'africa-india' => [qw(zu aa af am ar as ber bn ha he hi ig kn ks ml mr or pa sd ta tn ts ve xh yo)], + 'asia-noindia' => [qw(id ja ko th vi zh_CN zh_TW)], + }, + packs => { + int => [ map { "i18n-$_" } qw(de en es fi fr it nl pt sv) ], + da => [ map { "i18n-$_" } qw(da en) ], + }, + if_($live->{settings}{media} eq 'cdrom', + media => { + storage => 'cdrom', + boot_entries => [ "" => "", "linux" => " install", "harddisk" => "" ], + if_($live->{settings}{product} =~ /livecd/i, + source => build_one_label($live), + pre => [ 'for i in seq 1 5; do showlabels --removable | grep '.build_one_label($live).'; if [ $? -eq 0 ]; then break; fi; sleep 1; done' ], + extra_modules => [ qw(vfat sd_mod usb_storage uhci_hcd ohci_hcd ehci_hcd) ], + files => [ + [ 'extra/livecd/autorun/*', ''], + map { [ 'extra/livecd/' . $_, $_ ] } qw(LISEZMOI.pdf README.pdf) + ], + ), + }, + #extra_media => [ { storage => 'usb' } ], + mount => MDV::Draklive::Mounts::volatile_squash_union($use_modules), + ), + if_($live->{settings}{media} eq 'usb', + media => { + storage => 'usb', + bootloader_timeout => 1, + mount_options => 'dmask=0000,fmask=0111', + extra_boot => [ qw(cdrom) ], + if_($live->{settings}{product} =~ /liveusb-rw/i, + source => "LABEL=Mga_USB", + title => "Mageia Live USB", + boot_entries => [ "" => "" ], + files => [ + [ 'extra/liveusb-rw-common/*', '' ], + ($live->{settings}{commercial} ? + [ 'extra/liveusb-rw-commercial/*', '' ] : + [ 'extra/liveusb-rw/*', '' ] + ), + ], + partitions => [ + { + size => common::MB(8000), + mntpoint => '/', + }, + ], + remove_files => [ '.svn', '*~' ], + ), + }, + mount => MDV::Draklive::Mounts::squash_union('1000M', '150M', $use_modules), + ), +}; diff --git a/config/settings-livecd.cfg b/config/settings-livecd.cfg new file mode 100644 index 0000000..2c24a64 --- /dev/null +++ b/config/settings-livecd.cfg @@ -0,0 +1,13 @@ +repository=/mnt/BIG/dis/official/2010.1 +updates_repository=http://distro/dis/official/2010.1 +additional_repository= +arch=i586 +desktop=KDE4 +media=cdrom +region=int +pack= +name=mageia +product=livecd +version=1 +commercial=0 +default_user=live diff --git a/config/settings-liveusb-rw-GUADEC.cfg b/config/settings-liveusb-rw-GUADEC.cfg new file mode 100644 index 0000000..11a38d1 --- /dev/null +++ b/config/settings-liveusb-rw-GUADEC.cfg @@ -0,0 +1,12 @@ +repository=/mnt/BIG/dis/official/2008.1 +additional_repository=http://192.168.100.8/dis/official/2008.1 +arch=i586 +desktop=GNOME +media=usb +region=guadec +pack= +name=mageia +product=liveusb-guadec +version=1 +commercial=0 +default_user=guest diff --git a/config/settings-liveusb-rw.cfg b/config/settings-liveusb-rw.cfg new file mode 100644 index 0000000..20569d8 --- /dev/null +++ b/config/settings-liveusb-rw.cfg @@ -0,0 +1,13 @@ +repository=/mnt/BIG/dis/official/2010.0 +updates_repository= +additional_repository= +arch=i586 +desktop=KDE4 +media=usb +region=all +pack=int +name=mageia +product=liveusb +version=1 +commercial=1 +default_user= diff --git a/config/settings.cfg b/config/settings.cfg new file mode 120000 index 0000000..6342e22 --- /dev/null +++ b/config/settings.cfg @@ -0,0 +1 @@ +settings-livecd.cfg
\ No newline at end of file diff --git a/files/99-live-disable-suspend-hibernate.fdi b/files/99-live-disable-suspend-hibernate.fdi new file mode 100755 index 0000000..96f1767 --- /dev/null +++ b/files/99-live-disable-suspend-hibernate.fdi @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- --> +<deviceinfo version="0.2"> + <device> + <match key="info.udi" string="/org/freedesktop/Hal/devices/computer"> + <merge key="power_management.can_hibernate" type="bool">false</merge> + <merge key="power_management.can_suspend" type="bool">false</merge> + <merge key="power_management.can_suspend_to_disk" type="bool">false</merge> + <merge key="power_management.can_suspend_to_ram" type="bool">false</merge> + </match> + </device> +</deviceinfo> diff --git a/files/99dm-reload.xsetup b/files/99dm-reload.xsetup new file mode 100755 index 0000000..67d8ee8 --- /dev/null +++ b/files/99dm-reload.xsetup @@ -0,0 +1,3 @@ +#!/bin/sh +LOCK=/var/lock/reload-dm +[ -f "$LOCK" ] && rm -f $LOCK && if [ x"$RUNNING_UNDER_GDM" = xtrue ]; then nohup service dm restart; fi; diff --git a/files/GUADEC-booklet.desktop b/files/GUADEC-booklet.desktop new file mode 100644 index 0000000..ca2492e --- /dev/null +++ b/files/GUADEC-booklet.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Icon=distributor-logo +Encoding=UTF-8 +Name=GUADEC Booklet +Type=Link +URL=http://assets.expectnation.com/9/eventprovider/9/booklet.pdf diff --git a/files/compute-i18n-list.pl b/files/compute-i18n-list.pl new file mode 100755 index 0000000..914585b --- /dev/null +++ b/files/compute-i18n-list.pl @@ -0,0 +1,88 @@ +#!/usr/bin/perl + +use MDK::Common; +use Getopt::Long; +use lib qw(/usr/lib/libDrakX); +use run_program; + +# alleged i18n packages for french (useful to spot missing requires on locales-fr) +# rpm -qa \*-fr\* --qf '%{name}\n' | perl -n -e '/^(.*)-fr(_.+)?$/ and print "$1\n"' | sort -u +# my @packages = ( +# aspell +# kde-i18n +# locales +# mozilla-firefox +# myspell +# myspell-hyph +# openoffice.org-l10n +# ); + +my ($prefix, $ooo_version); +GetOptions( + "prefix=s" => \$prefix, + "ooo=s" => \$ooo_version, +); + +my @misowned_dirs = qw( +/usr/lib/ooo-${ooo_version} +/usr/lib/ooo-${ooo_version}/help +/usr/share/apps +/usr/share/apps/khangman +/usr/share/apps/khangman/data +/usr/share/apps/ktuberling +/usr/share/apps/ktuberling/sounds +/usr/share/doc/HTML +/usr/share/locale +); + +my @dirs = qw( +/usr/share/man +/usr/share/doc/HTML +); + +my @files = qw( +/usr/lib/ooo-${ooo_version}/share/dict/$L.* +/usr/lib/ooo-${ooo_version}/share/dict/$L_comb.* +/usr/lib/ooo-${ooo_version}/share/dict/hyph_$L.* +/usr/lib/ooo-${ooo_version}/share/dict/th_$L.* +/usr/lib/ooo-${ooo_version}/share/dict/th_$L_v2.* +); + +my %per_locale_files = ( + zh => [ + #- disables anti-aliasing by default + '/etc/fonts/conf.d/99-ttf-arphic-uming-bitmaps.conf' + ], +); + +my @locale_packages = run_program::rooted_get_stdout($prefix, 'rpm', '-qa', 'locales-*', '--qf', '%{name}\n'); +my @locales = sort(map { s/^locales-//; chomp; $_ } @locale_packages); + +sub expand_files { + my ($p, $o_lang) = @_; + $p =~ s/\$L/$o_lang/ if $o_lang; + map { s/^$prefix//; $_ } grep { -e $_ } glob($prefix . $p); +} + +foreach my $l (@locales) { + my @list; + my $locale_pkg = "locales-$l"; + #my $l_pattern = qr/^$l([_.@].+)?$/; + #my @l_packages = map { ("$_-$l", "$_-${l}_*") } @packages; + my @l_packages = chomp_(run_program::rooted_get_stdout($prefix, 'rpm', '-q', '--qf', '%{name}\n', '--whatrequires', $locale_pkg)); + unshift @l_packages, $locale_pkg; + my @list = chomp_(run_program::rooted_get_stdout($prefix, 'rpm', '-ql', @l_packages)); + my @all_locales = map { m!^/usr/share/locale/([^/]+)$! } chomp_(run_program::rooted_get_stdout($prefix, 'rpm', '-ql', $locale_pkg)); + # skip misowned directories such as /usr/share/locale + @list = grep { ! -d $prefix . $_ || member(basename($_), @all_locales) } @list; + #@list = difference2(\@list, \@misowned_dirs); + foreach my $l2 (@all_locales) { + foreach my $d (@dirs) { + my $l_d = $d . '/' . $l2; + push @list, $l_d if -e $prefix . $l_d; + } + push @list, expand_files($_, $l2) foreach @files; + } + push @list, expand_files($_) foreach @{$per_locale_files{$l} || []}; + output_p($prefix . "/root/drakx/i18n-$l.lst", map { "$_\n" } sort(@list)); +} diff --git a/files/compute-ooo-dicts.pl b/files/compute-ooo-dicts.pl new file mode 100755 index 0000000..d9968c5 --- /dev/null +++ b/files/compute-ooo-dicts.pl @@ -0,0 +1,55 @@ +#!/usr/bin/perl + +use MDK::Common; +use Getopt::Long; +use lib qw(/usr/lib/libDrakX); +use run_program; + +my $prefix; +my $check_locale; +GetOptions( + "prefix=s" => \$prefix, + "check-locale" => \$check_locale, +); +my $dictd = $ARGV[0] or die "syntax: $0 [--check-locale] [--prefix <prefix>] <dictionary dir>"; + +my $dictf = "dictionary.lst"; +my $dicts = "dictionary.src"; +my $dictu = "dictionary.unused"; + +my @dictl; +my @unused; + +my @available_langs = map { + /^locales-(\S+)/ ? $1 : (); +} chomp_(run_program::rooted_get_stdout($prefix, 'rpm', '-qa', '--provides', 'locales-*')); + +sub add_dict { + my ($type, $name, $file, $add) = @_; + my ($lang, $country) = $name =~ /^([^_]+)_([^_]+)/; + my ($root_name) = $file =~ /^(.*)\.(.*?)$/; + if (!$check_locale || member($lang, @available_langs)) { + push @dictl, [ $type, $lang, $country, $root_name ] if $add; + } else { + push @unused, "$dictd/$file"; + } +} + +rename("$prefix$dictd/$dictf", "$prefix$dictd/$dicts") if ! -e "$prefix$dictd/$dicts"; +foreach (all("$prefix/$dictd")) { + if (/^hyph_(.+)\.(.*?)$/) { + add_dict('HYPH', $1, $_, $2 eq 'dic'); + } elsif (/^th_(.+)\.(.*?)$/) { + add_dict('THES', $1, $_, $2 eq 'idx'); + } elsif (/^(.+_.+)\.(.*?)$/) { + add_dict('DICT', $1, $_, $2 eq 'dic'); + } +} + +output_p("$prefix$dictd/$dictf", + join('', grep { /^#/ } cat_("$prefix$dictd/$dicts")), + "\n", + map { join(' ', @$_) . "\n" } @dictl, + ); + +output_p("$prefix$dictd/$dictu", map { "$_\n" } @unused); diff --git a/files/defaultspooler b/files/defaultspooler new file mode 100644 index 0000000..462d36c --- /dev/null +++ b/files/defaultspooler @@ -0,0 +1 @@ +cups diff --git a/files/desktop-directories-liveusb-rw b/files/desktop-directories-liveusb-rw new file mode 100755 index 0000000..3fd7635 --- /dev/null +++ b/files/desktop-directories-liveusb-rw @@ -0,0 +1,37 @@ +#!/bin/sh + +LIVEUSB_LOCK="$HOME/.liveusb-folders" +LIVEUSB_ROOT=/live/media +[ -e "$LIVEUSB_ROOT/My Documents" ] && LIVEUSB_ALA_WINDOWS=1 + +[ -e $LIVEUSB_LOCK ] && exit + +while pidof -x xdg-user-dirs-update; do + [ "$SECONDS" -le 60 ] || return + sleep 1 +done + +function create_link() { + NAME=$1 + SRC=$2 + [ -z "$SRC" ] && SRC=$($NAME) + XDG_DIR=$(xdg-user-dir $NAME) + LIVEUSB_DIR="$LIVEUSB_ROOT/$SRC" + mkdir -p "$LIVEUSB_DIR" + mv $XDG_DIR/{.??,}* "$LIVEUSB_DIR" + rmdir $XDG_DIR && ln -sf "$LIVEUSB_DIR" "$XDG_DIR" +} + +if [ -n "$LIVEUSB_ALA_WINDOWS" ]; then + create_link "DOCUMENTS" "My Documents" + create_link "DOWNLOAD" "My Documents/My Downloads" + create_link "MUSIC" "My Documents/My Music" + create_link "PICTURES" "My Documents/My Images" + create_link "VIDEOS" "My Documents/My Video" +else + for d in DOWNLOAD DOCUMENTS MUSIC PICTURES VIDEOS; do + create_link $d $(echo $d | tr A-Z a-z) + done +fi + +touch $LIVEUSB_LOCK diff --git a/files/draklive-install.d/draklive-resize b/files/draklive-install.d/draklive-resize new file mode 100644 index 0000000..5d33155 --- /dev/null +++ b/files/draklive-install.d/draklive-resize @@ -0,0 +1 @@ +DRAKLIVE_RESIZE=no diff --git a/files/draklive-install.d/finish-install b/files/draklive-install.d/finish-install new file mode 100644 index 0000000..c4f6824 --- /dev/null +++ b/files/draklive-install.d/finish-install @@ -0,0 +1,13 @@ +FINISH_INSTALL=yes +LICENSE=no +LANGUAGE=no +KEYBOARD=no +TIMEZONE=no +COUNTRY=no +NETWORK=yes +URPMI=yes +AUTHENTICATION=no +USERS=with_root +USER_RENAME_FROM=<DEFAULT_USER> +USER_AUTOLOGIN_FIRST=yes +GLX=no diff --git a/files/draklive-install.d/firstboot b/files/draklive-install.d/firstboot new file mode 100644 index 0000000..a842497 --- /dev/null +++ b/files/draklive-install.d/firstboot @@ -0,0 +1 @@ +FIRSTBOOT=no diff --git a/files/draklive-install.d/remove.d/disable-speedboot b/files/draklive-install.d/remove.d/disable-speedboot new file mode 100644 index 0000000..7bc22d6 --- /dev/null +++ b/files/draklive-install.d/remove.d/disable-speedboot @@ -0,0 +1 @@ +/var/lib/speedboot/status diff --git a/files/draklive-install.d/run.d/generate-gtk-icon-cache.sh b/files/draklive-install.d/run.d/generate-gtk-icon-cache.sh new file mode 100755 index 0000000..e920320 --- /dev/null +++ b/files/draklive-install.d/run.d/generate-gtk-icon-cache.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +for icondir in /usr/share/icons/*; do + if [ -d "$icondir" -a -f "$icondir/index.theme" ]; then + /usr/bin/gtk-update-icon-cache --force --quiet "$icondir"; + fi +done diff --git a/files/draklive-install.d/services b/files/draklive-install.d/services new file mode 100644 index 0000000..6e7a6b4 --- /dev/null +++ b/files/draklive-install.d/services @@ -0,0 +1,3 @@ +anacron +crond +dkms diff --git a/files/draklive-install.usb b/files/draklive-install.usb new file mode 100644 index 0000000..fbfa41c --- /dev/null +++ b/files/draklive-install.usb @@ -0,0 +1 @@ +SOURCE=/live/source diff --git a/files/draksnapshot.sysconfig b/files/draksnapshot.sysconfig new file mode 100644 index 0000000..cca41e8 --- /dev/null +++ b/files/draksnapshot.sysconfig @@ -0,0 +1 @@ +AUTOSTART=FALSE diff --git a/files/finish-install.cdrom b/files/finish-install.cdrom new file mode 100644 index 0000000..fed1dd5 --- /dev/null +++ b/files/finish-install.cdrom @@ -0,0 +1,7 @@ +FINISH_INSTALL=yes +NETWORK=no +URPMI=no +AUTHENTICATION=no +USERS=no +TIMEZONE=simplified +COUNTRY=simplified diff --git a/files/finish-install.usb b/files/finish-install.usb new file mode 100644 index 0000000..467f1ac --- /dev/null +++ b/files/finish-install.usb @@ -0,0 +1,6 @@ +FINISH_INSTALL=yes +USERS=with_root +AUTHENTICATION=no +USER_AUTOLOGIN_FIRST=yes +TIMEZONE=simplified +COUNTRY=simplified diff --git a/files/firstboot b/files/firstboot new file mode 100644 index 0000000..a842497 --- /dev/null +++ b/files/firstboot @@ -0,0 +1 @@ +FIRSTBOOT=no diff --git a/files/halt.local.cdrom b/files/halt.local.cdrom new file mode 100755 index 0000000..1e9fc67 --- /dev/null +++ b/files/halt.local.cdrom @@ -0,0 +1,25 @@ +#!/usr/bin/perl + +use lib qw(/usr/lib/libDrakX); +use MDK::Common; +use detect_devices; +use c; + +my ($device) = cat_("/proc/mounts") =~ m!(/dev/\S+)\s+/live/media\s+iso9660!; +$device or exit; + +system("chvt 1"); + +# try to put halt/reboot in cache, if not called directly from them +# mount is also needed by end of /etc/init.d/halt +system("$_ --help &>/dev/null") foreach qw(halt mount reboot); + +my $f = detect_devices::tryOpen($device); +# see openCdromTray() from install::any +ioctl($f, c::CDROM_LOCKDOOR(), 0); # unlock door +ioctl($f, c::CDROMEJECT(), 0); + +print "\n\nPlease press <Enter> (or <CTRL><J>) once the medium is removed.\n"; +system("read < /dev/console"); + +ioctl($f, c::CDROMCLOSETRAY(), 0); diff --git a/files/halt.pre b/files/halt.pre new file mode 100644 index 0000000..8b2583e --- /dev/null +++ b/files/halt.pre @@ -0,0 +1,20 @@ +#!/bin/bash + +mypath=$_ +roottype=`awk '$2 == "/" { print $3 }' /etc/fstab` + +maybe_umount() { + eval d=\$$# + awk "\$2 == \"$d\" { system(\"umount \" \$d) }" /proc/mounts +} + +if [ "$roottype" == unionfs ]; then + maybe_umount /var/lib/rpm + maybe_umount /tmp/rpm/real + maybe_umount /tmp/rpm +fi + +# disable self during first halt when installed +rm -f $mypath + +/bin/plymouth quit diff --git a/files/kbluetoothrc b/files/kbluetoothrc new file mode 100644 index 0000000..2680caa --- /dev/null +++ b/files/kbluetoothrc @@ -0,0 +1,5 @@ +[General] +AutoStart=false + +[Notification Messages] +kbluepinLocInfo-usr-lib-kdebluetooth=false diff --git a/files/korgacrc b/files/korgacrc new file mode 100644 index 0000000..f948d8c --- /dev/null +++ b/files/korgacrc @@ -0,0 +1,2 @@ +[General] +Autostart=false diff --git a/files/live.modprobe.cdrom b/files/live.modprobe.cdrom new file mode 100644 index 0000000..5bb2345 --- /dev/null +++ b/files/live.modprobe.cdrom @@ -0,0 +1 @@ +install usblp /bin/true diff --git a/files/mdkonlinerc b/files/mdkonlinerc new file mode 100644 index 0000000..cca41e8 --- /dev/null +++ b/files/mdkonlinerc @@ -0,0 +1 @@ +AUTOSTART=FALSE diff --git a/files/portable-directories-flash-liveusb-rw b/files/portable-directories-flash-liveusb-rw new file mode 100755 index 0000000..dbdda92 --- /dev/null +++ b/files/portable-directories-flash-liveusb-rw @@ -0,0 +1,22 @@ +#!/bin/sh + +function create_mozilla_profile() { + USER_DIR=$1 + PORTABLE_DIR=$2 + [ -d $USER_DIR ] && return + mkdir -p $USER_DIR + ln -sf "$PORTABLE_DIR/Data/profile" $USER_DIR + cat > "$USER_DIR/profiles.ini" <<EOF +[General] +StartWithLastProfile=1 + +[Profile0] +Name=default +IsRelative=1 +Path=profile +EOF +} + +PORTABLE_ROOT=/live/media/.apps +create_mozilla_profile "$HOME/.mozilla/firefox" "$PORTABLE_ROOT/FirefoxPortable" +create_mozilla_profile "$HOME/.thunderbird" "$PORTABLE_ROOT/ThunderbirdPortable" diff --git a/files/xdg-email-hook.sh b/files/xdg-email-hook.sh new file mode 100755 index 0000000..2ad2dc3 --- /dev/null +++ b/files/xdg-email-hook.sh @@ -0,0 +1,4 @@ +#!/bin/sh +[ -z "$MAILER" ] && MAILER=`which mozilla-thunderbird 2> /dev/null` +[ -z "$MAILER" ] && MAILER=/usr/bin/xdg-email +exec $MAILER $@ diff --git a/tools/compute-rpm-sizes.sh b/tools/compute-rpm-sizes.sh new file mode 100755 index 0000000..5425d3f --- /dev/null +++ b/tools/compute-rpm-sizes.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +chroot=$1 +name=$2 + +if [ -z "$chroot" ] || [ -z "$name" ]; then + echo "usage: $0 <chroot> <name>" +fi + +full=$name-full.lst +leaves=$name-leaves.lst +chroot $chroot sh -c "rpm -qa --qf '%{size} \t%{name}\n' | sort -n" > $full +chroot $chroot sh -c "urpmi_rpm-find-leaves | xargs rpm -q --qf '%{size} \t%{name}\n' | sort -n" > $leaves + +echo $full $leaves diff --git a/tools/install-mozilla-extension.sh b/tools/install-mozilla-extension.sh new file mode 100755 index 0000000..4bb4c3b --- /dev/null +++ b/tools/install-mozilla-extension.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +extpath=$1 +xpi=$2 + +if [ -z "$extpath" ]; then + echo "usage: $0 <mozilla extension path> [<xpi file>]" + exit 1 +fi + +xpi_dir="." +if [ -n "$xpi" ]; then + xpi_dir="`basename $xpi`.dir" + rm -rf $xpi_dir + mkdir -p $xpi_dir + unzip -q -d $xpi_dir $xpi +fi + +rdf="$xpi_dir/install.rdf" +if [ ! -f $rdf ]; then + echo "unable to find rdf file" + exit 1 +fi + +# remove leading newline from some broken rdf files (pt-PT) +perl -pi -e 's/^\r?\n// if $. == 1' $rdf + +hash="$(perl -pe 's/\r\n/\n/g' $rdf | sed -n '/.*em:id="\(.*\)"/{s//\1/p;q}')" +if [ -z "$hash" ]; then + hash="$(perl -pe 's/\r\n/\n/g' $rdf | sed -n '/.*em:id>\(.*\)<\/em:id>.*/{s//\1/p;q}')" +fi +if [ -z "$hash" ]; then + echo "Failed to find plugin hash." + exit 1 +fi + +echo "installing $hash in $extpath" + +extdir="$extpath/$hash" +rm -rf $extdir +mkdir -p "$extdir" +cp -af $xpi_dir/* "$extdir/" + +if [ -n "$xpi" ]; then + rm -rf $xpi_dir +fi diff --git a/tools/install-portable-mozilla.sh b/tools/install-portable-mozilla.sh new file mode 100755 index 0000000..5158ceb --- /dev/null +++ b/tools/install-portable-mozilla.sh @@ -0,0 +1,58 @@ +#!/bin/sh + +mozapp=$1 +mozver=$2 +download=1 + +if [ -z "$mozapp" -o -z "$mozver" ]; then + echo "usage: $0 <mozilla application> <version>" +fi + +case "$mozapp" in + firefox) + sourceforgedir="portableapps/Mozilla Firefox, Portable Ed./Mozilla Firefox, Portable Edition $mozver" + installername=FirefoxPortable + portablename=FirefoxPortable + ;; + thunderbird) + sourceforgedir="portableapps/Mozilla Thunderbird, P.E./Mozilla Thunderbird, Portable Edition $mozver" + installername=ThunderbirdPortable + portablename=ThunderbirdPortable + ;; + *) + echo "invalid application: $mozapp" + exit 1 + ;; +esac + +installer="${installername}_${mozver}_English.paf.exe" +switchlocaleurl=https://addons.mozilla.org/en-US/firefox/downloads/file/16920/locale_switcher-2.1-fx+tb.xpi +switchlocalename=$(basename $switchlocaleurl) + +if [ -n "$download" ]; then + + wget -nc "http://freefr.dl.sourceforge.net/sourceforge/$sourceforgedir/$installer" + wget -nc $switchlocaleurl/$switchlocalename +fi + +xpi_url=http://releases.mozilla.org/pub/mozilla.org/$mozapp/releases/$mozver/win32/xpi/ +xpi_dir="${mozapp}-${mozver}-xpi" +extdir="${portablename}/App/DefaultData/profile/extensions" + +if [ -n "$download" ]; then + rm -rf $xpi_dir + mkdir -p $xpi_dir + lftp -e "lcd $xpi_dir; mget -c *.xpi; quit" $xpi_url +fi + +wine $installer + +bindir=$(dirname $0) +for ext in $switchlocalename $xpi_dir/*.xpi; do + $bindir/install-mozilla-extension.sh $extdir $ext +done + +mozexe="$portablename/$portablename.exe" +#- pre-create profile data, takes a long time on USB +wine $mozexe +# FIXME: run from key? (different path) diff --git a/tools/langs-expand.pl b/tools/langs-expand.pl new file mode 100755 index 0000000..2d0797b --- /dev/null +++ b/tools/langs-expand.pl @@ -0,0 +1,6 @@ +#!/usr/bin/perl -l +use lib qw(/usr/lib/libDrakX); +use lang; +use MDK::Common; +my @langs = grep { member(lang::locale_to_main_locale($_), @ARGV) } lang::list_langs(); +print join("\n", map { lang::l2name($_) . " (" . $_ . ")" } sort(@langs)); diff --git a/tools/live-lang b/tools/live-lang new file mode 100644 index 0000000..6772648 --- /dev/null +++ b/tools/live-lang @@ -0,0 +1,39 @@ +#!/usr/bin/perl +# +# + +use strict; +use lib qw(/usr/lib/libDrakX); +use common; +use lang; + +my @chroot = @ARGV; + +@chroot or usage(); + +foreach my $path (@chroot) { + my %done; + my $qa = `chroot $path rpm -qa`; + my @list; + foreach my $rpm (split "\n", $qa) { + my $l; + if ($rpm =~ /locales-([^-]+)-/) { + #$l = $1 + } elsif ($rpm =~ /(?:i18n|l10n|aspell)-([^-]+)-/) { + $l = $1 + } + if ($l && $lang::langs{$l} && !$done{$l}) { + $done{$l} = 1; + push @list,@{$lang::langs{$l}}[0] + } + } + print "$path: ", join(", ", sort @list), "\n" +} + +exit; + +sub usage { + print "\nusage:\n\n\t\tlive-lang <chroot install>\n\n"; + exit +} + diff --git a/tools/partition.sh b/tools/partition.sh new file mode 100755 index 0000000..2637797 --- /dev/null +++ b/tools/partition.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +DEVICE=$1 +LABEL=Share +if [ -z "$DEVICE" ]; then + echo "No device" + exit 1 +fi + +# FT +#END1=780 +#END2=1950 + +#END1=380 +#END2=1022 + +END1=25000 +END2=60869 + +fdisk $DEVICE <<EOF +o +n +p +1 + +$END1 +n +p +2 + +$END2 +t +1 +b +t +2 +b +w +EOF + +mkdosfs -n $LABEL ${DEVICE}1 diff --git a/tools/sync-trees.sh b/tools/sync-trees.sh new file mode 100755 index 0000000..8eea0f6 --- /dev/null +++ b/tools/sync-trees.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +#MEDIA=/media/non-free/release +[ -n "$1" ] && DRY_RUN=-n +DIST=/cooker/i586 +ROOT=$DIST$MEDIA +SOURCE=/live/mnt/BIG/dis/devel$ROOT +DEST=/mnt/field/dis/local$ROOT +TEST=media/main/release/media_info/UPDATING + +rsync $DRY_RUN -avP -lHz -e 'ssh -xc arcfour' --delete --delete-excluded --exclude 'debug_*/*/*' --exclude SRPMS $SOURCE/ $DEST + +if [ -e "$DEST/$TEST" ]; then + echo + echo "Warning: package upload in progress" + echo "Resync tree!" + exit 1 +fi + +exit 0 diff --git a/tools/umount-live b/tools/umount-live new file mode 100644 index 0000000..098c82e --- /dev/null +++ b/tools/umount-live @@ -0,0 +1,48 @@ +#!/bin/bash +# +### BEGIN INIT INFO +# Provides: umount-live +# Default-Stop: 0 6 +# Should-Stop: $remote_fs +# Short-Description: Umounts live-system-specific mountpoints on +#halt/reboot +# Description: This service umounts live-system-specific mountpoints +#on halt/reboot. +### END INIT INFO + +mypath=$_ + +case "$1" in + *start) + ;; + *stop) + exit + ;; + *) + gprintf "Usage: %s\n" "$(basename $0) {start}" + exit 1 + ;; +esac + +roottype=`awk '$2 == "/" { print $3 }' /etc/fstab` + +if [ "$roottype" != unionfs ]; then + # disable self during first halt when installed + chkconfig --del $(basename $0) + #rm -f $mypath + exit +fi + +maybe_umount() { + eval d=\$$# + [ -e $d ] && umount $@ +} + +maybe_umount -l /live/distrib +maybe_umount -l /live/memory +maybe_umount -l /live/system +maybe_umount -l /live/media + +maybe_umount /var/lib/rpm +maybe_umount /tmp/rpm/real +maybe_umount /tmp/rpm |