Cómo crear su propio ISO

From Paldo

Jump to: navigation, search

Contents

[edit] Cómo crear su propio ISO usando upkg (el sistema de empaquetado de paldo)

escrito por Philip Müller en mayo de 2007 (en traducción)

[edit] Resumen

Esta sección debería ayudarlo a crear su propio ISO usando upkg. Upkg es el sistema de administración y creación de paquetes usado en la distribución Linux Paldo.

[edit] Introducción

Upkg se puede usar para crear su propio ISO. Puede usar los paquetes por defecto que puede encontrar en repositorio principal de la distribución Linux Paldo. En esta guía, le mostraré cómo crear usted mismo mis XFCE-Installer-CDs.

[edit] Crear un repositorio paldo local

Lea esta guía para saber cómo crear su repositorio paldo local: Cómo crear un paquete fuente usando upkg por Nicolas Christener

[edit] Descargar el Installer-CD-XFCE-Repo

Descargar el Installer-CD-XFCE-Repo desde aquí: generic-xfce-repo.tar.bz2

[edit] Crear los archivos de especificaciones modificadas

No queremos usar el paquete paldo-live, por lo tanto tenemos que crear nuestro propio paquete llamado paldo-xfce-live. Esto debería verse como:

    <?xml version="1.0"?>
        <package name="paldo-xfce-live">
        <description/>
            <releases>
                <release version="20070514" revision="1" branch="stable">
                    <deps>
                            <dep name="paldo-base"/>
                            <dep name="x-window-system"/>
                            <dep name="gamin"/>
                            <dep name="zenity"/>
                            <dep name="gnome-doc-utils"/>
                            <dep name="xfce-desktop"/>
                            <dep name="paldo-installer"/>
                            <dep name="paldo-installer-xfce-scripts"/>
                            <dep name="paldo-xfce-desktop-settings"/>
                            <dep name="glibc-de_CH"/>
                            <dep name="glibc-de_DE"/>
                            <dep name="glibc-en_GB"/>
                            <dep name="glibc-en_US"/>
                            <dep name="glibc-es_ES"/>
                            <dep name="glibc-fr_CH"/>
                            <dep name="glibc-fr_FR"/>
                            <dep name="glibc-it_CH"/>
                            <dep name="glibc-it_IT"/>
                            <dep name="glibc-pl_PL"/>
                            <dep name="glibc-pt_BR"/>
                            <dep name="glibc-pt_PT"/>
                            <dep name="glibc-tr_TR"/>
                    </deps>
                    <postbuild>
                        <cmd>cd $CHROOTDIR</cmd>
                        <!-- backup files for later install -->
                        <cmd>mkdir -p backup/etc</cmd>
                        <cmd>cp etc/passwd backup/etc/passwd</cmd>
                        <cmd>cp etc/group backup/etc/group</cmd>
                        <cmd>mkdir -p backup/etc/init.d</cmd>
                        <cmd>cp etc/init.d/nscd backup/etc/init.d/nscd</cmd>
                        <cmd>mkdir -p backup/etc/network/if-up.d</cmd>
                        <cmd>cp etc/network/if-up.d/nscd backup/etc/network/if-up.d/nscd</cmd>				
                        <!-- copy installer desktop file to the tmp/desktop -->
                        <cmd>mkdir -p $CHROOTDIR/etc/skel/Desktop</cmd>
                        <cmd>cp $CHROOTDIR/usr/share/applications/pinstaller.desktop $CHROOTDIR/etc/skel/Desktop/pinstaller.desktop</cmd>
                        <!-- create .gtkrc.mine file for livecd user -->
                        <text dest="$CHROOTDIR/etc/skel/.gtkrc.mine"><![CDATA[# -- THEME AUTO-WRITTEN DO NOT EDIT
    
    include "/usr/share/themes/Smooth-Winter/gtk/gtkrc"
    include "/home/paldo/.gtkrc.mine"
    
    # -- THEME AUTO-WRITTEN DO NOT EDIT
    ]]></text>
                        <text dest="$CHROOTDIR/etc/skel/.gtkrc-1.2-gnome2"><![CDATA[# Autowritten by gnome-settings-daemon. Do not edit
    
    include "/home/paldo/.gtkrc.mine"
    ]]></text>
                        <text dest="$CHROOTDIR/root/.gtkrc.mine"><![CDATA[# -- THEME AUTO-WRITTEN DO NOT EDIT
    
    include "/usr/share/themes/Smooth-Winter/gtk/gtkrc"
    include "/root/.gtkrc.mine"
    
    # -- THEME AUTO-WRITTEN DO NOT EDIT
    ]]></text>
                        <text dest="$CHROOTDIR/root/.gtkrc-1.2-gnome2"><![CDATA[# Autowritten by gnome-settings-daemon. Do not edit
    
    include "/root/.gtkrc.mine"
    ]]></text>
                        <cmd>chown -R 1000:1000 $CHROOTDIR/etc/skel/Desktop</cmd>
                        <!-- create livecd user paldo and let it autologin -->
                        <cmd>chown -R 1000:1000 $CHROOTDIR/home/paldo</cmd>
                        <cmd>echo "paldo:x:1000:1000::/home/paldo:/bin/bash" >> $CHROOTDIR/etc/passwd</cmd>
                        <cmd>echo "paldo:x:1000:" >> $CHROOTDIR/etc/group</cmd>
                        <cmd>sed -i -e 's/^wheel:.*/wheel:x:18:paldo/' $CHROOTDIR/etc/group</cmd>
                        <cmd>sed -i -e 's/^audio:.*/audio:x:6:paldo/' $CHROOTDIR/etc/group</cmd>
                        <cmd>sed -i -e 's/^cdrom:.*/cdrom:x:25:paldo/' $CHROOTDIR/etc/group</cmd>
                        <cmd>echo "paldo:paldo" | chroot $CHROOTDIR chpasswd --md5</cmd>
                        <text dest="$CHROOTDIR/etc/gdm/custom.conf">
    [daemon]
    AutomaticLoginEnable=true
    AutomaticLogin=paldo
    </text>
                        <cmd>cp $CHROOTDIR/usr/share/xsessions/xfce.desktop $CHROOTDIR/usr/share/gdm/BuiltInSessions/default.desktop</cmd>
                        <!-- fix gconf defaults permissions -->
                        <cmd>chmod -R a+r $CHROOTDIR/etc/gconf/gconf.xml.defaults</cmd>
                        <cmd>find $CHROOTDIR/etc/gconf/gconf.xml.defaults -type d | xargs chmod a+x</cmd>
                        <!-- deactivate unneeded daemons -->
                        <cmd>sed -i -e 's/: 2 3 4 5/:/' -e 's/: 0 1 6/: 0 1 2 3 4 5 6/' $CHROOTDIR/etc/init.d/hplip</cmd>
                        <!-- disable nscd, doesn't seem to work with unionfs -->
                        <cmd>rm -vf $CHROOTDIR/etc/init.d/nscd $CHROOTDIR/etc/network/if-up.d/nscd</cmd>
				
                        <!-- add some more possible mountpoints as /media is read-only -->
                        <cmd>mkdir -p $CHROOTDIR/media/{cdrecorder,usbdisk}</cmd>
				
                        <!-- update mime -->
                        <cmd>chroot $CHROOTDIR update-mime-database /usr/share/mime</cmd>
                        <!-- create fonts.dir files for modular xorg -->
                        <cmd>[ ! -x $CHROOTDIR/usr/bin/mkfontdir ] || chroot $CHROOTDIR bash -c "mkfontdir /usr/share/X11/fonts/*"</cmd>
                        <!-- strip binaries -->
                        <cmd>find $CHROOTDIR{,/usr}{/bin,/lib,/sbin} -name '*.a' -o -name '*.o' -o -name '*.ko' -type f -exec /usr/bin/strip --strip-debug '{}' \;</cmd>
                        <cmd>find $CHROOTDIR{,/usr}{/bin,/lib,/sbin} -not -name '*.a' -not -name '*.o' -not -name '*.ko' -not -name '*.exe' -not -name '*.dll' -type f -exec /usr/bin/strip --strip-unneeded '{}' \;</cmd>
                    </postbuild>
                </release>
                <release version="20070514" revision="2" branch="testing">
                    <deps>
                            <dep name="paldo-base"/>
                            <dep name="x-window-system"/>
                            <dep name="gamin"/>
                            <dep name="zenity"/>
                            <dep name="gnome-doc-utils"/>
                            <dep name="xfce-desktop"/>
                            <dep name="paldo-installer"/>
                            <dep name="paldo-installer-xfce-scripts"/>
                            <dep name="paldo-xfce-desktop-settings"/>
                            <dep name="glibc-de_CH"/>
                            <dep name="glibc-de_DE"/>
                            <dep name="glibc-en_GB"/>
                            <dep name="glibc-en_US"/>
                            <dep name="glibc-es_ES"/>
                            <dep name="glibc-fr_CH"/>
                            <dep name="glibc-fr_FR"/>
                            <dep name="glibc-it_CH"/>
                            <dep name="glibc-it_IT"/>
                            <dep name="glibc-pl_PL"/>
                            <dep name="glibc-pt_BR"/>
                            <dep name="glibc-pt_PT"/>
                            <dep name="glibc-tr_TR"/>
                    </deps>
                    <postbuild>
                        <cmd>cd $CHROOTDIR</cmd>
                        <!-- backup files for later install -->
                        <cmd>mkdir -p backup/etc</cmd>
                        <cmd>cp etc/passwd backup/etc/passwd</cmd>
                        <cmd>cp etc/group backup/etc/group</cmd>
                        <cmd>mkdir -p backup/etc/init.d</cmd>
                        <cmd>cp etc/init.d/nscd backup/etc/init.d/nscd</cmd>
                        <cmd>mkdir -p backup/etc/network/if-up.d</cmd>
                        <cmd>cp etc/network/if-up.d/nscd backup/etc/network/if-up.d/nscd</cmd>				
                        <!-- copy installer desktop file to the tmp/desktop -->
                        <!-- new way for aufs copy files to /home/paldo instead of /etc/skel-->
                        <cmd>mkdir -p $CHROOTDIR/home/paldo/Desktop</cmd>
                        <cmd>cp $CHROOTDIR/usr/share/applications/pinstaller.desktop $CHROOTDIR/home/paldo/Desktop/pinstaller.desktop</cmd>
                        <!-- create .gtkrc.mine file for livecd user -->
                        <text dest="$CHROOTDIR/home/paldo/.gtkrc.mine"><![CDATA[# -- THEME AUTO-WRITTEN DO NOT EDIT
    
    include "/usr/share/themes/Smooth-Winter/gtk/gtkrc"
    include "/home/paldo/.gtkrc.mine"
    
    # -- THEME AUTO-WRITTEN DO NOT EDIT
    ]]></text>
                        <text dest="$CHROOTDIR/home/paldo/.gtkrc-1.2-gnome2"><![CDATA[# Autowritten by gnome-settings-daemon. Do not edit

    include "/home/paldo/.gtkrc.mine"
    ]]></text>
                        <text dest="$CHROOTDIR/root/.gtkrc.mine"><![CDATA[# -- THEME AUTO-WRITTEN DO NOT EDIT
    
    include "/usr/share/themes/Smooth-Winter/gtk/gtkrc"
    include "/root/.gtkrc.mine"
    
    # -- THEME AUTO-WRITTEN DO NOT EDIT
    ]]></text>
                        <text dest="$CHROOTDIR/root/.gtkrc-1.2-gnome2"><![CDATA[# Autowritten by gnome-settings-daemon. Do not edit

    include "/root/.gtkrc.mine"
    ]]></text>
                        <!-- create livecd user paldo and let it autologin -->
                        <cmd>chown -R 1000:1000 $CHROOTDIR/home/paldo</cmd>
                        <cmd>echo "paldo:x:1000:1000::/home/paldo:/bin/bash" >> $CHROOTDIR/etc/passwd</cmd>
                        <cmd>echo "paldo:x:1000:" >> $CHROOTDIR/etc/group</cmd>
                        <cmd>sed -i -e 's/^wheel:.*/wheel:x:18:paldo/' $CHROOTDIR/etc/group</cmd>
                        <cmd>sed -i -e 's/^audio:.*/audio:x:6:paldo/' $CHROOTDIR/etc/group</cmd>
                        <cmd>sed -i -e 's/^cdrom:.*/cdrom:x:25:paldo/' $CHROOTDIR/etc/group</cmd>
                        <cmd>echo "paldo:paldo" | chroot $CHROOTDIR chpasswd --md5</cmd>
                        <text dest="$CHROOTDIR/etc/gdm/custom.conf">
    [daemon]
    AutomaticLoginEnable=true
    AutomaticLogin=paldo
    </text>
                        <cmd>cp $CHROOTDIR/usr/share/xsessions/xfce.desktop $CHROOTDIR/usr/share/gdm/BuiltInSessions/default.desktop</cmd>
                        <!-- fix gconf defaults permissions -->
                        <cmd>chmod -R a+r $CHROOTDIR/etc/gconf/gconf.xml.defaults</cmd>
                        <cmd>find $CHROOTDIR/etc/gconf/gconf.xml.defaults -type d | xargs chmod a+x</cmd>
                        <!-- deactivate unneeded daemons -->
                        <cmd>sed -i -e 's/: 2 3 4 5/:/' -e 's/: 0 1 6/: 0 1 2 3 4 5 6/' $CHROOTDIR/etc/init.d/hplip</cmd>
                        <!-- disable nscd, doesn't seem to work with unionfs -->
                        <cmd>rm -vf $CHROOTDIR/etc/init.d/nscd $CHROOTDIR/etc/network/if-up.d/nscd</cmd>
				
                        <!-- add some more possible mountpoints as /media is read-only -->
                        <cmd>mkdir -p $CHROOTDIR/media/{cdrecorder,usbdisk}</cmd>
				
                        <!-- update mime -->
                        <cmd>chroot $CHROOTDIR update-mime-database /usr/share/mime</cmd>
                        <!-- create fonts.dir files for modular xorg -->
                        <cmd>[ ! -x $CHROOTDIR/usr/bin/mkfontdir ] || chroot $CHROOTDIR bash -c "mkfontdir /usr/share/X11/fonts/*"</cmd>
                        <!-- strip binaries -->
                        <cmd>find $CHROOTDIR{,/usr}{/bin,/lib,/sbin} -name '*.a' -o -name '*.o' -o -name '*.ko' -type f -exec /usr/bin/strip --strip-debug '{}' \;</cmd>
                        <cmd>find $CHROOTDIR{,/usr}{/bin,/lib,/sbin} -not -name '*.a' -not -name '*.o' -not -name '*.ko' -not -name '*.exe' -not -name '*.dll' -type f -exec /usr/bin/strip --strip-unneeded '{}' \;</cmd>
                    </postbuild>
                </release>
            </releases>
    </package>

