summaryrefslogtreecommitdiffstats
path: root/config/live.cfg
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2011-03-15 13:58:31 +0000
committerOlivier Blin <blino@mageia.org>2011-03-15 13:58:31 +0000
commit4c4328833cb84e7e5e4eccbb385c9d4851bfd7b5 (patch)
treef6d8d18d835eb7a25088d351663a29c5058532d5 /config/live.cfg
downloaddraklive-config-4c4328833cb84e7e5e4eccbb385c9d4851bfd7b5.tar
draklive-config-4c4328833cb84e7e5e4eccbb385c9d4851bfd7b5.tar.gz
draklive-config-4c4328833cb84e7e5e4eccbb385c9d4851bfd7b5.tar.bz2
draklive-config-4c4328833cb84e7e5e4eccbb385c9d4851bfd7b5.tar.xz
draklive-config-4c4328833cb84e7e5e4eccbb385c9d4851bfd7b5.zip
import initial live config
Diffstat (limited to 'config/live.cfg')
-rw-r--r--config/live.cfg268
1 files changed, 268 insertions, 0 deletions
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),
+ ),
+};