Construcción y customización de una distro OpenSolaris con distro_const
Supuestos previos
Se utilizó para este documento la distro OpenSolaris snv_134, basada en los paquetes de desarrollo (repositorio http://pkg.opensolaris.org/dev/).
Suponemos tener disponible un espacio en disco no menor a los 8 GB, dado que entre la generación de la imagen previa, y las imágenes tipo .iso y .usb ocupará ese espacio.
Proceso de generación de la imagen
- Instalar el paquete "distribution-constructor":
root@battlelloyd-o:~# pkg install distribution-constructor
DOWNLOAD PKGS FILES XFER (MB)
Completed 1/1 96/96 0.2/0.2
PHASE ACTIONS
Install Phase 140/140
root@battlelloyd-o:~#
- Para instalar una distro basada en el set de paquetes de desarrollo:
- Copiar el directorio /usr/share/distro_const/slim_cd como /usr/share/distro_const/slim_custom:
# cd /usr/share/distro_const
# cp -rp slim_cd slim_custom
- Generar el script slim_custom_x86.xml:
# cp /usr/share/distro_const/slim_custom/slim_cd_x86.xml /usr/share/distro_const/slim_custom/slim_custom_x86.xml
- Modificar el archivo /usr/share/distro_const/slim_custom/slim_custom_x86.xml:
El bloque:
<distribution name="OpenSolaris">
cambiarlo por:
<distribution name="OpenSolaris_custom">
Ese será el nombre que tendrá la imagen que se generará en el directorio /rpool/dc/media, con extensiones .iso y .usb.
El bloque:
<img_params>
<!--
The preferred authority to install packages into the
pkg_image area from.
The default url is: http://pkg.opensolaris.org/release
The default authname is opensolaris.org
-->
<pkg_repo_default_authority>
<main
url="http://pkg.opensolaris.org/release"
authname="opensolaris.org"/>
Cambiarlo por:
<img_params>
<!--
The preferred authority to install packages into the
pkg_image area from.
The default url is: http://pkg.opensolaris.org/dev
The default authname is opensolaris.org
-->
<pkg_repo_default_authority>
<main
url="http://pkg.opensolaris.org/dev"
authname="opensolaris.org"/>
El bloque:
<!--
The default preferred authority to be used by the system
after it has been installed.
The default url is: http://pkg.opensolaris.org/release
The default authname is opensolaris.org
If you want to use one or more mirrors that are
setup for the authority, specify the urls here.
-->
<post_install_repo_default_authority>
<main
url="http://pkg.opensolaris.org/release"
authname="opensolaris.org"/>
Cambiarlo por:
<!--
The default preferred authority to be used by the system
after it has been installed.
The default url is: http://pkg.opensolaris.org/dev
The default authname is opensolaris.org
If you want to use one or more mirrors that are
setup for the authority, specify the urls here.
-->
<post_install_repo_default_authority>
<main
url="http://pkg.opensolaris.org/dev"
authname="opensolaris.org"/>
Al bloque:
<pkg name="entire"/>
<pkg name="SUNWcsd"/>
<pkg name="SUNWcs"/>
<pkg name="slim_install"/>
<pkg name="SUNWslim-utils"/>
Agregarle, para tener los paquetes "OpenOffice", "OpenProj", "PgAdminIII", "SunStudio", "Gnome-Games", "Gimp", "Gcc", "JDK" y "Dia":
<pkg name="openoffice"/>
<pkg name="openoffice-es"/>
<pkg name="openproj"/>
<pkg name="pgadmin"/>
<pkg name="sunstudio"/>
<pkg name="sunstudio12u1"/>
<pkg name="gnome-games"/>
<pkg name="gimp"/>
<pkg name="gcc-43"/>
<pkg name="java"/>
<pkg name="dia"/>
<pkg name="amp-dev"/>
<pkg name="MBLgst-plugin-mp3"/>
<pkg name="MBLgst-plugin-mpeg2"/>
<pkg name="MBLgst-plugin-ffmpeg"/>
<pkg name="MBLgst-plugin-dvdread"/>
<pkg name="MBLgst-plugin-dvd"/>
<pkg name="MBLgst-plugin-lame"/>
<pkg name="MBLgst-plugin-flv"/>
<pkg name="MBLgst-plugin-dts"/>
Descomentar el bloque, y modificarlo para que quede:
<pkg_repo_addl_authority>
<main
url="http://ips.homeunix.com:10906"
authname="ips.homeunix.com"/>
<mirror url="" />
</pkg_repo_addl_authority>
Esto lo hacemos para que los que instalen esta distro tengan disponibles varios de los codecs que necesitarán para ver películas en un DVD, escuchar MP3, etc.
El bloque:
<key_value_pairs>
<pair key="iso_sort"
value="/usr/share/distro_const/slim_cd/slimcd_iso.sort"/>
</key_value_pairs>
Cambiarlo por:
<key_value_pairs>
<pair key="iso_sort"
value="/usr/share/distro_const/slim_custom/slimcd_iso.sort"/>
</key_value_pairs>
El bloque:
<script name="/usr/share/distro_const/slim_cd/slimcd_pre_boot_archive_pkg_image_mod">
<checkpoint
name="slim-im-mod"
message="Slim CD Image area Modifications"/>
</script>
Cambiarlo por:
<script name="/usr/share/distro_const/slim_custom/slimcd_pre_boot_archive_pkg_image_mod">
<checkpoint
name="slim-im-mod"
message="Slim CD Image area Modifications"/>
</script>
El bloque:
<script name="/usr/share/distro_const/slim_cd/slimcd_boot_archive_configure">
<checkpoint
name="slim-ba-config"
message="Slim CD boot archive configuration"/>
</script>
Cambiarlo por:
<script name="/usr/share/distro_const/slim_custom/slimcd_boot_archive_configure">
<checkpoint
name="slim-ba-config"
message="Slim CD boot archive configuration"/>
</script>
El bloque:
<script name="/usr/share/distro_const/slim_cd/slimcd_post_boot_archive_pkg_image_mod">
<checkpoint
name="slim-post-mod"
message="Slim CD post boot archive image area modification"/>
</script>
Cambiarlo por:
<script name="/usr/share/distro_const/slim_custom/slimcd_post_boot_archive_pkg_image_mod">
<checkpoint
name="slim-post-mod"
message="Slim CD post boot archive image area modification"/>
</script>
El bloque:
<script name="/usr/share/distro_const/slim_cd/slimcd_gen_cd_content">
<checkpoint
name="gen-slim-cont"
message="Generate Slim CD image content list"/>
</script>
Cambiarlo por:
<script name="/usr/share/distro_const/slim_custom/slimcd_gen_cd_content">
<checkpoint
name="gen-slim-cont"
message="Generate Slim CD image content list"/>
</script>
El bloque:
<smf_service_profile>
<profile path="/var/svc/profile/generic_limited_net.xml"
use_build_sys_file="false"/>
<profile path="/usr/share/distro_const/generic_live.xml"
use_build_sys_file="true"/>
<profile path="/usr/share/distro_const/slim_cd/slimcd_live.xml"
use_build_sys_file="true"/>
<profile path="/var/svc/profile/ns_files.xml"
use_build_sys_file="false"/>
</smf_service_profile>
Cambiarlo por:
<smf_service_profile>
<profile path="/var/svc/profile/generic_limited_net.xml"
use_build_sys_file="false"/>
<profile path="/usr/share/distro_const/generic_live.xml"
use_build_sys_file="true"/>
<profile path="/usr/share/distro_const/slim_custom/slimcd_live.xml"
use_build_sys_file="true"/>
<profile path="/var/svc/profile/ns_files.xml"
use_build_sys_file="false"/>
</smf_service_profile>
- Crear la nueva distro con el comando:
# distro_const build /usr/share/distro_const/slim_custom/slim_custom_x86.xml
/usr/share/distro_const/DC-manifest.defval.xml validates
/tmp/slim_custom_x86_temp_26263.xml validates
Simple Log: /rpool/dc/logs/simple-log-2010-03-21-04-24-34
Detail Log: /rpool/dc/logs/detail-log-2010-03-21-04-24-34
Build started Sun Mar 21 04:24:34 2010
Distribution name: OpenSolaris_custom
Build Area dataset: rpool/dc
Build Area mount point: /rpool/dc
==== im-pop: Image area creation
Initializing the IPS package image area: /rpool/dc/build_data/pkg_image
Setting preferred publisher: opensolaris.org
Origin repository: http://pkg.opensolaris.org/dev
Setting alternate publisher: ips.homeunix.com
Origin repository: http://ips.homeunix.com:10906
Verifying the contents of the IPS repository
Installing the designated packages
Uninstalling the designated packages
Setting post-install preferred publisher: opensolaris.org
Origin repository: http://pkg.opensolaris.org/dev
==== im-mod: Image area modifications
==== slim-im-mod: Slim CD Image area Modifications
0 blocks
gtk-update-icon-cache: Cache file created successfully.
gtk-update-icon-cache: Cache file created successfully.
gtk-update-icon-cache: Cache file created successfully.
gtk-update-icon-cache: Cache file created successfully.
==== ba-init: Boot archive initialization
282960 blocks
2928 blocks
32512 blocks
0 blocks
94288 blocks
4192 blocks
0 blocks
0 blocks
624 blocks
32 blocks
160 blocks
3024 blocks
256 blocks
20224 blocks
0 blocks
0 blocks
==== slim-ba-config: Slim CD boot archive configuration
==== ba-config: Boot archive configuration
==== ba-arch: Boot archive archiving (64-bit)
458560 blocks
322336 blocks
==== ba-arch-32: Boot archive archiving (32-bit)
458560 blocks
238688 blocks
==== slim-post-mod: Slim CD post boot archive image area modification
==== grub-setup: Grub menu setup
==== post-mod: Post boot archive image area modification
Warning: creating filesystem that does not conform to ISO-9660.
Warning: creating filesystem that does not conform to ISO-9660.
==== gen-slim-cont: Generate Slim CD image content list
==== iso: ISO image creation
Warning: creating filesystem that does not conform to ISO-9660.
Setting input-charset to 'UTF-8' from locale.
Size of boot image is 4 sectors -> No emulation
0.55% done, estimate finish Sun Mar 21 12:11:31 2010
1.10% done, estimate finish Sun Mar 21 12:10:00 2010
1.65% done, estimate finish Sun Mar 21 12:12:32 2010
2.20% done, estimate finish Sun Mar 21 12:11:32 2010
2.75% done, estimate finish Sun Mar 21 12:11:31 2010
3.30% done, estimate finish Sun Mar 21 12:12:02 2010
3.85% done, estimate finish Sun Mar 21 12:11:57 2010
4.39% done, estimate finish Sun Mar 21 12:11:54 2010
4.94% done, estimate finish Sun Mar 21 12:12:12 2010
5.49% done, estimate finish Sun Mar 21 12:12:08 2010
6.04% done, estimate finish Sun Mar 21 12:11:48 2010
6.59% done, estimate finish Sun Mar 21 12:12:17 2010
7.14% done, estimate finish Sun Mar 21 12:12:00 2010
7.69% done, estimate finish Sun Mar 21 12:12:24 2010
8.24% done, estimate finish Sun Mar 21 12:12:32 2010
8.79% done, estimate finish Sun Mar 21 12:12:28 2010
9.34% done, estimate finish Sun Mar 21 12:12:46 2010
9.89% done, estimate finish Sun Mar 21 12:12:52 2010
10.44% done, estimate finish Sun Mar 21 12:12:48 2010
10.99% done, estimate finish Sun Mar 21 12:12:53 2010
11.54% done, estimate finish Sun Mar 21 12:12:50 2010
12.08% done, estimate finish Sun Mar 21 12:13:03 2010
12.63% done, estimate finish Sun Mar 21 12:12:59 2010
13.18% done, estimate finish Sun Mar 21 12:12:55 2010
13.73% done, estimate finish Sun Mar 21 12:12:59 2010
14.28% done, estimate finish Sun Mar 21 12:12:56 2010
14.83% done, estimate finish Sun Mar 21 12:13:06 2010
15.38% done, estimate finish Sun Mar 21 12:13:03 2010
15.93% done, estimate finish Sun Mar 21 12:13:12 2010
16.48% done, estimate finish Sun Mar 21 12:13:03 2010
17.03% done, estimate finish Sun Mar 21 12:13:00 2010
17.58% done, estimate finish Sun Mar 21 12:13:08 2010
18.13% done, estimate finish Sun Mar 21 12:13:05 2010
18.68% done, estimate finish Sun Mar 21 12:13:13 2010
19.23% done, estimate finish Sun Mar 21 12:13:05 2010
19.77% done, estimate finish Sun Mar 21 12:13:03 2010
20.32% done, estimate finish Sun Mar 21 12:13:10 2010
20.87% done, estimate finish Sun Mar 21 12:13:07 2010
21.42% done, estimate finish Sun Mar 21 12:13:05 2010
21.97% done, estimate finish Sun Mar 21 12:13:03 2010
22.52% done, estimate finish Sun Mar 21 12:13:05 2010
23.07% done, estimate finish Sun Mar 21 12:13:07 2010
23.62% done, estimate finish Sun Mar 21 12:13:00 2010
24.17% done, estimate finish Sun Mar 21 12:13:07 2010
24.72% done, estimate finish Sun Mar 21 12:13:13 2010
25.27% done, estimate finish Sun Mar 21 12:13:07 2010
25.82% done, estimate finish Sun Mar 21 12:13:16 2010
26.37% done, estimate finish Sun Mar 21 12:13:14 2010
26.92% done, estimate finish Sun Mar 21 12:13:12 2010
27.46% done, estimate finish Sun Mar 21 12:13:14 2010
28.01% done, estimate finish Sun Mar 21 12:13:11 2010
28.56% done, estimate finish Sun Mar 21 12:13:17 2010
29.11% done, estimate finish Sun Mar 21 12:13:18 2010
29.66% done, estimate finish Sun Mar 21 12:13:16 2010
30.21% done, estimate finish Sun Mar 21 12:13:14 2010
30.76% done, estimate finish Sun Mar 21 12:13:16 2010
31.31% done, estimate finish Sun Mar 21 12:13:11 2010
31.86% done, estimate finish Sun Mar 21 12:13:15 2010
32.41% done, estimate finish Sun Mar 21 12:13:16 2010
32.96% done, estimate finish Sun Mar 21 12:13:18 2010
33.51% done, estimate finish Sun Mar 21 12:13:22 2010
34.06% done, estimate finish Sun Mar 21 12:13:17 2010
34.61% done, estimate finish Sun Mar 21 12:13:21 2010
35.15% done, estimate finish Sun Mar 21 12:13:20 2010
35.70% done, estimate finish Sun Mar 21 12:13:18 2010
36.25% done, estimate finish Sun Mar 21 12:13:19 2010
36.80% done, estimate finish Sun Mar 21 12:13:20 2010
37.35% done, estimate finish Sun Mar 21 12:13:24 2010
37.90% done, estimate finish Sun Mar 21 12:13:22 2010
38.45% done, estimate finish Sun Mar 21 12:13:26 2010
39.00% done, estimate finish Sun Mar 21 12:13:24 2010
39.55% done, estimate finish Sun Mar 21 12:13:23 2010
40.10% done, estimate finish Sun Mar 21 12:13:26 2010
40.65% done, estimate finish Sun Mar 21 12:13:22 2010
41.20% done, estimate finish Sun Mar 21 12:13:26 2010
41.75% done, estimate finish Sun Mar 21 12:13:27 2010
42.30% done, estimate finish Sun Mar 21 12:13:25 2010
42.84% done, estimate finish Sun Mar 21 12:13:26 2010
43.39% done, estimate finish Sun Mar 21 12:13:27 2010
43.94% done, estimate finish Sun Mar 21 12:13:25 2010
44.49% done, estimate finish Sun Mar 21 12:13:24 2010
45.04% done, estimate finish Sun Mar 21 12:13:27 2010
45.59% done, estimate finish Sun Mar 21 12:13:26 2010
46.14% done, estimate finish Sun Mar 21 12:13:24 2010
46.69% done, estimate finish Sun Mar 21 12:13:27 2010
47.24% done, estimate finish Sun Mar 21 12:13:24 2010
47.79% done, estimate finish Sun Mar 21 12:13:22 2010
48.34% done, estimate finish Sun Mar 21 12:13:25 2010
48.89% done, estimate finish Sun Mar 21 12:13:22 2010
49.44% done, estimate finish Sun Mar 21 12:13:23 2010
49.99% done, estimate finish Sun Mar 21 12:13:26 2010
50.53% done, estimate finish Sun Mar 21 12:13:22 2010
51.08% done, estimate finish Sun Mar 21 12:13:21 2010
51.63% done, estimate finish Sun Mar 21 12:13:20 2010
52.18% done, estimate finish Sun Mar 21 12:13:23 2010
52.73% done, estimate finish Sun Mar 21 12:13:22 2010
53.28% done, estimate finish Sun Mar 21 12:13:20 2010
53.83% done, estimate finish Sun Mar 21 12:13:21 2010
54.38% done, estimate finish Sun Mar 21 12:13:20 2010
54.93% done, estimate finish Sun Mar 21 12:13:17 2010
55.48% done, estimate finish Sun Mar 21 12:13:22 2010
56.03% done, estimate finish Sun Mar 21 12:13:19 2010
56.58% done, estimate finish Sun Mar 21 12:13:18 2010
57.13% done, estimate finish Sun Mar 21 12:13:20 2010
57.68% done, estimate finish Sun Mar 21 12:13:17 2010
58.22% done, estimate finish Sun Mar 21 12:13:20 2010
58.77% done, estimate finish Sun Mar 21 12:13:17 2010
59.32% done, estimate finish Sun Mar 21 12:13:19 2010
59.87% done, estimate finish Sun Mar 21 12:13:18 2010
60.42% done, estimate finish Sun Mar 21 12:13:16 2010
60.97% done, estimate finish Sun Mar 21 12:13:18 2010
61.52% done, estimate finish Sun Mar 21 12:13:17 2010
62.07% done, estimate finish Sun Mar 21 12:13:18 2010
62.62% done, estimate finish Sun Mar 21 12:13:20 2010
63.17% done, estimate finish Sun Mar 21 12:13:18 2010
63.72% done, estimate finish Sun Mar 21 12:13:18 2010
64.27% done, estimate finish Sun Mar 21 12:13:19 2010
64.82% done, estimate finish Sun Mar 21 12:13:16 2010
65.37% done, estimate finish Sun Mar 21 12:13:16 2010
65.91% done, estimate finish Sun Mar 21 12:13:24 2010
66.46% done, estimate finish Sun Mar 21 12:13:29 2010
67.01% done, estimate finish Sun Mar 21 12:13:26 2010
67.56% done, estimate finish Sun Mar 21 12:13:34 2010
68.11% done, estimate finish Sun Mar 21 12:13:42 2010
68.66% done, estimate finish Sun Mar 21 12:13:43 2010
69.21% done, estimate finish Sun Mar 21 12:13:55 2010
69.76% done, estimate finish Sun Mar 21 12:13:53 2010
70.31% done, estimate finish Sun Mar 21 12:13:52 2010
70.86% done, estimate finish Sun Mar 21 12:13:51 2010
71.41% done, estimate finish Sun Mar 21 12:13:49 2010
71.96% done, estimate finish Sun Mar 21 12:13:49 2010
72.50% done, estimate finish Sun Mar 21 12:13:48 2010
73.05% done, estimate finish Sun Mar 21 12:13:48 2010
73.60% done, estimate finish Sun Mar 21 12:13:49 2010
74.15% done, estimate finish Sun Mar 21 12:13:48 2010
74.70% done, estimate finish Sun Mar 21 12:13:48 2010
75.25% done, estimate finish Sun Mar 21 12:13:47 2010
75.80% done, estimate finish Sun Mar 21 12:13:46 2010
76.35% done, estimate finish Sun Mar 21 12:13:46 2010
76.90% done, estimate finish Sun Mar 21 12:13:44 2010
77.45% done, estimate finish Sun Mar 21 12:13:45 2010
78.00% done, estimate finish Sun Mar 21 12:13:45 2010
78.55% done, estimate finish Sun Mar 21 12:13:47 2010
79.10% done, estimate finish Sun Mar 21 12:13:44 2010
79.65% done, estimate finish Sun Mar 21 12:13:46 2010
80.19% done, estimate finish Sun Mar 21 12:13:44 2010
80.74% done, estimate finish Sun Mar 21 12:13:45 2010
81.29% done, estimate finish Sun Mar 21 12:13:44 2010
81.84% done, estimate finish Sun Mar 21 12:13:44 2010
82.39% done, estimate finish Sun Mar 21 12:13:45 2010
82.94% done, estimate finish Sun Mar 21 12:13:43 2010
83.49% done, estimate finish Sun Mar 21 12:13:41 2010
84.04% done, estimate finish Sun Mar 21 12:13:42 2010
84.59% done, estimate finish Sun Mar 21 12:13:40 2010
85.14% done, estimate finish Sun Mar 21 12:13:42 2010
85.69% done, estimate finish Sun Mar 21 12:13:41 2010
86.24% done, estimate finish Sun Mar 21 12:13:41 2010
86.79% done, estimate finish Sun Mar 21 12:13:39 2010
87.34% done, estimate finish Sun Mar 21 12:13:40 2010
87.88% done, estimate finish Sun Mar 21 12:13:40 2010
88.43% done, estimate finish Sun Mar 21 12:13:42 2010
88.98% done, estimate finish Sun Mar 21 12:13:40 2010
89.53% done, estimate finish Sun Mar 21 12:13:41 2010
90.08% done, estimate finish Sun Mar 21 12:13:40 2010
90.63% done, estimate finish Sun Mar 21 12:13:41 2010
91.18% done, estimate finish Sun Mar 21 12:13:42 2010
91.73% done, estimate finish Sun Mar 21 12:13:40 2010
92.28% done, estimate finish Sun Mar 21 12:13:39 2010
92.83% done, estimate finish Sun Mar 21 12:13:40 2010
93.38% done, estimate finish Sun Mar 21 12:13:38 2010
93.93% done, estimate finish Sun Mar 21 12:13:36 2010
94.48% done, estimate finish Sun Mar 21 12:13:38 2010
95.03% done, estimate finish Sun Mar 21 12:13:37 2010
95.57% done, estimate finish Sun Mar 21 12:13:35 2010
96.12% done, estimate finish Sun Mar 21 12:13:34 2010
96.67% done, estimate finish Sun Mar 21 12:13:33 2010
97.22% done, estimate finish Sun Mar 21 12:13:33 2010
97.77% done, estimate finish Sun Mar 21 12:13:33 2010
98.32% done, estimate finish Sun Mar 21 12:13:32 2010
98.87% done, estimate finish Sun Mar 21 12:13:30 2010
99.42% done, estimate finish Sun Mar 21 12:13:30 2010
99.97% done, estimate finish Sun Mar 21 12:13:29 2010
Total translation table size: 2048
Total rockridge attributes bytes: 31034
Total directory bytes: 196608
Path table size(bytes): 1256
Max brk space used 80000
910289 extents written (1777 MB)
==== usb: USB image creation
/dev/rlofi/2: 4369200 sectors in 7282 cylinders of 1 tracks, 600 sectors
2133.4MB in 114 cyl groups (64 c/g, 18.75MB/g, 3200 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 38432, 76832, 115232, 153632, 192032, 230432, 268832, 307232, 345632,
3993632, 4032032, 4070432, 4108832, 4147232, 4185632, 4224032, 4262432,
4300832, 4339232
3640656 blocks
Build completed Sun Mar 21 12:48:51 2010
Build is successful.
- Ahora, se puede copiar cualquiera de las dos imágenes, ubicadas en /rpool/dc/media/OpenSolaris_custom.iso o .usb, a un DVD o una memoria flash, respectivamente.
NOTA IMPORTANTE
: Si se agregan demasiados paquetes a la lista, puede ocurrir que luego de generar bien la imagen de DVD , bien la de USB, aunque no arroje errores del comando distro_const, al bootear como LiveDC/LiveUSB aparezcan mensajes haciendo referencia a que la cantidad de inodos se ha colapsado, lo que hará abortar el booteo normal, y por ende, la instalación. Yo probé agregando, por ejemplo, netbeans y eclipse, y mi instalación abortó por ese problema.