Para cambiar los paquetes, los cuales se instalarán en su nuevo ISO, tiene que cambiar las dependencias:

      <dep name="paldo-base"/>
      <dep name="x-window-system"/>
      <dep name="gamin"/>
      <dep name="zenity"/>
      <dep name="gnome-doc-utils"/>
      <dep name="xfce-desktop"/>
      <dep name="paldo-installer"/>
      <dep name="paldo-installer-xfce-scripts"/>
      <dep name="paldo-xfce-desktop-settings"/>
      <dep name="glibc-de_CH"/>
      <dep name="glibc-de_DE"/>
      <dep name="glibc-en_GB"/>
      <dep name="glibc-en_US"/>
      <dep name="glibc-es_ES"/>
      <dep name="glibc-fr_CH"/>
      <dep name="glibc-fr_FR"/>
      <dep name="glibc-it_CH"/>
      <dep name="glibc-it_IT"/>
      <dep name="glibc-pl_PL"/>
      <dep name="glibc-pt_BR"/>
      <dep name="glibc-pt_PT"/>
      <dep name="glibc-tr_TR"/>

Todos mis ISOs están basados en el paquete paldo-base.

Para ejecutar un escritorio, tiene que instalar también x-window-system. El paquete xfce-desktop necesita gamin y zenity. Mi instalador está incluido en paldo-installer.

