Development/Howto/MDK Installer

From Mandriva

Jump to: navigation, search
Mandriva Installer Tips and Tricks

Contents


[edit]

Basic architecture of the installer

The installer is divided in two parts: stage 1 (StageOne) , written in C, to initialize the system, and stage 2, written in perl, exposed here.

[edit]

Keyboard shortcuts

This is undocumented (at least in the Reference Guide), but in the Mandriva Installer GUI, you can use the following keyboard shortcuts:

  • F2: make a screenshot to place in /root/DrakX-screenshots after installation

Complete this list with any other installer shortcuts you know.

[edit]

Useful info

You can find the original documentation of AutoInstall here.

Or as one large raw HTML file (tarred): Media:auto_inst.tar.bz2

From DrakX README:

[edit]

Making screenshots through network

On a test machine, make a network install, switch to console (ctrl-alt-F2), enter:

% xhost+

then, on another computer:

% DISPLAY=test_machine:0 xwd -root | convert - screenshot.png
[edit]

Virtual consoles

During install, a lot of interesting stuff can be found in different places: in consoles and in files. To switch to console 2 for example, do Ctrl-Alt-F2 from the X install.

  • alt-F1: the stdout of the install. Not very interesting stuff
  • alt-F2: simple shell. Quite a lot of commands are available but as they are written in perl (for space), they do not handle the very same options as normally. After install, you can do chroot /mnt to see your system just like after rebooting. rpm -qa works for example.
  • alt-F3: a lot of interesting things. Be careful, some ERROR messages are not interesting.
  • alt-F4: kernel's place. a.k.a. the output of dmesg.
  • alt-F7: the graphical install lives there
  • command bug puts on floppy lots of interesting stuff.
  • /tmp/ddebug.log: same (or nearly the same) as alt-F3
  • /tmp/syslog: same as alt-F4
  • /mnt/root/ddebug.log: at the end of each step, DrakX tries to backup /tmp/ddebug.log to /mnt/root. Available only after mounting of /.
  • /mnt/root/install.log: the log of the installation (or upgrade) of the rpms (just like rpm's /mnt/tmp/(install )
  • /mnt/root/auto_inst.cfg.pl: a kickstart file generated at the end of each step. Can be used in 2 ways: kickstart install or defcfg install. Hopefully you know about kickstart. defcfg is a way to customize the default values in install. For example, French can be the default language with a qwerty keyboard, the auto-partitioning of partitions can be changed, the default user class can be set to developer (!)...
[edit]

Passing options to the installer

If you need to pass options to the kernel or the installer, you need to press F1 to see the bootloader and add options. You can choose between various flavours of the kernel and add standard kernel options ( like noapic, nolapic, acpi=off ), or add options for the installer.

[edit]

Various command line options

Drakx can use various options to change its behaviour.

This list not complete, most of the code is in install2.pm ( http://cvs.mandriva.com/cgi-bin/viewvc.cgi/gi/perl-install/install2.pm?view=markup ) :

  • flang, lang: change the translation of the installer. flang will skip the question.
  • display, askdisplay: export the installation on another X11
  • oem: install Mandriva Linux in a way suitable for oem. An oem install will remove all partitions and only ask some questions, suitable for selling a computer with the distribution preinstalled. See the file HACKING in cvs for more information
  • patch, defcfg: used to patch the installer in live mode (see next chapter).
[edit]

Special mode of installation

[edit]

Using brltty

By passing the brltty parameter to the kernel you will activate the brltty software, allowing to install Mandriva Linux with a Braille display.

[edit]

Using a serial cable for the installation

The installer should be able to use a serial link, as it is something standard on linux. All you have to do is to pass options to the kernel:

  • console=ttyS0,1152008n
  • text
  • vga=text

And use minicom to do the installation. But this is untested by the author of this document. You can see the documentation of the kernel for the syntax of the console option.

[edit]

Exporting the X11 display

You can run the graphical installation on another display. Either pass the option display=ip:0, or use askdisplay. You may need to lower the security ( using xhost + ) to make this work.

[edit]

Customisation of the install by patching it

Drakx can be fully customised without recompilation or modification of the code, by using a perl script run in the context of the installer used to change variables or functions. This approach has many advantages over a real patch:

  • this requires no modification of the source code, so the file can be changed and the patch still be valid.
  • you have access to all the power of perl and the library used by install, allowing to add questions, and test them without running a full install
  • it can be added on an iso very quickly, or on a network installation without changing anything in the layout

You can find examples on http://cvs.mandriva.com/cgi-bin/cvsweb.cgi/gi/perl-install/patch/.

One typical use is to remove a step of the installer:

undef *selectLanguage;
*selectLanguage = sub {
        1;
};

You can also use it to set some default variables. In fact, the auto_inst file is simply using the same mechanism.

The easiest way to use this is to place a file called patch-oem.pl in the install subdirectory of the Cd. This file will be read if it exists, without needing to give any option.

You can also place a file named as you want, and use defcfg=filename, to load this patch.

If you need to add some backgrounds, or change some files, you can also place an rpm in the file install/oem-theme.rpm, it will be installed with the command rpm -U ( code in file installs_step.pm )

[edit]

Testing the patch without burning a cd

Stage 2 of the installer can be run on a live system. First, you need to get a Mandriva Linux tree, the same you can find on cd or ftp mirror. You can use mount -o bind to not copy the whole tree on your disk:

mount /mnt/cdrom/
cp -R /mnt/cdrom/install/ ~/install
sudo mount -o bind ~/install /mnt/cdrom/install/

Then, you need to set 2 environment variables:

export SHARE_PATH=/tmp/image/Mandrake/mdkinst/usr/share/
# enable it, unless you want to do a real install ( maybe not supported )
export PERL_INSTALL_TEST=1
# stage 2 need to have the image mounted on /tmp/image, by convention
ln -s /mnt/cdrom /tmp/image
# if you want to pass a option, just use --option, instead of option
/tmp/image/Mandrake/mdkinst/usr/bin/perl-install/install2

If you have Xnest, drakx will be run in a window, if not, you will see three windows on your current desktop ( or another display, if you change $DISPLAY ). You do not need to be root to do this.

Personal tools