BlueSock es una empresa española que está haciendo una distribución denominada BSLinux y basada en Debian GNU/Linux. Esta empresa ha desarrollado un sistema de instalación muy potente que, a bajo nivel, utiliza XML. Todo el desarrollo se está haciendo bajo la licencia GPL.
La parte del desarrollo que interesa, a priori, a metadistros es su herramienta de particionado. Esta se basa en el programa parted y hace uso de XML internamente. Debido a como está diseñada la herramienta, se puede modificar la tabla de particiones de equipos vía red, no sólo aquellos en los cuales se esté ejecutando.
Las imágenes que se muestran a continuación, muestran el frontend basado en QT, que utiliza esta herramienta de particionado en la distribución BSLinux.
Particionador de BlueSock - imagen 1 -
Particionador de BlueSock - imagen 2 -
Particionador de BlueSock - imagen 3 -
Otra de las características interesantes de esta distribución, es su uso del XML para distintas partes del sistema, como pueden ser: archivos de configuración, archivos del sistema de instalación, etc.
Los ejemplos que se muestran a continuación son archivos obtenidos de BSLinux 1.0 Personal del día 6 de febrero de 2003. De ellos se puede desprender como se puede aprovechar el XML para estas tareas.
Configuración de la “localización” del sistema. El archivo se denomina installation_locate.xml.
<countries> <!-- we order the country by language, but this is just a way, not mean to be strict, just to look for the country name faster later --> <!-- English speaking countries --> <country> <name>England</name> <language>English</language> <keyboard-layout>U.S English</keyboard-layout> <GMT></GMT> </country> <country> <name>United States</name> <language>English</language> <keyboard-layout>U.S English</keyboard-layout> <GMT></GMT> </country> <country> <name>Spain</name> <language>Español</language> <keyboard-layout>Spain (es)</keyboard-layout> <GMT></GMT> </country> <country> <name>Japan</name> <language>æ¥æ¬èª</language> <keyboard-layout>Japan (jp)</keyboard-layout> <GMT></GMT> </country> <language> <name>English</name> <encoding>iso-8859-1</encoding> <dir></dir> </language> <language> <name>Español</name> <encoding>iso-8859-1</encoding> <dir></dir> </language> <language> <name>æ¥æ¬èª</name> <encoding>iso-2202</encoding> <dir></dir> </language> </countries> |
Archivo generado por el configurer de CoolBlue. El archivo se denomina configurerConfig.xml.
<?xml version = '1.0' encoding = 'UTF-8' ?> <AUTOMATICALLY_GENERATED_XML> <version>0.1</version> <global> <distro> <name>BSLinux</name> <version>1.0</version> <codenamed>kenny</codenamed> <date>??-??-2002</date> </distro> <paths> <source> <base>/target/</base> <lists>var/lib/apt/lists/</lists> <packages>var/cache/apt/archives/</packages> </source> <target> <base>/target/</base> <dpkg>var/lib/dpkg/</dpkg> </target> </paths> <architecture>i386</architecture> <suite>kenny/</suite> </global> <fstab> <header># # Automatically generated by configurer from CoolBlue. # # /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass></header> <filesystems> <filesystem> <name>reiserfs</name> <options> <option>defaults</option> </options> </filesystem> <filesystem> <name>ext3</name> <options> <option>errors=remount-ro</option> </options> </filesystem> <filesystem> <name>ext2</name> <options> <option>errors=remount-ro</option> </options> </filesystem> <filesystem> <name>linux-swap</name> <options> <option>pri=1</option> </options> </filesystem> <filesystem> <name>xfs</name> <options> <option>defaults</option> </options> </filesystem> <filesystem> <name>ntfs</name> <options> <option>ro</option> <option>noauto</option> <option>user</option> <option>umask=022</option> </options> </filesystem> <filesystem> <name>nfs</name> <options> <option>rw</option> <option>rsize=8192</option> <option>wsize=8192</option> <option>nolock</option> </options> </filesystem> <filesystem> <name>proc</name> <options> <option>defaults</option> </options> </filesystem> <filesystem> <name>devpts</name> <options> <option>defaults</option> </options> </filesystem> <filesystem> <name>usbdevfs</name> <options> <option>noauto</option> </options> </filesystem> </filesystems> <devices> <device> <name>cdrom</name> <options> <option>ro</option> <option>noauto</option> <option>user</option> <option>exec</option> </options> </device> <device> <name>dvd</name> <options> <option>ro</option> <option>noauto</option> <option>user</option> <option>exec</option> </options> </device> <device> <name>floppy</name> <options> <option>noauto</option> <option>user</option> <option>sync</option> </options> </device> <device> <name>tape</name> </device> <device> <name>zip</name> </device> </devices> </fstab> <lilo> <sections> <section name="header"> <doc># /etc/lilo.conf - See: `lilo(8)' and `lilo.conf(5)', # --------------- `install-mbr(8)', `/usr/share/doc/lilo/', # and `/usr/share/doc/mbr/'. # +---------------------------------------------------------------+ # | !! Reminder !! | # | | # | Don't forget to run `lilo' after you make changes to this | # | conffile, `/boot/bootmess.txt', or install a new kernel. The | # | computer will most likely fail to boot if a kernel-image | # | post-install script or you don't remember to run `lilo'. | # | | # +---------------------------------------------------------------+ </doc> </section> <section name="lba32"> <doc># Support LBA for large hard disks. # </doc> </section> <section name="boot"> <doc># Specifies the boot device. This is where Lilo installs its boot # block. It can be either a partition, or the raw device, in which # case it installs in the MBR, and will overwrite the current MBR. # </doc> <value>@BS@</value> </section> <section name="message"> <doc># You can put a customized boot message up if you like. If you use # `prompt', and this computer may need to reboot unattended, you # must specify a `timeout', or it will sit there forever waiting # for a keypress. `single-key' goes with the `alias' lines in the # `image' configurations below. eg: You can press `1' to boot # `Linux', `2' to boot `LinuxOLD', if you uncomment the `alias'. # </doc> <value>@BS@</value> </section> <section name="root"> <doc># Specifies the device that should be mounted as root. (`/') # </doc> <value>@BS@</value> </section> <section name="compact"> <doc># Enable map compaction: # Tries to merge read requests for adjacent sectors into a single # read request. This drastically reduces load time and keeps the # map smaller. Using `compact' is especially recommended when # booting from a floppy disk. It is disabled here by default # because it doesn't always work. # </doc> </section> <section name="install"> <doc># Installs the specified file as the new boot sector # </doc> <value>@BS@</value> </section> <section name="map"> <doc># Specifies the location of the map file # </doc> <value>@BS@</value> </section> <section name="password"> <doc># You can set a password here, and uncomment the `restricted' lines # in the image definitions below to make it so that a password must # be typed to boot anything but a default configuration. If a # command line is given, other than one specified by an `append' # statement in `lilo.conf', the password will be required, but a # standard default boot will not require one. # # This will, for instance, prevent anyone with access to the # console from booting with something like `Linux init=/bin/sh', # and thus becoming `root' without proper authorization. # # Note that if you really need this type of security, you will # likely also want to use `install-mbr' to reconfigure the MBR # program, as well as set up your BIOS to disallow booting from # removable disk or CD-ROM, then put a password on getting into the # BIOS configuration as well. Please RTFM `install-mbr(8)'. # </doc> <value>tatercounter2000</value> </section> <section name="timeout"> <doc># Specifies the number of deciseconds (0.1 seconds) LILO should # wait before booting the first image. # </doc> <value>@BS@</value> </section> <section name="vga"> <doc># Specifies the VGA text mode at boot time. (normal, extended, ask, <mode>) p.e.: # vga=ask # vga=9 # vga=normal # </doc> <value>@BS@</value> </section> <section name="append"> <doc># Kernel command line options that apply to all installed images go # here. See: The `boot-prompt-HOWTO' and `kernel-parameters.txt' in # the Linux kernel `Documentation' directory. # </doc> <value>@BS@</value> </section> <section name="default"> <doc># Boot up Linux by default. # </doc> <value>@BS@</value> </section> <section name="other"> <doc># If you have another OS on this machine to boot, you can uncomment the # following lines, changing the device name on the `other' line to # where your other OS' partition is. # </doc> </section> </sections> </lilo> <initrd> <ram> <device>/dev/ram4</device> <size>5000</size> <bs>1024</bs> <nbpi>1024</nbpi> <path>/tmp/initrd</path> </ram> <bin>/usr/share/coolblue/resources/initrd/bin.tar.gz</bin> <devices>/usr/share/coolblue/resources/initrd/devices.tar.gz</devices> </initrd> </AUTOMATICALLY_GENERATED_XML> |
Este archivo muestra la forma de guardar la información relativa a las fuentes de Debian para APT-GET y los paquetes a instalar. Se denomina: downloadConfig.xml.
<?xml version = '1.0' encoding = 'UTF-8' ?> <AUTOMATICALLY_GENERATED_XML> <version>0.1</version> <global> <distro> <name>BSLinux</name> <version>1.0</version> <codenamed>kenny</codenamed> <date>??-??-2002</date> </distro> <source useAllSources="yes" retriesNum="3"> <dists>dists/</dists> <pool>pool/</pool> <mirrors> <mirror>file://mnt/cdrom/</mirror> <mirror>file://usr/BSLINUX/workstation/CD_0/</mirror> <mirror>file://mnt/floppy/</mirror> <mirror>http://www.bluesock.net/</mirror> <mirror>http://ftp.bluesock.net/</mirror> <mirror>ftp://ftp.bluesock.net/pub/</mirror> <mirror>http://www.debian.org/bslinuxFlavour/</mirror> </mirrors> </source> <target> <base>/target/</base> <lists>var/lib/apt/lists/</lists> <packages>var/cache/apt/archives/</packages> </target> <architecture>i386</architecture> <suite>kenny/</suite> <mainIndices>Release</mainIndices> <packages> <required> <package> <name>base-files</name> </package> <package> <name>base-passwd</name> </package> <package> <name>bash</name> </package> <package> <name>bsdutils</name> </package> <package> <name>debconf</name> </package> <package> <name>debianutils</name> </package> <package> <name>diff</name> </package> <package> <name>dpkg</name> </package> <package> <name>e2fsprogs</name> </package> <package> <name>fileutils</name> </package> <package> <name>findutils</name> </package> <package> <name>grep</name> </package> <package> <name>gzip</name> </package> <package> <name>hostname</name> </package> <package> <name>libcap1</name> </package> <package> <name>libc6</name> </package> <package> <name>libdb2</name> </package> <package> <name>libdb3</name> </package> <package> <name>libgdbmg1</name> </package> <package> <name>libncurses5</name> </package> <package> <name>libnewt0</name> </package> <package> <name>libpam-modules</name> </package> <package> <name>libpam-runtime</name> </package> <package> <name>libpam0g</name> </package> <package> <name>libperl5.6</name> </package> <package> <name>libpopt0</name> </package> <package> <name>libreadline4</name> </package> <package> <name>libstdc++2.10-glibc2.2</name> </package> <package> <name>login</name> </package> <package> <name>makedev</name> </package> <package> <name>mawk</name> </package> <package> <name>modutils</name> </package> <package> <name>mount</name> </package> <package> <name>ncurses-base</name> </package> <package> <name>ncurses-bin</name> </package> <package> <name>passwd</name> </package> <package> <name>perl-base</name> </package> <package> <name>procps</name> </package> <package> <name>sed</name> </package> <package> <name>shellutils</name> </package> <package> <name>slang1</name> </package> <package> <name>sysvinit</name> </package> <package> <name>tar</name> </package> <package> <name>textutils</name> </package> <package> <name>util-linux</name> </package> <package> <name>whiptail</name> </package> </required> <base> <package> <name>adduser</name> </package> <package> <name>apt</name> </package> <package> <name>apt-utils</name> </package> <package> <name>at</name> </package> <package> <name>base-config</name> </package> <package> <name>bsdmainutils</name> </package> <package> <name>console-common</name> </package> <package> <name>console-tools</name> </package> <package> <name>console-tools-libs</name> </package> <package> <name>console-data</name> </package> <package> <name>cpio</name> </package> <package> <name>cron</name> </package> <package> <name>dhcp-client</name> </package> <package> <name>ed</name> </package> <package> <name>exim</name> </package> <package> <name>fdutils</name> </package> <package> <name>gettext-base</name> </package> <package> <name>groff-base</name> </package> <package> <name>ifupdown</name> </package> <package> <name>info</name> </package> <package> <name>klogd</name> </package> <package> <name>libident</name> </package> <package> <name>libldap2</name> </package> <package> <name>liblockfile1</name> </package> <package> <name>libpcre3</name> </package> <package> <name>libsasl7</name> </package> <package> <name>libwrap0</name> </package> <package> <name>logrotate</name> </package> <package> <name>mailx</name> </package> <package> <name>man-db</name> </package> <package> <name>manpages</name> </package> <package> <name>modconf</name> </package> <package> <name>nano</name> </package> <package> <name>net-tools</name> </package> <package> <name>netbase</name> </package> <package> <name>netkit-inetd</name> </package> <package> <name>netkit-ping</name> </package> <package> <name>nvi</name> </package> <package> <name>ppp</name> </package> <package> <name>pppconfig</name> </package> <package> <name>pppoe</name> </package> <package> <name>pppoeconf</name> </package> <package> <name>libpcap0</name> </package> <package> <name>sysklogd</name> </package> <package> <name>tasksel</name> </package> <package> <name>tcpd</name> </package> <package> <name>telnet</name> </package> </base> <architectures> <alpha> <required> <without> <package> <name>libc6</name> </package> </without> <with> <package> <name>libc6.1</name> </package> </with> </required> <base> <with> <package> <name>setserial</name> </package> <package> <name>aboot</name> </package> <package> <name>pciutils</name> </package> </with> </base> <bs> <kernel> <name>bslinux</name> <version>2.4.18</version> </kernel> <ipfwtools> <package> <name>ipchains</name> </package> <package> <name>iptables</name> </package> </ipfwtools> <additonal/> </bs> </alpha> <arm> <base> <with> <package> <name>setserial</name> </package> <package> <name>libgpmg1</name> </package> </with> </base> <bs> <kernel> <name>bslinux</name> <version>2.4.18</version> </kernel> <ipfwtools> <package> <name>ipchains</name> </package> <package> <name>iptables</name> </package> </ipfwtools> <additonal/> </bs> </arm> <i386> <required> <without> <package> <name>libperl5.6</name> </package> </without> <with> <package> <name>mbr</name> </package> </with> </required> <base> <with> <package> <name>lilo</name> </package> <package> <name>pciutils</name> </package> <package> <name>setserial</name> </package> <package> <name>syslinux</name> </package> <package> <name>psmisc</name> </package> <package> <name>pcmcia-cs</name> </package> </with> </base> <bs> <kernel> <name>bslinux</name> <version>2.4.18</version> </kernel> <with> <package> <name>ipchains</name> </package> <package> <name>iptables</name> </package> </with> </bs> </i386> <ia64> <required> <without> <package> <name>libc6</name> </package> </without> <with> <package> <name>libc6.1</name> </package> <package> <name>gcc-2.96-base</name> </package> </with> </required> <base> <with> <package> <name>elilo</name> </package> <package> <name>efibootmgr</name> </package> <package> <name>dosfstools</name> </package> <package> <name>libparted1.4</name> </package> <package> <name>parted</name> </package> </with> </base> <bs> <kernel> <package> <name>bslinux-ia64-2.4.18</name> </package> </kernel> </bs> </ia64> <m68k> <base> <with> <package> <name>atari-bootstrap</name> </package> <package> <name>atari-fdisk</name> </package> <package> <name>amiga-fdisk</name> </package> <package> <name>eject</name> </package> <package> <name>mac-fdisk</name> </package> <package> <name>pmac-fdisk-cross</name> </package> <package> <name>setserial</name> </package> <package> <name>vmelilo</name> </package> </with> </base> <bs> <kernel> <package> <name>bslinux-2.4.18</name> </package> </kernel> <ipfwtool> <package> <name>ipchains</name> </package> </ipfwtool> </bs> </m68k> <powerpc> <base> <with> <package> <name>quik</name> </package> <package> <name>mac-fdisk</name> </package> <package> <name>amiga-fdisk</name> </package> <package> <name>psmisc</name> </package> <package> <name>powerpc-utils</name> </package> <package> <name>setserial</name> </package> <package> <name>pciutils</name> </package> <package> <name>hfsutils</name> </package> <package> <name>yaboot</name> </package> <package> <name>pcmcia-cs</name> </package> </with> </base> <bs> <kernel> <package> <name>bslinux-2.4.18</name> </package> </kernel> <ipfwtool> <package> <name>ipchains</name> </package> <package> <name>iptables</name> </package> </ipfwtool> </bs> </powerpc> <sparc> <base> <with> <package> <name>silo</name> </package> <package> <name>eject</name> </package> <package> <name>pciutils</name> </package> <package> <name>sparc-utils</name> </package> </with> </base> <bs> <kernel> <package> <name>bslinux-2.4.18</name> </package> </kernel> <ipfwtool> <package> <name>ipchains</name> </package> <package> <name>iptables</name> </package> </ipfwtool> </bs> </sparc> <mips> <base> <with> <package> <name>dvhtool</name> </package> <package> <name>pciutils</name> </package> <package> <name>setserial</name> </package> </with> </base> <bs> <kernel> <package> <name>bslinux-2.4.18</name> </package> </kernel> </bs> </mips> <mipsel> <base> <with> <package> <name>delo</name> </package> <package> <name>pciutils</name> </package> <package> <name>setserial</name> </package> </with> </base> <bs> <kernel> <package> <name>bslinux-2.4.18</name> </package> </kernel> </bs> </mipsel> <hppa> <required> <without> <package> <name>libstdc++2.10-glibc2.2</name> </package> </without> </required> <base> <with> <package> <name>palo</name> </package> <package> <name>libstdc++3</name> </package> <package> <name>gcc-3.0-base</name> </package> </with> </base> <bs> <kernel> <package> <name>bslinux-2.4.18</name> </package> </kernel> </bs> </hppa> <s390_s390x> <base> <without> <package> <name>console-tools</name> </package> <package> <name>console-tools-libs</name> </package> <package> <name>fdutils</name> </package> <package> <name>ppp</name> </package> <package> <name>pppconfig</name> </package> <package> <name>pppoe</name> </package> <package> <name>pppoeconf</name> </package> </without> <with> <package> <name>s390-tools</name> </package> <package> <name>telnetd</name> </package> </with> </base> <bs> <kernel> <package> <name>bslinux-2.4.18</name> </package> </kernel> </bs> </s390_s390x> </architectures> </packages> </global> </AUTOMATICALLY_GENERATED_XML> |
Otra muestra de como se puede utilizar el XML, esta vez el archivo se denomina installConfig.xml.
<?xml version = '1.0' encoding = 'UTF-8' ?> <AUTOMATICALLY_GENERATED_XML> <version>0.1</version> <global> <distro> <name>BSLinux</name> <version>1.0</version> <codenamed>kenny</codenamed> <date>??-??-2002</date> </distro> <paths> <source> <base>/target/</base> <lists>var/lib/apt/lists/</lists> <packages>var/cache/apt/archives/</packages> </source> <target> <base>/target/</base> <dpkg>var/lib/dpkg/</dpkg> </target> </paths> <architecture>i386</architecture> <suite>kenny/</suite> </global> <process> <setup> <etc/> <proc/> <devices>/usr/lib/debootstrap/devices.tar.gz</devices> </setup> </process> </AUTOMATICALLY_GENERATED_XML> |
Archivo de configuración de la instalación. Su nombre es: installation.xml.
<?xml version = '1.0' encoding = 'UTF-8' ?> <AUTOMATICALLY_GENERATED_XML> <version>0.1</version> <installation-type>install</installation-type> <language>English</language> <country>USA</country> <keyboard-layout>us</keyboard-layout> <GMT>Madrid</GMT> <licenses> <free>true</free> <non-free>true</non-free> <crypto>false</crypto> <bsl>true</bsl> </licenses> <modules> <section name="IDE"> <path>/lib/modules/2.4.18-64GB-SMP/kernel/drivers/ide/</path> <module>ataraid.o</module> </section> <section name="scsi"> <path>/lib/modules/2.4.18-64GB-SMP/kernel/drivers/scsi/</path> <module>*.o</module> </section> <section name="scsi"> <path>/lib/modules/2.4.18-64GB-SMP/kernel/drivers/scsi/aacraid/</path> <module>*.o</module> </section> <section name="scsi"> <path>/lib/modules/2.4.18-64GB-SMP/kernel/drivers/scsi/pcmcia/</path> <module>*.o</module> </section> <section name="scsi"> <path>/lib/modules/2.4.18-64GB-SMP/kernel/drivers/scsi/qla2x00-emc/</path> <module>*.o</module> </section> <section name="scsi"> <path>/lib/modules/2.4.18-64GB-SMP/kernel/drivers/scsi/sym53c8xx_2/</path> <module>*.o</module> </section> <section name="scsi"> <path>/lib/modules/2.4.18-64GB-SMP/kernel/drivers/scsi/aic7xxx/</path> <module>*.o</module> </section> <section name="IDE"> <path>/lib/modules/2.4.18-64GB-SMP/kernel/drivers/usb/</path> <module>usb-ohci.o</module> </section> <section name="IDE"> <path>/lib/modules/2.4.18-64GB-SMP/kernel/drivers/usb/</path> <module>usb-uhci.o</module> </section> <section name="IDE"> <path>/lib/modules/2.4.18-64GB-SMP/kernel/drivers/usb/</path> <module>*.o</module> </section> </modules> </AUTOMATICALLY_GENERATED_XML> |