summaryrefslogtreecommitdiffstats
path: root/examples/minimal/config/build.cfg
blob: b7673711406b6c49aad8a195edc34adeee50b51c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
my $distro          = $build->{settings}{distro};
my $release         = $build->{settings}{release};
my $product         = $build->{settings}{product};
my $type            = $build->{settings}{type};
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, $release, $product, $type, $arch);
}

sub build_title {
    my ($build) = @_;

    join(' ', $distro, $release, $product, $type);
}

my $default_append = 'root=mgalive:LABEL=' . build_label($build) . ' noiswmd audit=0 rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0';

my $config = {
    iso_name_fields => [ qw(distro release product type arch) ],
    system => {
        enabled_media => [
            'Core Release',
            'Core Updates',
            'Nonfree Release',
            'Nonfree Updates',
        ],

        rpmsrate_flags => [
            'LIVE',
            # internet
            qw(CAT_NETWORKING_FILE_TRANSFER CAT_NETWORKING_DNS),
            # network
            qw(CAT_NETWORKING_REMOTE_ACCESS CAT_NETWORKING_FILE),
            # config
            qw(CAT_CONFIG),
            # console
            qw(CAT_EDITORS CAT_TERMINALS CAT_TEXT_TOOLS CAT_SHELLS CAT_FILE_TOOLS),
            # system
            qw(CAT_SYSTEM CAT_MINIMAL_DOCS),
        ],
        rpmsrate_level => 5,

        include_packages => [
            # Satisfy the basesystem bootloader requirement.
            'drakiso-null-bootloader',

            # Some extra admin tools.
            'bind-utils', 'btrfs-progs', 'dmraid', 'hdparm', 'mdadm',

            # 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 proprietary drivers
            'dkms-broadcom-wl',
            'dkms-nvidia340', 'x11-driver-video-nvidia340',
            'dkms-nvidia390', 'x11-driver-video-nvidia390',
            'dkms-nvidia-current', 'x11-driver-video-nvidia-current',

            # No bootloaders.
            'grub', 'grub2', 'grub2-efi', 'lilo',

            # Needs X
            'apmd', 'draklive-install', 'drakx-finish-install', 'xterm',

            # Not wanted
            'hunspell-dictionary',
        ],
#       preferred_packages => [
#       ],
        local_repo_packages => [
            # core
            'broadcom-bcma-config',
            'broadcom-ssb-config',
        ],

        langs_always => [ 'en_US' ],

        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 } ],

            # Set language and keyboard
            [ 'files/set-lang-kbd.service', '/etc/systemd/system/set-lang-kbd.service', { mode => 0644, no_install => 1 } ],
            [ 'files/set-lang-kbd', '/sbin/set-lang-kbd', { mode => 0755, no_install => 1 } ],

            # 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 } ],
        ],
        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(';',
            # Enable the set-lang-kbd service.
            "systemctl enable set-lang-kbd.service",

            # The man-db transfiletriggerin scriplet requires systemd, so will
            # have silently failed when run in a chroot. So the man-db cache
            # will not have been updated. Do it now.
            "mandb -q",

            # 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 => [
            { path => '/root/drakx' },
        ],
    },
#   regions => {
#       # the "all" region has a magical behavior and selects all langs
#   },
    media => {
        label               => build_label($build),
        overlay_label       => 'mgalive-persist',
        bootloader_title    => build_title($build),
        bootloader_theme    => '/usr/share/drakiso/bootloader/maggy',
        bootloader_font     => '/usr/share/drakiso/bootloader/unicode.pf2',
        bootloader_langs    => '/usr/share/drakiso/bootloader/lang-names.txt',
        bootloader_kbds     => '/usr/share/drakiso/bootloader/kbd-names.txt',
        bootloader_messages => '/usr/share/drakiso/bootloader/messages',
        bootloader_default  => 0,
        bootloader_timeout  => 10,
        bootloader_entries  => [
            'Boot Mageia Live' => { append => $default_append . ' xdriver=free' },
            'Memory Test'      => { command => 'linux16', image  => '/boot/memtest', initrd => 'none' },
        ],
        mbr_boot_img        => '/usr/share/drakiso/bootloader/images/boot_hybrid.img',
        eltorito_img        => '/usr/share/drakiso/bootloader/images/eltorito.img',
        if_($arch eq 'i586',
            efi_type        => '32bit',
            boot32_efi      => '/usr/share/drakiso/bootloader/images/bootia32.efi'
        ),
        if_($arch eq 'x86_64',
            efi_type        => '64bit',
            boot64_efi      => '/usr/share/drakiso/bootloader/images/bootx64.efi'
        ),
        copy_from_repo => [
            'isolinux/memtest'  => 'boot/memtest',
        ],
#       checksums           => [ qw(md5 sha1 sha2 sha3) ],
    },
};