Программа установки Mandriva
Материал из Mandriva Russian Community Wiki
Содержание |
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.
The stage2 is provided in a squashfs image containing various files listed here. The result is install/stage2/mdkinst.sqfs, built by drakx-installer-stage2 src.rpm.
Keyboard shortcuts
In the Mandriva Installer GUI, you can use the following keyboard shortcuts:
- F2: make a screenshot to place in /root/DrakX-screenshots after installation
- Ctrl-Alt-Home: go back to the first step of install. It is used to debug the "language selection" step, and must not be used for other purpose (especially, it will fail horribly if some partitions have been mounted).
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:
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
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, i.e. the output of dmesg.
- alt-F7: the graphical install lives there
Log files
- /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.
- /mnt/root/install.log: the log of the installation (or upgrade) of the rpms
- /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...
Command bug puts on usb key (or floppy) a lot of interesting stuff, including files above
Passing options to the installer
Various options
Drakx can use various options to change its behaviour (this list not complete, most of the code is in install2.pm):
- flang, lang: change the translation of the installer. flang will skip the question.
- patch, defcfg: used to patch the installer in live mode (see next chapter).
- display, askdisplay: export the installation on another X11
How to pass an option
The installer will take the options from the kernel command-line (/proc/cmdline), so either add it in isolinux.cfg or add it dynamically in gfxboot (ask for "Kernel Options" to display kernel command-line)
Special mode of installation
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.
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.
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.
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
Examples: patches fixing bugs on mdv 2008.0 installer.
One typical use is to remove a step of the installer:
package install::install2;
undef *selectLanguage;
*selectLanguage = sub { 1 };
You can also use it to set some default variables. In fact, the auto_inst file is using the same mechanism.
The easiest way to use this is to place a file install/patch-oem.pl on the CD. This file will be read if it exists. You can also place a file named as you want, and use option 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 )
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/ emacs ~/install/patch-oem.pl
You can then run drakx-in-chroot from package drakx-installer-stage2 as root:
/usr/lib/drakx-installer-stage2/misc/drakx-in-chroot /mnt/cdrom /tmp/foo
It will display the installer in a window using Xephyr or Xnest.

