summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/gui/config/build.cfg201
-rw-r--r--examples/gui/config/settings.cfg8
-rwxr-xr-xexamples/gui/files/50-disable-suspend.pkla6
-rw-r--r--examples/gui/files/blacklist-ide.conf2
-rw-r--r--examples/gui/files/dracut-live.conf16
-rw-r--r--examples/gui/files/draklive-install.d/finish-install13
-rw-r--r--examples/gui/files/draklive-install.d/firstboot1
-rwxr-xr-xexamples/gui/files/draklive-install.d/run.d/home-live-permissions.sh5
-rw-r--r--examples/gui/files/draklive-install.d/services2
-rw-r--r--examples/gui/files/empty.conf0
-rw-r--r--examples/gui/files/finish-install7
-rw-r--r--examples/gui/files/firstboot1
-rw-r--r--examples/gui/files/halt-local.service23
-rwxr-xr-xexamples/gui/files/halt.local24
-rw-r--r--examples/gui/files/mgaonlinerc1
-rw-r--r--examples/xfce/config/build.cfg251
-rw-r--r--examples/xfce/config/settings.cfg10
-rwxr-xr-xexamples/xfce/files/50-disable-suspend.pkla6
-rw-r--r--examples/xfce/files/blacklist-ide.conf2
-rw-r--r--examples/xfce/files/dracut-live.conf16
-rw-r--r--examples/xfce/files/draklive-install.d/finish-install13
-rw-r--r--examples/xfce/files/draklive-install.d/firstboot1
-rwxr-xr-xexamples/xfce/files/draklive-install.d/run.d/home-live-permissions.sh5
-rw-r--r--examples/xfce/files/draklive-install.d/services2
-rw-r--r--examples/xfce/files/empty.conf0
-rw-r--r--examples/xfce/files/finish-install7
-rw-r--r--examples/xfce/files/firstboot1
-rw-r--r--examples/xfce/files/halt-local.service23
-rwxr-xr-xexamples/xfce/files/halt.local24
-rw-r--r--examples/xfce/files/mgaonlinerc1
30 files changed, 672 insertions, 0 deletions
diff --git a/examples/gui/config/build.cfg b/examples/gui/config/build.cfg
new file mode 100644
index 0000000..9d1be92
--- /dev/null
+++ b/examples/gui/config/build.cfg
@@ -0,0 +1,201 @@
+#!/usr/bin/perl -cw
+
+my $distro = $build->{settings}{distro};
+my $version = $build->{settings}{version};
+my $product = $build->{settings}{product};
+my $desktop = $build->{settings}{desktop};
+my $arch = $build->{settings}{arch};
+
+my @user_config_dirs = ('/etc/skel');
+
+sub build_label {
+ my ($build) = @_;
+
+ join('-', $distro, $version, $product, $desktop, $arch);
+}
+
+sub build_title {
+ my ($build) = @_;
+
+ join(' ', $distro, $version, $product, $desktop);
+}
+
+my $default_append = 'root=mgalive:LABEL=' . build_label($build) . ' splash quiet noiswmd audit=0 rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0';
+
+my $_l = {
+ system => {
+ enabled_media => [
+ 'Core Release',
+# 'Core Updates',
+ 'Nonfree Release',
+# 'Nonfree Updates',
+ ],
+
+ include_packages => [
+ # Support first time actions and draklive-install.
+ 'busybox-static', 'drakx-installer-binaries-probe',
+ 'drakx-finish-install', 'draklive-install',
+
+ # Satisfy the basesystem bootloader requirement.
+ 'drakiso-null-bootloader',
+
+ # Allow patching during customisation.
+ 'patch',
+ ],
+ exclude_packages => [
+ if_($arch eq 'i586',
+ # We want the desktop586 kernel for maximum hardware compatibility.
+ '/^kernel-desktop-/', '/^vboxadditions-kernel-.*-desktop-/',
+ ),
+
+ # No server kernels.
+ '/^kernel-server-/', '/^vboxadditions-kernel-.*-server-/',
+
+ # No bootloaders. The GRUB2 bootloaders are needed for install, so we add
+ # them to the local repo, which means they are automatically excluded.
+ 'grub', 'lilo',
+
+ # No distribution license.
+ 'flash-player-plugin',
+ ],
+ preferred_packages => [
+ ],
+ local_repo_packages => [
+ # core
+ 'broadcom-bcma-config',
+ 'broadcom-ssb-config',
+ 'dkms',
+ 'efibootmgr', 'efivar',
+ 'grub2', 'grub2-efi', 'grub2-mageia-theme', 'os-prober',
+ if_($arch eq 'i586', 'kernel-desktop586-devel-latest'),
+ if_($arch eq 'x86_64', 'kernel-desktop-devel-latest'),
+
+ # nonfree
+ 'dkms-broadcom-wl',
+ 'dkms-nvidia304', 'x11-driver-video-nvidia304',
+ 'dkms-nvidia340', 'x11-driver-video-nvidia340',
+ 'dkms-nvidia-current', 'x11-driver-video-nvidia-current',
+ ],
+
+ post_install => join(";",
+ # systemd boots by default to multiuser.target (old init 3), so change to graphical (old init 5).
+ "ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target",
+
+ # Have inittab match systemd defaulting to init 5.
+ "perl -pi -e 's/^id:3:initdefault:/id:5:initdefault:/' /etc/inittab",
+ ),
+
+ langs_always => [ 'en_US' ],
+
+ disable_services => [
+ ],
+ disable_timers => [
+ ],
+ files => [
+ # Clean configuration files.
+ [ 'files/empty.conf', '/etc/dracut.conf.d/51-mageia-resume.conf', { mode => 0644 } ],
+ [ 'files/empty.conf', '/etc/modprobe.conf', { mode => 0644 } ],
+
+ # Blacklist pata_acpi (mga#3395).
+ [ 'files/blacklist-ide.conf', '/etc/modprobe.d/blacklist-ide.conf', { mode => 0644 } ],
+
+ # Live media specific initrd.
+ [ 'files/dracut-live.conf', '/etc/dracut.conf.d/60-live.conf', { mode => 0644, no_install => 1 } ],
+
+ # Disable first boot wizard at live boot.
+ [ 'files/firstboot', '/etc/sysconfig/firstboot', { mode => 0644 } ],
+
+ # Enable drakx-finish-install at live boot.
+ [ "files/finish-install", '/etc/sysconfig/finish-install', { mode => 0644 } ],
+
+ # Disable mgaonline in live mode.
+ (map { [ 'files/mgaonlinerc', $_ . '/.MgaOnline/mgaonline', { mode => 0644, no_install => 1 } ] } @user_config_dirs),
+
+ # Disable suspend and hibernate in live mode.
+ [ 'files/50-disable-suspend.pkla', '/etc/polkit-1/localauthority/50-local.d/50-disable-suspend.pkla', { mode => 0644, no_install => 1 } ],
+
+ # Eject medium before live system halt/reboot.
+ [ 'files/halt-local.service', '/etc/systemd/system/halt-local.service', { mode => 0644, no_install => 1 } ],
+ [ 'files/halt.local', '/sbin/halt.local', { mode => 0755, no_install => 1 } ],
+
+ # sysconfig files for first boot after install.
+ [ '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 } ],
+
+ # Fix for sometimes wrong permissions after install.
+ [ 'files/draklive-install.d/run.d/home-live-permissions.sh', '/etc/draklive-install.d/run.d/home-live-permissions.sh', { mode => 755 } ],
+
+ ],
+ 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_*",
+ ],
+ patches => [
+ ],
+ final_fixes => join(';',
+ # Get default user name.
+ "default_user=`grep 1000:1000 /etc/passwd`",
+ "default_user=\${default_user%%:*}",
+
+ # Add a desktop icon to run draklive-install (for DEs that support it).
+ "mkdir -p /home/\$default_user/Desktop",
+ "cp /usr/share/applications/mageia-draklive-install.desktop /home/\$default_user/Desktop/draklive-install.desktop",
+
+ # Fix permissions for copied files.
+ "chown -R \$default_user.\$default_user /home/\$default_user",
+
+ # Set default user name for draklive-install.
+ "echo \$default_user > /etc/draklive-install.d/user",
+ "sed -i s/DEFAULT_USER/\$default_user/ /etc/draklive-install.d/sysconfig/finish-install",
+
+ # Allow draklive-install to spawn subtasks that access the display.
+ "echo 'session optional pam_xauth.so # for draklive-install' >> /etc/pam.d/polkit-1",
+
+ # Set the timestamp on the font directories to be a whole second
+ # fc-cache looks at the nano second portion which may be non-zero
+ # as we are on ext4, but then it will compare against the stamps
+ # on the squashfs live image which have whole second resolution
+ # (adapted from fix descrived in OpenMandriva bug 1764).
+ "find /usr/share/fonts -type d -exec touch -t \$(date +%Y%m%d%H%M.%S) '{}' ';'",
+ # Now update the cache for the new timestamps.
+ "fc-cache -rf",
+
+ # Set the initial wireless regulatory domain to "world", enabling
+ # all possible wireless channels to be used.
+ "sed -i -r 's/CRDA_DOMAIN=.*/CRDA_DOMAIN=00/' /etc/sysconfig/network",
+ ),
+
+ vga_mode => 788,
+ },
+ loopbacks => {
+ exclude => {
+ type => 'squashfs',
+ files => [
+ { path => '/root/drakx' },
+ ],
+ },
+ },
+ regions => {
+ # the "all" region has a magical behavior and selects all langs
+ },
+ copy_from_repo => [
+ 'isolinux/memtest' => "boot/memtest",
+ ],
+ media => {
+ storage => 'iso',
+ label => build_label($build),
+ bootloader_title => build_title($build),
+ bootloader_default => 0,
+ bootloader_timeout => 10,
+ bootloader_entries => [
+ 'Boot Mageia Live' => { append => $default_append . ' xdriver=free' },
+ ' + use non-free video drivers (slower to boot)' => { append => $default_append . ' nokmsboot' },
+ 'Install Mageia Live' => { append => $default_append . ' xdriver=free install' },
+ ' + use non-free video drivers (slower to boot)' => { append => $default_append . ' nokmsboot install' },
+ 'Memory Test' => { command => 'linux16', image => '/boot/memtest', initrd => '' },
+ ],
+ },
+ mount => MGA::DrakISO::Mounts::volatile_squash_union(),
+};
diff --git a/examples/gui/config/settings.cfg b/examples/gui/config/settings.cfg
new file mode 100644
index 0000000..4785f94
--- /dev/null
+++ b/examples/gui/config/settings.cfg
@@ -0,0 +1,8 @@
+vendor=Custom
+distro=Mageia
+product=Live
+desktop=Custom
+version=6
+arch=x86_64
+repository=ftp://192.168.1.10/mageia/distrib/6
+workdir=/home/draklive/var-data
diff --git a/examples/gui/files/50-disable-suspend.pkla b/examples/gui/files/50-disable-suspend.pkla
new file mode 100755
index 0000000..7c92300
--- /dev/null
+++ b/examples/gui/files/50-disable-suspend.pkla
@@ -0,0 +1,6 @@
+[Disable Suspend]
+Identity=unix-user:*
+Action=org.freedesktop.upower.hibernate;org.freedesktop.upower.suspend
+ResultAny=no
+ResultInactive=no
+ResultActive=no
diff --git a/examples/gui/files/blacklist-ide.conf b/examples/gui/files/blacklist-ide.conf
new file mode 100644
index 0000000..146e357
--- /dev/null
+++ b/examples/gui/files/blacklist-ide.conf
@@ -0,0 +1,2 @@
+# temp fix for 3395
+blacklist pata_acpi
diff --git a/examples/gui/files/dracut-live.conf b/examples/gui/files/dracut-live.conf
new file mode 100644
index 0000000..42b3e24
--- /dev/null
+++ b/examples/gui/files/dracut-live.conf
@@ -0,0 +1,16 @@
+# it is a live, build initrd to boot any hardware
+hostonly="no"
+# load mga livecd support
+add_dracutmodules+=" mgalive "
+# block some dracut modules we dont want / use
+omit_dracutmodules+=" caps crypt dm dmraid mdraid lvm nfs i18n resume modsign "
+# compress initrd with xz
+compress_l="xz"
+# whitelist only the filesystems needed by live CDs and live USB
+filesystems="iso9660 vfat =fs/nls squashfs overlay"
+# ensure drm drivers are available early in the boot sequence
+add_drivers+=" amdgpu radeon nouveau i915 vboxvideo "
+# fibre channel & iSCSI modules are unneeded on live CD/USB and pull 1MB+ of firmware files
+omit_drivers+=" qla1280 qla2xxx qla4xxx "
+# pata_acpi is not wanted on boot
+omit_drivers+=" pata_acpi "
diff --git a/examples/gui/files/draklive-install.d/finish-install b/examples/gui/files/draklive-install.d/finish-install
new file mode 100644
index 0000000..28fe550
--- /dev/null
+++ b/examples/gui/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=no
+GLX=no
diff --git a/examples/gui/files/draklive-install.d/firstboot b/examples/gui/files/draklive-install.d/firstboot
new file mode 100644
index 0000000..a842497
--- /dev/null
+++ b/examples/gui/files/draklive-install.d/firstboot
@@ -0,0 +1 @@
+FIRSTBOOT=no
diff --git a/examples/gui/files/draklive-install.d/run.d/home-live-permissions.sh b/examples/gui/files/draklive-install.d/run.d/home-live-permissions.sh
new file mode 100755
index 0000000..efc7d05
--- /dev/null
+++ b/examples/gui/files/draklive-install.d/run.d/home-live-permissions.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+if [ -d "/home/live" ]; then
+ /usr/bin/chown -R live:live /home/live
+fi
diff --git a/examples/gui/files/draklive-install.d/services b/examples/gui/files/draklive-install.d/services
new file mode 100644
index 0000000..8a4c0de
--- /dev/null
+++ b/examples/gui/files/draklive-install.d/services
@@ -0,0 +1,2 @@
+crond
+msec
diff --git a/examples/gui/files/empty.conf b/examples/gui/files/empty.conf
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/gui/files/empty.conf
diff --git a/examples/gui/files/finish-install b/examples/gui/files/finish-install
new file mode 100644
index 0000000..fed1dd5
--- /dev/null
+++ b/examples/gui/files/finish-install
@@ -0,0 +1,7 @@
+FINISH_INSTALL=yes
+NETWORK=no
+URPMI=no
+AUTHENTICATION=no
+USERS=no
+TIMEZONE=simplified
+COUNTRY=simplified
diff --git a/examples/gui/files/firstboot b/examples/gui/files/firstboot
new file mode 100644
index 0000000..a842497
--- /dev/null
+++ b/examples/gui/files/firstboot
@@ -0,0 +1 @@
+FIRSTBOOT=no
diff --git a/examples/gui/files/halt-local.service b/examples/gui/files/halt-local.service
new file mode 100644
index 0000000..bc7f284
--- /dev/null
+++ b/examples/gui/files/halt-local.service
@@ -0,0 +1,23 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=/sbin/halt.local Compatibility
+ConditionFileIsExecutable=/sbin/halt.local
+DefaultDependencies=no
+After=shutdown.target
+Before=final.target
+
+[Service]
+Type=oneshot
+ExecStartPre=-/bin/kill -54 1
+ExecStartPre=-/usr/bin/plymouth quit
+ExecStartPre=-/usr/bin/chvt 1
+ExecStart=/sbin/halt.local
+TimeoutSec=0
+StandardOutput=tty
+RemainAfterExit=yes
diff --git a/examples/gui/files/halt.local b/examples/gui/files/halt.local
new file mode 100755
index 0000000..e27ad1d
--- /dev/null
+++ b/examples/gui/files/halt.local
@@ -0,0 +1,24 @@
+#!/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;
+
+# 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);
+
+system("clear");
+print "\n\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/examples/gui/files/mgaonlinerc b/examples/gui/files/mgaonlinerc
new file mode 100644
index 0000000..cca41e8
--- /dev/null
+++ b/examples/gui/files/mgaonlinerc
@@ -0,0 +1 @@
+AUTOSTART=FALSE
diff --git a/examples/xfce/config/build.cfg b/examples/xfce/config/build.cfg
new file mode 100644
index 0000000..36900f9
--- /dev/null
+++ b/examples/xfce/config/build.cfg
@@ -0,0 +1,251 @@
+#!/usr/bin/perl -cw
+
+my $distro = $build->{settings}{distro};
+my $version = $build->{settings}{version};
+my $product = $build->{settings}{product};
+my $desktop = $build->{settings}{desktop};
+my $arch = $build->{settings}{arch};
+my $default_user = $build->{settings}{default_user};
+
+my @user_config_dirs = ('/etc/skel', '/home/' . $default_user);
+
+sub build_label {
+ my ($build) = @_;
+
+ join('-', $distro, $version, $product, $desktop, $arch);
+}
+
+sub build_title {
+ my ($build) = @_;
+
+ join(' ', $distro, $version, $product, $desktop);
+}
+
+my $default_append = 'root=mgalive:LABEL=' . build_label($build) . ' splash quiet noiswmd audit=0 rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0';
+
+my $_l = {
+ system => {
+ enabled_media => [
+ 'Core Release',
+# 'Core Updates',
+ 'Nonfree Release',
+# 'Nonfree Updates',
+ ],
+
+ rpmsrate_flags => [
+ 'LIVE',
+ (map { "CAT_$_" } (
+ # 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),
+ # config
+ qw(CONFIG),
+ # console
+ qw(EDITORS TERMINALS TEXT_TOOLS SHELLS FILE_TOOLS),
+ # system
+ qw(SYSTEM MINIMAL_DOCS X ACCESSIBILITY THEMES),
+ # desktop
+ qw(XFCE),
+ ))
+ ],
+ compssListLevel => 5,
+
+ include_packages => [
+ # Satisfy the basesystem bootloader requirement.
+ 'drakiso-null-bootloader',
+
+ # Some extra admin tools.
+ 'bind-utils', 'btrfs-progs', 'dmraid', 'gparted', 'hdparm', 'mdadm',
+
+ # Mageia docs.
+ 'mageia-doc-mcc-en',
+
+ # Allow patching during customisation.
+ 'patch',
+
+ # s-c-p wants this if it detects a combined printer/scanner.
+ 'simple-scan',
+
+ # Provide a nicer UI for lxcontrol.
+ 'Xdialog',
+ ],
+ exclude_packages => [
+ if_($arch eq 'i586',
+ # We want the desktop586 kernel for maximum hardware compatibility.
+ '/^kernel-desktop-/', '/^vboxadditions-kernel-.*-desktop-/',
+ ),
+
+ # No server kernels.
+ '/^kernel-server-/', '/^vboxadditions-kernel-.*-server-/',
+
+ # No bootloaders. The GRUB2 bootloaders are needed for install, so we add
+ # them to the local repo, which means they are automatically excluded.
+ 'grub', 'lilo',
+
+ # No distribution license.
+ 'flash-player-plugin',
+ ],
+ preferred_packages => [
+ ],
+ local_repo_packages => [
+ # core
+ 'broadcom-bcma-config',
+ 'broadcom-ssb-config',
+ 'dkms',
+ 'efibootmgr', 'efivar',
+ 'grub2', 'grub2-efi', 'grub2-mageia-theme', 'os-prober',
+ if_($arch eq 'i586', 'kernel-desktop586-devel-latest'),
+ if_($arch eq 'x86_64', 'kernel-desktop-devel-latest'),
+
+ # nonfree
+ 'dkms-broadcom-wl',
+ 'dkms-nvidia304', 'x11-driver-video-nvidia304',
+ 'dkms-nvidia340', 'x11-driver-video-nvidia340',
+ 'dkms-nvidia-current', 'x11-driver-video-nvidia-current',
+ ],
+
+ post_install => join(";",
+ # systemd boots by default to multiuser.target (old init 3), so change to graphical (old init 5).
+ "ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target",
+
+ # Have inittab match systemd defaulting to init 5.
+ "perl -pi -e 's/^id:3:initdefault:/id:5:initdefault:/' /etc/inittab",
+ ),
+
+ langs_always => [ 'en_US' ],
+
+ additional_media => [
+# {
+# name => '',
+# path => '',
+# packages => [
+# ],
+# },
+ ],
+ rpms => [
+ ],
+ erase_rpms => [
+ ],
+ disable_services => [
+ # Uncommon hardware.
+ qw(bpalogin capi4linux cpqarrayd mdadm oki4daemon pcscd),
+ # Unneeded software.
+ qw(chronyd snmpd),
+ # Slows down basic usage and install, reenabled after install.
+ qw(crond msec),
+ ],
+ disable_timers => [
+ ],
+ files => [
+ # Clean configuration files.
+ [ 'files/empty.conf', '/etc/dracut.conf.d/51-mageia-resume.conf', { mode => 0644 } ],
+ [ 'files/empty.conf', '/etc/modprobe.conf', { mode => 0644 } ],
+
+ # Blacklist pata_acpi (mga#3395).
+ [ 'files/blacklist-ide.conf', '/etc/modprobe.d/blacklist-ide.conf', { mode => 0644 } ],
+
+ # Live media specific initrd.
+ [ 'files/dracut-live.conf', '/etc/dracut.conf.d/60-live.conf', { mode => 0644, no_install => 1 } ],
+
+ # Disable first boot wizard at live boot.
+ [ 'files/firstboot', '/etc/sysconfig/firstboot', { mode => 0644 } ],
+
+ # Enable drakx-finish-install at live boot.
+ [ "files/finish-install", '/etc/sysconfig/finish-install', { mode => 0644 } ],
+
+ # Disable mgaonline in live mode.
+ (map { [ 'files/mgaonlinerc', $_ . '/.MgaOnline/mgaonline', { mode => 0644, no_install => 1 } ] } @user_config_dirs),
+
+ # Disable suspend and hibernate in live mode.
+ [ 'files/50-disable-suspend.pkla', '/etc/polkit-1/localauthority/50-local.d/50-disable-suspend.pkla', { mode => 0644, no_install => 1 } ],
+
+ # Eject medium before live system halt/reboot.
+ [ 'files/halt-local.service', '/etc/systemd/system/halt-local.service', { mode => 0644, no_install => 1 } ],
+ [ 'files/halt.local', '/sbin/halt.local', { mode => 0755, no_install => 1 } ],
+
+ # sysconfig files for first boot after install.
+ [ '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 } ],
+
+ # Reenable services in installed system.
+ [ 'files/draklive-install.d/services', '/etc/draklive-install.d/services', { mode => 0644 } ],
+
+ # Fix for sometimes wrong permissions after install.
+ [ 'files/draklive-install.d/run.d/home-live-permissions.sh', '/etc/draklive-install.d/run.d/home-live-permissions.sh', { mode => 755 } ],
+
+ ],
+ 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_*",
+ ],
+ patches => [
+ ],
+ final_fixes => join(';',
+ # Add a desktop icon to run draklive-install.
+ "mkdir -p /home/$default_user/Desktop",
+ "cp /usr/share/applications/mageia-draklive-install.desktop /home/$default_user/Desktop/draklive-install.desktop",
+
+ # Fix permissions for copied files.
+ "chown -R $default_user.$default_user /home/$default_user",
+
+ # Set default user name for draklive-install.
+ "echo $default_user > /etc/draklive-install.d/user",
+ "sed -i s/DEFAULT_USER/$default_user/ /etc/draklive-install.d/sysconfig/finish-install",
+
+ # Allow draklive-install to spawn subtasks that access the display.
+ "echo 'session optional pam_xauth.so # for draklive-install' >> /etc/pam.d/polkit-1",
+
+ # Set the timestamp on the font directories to be a whole second
+ # fc-cache looks at the nano second portion which may be non-zero
+ # as we are on ext4, but then it will compare against the stamps
+ # on the squashfs live image which have whole second resolution
+ # (adapted from fix descrived in OpenMandriva bug 1764).
+ "find /usr/share/fonts -type d -exec touch -t \$(date +%Y%m%d%H%M.%S) '{}' ';'",
+ # Now update the cache for the new timestamps.
+ "fc-cache -rf",
+
+ # Set the initial wireless regulatory domain to "world", enabling
+ # all possible wireless channels to be used.
+ "sed -i -r 's/CRDA_DOMAIN=.*/CRDA_DOMAIN=00/' /etc/sysconfig/network",
+ ),
+
+ vga_mode => 788,
+ },
+ loopbacks => {
+ exclude => {
+ type => 'squashfs',
+ files => [
+ { path => '/root/drakx' },
+ ],
+ },
+ },
+ regions => {
+ # the "all" region has a magical behavior and selects all langs
+ },
+ copy_from_repo => [
+ 'isolinux/memtest' => "boot/memtest",
+ ],
+ media => {
+ storage => 'iso',
+ label => build_label($build),
+ bootloader_title => build_title($build),
+ bootloader_default => 0,
+ bootloader_timeout => 10,
+ bootloader_entries => [
+ 'Boot Mageia Live' => { append => $default_append . ' xdriver=free' },
+ ' + use non-free video drivers (slower to boot)' => { append => $default_append . ' nokmsboot' },
+ 'Install Mageia Live' => { append => $default_append . ' xdriver=free install' },
+ ' + use non-free video drivers (slower to boot)' => { append => $default_append . ' nokmsboot install' },
+ 'Memory Test' => { command => 'linux16', image => '/boot/memtest', initrd => '' },
+ ],
+ },
+ mount => MGA::DrakISO::Mounts::volatile_squash_union(),
+};
diff --git a/examples/xfce/config/settings.cfg b/examples/xfce/config/settings.cfg
new file mode 100644
index 0000000..3802295
--- /dev/null
+++ b/examples/xfce/config/settings.cfg
@@ -0,0 +1,10 @@
+vendor=Custom
+distro=Mageia
+product=Live
+desktop=Xfce
+version=6
+arch=x86_64
+region=all
+default_user=live
+repository=ftp://192.168.1.10/mageia/distrib/6
+workdir=/home/draklive/var-data
diff --git a/examples/xfce/files/50-disable-suspend.pkla b/examples/xfce/files/50-disable-suspend.pkla
new file mode 100755
index 0000000..7c92300
--- /dev/null
+++ b/examples/xfce/files/50-disable-suspend.pkla
@@ -0,0 +1,6 @@
+[Disable Suspend]
+Identity=unix-user:*
+Action=org.freedesktop.upower.hibernate;org.freedesktop.upower.suspend
+ResultAny=no
+ResultInactive=no
+ResultActive=no
diff --git a/examples/xfce/files/blacklist-ide.conf b/examples/xfce/files/blacklist-ide.conf
new file mode 100644
index 0000000..146e357
--- /dev/null
+++ b/examples/xfce/files/blacklist-ide.conf
@@ -0,0 +1,2 @@
+# temp fix for 3395
+blacklist pata_acpi
diff --git a/examples/xfce/files/dracut-live.conf b/examples/xfce/files/dracut-live.conf
new file mode 100644
index 0000000..42b3e24
--- /dev/null
+++ b/examples/xfce/files/dracut-live.conf
@@ -0,0 +1,16 @@
+# it is a live, build initrd to boot any hardware
+hostonly="no"
+# load mga livecd support
+add_dracutmodules+=" mgalive "
+# block some dracut modules we dont want / use
+omit_dracutmodules+=" caps crypt dm dmraid mdraid lvm nfs i18n resume modsign "
+# compress initrd with xz
+compress_l="xz"
+# whitelist only the filesystems needed by live CDs and live USB
+filesystems="iso9660 vfat =fs/nls squashfs overlay"
+# ensure drm drivers are available early in the boot sequence
+add_drivers+=" amdgpu radeon nouveau i915 vboxvideo "
+# fibre channel & iSCSI modules are unneeded on live CD/USB and pull 1MB+ of firmware files
+omit_drivers+=" qla1280 qla2xxx qla4xxx "
+# pata_acpi is not wanted on boot
+omit_drivers+=" pata_acpi "
diff --git a/examples/xfce/files/draklive-install.d/finish-install b/examples/xfce/files/draklive-install.d/finish-install
new file mode 100644
index 0000000..28fe550
--- /dev/null
+++ b/examples/xfce/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=no
+GLX=no
diff --git a/examples/xfce/files/draklive-install.d/firstboot b/examples/xfce/files/draklive-install.d/firstboot
new file mode 100644
index 0000000..a842497
--- /dev/null
+++ b/examples/xfce/files/draklive-install.d/firstboot
@@ -0,0 +1 @@
+FIRSTBOOT=no
diff --git a/examples/xfce/files/draklive-install.d/run.d/home-live-permissions.sh b/examples/xfce/files/draklive-install.d/run.d/home-live-permissions.sh
new file mode 100755
index 0000000..efc7d05
--- /dev/null
+++ b/examples/xfce/files/draklive-install.d/run.d/home-live-permissions.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+if [ -d "/home/live" ]; then
+ /usr/bin/chown -R live:live /home/live
+fi
diff --git a/examples/xfce/files/draklive-install.d/services b/examples/xfce/files/draklive-install.d/services
new file mode 100644
index 0000000..8a4c0de
--- /dev/null
+++ b/examples/xfce/files/draklive-install.d/services
@@ -0,0 +1,2 @@
+crond
+msec
diff --git a/examples/xfce/files/empty.conf b/examples/xfce/files/empty.conf
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/xfce/files/empty.conf
diff --git a/examples/xfce/files/finish-install b/examples/xfce/files/finish-install
new file mode 100644
index 0000000..fed1dd5
--- /dev/null
+++ b/examples/xfce/files/finish-install
@@ -0,0 +1,7 @@
+FINISH_INSTALL=yes
+NETWORK=no
+URPMI=no
+AUTHENTICATION=no
+USERS=no
+TIMEZONE=simplified
+COUNTRY=simplified
diff --git a/examples/xfce/files/firstboot b/examples/xfce/files/firstboot
new file mode 100644
index 0000000..a842497
--- /dev/null
+++ b/examples/xfce/files/firstboot
@@ -0,0 +1 @@
+FIRSTBOOT=no
diff --git a/examples/xfce/files/halt-local.service b/examples/xfce/files/halt-local.service
new file mode 100644
index 0000000..bc7f284
--- /dev/null
+++ b/examples/xfce/files/halt-local.service
@@ -0,0 +1,23 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=/sbin/halt.local Compatibility
+ConditionFileIsExecutable=/sbin/halt.local
+DefaultDependencies=no
+After=shutdown.target
+Before=final.target
+
+[Service]
+Type=oneshot
+ExecStartPre=-/bin/kill -54 1
+ExecStartPre=-/usr/bin/plymouth quit
+ExecStartPre=-/usr/bin/chvt 1
+ExecStart=/sbin/halt.local
+TimeoutSec=0
+StandardOutput=tty
+RemainAfterExit=yes
diff --git a/examples/xfce/files/halt.local b/examples/xfce/files/halt.local
new file mode 100755
index 0000000..e27ad1d
--- /dev/null
+++ b/examples/xfce/files/halt.local
@@ -0,0 +1,24 @@
+#!/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;
+
+# 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);
+
+system("clear");
+print "\n\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/examples/xfce/files/mgaonlinerc b/examples/xfce/files/mgaonlinerc
new file mode 100644
index 0000000..cca41e8
--- /dev/null
+++ b/examples/xfce/files/mgaonlinerc
@@ -0,0 +1 @@
+AUTOSTART=FALSE