Como en este ejemplo instalamos XFCE, agregamos al instalador dos paquetes más:

paldo-installer-xfce-scripts y paldo-xfce-desktop-settings.

paldo-installer-xfce-scripts incluye los scripts que estamos usando para instalar paldo y paldo-xfce-desktop-settings incluye valores personalizados de su .config ubicado en su carpeta home.

En esta guía, la clave es solamente el script 08_fixbootstrap.sh. Para nuestro ejemplo se sería como esto:

      #!/bin/bash
      # expects <%TargetPart%> as 1st argument!
      #fix upkg-bootstrap
      echo "Package: xfce-desktop" > /root/mnt/$1/var/lib/upkg/packages/xfce-desktop.select
      echo "Package: paldo-base" > /root/mnt/$1/var/lib/upkg/packages/paldo-base.select
      #keep extra installed apps - 20070511
      echo "Package: gamin" > /root/mnt/$1/var/lib/upkg/packages/gamin.select
      echo "Package: zenity" > /root/mnt/$1/var/lib/upkg/packages/zenity.select
      echo "Package: gparted" > /root/mnt/$1/var/lib/upkg/packages/gparted.select
      #keep all languages
      echo "Package: glibc-de_CH" > /root/mnt/$1/var/lib/upkg/packages/glibc-de_CH.select
      echo "Package: glibc-de_DE" > /root/mnt/$1/var/lib/upkg/packages/glibc-de_DE.select
      echo "Package: glibc-en_GB" > /root/mnt/$1/var/lib/upkg/packages/glibc-en_GB.select
      echo "Package: glibc-en_US" > /root/mnt/$1/var/lib/upkg/packages/glibc-en_EN.select
      echo "Package: glibc-es_ES" > /root/mnt/$1/var/lib/upkg/packages/glibc-es_ES.select
      echo "Package: glibc-fr_CH" > /root/mnt/$1/var/lib/upkg/packages/glibc-fr_CH.select
      echo "Package: glibc-fr_FR" > /root/mnt/$1/var/lib/upkg/packages/glibc-fr_FR.select
      echo "Package: glibc-it_CH" > /root/mnt/$1/var/lib/upkg/packages/glibc-it_CH.select
      echo "Package: glibc-it_IT" > /root/mnt/$1/var/lib/upkg/packages/glibc-it_IT.select
      echo "Package: glibc-pl_PL" > /root/mnt/$1/var/lib/upkg/packages/glibc-pl_PL.select
      echo "Package: glibc-pt_BR" > /root/mnt/$1/var/lib/upkg/packages/glibc-pt_BR.select
      echo "Package: glibc-pt_PT" > /root/mnt/$1/var/lib/upkg/packages/glibc-pt_PT.select
      echo "Package: glibc-tr_TR" > /root/mnt/$1/var/lib/upkg/packages/glibc-tr_TR.select
      #keep gtk+1.2
      echo "Package: gdk-pixbuf" > /root/mnt/$1/var/lib/upkg/packages/gdk-pixbuf.select
      echo "Package: glib-1.2" > /root/mnt/$1/var/lib/upkg/packages/glib-1.2.select
      echo "Package: gtk+-1.2" > /root/mnt/$1/var/lib/upkg/packages/gtk+-1.2.select
      
      #remove paldo-desktop package
      
      touch /root/mnt/$1/etc/rc.d/runonce
      echo "#!/bin/bash" >> /root/mnt/$1/etc/rc.d/runonce
      echo "#" >> /root/mnt/$1/etc/rc.d/runonce
      echo "rm -f /var/lib/upkg/packages/paldo-desktop.select" >> /root/mnt/$1/etc/rc.d/runonce
      echo "rm -f /etc/rc.d/runonce" >> /root/mnt/$1/etc/rc.d/runonce
      chmod a+x /root/mnt/$1/etc/rc.d/runonce

Entonces ¿qué hace el script exactamente?

Es simple. Agrega los paquetes que instalamos durante bootstrap (will come later) al upkg-cache en el sistema paldo que instalamos en el disco duro con el instalador paldo-installer.

La primera parte del script agrega todos los paquetes.

La segunda parte borra el paquete paldo-desktop.select en el primer arranque del sistema paldo instalado en el disco duro. This is needed to get the upkg-cmd upkg-upgrade get working on the new ISO.

Guarde su script 08_fixbootstrap.sh modificado y recree los dos tarballs paldo-installer-xfce-stable.tar.bz2 y paldo-installer-xfce-testing.tar.bz2.

[edit] Agregar su repositorio local a su archivo upkg.conf

Cuando su repositorio locla esté terminado, puede agregarlo a su archivo local upkg.conf:

    $ su
    Password: enter your root password
    #  sed -i -e 's%<repositories>%&\n<repository>RUTA/A/SU/REPOSITORIO/LOCAL</repository>%' /etc/upkg.conf

[edit] Creando el ISO

Ahora estamos en el último paso: la creación del ISO. Primero, tenemos que crear una carpeta nueva:

    mkdir -p /upkg

Luego, tenemos que vaciar el upkg-cache:

    rm -rf /upkg/*
    rm -rf /var/cache/upkg/*

Finalmente, podemos crear nuestro nuevo ISO con este comando:

    upkg-bootstrap --verbose paldo-xfce-live-cd-installer

Puede encontrar el ISO final en /var/cache/upkg. Quémelo con su aplicación de quemado favorita.

Personal tools