summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2011-04-15 08:20:34 +0000
committerramon <ramongomez@us.es>2011-04-15 08:20:34 +0000
commit3cedc88b26c9a8192537bc3884d91b2f549598c3 (patch)
tree0a2b0549ebad4426ed9c9e9fda2eda535a32851d
parentf43e6f49bdd1fdc709147b2f8ce0f929a94abdf7 (diff)
parente8460d24b1f422ee143e401cda13049f586370bf (diff)
OpenGnSys 1.0 como versión princial del trunk (modificado #362).
git-svn-id: https://opengnsys.es/svn/trunk@1867 a21b9725-9963-47de-94b9-378ad31fedc9
-rw-r--r--admin/Database/ogAdmBD-1.0pre-1.0.sql24
-rw-r--r--admin/Database/ogAdmBD.sql103
-rwxr-xr-xadmin/Interface/CambiarAcceso15
-rwxr-xr-xadmin/Interface/CrearImagen39
-rwxr-xr-xadmin/Interface/EjecutarScript9
-rwxr-xr-xadmin/Interface/RestaurarImagen17
-rwxr-xr-xadmin/Sources/Services/ogAdmRepoAux51
-rw-r--r--admin/Sources/Services/opengnsys.default1
-rwxr-xr-xadmin/Sources/Services/opengnsys.init36
-rw-r--r--admin/WebConsole/asistentes/AsistenteCloneRemotePartition.php112
-rw-r--r--admin/WebConsole/asistentes/AsistenteDeployImage.php138
-rw-r--r--admin/WebConsole/asistentes/AsistenteParticionado.php136
-rw-r--r--admin/WebConsole/asistentes/AsistenteUpdateCache.php138
-rw-r--r--admin/WebConsole/asistentes/gestores/gestor_Comandos.php285
-rw-r--r--admin/WebConsole/asistentes/includes/asistentes/AyudanteFormularios.php375
-rw-r--r--admin/WebConsole/asistentes/includes/asistentes/formCloneRemotePartition.php50
-rw-r--r--admin/WebConsole/asistentes/includes/asistentes/formDeployImage.php48
-rw-r--r--admin/WebConsole/asistentes/includes/asistentes/formParticionado.php77
-rw-r--r--admin/WebConsole/asistentes/includes/capturaacciones.php31
-rw-r--r--admin/WebConsole/asistentes/includes/formularioacciones.php20
-rw-r--r--admin/WebConsole/asistentes/includes/opcionesacciones.php93
-rw-r--r--admin/WebConsole/asistentes/jscripts/Apagar.js24
-rw-r--r--admin/WebConsole/asistentes/jscripts/Arrancar.js24
-rw-r--r--admin/WebConsole/asistentes/jscripts/Comando.js24
-rw-r--r--admin/WebConsole/asistentes/jscripts/Configurar.js174
-rw-r--r--admin/WebConsole/asistentes/jscripts/CrearImagen.js70
-rw-r--r--admin/WebConsole/asistentes/jscripts/EjecutarScripts.js34
-rw-r--r--admin/WebConsole/asistentes/jscripts/IniciarSesion.js47
-rw-r--r--admin/WebConsole/asistentes/jscripts/InventarioHardware.js24
-rw-r--r--admin/WebConsole/asistentes/jscripts/InventarioSoftware.js44
-rw-r--r--admin/WebConsole/asistentes/jscripts/Reiniciar.js24
-rw-r--r--admin/WebConsole/asistentes/jscripts/RestaurarImagen.js95
-rw-r--r--admin/WebConsole/asistentes/jscripts/asistentes.js102
-rw-r--r--admin/WebConsole/asistentes/jscripts/comunescomandos.js190
-rw-r--r--admin/WebConsole/asistentes/xajax.common.php7
-rw-r--r--admin/WebConsole/asistentes/xajax.server.php70
-rw-r--r--admin/WebConsole/gestores/gestor_aulas.php35
-rw-r--r--admin/WebConsole/gestores/gestor_ordenadores.php18
-rwxr-xr-xadmin/WebConsole/gestores/gestor_pxe.php179
-rwxr-xr-xadmin/WebConsole/gestores/gestor_pxe_grub4dos.php186
-rwxr-xr-xadmin/WebConsole/gestores/gestor_ubicarordenadores.php84
-rw-r--r--admin/WebConsole/idiomas/javascripts/eng/propiedades_aulas_eng.js1
-rw-r--r--admin/WebConsole/idiomas/javascripts/esp/propiedades_aulas_esp.js8
-rw-r--r--admin/WebConsole/idiomas/php/cat/propietats_aules_cat.txt24
-rw-r--r--admin/WebConsole/idiomas/php/eng/propiedades_aulas_eng.php16
-rw-r--r--admin/WebConsole/idiomas/php/esp/propiedades_aulas_esp.php10
-rw-r--r--admin/WebConsole/jscripts/aulas.js47
-rw-r--r--admin/WebConsole/jscripts/propiedades_aulas.js33
-rw-r--r--admin/WebConsole/jscripts/validators.js60
-rw-r--r--admin/WebConsole/menus/images/linux_peque.pngbin0 -> 2828 bytes
-rw-r--r--admin/WebConsole/menus/images/poweroff.pngbin0 -> 3477 bytes
-rw-r--r--admin/WebConsole/menus/images/xp_peque.pngbin0 -> 4324 bytes
-rw-r--r--admin/WebConsole/menus/menuaula1.html37
-rw-r--r--admin/WebConsole/menus/menuejemplo.html74
-rw-r--r--admin/WebConsole/principal/aula.php67
-rw-r--r--admin/WebConsole/principal/aulas.php147
-rw-r--r--admin/WebConsole/principal/boot.php217
-rw-r--r--admin/WebConsole/principal/ubicarordenadores.php274
-rw-r--r--admin/WebConsole/principal/verlog.php88
-rw-r--r--admin/WebConsole/principal/verlogseguimiento.php91
-rw-r--r--admin/WebConsole/propiedades/propiedades_aulas.php89
-rw-r--r--admin/WebConsole/propiedades/propiedades_ordenadores.php37
-rw-r--r--admin/WebConsole/varios/incorporaordenadores.php3
-rw-r--r--admin/xajax_0.5_standard.zipbin0 -> 241376 bytes
-rw-r--r--client/LICENSE.en.txt (renamed from client/LICENSE)0
-rw-r--r--client/README.es.txt16
-rw-r--r--client/boot-tools/INSTALL.es.txt46
-rw-r--r--client/boot-tools/clientstructure/etc/apt/sources.list.debian4
-rw-r--r--client/boot-tools/clientstructure/etc/apt/sources.list.ubuntu56
-rw-r--r--client/boot-tools/clientstructure/etc/environment4
-rw-r--r--client/boot-tools/clientstructure/etc/fstab13
-rwxr-xr-xclient/boot-tools/clientstructure/etc/initramfs-tools/hooks/oghooks58
-rw-r--r--client/boot-tools/clientstructure/etc/initramfs-tools/modules14
-rw-r--r--client/boot-tools/clientstructure/etc/initramfs-tools/scripts/ogfunctions427
-rwxr-xr-xclient/boot-tools/clientstructure/etc/initramfs-tools/scripts/oginit114
-rw-r--r--client/boot-tools/clientstructure/etc/inittab14
-rw-r--r--client/boot-tools/clientstructure/etc/modprobe.d/blacklist-framebuffer.conf30
-rw-r--r--client/boot-tools/clientstructure/etc/mtab0
-rw-r--r--client/boot-tools/clientstructure/etc/network/interfaces4
-rwxr-xr-xclient/boot-tools/clientstructure/etc/profile.d/loadenviron.sh87
-rw-r--r--client/boot-tools/clientstructure/etc/ssh/ssh_config56
-rw-r--r--client/boot-tools/clientstructure/etc/ssh/sshd_config86
-rwxr-xr-xclient/boot-tools/clientstructure/root/CompileSoftware.sh30
-rwxr-xr-xclient/boot-tools/clientstructure/root/ConfFS.sh24
-rwxr-xr-xclient/boot-tools/clientstructure/root/GenerateInitrd.generic.sh16
-rwxr-xr-xclient/boot-tools/clientstructure/root/InstallSoftware.sh62
-rwxr-xr-xclient/boot-tools/clientstructure/root/ReconfigureLocales.sh4
-rwxr-xr-xclient/boot-tools/clientstructure/root/generateSshKeysClient.sh23
-rwxr-xr-xclient/boot-tools/clientstructure/root/importSshKeys.sh17
-rwxr-xr-xclient/boot-tools/clientstructure/root/qemu.sh9
-rw-r--r--client/boot-tools/clientstructure/var/lib/locales/supported.d/local5
-rw-r--r--client/boot-tools/kernelParameterOG.es.txt46
-rwxr-xr-xclient/boot-tools/ogClientGeneratorV2.sh161
-rw-r--r--client/boot-tools/ogClientManager.lib614
-rw-r--r--client/boot-tools/ogInstaller.lib958
-rw-r--r--client/boot/README.es.txt22
-rwxr-xr-xclient/boot/initrd-generator314
-rwxr-xr-xclient/boot/ogClientNfs-generator.lib139
-rw-r--r--client/boot/udeblist-jaunty.conf22
-rw-r--r--client/boot/udeblist-karmic.conf22
-rw-r--r--client/boot/udeblist-lucid.conf31
-rw-r--r--client/boot/udeblist-maverick.conf28
l---------client/boot/udeblist.conf1
-rwxr-xr-xclient/boot/upgrade-clients-udeb.sh50
-rw-r--r--client/browser/src/main.cpp2
-rw-r--r--client/browser/src/mainwindow.cpp49
-rwxr-xr-xclient/engine/Cache.lib12
-rwxr-xr-xclient/engine/Disk.lib22
-rwxr-xr-xclient/engine/FileSystem.lib200
-rwxr-xr-xclient/engine/Image.lib881
-rwxr-xr-xclient/engine/Inventory.lib2
-rwxr-xr-xclient/engine/Net.lib60
-rwxr-xr-xclient/engine/Protocol.lib608
-rwxr-xr-xclient/engine/Protocol.lib.testing676
-rw-r--r--client/engine/String.lib123
-rwxr-xr-xclient/engine/System.lib37
-rwxr-xr-xclient/nfsexport/bin/awkbin932548 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/bashbin1373232 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/chntpwbin758632 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ctorrentbin817372 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/dosfsckbin601276 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/dosfslabelbin593084 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/gzipbin599428 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/mbufferbin666884 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/mkntfsbin228336 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/partclone.btrfsbin695592 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/partclone.chkimgbin556100 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/partclone.ddbin556100 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/partclone.extfsbin589048 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/partclone.fatbin572484 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/partclone.hfspbin568388 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/partclone.infobin547876 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/partclone.ntfsbin711912 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/partclone.ntfsfixbootbin523300 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/partclone.restorebin556100 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/partprobebin17924 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/udp-receiverbin48000 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/i386/udp-senderbin56836 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/kexecbin737604 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/lshwbin2073760 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/mkdosfsbin573148 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ms-sysbin563072 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ntfscatbin676904 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ntfsclonebin698332 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ntfsclusterbin682572 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ntfscmpbin685312 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ntfscpbin682588 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ntfsfixbin681000 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ntfsinfobin706168 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ntfslabelbin676904 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ntfslsbin682268 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ntfsundeletebin767408 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/ogAdmClientbin646145 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/partimagebin1468144 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/ethtoolbin170640 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/faucetbin17908 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/filebin13784 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/fsarchiverbin2045398 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/hdparmbin80428 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/hosebin17896 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/ifconfigbin65648 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/libgcc_s.so.1bin116272 -> 0 bytes
-rw-r--r--client/nfsexport/bin/testing/libmagic.so.1bin112256 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/lzopbin31496 -> 0 bytes
-rw-r--r--client/nfsexport/bin/testing/magic15283
-rw-r--r--client/nfsexport/bin/testing/magic.mgcbin1775200 -> 0 bytes
-rw-r--r--client/nfsexport/bin/testing/magic.mime1027
-rwxr-xr-xclient/nfsexport/bin/testing/mbufferbin112353 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/partimagebin1382420 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/pvbin14404 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/udp-receiverbin48000 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/udp-senderbin56836 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/testing/whereisbin9856 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/gzipbin754712 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/mbufferbin849416 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/mkntfsbin203496 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/ntfsresizebin178920 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/partclone.btrfsbin841112 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/partclone.chkimgbin713880 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/partclone.ddbin713880 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/partclone.extfsbin746960 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/partclone.fatbin726200 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/partclone.hfspbin722072 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/partclone.infobin701592 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/partclone.ntfsbin849240 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/partclone.ntfsfixbootbin672888 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/partclone.restorebin713880 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/partprobebin324856 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/udp-receiverbin52704 -> 0 bytes
-rwxr-xr-xclient/nfsexport/bin/x86_64/udp-senderbin61992 -> 0 bytes
-rwxr-xr-xclient/nfsexport/etc/preinit/fileslinks.sh38
-rwxr-xr-xclient/nfsexport/scripts/admBootOs3
-rwxr-xr-xclient/nfsexport/scripts/admCreateImage3
-rwxr-xr-xclient/nfsexport/scripts/admCreateLogicalPartitions3
-rwxr-xr-xclient/nfsexport/scripts/admCreatePrimaryPartitions5
-rwxr-xr-xclient/nfsexport/scripts/admFormatFs4
-rwxr-xr-xclient/nfsexport/scripts/admGetFsType6
-rwxr-xr-xclient/nfsexport/scripts/admGetIpAddress6
-rwxr-xr-xclient/nfsexport/scripts/admGetOsVersion6
-rwxr-xr-xclient/nfsexport/scripts/admListHardwareInfo6
-rwxr-xr-xclient/nfsexport/scripts/admListPrimaryPartitions7
-rwxr-xr-xclient/nfsexport/scripts/admListSoftwareInfo6
-rwxr-xr-xclient/nfsexport/scripts/admMenuBrowser3
-rwxr-xr-xclient/nfsexport/scripts/admRestoreImage4
-rw-r--r--client/shared/README.es.txt (renamed from client/nfsexport/README.es.txt)0
-rwxr-xr-xclient/shared/bin/EACInterfaces (renamed from client/nfsexport/bin/i386/EACInterfaces)bin9682 -> 9682 bytes
-rwxr-xr-xclient/shared/bin/browser (renamed from client/nfsexport/bin/browser)bin25407040 -> 23763136 bytes
-rwxr-xr-xclient/shared/bin/ogAdmClientbin0 -> 687449 bytes
-rwxr-xr-xclient/shared/bin/runtest246
-rwxr-xr-xclient/shared/etc/init/default.sh (renamed from client/nfsexport/etc/init/default.sh)13
-rwxr-xr-xclient/shared/etc/init/defaultTESTING.sh49
l---------client/shared/etc/lang.es_ES.UTF-8.conf (renamed from client/nfsexport/etc/lang.es_ES.UTF-8.conf)0
-rw-r--r--client/shared/etc/lang.es_ES.conf (renamed from client/nfsexport/etc/lang.es_ES.conf)2
-rwxr-xr-xclient/shared/etc/preinit/default.sh (renamed from client/nfsexport/etc/preinit/default.sh)14
-rwxr-xr-xclient/shared/etc/preinit/fileslinks.sh35
-rwxr-xr-xclient/shared/etc/preinit/loadenviron.sh (renamed from client/nfsexport/etc/preinit/loadenviron.sh)34
-rwxr-xr-xclient/shared/etc/preinit/loadmodules.sh (renamed from client/nfsexport/etc/preinit/loadmodules.sh)10
-rwxr-xr-xclient/shared/etc/preinit/loadudeb.sh.NoUsed (renamed from client/nfsexport/etc/preinit/loadudeb.sh)0
-rwxr-xr-xclient/shared/etc/preinit/metadevs.sh.NoUsed (renamed from client/nfsexport/etc/preinit/metadevs.sh)0
-rwxr-xr-xclient/shared/etc/preinit/mountrepo.sh25
-rw-r--r--client/shared/lib/engine/tests/Modify/Cache.shtest93
-rw-r--r--client/shared/lib/engine/tests/NoModify/File1.shtest80
-rw-r--r--client/shared/lib/engine/tests/NoModify/Lock1.shtest85
-rw-r--r--client/shared/lib/engine/tests/NoModify/Net1.shtest21
-rw-r--r--client/shared/lib/engine/tests/README6
-rwxr-xr-xclient/shared/lib/engine/tests/crearTestDisk1157
-rwxr-xr-xclient/shared/lib/engine/tests/crearTestLock282
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/DejaVuSans-Bold.ttf (renamed from client/nfsexport/lib/fonts/DejaVuSans-Bold.ttf)bin466696 -> 466696 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/DejaVuSans-BoldOblique.ttf (renamed from client/nfsexport/lib/fonts/DejaVuSans-BoldOblique.ttf)bin441736 -> 441736 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/DejaVuSans-Oblique.ttf (renamed from client/nfsexport/lib/fonts/DejaVuSans-Oblique.ttf)bin434576 -> 434576 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/DejaVuSans.ttf (renamed from client/nfsexport/lib/fonts/DejaVuSans.ttf)bin493564 -> 493564 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/DejaVuSansMono-Bold.ttf (renamed from client/nfsexport/lib/fonts/DejaVuSansMono-Bold.ttf)bin229460 -> 229460 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/DejaVuSansMono-BoldOblique.ttf (renamed from client/nfsexport/lib/fonts/DejaVuSansMono-BoldOblique.ttf)bin177780 -> 177780 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/DejaVuSansMono-Oblique.ttf (renamed from client/nfsexport/lib/fonts/DejaVuSansMono-Oblique.ttf)bin184896 -> 184896 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/DejaVuSansMono.ttf (renamed from client/nfsexport/lib/fonts/DejaVuSansMono.ttf)bin237788 -> 237788 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/DejaVuSerif-Bold.ttf (renamed from client/nfsexport/lib/fonts/DejaVuSerif-Bold.ttf)bin201516 -> 201516 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/DejaVuSerif-BoldOblique.ttf (renamed from client/nfsexport/lib/fonts/DejaVuSerif-BoldOblique.ttf)bin180948 -> 180948 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/DejaVuSerif-Oblique.ttf (renamed from client/nfsexport/lib/fonts/DejaVuSerif-Oblique.ttf)bin179872 -> 179872 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/DejaVuSerif.ttf (renamed from client/nfsexport/lib/fonts/DejaVuSerif.ttf)bin210416 -> 210416 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/README (renamed from client/nfsexport/lib/fonts/README)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/UTBI____.pfa (renamed from client/nfsexport/lib/fonts/UTBI____.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/UTB_____.pfa (renamed from client/nfsexport/lib/fonts/UTB_____.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/UTI_____.pfa (renamed from client/nfsexport/lib/fonts/UTI_____.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/UTRG____.pfa (renamed from client/nfsexport/lib/fonts/UTRG____.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/Vera.ttf (renamed from client/nfsexport/lib/fonts/Vera.ttf)bin65932 -> 65932 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/VeraBI.ttf (renamed from client/nfsexport/lib/fonts/VeraBI.ttf)bin63208 -> 63208 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/VeraBd.ttf (renamed from client/nfsexport/lib/fonts/VeraBd.ttf)bin58716 -> 58716 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/VeraIt.ttf (renamed from client/nfsexport/lib/fonts/VeraIt.ttf)bin63684 -> 63684 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/VeraMoBI.ttf (renamed from client/nfsexport/lib/fonts/VeraMoBI.ttf)bin55032 -> 55032 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/VeraMoBd.ttf (renamed from client/nfsexport/lib/fonts/VeraMoBd.ttf)bin49052 -> 49052 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/VeraMoIt.ttf (renamed from client/nfsexport/lib/fonts/VeraMoIt.ttf)bin54508 -> 54508 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/VeraMono.ttf (renamed from client/nfsexport/lib/fonts/VeraMono.ttf)bin49224 -> 49224 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/VeraSe.ttf (renamed from client/nfsexport/lib/fonts/VeraSe.ttf)bin60280 -> 60280 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/VeraSeBd.ttf (renamed from client/nfsexport/lib/fonts/VeraSeBd.ttf)bin58736 -> 58736 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/c0419bt_.pfb (renamed from client/nfsexport/lib/fonts/c0419bt_.pfb)bin40766 -> 40766 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/c0582bt_.pfb (renamed from client/nfsexport/lib/fonts/c0582bt_.pfb)bin39511 -> 39511 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/c0583bt_.pfb (renamed from client/nfsexport/lib/fonts/c0583bt_.pfb)bin40008 -> 40008 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/c0611bt_.pfb (renamed from client/nfsexport/lib/fonts/c0611bt_.pfb)bin39871 -> 39871 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/c0632bt_.pfb (renamed from client/nfsexport/lib/fonts/c0632bt_.pfb)bin33799 -> 33799 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/c0633bt_.pfb (renamed from client/nfsexport/lib/fonts/c0633bt_.pfb)bin35229 -> 35229 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/c0648bt_.pfb (renamed from client/nfsexport/lib/fonts/c0648bt_.pfb)bin34869 -> 34869 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/c0649bt_.pfb (renamed from client/nfsexport/lib/fonts/c0649bt_.pfb)bin35118 -> 35118 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/cour.pfa (renamed from client/nfsexport/lib/fonts/cour.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/courb.pfa (renamed from client/nfsexport/lib/fonts/courb.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/courbi.pfa (renamed from client/nfsexport/lib/fonts/courbi.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/couri.pfa (renamed from client/nfsexport/lib/fonts/couri.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/cursor.pfa (renamed from client/nfsexport/lib/fonts/cursor.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/fixed_120_50.qpf (renamed from client/nfsexport/lib/fonts/fixed_120_50.qpf)bin3109 -> 3109 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/fixed_70_50.qpf (renamed from client/nfsexport/lib/fonts/fixed_70_50.qpf)bin2567 -> 2567 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_100_50.qpf (renamed from client/nfsexport/lib/fonts/helvetica_100_50.qpf)bin3046 -> 3046 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_100_50i.qpf (renamed from client/nfsexport/lib/fonts/helvetica_100_50i.qpf)bin3052 -> 3052 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_100_75.qpf (renamed from client/nfsexport/lib/fonts/helvetica_100_75.qpf)bin3040 -> 3040 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_100_75i.qpf (renamed from client/nfsexport/lib/fonts/helvetica_100_75i.qpf)bin3081 -> 3081 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_120_50.qpf (renamed from client/nfsexport/lib/fonts/helvetica_120_50.qpf)bin3301 -> 3301 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_120_50i.qpf (renamed from client/nfsexport/lib/fonts/helvetica_120_50i.qpf)bin3560 -> 3560 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_120_75.qpf (renamed from client/nfsexport/lib/fonts/helvetica_120_75.qpf)bin3326 -> 3326 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_120_75i.qpf (renamed from client/nfsexport/lib/fonts/helvetica_120_75i.qpf)bin3759 -> 3759 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_140_50.qpf (renamed from client/nfsexport/lib/fonts/helvetica_140_50.qpf)bin3860 -> 3860 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_140_50i.qpf (renamed from client/nfsexport/lib/fonts/helvetica_140_50i.qpf)bin4208 -> 4208 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_140_75.qpf (renamed from client/nfsexport/lib/fonts/helvetica_140_75.qpf)bin4035 -> 4035 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_140_75i.qpf (renamed from client/nfsexport/lib/fonts/helvetica_140_75i.qpf)bin4498 -> 4498 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_180_50.qpf (renamed from client/nfsexport/lib/fonts/helvetica_180_50.qpf)bin5179 -> 5179 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_180_50i.qpf (renamed from client/nfsexport/lib/fonts/helvetica_180_50i.qpf)bin5778 -> 5778 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_180_75.qpf (renamed from client/nfsexport/lib/fonts/helvetica_180_75.qpf)bin5712 -> 5712 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_180_75i.qpf (renamed from client/nfsexport/lib/fonts/helvetica_180_75i.qpf)bin5977 -> 5977 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_240_50.qpf (renamed from client/nfsexport/lib/fonts/helvetica_240_50.qpf)bin7691 -> 7691 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_240_50i.qpf (renamed from client/nfsexport/lib/fonts/helvetica_240_50i.qpf)bin8333 -> 8333 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_240_75.qpf (renamed from client/nfsexport/lib/fonts/helvetica_240_75.qpf)bin7912 -> 7912 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_240_75i.qpf (renamed from client/nfsexport/lib/fonts/helvetica_240_75i.qpf)bin8588 -> 8588 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_80_50.qpf (renamed from client/nfsexport/lib/fonts/helvetica_80_50.qpf)bin2735 -> 2735 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_80_50i.qpf (renamed from client/nfsexport/lib/fonts/helvetica_80_50i.qpf)bin2742 -> 2742 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_80_75.qpf (renamed from client/nfsexport/lib/fonts/helvetica_80_75.qpf)bin2745 -> 2745 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/helvetica_80_75i.qpf (renamed from client/nfsexport/lib/fonts/helvetica_80_75i.qpf)bin2750 -> 2750 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/japanese_230_50.qpf (renamed from client/nfsexport/lib/fonts/japanese_230_50.qpf)bin263331 -> 263331 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/l047013t.pfa (renamed from client/nfsexport/lib/fonts/l047013t.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/l047016t.pfa (renamed from client/nfsexport/lib/fonts/l047016t.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/l047033t.pfa (renamed from client/nfsexport/lib/fonts/l047033t.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/l047036t.pfa (renamed from client/nfsexport/lib/fonts/l047036t.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/l048013t.pfa (renamed from client/nfsexport/lib/fonts/l048013t.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/l048016t.pfa (renamed from client/nfsexport/lib/fonts/l048016t.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/l048033t.pfa (renamed from client/nfsexport/lib/fonts/l048033t.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/l048036t.pfa (renamed from client/nfsexport/lib/fonts/l048036t.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/l049013t.pfa (renamed from client/nfsexport/lib/fonts/l049013t.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/l049016t.pfa (renamed from client/nfsexport/lib/fonts/l049016t.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/l049033t.pfa (renamed from client/nfsexport/lib/fonts/l049033t.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/l049036t.pfa (renamed from client/nfsexport/lib/fonts/l049036t.pfa)0
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/micro_40_50.qpf (renamed from client/nfsexport/lib/fonts/micro_40_50.qpf)bin1602 -> 1602 bytes
-rw-r--r--[-rwxr-xr-x]client/shared/lib/fonts/unifont_160_50.qpf (renamed from client/nfsexport/lib/fonts/unifont_160_50.qpf)bin1215089 -> 1215089 bytes
-rw-r--r--client/shared/lib/grub4dos/badgrub.exe (renamed from client/nfsexport/lib/grub4dos/badgrub.exe)bin210827 -> 210827 bytes
-rwxr-xr-xclient/shared/lib/grub4dos/bootlace.com (renamed from client/nfsexport/lib/grub4dos/bootlace.com)bin37092 -> 37092 bytes
-rw-r--r--client/shared/lib/grub4dos/config.sys (renamed from client/nfsexport/lib/grub4dos/config.sys)0
-rw-r--r--client/shared/lib/grub4dos/default (renamed from client/nfsexport/lib/grub4dos/default)0
-rw-r--r--client/shared/lib/grub4dos/grldr (renamed from client/nfsexport/lib/grub4dos/grldr)bin195435 -> 195435 bytes
-rw-r--r--client/shared/lib/grub4dos/grldr.mbr (renamed from client/nfsexport/lib/grub4dos/grldr.mbr)bin9216 -> 9216 bytes
-rw-r--r--client/shared/lib/grub4dos/grub.exe (renamed from client/nfsexport/lib/grub4dos/grub.exe)bin212363 -> 212363 bytes
-rw-r--r--client/shared/lib/grub4dos/grub.pif (renamed from client/nfsexport/lib/grub4dos/grub.pif)bin967 -> 967 bytes
-rw-r--r--client/shared/lib/grub4dos/hmload.com (renamed from client/nfsexport/lib/grub4dos/hmload.com)bin1856 -> 1856 bytes
-rw-r--r--client/shared/lib/grub4dos/menu.lst (renamed from client/nfsexport/lib/grub4dos/menu.lst)0
-rw-r--r--client/shared/lib/modules/psmouse.ko (renamed from client/nfsexport/lib/modules/psmouse.ko)bin78700 -> 78700 bytes
-rw-r--r--client/shared/lib/pci.ids (renamed from client/nfsexport/lib/pci.ids)0
-rw-r--r--client/shared/scripts/README.es.txt (renamed from client/nfsexport/scripts/README.es.txt)0
-rwxr-xr-xclient/shared/scripts/bootLinux (renamed from client/nfsexport/scripts/bootLinux)0
-rwxr-xr-xclient/shared/scripts/bootOs (renamed from client/nfsexport/scripts/bootOs)0
-rwxr-xr-xclient/shared/scripts/bootWindows (renamed from client/nfsexport/scripts/bootWindows)0
-rwxr-xr-xclient/shared/scripts/cloneRemoteFromMaster246
-rwxr-xr-xclient/shared/scripts/createImage (renamed from client/nfsexport/scripts/createImage)40
-rwxr-xr-xclient/shared/scripts/createLogicalPartitions (renamed from client/nfsexport/scripts/createLogicalPartitions)0
-rwxr-xr-xclient/shared/scripts/createPrimaryPartitions (renamed from client/nfsexport/scripts/createPrimaryPartitions)0
-rwxr-xr-xclient/shared/scripts/deployImage20
-rwxr-xr-xclient/shared/scripts/formatFs (renamed from client/nfsexport/scripts/formatFs)0
-rwxr-xr-xclient/shared/scripts/getFsType (renamed from client/nfsexport/scripts/getFsType)0
-rwxr-xr-xclient/shared/scripts/getIpAddress (renamed from client/nfsexport/scripts/getIpAddress)0
-rwxr-xr-xclient/shared/scripts/getOsVersion (renamed from client/nfsexport/scripts/getOsVersion)0
-rwxr-xr-xclient/shared/scripts/initCache (renamed from client/nfsexport/scripts/initCache)0
-rwxr-xr-xclient/shared/scripts/listHardwareInfo (renamed from client/nfsexport/scripts/listHardwareInfo)0
-rwxr-xr-xclient/shared/scripts/listPrimaryPartitions (renamed from client/nfsexport/scripts/listPrimaryPartitions)0
-rwxr-xr-xclient/shared/scripts/listSoftwareInfo (renamed from client/nfsexport/scripts/listSoftwareInfo)0
-rwxr-xr-xclient/shared/scripts/menuBrowser (renamed from client/nfsexport/scripts/menuBrowser)0
-rwxr-xr-xclient/shared/scripts/poweroff (renamed from client/nfsexport/scripts/poweroff)6
-rwxr-xr-xclient/shared/scripts/reboot (renamed from client/nfsexport/scripts/reboot)3
-rwxr-xr-xclient/shared/scripts/remoteConsole (renamed from client/nfsexport/scripts/remoteConsole)0
-rwxr-xr-xclient/shared/scripts/restoreImage (renamed from client/nfsexport/scripts/restoreImage)10
-rwxr-xr-xclient/shared/scripts/sendFileMcast (renamed from client/nfsexport/scripts/sendFileMcast)0
-rwxr-xr-xclient/shared/scripts/updateCache113
-rw-r--r--doc/CHANGELOG.es.txt126
-rw-r--r--doc/INSTALL.es.txt11
-rw-r--r--doc/VERSION.txt2
-rw-r--r--doc/filetree.es.txt38
-rw-r--r--doc/udeb.list120
-rwxr-xr-xinstaller/opengnsys_installer.sh354
-rwxr-xr-xinstaller/opengnsys_uninstall.sh5
-rwxr-xr-xinstaller/opengnsys_update.sh204
-rwxr-xr-xrepoman/bin/sendFileMcast14
-rwxr-xr-xrepoman/bin/torrent-creator18
-rwxr-xr-xrepoman/bin/torrent-tracker22
-rw-r--r--server/PXE/pxelinux.cfg/adminmode5
-rw-r--r--server/PXE/pxelinux.cfg/default5
-rw-r--r--server/etc/dhcpd.conf.tmpl (renamed from server/DHCP/dhcpd.conf)0
-rw-r--r--server/etc/exports.tmpl (renamed from server/NFS/exports)0
-rw-r--r--server/etc/smb-og.conf.tmpl37
-rw-r--r--server/lib/DBprocess.php319
-rw-r--r--server/tftpboot/pxelinux.0 (renamed from server/PXE/pxelinux.0)bin14776 -> 14776 bytes
-rw-r--r--server/tftpboot/pxelinux.cfg/default16
363 files changed, 11457 insertions, 18514 deletions
diff --git a/admin/Database/ogAdmBD-1.0pre-1.0.sql b/admin/Database/ogAdmBD-1.0pre-1.0.sql
new file mode 100644
index 00000000..652721c3
--- /dev/null
+++ b/admin/Database/ogAdmBD-1.0pre-1.0.sql
@@ -0,0 +1,24 @@
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+
+--
+-- Base de datos: `ogBDAdmin`
+--
+
+
+
+
+
+ALTER TABLE `aulas` CHANGE `modp2p` `modp2p` ENUM( 'seeder', 'peer', 'leecher' ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'peer';
+
+ALTER TABLE `aulas` CHANGE `velmul` `velmul` SMALLINT( 6 ) NOT NULL DEFAULT '70';
+
+
+ALTER TABLE `asistentes` DROP PRIMARY KEY ,
+ADD PRIMARY KEY ( `idcomando` , `descripcion` ) ;
+
+UPDATE `ogAdmBD`.`comandos` SET `activo` = '0' WHERE `comandos`.`idcomando` =10;
+
+UPDATE `ogAdmBD`.`asistentes` SET `idcomando` = '8' ;
+
+
+UPDATE `ogAdmBD`.`itemboot` SET `append` = 'APPEND initrd=ogclient/oginitrd.img ro boot=oginit vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=true ogdebug=true' WHERE `itemboot`.`label` = 'ogClientAdmin';
diff --git a/admin/Database/ogAdmBD.sql b/admin/Database/ogAdmBD.sql
index 48eb369d..e4639471 100644
--- a/admin/Database/ogAdmBD.sql
+++ b/admin/Database/ogAdmBD.sql
@@ -99,10 +99,46 @@ CREATE TABLE IF NOT EXISTS `aulas` (
`modomul` tinyint(4) NOT NULL,
`ipmul` varchar(16) NOT NULL,
`pormul` int(11) NOT NULL,
- `velmul` smallint(6) NOT NULL,
+ `velmul` smallint(6) NOT NULL DEFAULT '70',
+ `router` VARCHAR( 30 ),
+ `netmask` VARCHAR( 30 ),
+ `dns` VARCHAR (30),
+ `modp2p` enum('seeder','peer','leecher') DEFAULT 'peer',
+ `timep2p` INT(11) NOT NULL DEFAULT '60',
PRIMARY KEY (`idaula`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+
+
+--
+-- Estructura de tabla para la tabla `asistentes`
+--
+
+CREATE TABLE IF NOT EXISTS `asistentes` (
+ `idcomando` int(11) NOT NULL AUTO_INCREMENT,
+ `descripcion` varchar(250) NOT NULL DEFAULT '',
+ `pagina` varchar(256) NOT NULL,
+ `gestor` varchar(256) NOT NULL,
+ `funcion` varchar(64) NOT NULL,
+ `urlimg` varchar(250) DEFAULT NULL,
+ `aplicambito` tinyint(4) DEFAULT NULL,
+ `visuparametros` varchar(250) DEFAULT NULL,
+ `parametros` varchar(250) DEFAULT NULL,
+ `comentarios` text,
+ `activo` tinyint(1) NOT NULL,
+ PRIMARY KEY ( `idcomando` , `descripcion` )
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ;
+
+
+INSERT INTO `asistentes` (`idcomando`, `descripcion`, `pagina`, `gestor`, `funcion`, `urlimg`, `aplicambito`, `visuparametros`, `parametros`, `comentarios`, `activo`) VALUES
+('8', 'Asistente Clonacion Particiones Remotas', '../asistentes/AsistenteCloneRemotePartition.php', '../asistentes/gestores/gestor_Comandos.php', 'EjecutarScript', ' ', '31', 'iph;tis;dcr;dsp', 'nfn;iph;tis;dcr;scp', ' ', '1'),
+('8', 'Asistente "Deploy" de Imagenes', '../asistentes/AsistenteDeployImage.php', '../asistentes/gestores/gestor_Comandos.php', 'EjecutarScript', ' ', '31', 'iph;tis;dcr;dsp', 'nfn;iph;tis;dcr;scp', ' ', '1'),
+('8', 'Asistente "UpdateCache" con Imagenes', '../asistentes/AsistenteUpdateCache.php', '../asistentes/gestores/gestor_Comandos.php', 'EjecutarScript', ' ', '31', 'iph;tis;dcr;dsp', 'nfn;iph;tis;dcr;scp', ' ', '0'),
+('8', 'Asistente Restauracion de Imagenes', '../asistentes/AsistenteRestoreImage.php', '../asistentes/gestores/gestor_Comandos.php', 'EjecutarScript', ' ', '31', 'iph;tis;dcr;dsp', 'nfn;iph;tis;dcr;scp', ' ', '0'),
+('8', 'Asistente Particionado', '../asistentes/AsistenteParticionado.php', '../asistentes/gestores/gestor_Comandos.php', 'EjecutarScript', ' ', '31', 'iph;tis;dcr;dsp', 'nfn;iph;tis;dcr;scp', ' ', '1');
+
+
+
-- --------------------------------------------------------
--
@@ -181,7 +217,9 @@ INSERT INTO `comandos` (`idcomando`, `descripcion`, `pagina`, `gestor`, `funcion
(7, 'Inventario Software', '../comandos/InventarioSoftware.php', '../comandos/gestores/gestor_Comandos.php', 'InventarioSoftware', '', 16, 'par', 'nfn;iph;mac;par', '', 1),
(8, 'Ejecutar Script', '../comandos/EjecutarScripts.php', '../comandos/gestores/gestor_Comandos.php', 'EjecutarScript', '', 31, 'iph;tis;dcr;scp', 'nfn;iph;tis;dcr;scp', '', 1),
(9, 'Iniciar Sesion', '../comandos/IniciarSesion.php', '../comandos/gestores/gestor_Comandos.php', 'IniciarSesion', '', 31, 'par', 'nfn;iph;par', '', 1),
-(10, 'Particionar y Formatear', '../comandos/Configurar.php', '../comandos/gestores/gestor_Comandos.php', 'Configurar', '', 28, 'dsk;cfg;', 'nfn;iph;mac;dsk;cfg;par;cpt;sfi;tam;ope', '', 1);
+(10, 'Particionar y Formatear', '../comandos/Configurar.php', '../comandos/gestores/gestor_Comandos.php', 'Configurar', '', 28, 'dsk;cfg;', 'nfn;iph;mac;dsk;cfg;par;cpt;sfi;tam;ope', '', 0);
+
+
-- --------------------------------------------------------
@@ -432,9 +470,14 @@ CREATE TABLE IF NOT EXISTS `ordenadores` (
`router` varchar(16) NOT NULL,
`mascara` varchar(16) NOT NULL,
`idproautoexec` int(11) NOT NULL,
+ `arranque` VARCHAR( 30 ) NOT NULL DEFAULT '1',
+ `netiface` enum('eth0','eth1','eth2') DEFAULT 'eth0',
+ `netdriver` VARCHAR( 30 ) NOT NULL DEFAULT 'generic',
PRIMARY KEY (`idordenador`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+
+
-- --------------------------------------------------------
--
@@ -917,3 +960,59 @@ CREATE TABLE IF NOT EXISTS `usuarios` (
INSERT INTO `usuarios` (`idusuario`, `usuario`, `pasguor`, `nombre`, `email`, `ididioma`, `idtipousuario`) VALUES
(1, 'DBUSER', 'DBPASSWORD', 'Usuario de la base de datos MySql', '', 1, 1);
+
+CREATE TABLE IF NOT EXISTS `itemboot` (
+ `label` varchar(50) collate utf8_spanish_ci NOT NULL,
+ `kernel` varchar(100) collate utf8_spanish_ci NOT NULL,
+ `append` varchar(500) collate utf8_spanish_ci NOT NULL,
+ PRIMARY KEY (`label`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
+
+
+
+INSERT INTO `itemboot` (`label`, `kernel`, `append`) VALUES
+('1', 'KERNEL syslinux/chain.c32', 'APPEND hd0'),
+('1_localboot', 'LOCALBOOT 0', ' '),
+('11', 'KERNEL syslinux/chain.c32', 'APPEND hd0 1'),
+('12', 'KERNEL syslinux/chain.c32', 'APPEND hd0 2'),
+('ogClientUser', 'KERNEL ogclient/ogvmlinuz', 'APPEND initrd=ogclient/oginitrd.img ro boot=oginit vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=false'),
+('ogClientAdmin', 'KERNEL ogclient/ogvmlinuz', 'APPEND initrd=ogclient/oginitrd.img ro boot=oginit vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=true ogdebug=true'),
+('ogInitrdUser', 'KERNEL linux', 'APPEND initrd=initrd.gz ip=dhcp ro vga=788 irqpoll acpi=on boot=user '),
+('ogInitrdAdmin', 'KERNEL linux', 'APPEND initrd=initrd.gz ip=dhcp ro vga=788 irqpoll acpi=on boot=admin ');
+
+
+
+
+CREATE TABLE IF NOT EXISTS `menuboot` (
+ `label` varchar(50) collate utf8_spanish_ci NOT NULL,
+ `prompt` int(11) NOT NULL,
+ `timeout` int(30) default NULL,
+ `description` varchar(50) collate utf8_spanish_ci NOT NULL,
+ PRIMARY KEY (`label`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
+
+
+
+INSERT INTO `menuboot` (`label`, `prompt`, `timeout`, `description`) VALUES
+('1', 0, 10, 'mbr 1hd'),
+('11', 0, 10, '1hd 1particion'),
+('12', 0, 10, '1hd 2particion'),
+('pxe', 0, 10, 'og client - user'),
+('pxeADMIN', 0, 10, 'OgClient - admin');
+
+
+CREATE TABLE IF NOT EXISTS `menuboot_itemboot` (
+ `labelmenu` varchar(100) NOT NULL,
+ `labelitem` varchar(100) NOT NULL,
+ `default` tinyint(10) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+INSERT INTO `menuboot_itemboot` (`labelmenu`, `labelitem`, `default`) VALUES
+('0', '0', 0),
+('11', '11', 0),
+('12', '12', 0),
+('1', '1', 0),
+('pxe', 'ogClientUser', 0),
+('pxeADMIN', 'ogClientAdmin', 0);
+
diff --git a/admin/Interface/CambiarAcceso b/admin/Interface/CambiarAcceso
index 9c3f47fa..ddd67666 100755
--- a/admin/Interface/CambiarAcceso
+++ b/admin/Interface/CambiarAcceso
@@ -25,7 +25,13 @@ if ogIsRepoLocked; then
exit $?
fi
-# Comprobar modo de acceso.
+# Comprobar protocolo y modo de acceso.
+PROTO=${ogprotocol:-"smb"}
+case "$PROTO" in
+ nfs|smb) ;;
+ *) ogRaiseError $OG_ERR_FORMAT "protocolo desconocido $PROTO"
+ exit $? ;;
+esac
case "$1" in
admin) MODE="rw,nolock" ;;
user) MODE="ro,nolock" ;;
@@ -35,6 +41,9 @@ esac
# Desmontar repositorio y volver a montarlo con el modo adecuado.
umount $OGIMG
-ogEcho info "$PROG: Montar repositorio $REPO en modo $1"
-mount -t nfs -o $MODE $REPOIP:$OGIMG $OGIMG
+ogEcho info "$PROG: Montar repositorio $REPO por $PROTO en modo $1"
+case "$PROTO" in
+ nfs) mount -t nfs $REPOIP:$OGIMG $OGIMG -o $MODE ;;
+ smb) mount -t cifs //$REPOIP/ogimages $OGIMG -o $MODE,serverino,acl,username=opengnsys,password=og ;;
+esac
diff --git a/admin/Interface/CrearImagen b/admin/Interface/CrearImagen
index fb18c6f5..7625ab80 100755
--- a/admin/Interface/CrearImagen
+++ b/admin/Interface/CrearImagen
@@ -1,27 +1,40 @@
#!/bin/bash
-#_______________________________________________________________________________________________________________________________
+#___________________________________________________
#
# PARAMETROS RECIBIDOS DESDE EL CLIENTE:
-# $1 disco
-# $2 par=Nmero de particion
-# $3 Nombre cannico de la imagen
-# $4 Direccin del repositorio
-#_______________________________________________________________________________________________________________________________
+# $1 Número de disco
+# $2 Número de particion
+# $3 Nombre canónico de la imagen (sin extensión)
+# $4 Dirección del repositorio (REPO, por defecto)
+#___________________________________________________
-# Error si llamada no se realliza desde OpenGnSys Client.
+# Registro de ejecución
+echo $* >> $OGLOGFILE
+
+# Solo ejecutable por OpenGnSys Client.
PATH=$PATH:$(dirname $0)
PROG=$(basename $0)
CALLER=$(ogGetCaller)
if [ "$CALLER" != "ogAdmClient" ]; then
- ogRaiseError $OG_ERR_NOTEXEC "$CALLER -> $PROG"
- exit $?
+ ogRaiseError $OG_ERR_NOTEXEC "$CALLER -> $PROG"
+ exit $?
fi
-# Si modo "user"; activar repositorio para escritura, crear imagen y activar para lectura.
-[ "$boot" == "user" ] && CambiarAcceso admin
-createImage "$1" "$2" "REPO" "$3"
+# Valor por defecto para el repositorio.
+REPO=${4:-"REPO"}
+[ "$REPO" == "$(ogGetRepoIp)" ] && REPO="REPO"
+[ "$REPO" == "$(ogGetIpAddress)" ] && REPO="CACHE"
+
+# Si cleinte no está en modo "admin"; activar repositorio para escritura,
+# crear imagen y activar para lectura.
+[ "$boot" != "admin" ] && CambiarAcceso admin
+if [ -f createImage$ogengine ]; then
+ createImage$ogengine "$1" "$2" "$REPO" "$3" &>> $OGLOGFILE
+else
+ createImage "$1" "$2" "$REPO" "$3" &>> $OGLOGFILE
+fi
RETVAL=$?
-[ "$boot" == "user" ] && CambiarAcceso user
+[ "$boot" != "admin" ] && CambiarAcceso user
exit $RETVAL
diff --git a/admin/Interface/EjecutarScript b/admin/Interface/EjecutarScript
index 8925ac2b..101bd15f 100755
--- a/admin/Interface/EjecutarScript
+++ b/admin/Interface/EjecutarScript
@@ -1,3 +1,10 @@
#!/bin/bash
+
+echo -e >> $OGLOGFILE
+echo "Contenido de la ejecucion: *****************************" >> $OGLOGFILE
+cat $1 >> $OGLOGFILE
+echo -e >> $OGLOGFILE
+echo -e >> $OGLOGFILE
+echo "Salida: *****************************" >> $OGLOGFILE
chmod +x $1
-$1 || exit $?
+$1 &>> $OGLOGFILE || exit $?
diff --git a/admin/Interface/RestaurarImagen b/admin/Interface/RestaurarImagen
index 48f1e46a..6e2ed2f6 100755
--- a/admin/Interface/RestaurarImagen
+++ b/admin/Interface/RestaurarImagen
@@ -3,10 +3,19 @@
#
# PARAMETROS RECIBIDOS DESDE EL CLIENTE:
# $1 disco
-# $2 par=Nmero de particion
-# $3 Nombre cannico de la imagen
-# $4 Direccin del repositorio
+# $2 par=N�mero de particion
+# $3 Nombre can�nico de la imagen
+# $4 Direcci�n del repositorio
#_______________________________________________________________________________________________________________________________
-ogRestoreImage REPO $3 $1 $2 UNICAST
+echo $* >> $OGLOGFILE
+echo $* >> $OGLOGFILE
+if [ -f createImage$ogengine ]
+then
+ restoreImage$ogengine REPO $3 $1 $2 UNICAST &>> $OGLOGFILE || exit $?
+else
+ restoreImage REPO $3 $1 $2 UNICAST &>> $OGLOGFILE || exit $?
+fi
+
+
diff --git a/admin/Sources/Services/ogAdmRepoAux b/admin/Sources/Services/ogAdmRepoAux
new file mode 100755
index 00000000..9dd4b0bb
--- /dev/null
+++ b/admin/Sources/Services/ogAdmRepoAux
@@ -0,0 +1,51 @@
+#!/bin/bash
+PARM=`cat`
+
+#TODO: ticket 379
+#buscar parametro de identificador de operacion.
+#usar parametro de identificacion para anexarlo al nombre de log
+#Comprobar si la variable está seteas.
+#Si no lo está setearla.
+#Si esta seteada (en progreso) salir.
+
+
+
+BASEDIR=/opt/opengnsys
+REPONAME=ogAdmRepo
+REPOLOG=$BASEDIR/log/$REPONAME.log
+MCASTLOGBASE=$BASEDIR/log/mcastlog
+MCASTLOG=$MCASTLOGBASE/ogAdmRepoMcast.`date +%Y%m%d-%H%M%S`
+
+mkdir -p $MCASTLOGBASE
+
+PARM1=$(echo $PARM | cut -f1 -d" ")
+PARM2=$(echo $PARM | cut -f2 -d" ")
+PARM3=$(echo $PARM | cut -f3 -d" ")
+PARM4=$(echo $PARM | cut -f4 -d" ")
+
+
+case $PARM1 in
+ START_MULTICAST)
+ #1 START_MULTICAST
+ #2 fichero a enviar
+ #3 opciones de multicast
+ FILE=/opt/opengnsys/images$PARM2
+ MCASTOPT=$PARM3
+ echo `date +%Y%m%d-%H%M%S` "/opt/opengnsys/bin/sendFileMcast $FILE $MCASTOPT" >> $REPOLOG
+ /opt/opengnsys/bin/sendFileMcast $FILE $MCASTOPT &>> $MCASTLOG
+ case $? in
+ 1)
+ echo `date +%Y%m%d-%H%M%S` Parametros insuficientes >> $REPOLOG
+ ;;
+ 2)
+ echo `date +%Y%m%d-%H%M%S` Fichero no accesible >> $REPOLOG
+ ;;
+ 3)
+ echo `date +%Y%m%d-%H%M%S` sesion multicast no valida >> $REPOLOG
+ ;;
+ esac
+ ;;
+ default)
+ echo "Solicitud con parametros: - $PARM - no realizada: No registrada o con errores" >> $REPOLOG
+ ;;
+esac \ No newline at end of file
diff --git a/admin/Sources/Services/opengnsys.default b/admin/Sources/Services/opengnsys.default
index b8d4f00d..24d24265 100644
--- a/admin/Sources/Services/opengnsys.default
+++ b/admin/Sources/Services/opengnsys.default
@@ -4,5 +4,6 @@
# RUN_BTSEEDER starts seeding of selected torrent files
RUN_OGADMSERVER="yes"
RUN_OGADMREPO="yes"
+RUN_OGADMAGENT="yes"
RUN_BTTRACKER="yes"
RUN_BTSEEDER="yes"
diff --git a/admin/Sources/Services/opengnsys.init b/admin/Sources/Services/opengnsys.init
index ba08c7ad..a195301e 100755
--- a/admin/Sources/Services/opengnsys.init
+++ b/admin/Sources/Services/opengnsys.init
@@ -1,6 +1,6 @@
#! /bin/sh
-##################################################################################################################
+##########1.0######################################################################################################
####### Script de arranque de los servicios de OpenGnSys: Servidor ogAdmServer, Servidor de repositorio ogAdmRepo,
####### Tracker Bittorrent y seeder de imagenes por Bittorrent
####### autor: jcxifre <jcxifre@unizar.es>
@@ -40,6 +40,20 @@ REPODAEMON=$BASEDIR/sbin/$REPONAME
REPOCFG=$BASEDIR/etc/$REPONAME.cfg
REPOLOG=$BASEDIR/log/$REPONAME.log
REPODAEMON_OPTIONS="-f $REPOCFG -l $REPOLOG"
+############## ADV
+REPOAUXNAME=ogAdmRepoAux
+REPOAUXDAEMON=$BASEDIR/sbin/$REPOAUXNAME
+REPOAUXPORT=$((`cat $SERVERCFG | grep PUERTO | cut -f2 -d"="` + 1))
+############## ADV
+
+#
+# Servidor de tareas programadas
+#
+AGENTNAME=ogAdmAgent
+AGENTDAEMON=$BASEDIR/sbin/$AGENTNAME
+AGENTCFG=$BASEDIR/etc/$AGENTNAME.cfg
+AGENTLOG=$BASEDIR/log/$AGENTNAME.log
+AGENTDAEMON_OPTIONS="-f $AGENTCFG -l $AGENTLOG"
#
# Opciones Bittorrent
@@ -83,7 +97,18 @@ arranca_demonios() {
echo -n "Iniciando demonio: "$REPONAME
start-stop-daemon --start --quiet --background --exec $REPODAEMON -- $REPODAEMON_OPTIONS
echo "."
+ ############ ADV
+ echo -n "Iniciando demonio: "$REPOAUXNAME
+ faucet $REPOAUXPORT --daemon --in bash -c "$REPOAUXDAEMON"
+ echo "."
+ ############ ADV
fi
+ if [ $RUN_OGADMAGENT = "yes" ]
+ then
+ echo -n "Iniciando demonio: "$AGENTNAME $AGENTDAEMON
+ start-stop-daemon --start --quiet --background --exec $AGENTDAEMON -- $AGENTDAEMON_OPTIONS
+ echo "."
+ fi
if [ $RUN_BTTRACKER = "yes" ]
then
echo -n "Iniciando demonio: "$BTTRACK
@@ -113,10 +138,17 @@ para_demonios() {
start-stop-daemon --stop --quiet --oknodo --pidfile $BTTRACKPID
echo "."
rm $BTTRACKPID > /dev/null
- fi
+ fi
+ echo -n "Parando demonio: "$AGENTNAME
+ start-stop-daemon --stop --quiet --oknodo --name $AGENTNAME
+ echo "."
echo -n "Parando demonio: "$REPONAME
start-stop-daemon --stop --quiet --oknodo --name $REPONAME
echo "."
+ ############# ADV
+ echo -n "Parando demonio: "$REPOAUXNAME
+ pkill faucet
+ ############ ADV
echo -n "Parando demonio: "$SERVERNAME
start-stop-daemon --stop --quiet --oknodo --name $SERVERNAME
echo "."
diff --git a/admin/WebConsole/asistentes/AsistenteCloneRemotePartition.php b/admin/WebConsole/asistentes/AsistenteCloneRemotePartition.php
new file mode 100644
index 00000000..6966d9d7
--- /dev/null
+++ b/admin/WebConsole/asistentes/AsistenteCloneRemotePartition.php
@@ -0,0 +1,112 @@
+<?php
+// *************************************************************************************************************************************************
+// Aplicacion WEB: ogAdmWebCon
+// Autor: Antonio J. Doblas Viso
+// Baso en Codigo Comando.php de : Jose Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Xajax
+// *************************************************************************************************************************************************
+
+
+require_once('xajax.common.php');
+//Haciendo referencia a las funciones registradas y que seran interpretadas como funciones javascript
+
+
+
+/********HACIENDO CONSULTA A LA TABLA ordenadores***********/
+include_once("../includes/ctrlacc.php");
+include_once("../clases/AdoPhp.php");
+include_once("../includes/constantes.php");
+include_once("../includes/comunes.php");
+include_once("../includes/CreaComando.php");
+include_once("../includes/HTMLSELECT.php");
+include_once("../idiomas/php/".$idioma."/comandos/ejecutarscripts_".$idioma.".php");
+//________________________________________________________________________________________________________
+include_once("./includes/capturaacciones.php");
+//________________________________________________________________________________________________________
+//________________________________________________________________________________________________________
+$cmd=CreaComando($cadenaconexion);
+if (!$cmd)
+ Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
+//________________________________________________________________________________________________________
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title> Administración web de aulas </title>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ <LINK rel="stylesheet" type="text/css" href="../estilos.css">
+ <SCRIPT language="javascript" src="./jscripts/EjecutarScripts.js"></SCRIPT>
+ <SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
+ <SCRIPT language="javascript" src="./jscripts/asistentes.js"></SCRIPT>
+ <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/ejecutarscripts_'.$idioma.'.js"></SCRIPT>'?>
+ <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
+<?php
+//indicamos al objeto xajax se encargue de generar el javascript de las funciones registradas por ejm: ListarParticionesXip
+$xajax->printJavascript('../xajax/');
+?>
+</head>
+
+
+<body>
+<?
+switch($ambito){
+ case $AMBITO_CENTROS :
+ $urlimg='../images/iconos/centros.gif';
+ $textambito=$TbMsg[0];
+ break;
+ case $AMBITO_GRUPOSAULAS :
+ $urlimg='../images/iconos/carpeta.gif';
+ $textambito=$TbMsg[1];
+ break;
+ case $AMBITO_AULAS :
+ $urlimg='../images/iconos/aula.gif';
+ $textambito=$TbMsg[2];
+ if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+ break;
+ case $AMBITO_GRUPOSORDENADORES :
+ $urlimg='../images/iconos/carpeta.gif';
+ $textambito=$TbMsg[3];
+ break;
+ case $AMBITO_ORDENADORES :
+ $urlimg='../images/iconos/ordenador.gif';
+ $textambito=$TbMsg[4];
+ break;
+ }
+ echo '<p align=center><span class=cabeceras>'.$descricomando.'&nbsp;</span><br>';
+ echo '<IMG src="'.$urlimg.'">&nbsp;&nbsp;<span align=center class=subcabeceras>
+ <U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span>&nbsp;&nbsp;</span></p>';
+ ?>
+
+
+ <form align=center name="fdatos" >
+
+
+
+ <table align=center class=tabla_datos border="0" cellpadding="0" cellspacing="1">
+ <?
+ include_once("./includes/asistentes/AyudanteFormularios.php");
+ include_once("./includes/asistentes/formCloneRemotePartition.php");
+?>
+
+
+
+ <tr>
+ <th><INPUT TYPE="button" NAME="GenerarInstruccion" Value="Generar InstruccionOG" onClick="codeCloneRemotePartition(this.form)"> </th>
+ <td colspan="5"><textarea class="cajatexto" name="codigo" cols="70" rows="7"></textarea></td>
+ </tr>
+ </table>
+ </form>
+
+<?
+ //________________________________________________________________________________________________________
+ include_once("./includes/formularioacciones.php");
+ //________________________________________________________________________________________________________
+ //________________________________________________________________________________________________________
+ include_once("./includes/opcionesacciones.php");
+ //________________________________________________________________________________________________________
+?>
+
+
+</body>
+</html> \ No newline at end of file
diff --git a/admin/WebConsole/asistentes/AsistenteDeployImage.php b/admin/WebConsole/asistentes/AsistenteDeployImage.php
new file mode 100644
index 00000000..d7dfc695
--- /dev/null
+++ b/admin/WebConsole/asistentes/AsistenteDeployImage.php
@@ -0,0 +1,138 @@
+<?php
+// *************************************************************************************************************************************************
+// Aplicacion WEB: ogAdmWebCon
+// Autor:
+// Baso en Codigo Comando.php de : Jose Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Xajax
+// *************************************************************************************************************************************************
+
+
+require_once('xajax.common.php');
+//Haciendo referencia a las funciones registradas y que seran interpretadas como funciones javascript
+
+
+
+/********HACIENDO CONSULTA A LA TABLA ordenadores***********/
+include_once("../includes/ctrlacc.php");
+include_once("../clases/AdoPhp.php");
+include_once("../includes/constantes.php");
+include_once("../includes/comunes.php");
+include_once("../includes/CreaComando.php");
+include_once("../includes/HTMLSELECT.php");
+include_once("../idiomas/php/".$idioma."/comandos/ejecutarscripts_".$idioma.".php");
+
+
+
+include_once("../includes/HTMLCTESELECT.php");
+include_once("../includes/TomaDato.php");
+include_once("../includes/ConfiguracionesParticiones.php");
+include_once("../includes/RecopilaIpesMacs.php");
+
+include_once("./includes/asistentes/AyudanteFormularios.php");
+
+
+//________________________________________________________________________________________________________
+include_once("./includes/capturaacciones.php");
+//________________________________________________________________________________________________________
+//________________________________________________________________________________________________________
+$cmd=CreaComando($cadenaconexion);
+if (!$cmd)
+ Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
+//________________________________________________________________________________________________________
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title> Administración web de aulas </title>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ <LINK rel="stylesheet" type="text/css" href="../estilos.css">
+ <SCRIPT language="javascript" src="./jscripts/EjecutarScripts.js"></SCRIPT>
+ <SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
+ <SCRIPT language="javascript" src="./jscripts/asistentes.js"></SCRIPT>
+ <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/ejecutarscripts_'.$idioma.'.js"></SCRIPT>'?>
+ <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
+
+
+<?php
+//indicamos al objeto xajax se encargue de generar el javascript de las funciones registradas por ejm: ListarParticionesXip
+$xajax->printJavascript('../xajax/');
+?>
+</head>
+
+
+<body>
+<?
+# ambito: 4->aulas 16->ordenadores
+# idambito: id de los elementos en su correspondiente tabla-ambito (aulas, ordenadores...)
+# nombreambito: nombre del elemento.
+
+switch($ambito){
+ case $AMBITO_CENTROS :
+ $urlimg='../images/iconos/centros.gif';
+ $textambito=$TbMsg[0];
+ break;
+ case $AMBITO_GRUPOSAULAS :
+ $urlimg='../images/iconos/carpeta.gif';
+ $textambito=$TbMsg[1];
+ break;
+ case $AMBITO_AULAS :
+ $urlimg='../images/iconos/aula.gif';
+ $textambito=$TbMsg[2];
+ if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+ if (isset($_GET["litambito"])) $litambito=$_GET["litambito"];
+ break;
+ case $AMBITO_GRUPOSORDENADORES :
+ $urlimg='../images/iconos/carpeta.gif';
+ $textambito=$TbMsg[3];
+ break;
+ case $AMBITO_ORDENADORES :
+ $urlimg='../images/iconos/ordenador.gif';
+ $textambito=$TbMsg[4];
+ if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+ if (isset($_GET["litambito"])) $litambito=$_GET["litambito"];
+ break;
+ }
+ echo '<p align=center><span class=cabeceras>'.$descricomando.'&nbsp;</span><br>';
+ echo '<IMG src="'.$urlimg.'">&nbsp;&nbsp;<span align=center class=subcabeceras>
+ <U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span>&nbsp;&nbsp;</span></p>';
+
+ $sws=$fk_sysFi | $fk_nombreSO | $fk_tamano | $fk_imagen | $fk_perfil;
+ pintaConfiguraciones($cmd,$idambito,$ambito,7,$sws,false);
+
+ ?>
+
+
+ <form align=center name="fdatos" >
+
+
+
+ <table class=tabla_datos border="0" cellpadding="0" cellspacing="1">
+ <?
+ include_once("./includes/asistentes/formDeployImage.php");
+ ?>
+
+ <tr>
+ <th ><INPUT TYPE="button" NAME="GenerarInstruccion" Value="Generar InstruccionOG" onClick="codeDeployImage(this.form)"> </th>
+ <td colspan="5"><textarea class="cajatexto" name="codigo" cols="70" rows="7"></textarea></td>
+ </tr>
+ </table>
+ </form>
+
+<?
+ //________________________________________________________________________________________________________
+ include_once("./includes/formularioacciones.php");
+ //________________________________________________________________________________________________________
+ //________________________________________________________________________________________________________
+ include_once("./includes/opcionesacciones.php");
+ //________________________________________________________________________________________________________
+
+
+
+
+
+?>
+
+
+</body>
+</html> \ No newline at end of file
diff --git a/admin/WebConsole/asistentes/AsistenteParticionado.php b/admin/WebConsole/asistentes/AsistenteParticionado.php
new file mode 100644
index 00000000..de1b5f72
--- /dev/null
+++ b/admin/WebConsole/asistentes/AsistenteParticionado.php
@@ -0,0 +1,136 @@
+<?php
+// *************************************************************************************************************************************************
+// Aplicacion WEB: ogAdmWebCon
+// Autor: Antonio J. Doblas Viso
+// Baso en Codigo Comando.php de : Jose Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Xajax
+// *************************************************************************************************************************************************
+
+
+require_once('xajax.common.php');
+//Haciendo referencia a las funciones registradas y que seran interpretadas como funciones javascript
+
+
+
+/********HACIENDO CONSULTA A LA TABLA ordenadores***********/
+include_once("../includes/ctrlacc.php");
+include_once("../clases/AdoPhp.php");
+include_once("../includes/constantes.php");
+include_once("../includes/comunes.php");
+include_once("../includes/CreaComando.php");
+include_once("../includes/HTMLSELECT.php");
+include_once("../idiomas/php/".$idioma."/comandos/ejecutarscripts_".$idioma.".php");
+include_once("../idiomas/php/".$idioma."/configuraciones_".$idioma.".php");
+include_once("../includes/HTMLCTESELECT.php");
+include_once("../includes/TomaDato.php");
+include_once("../includes/ConfiguracionesParticiones.php");
+include_once("../includes/RecopilaIpesMacs.php");
+
+ include_once("./includes/asistentes/AyudanteFormularios.php");
+
+
+//________________________________________________________________________________________________________
+include_once("./includes/capturaacciones.php");
+//________________________________________________________________________________________________________
+//________________________________________________________________________________________________________
+$cmd=CreaComando($cadenaconexion);
+if (!$cmd)
+ Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
+//________________________________________________________________________________________________________
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title> Administración web de aulas </title>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ <LINK rel="stylesheet" type="text/css" href="../estilos.css">
+ <SCRIPT language="javascript" src="./jscripts/EjecutarScripts.js"></SCRIPT>
+ <SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
+ <SCRIPT language="javascript" src="./jscripts/asistentes.js"></SCRIPT>
+ <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/ejecutarscripts_'.$idioma.'.js"></SCRIPT>'?>
+ <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
+
+
+<?php
+//indicamos al objeto xajax se encargue de generar el javascript de las funciones registradas por ejm: ListarParticionesXip
+$xajax->printJavascript('../xajax/');
+?>
+</head>
+
+
+<body>
+<?
+switch($ambito){
+ case $AMBITO_CENTROS :
+ $urlimg='../images/iconos/centros.gif';
+ $textambito=$TbMsg[0];
+ break;
+ case $AMBITO_GRUPOSAULAS :
+ $urlimg='../images/iconos/carpeta.gif';
+ $textambito=$TbMsg[1];
+ break;
+ case $AMBITO_AULAS :
+ $urlimg='../images/iconos/aula.gif';
+ $textambito=$TbMsg[2];
+ if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+ break;
+ case $AMBITO_GRUPOSORDENADORES :
+ $urlimg='../images/iconos/carpeta.gif';
+ $textambito=$TbMsg[3];
+ break;
+ case $AMBITO_ORDENADORES :
+ $urlimg='../images/iconos/ordenador.gif';
+ $textambito=$TbMsg[4];
+ break;
+ }
+
+ //echo '<p align=center><span class=cabeceras>'.$descricomando.'&nbsp;</span><br>';
+ //echo '<IMG src="'.$urlimg.'">&nbsp;&nbsp;<span align=center class=subcabeceras>
+ // <U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span>&nbsp;&nbsp;</span></p>';
+
+ if(!$swp){
+ echo '<p align=center><span class=cabeceras>'.$descricomando.'&nbsp;</span><br>';
+ echo '<IMG src="'.$urlimg.'">&nbsp;&nbsp;<span align=center class=subcabeceras><U>'.$TbMsg[1].'
+ : '.$textambito.'</U></span>&nbsp;&nbsp;</span></p>';
+ }
+
+ $sws=$fk_sysFi | $fk_nombreSO | $fk_tamano | $fk_imagen | $fk_perfil;
+ pintaConfiguraciones($cmd,$idambito,$ambito,7,$sws,false);
+
+ ?>
+
+
+ <form align=center name="fdatos" >
+
+
+
+ <table class=tabla_datos border="0" cellpadding="0" cellspacing="1">
+ <?
+ include_once("./includes/asistentes/formParticionado.php");
+?>
+
+ <tr>
+ <th colspan="5"><INPUT TYPE="button" NAME="GenerarInstruccion" Value="Generar InstruccionOG" onClick="codeParticionado(this.form)"> </th>
+ <td><textarea class="cajatexto" name="codigo" cols="70" rows="7"></textarea></td>
+ </tr>
+ </table>
+ </form>
+
+<?
+ //________________________________________________________________________________________________________
+ include_once("./includes/formularioacciones.php");
+ //________________________________________________________________________________________________________
+ //________________________________________________________________________________________________________
+ include_once("./includes/opcionesacciones.php");
+ //________________________________________________________________________________________________________
+
+
+
+
+
+?>
+
+
+</body>
+</html> \ No newline at end of file
diff --git a/admin/WebConsole/asistentes/AsistenteUpdateCache.php b/admin/WebConsole/asistentes/AsistenteUpdateCache.php
new file mode 100644
index 00000000..7e06210f
--- /dev/null
+++ b/admin/WebConsole/asistentes/AsistenteUpdateCache.php
@@ -0,0 +1,138 @@
+<?php
+// *************************************************************************************************************************************************
+// Aplicacion WEB: ogAdmWebCon
+// Autor:
+// Baso en Codigo Comando.php de : Jose Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Xajax
+// *************************************************************************************************************************************************
+
+
+require_once('xajax.common.php');
+//Haciendo referencia a las funciones registradas y que seran interpretadas como funciones javascript
+
+
+
+/********HACIENDO CONSULTA A LA TABLA ordenadores***********/
+include_once("../includes/ctrlacc.php");
+include_once("../clases/AdoPhp.php");
+include_once("../includes/constantes.php");
+include_once("../includes/comunes.php");
+include_once("../includes/CreaComando.php");
+include_once("../includes/HTMLSELECT.php");
+include_once("../idiomas/php/".$idioma."/comandos/ejecutarscripts_".$idioma.".php");
+
+
+
+include_once("../includes/HTMLCTESELECT.php");
+include_once("../includes/TomaDato.php");
+include_once("../includes/ConfiguracionesParticiones.php");
+include_once("../includes/RecopilaIpesMacs.php");
+
+include_once("./includes/asistentes/AyudanteFormularios.php");
+
+
+//________________________________________________________________________________________________________
+include_once("./includes/capturaacciones.php");
+//________________________________________________________________________________________________________
+//________________________________________________________________________________________________________
+$cmd=CreaComando($cadenaconexion);
+if (!$cmd)
+ Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
+//________________________________________________________________________________________________________
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title> Administración web de aulas </title>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ <LINK rel="stylesheet" type="text/css" href="../estilos.css">
+ <SCRIPT language="javascript" src="./jscripts/EjecutarScripts.js"></SCRIPT>
+ <SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
+ <SCRIPT language="javascript" src="./jscripts/asistentes.js"></SCRIPT>
+ <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/ejecutarscripts_'.$idioma.'.js"></SCRIPT>'?>
+ <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
+
+
+<?php
+//indicamos al objeto xajax se encargue de generar el javascript de las funciones registradas por ejm: ListarParticionesXip
+$xajax->printJavascript('../xajax/');
+?>
+</head>
+
+
+<body>
+<?
+# ambito: 4->aulas 16->ordenadores
+# idambito: id de los elementos en su correspondiente tabla-ambito (aulas, ordenadores...)
+# nombreambito: nombre del elemento.
+
+switch($ambito){
+ case $AMBITO_CENTROS :
+ $urlimg='../images/iconos/centros.gif';
+ $textambito=$TbMsg[0];
+ break;
+ case $AMBITO_GRUPOSAULAS :
+ $urlimg='../images/iconos/carpeta.gif';
+ $textambito=$TbMsg[1];
+ break;
+ case $AMBITO_AULAS :
+ $urlimg='../images/iconos/aula.gif';
+ $textambito=$TbMsg[2];
+ if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+ if (isset($_GET["litambito"])) $litambito=$_GET["litambito"];
+ break;
+ case $AMBITO_GRUPOSORDENADORES :
+ $urlimg='../images/iconos/carpeta.gif';
+ $textambito=$TbMsg[3];
+ break;
+ case $AMBITO_ORDENADORES :
+ $urlimg='../images/iconos/ordenador.gif';
+ $textambito=$TbMsg[4];
+ if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+ if (isset($_GET["litambito"])) $litambito=$_GET["litambito"];
+ break;
+ }
+ echo '<p align=center><span class=cabeceras>'.$descricomando.'&nbsp;</span><br>';
+ echo '<IMG src="'.$urlimg.'">&nbsp;&nbsp;<span align=center class=subcabeceras>
+ <U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span>&nbsp;&nbsp;</span></p>';
+
+ $sws=$fk_sysFi | $fk_nombreSO | $fk_tamano | $fk_imagen | $fk_perfil;
+ pintaConfiguraciones($cmd,$idambito,$ambito,7,$sws,false);
+
+ ?>
+
+
+ <form align=center name="fdatos" >
+
+
+
+ <table class=tabla_datos border="0" cellpadding="0" cellspacing="1">
+ <?
+ include_once("./includes/asistentes/formDeployImage.php");
+ ?>
+
+ <tr>
+ <th ><INPUT TYPE="button" NAME="GenerarInstruccion" Value="Generar InstruccionOG" onClick="codeDeployImage(this.form)"> </th>
+ <td colspan="5"><textarea class="cajatexto" name="codigo" cols="70" rows="7"></textarea></td>
+ </tr>
+ </table>
+ </form>
+
+<?
+ //________________________________________________________________________________________________________
+ include_once("./includes/formularioacciones.php");
+ //________________________________________________________________________________________________________
+ //________________________________________________________________________________________________________
+ include_once("./includes/opcionesacciones.php");
+ //________________________________________________________________________________________________________
+
+
+
+
+
+?>
+
+
+</body>
+</html>
diff --git a/admin/WebConsole/asistentes/gestores/gestor_Comandos.php b/admin/WebConsole/asistentes/gestores/gestor_Comandos.php
new file mode 100644
index 00000000..5425ea81
--- /dev/null
+++ b/admin/WebConsole/asistentes/gestores/gestor_Comandos.php
@@ -0,0 +1,285 @@
+<?
+// *************************************************************************************************************************************************
+// Aplicación WEB: ogAdmWebCon
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: Año 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: gestor_Comandos.php
+// Descripción :
+// Gestor de todos los comandos
+// *************************************************************************************************************************************************
+include_once("../../includes/ctrlacc.php");
+include_once("../../clases/AdoPhp.php");
+include_once("../../clases/SockHidra.php");
+include_once("../../includes/constantes.php");
+include_once("../../includes/comunes.php");
+include_once("../../includes/cuestionacciones.php");
+include_once("../../includes/CreaComando.php");
+include_once("../../includes/RecopilaIpesMacs.php");
+//________________________________________________________________________________________________________
+include_once("../includes/capturaacciones.php");
+//________________________________________________________________________________________________________
+
+ // Recoge parametros de seguimiento
+$sw_ejya="";
+$sw_seguimiento="";
+
+$sw_mkprocedimiento="";
+$nombreprocedimiento="";
+$idprocedimiento="";
+$ordprocedimiento=0;
+
+$sw_mktarea="";
+$nombretarea="";
+$idtarea="";
+$ordtarea=0;
+
+if (isset($_POST["sw_ejya"])) $sw_ejya=$_POST["sw_ejya"];
+if (isset($_POST["sw_seguimiento"])) $sw_seguimiento=$_POST["sw_seguimiento"];
+
+if (isset($_POST["sw_ejprg"])) $sw_ejprg=$_POST["sw_ejprg"];
+
+if (isset($_POST["sw_mkprocedimiento"])) $sw_mkprocedimiento=$_POST["sw_mkprocedimiento"];
+if (isset($_POST["nombreprocedimiento"])) $nombreprocedimiento=$_POST["nombreprocedimiento"];
+if (isset($_POST["idprocedimiento"])) $idprocedimiento=$_POST["idprocedimiento"];
+if (isset($_POST["ordprocedimiento"])) $ordprocedimiento=$_POST["ordprocedimiento"];
+if(empty($ordprocedimiento)) $ordprocedimiento=0;
+
+if (isset($_POST["sw_mktarea"])) $sw_mktarea=$_POST["sw_mktarea"];
+if (isset($_POST["nombretarea"])) $nombretarea=$_POST["nombretarea"];
+if (isset($_POST["idtarea"])) $idtarea=$_POST["idtarea"];
+if (isset($_POST["ordtarea"])) $ordtarea=$_POST["ordtarea"];
+if(empty($ordtarea)) $ordtarea=0;
+
+//__________________________________________________________________
+$cmd=CreaComando($cadenaconexion);
+if (!$cmd)
+ Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
+//__________________________________________________________________
+$funcion="nfn=".$funcion.chr(13); // Nombre de la función que procesa el comando y el script que lo implementa
+$aplicacion=""; // Ámbito de aplicación (cadena de ipes separadas por ";" y de identificadores de ordenadores por ","
+$acciones=""; // Cadena de identificadores de acciones separadas por ";" para seguimiento
+
+$atributos=str_replace('@',chr(13),$atributos); // Reemplaza caracters
+$atributos=str_replace('#',chr(10),$atributos);
+$atributos=str_replace('$',chr(9),$atributos);
+
+//__________________________________________________________________
+?>
+<HTML>
+<HEAD>
+ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<BODY>
+ <SCRIPT language="javascript" src="../jscripts/comunescomandos.js"></SCRIPT>
+ <? echo '<SCRIPT language="javascript" src="../../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
+<?
+
+/* Recopila identificadore ,ipes y macs para envío de comandos */
+$cadenaid="";
+$cadenaip="";
+$cadenamac="";
+RecopilaIpesMacs($cmd,$ambito,$idambito);
+
+/*--------------------------------------------------------------------------------------------------------------------
+ Creación de parametros para sentencias SQL
+--------------------------------------------------------------------------------------------------------------------*/
+$cmd->CreaParametro("@tipoaccion",0,1);
+$cmd->CreaParametro("@idtipoaccion",0,1);
+$cmd->CreaParametro("@descriaccion","",0);
+$cmd->CreaParametro("@idordenador",0,1);
+$cmd->CreaParametro("@ip","",0);
+$cmd->CreaParametro("@sesion",0,1);
+$cmd->CreaParametro("@parametros","",0);
+$cmd->CreaParametro("@fechahorareg","",0);
+$cmd->CreaParametro("@estado",0,1);
+$cmd->CreaParametro("@resultado",0,1);
+$cmd->CreaParametro("@idcentro",0,1);
+$cmd->CreaParametro("@idprocedimiento",0,1);
+$cmd->CreaParametro("@descripcion","",0);
+$cmd->CreaParametro("@idcomando",0,1);
+$cmd->CreaParametro("@idtarea",0,1);
+$cmd->CreaParametro("@ambito",0,1);
+$cmd->CreaParametro("@idambito",0,1);
+$cmd->CreaParametro("@restrambito","",0);
+$cmd->CreaParametro("@ordprocedimiento",0,1);
+$cmd->CreaParametro("@ordtarea",0,1);
+
+if($ambito==0){ // Ambito restringido a un subconjuto de ordenadores con formato (idordenador1,idordenador2,etc)
+ $cmd->ParamSetValor("@restrambito",$idambito);
+ $idambito=0;
+}
+$resul=true;
+/*--------------------------------------------------------------------------------------------------------------------
+ Switch de ejecución inmediata y de seguimiento
+--------------------------------------------------------------------------------------------------------------------*/
+if($sw_ejya=='on' || $sw_ejprg=="on" ){
+ $parametros=$funcion.$atributos;
+ $aplicacion=chr(13)."ido=".$cadenaid.chr(13)."mac=".$cadenamac.chr(13)."iph=".$cadenaip.chr(13);
+ if($sw_seguimiento==1 || $sw_ejprg=="on"){ // Switch de ejecución con seguimiento o comando programado
+ $sesion=time();
+ $cmd->ParamSetValor("@tipoaccion",$EJECUCION_COMANDO);
+ $cmd->ParamSetValor("@idtipoaccion",$idcomando);
+ $cmd->ParamSetValor("@descriaccion",$descricomando);
+ $cmd->ParamSetValor("@sesion",$sesion);
+ $cmd->ParamSetValor("@idcomando",$idcomando);
+ $cmd->ParamSetValor("@parametros",$parametros);
+ $cmd->ParamSetValor("@fechahorareg",date("y/m/d H:i:s"));
+ if($sw_ejprg=="on") // Switch de ejecución con programación (se para el comando tarea para lanzarlo posteriormente)
+ $cmd->ParamSetValor("@estado",$ACCION_DETENIDA);
+ else
+ $cmd->ParamSetValor("@estado",$ACCION_INICIADA);
+ $cmd->ParamSetValor("@resultado",$ACCION_SINRESULTADO);
+ $cmd->ParamSetValor("@ambito",$ambito);
+ $cmd->ParamSetValor("@idambito",$idambito);
+ $cmd->ParamSetValor("@idcentro",$idcentro);
+ $auxID=split(",",$cadenaid);
+ $auxIP=split(";",$cadenaip);
+
+ for ($i=0;$i<sizeof($auxID);$i++){
+ $cmd->ParamSetValor("@idordenador",$auxID[$i]);
+ $cmd->ParamSetValor("@ip",$auxIP[$i]);
+ $cmd->texto="INSERT INTO acciones (idordenador,tipoaccion,idtipoaccion,descriaccion,ip,
+ sesion,idcomando,parametros,fechahorareg,estado,resultado,ambito,idambito,restrambito,idcentro)
+ VALUES (@idordenador,@tipoaccion,@idtipoaccion,@descriaccion,@ip,
+ @sesion,@idcomando,@parametros,@fechahorareg,@estado,@resultado,@ambito,@idambito,@restrambito,@idcentro)";
+ $resul=$cmd->Ejecutar();
+ //echo "<br>".$cmd->texto;
+ }
+ $acciones=chr(13)."ids=".$sesion.chr(13); // Para seguimiento
+ }
+ if (!$resul){
+ echo '<SCRIPT language="javascript">';
+ echo 'resultado_comando(7);'.chr(13);
+ echo '</SCRIPT>';
+ }
+ else{
+ if($sw_ejya=='on'){
+ // Envio al servidor
+ $shidra=new SockHidra($servidorhidra,$hidraport);
+ if ($shidra->conectar()){ // Se ha establecido la conexión con el servidor hidra
+ $parametros.=$aplicacion;
+ $parametros.=$acciones;
+ //echo $parametros;
+ $resul=$shidra->envia_comando($parametros);
+ if($resul)
+ $trama=$shidra->recibe_respuesta();
+ if($resul){
+ $hlonprm=hexdec(substr($trama,$LONCABECERA,$LONHEXPRM));
+ $parametros=substr($trama,$LONCABECERA+$LONHEXPRM,$hlonprm);
+ $ValorParametros=extrae_parametros($parametros,chr(13),'=');
+ $resul=$ValorParametros["res"];
+ }
+ $shidra->desconectar();
+ }
+ if (!$resul){
+ echo '<SCRIPT language="javascript">';
+ echo 'resultado_comando(1);'.chr(13);
+ echo '</SCRIPT>';
+ }
+ else{
+ echo '<SCRIPT language="javascript">'.chr(13);
+ echo 'resultado_comando(2);'.chr(13);
+ echo '</SCRIPT>'.chr(13);
+ }
+ }
+ }
+}
+/*--------------------------------------------------------------------------------------------------------------------
+ Switch de creación o inclusión en procedimiento
+--------------------------------------------------------------------------------------------------------------------*/
+if($sw_mkprocedimiento=='on' || $sw_mktarea=='on'){
+ $resul=false;
+ if($idprocedimiento==0 || $sw_mktarea=='on'){ // Nuevo procedimiento o Tarea
+ if($sw_mktarea=='on' && empty($nombreprocedimiento)){ // Si tarea con inclusión de procedimiento...
+ if(!empty($nombretarea))
+ $nombreprocedimiento="Proc($nombretarea)"; // .. tarea nueva
+ else
+ $nombreprocedimiento="Proc($idtarea)"; // .. inclusión en tarea
+ }
+ $cmd->ParamSetValor("@descripcion",$nombreprocedimiento);
+ $cmd->ParamSetValor("@idcentro",$idcentro);
+ $cmd->texto="INSERT INTO procedimientos(descripcion,idcentro) VALUES (@descripcion,@idcentro)";
+ $resul=$cmd->Ejecutar();
+ if($resul){
+ if($idprocedimiento==0) // Cambia el identificador sólo si es nuevo procedimiento
+ $idprocedimiento=$cmd->Autonumerico();
+ if($sw_mktarea=='on')
+ $idprocedimientotarea=$cmd->Autonumerico(); // Identificador para la tarea;
+ }
+ }
+ if( $idprocedimiento>0 || $sw_mktarea=='on'){ // inclusión en procedimiento existente
+ $cmd->ParamSetValor("@idprocedimiento",$idprocedimiento);
+ $cmd->ParamSetValor("@idcomando",$idcomando);
+ $cmd->ParamSetValor("@ordprocedimiento",$ordprocedimiento);
+ $parametros=$funcion.$atributos;
+ $cmd->ParamSetValor("@parametros",$parametros);
+ $cmd->texto="INSERT INTO procedimientos_acciones(idprocedimiento,orden,idcomando,parametros) VALUES (@idprocedimiento,@ordprocedimiento,@idcomando,@parametros)";
+ $resul=$cmd->Ejecutar();
+ if($sw_mktarea=='on' && $idprocedimiento!=$idprocedimientotarea){ // Si es tarea se graba para su procedimiento independiente aunque los parametros sean los mismos
+ $cmd->ParamSetValor("@idprocedimiento",$idprocedimientotarea);
+ $cmd->texto="INSERT INTO procedimientos_acciones(idprocedimiento,orden,idcomando,parametros) VALUES (@idprocedimiento,@ordprocedimiento,@idcomando,@parametros)";
+ $resul=$cmd->Ejecutar();
+ }
+ }
+ if (!$resul){
+ echo '<SCRIPT language="javascript">';
+ echo 'resultado_comando(3);'.chr(13);
+ echo '</SCRIPT>';
+ }
+ else{
+ if($sw_mkprocedimiento=='on'){
+ echo '<SCRIPT language="javascript">'.chr(13);
+ echo 'resultado_comando(4);'.chr(13);
+ echo '</SCRIPT>'.chr(13);
+ }
+ }
+}
+/*--------------------------------------------------------------------------------------------------------------------
+ Switch de creación o inclusión en tarea
+--------------------------------------------------------------------------------------------------------------------*/
+if($sw_mktarea=='on'){
+ $resul=false;
+ if($idtarea==0){ // Nueva tarea
+ $cmd->ParamSetValor("@descripcion",$nombretarea);
+ $cmd->ParamSetValor("@idcentro",$idcentro);
+ $cmd->ParamSetValor("@ambito",$ambito);
+ $cmd->ParamSetValor("@idambito",$idambito);
+ $cmd->texto="INSERT INTO tareas(descripcion,idcentro,ambito,idambito,restrambito)
+ VALUES (@descripcion,@idcentro,@ambito,@idambito,@restrambito)";
+ $resul=$cmd->Ejecutar();
+ if($resul)
+ $idtarea=$cmd->Autonumerico();
+ }
+ if($idtarea>0){ // inclusión en tarea existente
+ $cmd->ParamSetValor("@idtarea",$idtarea);
+ $cmd->ParamSetValor("@idprocedimiento",$idprocedimientotarea);
+ $cmd->ParamSetValor("@ordtarea",$ordtarea);
+ $cmd->texto="INSERT INTO tareas_acciones(idtarea,orden,idprocedimiento)
+ VALUES (@idtarea,@ordtarea,@idprocedimiento)";
+ $resul=$cmd->Ejecutar();
+ //echo $cmd->texto;
+ }
+ if (!$resul){
+ echo '<SCRIPT language="javascript">'.chr(13);
+ echo 'resultado_comando(5);'.chr(13);
+ echo '</SCRIPT>'.chr(13);
+ }
+ else{
+ echo '<SCRIPT language="javascript">'.chr(13);
+ echo 'resultado_comando(6);'.chr(13);
+ echo '</SCRIPT>'.chr(13);
+ }
+}
+/* Programación del comando */
+if ($resul){
+ if($sw_ejprg=="on" ){
+ echo '<SCRIPT language="javascript">'.chr(13);
+ echo 'var whref="../../varios/programaciones.php?idcomando='.$idcomando.'";'.chr(13);
+ echo 'whref+="&sesion='.$sesion.'&descripcioncomando='.UrlEncode($descricomando).'&tipoaccion='.$EJECUCION_COMANDO.'";'.chr(13);
+ echo 'location.href=whref;';
+ echo '</SCRIPT>';
+ }
+}
+?>
+</BODY>
+</HTML>
diff --git a/admin/WebConsole/asistentes/includes/asistentes/AyudanteFormularios.php b/admin/WebConsole/asistentes/includes/asistentes/AyudanteFormularios.php
new file mode 100644
index 00000000..e1164221
--- /dev/null
+++ b/admin/WebConsole/asistentes/includes/asistentes/AyudanteFormularios.php
@@ -0,0 +1,375 @@
+<?
+/// funciones php
+
+#devuelve los elementos [texto] multicast para un formulario.
+#$ambito (aula=4 y ordenadores=16)
+function htmlForm_mcast($cmd,$ambito,$idambito)
+{
+//if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+if ($ambito == 4)
+{
+$cmd->texto='SELECT aulas.pormul,aulas.ipmul,aulas.modomul,aulas.velmul,aulas.modp2p,aulas.timep2p FROM aulas where aulas.idaula=' . $idambito ;
+}
+
+if ($ambito == 8)
+{
+$cmd->texto='SELECT aulas.pormul,aulas.ipmul,aulas.modomul,aulas.velmul,aulas.modp2p,aulas.timep2p FROM aulas JOIN gruposordenadores ON aulas.idaula=gruposordenadores.idaula where gruposordenadores.idgrupo=' . $idambito ;
+}
+
+if ($ambito == 16)
+{
+$cmd->texto='SELECT aulas.pormul,aulas.ipmul,aulas.modomul,aulas.velmul,aulas.modp2p,aulas.timep2p FROM aulas JOIN ordenadores ON ordenadores.idaula=aulas.idaula where ordenadores.idordenador=' . $idambito ;
+}
+
+ $rs=new Recordset;
+ $rs->Comando=&$cmd;
+if ($rs->Abrir()){
+ $rs->Primero();
+ $SelectHtml.='puerto :<input type="text" size="3" name="mcastpuerto" value="'.$rs->campos["pormul"] . '" /> <br />';
+ $rs->Siguiente();
+ $SelectHtml.='direccion Mcast :<input type="text" size="15" maxlength="15" name="mcastdireccion" value="'.$rs->campos["ipmul"] . '" /> <br />';
+ $rs->Siguiente();
+ switch ($rs->campos["modomul"])
+ {
+ case 1:
+ $modomulticast="half-duplex";
+ break;
+ default:
+ $modomulticast="full-duplex";
+ break;
+ }
+ $SelectHtml.='modo :<input type="text" size="8" name="mcastmodo" value="'.$modomulticast. '" /> <br />';
+ $rs->Siguiente();
+ $SelectHtml.='velocidad :<input type="text" size="6" name="mcastvelocidad" value="'.$rs->campos["velmul"] . '" /> <br />';
+
+ $rs->Cerrar();
+ }
+ $SelectHtml.='nº Max. clientes :<input type="text" size="8" name="mcastnclien" value="50" /> <br />';
+ $SelectHtml.='Tiempo(seg) Max. Espera :<input type="text" size="8" name="mcastseg" value="60" /> <br />';
+
+ return($SelectHtml);
+}
+
+
+#devuelve los elementos [texto] p2p para un formulario.
+#$ambito (aula=4 y ordenadores=16)
+function htmlForm_p2p($cmd,$ambito,$idambito)
+{
+//if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+if ($ambito == 4)
+{
+$cmd->texto='SELECT aulas.modp2p,aulas.timep2p FROM aulas where aulas.idaula=' . $idambito ;
+}
+if ($ambito == 8)
+{
+$cmd->texto='SELECT aulas.modp2p,aulas.timep2p FROM aulas JOIN gruposordenadores ON aulas.idaula=gruposordenadores.idaula where gruposordenadores.idgrupo=' . $idambito ;
+}
+
+
+if ($ambito == 16)
+{
+$cmd->texto='SELECT aulas.modp2p,aulas.timep2p FROM aulas JOIN ordenadores ON ordenadores.idaula=aulas.idaula where ordenadores.idordenador=' . $idambito ;
+}
+
+ $rs=new Recordset;
+ $rs->Comando=&$cmd;
+if ($rs->Abrir()){
+ $rs->Primero();
+ $SelectHtml.='modo :<input type="text" size="10" name="modp2p" value="'.$rs->campos["modp2p"] . '" /> <br />';
+ $rs->Siguiente();
+ $SelectHtml.='tiempo de semilla :<input type="text" size="10" maxlength="15" name="timep2p" value="'.$rs->campos["timep2p"] . '" /> <br />';
+ $rs->Siguiente();
+ $rs->Cerrar();
+ }
+
+return($SelectHtml);
+}
+
+
+function htmlForm_unicast($cmd,$ambito,$idambito)
+{
+
+//if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+if ($ambito == 4)
+{
+$cmd->texto='SELECT nombreordenador,idordenador,ip FROM ordenadores where idaula=' . $idambito ;
+}
+
+if ($ambito == 8)
+{
+$cmd->texto='SELECT nombreordenador,idordenador,ip FROM ordenadores where grupoid=' . $idambito ;
+}
+if ($ambito == 16)
+{
+$cmd->texto='SELECT nombreordenador,idordenador,ip FROM ordenadores where idaula=' . $idambito ;
+}
+
+ $SelectHtml="";
+ $rs=new Recordset;
+ $rs->Comando=&$cmd;
+
+ if ($rs->Abrir()){
+ $rs->Primero();
+ while (!$rs->EOF){
+ $ucastclient.= $rs->campos["ip"] . ":" ;
+ $rs->Siguiente();
+ }
+ $rs->Cerrar();
+ }
+ $SelectHtml.='Puerto Unicast :<input type="text" size="8" name="ucastport" value="8000" /> <br />';
+ $SelectHtml.='Clientes Posibles :<input type="text" size="98" name="ucastclient" value="' . $ucastclient . '" /> <br />';
+
+ return($SelectHtml);
+}
+
+
+
+function htmlOPTION_equipos($cmd,$ambito,$idambito)
+{
+
+//if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+if ($ambito == 4)
+{
+$cmd->texto='SELECT nombreordenador,idordenador,ip FROM ordenadores where idaula=' . $idambito ;
+}
+
+if ($ambito == 8)
+{
+$cmd->texto='SELECT nombreordenador,idordenador,ip FROM ordenadores where grupoid=' . $idambito ;
+}
+if ($ambito == 16)
+{
+$cmd->texto='SELECT nombreordenador,idordenador,ip FROM ordenadores where idaula=' . $idambito ;
+}
+
+ $SelectHtml="";
+ $rs=new Recordset;
+ $rs->Comando=&$cmd;
+
+ if ($rs->Abrir()){
+ $rs->Primero();
+ while (!$rs->EOF){
+ $SelectHtml.='<OPTION value="'.$rs->campos["ip"] . '" ';
+ $SelectHtml.='>';
+ $SelectHtml.= $rs->campos["nombreordenador"] .'</OPTION>';
+ $rs->Siguiente();
+ }
+ $rs->Cerrar();
+ }
+ //$SelectHtml.= '</SELECT>';
+ return($SelectHtml);
+}
+
+
+
+
+
+
+function htmlOPTION_images($cmd)
+{
+ $SelectHtml="";
+ $cmd->texto="SELECT *,repositorios.ip as iprepositorio FROM imagenes
+ INNER JOIN repositorios ON repositorios.idrepositorio=imagenes.idrepositorio";
+ $rs=new Recordset;
+ $rs->Comando=&$cmd;
+
+ if ($rs->Abrir()){
+ $rs->Primero();
+ while (!$rs->EOF){
+ $SelectHtml.='<OPTION value="'.$rs->campos["nombreca"] . '" ';
+ $SelectHtml.='>';
+ $SelectHtml.= $rs->campos["descripcion"] .'</OPTION>';
+ $rs->Siguiente();
+ }
+ $rs->Cerrar();
+ }
+ return($SelectHtml);
+}
+
+
+
+function HTMLSELECT_imagenes($cmd,$idimagen,$numpar,$codpar,$icp,$sw)
+{
+ $SelectHtml="";
+ $cmd->texto="SELECT *,repositorios.ip as iprepositorio FROM imagenes
+ INNER JOIN repositorios ON repositorios.idrepositorio=imagenes.idrepositorio";
+ if($sw) // Imágenes con el mismo tipo de partición
+ $cmd->texto.= " WHERE imagenes.codpar=".$codpar;
+ else
+ $cmd->texto.= " WHERE imagenes.codpar<>".$codpar;
+
+ $cmd->texto.=" AND imagenes.numpar>0 AND imagenes.codpar>0 AND imagenes.idrepositorio>0"; // La imagene debe existir y estar creada
+ $rs=new Recordset;
+ $rs->Comando=&$cmd;
+ if($sw) $des=1; else $des=0;
+ $SelectHtml.= '<SELECT class="formulariodatos" id="despleimagen_'.$icp.'_'.$des.'" style="WIDTH:220">';
+ $SelectHtml.= ' <OPTION value="0"></OPTION>';
+
+ if ($rs->Abrir()){
+ $rs->Primero();
+ while (!$rs->EOF){
+ $SelectHtml.='<OPTION value="'.$rs->campos["idimagen"]."_".$rs->campos["nombreca"]."_".$rs->campos["iprepositorio"]."_".$rs->campos["idperfilsoft"].'"';
+ if($idimagen==$rs->campos["idimagen"]) $SelectHtml.=" selected ";
+ $SelectHtml.='>';
+ $SelectHtml.= $rs->campos["descripcion"].'</OPTION>';
+ $rs->Siguiente();
+ }
+ $rs->Cerrar();
+ }
+ $SelectHtml.= '</SELECT>';
+ return($SelectHtml);
+}
+
+
+
+function htmlOPTION_typepartnotcache($cmd)
+{
+ $SelectHtml="";
+ $cmd->texto='SELECT tipopar FROM tipospar WHERE NOT tipopar = "CACHE"';
+ $rs=new Recordset;
+ $rs->Comando=&$cmd;
+ //$SelectHtml.= '<SELECT class="formulariodatos" name="nombre" id="identificador" style="WIDTH:220" ;" >';
+ //$SelectHtml.= ' <OPTION value="0"></OPTION>';
+
+ if ($rs->Abrir()){
+ $rs->Primero();
+ while (!$rs->EOF){
+ $SelectHtml.='<OPTION value="'.$rs->campos["tipopar"] . '" ';
+ $SelectHtml.='>';
+ $SelectHtml.= $rs->campos["tipopar"] .'</OPTION>';
+ $rs->Siguiente();
+ }
+ $rs->Cerrar();
+ }
+ //$SelectHtml.= '</SELECT>';
+ return($SelectHtml);
+}
+
+
+function htmlForm_typepart($cmd,$numpar)
+{
+ $SelectHtml="";
+ $cmd->texto='SELECT DISTINCT tipopar FROM tipospar JOIN ordenadores_particiones ON ordenadores_particiones.codpar = tipospar.codpar WHERE numpar = ' .$numpar;
+ $rs=new Recordset;
+ $rs->Comando=&$cmd;
+
+ if ($rs->Abrir()){
+ $rs->Primero();
+ while (!$rs->EOF){
+ if ( $rs->campos["tipopar"] == "LINUX" )
+ {
+ $valor="EXT4";
+ $valormostrar="LINUX:EXT[2:3:4]";
+ }
+ else
+ {
+ $valor=$rs->campos["tipopar"];
+ $valormostrar=$rs->campos["tipopar"];
+ }
+ $SelectHtml.='<OPTION value="'.$valor . '" ';
+ $SelectHtml.='>';
+ $SelectHtml.= $valormostrar .'</OPTION>';
+ $rs->Siguiente();
+ }
+ $rs->Cerrar();
+ }
+ return($SelectHtml);
+}
+
+
+
+
+
+
+
+function htmlForm_typepartnotcacheEngine10()
+{
+$SelectHtml="";
+$SelectHtml.='<OPTION value="FAT12"> FAT12 </OPTION>';
+$SelectHtml.='<OPTION value="FAT16"> FAT16 </OPTION>';
+$SelectHtml.='<OPTION value="FAT32"> FAT32 </OPTION>';
+$SelectHtml.='<OPTION value="NTFS"> NTFS </OPTION>';
+#$SelectHtml.='<OPTION value="EXT2"> EXT2 </OPTION>';
+#$SelectHtml.='<OPTION value="EXT3"> EXT3 </OPTION>';
+$SelectHtml.='<OPTION value="EXT4"> LINUX:EXT[2:3:4] </OPTION>';
+$SelectHtml.='<OPTION value="LINUX-SWAP"> LINUX-SWAP </OPTION>';
+$SelectHtml.='<OPTION value="REISERFS"> REISERFS </OPTION>';
+$SelectHtml.='<OPTION value="REISER4"> RESISER4 </OPTION>';
+$SelectHtml.='<OPTION value="XFS"> XFS </OPTION>';
+$SelectHtml.='<OPTION value="JFS"> JFS </OPTION>';
+$SelectHtml.='<OPTION value="LINUX-RAID"> LINUX-RAID </OPTION>';
+$SelectHtml.='<OPTION value="LINUX-LVM"> LINUX-LVM </OPTION>';
+return($SelectHtml);
+}
+
+
+function htmlForm_sizepart($cmd,$numpar)
+{
+ $SelectHtml="";
+ $cmd->texto='SELECT DISTINCT tamano FROM ordenadores_particiones WHERE numpar = ' .$numpar . ' AND NOT tamano = 0';
+ $rs=new Recordset;
+ $rs->Comando=&$cmd;
+
+ if ($rs->Abrir()){
+ $rs->Primero();
+ while (!$rs->EOF){
+ $SelectHtml.='<OPTION value="'.$rs->campos["tamano"] . '" ';
+ $SelectHtml.='>';
+ $SelectHtml.= $rs->campos["tamano"] .'</OPTION>';
+ $rs->Siguiente();
+ }
+ $rs->Cerrar();
+ }
+ return($SelectHtml);
+}
+
+function pintaParticiones($cmd,$configuraciones,$idordenadores,$cc)
+{
+ global $tbKeys; // Tabla contenedora de claves de configuración
+ global $conKeys; // Contador de claves de configuración
+ global $TbMsg;
+
+ $colums=7;
+ echo '<TR height=16>';
+ echo '<TH align=center>&nbsp;'.$TbMsg[20].'&nbsp;</TH>'; // Número de partición
+ echo '<TH align=center>&nbsp;'.$TbMsg[24].'&nbsp;</TH>'; // Tipo de partición
+ echo '<TH align=center>&nbsp;'.$TbMsg[27].'&nbsp;</TH>'; // Sistema de ficheros
+ echo '<TH align=center>&nbsp;'.$TbMsg[21].'&nbsp;</TH>'; // Sistema Operativo Instalado
+ echo '<TH align=center>&nbsp;'.$TbMsg[22].'&nbsp;</TH>'; // Tamaño
+ echo '<TH align=center>&nbsp;'.$TbMsg[25].'&nbsp;</TH>'; // Imagen instalada
+ echo '<TH align=center>&nbsp;'.$TbMsg[26].'&nbsp;</TH>'; // Perfil software
+ echo '</TR>';
+
+ $auxCfg=split("@",$configuraciones); // Crea lista de particiones
+ for($i=0;$i<sizeof($auxCfg);$i++){
+ $auxKey=split(";",$auxCfg[$i]); // Toma clave de configuracion
+ for($k=0;$k<$conKeys;$k++){ // Busca los literales para las claves de esa partición
+ if($tbKeys[$k]["cfg"]==$auxCfg[$i]){ // Claves encontradas
+ echo'<TR height=16>'.chr(13);
+ echo'<TD align=center>&nbsp;'.$tbKeys[$k]["numpar"].'&nbsp;</TD>'.chr(13);
+ echo'<TD align=center>&nbsp;'.$tbKeys[$k]["tipopar"].'&nbsp;</TD>'.chr(13);
+
+ //echo'<TD align=center>&nbsp;'.$tbKeys[$k]["sistemafichero"].'&nbsp;</TD>'.chr(13);
+ echo'<TD align=center>&nbsp;'.tomaSistemasFicheros($tbKeys[$k]["numpar"],$idordenadores).'&nbsp;</TD>'.chr(13);
+
+ //echo '<TD>&nbsp;'.$tbKeys[$k]["nombreso"].'&nbsp;</TD>'.chr(13);
+ echo '<TD align=center>&nbsp;'.tomaNombresSO($tbKeys[$k]["numpar"],$idordenadores).'&nbsp;</TD>'.chr(13);
+
+ //echo'<TD align=rigth>&nbsp;'.formatomiles($tbKeys[$k]["tamano"]).'&nbsp;</TD>'.chr(13);
+ echo'<TD align=center>&nbsp;'.tomaTamano($tbKeys[$k]["numpar"],$idordenadores).'&nbsp;</TD>'.chr(13);
+
+ //echo'<TD>&nbsp;'.$tbKeys[$k]["imagen"].'&nbsp;</TD>'.chr(13);
+ echo'<TD align=center>&nbsp;'.tomaImagenes($tbKeys[$k]["numpar"],$idordenadores).'&nbsp;</TD>'.chr(13);
+
+ //echo'<TD>&nbsp;'.$tbKeys[$k]["perfilsoft"].'&nbsp;</TD>'.chr(13);
+ echo'<TD align=center>&nbsp;'.tomaPerfiles($tbKeys[$k]["numpar"],$idordenadores).'&nbsp;</TD>'.chr(13);
+
+ echo'</TR>'.chr(13);
+ break;
+ }
+ }
+ }
+ echo '<TR height=5><TD colspan='.$colums.' style="BORDER-TOP: #999999 1px solid;BACKGROUND-COLOR: #FFFFFF;">&nbsp;</TD></TR>';
+}
+
+?> \ No newline at end of file
diff --git a/admin/WebConsole/asistentes/includes/asistentes/formCloneRemotePartition.php b/admin/WebConsole/asistentes/includes/asistentes/formCloneRemotePartition.php
new file mode 100644
index 00000000..819edd1d
--- /dev/null
+++ b/admin/WebConsole/asistentes/includes/asistentes/formCloneRemotePartition.php
@@ -0,0 +1,50 @@
+
+
+
+<tr>
+ <td class="op_basic">
+ Elige equipo MASTER:
+ <select name="ipMaster" id="ipMaster" style="WIDTH:220" onChange="xajax_ListarOrigenMaster(this.value);">
+ <option value="">-- Elige equipo Master--</option>
+ <?php echo ''.htmlOPTION_equipos($cmd,$ambito,$idambito).''; ?>
+ </select>
+ <br />
+ <!--DIV donde se mostrara la respuesta AJAX sobre las particiones clonables del equipo-->
+ Elige particion del Master a enviar
+ <div id="divListado"></div>
+ <br />
+ Elige herramienta de clonacion:
+ <select name="tool" id="tool" style="WIDTH:220";">
+ <option value="partclone"> partclone </option>
+ <option value="partimage"> partimage </option>
+ </select>
+ <br />
+ Elige compresor para la herramienta de clonacion:
+ <select name="compresor" id="compresor" style="WIDTH:220";">
+ <option value="lzop"> lzop </option>
+ <option value="gzip"> gzip </option>
+ </select>
+ <br />
+
+ <br />
+ Elige el metodo de transferencia
+ <select name="idmetodo" id="idmetodo" style="WIDTH:220";">
+ <option value="MULTICAST"> MULTICAST </option>
+ <option value="UNICAST"> UNICAST </option>
+ </select>
+ <br />
+ </td>
+
+ <td class="op_mcast">
+ <?php echo ''. htmlForm_mcast($cmd,$ambito,$idambito).''; ?>
+ </td>
+
+ <td class="op_unicast">
+ <?php echo ''. htmlForm_unicast($cmd,$ambito,$idambito).''; ?>
+ </td>
+</tr>
+
+
+
+
+
diff --git a/admin/WebConsole/asistentes/includes/asistentes/formDeployImage.php b/admin/WebConsole/asistentes/includes/asistentes/formDeployImage.php
new file mode 100644
index 00000000..2ee0920c
--- /dev/null
+++ b/admin/WebConsole/asistentes/includes/asistentes/formDeployImage.php
@@ -0,0 +1,48 @@
+
+
+<tr> <td> opciones basicas </td> <td> opciones multicast </td> <td> opciones torrent </td> <td> opciones unicast </td></tr>
+
+<tr>
+ <td class="op_basic">
+ Elige la particion del disco donde se restaurar la imagen:
+ <select name="idparticion" id="idparticion" style="WIDTH:220">
+ <option value="1"> 1 </option>
+ <option value="2"> 2 </option>
+ <option value="3"> 3 </option>
+ </select>
+
+ <!--DIV donde se mostrara la respuesta AJAX sobre las particiones clonables del equipo-->
+ <div id="divListado"></div>
+ Elige la imagen a distribuir:
+ <select name="idimagen" id="idimagen" style="WIDTH:220">
+ <option value="">--Selecciona imagen --</option>
+ <?php echo ''. htmlOPTION_images($cmd) .''; ?>
+ </select>
+ <br />
+
+ <br />
+ Elige el metodo de transferencia
+ <select name="idmetodo" id="idmetodo" style="WIDTH:220";">
+ <!-- <option value="UNICAST"> UNICAST </option> -->
+ <option value="TORRENT"> TORRENT </option>
+ <option value="MULTICAST"> MULTICAST </option>
+ </select>
+ <br />
+ </td>
+
+ <td class="op_mcast">
+ <?php echo ''. htmlForm_mcast($cmd,$ambito,$idambito).''; ?>
+ </td>
+
+ <td class="op_torrent">
+ <?php echo ''. htmlForm_p2p($cmd,$ambito,$idambito).''; ?>
+ </td>
+
+ <td class="op_unicast">
+
+ </td>
+</tr>
+
+
+
+
diff --git a/admin/WebConsole/asistentes/includes/asistentes/formParticionado.php b/admin/WebConsole/asistentes/includes/asistentes/formParticionado.php
new file mode 100644
index 00000000..48476243
--- /dev/null
+++ b/admin/WebConsole/asistentes/includes/asistentes/formParticionado.php
@@ -0,0 +1,77 @@
+
+
+<TR>
+<TD > Partici&oacute;n </TD>
+<TD > Tipo </TD>
+<TD > Tama&ntilde;o KB </TD>
+</TR>
+
+<TR>
+<TD > <input type="checkbox" name="check1" value="check1" onclick="if (this.form.check1.checked) { this.form.part1.disabled=false; this.form.size1.disabled=false; if (this.form.part1.options[this.form.part1.selectedIndex].value == 'CUSTOM') { this.form.part1custom.disabled=false } if (this.form.size1.options[this.form.size1.selectedIndex].value == 'CUSTOM') { this.form.size1custom.disabled=false } } else { this.form.part1.disabled=true; this.form.size1.disabled=true; this.form.part1custom.disabled=true; this.form.size1custom.disabled=true }" /> <br> Partici&oacute;n 1 </TD>
+<TD>
+<select name="part1" id="part1" style="WIDTH:220" disabled="true" onclick="if (this.form.part1.options[this.form.part1.selectedIndex].value == 'CUSTOM') { this.form.part1custom.disabled=false } else { this.form.part1custom.disabled=true }" >
+ <?php echo ''. htmlForm_typepart($cmd,1) .''; ?>
+ <option value="CUSTOM"> Personalizar </option>
+</select>
+<br>
+<select name="part1custom" id="part1custom" style="WIDTH:220" disabled="true" >
+ <?php echo ''. htmlForm_typepartnotcacheEngine10() .''; ?>
+</select></TD>
+
+<TD><select name="size1" id="size1" style="WIDTH:220" disabled="true" onclick="if (this.form.size1.options[this.form.size1.selectedIndex].value == 'CUSTOM') { this.form.size1custom.disabled=false } else { this.form.size1custom.disabled=true }" >
+ <?php echo ''. htmlForm_sizepart($cmd,1) .''; ?>
+ <option value="CUSTOM"> Personalizar </option>
+</select>
+<br >
+<INPUT type="text" style="width:100" name="size1custom" value="0" disabled="true"></TD>
+</TR>
+
+<TR>
+<TD > <input type="checkbox" name="check2" value="check2" onclick="if (this.form.check2.checked) { this.form.part2.disabled=false; this.form.size2.disabled=false; if (this.form.part2.options[this.form.part2.selectedIndex].value == 'CUSTOM') { this.form.part2custom.disabled=false } if (this.form.size2.options[this.form.size2.selectedIndex].value == 'CUSTOM') { this.form.size2custom.disabled=false } } else { this.form.part2.disabled=true; this.form.size2.disabled=true; this.form.part2custom.disabled=true; this.form.size2custom.disabled=true }" /> <br> Partici&oacute;n 2 </TD>
+<TD><select name="part2" id="part2" style="WIDTH:220" disabled="true" onclick="if (this.form.part2.options[this.form.part2.selectedIndex].value == 'CUSTOM') { this.form.part2custom.disabled=false } else { this.form.part2custom.disabled=true }" >
+ <?php echo ''. htmlForm_typepart($cmd,2) .''; ?>
+ <option value="CUSTOM"> Personalizar </option>
+</select>
+<br>
+<select name="part2custom" id="part2custom" style="WIDTH:220" disabled="true" >
+ <?php echo ''. htmlForm_typepartnotcacheEngine10() .''; ?>
+</select></TD>
+
+<TD><select name="size2" id="size2" style="WIDTH:220" disabled="true" onclick="if (this.form.size2.options[this.form.size2.selectedIndex].value == 'CUSTOM') { this.form.size2custom.disabled=false } else { this.form.size2custom.disabled=true }" >
+ <?php echo ''. htmlForm_sizepart($cmd,2) .''; ?>
+ <option value="CUSTOM"> Personalizar </option>
+</select>
+<br >
+<INPUT type="text" style="width:100" name="size2custom" value="0" disabled="true"></TD>
+</TR>
+
+<TR>
+<TD > <input type="checkbox" name="check3" value="check3" onclick="if (this.form.check3.checked) { this.form.part3.disabled=false; this.form.size3.disabled=false; if (this.form.part3.options[this.form.part3.selectedIndex].value == 'CUSTOM') { this.form.part3custom.disabled=false } if (this.form.size3.options[this.form.size3.selectedIndex].value == 'CUSTOM') { this.form.size3custom.disabled=false } } else { this.form.part3.disabled=true; this.form.size3.disabled=true; this.form.part3custom.disabled=true; this.form.size3custom.disabled=true }" /> <br> Partici&oacute;n 3 </TD>
+<TD><select name="part3" id="part3" style="WIDTH:220" disabled="true" onclick="if (this.form.part3.options[this.form.part3.selectedIndex].value == 'CUSTOM') { this.form.part3custom.disabled=false } else { this.form.part3custom.disabled=true }" >
+ <?php echo ''. htmlForm_typepart($cmd,3) .''; ?>
+ <option value="CUSTOM"> Personalizar </option>
+</select>
+<br>
+<select name="part3custom" id="part3custom" style="WIDTH:220" disabled="true" >
+ <?php echo ''. htmlForm_typepartnotcacheEngine10() .''; ?>
+</select></TD>
+
+<TD><select name="size3" id="size3" style="WIDTH:220" disabled="true" onclick="if (this.form.size3.options[this.form.size3.selectedIndex].value == 'CUSTOM') { this.form.size3custom.disabled=false } else { this.form.size3custom.disabled=true }" >
+ <?php echo ''. htmlForm_sizepart($cmd,3) .''; ?>
+ <option value="CUSTOM"> Personalizar </option>
+</select>
+<br >
+<INPUT type="text" style="width:100" name="size3custom" value="0" disabled="true"></TD>
+</TR>
+
+<TR>
+<TD > <input type="checkbox" name="check4" value="check4" onclick="if (this.form.check4.checked) { this.form.part4.disabled=false; this.form.size4.disabled=false; if (this.form.size4.options[this.form.size4.selectedIndex].value == 'CUSTOM') { this.form.size4custom.disabled=false } } else { this.form.part4.disabled=true; this.form.size4.disabled=true; this.form.size4.options[0].selected=true; }" /> <br> Partici&oacute;n 4 </TD>
+<TD> <INPUT type="label" readonly size="8" name="part4" disabled="true" value="CACHE"></TD>
+<TD><select name="size4" id="size4" style="WIDTH:220" disabled="true" onclick="if (this.form.size4.options[this.form.size4.selectedIndex].value == 'CUSTOM') { this.form.size4custom.disabled=false } else { this.form.size4custom.disabled=true }" >
+ <option value="0"> Sin modificar tama&ntilde;o </option>
+ <?php echo ''. htmlForm_sizepart($cmd,4) .''; ?>
+ <option value="CUSTOM"> Personalizar </option>
+</select>
+<br >
+<INPUT type="text" style="width:100" name="size4custom" value="0" disabled="true"></TD>
+</TR>
diff --git a/admin/WebConsole/asistentes/includes/capturaacciones.php b/admin/WebConsole/asistentes/includes/capturaacciones.php
new file mode 100644
index 00000000..e26e38e6
--- /dev/null
+++ b/admin/WebConsole/asistentes/includes/capturaacciones.php
@@ -0,0 +1,31 @@
+<?
+// *************************************************************************************************************************************************
+// Aplicación WEB: ogAdmWebCon
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: Año 2009-2010
+// Fecha Última modificación: Abril-2010
+// Nombre del fichero: opcionesacciones.php
+// Descripción :
+// Captura de parámetros comunes para la ejecución de comandos
+// *************************************************************************************************************************************************
+//________________________________________________________________________________________________________
+// Captura parámetros
+//________________________________________________________________________________________________________
+$idcomando=0;
+$ambito=0;
+$idambito=0;
+$nombreambito="";
+$funcion="";
+$atributos="";
+$gestor="";
+
+if (isset($_POST["idcomando"])) $idcomando=$_POST["idcomando"];
+if (isset($_POST["descricomando"])) $descricomando=$_POST["descricomando"];
+if (isset($_POST["ambito"])) $ambito=$_POST["ambito"];
+if (isset($_POST["idambito"])) $idambito=$_POST["idambito"];
+if (isset($_POST["nombreambito"])) $nombreambito=$_POST["nombreambito"];
+if (isset($_POST["funcion"])) $funcion=$_POST["funcion"];
+if (isset($_POST["atributos"])) $atributos=$_POST["atributos"];
+if (isset($_POST["gestor"])) $gestor=$_POST["gestor"];
+?>
+
diff --git a/admin/WebConsole/asistentes/includes/formularioacciones.php b/admin/WebConsole/asistentes/includes/formularioacciones.php
new file mode 100644
index 00000000..4f8d401e
--- /dev/null
+++ b/admin/WebConsole/asistentes/includes/formularioacciones.php
@@ -0,0 +1,20 @@
+<?
+// *************************************************************************************************************************************************
+// Aplicación WEB: ogAdmWebCon
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: Año 2009-2010
+// Fecha Última modificación: Abril-2010
+// Nombre del fichero: opcionesacciones.php
+// Descripción :
+// Formulario para paso de parametros comunes para la ejecución de comandos
+// *************************************************************************************************************************************************
+?>
+<FORM align=center name="fdatosejecucion" action="<? echo $gestor?>" method="post">
+ <INPUT type="hidden" name="idcomando" value="<? echo $idcomando?>">
+ <INPUT type="hidden" name="descricomando" value="<? echo $descricomando?>">
+ <INPUT type="hidden" name="ambito" value="<? echo $ambito?>">
+ <INPUT type="hidden" name="idambito" value="<? echo $idambito?>">
+ <INPUT type="hidden" name="funcion" value="<? echo $funcion?>">
+ <INPUT type="hidden" name="atributos" value="<? echo $atributos?>">
+ <INPUT type="hidden" name="gestor" value="<? echo $gestor?>">
+
diff --git a/admin/WebConsole/asistentes/includes/opcionesacciones.php b/admin/WebConsole/asistentes/includes/opcionesacciones.php
new file mode 100644
index 00000000..36672783
--- /dev/null
+++ b/admin/WebConsole/asistentes/includes/opcionesacciones.php
@@ -0,0 +1,93 @@
+<?
+// *************************************************************************************************************************************************
+// Aplicación WEB: ogAdmWebCon
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: Año 2009-2010
+// Fecha Última modificación: Abril-2010
+// Nombre del fichero: opcionesacciones.php
+// Descripción :
+// Opciones comunes para la ejecución de comandos
+// *************************************************************************************************************************************************
+?>
+<P align=center><span align=center class=subcabeceras><? echo "Opciones de Ejecución"?></span></P>
+
+<?if($idcomando!=10){?>
+ <TABLE align=center>
+ <TR>
+ <TD><IMG border=0 style="cursor:pointer" src="../images/boton_aceptar.gif" onclick="confirmar()" ></TD>
+ </TR>
+ </TABLE>
+ <BR>
+<?}?>
+<TABLE align=center class=opciones_ejecucion BORDER=0>
+ <TR>
+ <TD><INPUT name=sw_ejya type=checkbox checked></TD>
+ <TD colspan=3>Ejecutar inmediatamente</TD>
+ </TR>
+ <TR>
+ <TD>&nbsp; </TD>
+ <TD><INPUT name=sw_seguimiento type=radio value=1></TD><TD>Ejecutar con seguimiento&nbsp;</TD>
+ </TR>
+ <TR>
+ <TD>&nbsp; </TD>
+ <TD><INPUT checked name=sw_seguimiento type=radio value=0></TD><TD>Sin seguimiento&nbsp;</TD>
+ </TR>
+ <!-------------------------------------------------------------------------------------------------------------------------------->
+ <TR HEIGHT=5><TD colspan=4><HR></TD></TR>
+ <!-------------------------------------------------------------------------------------------------------------------------------->
+ <TR>
+ <TD><INPUT name=sw_ejprg type=checkbox></TD>
+ <TD colspan=3>Programar comando</TD>
+ </TR>
+ <!-------------------------------------------------------------------------------------------------------------------------------->
+ <TR HEIGHT=5><TD colspan=4><HR></TD></TR>
+ <!-------------------------------------------------------------------------------------------------------------------------------->
+ <TR>
+ <TD><INPUT onclick="clic_mkprocedimiento(this)" name=sw_mkprocedimiento type=checkbox></TD>
+ <TD colspan=3>Guardar como procedimiento</TD></TR>
+
+ <TR>
+ <TD>&nbsp; </TD>
+ <TD><INPUT onclick="clic_nwprocedimiento(this)" name=sw_procedimiento type=radio value=0></TD>
+ <TD>Guardar como nuevo procedimiento&nbsp;</TD>
+ <TD><INPUT onclick="clic_nomprocedimiento(this)" style="FONT-FAMILY:Arial, Helvetica, sans-serif;FONT-SIZE: 11px" name=nombreprocedimiento style="HEIGHT: 22px; WIDTH: 275px"></TD></TR>
+
+ <TR>
+ <TD>&nbsp; </TD>
+ <TD><INPUT onclick="clic_exprocedimiento(this)" name=sw_procedimiento type=radio value=1></TD>
+ <TD>Incluir en un procedimiento existente&nbsp;</TD>
+ <TD><?echo HTMLSELECT($cmd,$idcentro,'procedimientos',0,'idprocedimiento','descripcion',275,"procedimientoexistente");?></TD></TR>
+
+ <TR>
+ <TD>&nbsp; </TD>
+ <TD>&nbsp; </TD>
+ <TD>Orden de ejecución&nbsp;</TD>
+ <TD><INPUT maxlength=3 style="FONT-FAMILY:Arial, Helvetica, sans-serif;FONT-SIZE: 11px;WIDTH:30" name=ordprocedimiento type=text value=""></TD></TR>
+ <!-------------------------------------------------------------------------------------------------------------------------------->
+ <TR HEIGHT=10><TD colspan=4>&nbsp; <HR></TD></TR>
+ <!-------------------------------------------------------------------------------------------------------------------------------->
+ <TR>
+ <TD><INPUT onclick="clic_mktarea(this)" name=sw_mktarea type=checkbox></TD>
+ <TD colspan=3>Guardar como tarea</TD></TR>
+
+ <TR>
+ <TD>&nbsp; </TD>
+ <TD><INPUT onclick="clic_nwtarea(this)" name=sw_tarea type=radio value=0></TD>
+ <TD>Guardar como una tarea nueva&nbsp;</TD>
+ <TD><INPUT onclick="clic_nomtarea(this)" style="FONT-FAMILY:Arial, Helvetica, sans-serif;FONT-SIZE: 11px" name=nombretarea style="HEIGHT: 22px; WIDTH: 275px"></TD></TR>
+
+ <TR>
+ <TD>&nbsp; </TD>
+ <TD><INPUT onclick="clic_extarea(this)" name=sw_tarea type=radio value=1></TD>
+ <TD>Incluir en una tarea existente&nbsp;</TD>
+ <TD><?echo HTMLSELECT($cmd,$idcentro,'tareas',0,'idtarea','descripcion',275,"tareaexistente");?></TD></TR>
+
+ <TR>
+ <TD>&nbsp; </TD>
+ <TD>&nbsp; </TD>
+ <TD>Orden de ejecución&nbsp;</TD>
+ <TD><INPUT maxlength=3 style="FONT-FAMILY:Arial, Helvetica, sans-serif;FONT-SIZE: 11px;WIDTH:30" name=ordtarea type=text value=""></TD></TR>
+ <!-------------------------------------------------------------------------------------------------------------------------------->
+ </TABLE>
+</FORM>
+
diff --git a/admin/WebConsole/asistentes/jscripts/Apagar.js b/admin/WebConsole/asistentes/jscripts/Apagar.js
new file mode 100644
index 00000000..44106958
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/Apagar.js
@@ -0,0 +1,24 @@
+// *************************************************************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: Apagar.js
+// Descripción :
+// Este fichero implementa las funciones javascript del fichero Apagar.php (Comandos)
+// *************************************************************************************************************************************************
+ function confirmar(){
+ if (comprobar_datos()){
+ document.fdatosejecucion.submit();
+ }
+ }
+//________________________________________________________________________________________________________
+ function cancelar(){
+ alert(CTbMsg[0]);
+ location.href="../nada.php"
+ }
+//________________________________________________________________________________________________________
+ function comprobar_datos(){
+ return(comprobar_datosejecucion())
+}
+
diff --git a/admin/WebConsole/asistentes/jscripts/Arrancar.js b/admin/WebConsole/asistentes/jscripts/Arrancar.js
new file mode 100644
index 00000000..acd04a7e
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/Arrancar.js
@@ -0,0 +1,24 @@
+// *************************************************************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: Arrancar.js
+// Descripción :
+// Este fichero implementa las funciones javascript del fichero Arrancar.php (Comandos)
+// *************************************************************************************************************************************************
+ function confirmar(){
+ if (comprobar_datos()){
+ document.fdatosejecucion.submit();
+ }
+ }
+//________________________________________________________________________________________________________
+ function cancelar(){
+ alert(CTbMsg[0]);
+ location.href="../nada.php"
+}
+//________________________________________________________________________________________________________
+ function comprobar_datos(){
+ return(comprobar_datosejecucion())
+}
+
diff --git a/admin/WebConsole/asistentes/jscripts/Comando.js b/admin/WebConsole/asistentes/jscripts/Comando.js
new file mode 100644
index 00000000..a81f9a92
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/Comando.js
@@ -0,0 +1,24 @@
+// *************************************************************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: Apagar.js
+// Descripción :
+// Este fichero implementa las funciones javascript del fichero Comando.php (Comandos)
+// *************************************************************************************************************************************************
+ function confirmar(){
+ if (comprobar_datos()){
+ document.fdatosejecucion.submit();
+ }
+ }
+//________________________________________________________________________________________________________
+ function cancelar(){
+ alert(CTbMsg[0]);
+ location.href="../nada.php"
+ }
+//________________________________________________________________________________________________________
+ function comprobar_datos(){
+ return(comprobar_datosejecucion())
+}
+
diff --git a/admin/WebConsole/asistentes/jscripts/Configurar.js b/admin/WebConsole/asistentes/jscripts/Configurar.js
new file mode 100644
index 00000000..cc7eba86
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/Configurar.js
@@ -0,0 +1,174 @@
+// *************************************************************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: Configurar.js
+// Descripción :
+// Este fichero implementa las funciones javascript del fichero Configurar.php (Comandos)
+// *************************************************************************************************************************************************
+
+var atributos; // Variable global
+
+//________________________________________________________________________________________________________
+//
+// Elimina una fila de una tabla de configuraciones perteneciente a las propiedades de una partición
+// Parametros:
+// icp: Identificador de la configuración-partición
+// o: Objeto checkbox que invoca la función
+//________________________________________________________________________________________________________
+
+function eliminaParticion(icp,o)
+{
+ var res=confirm(TbMsg[4]); // Pide confirmación
+ if(!res){
+ o.checked=false;
+ return;
+ }
+ var tbCfg = document.getElementById("tabla_conf"); // Recupera objeto <TABLE>
+ var trCfg = document.getElementById("TR_"+icp); // Recupera <TR> de la fila a eliminar
+ var tbodyObj=tbCfg.firstChild; // Recupera hijo <TBODY> del objeto <TABLE>
+ tbodyObj.removeChild(trCfg); // Elimina nodo <TR> completo
+}
+//________________________________________________________________________________________________________
+
+function addParticion(objImg,cc)
+{
+ var tbCfg = document.getElementById("tabla_conf"); // Recupera objeto <TABLE>
+ var tbodyObj=tbCfg.firstChild; // Recupera hijo <TBODY> del objeto <TABLE>
+
+ var trImg=document.getElementById("TRIMG_"+cc); // Recupera <TR> de los botones para insertar antes
+
+ var k=objImg.getAttribute('value'); // Toma siguiente identificador de nodo
+ var icp=cc+"_"+k; // Identificador de la configuración-partición
+
+ /* Crea objeto TR y lo añade al TBODY de la tabla*/
+ var nwTR = document.createElement('TR');
+ nwTR.setAttribute("id","TR_"+icp);
+ tbodyObj.insertBefore(nwTR,trImg); // Inserta nodo <TR> completo
+ var patron = document.getElementById("TR_patron"); // Recupera <TR> patron
+ nwTR.innerHTML=patron.innerHTML;
+ /* Actualiza objeto checkbox nuevo para que actue como los demás */
+ var nwCHK = document.getElementById("CHK_patron"); // Recupera reciente chekcbox
+ var fclbk="eliminaParticion('"+icp+"');";
+ nwCHK.setAttribute("onclick",fclbk);
+ nwCHK.removeAttribute("id");
+ /* Incrementa para siguiente identificador de nodo */
+ k++;
+ objImg.setAttribute('value',k);
+}
+//________________________________________________________________________________________________________
+//
+// Confirma un bloque de configuración de particiones
+// Parametros:
+// idordenadores: Identificadores de los ordenadores a los que se aplicará el comando
+// cc: Identificador de la configuración (bloque de particiones)
+// Especificaciones:
+// Cuando un comando se va a aplicar a un conjunto aleatorio de ordenaores, el código del
+// ámbito será cero y la variable idambito contendrá la cadena con los identificadores de
+// los oordenadores separados por coma (este dato aparece en esta función como promer parámetro)
+//________________________________________________________________________________________________________
+
+function Confirmar(cc)
+{
+ if(comprobarDatos(cc)){
+ var RC="@";
+ var disco=1; // Siempre disco 1
+ atributos+=RC+"dsk="+disco+RC; // Le añade a la variable global el parámetro disco
+ //alert(atributos)
+ if(document.fdatosejecucion.ambito.value!=AMBITO_ORDENADORES){
+ var tbOrd= document.getElementById("tbOrd_"+cc); // Recupera tabla de ordenadores de la configuración
+ var idordenadores=tbOrd.getAttribute('value'); // Toma identificadores de los ordenadores
+ var cadenaid=document.fdatos.cadenaid.value; // Cadena de identificadores de todos los ordenadores del ámbito
+ if(idordenadores!=cadenaid){ // Si no son iguales es que el ámbito de aplicación es restringido
+ document.fdatosejecucion.ambito.value=0; // Ambito de aplicación restringido
+ document.fdatosejecucion.idambito.value=idordenadores;
+ }
+ }
+ document.fdatosejecucion.atributos.value=atributos;
+ document.fdatosejecucion.submit();
+ }
+}
+//________________________________________________________________________________________________________
+//
+// Confirma un bloque de configuración de particiones
+// Parametros:
+// cc: Identificador de la configuración (bloque de particiones)
+//________________________________________________________________________________________________________
+
+function comprobarDatos(cc)
+{
+ // Indices de campos a recuperar
+ var ipar=1;
+ var icodpar=2;
+ var isysfi=3;
+ var itama=4;
+ var iope=6;
+
+ var SL="#";
+ var TB="$";
+
+ var tbpar=new Array(); // Para control de particiones duplicadas
+ atributos="cfg="; // Inicializa variable global de parámetros del comando
+
+ var trCfg = document.getElementById("TR_"+cc); // Recupera primer <TR> de la configuración
+ trCfg=trCfg.nextSibling; // Primera fila de particiones
+ while(trCfg.id!="TRIMG_"+cc){
+ var par=tomavalorDesple(trCfg.childNodes[ipar].childNodes[0]); // Partición
+ if(par==0){
+ alert(TbMsg[1]);
+ trCfg.childNodes[ipar].childNodes[0].focus();
+ return(false);
+ }
+ if(tbpar[par]==1){ // Existe ya una partición con ese número
+ alert(TbMsg[0]);
+ trCfg.childNodes[ipar].childNodes[0].focus();
+ return(false);
+ }
+ tbpar[par]=1;
+ var codpar=tomavalorDesple(trCfg.childNodes[icodpar].childNodes[0]); // Tipo de partición
+ if(codpar==0){
+ alert(TbMsg[2]);
+ trCfg.childNodes[icodpar].childNodes[0].focus();
+ return(false);
+ }
+
+ var sysfi=tomatextDesple(trCfg.childNodes[isysfi].childNodes[0]); // Sistema de ficheros
+
+ var tama=trCfg.childNodes[itama].childNodes[0].value; // Tamaño de partición
+ if(tama==0){
+ alert(TbMsg[3]);
+ trCfg.childNodes[itama].childNodes[0].focus();
+ return(false);
+ }
+ var ope=tomavalorDesple(trCfg.childNodes[iope].childNodes[0]); // Operación a realizar
+
+ trCfg=trCfg.nextSibling; // Primera fila de particiones
+ /* Compone formato del comando */
+ atributos+="par="+par+TB+"cpt="+codpar+TB+"sfi="+sysfi+TB+"tam="+tama+TB+"ope="+ope+SL;
+ }
+ return(true);
+}
+//________________________________________________________________________________________________________
+//
+// Devuelve el valor seleccionado de un desplegable cualquiera
+//________________________________________________________________________________________________________
+
+function tomavalorDesple(desplegable)
+{
+ var idx=desplegable.selectedIndex; // Indice seleccionado en el desplegable
+ var val=desplegable.options[idx].value; // Valor seleccionado en el desplegable
+ return(val);
+}
+//________________________________________________________________________________________________________
+//
+// Devuelve el valor seleccionado de un desplegable cualquiera
+//________________________________________________________________________________________________________
+
+function tomatextDesple(desplegable)
+{
+ var idx=desplegable.selectedIndex; // Indice seleccionado en el desplegable
+ var txt=desplegable.options[idx].text; // Valor seleccionado en el desplegable
+ return(txt);
+}
+
diff --git a/admin/WebConsole/asistentes/jscripts/CrearImagen.js b/admin/WebConsole/asistentes/jscripts/CrearImagen.js
new file mode 100644
index 00000000..ebf37155
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/CrearImagen.js
@@ -0,0 +1,70 @@
+// *************************************************************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: CrearImagen.js
+// Descripción :
+// Este fichero implementa las funciones javascript del fichero CrearImagen.php (Comandos)
+// *************************************************************************************************************************************************
+ function confirmar()
+ {
+ if (!comprobar_datos()) return;
+
+ var RC="@";
+ var disco=1; // Siempre disco 1
+ var atributos="dsk="+disco+RC;
+
+ var tb_conf=document.getElementById("tabla_conf");
+ var ochecks=tb_conf.getElementsByTagName('INPUT')
+ for(var i=0;i<ochecks.length;i++){
+ if(ochecks[i].checked){
+ var parcod=ochecks[i].value.split("_");
+ atributos+="par="+parcod[0]+RC; // Número de partición
+ atributos+="cpt="+parcod[1]+RC; // Código de partición
+
+ var despleimagen=document.getElementById("despleimagen_"+parcod[0]);
+ var imgcan=despleimagen.value.split("_");
+ atributos+="idi="+imgcan[0]+RC; // Identificador de la imagen
+ atributos+="nci="+imgcan[1]+RC; // Nonbre canónico
+
+ var desplerepositorios=document.getElementById("desplerepositorios_"+parcod[0]);
+ var idx=desplerepositorios.selectedIndex;
+ atributos+="ipr="+desplerepositorios.options[idx].value+RC;
+ break;
+ }
+ }
+ document.fdatosejecucion.atributos.value=atributos;
+ document.fdatosejecucion.submit();
+}
+//________________________________________________________________________________________________________
+ function cancelar(){
+ alert(CTbMsg[0]);
+ location.href="../nada.php"
+ }
+//________________________________________________________________________________________________________
+ function comprobar_datos()
+{
+ tb_conf=document.getElementById("tabla_conf");
+ var ochecks=tb_conf.getElementsByTagName('INPUT')
+ var op=0
+ for(var i=0;i<ochecks.length;i++){
+ if(ochecks[i].checked){
+ op++;
+ var particion=ochecks[i].value.split("_")[0];
+ despleimagen=document.getElementById("despleimagen_"+particion);
+ var p=despleimagen.selectedIndex
+ if (p==0){
+ alert(TbMsg[0])
+ despleimagen.focus()
+ return(false)
+ }
+ }
+ }
+ if(op==0){
+ alert(TbMsg[1])
+ return(false);
+ }
+ return(comprobar_datosejecucion())
+}
+
diff --git a/admin/WebConsole/asistentes/jscripts/EjecutarScripts.js b/admin/WebConsole/asistentes/jscripts/EjecutarScripts.js
new file mode 100644
index 00000000..e17411c0
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/EjecutarScripts.js
@@ -0,0 +1,34 @@
+// ***********************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: EjecutarScripts.js
+// Descripción :
+// Este fichero implementa las funciones javascript del fichero EjecutarScripts.php (Comandos)
+// ***********************************************************************************************************
+ function confirmar(){
+ if (comprobar_datos()){
+ var RC='@';
+ document.fdatosejecucion.atributos.value="scp="+escape(document.fdatos.codigo.value)+RC;
+ document.fdatosejecucion.submit();
+ }
+ }
+//________________________________________________________________________________________________________
+
+ function cancelar()
+{
+ alert(CTbMsg[0]);
+ location.href="../nada.php"
+ }
+//________________________________________________________________________________________________________
+
+ function comprobar_datos()
+{
+ if (document.fdatos.codigo.value=="") {
+ alert(TbMsg[1]);
+ document.fdatos.codigo.focus();
+ return(false);
+ }
+ return(comprobar_datosejecucion())
+}
diff --git a/admin/WebConsole/asistentes/jscripts/IniciarSesion.js b/admin/WebConsole/asistentes/jscripts/IniciarSesion.js
new file mode 100644
index 00000000..05dcc52c
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/IniciarSesion.js
@@ -0,0 +1,47 @@
+// *************************************************************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: IniciarSesion.js
+// Descripción :
+// Este fichero implementa las funciones javascript del fichero IniciarSesion.php (Comandos)
+// *************************************************************************************************************************************************
+function confirmar(){
+ if (comprobar_datos()){
+ // Compone atributos del comando
+ tb_conf=document.getElementById("tabla_conf");
+ var ochecks=tb_conf.getElementsByTagName('INPUT')
+ var particion;
+ for(var i=0;i<ochecks.length;i++){
+ if(ochecks[i].checked){
+ particion=ochecks[i].value
+ }
+ }
+ var RC='@';
+ document.fdatosejecucion.atributos.value="par="+particion+RC;
+ document.fdatosejecucion.submit();
+ }
+ }
+//________________________________________________________________________________________________________
+ function cancelar()
+{
+ alert(CTbMsg[0]);
+ location.href="../nada.php"
+ }
+//________________________________________________________________________________________________________
+ function comprobar_datos()
+{
+ tb_conf=document.getElementById("tabla_conf");
+ var ochecks=tb_conf.getElementsByTagName('INPUT')
+ var op=0
+ for(var i=0;i<ochecks.length;i++){
+ if(ochecks[i].checked) op++;
+ }
+ if(op==0){
+ alert(TbMsg[1])
+ return(false);
+ }
+ return(comprobar_datosejecucion())
+}
+
diff --git a/admin/WebConsole/asistentes/jscripts/InventarioHardware.js b/admin/WebConsole/asistentes/jscripts/InventarioHardware.js
new file mode 100644
index 00000000..903b02a0
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/InventarioHardware.js
@@ -0,0 +1,24 @@
+// *************************************************************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: InventarioHardware.js
+// Descripción :
+// Este fichero implementa las funciones javascript del fichero InventarioHardware.php (Comandos)
+// *************************************************************************************************************************************************
+ function confirmar(){
+ if (comprobar_datos()){
+ document.fdatosejecucion.submit();
+ }
+ }
+//________________________________________________________________________________________________________
+ function cancelar(){
+ alert(CTbMsg[0]);
+ location.href="../nada.php"
+ }
+//________________________________________________________________________________________________________
+ function comprobar_datos(){
+ return(comprobar_datosejecucion())
+}
+
diff --git a/admin/WebConsole/asistentes/jscripts/InventarioSoftware.js b/admin/WebConsole/asistentes/jscripts/InventarioSoftware.js
new file mode 100644
index 00000000..aeb8437e
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/InventarioSoftware.js
@@ -0,0 +1,44 @@
+// *************************************************************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: InventarioHardware.js
+// Descripción :
+// Este fichero implementa las funciones javascript del fichero InventarioHardware.php (Comandos)
+// *************************************************************************************************************************************************
+ function confirmar(){
+ if (comprobar_datos()){
+ tb_conf=document.getElementById("tabla_conf");
+ var ochecks=tb_conf.getElementsByTagName('INPUT')
+ var particion;
+ for(var i=0;i<ochecks.length;i++){
+ if(ochecks[i].checked){
+ particion=ochecks[i].value
+ }
+ }
+ var RC="@";
+ var disco=1; // Siempre disco 1
+ document.fdatosejecucion.atributos.value="dsk="+disco+RC+"par="+particion+RC;
+ document.fdatosejecucion.submit();
+ }
+ }
+//________________________________________________________________________________________________________
+ function cancelar(){
+ alert(CTbMsg[0]);
+ location.href="../nada.php"
+ }
+//________________________________________________________________________________________________________
+ function comprobar_datos(){
+ tb_conf=document.getElementById("tabla_conf");
+ var ochecks=tb_conf.getElementsByTagName('INPUT')
+ var op=0
+ for(var i=0;i<ochecks.length;i++){
+ if(ochecks[i].checked) op++;
+ }
+ if(op==0){
+ alert(TbMsg[1])
+ return(false);
+ }
+ return(comprobar_datosejecucion());
+}
diff --git a/admin/WebConsole/asistentes/jscripts/Reiniciar.js b/admin/WebConsole/asistentes/jscripts/Reiniciar.js
new file mode 100644
index 00000000..579ccdb5
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/Reiniciar.js
@@ -0,0 +1,24 @@
+// *************************************************************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: Reiniciar.js
+// Descripción :
+// Este fichero implementa las funciones javascript del fichero Reiniciar.php (Comandos)
+// *************************************************************************************************************************************************
+ function confirmar(){
+ if (comprobar_datos()){
+ document.fdatosejecucion.submit();
+ }
+ }
+//__________________________________________________________________________________________________
+ function cancelar(){
+ alert(CTbMsg[0]);
+ location.href="../nada.php"
+}
+//__________________________________________________________________________________________________
+ function comprobar_datos(){
+ return(comprobar_datosejecucion())
+}
+
diff --git a/admin/WebConsole/asistentes/jscripts/RestaurarImagen.js b/admin/WebConsole/asistentes/jscripts/RestaurarImagen.js
new file mode 100644
index 00000000..eb436aeb
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/RestaurarImagen.js
@@ -0,0 +1,95 @@
+// *************************************************************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: RestaurarImagen.js
+// Descripción :
+// Este fichero implementa las funciones javascript del fichero RestaurarImagen.php (Comandos)
+// *************************************************************************************************************************************************
+ function confirmar(){
+ if(comprobar_datos()){
+ var RC="@";
+ var disco=1; // Siempre disco 1
+ var atributos="dsk="+disco+RC;
+ var tb_conf=document.getElementById("tabla_conf");
+ var ochecks=tb_conf.getElementsByTagName('INPUT')
+ for(var i=0;i<ochecks.length;i++){
+ if(ochecks[i].checked){
+ var idradio=ochecks[i].id;
+ var numpar=ochecks[i].value;
+
+ atributos+="par="+numpar+RC; // Número de partición
+ var despleimagenizda=document.getElementById("despleimagen_"+idradio+"_1");
+ var despleimagendrcha=document.getElementById("despleimagen_"+idradio+"_0");
+ var despleimagen;
+
+ var protoclonacion=document.getElementById("protoclonacion_"+idradio);
+
+ if(despleimagenizda.selectedIndex>0) despleimagen=despleimagenizda;
+ if(despleimagendrcha.selectedIndex>0) despleimagen=despleimagendrcha;
+ var imgcanrepo=despleimagen.value.split("_");
+ atributos+="idi="+imgcanrepo[0]+RC; // Identificador de la imagen
+ atributos+="nci="+imgcanrepo[1]+RC; // Nombre canónico
+ atributos+="ipr="+imgcanrepo[2]+RC; // Ip del repositorio donde está alojada
+ atributos+="ifs="+imgcanrepo[3]+RC; // Identificador del perfil soft contenido en la imagen
+ atributos+="ptc="+protoclonacion.value+RC; // Identificador del protocolo de clonación
+
+ var cc=ochecks[i].getAttribute('idcfg'); // Toma identificador del bloque de configuración
+
+ if(document.fdatosejecucion.ambito.value!=AMBITO_ORDENADORES){
+ var tbOrd=document.getElementById("tbOrd_"+cc);
+ var idordenadores=tbOrd.getAttribute('value'); // Toma identificadores de los ordenadores
+ var cadenaid=document.fdatos.cadenaid.value; // Cadena de identificadores de todos los ordenadores del ámbito
+ if(idordenadores!=cadenaid){
+ document.fdatosejecucion.ambito.value=0; // Ambito de aplicación restringido
+ document.fdatosejecucion.idambito.value=idordenadores;
+ }
+ }
+ document.fdatosejecucion.atributos.value=atributos;
+ document.fdatosejecucion.submit();
+ break;
+ }
+ }
+ }
+ }
+//________________________________________________________________________________________________________
+ function cancelar(){
+ alert(CTbMsg[0]);
+ location.href="../nada.php"
+ }
+//________________________________________________________________________________________________________
+ function comprobar_datos()
+{
+ tb_conf=document.getElementById("tabla_conf");
+ var ochecks=tb_conf.getElementsByTagName('INPUT')
+ var op=0
+ for(var i=0;i<ochecks.length;i++){
+ if(ochecks[i].checked){
+ op++;
+ var idradio=ochecks[i].id; // Toma idemtificador del desplegable de imagenes
+ despleimagenizda=document.getElementById("despleimagen_"+idradio+"_1"); // Desplegable izda.
+ despleimagendcha=document.getElementById("despleimagen_"+idradio+"_0"); // Desplegable derecha.
+
+ var p1=despleimagenizda.selectedIndex // Toma índice seleccionado
+ var p2=despleimagendcha.selectedIndex // Toma índice seleccionado
+
+ if (p1==0 && p2==0){
+ alert(TbMsg[0])
+ despleimagenizda.focus()
+ return(false)
+ }
+ if (p1==p2){
+ alert(TbMsg[6])
+ despleimagenizda.focus()
+ return(false)
+ }
+ }
+ }
+ if(op==0){
+ alert(TbMsg[1])
+ return(false);
+ }
+ return(comprobar_datosejecucion())
+}
+
diff --git a/admin/WebConsole/asistentes/jscripts/asistentes.js b/admin/WebConsole/asistentes/jscripts/asistentes.js
new file mode 100644
index 00000000..3dd08014
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/asistentes.js
@@ -0,0 +1,102 @@
+// ***********************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor:
+// Fecha Creación: 2011
+// Fecha Última modificación: enero-2011
+// Nombre del fichero: asistentes.js
+// Descripción :
+// Este fichero implementa las funciones javascript del fichero AsistentesEjecutarScripts.php (Comandos)
+// ***********************************************************************************************************
+
+function codeCloneRemotePartition(form){
+switch (form.idmetodo.value)
+{
+ case "MULTICAST":
+ protocol="MULTICAST " + form.mcastpuerto.value + ":" + form.mcastmodo.value + ":" + form.mcastdireccion.value + ":" + form.mcastvelocidad.value + "M:" + form.mcastnclien.value + ":" + form.mcastseg.value + " ";
+ break;
+ case "UNICAST":
+ protocol="UNICAST " + form.ucastport.value + ":" + form.ucastclient.value + " ";
+ break;
+}
+//form.codigo.value="cloneRemoteFromMaster " + form.ipMaster.value + " 1 " + form.PartOrigen.value + " " + form.mcastpuerto.value + ":" + form.mcastmodo.value + ":" + form.mcastdireccion.value + ":" + form.mcastvelocidad.value + "M:" + form.mcastnclien.value + ":" + form.mcastseg.value + " 1 " + form.PartOrigen.value + " " + form.tool.value + " " + form.compresor.value;
+form.codigo.value="cloneRemoteFromMaster " + form.ipMaster.value + " 1 " + form.PartOrigen.value + " " + protocol + " 1 " + form.PartOrigen.value + " " + form.tool.value + " " + form.compresor.value;
+
+}
+
+function codeDeployImage(form){
+switch (form.idmetodo.value)
+{
+ case "MULTICAST":
+ protocol="MULTICAST " + form.mcastpuerto.value + ":" + form.mcastmodo.value + ":" + form.mcastdireccion.value + ":" + form.mcastvelocidad.value + "M:" + form.mcastnclien.value + ":" + form.mcastseg.value + " ";
+ break;
+ case "TORRENT":
+ protocol=" TORRENT " + form.modp2p.value + ":" + form.timep2p.value;
+ break;
+}
+//form.codigo.value="deployImage REPO /";
+form.codigo.value="deployImage REPO /" + form.idimagen.value + " 1 " + form.idparticion.value + " " + protocol ;
+}
+
+function codeParticionado(form){
+var value1;
+var value2;
+var value3;
+var precache;
+if (form.check1.checked) {
+ if (form.part1.value == "CUSTOM" ) {value1 = form.part1custom.value}
+ else {value1 = form.part1.value};
+ if (form.size1.value == "CUSTOM") {value1 += ":" + form.size1custom.value}
+ else {value1 += ":" + form.size1.value};
+}
+else
+{
+ value1 = "EMPTY:0"
+}
+if (form.check2.checked) {
+ if (form.part2.value == "CUSTOM" ) {value2 = form.part2custom.value}
+ else {value2 = form.part2.value};
+ if (form.size2.value == "CUSTOM") {value2 += ":" + form.size2custom.value}
+ else {value2 += ":" + form.size2.value};
+}
+else
+{
+ value2 = "EMPTY:0"
+}
+if (form.check3.checked) {
+ if (form.part3.value == "CUSTOM" ) {value3 = form.part3custom.value}
+ else {value3 = form.part3.value};
+ if (form.size3.value == "CUSTOM") {value3 += ":" + form.size3custom.value}
+ else {value3 += ":" + form.size3.value};
+}
+else
+{
+ value3 = "EMPTY:0"
+}
+
+if (form.size4.value == "0") {
+precache="ogUnmountCache \n ogUnmountAll 1 \n sizecache=`ogGetPartitionSize 1 4` \n ogDeletePartitionTable 1 \n ogUpdatePartitionTable 1 \n initCache $sizecache ";
+//alert(precache);
+}
+else
+{
+ if (form.size4.value == "CUSTOM")
+ {
+ cachesize = form.size4custom.value;
+ }
+ else
+ {
+ cachesize = form.size4.value;
+ }
+ precache="ogUnmountCache \n ogUnmountAll 1 \n ogDeletePartitionTable 1 \n ogUpdatePartitionTable 1 \n initCache " + cachesize + " ";
+ //alert(precache);
+}
+
+
+form.codigo.value="\
+" + precache + " \n \
+ogListPartitions 1 \n \
+ogCreatePartitions 1 " + value1 + " " + value2 + " " + value3 + " \n \
+ogSetPartitionActive 1 1 \n \
+ogUpdatePartitionTable 1 \n \
+ogListPartitions 1 \n";
+}
diff --git a/admin/WebConsole/asistentes/jscripts/comunescomandos.js b/admin/WebConsole/asistentes/jscripts/comunescomandos.js
new file mode 100644
index 00000000..b82bfa29
--- /dev/null
+++ b/admin/WebConsole/asistentes/jscripts/comunescomandos.js
@@ -0,0 +1,190 @@
+// *************************************************************************************************************************************************
+// Libreria de scripts de Javascript
+// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
+// Fecha Creación: 2009-2010
+// Fecha Última modificación: Agosto-2010
+// Nombre del fichero: comunescomandos.js
+// Descripción :
+// Este fichero implementa las funciones javascript comunes a todos los comandos
+// *************************************************************************************************************************************************
+ function comprobar_datosejecucion(){
+ /* Comprobación de las opciones de ejecución */
+ var sw_ejya=document.fdatosejecucion.sw_ejya.checked;
+ var sw_ejprg=document.fdatosejecucion.sw_ejprg.checked;
+
+ var sw_seguimientocon=document.fdatosejecucion.sw_seguimiento[0].checked;
+ var sw_seguimientosin=document.fdatosejecucion.sw_seguimiento[1].checked;
+
+ var sw_mkprocedimiento=document.fdatosejecucion.sw_mkprocedimiento.checked;
+ var sw_nuevaprocedimiento=document.fdatosejecucion.sw_procedimiento[0].checked;
+ var descripcion_nuevaprocedimiento=document.fdatosejecucion.nombreprocedimiento.value;
+ var sw_procedimientoexistente=document.fdatosejecucion.sw_procedimiento[1].checked;
+
+ var sw_mktarea=document.fdatosejecucion.sw_mktarea.checked;
+ var sw_nuevatarea=document.fdatosejecucion.sw_tarea[0].checked;
+ var descripcion_nuevatarea=document.fdatosejecucion.nombretarea.value;
+ var sw_tareaexistente=document.fdatosejecucion.sw_tarea[1].checked;
+
+ var pprocedimiento=document.fdatosejecucion.idprocedimiento.selectedIndex
+ var ptarea=document.fdatosejecucion.idtarea.selectedIndex
+
+ if(!sw_ejya && !sw_ejprg && !sw_mkprocedimiento && !sw_mktarea ){
+ alert("ATENCIÓN.- Debe elegir al menos un modo de ejecución");
+ return(false);
+ }
+
+ // Cuestión procedimiento ---------------------------------------------------------------------
+
+ if(sw_ejya){
+ if(!sw_seguimientocon && !sw_seguimientosin){
+ alert("ATENCIÓN.- Debe elegir un modo de ejecución inmediata");
+ return(false);
+ }
+ }
+ // Cuestión procedimiento -----------------------------------------------------------------------
+ if(sw_mkprocedimiento){
+ if(!sw_nuevaprocedimiento && !sw_procedimientoexistente){
+ alert("ATENCIÓN.- Debe elegir un modo de inclusión en procedimiento de este comando");
+ return(false);
+ }
+ if(sw_nuevaprocedimiento && descripcion_nuevaprocedimiento==""){
+ alert("ATENCIÓN.- Debe especificar el nombre del nuevo procedimiento que se creará y al que se añadirá este comando");
+ document.fdatosejecucion.nombreprocedimiento.focus();
+ return(false);
+ }
+ if(sw_procedimientoexistente && pprocedimiento==0){
+ alert("ATENCIÓN.- Debe elegir el procedimiento al que se añadirá este comando");
+ document.fdatosejecucion.idprocedimiento.focus();
+ return(false);
+ }
+ }
+
+ // Cuestión tarea ------------------------------------------------------------------------------------------------------------------------------
+ if(sw_mktarea){
+ if(!sw_nuevatarea && !sw_tareaexistente){
+ alert("ATENCIÓN.- Debe elegir un modo de inclusión en tarea ejecutable, de este comando");
+ return(false);
+ }
+ if(sw_nuevatarea && descripcion_nuevatarea==""){
+ alert("ATENCIÓN.- Debe especificar el nombre de la nueva tarea ejecutable que se creará y a la que se añadirá este comando");
+ document.fdatosejecucion.nombretarea.focus();
+ return(false);
+ }
+ if(sw_tareaexistente && ptarea==0){
+ alert("ATENCIÓN.- Debe elegir la tarea a la que se añadirá este comando");
+ document.fdatosejecucion.idtarea.focus();
+ return(false);
+ }
+ }
+ //-----------------------------------------------------------------------------------------------------------------------------------------------------
+ return(true)
+}
+//____________________________________________________________________________
+function clic_mktarea(o){
+ if(!o.checked){
+ document.fdatosejecucion.sw_tarea[0].checked=false;
+ document.fdatosejecucion.nombretarea.value="";
+ document.fdatosejecucion.sw_tarea[1].checked=false;
+ document.fdatosejecucion.idtarea.selectedIndex=0;
+ }
+}
+function clic_nwtarea(o){
+ if(o.checked){
+ document.fdatosejecucion.sw_mktarea.checked=true;
+ document.fdatosejecucion.sw_tarea[1].checked=false;
+ document.fdatosejecucion.idtarea.selectedIndex=0;
+ }
+}
+function clic_extarea(o){
+ if(o.checked){
+ document.fdatosejecucion.sw_mktarea.checked=true;
+ document.fdatosejecucion.sw_tarea[0].checked=false;
+ document.fdatosejecucion.nombretarea.value="";
+ }
+}
+function clic_nomtarea(o){
+ document.fdatosejecucion.sw_mktarea.checked=true;
+ document.fdatosejecucion.sw_tarea[0].checked=true;
+ document.fdatosejecucion.idtarea.selectedIndex=0;
+}
+function clic_mkprocedimiento(o){
+ if(!o.checked){
+ document.fdatosejecucion.sw_procedimiento[0].checked=false;
+ document.fdatosejecucion.nombreprocedimiento.value="";
+ document.fdatosejecucion.sw_procedimiento[1].checked=false;
+ document.fdatosejecucion.idprocedimiento.selectedIndex=0;
+ }
+}
+function clic_nwprocedimiento(o){
+ if(o.checked){
+ document.fdatosejecucion.sw_mkprocedimiento.checked=true;
+ document.fdatosejecucion.sw_procedimiento[1].checked=false;
+ document.fdatosejecucion.idprocedimiento.selectedIndex=0;
+ }
+}
+function clic_exprocedimiento(o){
+ if(o.checked){
+ document.fdatosejecucion.sw_mkprocedimiento.checked=true;
+ document.fdatosejecucion.sw_procedimiento[0].checked=false;
+ document.fdatosejecucion.nombreprocedimiento.value="";
+ }
+}
+function clic_nomprocedimiento(o){
+ document.fdatosejecucion.sw_mkprocedimiento.checked=true;
+ document.fdatosejecucion.sw_procedimiento[0].checked=true;
+ document.fdatosejecucion.idprocedimiento.selectedIndex=0;
+}
+
+function procedimientoexistente(o){
+ document.fdatosejecucion.sw_mkprocedimiento.checked=true;
+ document.fdatosejecucion.sw_procedimiento[1].checked=true;
+ document.fdatosejecucion.nombreprocedimiento.value="";
+}
+
+function tareaexistente(o){
+ document.fdatosejecucion.sw_mktarea.checked=true;
+ document.fdatosejecucion.sw_tarea[1].checked=true;
+ document.fdatosejecucion.nombretarea.value="";
+}
+//____________________________________________________________________________
+function compone_urlejecucion(){
+
+ var wurl=""
+
+ var sw_ejya=document.fdatosejecucion.sw_ejya.checked;
+ var sw_seguimiento=document.fdatosejecucion.sw_seguimiento[0].checked;
+
+ var sw_ejprg=document.fdatosejecucion.sw_ejprg.checked;
+
+ var sw_mkprocedimiento=document.fdatosejecucion.sw_mkprocedimiento.checked;
+ if (document.fdatosejecucion.sw_procedimiento[0].checked){
+ var nwidprocedimiento=0
+ var nwdescriprocedimiento=document.fdatosejecucion.nombreprocedimiento.value;
+ }
+ else{
+ var p=document.fdatosejecucion.idprocedimiento.selectedIndex
+ var nwidprocedimiento=document.fdatosejecucion.idprocedimiento.options[p].value
+ var nwdescriprocedimiento=document.fdatosejecucion.idprocedimiento.options[p].text
+ }
+
+ var sw_mktarea=document.fdatosejecucion.sw_mktarea.checked;
+ if (document.fdatosejecucion.sw_tarea[0].checked){
+ var nwidtarea=0
+ var nwdescritarea=document.fdatosejecucion.nombretarea.value;
+ }
+ else{
+ var p=document.fdatosejecucion.idtarea.selectedIndex
+ var nwidtarea=document.fdatosejecucion.idtarea.options[p].value
+ var nwdescritarea=document.fdatosejecucion.idtarea.options[p].text
+ }
+ wurl+="sw_ejya="+sw_ejya +"&sw_seguimiento="+sw_seguimiento+"sw_ejprg="+sw_ejprg+"&sw_mktarea="+sw_mktarea+"&nwidtarea="+nwidtarea+"&nwdescritarea="+nwdescritarea
+ wurl+="&sw_mkprocedimiento="+sw_mkprocedimiento+"&nwidprocedimiento="+nwidprocedimiento+"&nwdescriprocedimiento="+nwdescriprocedimiento
+ return(wurl)
+}
+//________________________________________________________________________________________________________
+//
+// Resultado ejecución de un comando
+//________________________________________________________________________________________________________
+function resultado_comando(resul){
+ alert(CTbMsg[resul]);
+}
diff --git a/admin/WebConsole/asistentes/xajax.common.php b/admin/WebConsole/asistentes/xajax.common.php
new file mode 100644
index 00000000..7a97f2e8
--- /dev/null
+++ b/admin/WebConsole/asistentes/xajax.common.php
@@ -0,0 +1,7 @@
+<?php
+//importando las librerias XAJAX
+require ("/opt/opengnsys/www/xajax/xajax_core/xajax.inc.php");
+$xajax = new xajax("xajax.server.php");
+//asociamos la funci�n creada en index.server.php al objeto XAJAX
+$xajax->registerFunction("ListarOrigenMaster");
+?> \ No newline at end of file
diff --git a/admin/WebConsole/asistentes/xajax.server.php b/admin/WebConsole/asistentes/xajax.server.php
new file mode 100644
index 00000000..9e0fafa6
--- /dev/null
+++ b/admin/WebConsole/asistentes/xajax.server.php
@@ -0,0 +1,70 @@
+<?php
+//importando nuestras las referencias XAJAX
+require ("xajax.common.php");
+
+
+//función que lista las Particiones segun la IP elegida
+function ListarOrigenMaster($ip){
+
+ include_once("../includes/ctrlacc.php");
+ include_once("../clases/AdoPhp.php");
+ include_once("../includes/constantes.php");
+ include_once("../includes/comunes.php");
+ include_once("../includes/CreaComando.php");
+ include_once("../includes/HTMLSELECT.php");
+
+
+ //instanciamos el objeto para la respuesta AJAX
+ $objResponse = new xajaxResponse();
+
+ $SelectHtml=" ";
+ $cmd=CreaComando($cadenaconexion);
+
+ $cmd->texto='SELECT ordenadores_particiones.numpar as PART,nombresos.nombreso as OS
+ FROM ordenadores_particiones INNER JOIN tipospar ON tipospar.codpar=ordenadores_particiones.codpar
+ INNER JOIN nombresos ON ordenadores_particiones.idnombreso=nombresos.idnombreso
+ INNER JOIN ordenadores ON ordenadores_particiones.idordenador=ordenadores.idordenador
+ WHERE ordenadores.ip="' .$ip . '"
+ AND tipospar.clonable>0
+ AND ordenadores_particiones.idnombreso>0
+ ORDER BY ordenadores_particiones.numpar';
+
+ $rs=new Recordset;
+ $rs->Comando=&$cmd;
+
+
+
+ if ($rs->Abrir()){
+ $cantRegistros=$rs->numeroderegistros;
+ if($cantRegistros>0){
+ $SelectHtml='<select name="PartOrigen"> <option value="">--Particion a Enviar--</option>';
+ $rs->Primero();
+ while (!$rs->EOF){
+ $SelectHtml.='<OPTION value="'.$rs->campos["PART"].'"';
+ $SelectHtml.='>';
+ $SelectHtml.= $rs->campos["OS"].'</OPTION>';
+ $rs->Siguiente();
+ }
+ }
+ else
+ {
+ $objResponse->alert("Este equipo No tiene particiones clonables.");
+ }
+ $rs->Cerrar();
+ }
+ $SelectHtml.= '</SELECT>';
+
+
+ //asignando el contenido de la varabiale $SelectHTML al div que esta en la paquina inicial
+ $objResponse->assign("divListado","innerHTML",$SelectHtml);
+
+
+ return $objResponse; //retornamos la respuesta AJAX
+}
+
+$xajax->processRequest(); //procesando cualquier petición AJAX
+
+
+
+
+?> \ No newline at end of file
diff --git a/admin/WebConsole/gestores/gestor_aulas.php b/admin/WebConsole/gestores/gestor_aulas.php
index 27447ac5..013c03c1 100644
--- a/admin/WebConsole/gestores/gestor_aulas.php
+++ b/admin/WebConsole/gestores/gestor_aulas.php
@@ -41,7 +41,12 @@ $modomul=0;
$ipmul="";
$pormul=0;
$velmul=0;
-
+############## ADV
+$router=0;
+$netmask=0;
+$modp2p=0;
+$timep2p=0;
+############ ADV
if (isset($_POST["opcion"])) $opcion=$_POST["opcion"]; // Recoge parametros
if (isset($_POST["grupoid"])) $grupoid=$_POST["grupoid"];
@@ -66,6 +71,12 @@ if (isset($_POST["modomul"])) $modomul=$_POST["modomul"];
if (isset($_POST["ipmul"])) $ipmul=$_POST["ipmul"];
if (isset($_POST["pormul"])) $pormul=$_POST["pormul"];
if (isset($_POST["velmul"])) $velmul=$_POST["velmul"];
+############## ADV
+if (isset($_POST["router"])) $router=$_POST["router"];
+if (isset($_POST["netmask"])) $netmask=$_POST["netmask"];
+if (isset($_POST["modp2p"])) $modp2p=$_POST["modp2p"];
+if (isset($_POST["timep2p"])) $timep2p=$_POST["timep2p"];
+################# ADV
$gidmenu=0;
$gidproautoexec=0;
@@ -166,12 +177,20 @@ function Gestiona(){
global $ipmul;
global $pormul;
global $velmul;
-
+######################### ADV
+ global $router;
+ global $netmask;
+ global $modp2p;
+ global $timep2p;
+########################## ADV
+
global $op_alta;
global $op_modificacion;
global $op_eliminacion;
global $tablanodo;
+
+
$cmd->CreaParametro("@grupoid",$grupoid,1);
$cmd->CreaParametro("@idcentro",$idcentro,1);
@@ -194,13 +213,19 @@ function Gestiona(){
$cmd->CreaParametro("@ipmul",$ipmul,0);
$cmd->CreaParametro("@pormul",$pormul,1);
$cmd->CreaParametro("@velmul",$velmul,1);
+############ ADV
+ $cmd->CreaParametro("@netmask",$netmask,0);
+ $cmd->CreaParametro("@router",$router,0);
+ $cmd->CreaParametro("@modp2p",$modp2p,0);
+ $cmd->CreaParametro("@timep2p",$timep2p,1);
+############### ADV
switch($opcion){
case $op_alta :
$cmd->texto="INSERT INTO aulas(idcentro,grupoid,nombreaula,urlfoto,cagnon,pizarra,ubicacion,comentarios,
- puestos,horaresevini,horaresevfin,modomul,ipmul,pormul,velmul)
+ puestos,horaresevini,horaresevfin,modomul,ipmul,pormul,velmul,router,netmask,modp2p,timep2p)
VALUES (@idcentro,@grupoid,@nombreaula,@urlfoto,@cagnon,@pizarra,@ubicacion,@comentarios,
- @puestos,@horaresevini,@horaresevfin,@modomul,@ipmul,@pormul,@velmul)";
+ @puestos,@horaresevini,@horaresevfin,@modomul,@ipmul,@pormul,@velmul,@router,@netmask,@modp2p,@timep2p)";
$resul=$cmd->Ejecutar();
if ($resul){ // Crea una tabla nodo para devolver a la página que llamó ésta
$idaula=$cmd->Autonumerico();
@@ -214,7 +239,7 @@ function Gestiona(){
case $op_modificacion:
$cmd->texto="UPDATE aulas SET nombreaula=@nombreaula,urlfoto=@urlfoto,cagnon=@cagnon,pizarra=@pizarra,
ubicacion=@ubicacion,comentarios=@comentarios,puestos=@puestos,horaresevini=@horaresevini,
- horaresevfin=@horaresevfin,modomul=@modomul,ipmul=@ipmul,pormul=@pormul,velmul=@velmul WHERE idaula=@idaula";
+ horaresevfin=@horaresevfin,modomul=@modomul,ipmul=@ipmul,pormul=@pormul,velmul=@velmul,router=@router,netmask=@netmask,modp2p=@modp2p,timep2p=@timep2p WHERE idaula=@idaula";
$resul=$cmd->Ejecutar();
//echo $cmd->texto;
if ($resul){ // Crea una tabla nodo para devolver a la página que llamó ésta
diff --git a/admin/WebConsole/gestores/gestor_ordenadores.php b/admin/WebConsole/gestores/gestor_ordenadores.php
index 3316c428..3b5645b4 100644
--- a/admin/WebConsole/gestores/gestor_ordenadores.php
+++ b/admin/WebConsole/gestores/gestor_ordenadores.php
@@ -31,6 +31,10 @@ $idmenu=0;
$idprocedimiento=0;
$idimagen=0;
$cache=0;
+#### ADV
+$netiface="";
+$netdriver="";
+### ADV
if (isset($_POST["opcion"])) $opcion=$_POST["opcion"]; // Recoge parametros
if (isset($_POST["grupoid"])) $grupoid=$_POST["grupoid"];
@@ -48,6 +52,9 @@ if (isset($_POST["cache"])) $cache=$_POST["cache"];
if(empty($cache)) $cache=0;
+if (isset($_POST["netiface"])) $netiface=$_POST["netiface"];
+if (isset($_POST["netdriver"])) $netdriver=$_POST["netdriver"];
+
$tablanodo=""; // Arbol para nodos insertados
//________________________________________________________________________________________________________
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
@@ -138,6 +145,8 @@ function Gestiona(){
global $idmenu;
global $idprocedimiento;
global $cache;
+ global $netiface;
+ global $netdriver;
global $op_alta;
global $op_modificacion;
@@ -156,12 +165,15 @@ function Gestiona(){
$cmd->CreaParametro("@idmenu",$idmenu,1);
$cmd->CreaParametro("@idprocedimiento",$idprocedimiento,1);
$cmd->CreaParametro("@cache",$cache,1);
+ $cmd->CreaParametro("@netiface",$netiface,0);
+ $cmd->CreaParametro("@netdriver",$netdriver,0);
+
switch($opcion){
case $op_alta :
$cmd->texto="INSERT INTO ordenadores(nombreordenador,ip,mac,idperfilhard,idrepositorio,
- idmenu,idproautoexec,idaula,grupoid,cache) VALUES (@nombreordenador,@ip,@mac,@idperfilhard,@idrepositorio,
- @idmenu,@idprocedimiento,@idaula,@grupoid,@cache)";
+ idmenu,idproautoexec,idaula,grupoid,cache,netiface,netdriver) VALUES (@nombreordenador,@ip,@mac,@idperfilhard,@idrepositorio,
+ @idmenu,@idprocedimiento,@idaula,@grupoid,@cache,@netiface,@netdriver)";
$resul=$cmd->Ejecutar();
//echo $cmd->texto;
@@ -176,7 +188,7 @@ function Gestiona(){
break;
case $op_modificacion:
$cmd->texto="UPDATE ordenadores SET nombreordenador=@nombreordenador,ip=@ip,mac=@mac,idperfilhard=@idperfilhard,
- idrepositorio=@idrepositorio,idmenu=@idmenu,idproautoexec=@idprocedimiento,cache=@cache
+ idrepositorio=@idrepositorio,idmenu=@idmenu,idproautoexec=@idprocedimiento,cache=@cache,netiface=@netiface,netdriver=@netdriver
WHERE idordenador=@idordenador";
$resul=$cmd->Ejecutar();
//echo $cmd->texto;
diff --git a/admin/WebConsole/gestores/gestor_pxe.php b/admin/WebConsole/gestores/gestor_pxe.php
new file mode 100755
index 00000000..f585a9d5
--- /dev/null
+++ b/admin/WebConsole/gestores/gestor_pxe.php
@@ -0,0 +1,179 @@
+<?php
+include_once("../includes/ctrlacc.php");
+include_once("../clases/AdoPhp.php");
+include_once("../clases/XmlPhp.php");
+include_once("../clases/MenuContextual.php");
+include_once("../clases/SockHidra.php");
+include_once("../includes/constantes.php");
+include_once("../includes/comunes.php");
+include_once("../includes/CreaComando.php");
+include_once("../idiomas/php/".$idioma."/aulas_".$idioma.".php");
+
+$cmd=CreaComando($cadenaconexion);
+if (!$cmd)
+ Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
+//________________________________________________________________________________________________________
+
+
+echo "<html>";
+echo "<head>";
+echo "<meta http-equiv='Refresh' content='1;URL=../principal/boot.php?idambito=". $_GET['idaula'] ."&nombreambito=" . $_GET['nombreambito'] . "&litambito=" . $_GET['litambito'] . "'>";
+echo "<title> gestion de equipos </title>";
+echo "<base target='principal'>";
+echo "</head>";
+echo "<body>";
+
+
+
+#echo('litambito con valor: '. $_GET['litambito']);
+#echo ('idambito con valor: ' . $_GET['idaula']);
+#echo ('nombreambito con valor: ' . $_GET['nombreambito']);
+
+$lista = explode(";",$_POST['listOfItems']);
+foreach ($lista as $sublista) {
+ $elementos = explode("|",$sublista);
+ $hostname=$elementos[1];
+ $optboot=$elementos[0];
+ ogBootServer($cmd,$optboot,$hostname);
+}
+echo " </body>";
+echo " </html> ";
+
+function ogBootServer($cmd,$optboot,$hostname)
+{
+global $cmd;
+global $hostname;
+global $optboot;
+$cmd->CreaParametro("@optboot",$optboot,0);
+$cmd->CreaParametro("@hostname",$hostname,0);
+$cmd->texto="update ordenadores set arranque=@optboot where nombreordenador=@hostname";
+$cmd->Ejecutar();
+
+$cmd->texto="SELECT ordenadores.ip AS ip, ordenadores.mac AS mac,
+ ordenadores.netiface AS netiface, aulas.netmask AS netmask, aulas.router AS router,
+ repositorios.ip AS iprepo FROM ordenadores
+ join aulas on ordenadores.idaula=aulas.idaula
+ join repositorios on ordenadores.idrepositorio=repositorios.idrepositorio
+ where ordenadores.nombreordenador='". $hostname ."'";
+$rs=new Recordset;
+$rs->Comando=&$cmd;
+if (!$rs->Abrir()) echo "error";
+$rs->Primero();
+ $mac=$rs->campos["mac"];
+ $netiface=$rs->campos["netiface"];
+ $ip=$rs->campos["ip"];
+ $router=$rs->campos["router"];
+ $netmask=$rs->campos["netmask"];
+ $repo=$rs->campos["iprepo"];
+ $infohost=" ip="
+ . $ip . ":"
+ . $repo .":"
+ . $router . ":"
+ . $netmask .":"
+ . $hostname .":"
+ . $netiface . ":none ogrepo="
+ . $repo;
+$rs->Cerrar();
+
+###################obtenemos las variables de red del aula.
+
+ #02.1 obtenemos nombre fichero mac
+ $mac= substr($mac,0,2) . ":" . substr($mac,2,2) . ":" . substr($mac,4,2) . ":" . substr($mac,6,2) . ":" . substr($mac,8,2) . ":" . substr($mac,10,2);
+ $macfile="01-" . str_replace(":","-",strtolower($mac));
+ $nombre_archivo="/var/lib/tftpboot/pxelinux.cfg/" . $macfile;
+
+
+########## Escribimos el fichero mac
+if (!$gestion=fopen($nombre_archivo, 'w+'))
+{
+ echo "No se puede abrir el archivo ($nombre_archivo)";
+ return;
+}
+# cuales son los parametros del menu
+fwrite($gestion, "DEFAULT syslinux/vesamenu.c32 \n");
+fwrite($gestion, "MENU TITLE Aplicacion OpenGnsys \n");
+
+$cmd->texto="SELECT itemboot.label, itemboot.kernel,
+ itemboot.append, menuboot.timeout, menuboot.prompt,
+ menuboot.description, menuboot_itemboot.default
+ From itemboot,menuboot_itemboot,menuboot
+ WHERE menuboot_itemboot.labelmenu=menuboot.label
+ AND menuboot_itemboot.labelitem=itemboot.label
+ AND menuboot.label='" . $optboot . "'";
+
+$rs->Comando=&$cmd;
+if (!$rs->Abrir()) echo "error";
+$rs->Primero();
+while (!$rs->EOF)
+{
+ fwrite($gestion, " \n");
+ fwrite($gestion, "LABEL " . $rs->campos['label'] . " \n");
+ fwrite($gestion, "MENU LABEL " . $rs->campos['label'] . " \n");
+ if ( $rs->campos["default"] == true)
+ {
+ fwrite($gestion, "MENU DEFAULT \n");
+ }
+ fwrite($gestion, $rs->campos["kernel"] . " \n");
+ # set netmask cird para ogclient
+ $isnfsroot=substr_count($rs->campos["append"] , "boot=oginit");
+ if ($isnfsroot > 0)
+ {
+ $netmask=$netmask;
+ }
+ else
+ {
+ $netmask=netmask2cidr($netmask);
+ }
+
+ $iseac=substr_count($rs->campos["append"] , "boot=oginit");
+ $isinitrd=substr_count($rs->campos["append"] , "initrd.gz");
+
+ if ($iseac > 0)
+ {
+ $append=$rs->campos["append"];
+ fwrite($gestion, $append . " " . $infohost . " \n ");
+ }
+
+ elseif ($isinitrd > 0)
+ {
+ $append=$rs->campos["append"];
+ fwrite($gestion, $append . " ogrepo=" . $repo . " \n");
+ }
+ else
+ {
+ fwrite($gestion, $rs->campos["append"] . " \n");
+ }
+
+ $prompt=$rs->campos["prompt"];
+ $timeout=$rs->campos["timeout"];
+
+ $rs->Siguiente();
+}
+$rs->Cerrar();
+
+
+
+ fwrite($gestion, " \n");
+ fwrite($gestion, "PROMPT " . $prompt ." \n");
+ fwrite($gestion, "TIMEOUT " . $timeout . " \n");
+ fwrite($gestion, " \n");
+ fclose($gestion);
+ exec("chown www-data:www-data /var/lib/tftpboot/pxelinux.cfg/". $macfile);
+ exec("chmod 777 /var/lib/tftpboot/pxelinux.cfg/". $macfile);
+
+
+
+
+}
+
+function netmask2cidr($netmask) {
+ $cidr = 0;
+ foreach (explode('.', $netmask) as $number) {
+ for (;$number> 0; $number = ($number <<1) % 256) {
+ $cidr++;
+ }
+ }
+ return $cidr;
+ }
+
+?> \ No newline at end of file
diff --git a/admin/WebConsole/gestores/gestor_pxe_grub4dos.php b/admin/WebConsole/gestores/gestor_pxe_grub4dos.php
new file mode 100755
index 00000000..a82448f7
--- /dev/null
+++ b/admin/WebConsole/gestores/gestor_pxe_grub4dos.php
@@ -0,0 +1,186 @@
+<?php
+include_once("../includes/ctrlacc.php");
+include_once("../clases/AdoPhp.php");
+include_once("../clases/XmlPhp.php");
+include_once("../clases/MenuContextual.php");
+include_once("../clases/SockHidra.php");
+include_once("../includes/constantes.php");
+include_once("../includes/comunes.php");
+include_once("../includes/CreaComando.php");
+include_once("../idiomas/php/".$idioma."/aulas_".$idioma.".php");
+
+$cmd=CreaComando($cadenaconexion);
+if (!$cmd)
+ Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
+//________________________________________________________________________________________________________
+
+
+echo "<html>";
+echo "<head>";
+echo "<meta http-equiv='Refresh' content='1;URL=../principal/boot.php?idambito=". $_GET['idaula'] ."&nombreambito=" . $_GET['nombreambito'] . "&litambito=" . $_GET['litambito'] . "'>";
+echo "<title> gestion de equipos </title>";
+echo "<base target='principal'>";
+echo "</head>";
+echo "<body>";
+
+
+
+#echo('litambito con valor: '. $_GET['litambito']);
+#echo ('idambito con valor: ' . $_GET['idaula']);
+#echo ('nombreambito con valor: ' . $_GET['nombreambito']);
+
+$lista = explode(";",$_POST['listOfItems']);
+foreach ($lista as $sublista) {
+ $elementos = explode("|",$sublista);
+ $hostname=$elementos[1];
+ $optboot=$elementos[0];
+ ogBootServer($cmd,$optboot,$hostname);
+}
+echo " </body>";
+echo " </html> ";
+
+function ogBootServer($cmd,$optboot,$hostname)
+{
+global $cmd;
+global $hostname;
+global $optboot;
+global $retrun;
+$return="\n";
+$cmd->CreaParametro("@optboot",$optboot,0);
+$cmd->CreaParametro("@hostname",$hostname,0);
+$cmd->texto="update ordenadores set arranque=@optboot where nombreordenador=@hostname";
+$cmd->Ejecutar();
+
+$cmd->texto="SELECT ordenadores.ip AS ip, ordenadores.mac AS mac,
+ ordenadores.netiface AS netiface, aulas.netmask AS netmask, aulas.router AS router,
+ repositorios.ip AS iprepo FROM ordenadores
+ join aulas on ordenadores.idaula=aulas.idaula
+ join repositorios on ordenadores.idrepositorio=repositorios.idrepositorio
+ where ordenadores.nombreordenador='". $hostname ."'";
+$rs=new Recordset;
+$rs->Comando=&$cmd;
+if (!$rs->Abrir()) echo "error";
+$rs->Primero();
+ $mac=$rs->campos["mac"];
+ $netiface=$rs->campos["netiface"];
+ $ip=$rs->campos["ip"];
+ $router=$rs->campos["router"];
+ $netmask=$rs->campos["netmask"];
+ $repo=$rs->campos["iprepo"];
+ $infohost=" IP="
+ . $ip . ":"
+ . $repo .":"
+ . $router . ":"
+ . $netmask .":"
+ . $hostname .":"
+ . $netiface . ":none repo="
+ . $repo;
+$rs->Cerrar();
+
+###################obtenemos las variables de red del aula.
+
+ #02.1 obtenemos nombre fichero mac
+ $mac= substr($mac,0,2) . ":" . substr($mac,2,2) . ":" . substr($mac,4,2) . ":" . substr($mac,6,2) . ":" . substr($mac,8,2) . ":" . substr($mac,10,2);
+ $macfile="01-" . str_replace(":","-",strtoupper($mac));
+ $nombre_archivo="/var/lib/tftpboot/menu.lst/" . $macfile;
+
+
+########## Escribimos el fichero mac
+if (!$gestion=fopen($nombre_archivo, 'w+'))
+{
+ echo "No se puede abrir el archivo ($nombre_archivo)";
+ return;
+}
+# cuales son los parametros del menu
+fwrite($gestion, "color white/blue black/light-gray \n");
+
+
+$cmd->texto="SELECT itemboot.label, itemboot.kernel,
+ itemboot.append, menuboot.timeout, menuboot.prompt,
+ menuboot.description, menuboot_itemboot.default
+ From itemboot,menuboot_itemboot,menuboot
+ WHERE menuboot_itemboot.labelmenu=menuboot.label
+ AND menuboot_itemboot.labelitem=itemboot.label
+ AND menuboot.label='" . $optboot . "'";
+
+$rs->Comando=&$cmd;
+if (!$rs->Abrir()) echo "error";
+$rs->Primero();
+while (!$rs->EOF)
+{
+ fwrite($gestion, " \n");
+ fwrite($gestion, "LABEL " . $rs->campos['label'] . " \n");
+ fwrite($gestion, "MENU LABEL " . $rs->campos['label'] . " \n");
+ #if ( $rs->campos["default"] == true)
+ #{
+ # fwrite($gestion, "MENU DEFAULT \n");
+ #}
+
+
+ # set netmask cird para ogclient
+ $isogclient=substr_count($rs->campos["label"] , "og");
+ if ($isogclient > 0)
+ {
+ $netmask=$netmask;
+ $kernel=$rs->campos["kernel"];
+ $append=$rs->campos["append"];
+ fwrite($gestion,"keeppxe \n");
+ fwrite($gestion, $rs->campos["kernel"] . " " . $infohost . " \n");
+ fwrite($gestion, $rs->campos["append"] . " \n");
+ fwrite($gestion,"savedefault \n");
+ fwrite($gestion,"boot \n");
+
+ # fwrite($gestion,"APPEND keeppxe --config-file='pxe detect; default 0; timeout 0; hiddenmenu; title cache; fallback 1; find --set-root /boot/ogvmlinuz; kernel /boot/ogvmlinuz ro boot=oginit vga=788 irqpoll acpi=on " . $infohost . " ogprotocol=smb og2nd=sqfs ; initrd /boot/oginitrd.img; boot; title net; kernel (pd)/ogclient/vmlinuz ro boot=oginit vga=788 irqpoll acpi=on " . $infohost . " ogprotocol=smb og2nd=sqfs; initrd (pd)/ogclient/oginitrd.img; boot' \n");
+ # keeppxe
+ # kernel (pd)/ogclient/ogvmlinuz ro boot=oginit vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=true IP=172.17.9.204:172.17.9.249:172.17.9.254:255.255.255.0:cte204:eth0:none repo=172.17.9.249
+ # initrd (pd)/ogclient/oginitrd.img
+ # savedault
+ # boot
+
+
+ }
+ else
+ {
+ $netmask=netmask2cidr($netmask);
+ fwrite($gestion, $rs->campos["kernel"] . $return );
+ fwrite($gestion, $rs->campos["append"] . " \n");
+
+ }
+
+
+
+
+
+ # $prompt=$rs->campos["prompt"];
+ # $timeout=$rs->campos["timeout"];
+
+ $rs->Siguiente();
+}
+$rs->Cerrar();
+
+
+
+ fwrite($gestion, " \n");
+ fwrite($gestion, "PROMPT " . $prompt ." \n");
+ fwrite($gestion, "TIMEOUT " . $timeout . " \n");
+ fwrite($gestion, " \n");
+ fclose($gestion);
+ exec("chown www-data:www-data /var/lib/tftpboot/pxelinux.cfg/". $macfile);
+ exec("chmod 777 /var/lib/tftpboot/pxelinux.cfg/". $macfile);
+
+
+
+
+}
+
+function netmask2cidr($netmask) {
+ $cidr = 0;
+ foreach (explode('.', $netmask) as $number) {
+ for (;$number> 0; $number = ($number <<1) % 256) {
+ $cidr++;
+ }
+ }
+ return $cidr;
+ }
+
+?> \ No newline at end of file
diff --git a/admin/WebConsole/gestores/gestor_ubicarordenadores.php b/admin/WebConsole/gestores/gestor_ubicarordenadores.php
new file mode 100755
index 00000000..6be815db
--- /dev/null
+++ b/admin/WebConsole/gestores/gestor_ubicarordenadores.php
@@ -0,0 +1,84 @@
+<?php
+include_once("../includes/ctrlacc.php");
+include_once("../clases/AdoPhp.php");
+include_once("../clases/XmlPhp.php");
+include_once("../clases/MenuContextual.php");
+include_once("../clases/SockHidra.php");
+include_once("../includes/constantes.php");
+include_once("../includes/comunes.php");
+include_once("../includes/CreaComando.php");
+include_once("../idiomas/php/".$idioma."/aulas_".$idioma.".php");
+
+$cmd=CreaComando($cadenaconexion);
+if (!$cmd)
+ Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
+//________________________________________________________________________________________________________
+
+
+echo "<html>";
+echo "<head>";
+echo "<meta http-equiv='Refresh' content='1;URL=../principal/ubicarordenadores.php?idambito=". $_GET['idaula'] ."&nombreambito=" . $_GET['nombreambito'] . "&litambito=" . $_GET['litambito'] . "'>";
+echo "<title> gestion de equipos </title>";
+echo "<base target='principal'>";
+echo "</head>";
+echo "<body>";
+
+
+
+#echo('litambito con valor: '. $_GET['litambito']);
+#echo ('idambito con valor: ' . $_GET['idaula']);
+#echo ('nombreambito con valor: ' . $_GET['nombreambito']);
+#echo "<br>";
+
+$lista = explode(";",$_POST['listOfItems']);
+foreach ($lista as $sublista) {
+ $elementos = explode("|",$sublista);
+ $hostname=$elementos[1];
+ $grupo=$elementos[0];
+ ReubicarOrdenador($cmd,$hostname,$grupo);
+ #echo $elementos[0] . $elementos[1];
+ #echo "<br>";
+}
+echo " </body>";
+echo " </html> ";
+
+function ReubicarOrdenador($cmd,$hostname,$grupo)
+{
+global $cmd;
+global $hostname;
+global $grupo;
+if ($grupo == "pxe")
+{
+ $cmd->CreaParametro("@grupo","0",0);
+ $cmd->CreaParametro("@hostname",$hostname,0);
+ $cmd->texto="update ordenadores set grupoid=@grupo where nombreordenador=@hostname";
+}
+else
+{
+ $cmd->CreaParametro("@grupo",$grupo,0);
+ $cmd->CreaParametro("@hostname",$hostname,0);
+ $cmd->texto="update ordenadores set grupoid=(Select idgrupo from gruposordenadores where nombregrupoordenador=@grupo) where nombreordenador=@hostname";
+}
+$cmd->Ejecutar();
+#Update ordenadores Set grupoid=(Select idgrupo From gruposordenadores Where nombregrupoordenador="subgrupo1") where nombreordenador="prueba1"
+}
+
+
+# <iframe src="frame_a.htm" name="frame1"></iframe>
+# <iframe src="frame_b.htm" name="frame2"></iframe>
+
+?>
+
+<html> <head>
+ <script language="javascript">
+ function actualiza_frame_principal(){
+ window.parent.frames[1].location="../principal/aulas.php"
+ // window.location="../nada.php"
+}
+ </script>
+</head>
+ <body onunload="actualiza_frame_principal()"> </body>
+</html>
+
+
+
diff --git a/admin/WebConsole/idiomas/javascripts/eng/propiedades_aulas_eng.js b/admin/WebConsole/idiomas/javascripts/eng/propiedades_aulas_eng.js
index d49c7db6..fa7b8bfc 100644
--- a/admin/WebConsole/idiomas/javascripts/eng/propiedades_aulas_eng.js
+++ b/admin/WebConsole/idiomas/javascripts/eng/propiedades_aulas_eng.js
@@ -8,4 +8,5 @@ TbMsg[0]="You must introduce a name for this lab";
TbMsg[1]="You must introduce a number of places for this lab";
TbMsg[2]="WARNING.- This lab contain others groups or labs. If you remove it, you will also remove all these. Are you sure ?";
TbMsg[3]="Time for begining of reserves periode must be smaller than final time";
+TbMsg[4]="Multicast speed is not valid, use numbers only";
diff --git a/admin/WebConsole/idiomas/javascripts/esp/propiedades_aulas_esp.js b/admin/WebConsole/idiomas/javascripts/esp/propiedades_aulas_esp.js
index 4c4dcaea..8f510866 100644
--- a/admin/WebConsole/idiomas/javascripts/esp/propiedades_aulas_esp.js
+++ b/admin/WebConsole/idiomas/javascripts/esp/propiedades_aulas_esp.js
@@ -8,4 +8,12 @@ TbMsg[0]="Debe introducir un nombre para este aula";
TbMsg[1]="Debe introducir un número de puestos para este aula";
TbMsg[2]="ATENCIÓN.- Este aula contiene grupos de ordenadores u ordenadores. Si los elimina, eliminará también éstos. ¿ Está seguro ?";
TbMsg[3]="La hora de comienzo del intervalo de reservas debe ser menor que la hora final";
+TbMsg[4]="La direccion del router no es valida";
+TbMsg[5]="La mascara de red no es valida";
+TbMsg[6]="El modo de p2p no es valido";
+TbMsg[7]="El tiempo (segundos ) de semillero despues de la descarga p2p no es valida";
+TbMsg[8]="Modo multicast no es valido";
+TbMsg[9]="La dirección multicast no es valida";
+TbMsg[10]="El puerto de multicast no es valida";
+TbMsg[11]="La velocidad de multicast no es válida, sólo números";
diff --git a/admin/WebConsole/idiomas/php/cat/propietats_aules_cat.txt b/admin/WebConsole/idiomas/php/cat/propietats_aules_cat.txt
index 85c5a06b..a996ec18 100644
--- a/admin/WebConsole/idiomas/php/cat/propietats_aules_cat.txt
+++ b/admin/WebConsole/idiomas/php/cat/propietats_aules_cat.txt
@@ -2,17 +2,17 @@
//________________________________________________________________________________________________________
//
// Fitxer d'idiomes php: propiedades_aulas_esp.php
-// Idioma: Catal
+// Idioma: Catala
//________________________________________________________________________________________________________
$TbMsg=array();
-$TbMsg[0]="Sense Opci";
+$TbMsg[0]="Sense Opcio";
$TbMsg[1]="Insertar";
$TbMsg[2]="Modificar";
$TbMsg[3]="Eliminar";
-$TbMsg[4]="Gesti Aules";
+$TbMsg[4]="Gestio Aules";
$TbMsg[5]="Nom";
-$TbMsg[6]="Ubicaci";
-$TbMsg[7]="Cann";
+$TbMsg[6]="Ubicacio";
+$TbMsg[7]="Canon";
$TbMsg[8]="Pissarra";
$TbMsg[9]="Puestos";
$TbMsg[10]="Url Imatge";
@@ -21,4 +21,18 @@ $TbMsg[12]="Comentaris";
$TbMsg[13]="Intervals";
$TbMsg[14]="Hora desde:";
$TbMsg[15]="Hora fins:";
+$TbMsg[16]="Repositorio";
+$TbMsg[17]="Perfil Hardware";
+$TbMsg[18]="Propietat pert tot els ordinadors";
+$TbMsg[19]="Tamaño caché (KB)";
+$TbMsg[20]="Autoexec";
+$TbMsg[21]="";
+$TbMsg[22]="Modo Multicast";
+$TbMsg[23]="IP Multicast";
+$TbMsg[24]="Port Multicast";
+$TbMsg[25]="Velocidat Multicast";
+$TbMsg[26]="Modo P2P -semillero durante la descarga-";
+$TbMsg[27]="Temp P2P -semillero despres de descarga-";
+$TbMsg[28]="adresa gateway del aule";
+$TbMsg[29]="Mascara de la xarxa del aule";
?> \ No newline at end of file
diff --git a/admin/WebConsole/idiomas/php/eng/propiedades_aulas_eng.php b/admin/WebConsole/idiomas/php/eng/propiedades_aulas_eng.php
index 795578ba..1a82032c 100644
--- a/admin/WebConsole/idiomas/php/eng/propiedades_aulas_eng.php
+++ b/admin/WebConsole/idiomas/php/eng/propiedades_aulas_eng.php
@@ -2,7 +2,7 @@
//________________________________________________________________________________________________________
//
// Fichero de idiomas php: propiedades_aulas_eng.php
-// Idioma: Ings
+// Idioma: Ing�s
//________________________________________________________________________________________________________
$TbMsg=array();
$TbMsg[0]="No Option";
@@ -21,5 +21,19 @@ $TbMsg[12]="Comments";
$TbMsg[13]="Intervals";
$TbMsg[14]="Begin reserves";
$TbMsg[15]="End reserves";
+$TbMsg[16]="Repository";
+$TbMsg[17]="Hardware profile";
+$TbMsg[18]="Properties for all computers in this class";
+$TbMsg[19]="Cache Size (KB)";
+$TbMsg[20]="Autoexec";
+$TbMsg[21]="";
+$TbMsg[22]="Multicast mode";
+$TbMsg[23]="Multicast IP address";
+$TbMsg[24]="Multicast port";
+$TbMsg[25]="Multicast bandwith";
+$TbMsg[26]="P2P mode -seeder while downloading";
+$TbMsg[27]="P2P time -seeder time(s) after download-";
+$TbMsg[28]="Gateway";
+$TbMsg[29]="Netmask";
?> \ No newline at end of file
diff --git a/admin/WebConsole/idiomas/php/esp/propiedades_aulas_esp.php b/admin/WebConsole/idiomas/php/esp/propiedades_aulas_esp.php
index 65fb75c8..f9e9778f 100644
--- a/admin/WebConsole/idiomas/php/esp/propiedades_aulas_esp.php
+++ b/admin/WebConsole/idiomas/php/esp/propiedades_aulas_esp.php
@@ -29,6 +29,12 @@ $TbMsg[20]="Autoexec";
$TbMsg[21]="";
$TbMsg[22]="Modo Multicast";
$TbMsg[23]="IP Multicast";
-$TbMsg[24]="Puerto";
-$TbMsg[25]="Velocidad";
+$TbMsg[24]="Puerto Multicast";
+$TbMsg[25]="Velocidad Multicast";
+$TbMsg[26]="Modo P2P -semillero durante la descarga-";
+$TbMsg[27]="Tiempo P2P -semillero despues de descarga-";
+$TbMsg[28]="Direccion gateway del aula";
+$TbMsg[29]="Mascara de red del aula";
+
+
?>
diff --git a/admin/WebConsole/jscripts/aulas.js b/admin/WebConsole/jscripts/aulas.js
index fb3fe373..c2634c3b 100644
--- a/admin/WebConsole/jscripts/aulas.js
+++ b/admin/WebConsole/jscripts/aulas.js
@@ -130,6 +130,31 @@ function consola_remota(ambito){
Ambito=ambito;
consola_eco(1);
}
+
+//________________________________________________________________________________________________________
+//
+// Abre una ventana independiente, para ver el log del ordenador cliente
+//________________________________________________________________________________________________________
+
+
+function ver_log(ambito){
+ var nombre_ordenador=currentNodo.toma_infonodo();
+ var whref="../principal/verlog.php?nombreordenador="+nombre_ordenador;
+ window.open(whref,"","width=400,height=100,scrollbars=YES,resizable=YES")
+}
+
+//________________________________________________________________________________________________________
+//
+// Abre una ventana independiente, para ver el log del ordenador cliente
+//________________________________________________________________________________________________________
+
+
+function ver_log_seguimiento(ambito){
+ var nombre_ordenador=currentNodo.toma_infonodo();
+ var whref="../principal/verlogseguimiento.php?nombreordenador="+nombre_ordenador;
+ window.open(whref,"","width=400,height=100,scrollbars=YES,resizable=YES")
+}
+
//________________________________________________________________________________________________________
//
// Abre una ventana para mostrar el eco de una consola
@@ -334,4 +359,26 @@ function incorporarordenador(){
window.open(whref,"frame_contenidos")
}
+function ver_boot(){
+ reset_contextual(-1,-1) // Oculta menu contextual
+ var idambito=currentNodo.toma_identificador();
+ var litambito=currentNodo.toma_sufijo();
+ var nombreambito=currentNodo.toma_infonodo();
+ //alert(idambito);
+ //alert('nombreambito' + nombreambito);
+ //alert('litambito' + litambito);
+ var whref="boot.php?litambito="+litambito+"&idambito="+idambito+"&nombreambito="+nombreambito
+ window.open(whref,"frame_contenidos")
+}
+function ver_ubicarordenadores(){
+ reset_contextual(-1,-1) // Oculta menu contextual
+ var idambito=currentNodo.toma_identificador();
+ var litambito=currentNodo.toma_sufijo();
+ var nombreambito=currentNodo.toma_infonodo();
+ //alert(idambito);
+ //alert('nombreambito' + nombreambito);
+ //alert('litambito' + litambito);
+ var whref="ubicarordenadores.php?litambito="+litambito+"&idambito="+idambito+"&nombreambito="+nombreambito
+ window.open(whref,"frame_contenidos")
+}
diff --git a/admin/WebConsole/jscripts/propiedades_aulas.js b/admin/WebConsole/jscripts/propiedades_aulas.js
index 0d37ec12..61126a6f 100644
--- a/admin/WebConsole/jscripts/propiedades_aulas.js
+++ b/admin/WebConsole/jscripts/propiedades_aulas.js
@@ -84,24 +84,37 @@ function confirmar(op){
// Comprobar_datos
//________________________________________________________________________________________________________
function comprobar_datos(){
- if (document.fdatos.nombreaula.value=="") {
- alert(TbMsg[0]);
- document.fdatos.nombreaula.focus();
- return(false);
- }
- if (document.fdatos.puestos.value=="" || document.fdatos.puestos.value=="0") {
- alert(TbMsg[1]);
- document.fdatos.puestos.focus();
- return(false);
+ function validate (field, validator, msgi) {
+ if (!validator (field.value)) {
+ alert(TbMsg[msgi]);
+ validation_highlight (field);
+ return false;
+ }
+ return true;
}
+
if (parseInt(document.fdatos.horaresevini.value)>parseInt(document.fdatos.horaresevfin.value)) {
alert(TbMsg[3]);
- document.fdatos.horaresevini.focus();
+ validation_highlight (document.fdatos.horaresevini);
+ validation_highlight (document.fdatos.horaresevfin);
return(false);
}
+ var form = document.fdatos;
+ return validate (form.nombreaula, validate_notnull, 0) &&
+ validate (form.puestos, validate_number_notnull, 1) &&
+ validate (form.router, validate_ipadress_notnull, 4) &&
+ validate (form.netmask, validate_ipadress_notnull, 5) &&
+ validate (form.modp2p, validate_notnull, 6) &&
+ validate (form.timep2p, validate_number_notnull, 7) &&
+ validate (form.modomul, validate_notnull, 8) &&
+ validate (form.ipmul, validate_ipadress_notnull, 9) &&
+ validate (form.pormul, validate_notnull, 10) &&
+ validate (form.velmul, validate_number_notnull, 11);
+
return(true);
}
+
//________________________________________________________________________________________________________
function vertabla_horas(ohora){
currentHora=ohora;
diff --git a/admin/WebConsole/jscripts/validators.js b/admin/WebConsole/jscripts/validators.js
new file mode 100644
index 00000000..4fc91c75
--- /dev/null
+++ b/admin/WebConsole/jscripts/validators.js
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2011 Daniel Garcia <danigm@wadobo.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+function validate_expr(value, epx) {
+ var expr = new RegExp(epx);
+ return (value.search(expr) == 0);
+}
+
+function validate_number(value) {
+ return validate_expr(value, "^\\d*$");
+}
+
+function validate_alphanum(value) {
+ return validate_expr(value, "^\\w*$");
+}
+
+function validate_notnull(value) {
+ return validate_expr(value, "^.+$") && !validate_expr(value, "^\\s*0\\s*$");
+}
+
+function validate_number_notnull(value) {
+ return validate_number(value) && validate_notnull(value);
+}
+
+function validate_alphanum_notnull(value) {
+ return validate_number(value) && validate_notnull(value);
+}
+
+
+function validate_ipadress(value) {
+ return validate_expr(value, "^\\d+\\.\\d+\.\\d+\\.\\d+$");
+}
+
+function validate_ipadress_notnull(value) {
+ return validate_ipadress(value) && validate_notnull(value);
+}
+
+
+
+function validation_highlight(field) {
+ field.focus();
+ field.style.border = "1px solid red";
+ field.style.background = "#fee";
+}
diff --git a/admin/WebConsole/menus/images/linux_peque.png b/admin/WebConsole/menus/images/linux_peque.png
new file mode 100644
index 00000000..96b6c677
--- /dev/null
+++ b/admin/WebConsole/menus/images/linux_peque.png
Binary files differ
diff --git a/admin/WebConsole/menus/images/poweroff.png b/admin/WebConsole/menus/images/poweroff.png
new file mode 100644
index 00000000..e494fddb
--- /dev/null
+++ b/admin/WebConsole/menus/images/poweroff.png
Binary files differ
diff --git a/admin/WebConsole/menus/images/xp_peque.png b/admin/WebConsole/menus/images/xp_peque.png
new file mode 100644
index 00000000..9b46e50c
--- /dev/null
+++ b/admin/WebConsole/menus/images/xp_peque.png
Binary files differ
diff --git a/admin/WebConsole/menus/menuaula1.html b/admin/WebConsole/menus/menuaula1.html
deleted file mode 100644
index b24b101f..00000000
--- a/admin/WebConsole/menus/menuaula1.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<html>
- <head>
- <style type="text/css">
- * { font-size: 10px; }
- h2 { font-size: 2em;}
- br {font-size: 0.2em; }
- a:link, a:visited { text-decoration: none; font-weight: normal; color:#505e6b; font-weight: bold; } </style>
- </head>
-
- <body>
- <table width=100%>
- <tr><td colspan=3 height=50px >
- <h2><img style="margin:0px 100px 0px 0px" align=middle src=images/opengnsys.png>Men&uacute; de opciones</h2></p></td></tr>
-
- <tr><td width=10% rowspan="2" align=right valign=top><img width="40px" heigth="40px" src=images/xp.png>
- <td width=30%><a href="command:bootOs 1 1">1.- Arrancar Windows XP</a>
- <td width=60%>Arranque normal sin modificaciones.
- <tr>
- <td width=30%><a href="command: restoreImage REPO /aula1/xp 1 1">2.- Reinstalar Windows XP</a></td>
- <td width=60%><br>El proceso de instalaci&oacute;n puede tardar unos minutos.
- <br><font color=red>Durante la instalaci&oacute;n se bloquean teclado y rat&oacute;n.</font></td>
-
- <tr><td colspan=3 text=white bgcolor=#ffffff align=center height=10px>
-
-
- <tr><td width=10% rowspan="2" align=right valign=top><img width="40px" heigth="40px" src=images/linux.png>
- <td width=30%><a href="command:bootOs 1 2">3.- Arrancar Ubuntu 9.04</a>
- <td width=60%>Arranque normal sin modificaciones.
- <tr>
- <td width=30%><a href="command: restoreImage REPO /aula1/ubuntu9 1 2"><br>4.- Reinstalar Ubuntu 9.04</a>
- <td width=60%><br>El proceso de instalaci&oacute;n puede tardar unos minutos.
- <br><font color=red>Durante la instalaci&oacute;n se bloquean teclado y rat&oacute;n.</font>
-
-
- </table>
- <body>
-</html>
diff --git a/admin/WebConsole/menus/menuejemplo.html b/admin/WebConsole/menus/menuejemplo.html
new file mode 100644
index 00000000..78701260
--- /dev/null
+++ b/admin/WebConsole/menus/menuejemplo.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es">
+
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=utf-8" />
+ <title>Men&uacute; de inicio de los equipos OpenGnSys</title>
+
+ <style type="text/css">
+ body { background: #fff; font-size: 0.7em; }
+ h1, h2 { font-size: 1.5em; }
+ br {font-size: 0.2em; }
+ a:link, a:visited { text-decoration: none; color:#900; font-weight: bold; }
+ a:hover, a:active { color:#d90; }
+
+ h1 {
+ font-size: 1.5em;
+ width: 100%;
+ vertical-align: bottom;
+ color: #555;
+ background: transparent url('images/opengnsys.png') no-repeat top left;
+ padding: 2em 0 1.5em 12em;
+ margin-bottom: 1em;
+ }
+
+ dl {
+ background: transparent url('images/xp_peque.png') no-repeat top left;
+ padding: 0 0 1em 5em;
+ margin: 5px 50px;
+ }
+
+ dl.windows {
+ background-image: url('images/xp_peque.png');
+ }
+
+ dl.linux {
+ background-image: url('images/linux_peque.png');
+ }
+
+ dl.apagar {
+ background-image: url('images/poweroff.png');
+ }
+
+ dt { float: left;}
+ dd { margin: 1em 20em; }
+ </style>
+
+</head>
+
+ <body>
+
+
+ <h1>Men&uacute; de opciones</h1>
+ <dl class="windows">
+ <dt><a href="command:bootOs 1 1" title="Iniciar sesi&oacute;n de Windows" accesskey="1">Arrancar Windows.</a></dt>
+ <dd>Arranque normal de Windows sin modificaciones.</dd>
+ <dt><a href="commandwithconfirmation:restoreImage REPO windows 1 1" title="Formatear el disco e instalar el sistema operativo Windows" accesskey="3">Instalar Windows.</a></dt>
+ <dd>El proceso de instalaci&oacute;n tardar&aacute; unos minutos.</dd>
+ </dl>
+
+ <dl class="linux">
+ <dt><a href="command:bootOs 1 2" title="Iniciar sesi&oacute;n de GNU/Linux" accesskey="2">Arrancar GNU/Linux.</a></dt>
+ <dd>Arranque normal de <acronym title="GNU's not Unix">GNU</acronym>/Linux sin modificaciones.</dd>
+ <dt><a href="commandwithconfirmation:restoreImage REPO linux 1 2" title="Formatear el disco e instalar el sistema operativo GNU/Linux" accesskey="4">Instalar GNU/Linux.</a></dt>
+ <dd>El proceso de instalaci&oacute;n tardar&aacute; unos minutos.</dd>
+ </dl>
+
+ <dl class="apagar">
+ <dt><a href="command:poweroff" title="Apagar la m&aacute;quina" accesskey="5">Apagar.</a></dt>
+ <dd>Apagar el ordenador.</dd>
+ <dt><a href="command:reboot" title="Reiniciar la m&aacute;quina" accesskey="6">Reiniciar.</a></dt>
+ <dd>Reiniciar el ordenador.</dd>
+ </dl>
+ </body>
+</html>
diff --git a/admin/WebConsole/principal/aula.php b/admin/WebConsole/principal/aula.php
index b7b878ae..4f62e9c8 100644
--- a/admin/WebConsole/principal/aula.php
+++ b/admin/WebConsole/principal/aula.php
@@ -111,6 +111,13 @@ $XMLcontextual=ContextualXMLComandos($LITAMBITO_AULAS,$AMBITO_AULAS);
echo $flotante->CreaMenuContextual($XMLcontextual);
$XMLcontextual=ContextualXMLComandos($LITAMBITO_ORDENADORES,$AMBITO_ORDENADORES);
echo $flotante->CreaMenuContextual($XMLcontextual);
+
+// Crea contextual de los asistentes para los distintosn ámbitos
+$XMLcontextual=ContextualXMLAsistentes($LITAMBITO_AULAS,$AMBITO_AULAS);
+echo $flotante->CreaMenuContextual($XMLcontextual);
+$XMLcontextual=ContextualXMLAsistentes($LITAMBITO_ORDENADORES,$AMBITO_ORDENADORES);
+echo $flotante->CreaMenuContextual($XMLcontextual);
+
?>
<SCRIPT language="javascript">
Sondeo();
@@ -300,6 +307,8 @@ function ContextualXMLAulas(){
$layerXML.='<SEPARADOR>';
$layerXML.='</SEPARADOR>';
+
+
$layerXML.='<ITEM';
$layerXML.=' alpulsar="actualizar_ordenadores(this)"';
@@ -330,6 +339,12 @@ function ContextualXMLAulas(){
$layerXML.=' imgitem="../images/iconos/comandos.gif"';
$layerXML.=' textoitem='.$TbMsg[5];
$layerXML.='></ITEM>';
+
+ $layerXML.='<ITEM';
+ $layerXML.=' subflotante="flo_asistentes_'.$LITAMBITO_AULAS.'"';
+ $layerXML.=' imgitem="../images/iconos/comandos.gif"';
+ $layerXML.=' textoitem=Asistentes';
+ $layerXML.='></ITEM>';
$layerXML.='<ITEM';
$layerXML.=' alpulsar="confirmarprocedimiento('.$AMBITO_AULAS.')"';
@@ -419,6 +434,18 @@ function ContextualXMLOrdenadores(){
$layerXML.='<SEPARADOR>';
$layerXML.='</SEPARADOR>';
+
+ $layerXML.='<ITEM';
+ $layerXML.=' alpulsar="ver_log('.$AMBITO_ORDENADORES.')"';
+ $layerXML.=' imgitem="../images/iconos/acciones.gif"';
+ $layerXML.=' textoitem="Log"';
+ $layerXML.='></ITEM>';
+
+ $layerXML.='<ITEM';
+ $layerXML.=' alpulsar="ver_log_seguimiento('.$AMBITO_ORDENADORES.')"';
+ $layerXML.=' imgitem="../images/iconos/acciones.gif"';
+ $layerXML.=' textoitem="Log_seguimiento"';
+ $layerXML.='></ITEM>';
$layerXML.='<ITEM';
$layerXML.=' alpulsar="actualizar_ordenadores()"';
@@ -455,6 +482,13 @@ function ContextualXMLOrdenadores(){
$layerXML.=' imgitem="../images/iconos/comandos.gif"';
$layerXML.=' textoitem='.$TbMsg[5];
$layerXML.='></ITEM>';
+
+ $layerXML.='<ITEM';
+ $layerXML.=' subflotante="flo_asistentes_'.$LITAMBITO_ORDENADORES.'"';
+ $layerXML.=' imgitem="../images/iconos/comandos.gif"';
+ $layerXML.=' textoitem=Asistentes';
+ $layerXML.='></ITEM>';
+
$layerXML.='<ITEM';
$layerXML.=' alpulsar="confirmarprocedimiento('.$AMBITO_ORDENADORES.')"';
@@ -525,3 +559,36 @@ function ContextualXMLComandos($litambito,$ambito){
return($finallayerXML);
}
}
+
+
+function ContextualXMLAsistentes($litambito,$ambito){
+ global $cmd;
+ $maxlongdescri=0;
+ $rs=new Recordset;
+ $cmd->texto="SELECT idcomando,descripcion,pagina,gestor,funcion
+ FROM asistentes
+ WHERE activo=1 AND aplicambito & ".$ambito.">0
+ ORDER BY descripcion";
+ $rs->Comando=&$cmd;
+ if ($rs->Abrir()){
+ $layerXML="";
+ $rs->Primero();
+ while (!$rs->EOF){
+ $layerXML.='<ITEM';
+ $layerXML.=' alpulsar="confirmarcomando('."'".$ambito."'".','.$rs->campos["idcomando"].',\''.$rs->campos["descripcion"].'\',\''.$rs->campos["pagina"]. '\',\''.$rs->campos["gestor"]. '\',\''.$rs->campos["funcion"]. '\')"';
+ $layerXML.=' textoitem="'.$rs->campos["descripcion"].'"';
+ $layerXML.='></ITEM>';
+ if($maxlongdescri<strlen($rs->campos["descripcion"])) // Toma la Descripción de mayor longitud
+ $maxlongdescri=strlen($rs->campos["descripcion"]);
+ $rs->Siguiente();
+ }
+ $layerXML.='</MENUCONTEXTUAL>';
+ $prelayerXML='<MENUCONTEXTUAL';
+ $prelayerXML.=' idctx="flo_asistentes_'.$litambito.'"';
+ $prelayerXML.=' maxanchu='.$maxlongdescri*7;
+ $prelayerXML.=' clase="menu_contextual"';
+ $prelayerXML.='>';
+ $finallayerXML=$prelayerXML.$layerXML;
+ return($finallayerXML);
+ }
+} \ No newline at end of file
diff --git a/admin/WebConsole/principal/aulas.php b/admin/WebConsole/principal/aulas.php
index bcb68755..8cf19824 100644
--- a/admin/WebConsole/principal/aulas.php
+++ b/admin/WebConsole/principal/aulas.php
@@ -25,7 +25,7 @@ else
// Creación del árbol
$baseurlimg="../images/signos"; // Url de las imágenes de signo
$clasedefault="texto_arbol"; // Hoja de estilo (Clase por defecto) del árbol
-$arbol=new ArbolVistaXML($arbolXML,0,$baseurlimg,$clasedefault,2,0,5); // Crea el árbol (formato XML)
+$arbol=new ArbolVistaXML($arbolXML,0,$baseurlimg,$clasedefault,1,0,5); // Crea el árbol (formato XML)
//________________________________________________________________________________________________________
?>
<HTML>
@@ -83,6 +83,25 @@ $XMLcontextual=ContextualXMLComandos($LITAMBITO_GRUPOSORDENADORES,$AMBITO_GRUPOS
echo $flotante->CreaMenuContextual($XMLcontextual);
$XMLcontextual=ContextualXMLComandos($LITAMBITO_ORDENADORES,$AMBITO_ORDENADORES);
echo $flotante->CreaMenuContextual($XMLcontextual);
+
+// Crea submenu contextual de clase de gestion de arranque pxe
+$XMLcontextual=ContextualXMLNetBoot(); // Crea submenu contextual de acciones
+echo $flotante->CreaMenuContextual($XMLcontextual);
+
+// Crea submenu contextual de la clase de asistentes.
+$XMLcontextual=ContextualXMLAsistentes($LITAMBITO_CENTROS,$AMBITO_CENTROS);
+echo $flotante->CreaMenuContextual($XMLcontextual);
+$XMLcontextual=ContextualXMLAsistentes($LITAMBITO_GRUPOSAULAS,$AMBITO_GRUPOSAULAS);
+echo $flotante->CreaMenuContextual($XMLcontextual);
+$XMLcontextual=ContextualXMLAsistentes($LITAMBITO_AULAS,$AMBITO_AULAS);
+echo $flotante->CreaMenuContextual($XMLcontextual);
+$XMLcontextual=ContextualXMLAsistentes($LITAMBITO_GRUPOSORDENADORES,$AMBITO_GRUPOSORDENADORES);
+echo $flotante->CreaMenuContextual($XMLcontextual);
+$XMLcontextual=ContextualXMLAsistentes($LITAMBITO_ORDENADORES,$AMBITO_ORDENADORES);
+echo $flotante->CreaMenuContextual($XMLcontextual);
+
+
+
//___________________________________________________________________________________________________
?>
</BODY>
@@ -342,6 +361,8 @@ function ContextualXMLGruposAulas(){
$layerXML.=' clase="menu_contextual"';
$layerXML.='>';
+
+
$layerXML.='<ITEM';
$layerXML.=' alpulsar="ver_aulas()"';
$layerXML.=' textoitem='.$TbMsg[1];
@@ -354,6 +375,12 @@ function ContextualXMLGruposAulas(){
$layerXML.=' textoitem='.$TbMsg[6];
$layerXML.='></ITEM>';
+ $layerXML.='<ITEM';
+ $layerXML.=' subflotante="flo_netboot"';
+ $layerXML.=' imgitem="../images/iconos/ordenadores.gif"';
+ $layerXML.=' textoitem="NetBoot Gestion"';
+ $layerXML.='></ITEM>';
+
$layerXML.='<SEPARADOR>';
$layerXML.='</SEPARADOR>';
@@ -456,6 +483,21 @@ function ContextualXMLAulas(){
$layerXML.=' clase="menu_contextual"';
$layerXML.='>';
+ $layerXML.='<ITEM';
+ $layerXML.=' subflotante="flo_netboot"';
+ $layerXML.=' imgitem="../images/iconos/ordenadores.gif"';
+ $layerXML.=' textoitem="NetBoot Gestion"';
+ $layerXML.='></ITEM>';
+
+//adv compatiblidad Configurador de Startpages
+ $layerXML.='<ITEM';
+ $layerXML.=' alpulsar="ver_ubicarordenadores()"';
+ $layerXML.=' textoitem="Reubicar ordenadores"';
+ $layerXML.=' imgitem="../images/iconos/ordenadores.gif"';
+ $layerXML.='></ITEM>';
+//adv compatiblidad Configurador de Startpages
+
+
$layerXML.='<ITEM';
$layerXML.=' alpulsar="ver_aulas()"';
$layerXML.=' textoitem='.$TbMsg[1];
@@ -539,6 +581,12 @@ function ContextualXMLAulas(){
$layerXML.='></ITEM>';
$layerXML.='<ITEM';
+ $layerXML.=' subflotante="flo_asistentes_'.$LITAMBITO_AULAS.'"';
+ $layerXML.=' imgitem="../images/iconos/comandos.gif"';
+ $layerXML.=' textoitem=Asistentes';
+ $layerXML.='></ITEM>';
+
+ $layerXML.='<ITEM';
$layerXML.=' alpulsar="confirmarprocedimiento('.$AMBITO_AULAS.')"';
$layerXML.=' imgitem="../images/iconos/procedimiento.gif"';
$layerXML.=' textoitem='.$TbMsg[28];
@@ -646,6 +694,12 @@ function ContextualXMLGruposOrdenadores(){
$layerXML.=' clase="menu_contextual"';
$layerXML.='>';
+ $layerXML.='<ITEM';
+ $layerXML.=' subflotante="flo_netboot"';
+ $layerXML.=' imgitem="../images/iconos/ordenadores.gif"';
+ $layerXML.=' textoitem="NetBoot Gestion"';
+ $layerXML.='></ITEM>';
+
$layerXML.='<ITEM';
$layerXML.=' alpulsar="ver_aulas()"';
$layerXML.=' textoitem='.$TbMsg[1];
@@ -713,6 +767,13 @@ function ContextualXMLGruposOrdenadores(){
$layerXML.='></ITEM>';
$layerXML.='<ITEM';
+ $layerXML.=' subflotante="flo_asistentes_'.$LITAMBITO_GRUPOSORDENADORES.'"';
+ $layerXML.=' imgitem="../images/iconos/comandos.gif"';
+ $layerXML.=' textoitem=Asistentes';
+ $layerXML.='></ITEM>';
+
+
+ $layerXML.='<ITEM';
$layerXML.=' alpulsar="confirmarprocedimiento('.$AMBITO_GRUPOSORDENADORES.')"';
$layerXML.=' imgitem="../images/iconos/procedimiento.gif"';
$layerXML.=' textoitem='.$TbMsg[28];
@@ -772,6 +833,13 @@ function ContextualXMLOrdenadores(){
$layerXML.='<SEPARADOR>';
$layerXML.='</SEPARADOR>';
+
+ $layerXML.='<ITEM';
+ $layerXML.=' alpulsar="ver_log('.$AMBITO_ORDENADORES.')"';
+ $layerXML.=' imgitem="../images/iconos/acciones.gif"';
+ $layerXML.=' textoitem="Log"';
+ $layerXML.='></ITEM>';
+
$layerXML.='<ITEM';
$layerXML.=' alpulsar="mover_ordenador()"';
@@ -818,6 +886,14 @@ function ContextualXMLOrdenadores(){
$layerXML.=' textoitem='.$TbMsg[5];
$layerXML.='></ITEM>';
+
+ $layerXML.='<ITEM';
+ $layerXML.=' subflotante="flo_asistentes_'.$LITAMBITO_ORDENADORES.'"';
+ $layerXML.=' imgitem="../images/iconos/comandos.gif"';
+ $layerXML.=' textoitem=Asistentes';
+ $layerXML.='></ITEM>';
+
+
$layerXML.='<ITEM';
$layerXML.=' alpulsar="confirmarprocedimiento('.$AMBITO_ORDENADORES.')"';
$layerXML.=' imgitem="../images/iconos/procedimiento.gif"';
@@ -887,4 +963,73 @@ function ContextualXMLComandos($litambito,$ambito){
return($finallayerXML);
}
}
+
+
+//________________________________________________________________________________________________________
+function ContextualXMLAsistentes($litambito,$ambito){
+ global $cmd;
+ $maxlongdescri=0;
+ $rs=new Recordset;
+ $cmd->texto="SELECT idcomando,descripcion,pagina,gestor,funcion
+ FROM asistentes
+ WHERE activo=1 AND aplicambito & ".$ambito.">0
+ ORDER BY descripcion";
+ $rs->Comando=&$cmd;
+ if ($rs->Abrir()){
+ $layerXML="";
+ $rs->Primero();
+ while (!$rs->EOF){
+ $layerXML.='<ITEM';
+ $layerXML.=' alpulsar="confirmarcomando('."'".$ambito."'".','.$rs->campos["idcomando"].',\''.$rs->campos["descripcion"].'\',\''.$rs->campos["pagina"]. '\',\''.$rs->campos["gestor"]. '\',\''.$rs->campos["funcion"]. '\')"';
+ $layerXML.=' textoitem="'.$rs->campos["descripcion"].'"';
+ $layerXML.='></ITEM>';
+ if($maxlongdescri<strlen($rs->campos["descripcion"])) // Toma la Descripción de mayor longitud
+ $maxlongdescri=strlen($rs->campos["descripcion"]);
+ $rs->Siguiente();
+ }
+ $layerXML.='</MENUCONTEXTUAL>';
+ $prelayerXML='<MENUCONTEXTUAL';
+ $prelayerXML.=' idctx="flo_asistentes_'.$litambito.'"';
+ $prelayerXML.=' maxanchu='.$maxlongdescri*7;
+ $prelayerXML.=' clase="menu_contextual"';
+ $prelayerXML.='>';
+ $finallayerXML=$prelayerXML.$layerXML;
+ return($finallayerXML);
+ }
+}
+
+
+function ContextualXMLNetBoot(){
+ #global $TbMsg;
+ #global $EJECUCION_COMANDO;
+ #global $EJECUCION_TAREA;
+ #global $EJECUCION_TRABAJO;
+
+ $layerXML='<MENUCONTEXTUAL';
+ $layerXML.=' idctx="flo_netboot"';
+ $layerXML.=' maxanchu=190';
+ $layerXML.=' swimg=1';
+ $layerXML.=' clase="menu_contextual"';
+ $layerXML.='>';
+
+
+//adv compatiblidad Gestor de arranque remoto
+ $layerXML.='<ITEM';
+ $layerXML.=' alpulsar="ver_boot()"';
+ $layerXML.=' textoitem="NetBoot AVANZADO"';
+ $layerXML.=' imgitem="../images/iconos/ordenadores.gif"';
+ $layerXML.='></ITEM>';
+//adv compatiblidad Gestor de arranque remoto
+//adv compatiblidad Configurador de Startpages
+ // $layerXML.='<ITEM';
+ // $layerXML.=' alpulsar="ver_startpages()"';
+ // $layerXML.=' textoitem="Gestor Startpages"';
+ // $layerXML.=' imgitem="../images/iconos/ordenadores.gif"';
+ // $layerXML.='></ITEM>';
+//adv compatiblidad Configurador de Startpages
+
+ $layerXML.='</MENUCONTEXTUAL>';
+ return($layerXML);
+}
+
?>
diff --git a/admin/WebConsole/principal/boot.php b/admin/WebConsole/principal/boot.php
new file mode 100644
index 00000000..8fda145d
--- /dev/null
+++ b/admin/WebConsole/principal/boot.php
@@ -0,0 +1,217 @@
+<html>
+<TITLE>Administración web de aulas</TITLE>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ <LINK rel="stylesheet" type="text/css" href="../estilos.css">
+ <SCRIPT language="javascript" src="../jscripts/propiedades_aulas.js"></SCRIPT>
+ <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT>
+ <SCRIPT language="javascript" src="../idiomas/javascripts/esp/propiedades_aulas_esp.js"></SCRIPT></HEAD>
+
+<script language="javascript" type="text/javascript">
+
+function move(fbox, tbox) {
+ var arrFbox = new Array();
+ var arrTbox = new Array();
+ var arrLookup = new Array();
+ var i;
+ for (i = 0; i < tbox.options.length; i++) {
+ arrLookup[tbox.options[i].text] = tbox.options[i].value;
+ arrTbox[i] = tbox.options[i].text;
+ }
+ var fLength = 0;
+ var tLength = arrTbox.length;
+ for(i = 0; i < fbox.options.length; i++) {
+ arrLookup[fbox.options[i].text] = fbox.options[i].value;
+ if (fbox.options[i].selected && fbox.options[i].value != "") {
+ arrTbox[tLength] = fbox.options[i].text;
+ tLength++;
+ }
+ else {
+ arrFbox[fLength] = fbox.options[i].text;
+ fLength++;
+ }
+ }
+ arrFbox.sort();
+ arrTbox.sort();
+ fbox.length = 0;
+ tbox.length = 0;
+ var c;
+
+for(c = 0; c < arrFbox.length; c++) {
+var no = new Option();
+no.value = arrLookup[arrFbox[c]];
+no.text = arrFbox[c];
+fbox[c] = no;
+}
+
+for(c = 0; c < arrTbox.length; c++) {
+var no = new Option();
+no.value = arrLookup[arrTbox[c]];
+no.text = arrTbox[c];
+tbox[c] = no;
+ }
+}
+
+function allSelect()
+{
+var saveString = "";
+// seleccionamos cada uno de los select
+var input = document.getElementsByTagName('select');
+//alert(input.length);
+for(var i=0; i<input.length; i++){
+//if(inputs[i].getAttribute('type')=='button'){
+// your statements
+patron = "L";
+parm = input[i].name;
+//alert(parm);
+parm = parm.replace(patron,'');
+//alert(parm);
+for (j=0;j<input[i].length;j++)
+ {
+ //List.options[i].selected = true;
+ saveString = saveString + parm + '|' + input[i].options[j].value + ';';
+ //alert(saveString);
+ }
+}
+document.forms['myForm'].listOfItems.value = saveString;
+}
+
+
+</script>
+</head>
+<body>
+
+<?php
+include_once("../includes/ctrlacc.php");
+include_once("../clases/AdoPhp.php");
+include_once("../clases/XmlPhp.php");
+include_once("../clases/MenuContextual.php");
+include_once("../clases/SockHidra.php");
+include_once("../includes/constantes.php");
+include_once("../includes/comunes.php");
+include_once("../includes/CreaComando.php");
+include_once("../idiomas/php/".$idioma."/aulas_".$idioma.".php");
+
+$cmd=CreaComando($cadenaconexion);
+if (!$cmd)
+ Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
+//________________________________________________________________________________________________________
+
+$litambito=0;
+$idambito=0;
+$nombreambito="";
+
+
+if (isset($_GET["litambito"])) $litambito=$_GET["litambito"]; // Recoge parametros
+if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+if (isset($_GET["nombreambito"])) $nombreambito=$_GET["nombreambito"];
+
+
+switch($litambito){
+ case "aulas":
+ $seleccion="and idaula=" . $idambito ."";
+ break;
+ case "gruposordenadores":
+ $seleccion= "and grupoid=" . $idambito . "";
+ break;
+}
+?>
+
+<TABLE align=center border=1 cellPadding=1 cellSpacing=1 class=tabla_datos >
+<form name="myForm" method="post" action="../gestores/gestor_pxe.php?idaula=<?php echo $idambito ?>&nombreambito=<?php echo $nombreambito?>&litambito=<?php echo $litambito?>" >
+
+
+ <P align=center class=cabeceras>Gestión Arranque Avanzado<BR>
+ <SPAN align=center class=subcabeceras> <?php echo $nombreambito; ?> </SPAN>
+ <input type="submit" value="GUARDAR" name="saveButton" onclick="allSelect()"> </P>
+
+
+
+
+
+
+<input type="hidden" name="listOfItems" value="">
+<?php
+echo "<input type='hidden' name='rungrupo' value='" . $_GET['id_aula'] . "'>";
+?>
+
+
+<!-- primer file, nombre de las equipos por pxe hace falta <td> </td>-->
+<tr>
+<td>
+ <!-- <a href="./muestramenu.php?labelmenu=pxe"> OGclient </a><br> pxe <br> -->
+OGclient <br>
+<select multiple size="30" name="Lpxe" id="Lpxe" style="width:100">
+
+<?php
+#### listado de equipos con menu pxe
+$menupxe=pxe;
+$listadopxe=listaequipos($cmd,$menupxe,$seleccion);
+echo $listadopxe;
+?>
+</select>
+</td>
+
+
+<?php
+
+$cmd->texto="SELECT * FROM menuboot where label <> 'pxe' ";
+$rsmenu=new Recordset;
+$rsmenu->Comando=&$cmd;
+if (!$rsmenu->Abrir()) echo "error";
+$rsmenu->Primero();
+while (!$rsmenu->EOF)
+{
+ echo "<td></td>";
+ echo "<td> ";
+ echo $rsmenu->campos['description'];
+ #echo "<a href='./muestramenu.php?labelmenu=" . $rsmenu->campos['label'] ."'> " . $rsmenu->campos['description'] . " </a> <br>". $rs->campos['label'] . "<br>";
+ echo " <br>";
+ echo "<input type='button' onClick='move(this.form.L" . $rsmenu->campos['label'] . ",this.form.Lpxe)' value='OUT' style='height: 25px; width: 50px' >";
+ echo "<input type='button' onClick='move(this.form.Lpxe,this.form.L" . $rsmenu->campos['label'] .")' value='IN' style='height: 25px; width: 35px' >";
+ echo " <br>";
+ echo "<select multiple size='30' name='L" . $rsmenu->campos['label'] . "' style='width:100'>";
+ $listadopxe="";
+ $listadopxe=listaequipos($cmd,$rsmenu->campos['label'],$seleccion);
+ echo $listadopxe;
+ echo "</select>";
+ echo "</td>";
+ $rsmenu->Siguiente();
+}
+$rsmenu->Cerrar();
+
+
+
+
+
+
+
+// esta funcion genera los elementos de un select(formulario html) donde aparecen los nombres de los ordenadores, según su menu pxe
+function listaequipos($cmd,$menupxe,$seleccion)
+{
+$cmd->texto="SELECT * FROM ordenadores where arranque='" . $menupxe ."' " . $seleccion;
+$rs=new Recordset;
+$rs->Comando=&$cmd;
+if (!$rs->Abrir()) echo "error";
+$rs->Primero();
+while (!$rs->EOF)
+{
+ echo "<option value='";
+ echo $rs->campos["nombreordenador"];
+ echo "'>";
+ echo $rs->campos["nombreordenador"];
+ echo "</option>";
+ $rs->Siguiente();
+}
+$rs->Cerrar();
+}
+
+?>
+
+</tr>
+
+</form>
+</table>
+
+</body>
+</html>
diff --git a/admin/WebConsole/principal/ubicarordenadores.php b/admin/WebConsole/principal/ubicarordenadores.php
new file mode 100644
index 00000000..f5efb099
--- /dev/null
+++ b/admin/WebConsole/principal/ubicarordenadores.php
@@ -0,0 +1,274 @@
+<html>
+<TITLE>Administración web de aulas</TITLE>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ <LINK rel="stylesheet" type="text/css" href="../estilos.css">
+ <SCRIPT language="javascript" src="../jscripts/propiedades_aulas.js"></SCRIPT>
+ <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT>
+ <SCRIPT language="javascript" src="../idiomas/javascripts/esp/propiedades_aulas_esp.js"></SCRIPT></HEAD>
+
+<script language="javascript" type="text/javascript">
+
+function move(fbox, tbox) {
+ var arrFbox = new Array();
+ var arrTbox = new Array();
+ var arrLookup = new Array();
+ var i;
+ for (i = 0; i < tbox.options.length; i++) {
+ arrLookup[tbox.options[i].text] = tbox.options[i].value;
+ arrTbox[i] = tbox.options[i].text;
+ }
+ var fLength = 0;
+ var tLength = arrTbox.length;
+ for(i = 0; i < fbox.options.length; i++) {
+ arrLookup[fbox.options[i].text] = fbox.options[i].value;
+ if (fbox.options[i].selected && fbox.options[i].value != "") {
+ arrTbox[tLength] = fbox.options[i].text;
+ tLength++;
+ }
+ else {
+ arrFbox[fLength] = fbox.options[i].text;
+ fLength++;
+ }
+ }
+ arrFbox.sort();
+ arrTbox.sort();
+ fbox.length = 0;
+ tbox.length = 0;
+ var c;
+
+for(c = 0; c < arrFbox.length; c++) {
+var no = new Option();
+no.value = arrLookup[arrFbox[c]];
+no.text = arrFbox[c];
+fbox[c] = no;
+}
+
+for(c = 0; c < arrTbox.length; c++) {
+var no = new Option();
+no.value = arrLookup[arrTbox[c]];
+no.text = arrTbox[c];
+tbox[c] = no;
+ }
+}
+
+function allSelect()
+{
+var saveString = "";
+// seleccionamos cada uno de los select
+var input = document.getElementsByTagName('select');
+//alert(input.length);
+for(var i=0; i<input.length; i++){
+ //if(inputs[i].getAttribute('type')=='button'){
+ // your statements
+ patron = "L";
+ parm = input[i].name;
+ //alert(parm);
+ parm = parm.replace(patron,'');
+ //alert(parm);
+ for (j=0;j<input[i].length;j++)
+ {
+ //List.options[i].selected = true;
+ saveString = saveString + parm + '|' + input[i].options[j].value + ';';
+ //alert(saveString);
+ }
+}
+document.forms['myForm'].listOfItems.value = saveString;
+}
+
+
+</script>
+</head>
+<body>
+
+<?php
+include_once("../includes/ctrlacc.php");
+include_once("../clases/AdoPhp.php");
+include_once("../clases/XmlPhp.php");
+include_once("../clases/MenuContextual.php");
+include_once("../clases/SockHidra.php");
+include_once("../includes/constantes.php");
+include_once("../includes/comunes.php");
+include_once("../includes/CreaComando.php");
+include_once("../idiomas/php/".$idioma."/aulas_".$idioma.".php");
+
+$cmd=CreaComando($cadenaconexion);
+if (!$cmd)
+ Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
+//________________________________________________________________________________________________________
+
+$litambito=0;
+$idambito=0;
+$nombreambito="";
+
+
+if (isset($_GET["litambito"])) $litambito=$_GET["litambito"]; // Recoge parametros
+if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+if (isset($_GET["nombreambito"])) $nombreambito=$_GET["nombreambito"];
+
+# ambito: 4->aulas 16->ordenadores
+# idambito: id de los elementos en su correspondiente tabla-ambito (aulas, ordenadores...)
+# nombreambito: nombre del elemento.
+
+switch($ambito){
+ case $AMBITO_CENTROS :
+ $urlimg='../images/iconos/centros.gif';
+ $textambito=$TbMsg[0];
+ break;
+ case $AMBITO_GRUPOSAULAS :
+ $urlimg='../images/iconos/carpeta.gif';
+ $textambito=$TbMsg[1];
+ break;
+ case $AMBITO_AULAS :
+ $urlimg='../images/iconos/aula.gif';
+ $textambito=$TbMsg[2];
+ if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+ if (isset($_GET["litambito"])) $litambito=$_GET["litambito"];
+ $seleccion="and idaula=" . $idambito ."";
+ break;
+ case $AMBITO_GRUPOSORDENADORES :
+ $urlimg='../images/iconos/carpeta.gif';
+ $textambito=$TbMsg[3];
+ $seleccion= "and grupoid=" . $idambito . "";
+ break;
+ case $AMBITO_ORDENADORES :
+ $urlimg='../images/iconos/ordenador.gif';
+ $textambito=$TbMsg[4];
+ if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
+ if (isset($_GET["litambito"])) $litambito=$_GET["litambito"];
+ break;
+ }
+
+
+?>
+
+<TABLE align=center border=1 cellPadding=1 cellSpacing=1 class=tabla_datos >
+<form name="myForm" method="post" action="../gestores/gestor_ubicarordenadores.php?idaula=<?php echo $idambito ?>&nombreambito=<?php echo $nombreambito?>&litambito=<?php echo $litambito?>" >
+
+
+ <P align=center class=cabeceras>Ubicador Ordenadores<BR>
+ <SPAN align=center class=subcabeceras> <?php echo "nombre ambito:" . $nombreambito . " identificador ambito: " . $idambito . $litambito; ?> </SPAN>
+ <input type="submit" value="GUARDAR" name="saveButton" onclick="allSelect()"> </P>
+
+
+
+
+
+
+<input type="hidden" name="listOfItems" value="">
+<?php
+echo "<input type='hidden' name='rungrupo' value='" . $_GET['id_aula'] . "'>";
+?>
+
+
+<!-- primera columna, nombre de las equipos que no pertenecen a subggrupos -->
+<tr>
+<td>
+<?php echo $nombreambito; ?> <br>
+<select multiple size="30" name="Lpxe" id="Lpxe" style="width:100">
+
+<?php
+#### listado de equipos que pertenecen al aula, pero no estan en subgrupos
+$listadogrupo="";
+$listadogrupo=ListaEquiposBase($cmd,$idambito);
+echo $listadogrupo;
+?>
+
+</select>
+</td>
+
+
+<?php
+
+$cmd->texto="SELECT * FROM gruposordenadores where idaula = '".$idambito ."' ";
+$rsmenu=new Recordset;
+$rsmenu->Comando=&$cmd;
+if (!$rsmenu->Abrir()) echo "error";
+$rsmenu->Primero();
+while (!$rsmenu->EOF)
+{
+ echo "<td></td>";
+ echo "<td> ";
+ echo $rsmenu->campos['nombregrupoordenador'];
+ echo " <br>";
+ echo "<input type='button' onClick='move(this.form.L" . $rsmenu->campos['nombregrupoordenador'] . ",this.form.Lpxe)' value='OUT' style='height: 25px; width: 50px' >";
+ echo "<input type='button' onClick='move(this.form.Lpxe,this.form.L" . $rsmenu->campos['nombregrupoordenador'] .")' value='IN' style='height: 25px; width: 35px' >";
+ echo " <br>";
+ echo "<select multiple size='30' name='L" . $rsmenu->campos['nombregrupoordenador'] . "' style='width:100'>";
+ $listadogrupo="";
+ #$listadogrupo=listaequipos($cmd,$rsmenu->campos['idgrupo'],$seleccion);
+ $listadogrupo=ListaEquiposGrupo($cmd,$rsmenu->campos['idaula'],$rsmenu->campos['idgrupo']);
+ echo $listadogrupo;
+ echo "</select>";
+ echo "</td>";
+ $rsmenu->Siguiente();
+}
+$rsmenu->Cerrar();
+
+
+
+
+
+
+// esta funcion genera los elementos de un select(formulario html) donde aparecen los nombres de los ordenadores, según su menu pxe
+function ListaEquiposGrupo($cmd,$idaula,$idgrupo)
+{
+#componemos select dependiendo de idgrupo; si idgrupo=0, los ordenadores solo pertenenen al aula y no estan en ningun subgrupo.
+switch ($idgrupo){
+ case 0:
+ $cmd->texto="select nombreordenador from ordenadores where ordenadores.idaula='" . $idaula . "' AND ordenadores.grupoid = '0'";
+ ;;
+ default:
+ $cmd->texto="select nombreordenador from ordenadores JOIN gruposordenadores ON ordenadores.grupoid = gruposordenadores.idgrupo where ordenadores.idaula='" . $idaula . "' AND gruposordenadores.idgrupo = '". $idgrupo ."'";
+ ;;
+}
+
+#$cmd->texto="select nombreordenador from ordenadores JOIN gruposordenadores ON ordenadores.grupoid = gruposordenadores.idgrupo where ordenadores.idaula='" . $idaula . "' AND gruposordenadores.idgrupo = '". $idgrupo ."'";
+#$cmd->texto="SELECT * FROM gruposordenadores where arranque='" . $menupxe ."' " . $seleccion;
+$rs=new Recordset;
+$rs->Comando=&$cmd;
+if (!$rs->Abrir()) echo "error";
+$rs->Primero();
+while (!$rs->EOF)
+{
+ echo "<option value='";
+ echo $rs->campos["nombreordenador"];
+ echo "'>";
+ echo $rs->campos["nombreordenador"];
+ echo "</option>";
+ $rs->Siguiente();
+}
+$rs->Cerrar();
+}
+
+
+function ListaEquiposBase($cmd,$idaula)
+{
+$cmd->texto="select nombreordenador from ordenadores where ordenadores.idaula='" . $idaula . "' AND ordenadores.grupoid = '0'";
+$rs=new Recordset;
+$rs->Comando=&$cmd;
+if (!$rs->Abrir()) echo "error";
+$rs->Primero();
+while (!$rs->EOF)
+{
+ echo "<option value='";
+ echo $rs->campos["nombreordenador"];
+ echo "'>";
+ echo $rs->campos["nombreordenador"];
+ echo "</option>";
+ $rs->Siguiente();
+}
+$rs->Cerrar();
+}
+
+
+
+?>
+
+</tr>
+
+</form>
+</table>
+
+</body>
+</html>
diff --git a/admin/WebConsole/principal/verlog.php b/admin/WebConsole/principal/verlog.php
new file mode 100644
index 00000000..f971afff
--- /dev/null
+++ b/admin/WebConsole/principal/verlog.php
@@ -0,0 +1,88 @@
+<?
+// *************************************************************************************************************************************************
+// Aplicación WEB:
+// Autor:
+// Fecha Creación:
+// Fecha Última modificación:
+// Nombre del fichero:
+// Descripción :
+// muestra los log del equipo
+// *************************************************************************************************************************************************
+include_once("../includes/ctrlacc.php");
+include_once("../clases/AdoPhp.php");
+include_once("../includes/constantes.php");
+include_once("../includes/comunes.php");
+include_once("../includes/CreaComando.php");
+include_once("../includes/HTMLSELECT.php");
+include_once("../idiomas/php/".$idioma."/comandos/ejecutarscripts_".$idioma.".php");
+include_once("../idiomas/php/".$idioma."/consolaremota_".$idioma.".php");
+//________________________________________________________________________________________________________
+$cmd=CreaComando($cadenaconexion);
+if (!$cmd)
+ Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
+//___________________________________________________________________________________________________
+
+$nombreordenador=$_GET["nombreordenador"];
+
+if (isset($_GET["ip"]))
+{
+$ip=$_GET["ip"];
+}
+else
+{
+ $rs=new Recordset;
+ $cmd->texto="SELECT * FROM ordenadores WHERE nombreordenador='".$nombreordenador."'";
+ $rs->Comando=&$cmd;
+ if (!$rs->Abrir()) return(false); // Error al abrir recordset
+ $rs->Primero();
+ if (!$rs->EOF){
+ $ip=$rs->campos["ip"];
+ $rs->Cerrar();
+ }
+}
+
+?>
+
+
+<HTML>
+<TITLE>Log: <? echo $_GET["nombreordenador"] ?> </TITLE>
+<HEAD>
+<?
+#echo "<meta http-equiv='Refresh' content='2;URL=./verlog.php?nombreordenador=". $_GET["nombreordenador"] ."&ip=".$ip ."'";
+?>
+
+
+</HEAD>
+
+<BODY>
+
+
+<form name="leerficherolog" action="" method="GET">
+<table>
+<tr>
+<?php
+ $nombreordenador=$_GET["nombreordenador"];
+ echo "<td> Log del equipo ". $nombreordenador ." con ip " . $ip ." </td> ";
+?>
+</tr>
+</table>
+<TEXTAREA NAME="contenido" ROWS="50" COLS="150" >
+<?php
+ $fp = "/opt/opengnsys/log/clients/" . $ip . ".log";
+ $array=file($fp);
+ foreach($array as $line)
+ {
+ echo($line);
+ }
+ #lectura del fichero tipo tail
+ #for($i=count($array);$i>0;$i--)
+ #{
+ # echo "$array[$i]";
+ #}
+?>
+</TEXTAREA>
+
+</form>
+
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/admin/WebConsole/principal/verlogseguimiento.php b/admin/WebConsole/principal/verlogseguimiento.php
new file mode 100644
index 00000000..e74e17f7
--- /dev/null
+++ b/admin/WebConsole/principal/verlogseguimiento.php
@@ -0,0 +1,91 @@
+<?
+// *************************************************************************************************************************************************
+// Aplicación WEB:
+// Autor:
+// Fecha Creación:
+// Fecha Última modificación:
+// Nombre del fichero:
+// Descripción :
+// muestra los log del equipo
+// *************************************************************************************************************************************************
+include_once("../includes/ctrlacc.php");
+include_once("../clases/AdoPhp.php");
+include_once("../includes/constantes.php");
+include_once("../includes/comunes.php");
+include_once("../includes/CreaComando.php");
+include_once("../includes/HTMLSELECT.php");
+include_once("../idiomas/php/".$idioma."/comandos/ejecutarscripts_".$idioma.".php");
+include_once("../idiomas/php/".$idioma."/consolaremota_".$idioma.".php");
+//________________________________________________________________________________________________________
+$cmd=CreaComando($cadenaconexion);
+if (!$cmd)
+ Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
+//___________________________________________________________________________________________________
+
+$nombreordenador=$_GET["nombreordenador"];
+
+if (isset($_GET["ip"]))
+{
+$ip=$_GET["ip"];
+}
+else
+{
+ $rs=new Recordset;
+ $cmd->texto="SELECT * FROM ordenadores WHERE nombreordenador='".$nombreordenador."'";
+ $rs->Comando=&$cmd;
+ if (!$rs->Abrir()) return(false); // Error al abrir recordset
+ $rs->Primero();
+ if (!$rs->EOF){
+ $ip=$rs->campos["ip"];
+ $rs->Cerrar();
+ }
+}
+
+?>
+
+
+<HTML>
+<TITLE>Log: <? echo $_GET["nombreordenador"] ?> </TITLE>
+<HEAD>
+<?
+echo "<meta http-equiv='Refresh' content='2;URL=./verlogseguimiento.php?nombreordenador=". $_GET["nombreordenador"] ."&ip=".$ip ."'";
+?>
+
+
+</HEAD>
+
+<BODY>
+
+
+<form name="leerficherolog" action="" method="GET">
+<table>
+<tr>
+<?php
+ $nombreordenador=$_GET["nombreordenador"];
+ echo "<td> Log del equipo ". $nombreordenador ." con ip " . $ip ." </td> ";
+?>
+</tr>
+</table>
+<TEXTAREA NAME="contenido" ROWS="50" COLS="150" >
+<?php
+ $fp = "/opt/opengnsys/log/clients/" . $ip . ".log";
+ #echo exec('tail -n 50 ' . $fp);
+ $handle = popen("tail " . $fp ." 2>&1", 'r');
+ while(!feof($handle)) {
+ $buffer = fgets($handle);
+ echo "$buffer";
+ ob_flush();
+ flush();
+}
+pclose($handle);
+
+
+
+
+?>
+</TEXTAREA>
+
+</form>
+
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/admin/WebConsole/propiedades/propiedades_aulas.php b/admin/WebConsole/propiedades/propiedades_aulas.php
index e77efe11..c55c7abf 100644
--- a/admin/WebConsole/propiedades/propiedades_aulas.php
+++ b/admin/WebConsole/propiedades/propiedades_aulas.php
@@ -47,6 +47,7 @@ else
<HEAD>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
+ <SCRIPT language="javascript" src="../jscripts/validators.js"></SCRIPT>
<SCRIPT language="javascript" src="../jscripts/propiedades_aulas.js"></SCRIPT>
<SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT>
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_aulas_'.$idioma.'.js"></SCRIPT>'?>
@@ -167,7 +168,62 @@ else
?>
</TR>
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
+<!----ADV -------------------------------------router-------------------------------------------------------------------------------------------------------------------------------------------->
<TR>
+ <TH align=center&nbsp;><?echo $TbMsg[28]?>&nbsp;</TD>
+ <?
+ if ($opcion==$op_eliminacion)
+ echo '<TD colspan=3>'.$router.'</TD>';
+ else
+ echo '<TD colspan=3><INPUT class="formulariodatos" name=router style="width:100" type=text value='.$router.'></TD>';
+ ?>
+ </TR>
+<!-----ADV -----------------------------netmask--------------------------------------------------------------------------------------------------------------------------------------------------->
+ <TR>
+ <TH align=center&nbsp;><?echo $TbMsg[29]?>&nbsp;</TD>
+ <?
+ if ($opcion==$op_eliminacion)
+ echo '<TD colspan=3>'.$netmask.'</TD>';
+ else
+ echo '<TD colspan=3><INPUT class="formulariodatos" name=netmask style="width:100" type=text value='.$netmask.'></TD>';
+ ?>
+ </TR>
+<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
+
+<!-----ADV --------------------------p2pmodo------------------------------------------------------------------------------------------------------------------------------------------------------>
+ <TR>
+ <TH align=center&nbsp;><?echo $TbMsg[26]?>&nbsp;</TD>
+ <?
+ if ($opcion==$op_eliminacion)
+ echo '<TD colspan=3>'.$modp2p.'</TD>';
+ else
+ echo '<TD colspan=3>';
+ $p2pmetodos="peer=peer".chr(13);
+ $p2pmetodos.="leecher=leecher".chr(13);
+ $p2pmetodos.="seeder=seeder";
+ echo HTMLCTESELECT($p2pmetodos,"modp2p","estilodesple","",$modp2p,100).'</TD>';
+ ?>
+ </TR>
+<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
+
+<!----------------------------p2p tiempo semillero--------------------------------------------------------------------------------------------------------------------------------------------------------->
+ <TR>
+ <TH align=center&nbsp;><?echo $TbMsg[27]?>&nbsp;</TD>
+ <?
+ if ($opcion==$op_eliminacion)
+ echo '<TD colspan=3>'.$timep2p.'</TD>';
+ else
+ echo '<TD colspan=3><INPUT class="formulariodatos" name=timep2p style="width:100" type=text value='.$timep2p.'></TD>';
+ ?>
+ </TR>
+<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
+
+
+
+
+
+
+ <TR>
<TH align=center&nbsp;><?echo $TbMsg[22]?>&nbsp;</TD>
<?
if ($opcion==$op_eliminacion){
@@ -201,7 +257,15 @@ else
if ($opcion==$op_eliminacion)
echo '<TD colspan=3>'.$pormul.'</TD>';
else
- echo '<TD colspan=3><INPUT class="formulariodatos" name=pormul style="width:100" type=text value='.$pormul.'></TD>';
+ echo '<TD colspan=3>';
+ $pormulmetodos="9000=9000".chr(13);
+ $pormulmetodos.="9002=9002".chr(13);
+ $pormulmetodos.="9004=9004".chr(13);
+ $pormulmetodos.="9006=9006".chr(13);
+ $pormulmetodos.="9010=9010".chr(13);
+ $pormulmetodos.="9012=9012".chr(13);
+ $pormulmetodos.="9014=9014";
+ echo HTMLCTESELECT($pormulmetodos,"pormul","estilodesple","",$pormul,100).'</TD>';
?>
</TR>
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
@@ -265,7 +329,7 @@ else
if ($opcion==$op_eliminacion)
echo '<TD colspan=3>'.$cache.'</TD>';
else
- echo '<TD colspan=3><INPUT class="formulariodatos" name=cache style="width:100" type=text value='.$cache.'></TD>';
+ echo '<TD colspan=3><INPUT class="formulariodatos" name=cache style="width:100" type=text readonly value=0></TD>';
?>
</TR>
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
@@ -314,7 +378,12 @@ function TomaPropiedades($cmd,$ida)
global $gidrepositorio;
global $gidperfilhard;
global $gcache;
-
+###################### ADV
+ global $router;
+ global $netmask;
+ global $modp2p;
+ global $timep2p;
+###################### ADV
global $modomul;
global $ipmul;
global $pormul;
@@ -332,6 +401,12 @@ function TomaPropiedades($cmd,$ida)
$horaresevini=0;
$horaresevfin=0;
$grupoid=0;
+## ADV #########################################
+ $router=0;
+ $netmask=0;
+ $modp2p=0;
+ $timep2p=0;
+### ADV ########################################
$modomul=0;
$ipmul=0;
$pormul=0;
@@ -349,6 +424,8 @@ function TomaPropiedades($cmd,$ida)
$gidperfilhard=0;
$gcache=0;
+
+
$rs=new Recordset;
$cmd->texto="SELECT count( * ) AS numordenadores, aulas.* ,
group_concat(DISTINCT cast( ordenadores.idmenu AS char( 11 ) )
@@ -387,6 +464,12 @@ function TomaPropiedades($cmd,$ida)
$ipmul=$rs->campos["ipmul"];
$pormul=$rs->campos["pormul"];
$velmul=$rs->campos["velmul"];
+#################### ADV
+ $router=$rs->campos["router"];
+ $netmask=$rs->campos["netmask"];
+ $modp2p=$rs->campos["modp2p"];
+ $timep2p=$rs->campos["timep2p"];
+###################### ADV
$ordenadores=$rs->campos["numordenadores"];
$idmenu=$rs->campos["idmenus"];
diff --git a/admin/WebConsole/propiedades/propiedades_ordenadores.php b/admin/WebConsole/propiedades/propiedades_ordenadores.php
index ab8c832d..69f44b4c 100644
--- a/admin/WebConsole/propiedades/propiedades_ordenadores.php
+++ b/admin/WebConsole/propiedades/propiedades_ordenadores.php
@@ -14,6 +14,7 @@ include_once("../includes/constantes.php");
include_once("../includes/CreaComando.php");
include_once("../includes/TomaDato.php");
include_once("../includes/HTMLSELECT.php");
+include_once("../includes/HTMLCTESELECT.php");
include_once("../clases/AdoPhp.php");
include_once("../idiomas/php/".$idioma."/propiedades_ordenadores_".$idioma.".php");
//________________________________________________________________________________________________________
@@ -31,6 +32,10 @@ $idprocedimiento=0;
$idaula=0;
$cache="";
$grupoid=0;
+######################## ADV
+$netiface="";
+$netdriver="";
+########################### ADV
if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros
if (isset($_GET["idordenador"])) $idordenador=$_GET["idordenador"];
@@ -144,10 +149,34 @@ if ($opcion!=$op_alta){
if ($opcion==$op_eliminacion)
echo '<TD colspan=3>'.$cache.'</TD>';
else
- echo '<TD colspan=3><INPUT style="width=250" class="formulariodatos" name=cache type=text value="'. $cache.'"></TD>';
+ echo '<TD colspan=3><INPUT style="width=250" class="formulariodatos" name="cache" type="text" readonly value="'. $cache.'"></TD>';
?>
- </TR>
+ </TR>
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
+<!-----ADV -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
+ <TR>
+ <TH align=center&nbsp;> Interfaz de Red: &nbsp;</TD>
+ <?
+ echo '<TD colspan=3>';
+ $iface="eth0=eth0".chr(13);
+ $iface.="eth1=eth1".chr(13);
+ $iface.="eth2=eth2";
+ echo HTMLCTESELECT($iface,"netiface","estilodesple","",$netiface,100).'</TD>';
+ ?>
+ </TR>
+<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
+
+ <TR>
+ <TH align=center&nbsp;> Driver de Red: &nbsp;</TD>
+ <?
+ echo '<TD colspan=3>';
+ $driver="generic=generic";
+ echo HTMLCTESELECT($driver,"netdriver","estilodesple","",$netdriver,100).'</TD>';
+ ?>
+ </TR>
+
+<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
+
</TABLE>
</FORM>
</DIV>
@@ -186,6 +215,8 @@ function TomaPropiedades($cmd,$id){
global $idmenu;
global $idprocedimiento;
global $cache;
+ global $netiface;
+ global $netdriver;
$rs=new Recordset;
$cmd->texto="SELECT * FROM ordenadores WHERE idordenador=".$id;
$rs->Comando=&$cmd;
@@ -200,6 +231,8 @@ function TomaPropiedades($cmd,$id){
$idmenu=$rs->campos["idmenu"];
$idprocedimiento=$rs->campos["idproautoexec"];
$cache=$rs->campos["cache"];
+ $netiface=$rs->campos["netiface"];
+ $netdriver=$rs->campos["netdriver"];
$rs->Cerrar();
return(true);
}
diff --git a/admin/WebConsole/varios/incorporaordenadores.php b/admin/WebConsole/varios/incorporaordenadores.php
index 3e2ae333..a9ed0163 100644
--- a/admin/WebConsole/varios/incorporaordenadores.php
+++ b/admin/WebConsole/varios/incorporaordenadores.php
@@ -146,7 +146,8 @@ function Inserta($cmd,$idaula,$nombre,$lamac,$laip)
return(true);
}
$idperfilhard=0;
- $idrepositorio=0;
+## ADV: modificacion para asignar a los ordenadores, cuando se crean desde "incorpoar ordenadores" el repositorio "default"
+ $idrepositorio=1;
$idconfiguracion=0;
$cmd->CreaParametro("@grupoid",$grupoid,1);
$cmd->CreaParametro("@idaula",$idaula,1);
diff --git a/admin/xajax_0.5_standard.zip b/admin/xajax_0.5_standard.zip
new file mode 100644
index 00000000..d247c280
--- /dev/null
+++ b/admin/xajax_0.5_standard.zip
Binary files differ
diff --git a/client/LICENSE b/client/LICENSE.en.txt
index 94a9ed02..94a9ed02 100644
--- a/client/LICENSE
+++ b/client/LICENSE.en.txt
diff --git a/client/README.es.txt b/client/README.es.txt
index 83ee38ce..fc35d4b7 100644
--- a/client/README.es.txt
+++ b/client/README.es.txt
@@ -1,12 +1,12 @@
-OpenGNSys Client README
+OpenGnSys Client README
=========================
-Este directorio contiene la estructura de datos del cliente OpenGNSys.
+Este directorio contiene la estructura de datos del cliente OpenGnSys.
-- boot gestión del proceso de arranque de los clientes.
-- browser código fuente del cliente gráfico OpenGNSys Browser.
-- engine funciones del motor (se instalará en el servidor en
- /opt/opengneys/client/lib/engine).
-- nfsroot estructura principal del cliente exportado por NFS
- (se instalará en el servidor en /opt/opengneys/client).
+- boot-tools herramientas para generar la distribución de OpenGnSys Client.
+- browser código fuente del cliente gráfico OpenGnSys Browser.
+- engine funciones del motor (se instalará en el servidor en
+ /opt/opengneys/client/lib/engine).
+- shared estructura principal del cliente exportado por NFS o Samba
+ (se instalará en el servidor en /opt/opengneys/client).
diff --git a/client/boot-tools/INSTALL.es.txt b/client/boot-tools/INSTALL.es.txt
new file mode 100644
index 00000000..d39e798d
--- /dev/null
+++ b/client/boot-tools/INSTALL.es.txt
@@ -0,0 +1,46 @@
+OpenGnSys Client boot-tools INSTALL.es.txt
+============================================
+
+
+Requisitos iniciales
+--------------------
+
+- Utilizar el usuario "root" para ejecutar el proceso de generación del cliente.
+- Comprobar la conexión a Internet, sobre todo si usas proxy (el hecho de que funcione apt-get no significa que tengas el proxy configurado).
+
+
+Proceso de instalación
+----------------------
+
+0. Si ya tenemos configurado TFTP, renombrar el directorio /var/lib/tftpboot/ogclient.
+1. Descargar del Subversion las herramientas del cliente
+2. Ejecutar el instalador:
+
+mv /opt/opengnsys/tftpboot/ogclient /opt/opengnsys/tftpboot/ogclient-old;
+svn checkout http://www.opengnsys.es/svn/trunk/client /tmp/opengnsys_installer/opengnsys;
+find /tmp/opengnsys_installer/ -name .svn -type d -exec rm -fr {} \; 2>/dev/null;
+/tmp/opengnsys_installer/opengnsys/client/boot-tools/ogClientGeneratorV2.sh;
+
+
+NOTAS:
+- el proceso tardará un buen rato, dependiendo de nuestras circustancias.
+- crea un kernel, initrd, ogclient.img en /var/lib/tftpboot/ogclient
+- el ogclient.img es el Segundo sistema de archivos en formato fichero bloques emulando a disco con partición primaria.
+- el ogclient.sqfs es el Segundo sistema de archivos (partición primaria del img) en formato squashfs. Se usará con el parámetro og2nd=sqfs
+- los logs de instalación estarán en /tmp/opengnsys_installation.log
+
+NOTA ACLARATORIA: $OGSCRITPS(reboot,poweroff) antes de /sbin/{reboot,poweroff}
+
+
+Descripción de la estrucutra de boot-tools
+------------------------------------------
+
+- INSTALL.es.txt este mismo archivo.
+- ogInstaller.lib son todas las funciones del instalador oficial de OpenGnSys.
+ Algunas de ellas son utilizadas en la generación del cliente
+ (crear ticket para separar las funciones necesarias).
+- ogClientManager.lib son las funicones especificas para la instalacion del cliente;
+ están escritas en orden de que son llamadas por el instalador.
+- ogClientGeneratorV2.sh es el guión de ejecución del isntalador.
+
+
diff --git a/client/boot-tools/clientstructure/etc/apt/sources.list.debian b/client/boot-tools/clientstructure/etc/apt/sources.list.debian
new file mode 100644
index 00000000..495e48d4
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/apt/sources.list.debian
@@ -0,0 +1,4 @@
+deb http://ftp.us.debian.org/debian lenny main contrib non-free
+
+deb http://security.debian.org/ lenny/updates main contrib non-free
+deb-src http://security.debian.org/ lenny/updates main contrib non-free
diff --git a/client/boot-tools/clientstructure/etc/apt/sources.list.ubuntu b/client/boot-tools/clientstructure/etc/apt/sources.list.ubuntu
new file mode 100644
index 00000000..29348ccc
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/apt/sources.list.ubuntu
@@ -0,0 +1,56 @@
+deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME main restricted
+deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME main restricted
+## Major bug fix updates produced after the final release of the
+## distribution.
+deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-updates main restricted
+deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-updates main restricted
+## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
+## team. Also, please note that software in universe WILL NOT receive any
+## review or updates from the Ubuntu security team.
+deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME universe
+deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME universe
+deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-updates universe
+deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-updates universe
+
+## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
+## team, and may not be under a free licence. Please satisfy yourself as to
+## your rights to use the software. Also, please note that software in
+## multiverse WILL NOT receive any review or updates from the Ubuntu
+## security team.
+deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME multiverse
+deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME multiverse
+deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-updates multiverse
+deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-updates multiverse
+
+## Uncomment the following two lines to add software from the 'backports'
+## repository.
+## N.B. software from this repository may not have been tested as
+## extensively as that contained in the main release, although it includes
+## newer versions of some applications which may provide useful features.
+## Also, please note that software in backports WILL NOT receive any review
+## or updates from the Ubuntu security team.
+# deb http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-backports main restricted universe multiverse
+# deb-src http://es.archive.ubuntu.com/ubuntu/ OSCODENAME-backports main restricted universe multiverse
+
+## Uncomment the following two lines to add software from Canonical's
+## 'partner' repository.
+## This software is not part of Ubuntu, but is offered by Canonical and the
+## respective vendors as a service to Ubuntu users.
+# deb http://archive.canonical.com/ubuntu OSCODENAME partner
+# deb-src http://archive.canonical.com/ubuntu OSCODENAME partner
+
+
+deb http://security.ubuntu.com/ubuntu OSCODENAME-security main restricted
+deb-src http://security.ubuntu.com/ubuntu OSCODENAME-security main restricted
+deb http://security.ubuntu.com/ubuntu OSCODENAME-security universe
+deb-src http://security.ubuntu.com/ubuntu OSCODENAME-security universe
+deb http://security.ubuntu.com/ubuntu OSCODENAME-security multiverse
+deb-src http://security.ubuntu.com/ubuntu OSCODENAME-security multiverse
+
+
+deb http://archive.ubuntu.com/ubuntu OSCODENAME main
+deb http://free.nchc.org.tw/drbl-core drbl stable
+deb http://free.nchc.org.tw/ubuntu OSCODENAME-security main restricted universe multiverse
+deb http://ppa.launchpad.net/freenx-team/ubuntu/ OSCODENAME main
+deb http://ppa.launchpad.net/randomaction/ppa/ubuntu OSCODENAME main
+deb-src http://ppa.launchpad.net/randomaction/ppa/ubuntu OSCODENAME main
diff --git a/client/boot-tools/clientstructure/etc/environment b/client/boot-tools/clientstructure/etc/environment
new file mode 100644
index 00000000..bb529d99
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/environment
@@ -0,0 +1,4 @@
+LC_TYPE=es_ES@euro
+LC_ALL=es_ES@euro
+LANG=es_ES@euro
+LANGUAGE=es_ES@euro \ No newline at end of file
diff --git a/client/boot-tools/clientstructure/etc/fstab b/client/boot-tools/clientstructure/etc/fstab
new file mode 100644
index 00000000..d7473df4
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/fstab
@@ -0,0 +1,13 @@
+# /etc/fstab: static file system information.
+#
+# Use 'blkid -o value -s UUID' to print the universally unique identifier
+# for a device; this may be used with UUID= as a more robust way to name
+# devices that works even if disks are added and removed. See fstab(5).
+#
+# <file system> <mount point> <type> <options> <dump> <pass>
+proc /proc proc 0 0
+/dev/sda1 ext3 errors=remount-ro 0 1
+
+
+
+
diff --git a/client/boot-tools/clientstructure/etc/initramfs-tools/hooks/oghooks b/client/boot-tools/clientstructure/etc/initramfs-tools/hooks/oghooks
new file mode 100755
index 00000000..51f452ff
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/initramfs-tools/hooks/oghooks
@@ -0,0 +1,58 @@
+#!/bin/sh -e
+# initramfs hook for OpenGnsys
+
+#@file oghooks
+#@brief configuración initrd para OpenGnSys
+#@warning
+#@version 0.9 - estrucura opengnsys, bash-static, unionfs, atheros
+#@author Antonio J. Doblas Viso.
+#@date 2010/05/24
+#*/
+
+PREREQ="og"
+
+# Output pre-requisites
+prereqs()
+{
+ echo "$PREREQ"
+}
+
+case "$1" in
+ prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+
+. /usr/share/initramfs-tools/hook-functions
+
+mkdir -p ${DESTDIR}/scripts/og-top
+mkdir -p ${DESTDIR}/scripts/og-premount
+mkdir -p ${DESTDIR}/scripts/og-bottom
+mkdir -p ${DESTDIR}/mnt/
+mkdir -p ${DESTDIR}/net/
+mkdir -p ${DESTDIR}/usr
+mkdir -p ${DESTDIR}/var/lock
+mkdir -p ${DESTDIR}/var/log
+mkdir -p ${DESTDIR}/opt/opengnsys;
+mkdir -p ${DESTDIR}/ogboot;
+mkdir -p ${DESTDIR}/boot;
+
+# Insert basic binaries
+copy_exec /bin/bash-static /bin/bash
+copy_exec /usr/bin/unionfs-fuse
+copy_exec /sbin/mount.cifs
+
+
+# Insert OpenGnsys Engine
+#mkdir -p ${DESTDIR}/opt/opengnsys/lib/engine
+#cp -prv /opt/opengnsys/client/lib/engine ${DESTDIR}/opt/opengnsys/lib/engine
+
+#rm -fr ${DESTDIR}/lib/modules/2.6.32-21-generic-pae/kernel/drivers/net/atl*
+manual_add_modules cifs
+manual_add_modules smbfs
+manual_add_modules atl1e
+manual_add_modules squashfs
+
+
diff --git a/client/boot-tools/clientstructure/etc/initramfs-tools/modules b/client/boot-tools/clientstructure/etc/initramfs-tools/modules
new file mode 100644
index 00000000..8bac1d4b
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/initramfs-tools/modules
@@ -0,0 +1,14 @@
+# List of modules that you want to include in your initramfs.
+#
+# Syntax: module_name [args ...]
+#
+# You must run update-initramfs(8) to effect this change.
+#
+# Examples:
+#
+# raid1
+# sd_mod
+vga16b
+vesafb
+fbcon
+
diff --git a/client/boot-tools/clientstructure/etc/initramfs-tools/scripts/ogfunctions b/client/boot-tools/clientstructure/etc/initramfs-tools/scripts/ogfunctions
new file mode 100644
index 00000000..ef6f00c8
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/initramfs-tools/scripts/ogfunctions
@@ -0,0 +1,427 @@
+#@file ogfunctions.lib
+#@brief Librería o clase para la generación del 1erFS
+#@class client
+#@brief Funciones para la generación del primers sistema (initrd)
+#@version 0.91
+#@warning License: GNU GPLv3+
+
+
+
+
+ogExportKernelParameters ()
+{
+ GLOBAL="cat /proc/cmdline"
+ for i in `${GLOBAL}`
+ do
+ echo $i | grep "=" > /dev/null && export $i
+ done
+return 0
+}
+
+ogExportVarEnvironment ()
+{
+ #puntos de accesos al servidor ogprotocol=nfs
+ export NFSROOTBOOT="/var/lib/tftpboot"
+ export NFSCLIENTDIR="/opt/opengnsys/client"
+ export NFSLOGDIR="/opt/opengnsys/log/clients"
+ export NFSIMGDIR="/opt/opengnsys/images"
+ #puntos de accesos al servidor ogprotocol=smb
+ export SMBROOTBOOT="tftpboot"
+ export SMBCLIENTDIR="ogclient"
+ export SMBLOGDIR="oglog"
+ export SMBIMGDIR="ogimages"
+
+ #puntos de montaje local ram o cache
+ export LOCALCLIENTDIR="/opt/opengnsys"
+ export LOCALLOGDIR="/opt/opengnsys/log"
+ export LOCALIMGDIR="/opt/opengnsys/images"
+ export LOCALROOTBOOT="/opt/og2fs/tftpboot" #punto de montaje del contendor tftpboot
+ export LOCALROOTIMG="/opt/og2fs/2ndfs" #punto de montaje donde se accede al 2nd FS mediante loop
+ export LOCALROOTRAM="/opt/og2fs/1stfs" #punto de montaje para unionfs
+ export LOCALROOTUNION="/opt/og2fs/unionfs" #punto de union entreo LOCALROOTIMG y LOCALROOTRAM
+ ##INFORMACION DE OTRAS VARIABLES OBTENDIAS EN OTRAS FUNCIONES.
+ #ogGetROOTSERVER() ip del servidor pxe, valor obtenido automaticamente desde dhcpd.
+ #IPV4DDR
+ #IPV4BROADCAST
+ #IPV4NETMASK
+ #IPV4GATEWAY
+ #DNS0 DNS1
+ #HOSTNAME
+ #ROOTSERVER #ip del servidor pxe que ha servido el kernel
+ #REPOSERVER=ogrepo -> ogConectROOTSERVER() ip del servidor de images para separar serviicios.
+ return 0
+}
+
+ogConfigureRamfs ()
+{
+ mkdir -p $LOCALROOTBOOT
+ mkdir -p $LOCALROOTIMG
+ mkdir -p $LOCALROOTRAM
+ mkdir -p $LOCALROOTUNION
+}
+
+ogLoadNetModule ()
+{
+ #cargando netmodule
+ if [ -n "$ognetmodule" ]
+ then
+ echo "Cargando modulo de red $netmodule"
+ insmod `find /lib/modules/ -name ${netmodule}*`
+ fi
+}
+
+
+ogPostConfigureFS()
+{
+ # configuramos el /etc/hostname.
+ echo $HOSTNAME > /etc/hostname
+
+ #configuramos el /etc/hosts
+ echo "127.0.0.1 localhost" > /etc/hosts
+ echo "$IPV4ADDR $HOSTNAME" >> /etc/hosts
+
+ #configuramos el host.conf
+ echo "order hosts,bind" > /etc/host.conf
+ echo "multi on" >> /etc/host.conf
+
+ # configuramos el /etc/networks
+ #read -e NETIP NETDEFAULT <<<$(route -n | grep eth0 | awk -F" " '{print $1}')
+ NETIP=$(route -n | grep eth0 | awk -F" " '{print $1}') && NETIP=$(echo $NETIP | cut -f1 -d" ")
+ echo "default 0.0.0.0" > /etc/networks
+ echo "loopback 127.0.0.0" >> /etc/networks
+ echo "link-local 169.254.0.0" >> /etc/networks
+ echo "localnet $NETIP" >> /etc/networks
+ #route
+}
+
+
+
+
+ogGetROOTSERVER ()
+{
+ # get nfs root from dhcp
+ if [ "x${NFSROOT}" = "xauto" ]; then
+ # check if server ip is part of dhcp root-path
+ if [ "${ROOTPATH#*:}" = "${ROOTPATH}" ]; then
+ NFSROOT=${ROOTSERVER}:${ROOTPATH}
+ else
+ NFSROOT=${ROOTPATH}
+ fi
+
+ # nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
+ elif [ -n "${NFSROOT}" ]; then
+ # nfs options are an optional arg
+ if [ "${NFSROOT#*,}" != "${NFSROOT}" ]; then
+ NFSOPTS="-o ${NFSROOT#*,}"
+ fi
+ NFSROOT=${NFSROOT%%,*}
+ if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then
+ NFSROOT=${ROOTSERVER}:${NFSROOT}
+ fi
+ fi
+ export ROOTSERVER
+return 0
+}
+
+ogConectROOTSERVER ()
+{
+local OPTIONS
+#params a detectar
+if [ $ogrepo ]
+then
+ # Validar si la ip es correcta
+ ROOTREPO=$ogrepo
+else
+ ROOTREPO=$ROOTSERVER
+fi
+
+case "$ogprotocol" in
+ cdrom)
+ echo "Montar imagen de CD-ROM"
+ blkid /dev/s*
+ mount -t iso9660 LABEL=ogClient $LOCALROOTBOOT
+ ;;
+ httfs)
+ echo "protocolo httfs aun no soportado"
+ ;;
+ sshfs)
+ echo "protocolo sshfs aun no soportado"
+ ;;
+ smb)
+ echo "Preparando conexión con el Repositorio $ROOTSERVER por $ogprotocol"
+ OPTIONS=" -o user=opengnsys,pass=og"
+ mount.cifs //${ROOTSERVER}/${SMBCLIENTDIR} $LOCALCLIENTDIR $OPTIONS
+ mount.cifs //${ROOTSERVER}/${SMBLOGDIR} $LOCALLOGDIR $OPTIONS
+ mount.cifs //${ROOTSERVER}/${SMBROOTBOOT} $LOCALROOTBOOT $OPTIONS
+ mount.cifs //${ROOTREPO}/${SMBIMGDIR} $LOCALIMGDIR ${OPTIONS},ro
+ ;;
+ nfs)
+ echo "Preparando conexión con el Repositorio $ROOTSERVER por $ogprotocol"
+ nfsmount -o nolock,ro $ROOTSERVER:$NFSCLIENTDIR $LOCALCLIENTDIR
+ nfsmount -o nolock $ROOTSERVER:$NFSLOGDIR $LOCALLOGDIR
+ nfsmount -o nolock $ROOTSERVER:$NFSROOTBOOT $LOCALROOTBOOT
+ nfsmount -o nolock,ro $ROOTREPO:$NFSIMGDIR $LOCALIMGDIR
+ ;;
+esac
+}
+
+ogMerge2ndFile()
+{
+if [ -f $LOCALROOTBOOT/ogclient/ogclient.sqfs ]
+then
+ cat /proc/mounts > /tmp/mtab.preunion
+ if [ "$og2nd" == "img" ]
+ then
+ #para acceder al img
+ losetup /dev/loop0 $LOCALROOTBOOT/ogclient/ogclient.img -o 32256
+ mount /dev/loop0 $LOCALROOTIMG
+ else
+ ## para acceder al squashfs
+ mount $LOCALROOTBOOT/ogclient/ogclient.sqfs $LOCALROOTIMG -t squashfs -o loop
+ fi
+ for i in etc var lib bin sbin usr root boot; do
+ unionmount $i
+ done
+ cat /tmp/mtab.preunion > /etc/mtab
+else
+ echo "Fichero imagen del cliente no encontrado"
+ return 1
+fi
+}
+
+
+unionmount()
+{
+ tmpdir=/$1 #dir
+ FUSE_OPT="-o default_permissions -o allow_other -o use_ino -o nonempty -o suid"
+ UNION_OPT="-o cow -o noinitgroups"
+ UBIN="unionfs-fuse"
+ #UPATH="/unionfs"
+ #LOCALROOTIMG="/opt/og2fs/2ndfs"
+ #LOCALROOTRAM="/opt/og2fs/1stfs" #/unionfs/host #punto de montaje para unionfs
+ #LOCALROOTUNION=/opt/og2fs/unionfs/" #/unionfs/union #punto de union entreo LOCALROOTIMG y LOCALROOTRAM
+ #mkdir -p $LOCALROOTRAM #/unionfs/host
+ #mkdir -p $LOCALROOTUNION #/unionfs/union
+ mkdir -p $LOCALROOTRAM$tmpdir
+ #mount --bind /$tmpdir $LOCALROOTRAM$tmpdir
+ U1STDIR="${LOCALROOTRAM}${tmpdir}=RW"
+ U2NDDIR="${LOCALROOTIMG}${tmpdir}=RO"
+ UNIONDIR=$LOCALROOTUNION$tmpdir
+ mkdir -p $UNIONDIR
+ $UBIN $FUSE_OPT $UNION_OPT ${U1STDIR}:${U2NDDIR} $UNIONDIR
+ mount --bind $UNIONDIR $tmpdir
+}
+
+
+unionmountOLD()
+{
+ FUSE_OPT="-o default_permissions -o allow_other -o use_ino -o nonempty -o suid"
+ UNION_OPT="-o cow -o noinitgroups"
+ UPATH="/unionfs"
+ UBIN="unionfs-fuse"
+ mkdir -p /unionfs/host
+ mkdir -p /unionfs/union
+ dir=$1
+ mkdir -p /unionfs/host/$dir
+ #mount --bind /$dir /unionfs/host/$dir
+ mkdir -p /unionfs/union/$dir
+ host="/unionfs/host/${dir}=RW"
+ common="/opt/og2fs/${dir}=RO"
+ $UBIN $FUSE_OPT $UNION_OPT ${host}:${common} /unionfs/union/$dir
+ mount --bind /unionfs/union/$dir /$dir
+}
+
+ogconfigure_lo()
+{
+# for the portmapper we need localhost
+ifconfig lo 127.0.0.1
+#/etc/init.d/portmap start
+}
+
+ogconfigure_networking()
+{
+IP=$IPOPTS
+# http://paste.ubuntu.com/427631/ Paste from yofel at Tue, 4 May 2010 13:49:56 +0000
+ if [ -n "${BOOTIF}" ]; then
+ # pxelinux sets BOOTIF to a value based on the mac address of the
+ # network card used to PXE boot, so use this value for DEVICE rather
+ # than a hard-coded device name from initramfs.conf. this facilitates
+ # network booting when machines may have multiple network cards.
+ # pxelinux sets BOOTIF to 01-$mac_address
+
+ # strip off the leading "01-", which isn't part of the mac
+ # address
+ temp_mac=${BOOTIF#*-}
+
+ # convert to typical mac address format by replacing "-" with ":"
+ bootif_mac=""
+ IFS='-'
+ for x in $temp_mac ; do
+ if [ -z "$bootif_mac" ]; then
+ bootif_mac="$x"
+ else
+ bootif_mac="$x:$bootif_mac"
+ fi
+ done
+ unset IFS
+
+ # look for devices with matching mac address, and set DEVICE to
+ # appropriate value if match is found.
+ for device in /sys/class/net/* ; do
+ if [ -f "$device/address" ]; then
+ current_mac=$(cat "$device/address")
+ if [ "$bootif_mac" = "$current_mac" ]; then
+ DEVICE=${device##*/}
+ break
+ fi
+ fi
+ done
+ fi
+
+ # networking already configured thus bail out
+ [ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ] && return 0
+
+ # support ip options see linux sources
+ # Documentation/filesystems/nfsroot.txt
+ # Documentation/frv/booting.txt
+
+ for ROUNDTTT in 2 3 4 6 9 16 25 36 64 100; do
+
+ # The NIC is to be configured if this file does not exist.
+ # Ip-Config tries to create this file and when it succeds
+ # creating the file, ipconfig is not run again.
+ if [ -e /tmp/net-"${DEVICE}".conf ]; then
+ break;
+ fi
+
+ case ${IP} in
+ none|off)
+ # Do nothing
+ ;;
+ ""|on|any)
+ # Bring up device
+ echo "Setting $DEVICE with kernel params $IP: ipconfig -t ${ROUNDTTT} ${DEVICE} "
+ ipconfig -t ${ROUNDTTT} ${DEVICE}
+ ;;
+ dhcp|bootp|rarp|both)
+ echo "Setting $DEVICE with (dhcp) kernel params $IP: ipconfig -t ${ROUNDTTT} -c ${IP} -d ${DEVICE} "
+ ipconfig -t ${ROUNDTTT} -c ${IP} -d ${DEVICE}
+ ;;
+ *)
+ echo "Setting $DEVICE with kernel params $IP: ipconfig -t ${ROUNDTTT} -d $IP "
+ ipconfig -t ${ROUNDTTT} -d $IP
+
+ # grab device entry from ip option
+ NEW_DEVICE=${IP#*:*:*:*:*:*}
+ if [ "${NEW_DEVICE}" != "${IP}" ]; then
+ NEW_DEVICE=${NEW_DEVICE%:*}
+ else
+ # wrong parse, possibly only a partial string
+ NEW_DEVICE=
+ fi
+ if [ -n "${NEW_DEVICE}" ]; then
+ DEVICE="${NEW_DEVICE}"
+ fi
+ ;;
+ esac
+ done
+
+ # source ipconfig output
+ if [ -n "${DEVICE}" ]; then
+ # source specific bootdevice
+ . /tmp/net-${DEVICE}.conf
+ else
+ # source any interface as not exaclty specified
+ . /tmp/net-*.conf
+ fi
+}
+
+ #####################################################################
+# Ask yesno question.
+#
+# Usage: yesno OPTIONS QUESTION
+#
+# Options:
+# --timeout N Timeout if no input seen in N seconds.
+# --default ANS Use ANS as the default answer on timeout or
+# if an empty answer is provided.
+#
+# Exit status is the answer. 0=yes 1=no
+
+ogYesNo()
+{
+ local ans
+ local ok=0
+ local timeout=0
+ local default
+ local t
+
+ while [[ "$1" ]]
+ do
+ case "$1" in
+ --default)
+ shift
+ default=$1
+ if [[ ! "$default" ]]; then error "Missing default value"; fi
+ t=$(echo $default | tr '[:upper:]' '[:lower:]')
+
+ if [[ "$t" != 'y' && "$t" != 'yes' && "$t" != 'n' && "$t" != 'no' ]]; then
+ error "Illegal default answer: $default"
+ fi
+ default=$t
+ shift
+ ;;
+
+ --timeout)
+ shift
+ timeout=$1
+ if [[ ! "$timeout" ]]; then error "Missing timeout value"; fi
+ #if [[ ! "$timeout" =~ ^[0-9][0-9]*$ ]]; then error "Illegal timeout value: $timeout"; fi
+ shift
+ ;;
+
+ -*)
+ error "Unrecognized option: $1"
+ ;;
+
+ *)
+ break
+ ;;
+ esac
+ done
+
+ if [[ $timeout -ne 0 && ! "$default" ]]; then
+ error "Non-zero timeout requires a default answer"
+ fi
+
+ if [[ ! "$*" ]]; then error "Missing question"; fi
+
+ while [[ $ok -eq 0 ]]
+ do
+ if [[ $timeout -ne 0 ]]; then
+ if ! read -t $timeout -p "$*" ans; then
+ ans=$default
+ else
+ # Turn off timeout if answer entered.
+ timeout=0
+ if [[ ! "$ans" ]]; then ans=$default; fi
+ fi
+ else
+ read -p "$*" ans
+ if [[ ! "$ans" ]]; then
+ ans=$default
+ else
+ ans=$(echo $ans | tr '[:upper:]' '[:lower:]')
+ fi
+ fi
+
+ if [[ "$ans" == 'y' || "$ans" == 'yes' || "$ans" == 'n' || "$ans" == 'no' ]]; then
+ ok=1
+ fi
+
+ if [[ $ok -eq 0 ]]; then warning "Valid answers are: yes y no n"; fi
+ done
+ [[ "$ans" = "y" || "$ans" == "yes" ]]
+}
+
+
diff --git a/client/boot-tools/clientstructure/etc/initramfs-tools/scripts/oginit b/client/boot-tools/clientstructure/etc/initramfs-tools/scripts/oginit
new file mode 100755
index 00000000..d91afaee
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/initramfs-tools/scripts/oginit
@@ -0,0 +1,114 @@
+# OpenGnsys oginit -*- shell-script -*-
+
+#@file oginit
+#@brief Guion modificador inicio initrd para OpenGnSys
+#@warning
+#@version 0.1 - basado en ROOTfs
+#@author Antonio J. Doblas Viso. Universidad de Málaga
+#@date 2009/00/00
+#@version 0.2 - basado en el instalador de ubunto
+#@author Alejandro Castillo
+#@author Ramón Gómez
+#@author Irina
+#@author Antonio Doblas
+#@date 2010/00/00
+#@version 0.7 - Generación limpia con mkinitrd, busybox
+#@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT.
+#@date 2010/05/24
+#@version 0.8 - Integración con FileSystem externo
+#@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT.
+#@date 2010/06/24
+#@version 0.8.1 - UnionFS + squasfs
+#@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT.
+#@date 2010/06/29
+
+#*/
+
+
+
+
+
+# Parameter: Where to mount the filesystem
+mountroot ()
+{
+ [ "$quiet" != "y" ] && log_begin_msg "Running OpenGnsys /scripts/og-top"
+ run_scripts /scripts/og-top
+ [ "$quiet" != "y" ] && log_end_msg
+
+ # If the root device hasn't shown up yet, give it a little while
+ # to deal with removable devices
+
+ . /scripts/functions
+ . /scripts/ogfunctions
+
+ sleep 2
+
+ [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before get OG variables: y/N "
+ [ $? == 0 ] && sh || echo " "
+
+
+ set -a
+ log_success_msg "Checking kernel parameters"
+ ogExportKernelParameters
+ log_success_msg "Checking Opengnys Environmnet"
+ ogExportVarEnvironment
+
+ [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure ramfs structure for OG: y/N "
+ [ $? == 0 ] && sh || echo " "
+ ogConfigureRamfs
+
+ [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure netmoule specified in kernel parameters: y/N "
+ [ $? == 0 ] && sh || echo " "
+ ogLoadNetModule
+
+ #[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-premount"
+ #run_scripts /scripts/og-premount
+ #[ "$quiet" != "y" ] && log_end_msg
+
+ [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before configure networking: y/N "
+ [ $? == 0 ] && sh || echo " "
+ ogconfigure_networking
+ log_success_msg "config networking"
+ ogconfigure_lo
+ log_success_msg "config loopback"
+
+
+ [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before detect rootserver: y/N "
+ [ $? == 0 ] && sh || echo " "
+ ogGetROOTSERVER && log_success_msg "Get Info from pxe server"
+
+ [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before conect with og Services : y/N "
+ [ $? == 0 ] && sh || echo " "
+ ogConectROOTSERVER && log_success_msg "Conecting with og services" || sh
+ # ogConectROOTMEDIA
+
+ [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before merge the Second File System with initrd (First File System) : y/N "
+ [ $? == 0 ] && sh || echo " "
+ ogMerge2ndFile && log_success_msg "Merge onto Second File System"
+
+
+ #[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-bottom"
+ #run_scripts /scripts/og-bottom
+ #[ "$quiet" != "y" ] && log_end_msg
+
+
+ [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before doing the postconfiguration: y/N "
+ [ $? == 0 ] && sh || echo " "
+ ogPostConfigureFS
+ setupcon -k
+
+ [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before calling oginit with /etc/inittab: y/N "
+ [ $? == 0 ] && sh || echo " "
+
+if [ "$oginit" ]
+then
+ exec $oginit
+else
+ exec init
+fi
+
+
+
+
+
+}
diff --git a/client/boot-tools/clientstructure/etc/inittab b/client/boot-tools/clientstructure/etc/inittab
new file mode 100644
index 00000000..6d3277fc
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/inittab
@@ -0,0 +1,14 @@
+# This is run first except when booting in single-user mode
+#
+#::sysinit:/opt/opengnsys/etc/preinit/defaultTESTING.sh
+# /bin/sh invocations on selected ttys
+#
+# Start an "askfirst" shell on the console (whatever that may be)
+#::askfirst:/bin/sh
+# Start an "askfirst" shell on /dev/tty2-4
+#tty1::respawn:/sbin/getty 38400 tty1
+tty1::respawn:/opt/opengnsys/etc/preinit/default.sh
+tty2::respawn:/sbin/getty 38400 tty2
+tty3::respawn:/sbin/getty 38400 tty3
+tty4::respawn:/sbin/getty 38400 tty4
+tty5::respawn:/sbin/getty 38400 tty5
diff --git a/client/boot-tools/clientstructure/etc/modprobe.d/blacklist-framebuffer.conf b/client/boot-tools/clientstructure/etc/modprobe.d/blacklist-framebuffer.conf
new file mode 100644
index 00000000..8b047e4e
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/modprobe.d/blacklist-framebuffer.conf
@@ -0,0 +1,30 @@
+# Framebuffer drivers are generally buggy and poorly-supported, and cause
+# suspend failures, kernel panics and general mayhem. For this reason we
+# never load them automatically.
+blacklist aty128fb
+blacklist atyfb
+#blacklist radeonfb
+blacklist cirrusfb
+blacklist cyber2000fb
+blacklist cyblafb
+blacklist gx1fb
+blacklist hgafb
+blacklist i810fb
+blacklist intelfb
+blacklist kyrofb
+blacklist lxfb
+blacklist matroxfb_base
+blacklist neofb
+blacklist nvidiafb
+blacklist pm2fb
+blacklist rivafb
+blacklist s1d13xxxfb
+blacklist savagefb
+blacklist sisfb
+blacklist sstfb
+blacklist tdfxfb
+blacklist tridentfb
+#blacklist vesafb
+blacklist vfb
+blacklist viafb
+blacklist vt8623fb
diff --git a/client/boot-tools/clientstructure/etc/mtab b/client/boot-tools/clientstructure/etc/mtab
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/mtab
diff --git a/client/boot-tools/clientstructure/etc/network/interfaces b/client/boot-tools/clientstructure/etc/network/interfaces
new file mode 100644
index 00000000..dbe43582
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/network/interfaces
@@ -0,0 +1,4 @@
+auto lo
+iface lo inet loopback
+auto eth0
+iface eth0 inet dhcp \ No newline at end of file
diff --git a/client/boot-tools/clientstructure/etc/profile.d/loadenviron.sh b/client/boot-tools/clientstructure/etc/profile.d/loadenviron.sh
new file mode 100755
index 00000000..c6e8f790
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/profile.d/loadenviron.sh
@@ -0,0 +1,87 @@
+#!/bin/bash
+#/**
+#@file loadenviron.sh
+#@brief Script de carga de la API de funciones de OpenGNSys.
+#@warning License: GNU GPLv3+
+#@version 0.9
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2009-10-10
+#*/
+
+ GLOBAL="cat /proc/cmdline"
+ for i in `${GLOBAL}`
+ do
+ echo $i | grep "=" > /dev/null && export $i
+ done
+
+
+# FIXME Temporal
+export LANG="${LANG:-es_ES}"
+
+#/// Directorios del projecto OpenGNSys.
+export OPENGNSYS="${OPENGNSYS:-/opt/opengnsys}"
+if [ -d $OPENGNSYS ]; then
+ export OGBIN=$OPENGNSYS/bin
+ export OGETC=$OPENGNSYS/etc
+ export OGLIB=$OPENGNSYS/lib
+ export OGAPI=$OGLIB/engine/bin
+ export OGSCRIPTS=$OPENGNSYS/scripts
+ export OGIMG=$OPENGNSYS/images
+ export OGCAC=$OPENGNSYS/cache
+ export OGLOG=$OPENGNSYS/log
+
+# export PATH=$OGBIN:$OGAPI:$OGSCRIPTS:$PATH
+ # export LD_LIBRARY_PATH=$OGLIB:$LD_LIBRARY_PATH
+
+ #/// Cargar fichero de idioma.
+ LANGFILE=$OGETC/lang.$LANG.conf
+ if [ -f $LANGFILE ]; then
+ source $LANGFILE
+ #for i in $(grep "^[a-zA-Z].*=" $LANGFILE | cut -f1 -d=); do
+ for i in $(awk -F= '{if (NF==2) print $1}' $LANGFILE); do
+ export $i
+ done
+ fi
+ #/// Cargar API de funciones.
+ echo "$MSG_LOADAPI"
+ for i in $OGAPI/*.lib; do
+ source $i
+ done
+ for i in $(typeset -F | cut -f3 -d" "); do
+ export -f $i
+ done
+ # Carga de las API testing
+ if [ "$engine" = "testing" ]
+ then
+ for i in $OGAPI/*.testing; do
+ source $i
+ done
+ fi
+
+ source /tmp/net-eth* 2>/dev/null
+
+ # Añadir dependencia de arquitectura
+ ARCH=$(ogGetArch)
+ if [ -n "$ARCH" ]; then
+ # export PATH=$OGBIN/$ARCH:$PATH
+ # export LD_LIBRARY_PATH=$OGLIB/$ARCH:$LD_LIBRARY_PATH
+ export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:/opt/og2fs/2ndfs/opt/drbl/sbin
+ export PATH=$OGSCRIPTS:$PATH:$OGAPI:$OGBIN:$OGBIN/$ARCH
+ fi
+ # Fichero de registros.
+ export OGLOGFILE="$OGLOG/$(ogGetIpAddress).log"
+ # FIXME Pruebas para grupos de ordenadores
+ #export OGGROUP=$(ogGetGroup)
+ export OGGROUP=aula3
+fi
+
+#/// Declaración de códigos de error.
+export OG_ERR_FORMAT=1 # Formato de ejecución incorrecto.
+export OG_ERR_NOTFOUND=2 # Fichero o dispositivo no encontrado.
+export OG_ERR_PARTITION=3 # Error en partición de disco.
+export OG_ERR_LOCKED=4 # Partición o fichero bloqueado.
+export OG_ERR_IMAGE=5 # Error al crear o restaurar una imagen.
+export OG_ERR_NOTOS=6 # Sin sistema operativo.
+export OG_ERR_NOTEXEC=7 # Programa o función no ejecutable.
+
+
diff --git a/client/boot-tools/clientstructure/etc/ssh/ssh_config b/client/boot-tools/clientstructure/etc/ssh/ssh_config
new file mode 100644
index 00000000..7f9319dc
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/ssh/ssh_config
@@ -0,0 +1,56 @@
+
+# This is the ssh client system-wide configuration file. See
+# ssh_config(5) for more information. This file provides defaults for
+# users, and the values can be changed in per-user configuration files
+# or on the command line.
+
+# Configuration data is parsed as follows:
+# 1. command line options
+# 2. user-specific file
+# 3. system-wide file
+# Any configuration value is only changed the first time it is set.
+# Thus, host-specific definitions should be at the beginning of the
+# configuration file, and defaults at the end.
+
+# Site-wide defaults for some commonly used options. For a comprehensive
+# list of available options, their meanings and defaults, please see the
+# ssh_config(5) man page.
+
+Host *
+# ForwardAgent no
+# ForwardX11 no
+# ForwardX11Trusted yes
+# RhostsRSAAuthentication no
+# RSAAuthentication yes
+# PasswordAuthentication yes
+ HostbasedAuthentication no
+# GSSAPIAuthentication no
+# GSSAPIDelegateCredentials no
+# GSSAPIKeyExchange no
+# GSSAPITrustDNS no
+# BatchMode no
+# CheckHostIP yes
+# AddressFamily any
+# ConnectTimeout 0
+# StrictHostKeyChecking ask
+# IdentityFile ~/.ssh/identity
+# IdentityFile ~/.ssh/id_rsa
+# IdentityFile ~/.ssh/id_dsa
+# Port 22
+# Protocol 2,1
+# Cipher 3des
+# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
+# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
+# EscapeChar ~
+# Tunnel no
+# TunnelDevice any:any
+# PermitLocalCommand no
+# VisualHostKey no
+ SendEnv LANG LC_*
+# HashKnownHosts yes
+ GSSAPIAuthentication yes
+ GSSAPIDelegateCredentials no
+
+ StrictHostKeyChecking no
+ UserKnownHostsFile=/dev/null
+
diff --git a/client/boot-tools/clientstructure/etc/ssh/sshd_config b/client/boot-tools/clientstructure/etc/ssh/sshd_config
new file mode 100644
index 00000000..ea0303b3
--- /dev/null
+++ b/client/boot-tools/clientstructure/etc/ssh/sshd_config
@@ -0,0 +1,86 @@
+# Package generated configuration file
+# See the sshd_config(5) manpage for details
+
+# What ports, IPs and protocols we listen for
+Port 22
+# Use these options to restrict which interfaces/protocols sshd will bind to
+#ListenAddress ::
+#ListenAddress 0.0.0.0
+Protocol 2
+# HostKeys for protocol version 2
+HostKey /etc/ssh/ssh_host_rsa_key
+HostKey /etc/ssh/ssh_host_dsa_key
+#Privilege Separation is turned on for security
+UsePrivilegeSeparation yes
+
+# Lifetime and size of ephemeral version 1 server key
+KeyRegenerationInterval 3600
+ServerKeyBits 768
+
+# Logging
+SyslogFacility AUTH
+LogLevel INFO
+
+# Authentication:
+LoginGraceTime 120
+PermitRootLogin yes
+StrictModes yes
+
+RSAAuthentication yes
+PubkeyAuthentication yes
+#AuthorizedKeysFile %h/.ssh/authorized_keys
+
+# Don't read the user's ~/.rhosts and ~/.shosts files
+IgnoreRhosts yes
+# For this to work you will also need host keys in /etc/ssh_known_hosts
+RhostsRSAAuthentication no
+# similar for protocol version 2
+HostbasedAuthentication no
+# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
+#IgnoreUserKnownHosts yes
+
+# To enable empty passwords, change to yes (NOT RECOMMENDED)
+PermitEmptyPasswords no
+
+# Change to yes to enable challenge-response passwords (beware issues with
+# some PAM modules and threads)
+ChallengeResponseAuthentication no
+
+# Change to no to disable tunnelled clear text passwords
+#PasswordAuthentication yes
+
+# Kerberos options
+#KerberosAuthentication no
+#KerberosGetAFSToken no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+
+X11Forwarding yes
+X11DisplayOffset 10
+PrintMotd no
+PrintLastLog yes
+TCPKeepAlive yes
+#UseLogin no
+
+#MaxStartups 10:30:60
+#Banner /etc/issue.net
+
+# Allow client to pass locale environment variables
+AcceptEnv LANG LC_*
+
+Subsystem sftp /usr/lib/openssh/sftp-server
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication. Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+UsePAM yes
diff --git a/client/boot-tools/clientstructure/root/CompileSoftware.sh b/client/boot-tools/clientstructure/root/CompileSoftware.sh
new file mode 100755
index 00000000..1a9b854a
--- /dev/null
+++ b/client/boot-tools/clientstructure/root/CompileSoftware.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+################################################################
+##################### SOFTWARE #####################
+################################################################
+export LANGUAGE=C
+export LC_ALL=C
+export LANG=C
+
+#dpkg-divert --local --rename --add /sbin/initctl
+#ln -s /bin/true /sbin/initctl
+
+apt-get -y update
+# software to compile code
+apt-get -y --force-yes install build-essential libattr* attr make m4 gettext libmhash-dev gdebi-core gawk
+
+source /opt/opengnsys/lib/engine/bin/ToolsGNU.c
+
+ctorrent install
+udpcast install
+#ntfs-3g install
+ms-sys install
+
+wget -O partclone_0.2.16_i386.deb http://downloads.sourceforge.net/project/partclone/stable/0.2.16/partclone_0.2.16_i386.deb?use_mirror=ovh
+gdebi -n partclone_0.2.16_i386.deb
+
+ cd /tmp
+ wget http://damien.guibouret.free.fr/savepart.zip
+ unzip savepart.zip -d /sbin/
+
+
diff --git a/client/boot-tools/clientstructure/root/ConfFS.sh b/client/boot-tools/clientstructure/root/ConfFS.sh
new file mode 100755
index 00000000..3e0f4b5c
--- /dev/null
+++ b/client/boot-tools/clientstructure/root/ConfFS.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+dpkg-divert --local --rename --add /sbin/initctl
+ln -s /bin/true /sbin/initctl
+#mv /etc/fstab /etc/fstab.original 2>/dev/null
+#mv /etc/mtab /etc/mtab.original 2>/dev/null
+
+#TODO: fichero etc/hosts
+#TODO: fichero etc/resolv.conf
+echo "ogClient" > /etc/hostname
+
+#export PASSROOT=og
+#dpkg-reconfigure passwd
+#echo "root:$PASSROOT" | chpasswd
+
+
+#for i in pts/0 pts/1 pts/2 pts/3 do
+#
+#
+#done
+#TODO: introducir mas consoluas para el acceso como root.
+echo "pts/0" >> /etc/securetty
+echo "pts/1" >> /etc/securetty
+echo "pts/2" >> /etc/securetty
+echo "pts/3" >> /etc/securetty \ No newline at end of file
diff --git a/client/boot-tools/clientstructure/root/GenerateInitrd.generic.sh b/client/boot-tools/clientstructure/root/GenerateInitrd.generic.sh
new file mode 100755
index 00000000..eaeb475b
--- /dev/null
+++ b/client/boot-tools/clientstructure/root/GenerateInitrd.generic.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+export OSDISTRIB=$(lsb_release -i | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null
+#OSCODENAME=$(lsb_release -c | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null
+export OSCODENAME=$(cat /etc/lsb-release | grep CODENAME | awk -F= '{print $NF}')
+export OSRELEASE=$(uname -a | awk '{print $3}')
+uname -a | grep x86_64 > /dev/null && export OSARCH=amd64 || export OSARCH=i386
+export OSHTTP="http://es.archive.ubuntu.com/ubuntu/"
+
+
+
+cd /usr/lib/initramfs-tools/bin/
+rm *
+cp /bin/busybox ./
+cd /tmp/
+mkinitramfs -o /tmp/initrd.img-$OSRELEASE -v $OSRELEASE
+cp /boot/vmlinuz-$OSRELEASE /tmp \ No newline at end of file
diff --git a/client/boot-tools/clientstructure/root/InstallSoftware.sh b/client/boot-tools/clientstructure/root/InstallSoftware.sh
new file mode 100755
index 00000000..da8d8d06
--- /dev/null
+++ b/client/boot-tools/clientstructure/root/InstallSoftware.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+################################################################
+##################### SOFTWARE #####################
+################################################################
+export LANGUAGE=C
+export LC_ALL=C
+export LANG=C
+
+
+dpkg-divert --local --rename --add /sbin/initctl
+ln -s /bin/true /sbin/initctl
+
+apt-get clean
+apt-get -y update
+
+
+# software system
+apt-get -y --force-yes install linux-image-${OSRELEASE} linux-headers-${OSRELEASE} linux-image-$RELEASE wget dialog man-db htop fbset gdebi-core busybox-static
+
+apt-get -y --force-yes install console-data locales
+
+# sofware networking
+apt-get -y --force-yes install netpipes nfs-common sshfs smbfs smbclient davfs2 unionfs-fuse open-iscsi nmap tcpdump arping dnsutils
+
+apt-get clean
+# software services
+apt-get -y --force-yes install openssh-server bittornado trickle iptraf screen schroot grub
+
+# software disk and filesystem
+apt-get -y --force-yes install drbl-ntfsprogs ntfsprogs parted ntfs-3g dosfstools
+apt-get -y --force-yes install dmraid dmsetup lvm2 e2fsprogs jfsutils reiserfsprogs xfsprogs unionfs-fuse mhddfs squashfs-tools
+apt-get -y --force-yes install btrfs-tools hfsplus hfsprogs hfsutils nilfs-tools reiser4progs ufsutils
+
+# software cloning
+apt-get -y --force-yes install drbl-partimage fsarchiver pv kexec-tools
+apt-get -y --force-yes install mbuffer
+
+
+apt-get clean
+## software postconf
+apt-get -y --force-yes install drbl-chntpw chntpw ethtool lshw gawk
+
+# software compressor
+apt-get -y --force-yes install lzma zip unzip gzip lzop drbl-lzop pigz pbzip2 lbzip2 rzip p7zip-full unzip
+
+apt-get -y --force-yes remove busybox
+apt-get -y --force-yes install busybox-static bash-static
+apt-get clean
+#apt-get -y --force-yes xorg-dev xorg lxde roxterm
+#
+####################################################################
+###################### Reconfigurando paquetes ######################
+###################################################################
+
+
+#dpkg-reconfigure console-data
+#dpkg-reconfigure console-setup
+#dpkg-reconfigure locales
+apt-get clean
+##TODO################# Borrar algunos binarios del mkinitramfs
+
+
diff --git a/client/boot-tools/clientstructure/root/ReconfigureLocales.sh b/client/boot-tools/clientstructure/root/ReconfigureLocales.sh
new file mode 100755
index 00000000..5480d141
--- /dev/null
+++ b/client/boot-tools/clientstructure/root/ReconfigureLocales.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+dpkg-reconfigure console-data
+dpkg-reconfigure console-setup
+dpkg-reconfigure locales \ No newline at end of file
diff --git a/client/boot-tools/clientstructure/root/generateSshKeysClient.sh b/client/boot-tools/clientstructure/root/generateSshKeysClient.sh
new file mode 100755
index 00000000..9857ad40
--- /dev/null
+++ b/client/boot-tools/clientstructure/root/generateSshKeysClient.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+echo "comprobando directorio .ssh del root"
+if [ ! -d /root/.ssh ]
+then
+ echo "creando directorio .ssh 600"
+ mkdir -p /root/.ssh
+ chmod 700 /root/.ssh
+fi
+
+
+echo "comprobando el fichero authorized_keys .ssh del root"
+if [ ! -f /root/.ssh/authorized_keys ]
+then
+ echo "creando el fichero authorized_keys"
+ touch /root/.ssh/authorized_keys
+ chmod 600 /root/.ssh/authorized_keys
+fi
+
+ssh-keygen -q -f /root/.ssh/id_rsa -N ""
+cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
+
+## TODO: exportamos la publica a los repos
+cp /root/.ssh/id_rsa.pub /tmp/rsa.ogclient.pub \ No newline at end of file
diff --git a/client/boot-tools/clientstructure/root/importSshKeys.sh b/client/boot-tools/clientstructure/root/importSshKeys.sh
new file mode 100755
index 00000000..17a797f8
--- /dev/null
+++ b/client/boot-tools/clientstructure/root/importSshKeys.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+echo "comprobando directorio .ssh del root"
+if [ ! -d /root/.ssh ]
+then
+ echo "creando directorio .ssh 600"
+ mkdir -p /root/.ssh
+ chmod 700 /root/.ssh
+fi
+echo "creando el fichero authorized_keys"
+touch /root/.ssh/authorized_keys
+chmod 600 /root/.ssh/authorized_keys
+
+echo "importando la clave publica del servidor OG"
+cat /tmp/id_rsa.pub
+
+[ -f /tmp/id_rsa.pub ] && cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys || echo "no key publica og"
+ \ No newline at end of file
diff --git a/client/boot-tools/clientstructure/root/qemu.sh b/client/boot-tools/clientstructure/root/qemu.sh
new file mode 100755
index 00000000..c5a93cd9
--- /dev/null
+++ b/client/boot-tools/clientstructure/root/qemu.sh
@@ -0,0 +1,9 @@
+#/bin/bash
+
+mount -o rw,remount /
+mount proc /proc -t proc
+export PATH=$PATH dpkg -i *.deb
+modprobe 8139too
+modprobe 8139cp
+dhclient
+/etc/init.d/ssh restart \ No newline at end of file
diff --git a/client/boot-tools/clientstructure/var/lib/locales/supported.d/local b/client/boot-tools/clientstructure/var/lib/locales/supported.d/local
new file mode 100644
index 00000000..be3f2a41
--- /dev/null
+++ b/client/boot-tools/clientstructure/var/lib/locales/supported.d/local
@@ -0,0 +1,5 @@
+es_ES ISO-8859-1
+es_ES@euro ISO-8859-15
+es_ES.UTF-8 UTF-8
+es_ES.UTF-8@euro UTF-8
+en_US.UTF-8 UTF-8 \ No newline at end of file
diff --git a/client/boot-tools/kernelParameterOG.es.txt b/client/boot-tools/kernelParameterOG.es.txt
new file mode 100644
index 00000000..4ec96c8a
--- /dev/null
+++ b/client/boot-tools/kernelParameterOG.es.txt
@@ -0,0 +1,46 @@
+
+KERNEL ogclient/ogvmlinuz
+initrd=ogclient/oginitrd.img
+
+### PARAMETROS ESTANDAR DEl KERNEL
+## indicamos al kernel que proceso a iniciar el Opengnsys
+ boot=oginit
+
+ vga=788
+irqpoll
+acpi=on
+
+ip=dhcp
+ip=
+
+### PARAMETROS ESPECIFICOS DE OG.
+ # Indicamos al cliente OG, cuando termine su proceso que incie el init (/opt/opengnsys/etc/preinit/default.sh)
+ # si no se utiliza este parametro por defecto usa init.
+ oginit=init|/bin/bash
+
+
+ #por defecto todos los servicios OG, los considera ubicados en el next-server (parámetro indicado en el servicio dhcp)
+# en el caso de que queramos que indicar que REPO (/opt/opengnsys/images) está en otro equipo utilizar este parámetro ogrepo
+ ogrepo=ip del repositorio
+
+ # fichero donde se encuentra el rootfs que usara el ogvmlinuz y el oginitrd.img
+ # hay dos formatos, el img (fichero modificable desde el OG server), o el sqfs (fichero solo lectura del img)
+ og2nd=sqfs|img
+
+ #protocolo de acceso al og2nd.
+ ogprotocol=smb|nfs
+
+ # modo de funcionalidad del browser con shell root activa.
+ ogactiveadmin=true|false
+
+ #modo de depuración en el proceso de arranque del cliente.
+ ogdebug=true|false
+
+
+#modulo especial de la tarjeta de red.
+ognetmodule
+
+
+
+
+
diff --git a/client/boot-tools/ogClientGeneratorV2.sh b/client/boot-tools/ogClientGeneratorV2.sh
new file mode 100755
index 00000000..3f816aeb
--- /dev/null
+++ b/client/boot-tools/ogClientGeneratorV2.sh
@@ -0,0 +1,161 @@
+#!/bin/bash
+#@file ogClientGenerator.sh
+#@brief Script generación del cliente OpenGnSys
+#@warning
+#@version 0.9 -
+#@author Antonio J. Doblas Viso.
+#@date 2010/05/24
+#*/
+
+
+#$1 OSCONENAME lucid karmic
+#if [ $# -ne 1 ]; then
+# echo ": invalid number of parameters"
+# echo " host | lucid | karmic | jaunty | lenny | squeeze "
+# exit 1
+#fi
+TYPECLIENT=host
+
+# Solo ejecutable por usuario root
+if [ "$(whoami)" != 'root' ]
+then
+ echo "ERROR: this program must run under root privileges!!"
+ exit 1
+fi
+
+
+
+#FIXME: variables del instalador oficial.
+WORKDIR=/tmp/opengnsys_installer
+INSTALL_TARGET=/opt/opengnsys
+LOG_FILE=/tmp/opengnsys_installation.log
+PROGRAMDIR=$(readlink -e $(dirname "$0"))
+
+
+#funciones especificas del cliente.
+source $PROGRAMDIR/ogClientManager.lib
+#funciones incluidas dentro del scritps general de instalacion.
+source $PROGRAMDIR/ogInstaller.lib
+
+echoAndLog "OpenGnSys CLIENT installation begins at $(date)"
+
+##########################################################################
+## FASE 1 - Instalación de software adicional.
+##TO DO Integrar en el instaldor. Actualizar repositorios
+# Datos para la generación del cliente.
+DEPENDENCIES=( debootstrap subversion schroot squashfs-tools)
+apt-get update
+# Instalación de dependencias (paquetes de sistema operativo).
+declare -a notinstalled
+checkDependencies DEPENDENCIES notinstalled
+if [ $? -ne 0 ]; then
+ installDependencies notinstalled
+ if [ $? -ne 0 ]; then
+ echoAndLog "Error while installing some dependeces, please verify your server installation before continue"
+ exit 1
+ fi
+fi
+############## FIN DEL TO DO
+############################################## FIN FASE 1
+
+
+
+############## FASE 2 - Asignación de variables
+#obtenemos las variables necesarias.
+ogClientVar
+#obtenemos la información del host.
+ogClientOsInfo
+######################## FIN fase 2
+
+############# FASE 3: Segundo Sistema archivos (img) Creación.
+#TODO comprobacion de que el fichero esta creado.
+file $OGCLIENTFILE | grep "partition 1: ID=0x83"
+if [ $? == 1 ]
+then
+ ##3.1 creación y formateo del disco virtual. generamos el dispositivo loop.
+ ogClient2ndFile || exit 1
+fi
+
+
+#3.2 generamos el Sistema de archivos con debootstrap
+# Comprobamos que ya tenemos alguno.
+schroot -p -c IMGogclient -- touch /tmp/ogclientOK
+if [ -f /tmp/ogclientOK ]
+then
+ rm /tmp/ogclientOK
+else
+ ogClient2ndFs $TYPECLIENT || exit
+fi
+
+
+############### FASE 4: Configuración el acceso al Segundo Sistema de archivos (img), para schroot
+cat /etc/schroot/schroot.conf | grep ogclient || ogClientSchrootConf
+
+
+############### FASE 5: Configuración del Segundo Sistema de archivos (img) con la estructura especial de OpenGnsys
+ogClient2ndSVN $TYPECLIENT || exit
+
+
+
+
+############# FASE6: Ejecutamos los scripts de personalización del 2º sistema de archivos (img) desde la jaula schroot
+### 6.1 instalacion de software con apt-get
+schroot -p -c IMGogclient -- /root/InstallSoftware.sh
+echo "saltando"
+ if [ $? -ne 0 ]; then
+ errorAndLog "Instalando sofware adicional OG : ERROR"
+ exit
+else
+ echoAndLog "Instalando sofware adicional OG: OK"
+fi
+#### 6.2 compilación de software.
+cd /
+schroot -p -c IMGogclient -- /root/CompileSoftware.sh
+cd -
+
+### 6.3 configuracion hostname passroot securety
+cd /
+schroot -c IMGogclient -- /root/ConfFS.sh
+cd -
+#schroot -c IMGogclient -- echo -ne "og1\nog1\n" | passwd root
+# schroot -c IMGogclient -- passwd root | echo "root"
+
+
+### 6.4 incorporamos la clave publica del servidor
+cd /
+ssh-keygen -q -f /root/.ssh/id_rsa -N ""
+cp /root/.ssh/id_rsa.pub /tmp
+schroot -p -c IMGogclient -- /root/importSshKeys.sh
+cd -
+############ y la del propio cliente.
+schroot -c IMGogclient -- /root/generateSshKeysClient.sh
+
+## configuramos los locales.
+schroot -c IMGogclient -- /root/ReconfigureLocales.sh
+
+
+################## FIN fase 6. Fin de comfiguración del segundo sistema de archivos (img)
+
+################## FASE 7. Generamos el 1er sistema de archivos. INITRD
+#nota el parametro es el "tipo" de linux generado en debootstrap. usar solo "host", es decir version,kernel ... del propio host
+#nota: hace un schroot, al 2fs (img), ejecuta el fichero generateinitrd.
+#nota: deja en el directorio tmp del host el nuevo initrd, y lo copia al tftpboot
+ogClientInitrd $TYPECLIENT
+
+
+################## FASE 8. convertimos el 2ºFS(img) en 2ºFS(sqfs)
+# generamos el 2sistema de archivos en squashfs
+ogClient2ndSqfs
+################## FIN FASE 8. convertimos el 2ºFS(img) en 2ºFS(sqfs)
+
+
+##################### FASE 9. algunos detallas del pxe
+#dejamos ficheros de ejemplo para el pxe y el nfs
+#ogClientConfpxe
+##################### FIN FASE 9. algunos detallas del pxe
+
+
+# Mostrar sumario de la instalación e instrucciones de post-instalación.
+installationSummary
+
+echoAndLog "OpenGnSys installation finished at $(date)"
diff --git a/client/boot-tools/ogClientManager.lib b/client/boot-tools/ogClientManager.lib
new file mode 100644
index 00000000..438ee56a
--- /dev/null
+++ b/client/boot-tools/ogClientManager.lib
@@ -0,0 +1,614 @@
+
+ogClientVar()
+{
+export SVNCLIENTDIR=/tmp/opengnsys_installer/opengnsys/client/boot-tools
+export SVNCLIENTSTRUCTURE=/tmp/opengnsys_installer/opengnsys/client/shared
+export SVNCLIENTENGINE=/tmp/opengnsys_installer/opengnsys/client/engine
+
+export OGCLIENTBASEDIR=/var/lib/tftpboot/ogclient/
+export OGCLIENTFILE=${OGCLIENTBASEDIR}ogclient.img
+export OGCLIENTMOUNT=${OGCLIENTBASEDIR}ogclientmount
+# tamaño maximo limitado por schroot 2GB
+export OGCLIENTSIZEMB=1900
+#export OGCLIENTSIZEMB=1000
+# export OGCLIENTSIZEKB=500
+export OGCLIENTLABEL=ogClient
+#export OGLIB=/opt/opengnsys/client/lib
+}
+
+
+
+function ogClientOsInfo ()
+{
+#TODO según host, un OSHHTP u otro OSARCH
+ #1 OSCODENAME jaunty|karmic|lucid
+ #devuelve OSDISTRIB(ubuntu,debian),OSCODENAME(lucid,karmic,squeeze):OGRELEASE:httpAPT
+ case $1 in
+ host | HOST)
+ export OSDISTRIB=$(lsb_release -i | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null
+ #OSCODENAME=$(lsb_release -c | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null
+ export OSCODENAME=$(cat /etc/lsb-release | grep CODENAME | awk -F= '{print $NF}')
+ export OSRELEASE=$(uname -a | awk '{print $3}')
+ uname -a | grep x86_64 > /dev/null && export OSARCH=amd64 || export OSARCH=i386
+ export OSHTTP="http://es.archive.ubuntu.com/ubuntu/"
+ ;;
+ jaunty|JAUNTY)
+ export OSDISTRIB=ubuntu
+ export OSCODENAME=jaunty
+ export OSRELEASE="2.6.28-11-generic"
+ export OSARCH=i386
+ export OSHTTP="http://es.archive.ubuntu.com/ubuntu/"
+ ;;
+ lenny|LENNY)
+ export OSDISTRIB=debian
+ export OSCODENAME=lenny
+ export OSRELEASE="2.6.28-11-generic"
+ export OSARCH=i386
+ export OSHTTP="http://es.archive.ubuntu.com/ubuntu/ "
+ ;;
+ squeeze|SQUEEZE)
+ export OSDISTRIB=debian
+ export OSCODENAME=squeeze
+ export OSRELEASE="2.6.28-11-generic"
+ export OSARCH=i386
+ export OSHTTP="http://es.archive.ubuntu.com/ubuntu/ "
+ ;;
+ karmic|KARMIC)
+ export OSDISTRIB=ubuntu
+ export OSCODENAME=karmic
+ export OSRELEASE="2.6.31-14-generic"
+ export OSARCH=i386
+ export OSHTTP="http://es.archive.ubuntu.com/ubuntu/ "
+ ;;
+ lucid|LUCID)
+ export OSDISTRIB=ubuntu
+ export OSCODENAME=lucid
+ export OSRELEASE="2.6.32-21-generic-pae"
+ export OSARCH=i386
+ export OSHTTP="http://es.archive.ubuntu.com/ubuntu/ "
+ ;;
+ *)
+ return 1
+ ;;
+ esac
+ echo $OSDISTRIB:$OSCODENAME:$OSRELEASE:$OSARCH:$OSHTTP
+}
+
+#creación y formateo del disco virtual.
+ogClient2ndFile ()
+{
+local RERROR DISKLOOP PARTLOOP #return code error
+echoAndLog "$FUNCNAME(): Creación y formateo del disco virtual $OGCLIENTSIZEMB MB "
+#Desmontamos por si acaso el dispositivo virtual
+mount | grep $OGCLIENTMOUNT && umount $OGCLIENTMOUNT
+mount | grep $OGCLIENTMOUNT && umount $OGCLIENTMOUNT
+echo "$FUNCNAME(): Creando el directorio donde se montará el disco virtual $OGCLIENTMOUNT"
+mkdir -p $OGCLIENTMOUNT
+if [ $? -ne 0 ]
+then
+ errorAndLog "$FUNCNAME(): Creando directorio $OGCLIENTMOUNT : ERROR"
+ return 1
+fi
+echo "$FUNCNAME(): Creando el disco virtual que almacenará el FS del cliente $OGCLIENTSIZEMB MB de datos físicos"
+dd if=/dev/zero of=$OGCLIENTFILE bs=1048576 count=$OGCLIENTSIZEMB
+#qemu-img create $OGCLIENTFILE 3G
+#dd if=/dev/zero of=$OGCLIENTFILE bs=1k count=$OGCLIENTSIZEKB # necesita 500MB
+if [ $? -ne 0 ]
+then
+ errorAndLog "$FUNCNAME(): Creando el disco virtual: ERROR"
+ return 1
+fi
+
+DISKLOOP=$(losetup -f)
+losetup $DISKLOOP $OGCLIENTFILE
+echo "$FUNCNAME(): particiondo el disco virtual - $DISKLOOP - con una particion primaria"
+echo -e "n\np\n1\n\n\nt\n83\nw" | fdisk $DISKLOOP
+#echo $?
+# da error, porque no puede actualizar el kernel.
+#if [ $? -ne 0 ]
+#then
+# errorAndLog "$FUNCNAME(): Particionando el disco virutal: ERROR"
+# return 1
+#fi
+
+echoAndLog "$FUNCNAME(): Desmontando $DISKLOOP despues del particionado "
+losetup -d $DISKLOOP
+
+if [ $? -ne 0 ]
+then
+ errorAndLog "$FUNCNAME(): Liberando disco virtual despues del particionado: ERROR"
+ return 1
+fi
+
+
+#mkfs.ext3 -L $OGCLIENTLABEL /dev/loop1
+#mkfs.ext3 -L $OGCLIENTLABEL /dev/loop1
+PARTLOOP=$(losetup -f)
+echo "$FUNCNAME(): Formateando la particion principal $PARTLOOP"
+losetup -o 32256 $PARTLOOP $OGCLIENTFILE && mkfs.ext3 -b 4096 -L $OGCLIENTLABEL $PARTLOOP
+if [ $? -ne 0 ]
+then
+ errorAndLog "$FUNCNAME(): Formateando la particion principal del disco virtual: ERROR"
+ return 1
+fi
+echoAndLog "$FUNCNAME(): Desmontando $PARTLOOP despues del formateo "
+losetup -d $PARTLOOP
+if [ $? -ne 0 ]
+then
+ errorAndLog "$FUNCNAME(): Liberando la particion virtual despues del formateo: ERROR"
+ return 1
+else
+ echoAndLog "$FUNCNAME(): $OGCLIENTFILE $OGCLIENTSIZEMB MB : OK"
+fi
+}
+
+
+
+
+
+ogClient2ndFs ()
+{
+ogClientOsInfo $1
+echoAndLog "$FUNCNAME: Iniciando la generación del sistema de archivos "
+#Montamos el dispositivo virtual en su punto de montaje.
+mount | grep $OGCLIENTMOUNT || mount $OGCLIENTFILE $OGCLIENTMOUNT -o loop,offset=32256
+
+mount | grep $OGCLIENTMOUNT && echoAndLog "$FUNCNAME: mount $OGCLIENTFILE $OGCLIENTMOUNT -o loop,offset=32256 OK " || errorAndLog "$FUNCNAME: mount $OGCLIENTFILE $OGCLIENTMOUNT -o loop,offset=32256 : FAILURE "
+
+#debootstrap --include=linux-image-${OSRELEASE},linux-headers-${OSRELEASE} --arch=$OSARCH --components=main,universe ${OSCODENAME} ${OGCLIENTMOUNT} ${OSHTTP}
+debootstrap --arch=$OSARCH --components=main,universe ${OSCODENAME} ${OGCLIENTMOUNT} ${OSHTTP}
+
+
+if [ $? -ne 0 ]; then
+ errorAndLog "$FUNCNAME: debootstrap --include=linux-image-${OSRELEASE},linux-headers-${OSRELEASE} --arch=$OSARCH --components=main,universe $OSCODENAME $OGCLIENTMOUNT $OSHTTP
+ : ha fallado!"
+ mount | grep $OGCLIENTMOUNT && umount $OGCLIENTMOUNT
+ return 1
+else
+ echoAndLog "$FUNCNAME: debootstrap --include=linux-image-${OSRELEASE},linux-headers-${OSRELEASE} --arch=$OSARCH --components=main,universe $OSCODENAME $OGCLIENTMOUNT $OSHTTP
+ : ok"
+ mount | grep $OGCLIENTMOUNT && umount $OGCLIENTMOUNT
+ return 0
+fi
+ sleep 5
+
+##preubas revisar OSRELEASE
+#debootstrap --include=linux-image-${OSRELEASE} --arch=i386 --variant=minbase $OSVERSION $OGCLIENTMOUNT http://es.archive.ubuntu.com/ubuntu/
+#debootstrap --variant=minbase --include=linux-image-${OGRELEASE} --arch=i386 $OGVERSION $OGCLIENTMOUNT http://es.archive.ubuntu.com/ubuntu/
+#echo debootstrap --include=linux-image-${OGRELEASE},dbus --arch=i386 --components=main,universe $OGVERSION $OGCLIENTMOUNT http://es.archive.ubuntu.com/ubuntu/
+}
+
+
+
+
+########## configura el segundo sistema de archivos
+########### parametro: "host"
+function ogClient2ndSVN()
+{
+ogClientOsInfo $1
+#1 la salida de ogClientOsInfo
+local LERROR
+LERROR=TRUE
+echoAndLog "$FUNCNAME: Iniciando la personalización con datos del SVN "
+# comprobar que está montado $OGCLIENTMOUNT
+mount | grep $OGCLIENTMOUNT || mount $OGCLIENTFILE $OGCLIENTMOUNT -o loop,offset=32256
+
+# parseamos del apt.source
+sed -e "s/OSCODENAME/$OSCODENAME/g" ${SVNCLIENTDIR}/clientstructure/etc/apt/sources.list.ubuntu > ${SVNCLIENTDIR}/clientstructure/etc/apt/sources.list
+if [ $? -ne 0 ]
+then
+ errorAndLog "$FUNCNAME(): Parsing apt.sources : ERROR"
+ return 1
+fi
+
+#parseamos el script de generación del initrd.
+sed -e "s/OSRELEASE/$OSRELEASE/g" ${SVNCLIENTDIR}/clientstructure/root/GenerateInitrd.generic.sh > ${SVNCLIENTDIR}/clientstructure/root/GenerateInitrd.sh
+if [ $? -ne 0 ]
+then
+ errorAndLog "$FUNCNAME(): Parsing GenerateInitrd.sh : ERROR"
+ return 1
+fi
+
+#damos permiso al directorio de scripts
+chmod 775 ${SVNCLIENTDIR}/clientstructure/root/*
+
+# los copiamos
+cp -prv ${SVNCLIENTDIR}/clientstructure/* $OGCLIENTMOUNT
+mkdir -p ${OGCLIENTMOUNT}/opt/opengnsys/
+cp -prv ${SVNCLIENTSTRUCTURE}/* ${OGCLIENTMOUNT}/opt/opengnsys/
+cp -prv ${SVNCLIENTENGINE}/* ${OGCLIENTMOUNT}/opt/opengnsys/lib/engine/bin/
+
+if [ $? -ne 0 ]
+then
+ errorAndLog "$FUNCNAME(): Copying client data : ERROR"
+ return 1
+fi
+
+# copiamos algunas cosas del nfsexport
+
+#### Tipos de letra para el Browser.
+cp -pr ${SVNCLIENTSTRUCTURE}/lib/fonts $OGCLIENTMOUNT/usr/local/lib/fonts
+#### Crear enlaces para compatibilidad con las distintas versiones del Browser.
+mkdir -p $OGCLIENTMOUNT/usr/local/Trolltech/QtEmbedded-4.5.1/lib/
+mkdir -p $OGCLIENTMOUNT/usr/local/QtEmbedded-4.6.2/lib/
+mkdir -p $OGCLIENTMOUNT/usr/local/QtEmbedded-4.6.3/lib/
+#ln -fs $OGCLIENTMOUNT/usr/local/lib/fonts /usr/local/Trolltech/QtEmbedded-4.5.1/lib/fonts
+#ln -fs $OGCLIENTMOUNT/usr/local/lib/fonts /usr/local/QtEmbedded-4.6.2/lib/fonts
+#ln -fs $OGCLIENTMOUNT/usr/local/lib/fonts /usr/local/QtEmbedded-4.6.3/lib/fonts
+cp -pr ${SVNCLIENTSTRUCTURE}/lib/fonts $OGCLIENTMOUNT/usr/local/Trolltech/QtEmbedded-4.5.1/lib/fonts
+cp -pr ${SVNCLIENTSTRUCTURE}/lib/fonts $OGCLIENTMOUNT/usr/local/QtEmbedded-4.6.2/lib/fonts
+cp -pr ${SVNCLIENTSTRUCTURE}/lib/fonts $OGCLIENTMOUNT/usr/local/QtEmbedded-4.6.3/lib/fonts
+
+
+
+
+if [ $? -ne 0 ]
+then
+ errorAndLog "$FUNCNAME(): Linking Browser fonts : ERROR"
+ return 1
+fi
+
+# B ########################################################
+cp -pr ${SVNCLIENTSTRUCTURE}/lib/pci.ids $OGCLIENTMOUNT/etc
+if [ $? -ne 0 ]
+then
+ errorAndLog "$FUNCNAME(): Copying pci.ids : ERROR"
+ return 1
+fi
+
+cp ${SVNCLIENTSTRUCTURE}/bin/browser $OGCLIENTMOUNT/bin
+if [ $? -ne 0 ]
+then
+ errorAndLog "$FUNCNAME(): Copying Browser : ERROR"
+ return 1
+fi
+
+cp ${SVNCLIENTSTRUCTURE}/bin/ogAdmClient $OGCLIENTMOUNT/bin
+if [ $? -ne 0 ]
+then
+ errorAndLog "$FUNCNAME(): Copying ogAdmClient : ERROR"
+ return 1
+else
+ mount | grep $OGCLIENTMOUNT && umount $OGCLIENTMOUNT
+ mount | grep $OGCLIENTMOUNT && umount $OGCLIENTMOUNT
+ mount | grep $OGCLIENTMOUNT && umount $OGCLIENTMOUNT
+ mount | grep $OGCLIENTMOUNT && umount $OGCLIENTMOUNT
+ echoAndLog "$FUNCNAME: Finalizado: OK "
+ return 0
+fi
+}
+
+
+ogClientSchrootConf()
+{
+echoAndLog "$FUNCNAME: Iniciando la configuración del schroot "
+cp /etc/schroot/schroot.conf /etc/schroot/schroot.conf.`getDateTime`
+cat << EOF > /etc/schroot/schroot.conf
+[IMGogclient]
+type=loopback
+file=/var/lib/tftpboot/ogclient/ogclient.img
+description=ogclient ubuntu luc IMGi
+priority=1
+users=root
+groups=root
+root-groups=root
+mount-options=-o offset=32256
+root-users=root
+[DIRogclient]
+type=directory
+directory=/var/lib/tftpboot/ogclient/ogclientmount
+description=ogclient ubuntu lucid DIR
+priority=2
+users=root
+groups=root
+root-groups=root
+root-users=root
+EOF
+cp /etc/schroot/mount-defaults /etc/schroot/mount-defaults.`getDateTime`
+cat << EOF > /etc/schroot/mount-defaults
+# mount.defaults: static file system information for chroots.
+# Note that the mount point will be prefixed by the chroot path
+# (CHROOT_PATH)
+#
+# <file system> <mount point> <type> <options> <dump> <pass>
+proc /proc proc defaults 0 0
+#procbususb /proc/bus/usb usbfs defaults 0 0
+#/dev /dev none rw,bind 0 0
+/dev/pts /dev/pts none rw,bind 0 0
+/dev/shm /dev/shm none rw,bind 0 0
+#/home /home none rw,bind 0 0
+/tmp /tmp none rw,bind 0 0
+EOF
+
+echoAndLog "$FUNCNAME: Finalizado: OK "
+return 0
+}
+
+
+
+########### param1 "host"
+ogClientInitrd()
+{
+ogClientVar
+cd /
+ogClientOsInfo $1
+schroot -c IMGogclient -- /root/GenerateInitrd.generic.sh
+echo "cp /tmp/*-${OSRELEASE} $OGCLIENTBASEDIR"
+cp /tmp/*-${OSRELEASE} $OGCLIENTBASEDIR
+cp /tmp/initrd.img-${OSRELEASE} ${OGCLIENTBASEDIR}/oginitrd.img
+cp /tmp/vmlinuz-${OSRELEASE} ${OGCLIENTBASEDIR}/ogvmlinuz
+cd -
+}
+
+
+ogClient2ndSqfs()
+{
+ogClientVar
+echoAndLog "$FUNCNAME: Iniciando la creación del sistema de archivos en sqfs "
+# si ya existe un sqfs lo renombramos
+[ -f $OGCLIENTBASEDIR/ogclient.sqfs ] && mv $OGCLIENTBASEDIR/ogclient.sqfs $OGCLIENTBASEDIR/ogclient.sqfs.`date +%Y%m%d-%H%M%S`
+mount | grep $OGCLIENTMOUNT || mount $OGCLIENTFILE $OGCLIENTMOUNT -o loop,offset=32256
+mksquashfs $OGCLIENTMOUNT $OGCLIENTBASEDIR/ogclient.sqfs
+chmod 744 $OGCLIENTBASEDIR/ogclient.sqfs
+mount | grep $OGCLIENTMOUNT && umount $OGCLIENTMOUNT
+}
+
+
+
+
+ogClientSshkeys()
+{
+echo comprobamos clave rsa en el host REPO OG.
+if [ ! -f /root/.ssh/id_rsa.pub ]
+then
+ echo "creando claves rsa"
+ ssh-keygen -q -f /root/.ssh/id_dsa -t dsa -N "opengnsys"
+else
+ echo "la claves ya estan creadas"
+fi
+echo "copiamos la clave publica a /tmp"
+cp /root/.ssh/id_dsa.pub /tmp
+
+cat /tmp/id_dsa.pub
+
+echo "schroot con instrucciones."
+schroot -c IMGogclient -- /root/importSshKeys.sh
+
+echo "limpiando"
+rm /tmp/id_dsa.pub
+
+## copiamos ssh rsa del host al guest como authorized-key2
+##rm ${OGCLIENTMOUNT}/root/.ssh/authorized-key2
+##cat /root/.ssh/id_rsa.pub >> ${OGCLIENTMOUNT}/root/.ssh/authorized-key2
+#cat ${OGCLIENTMOUNT}/root/.ssh/id_rsa.pub >> ${OGCLIENTMOUNT}/root/.ssh/authorized-key2
+##mount | grep $OGCLIENTMOUNT || umount $OGCLIENTMOUNT
+}
+
+
+ogClientConfpxe()
+{
+################## DEJAMOS FICHERO DE EJEMPLOS PARA:
+#default
+cat << FIN >> /var/lib/tftpboot/pxelinux.cfg/defaultNEWClient
+LABEL pxe-${OGRELEASE}
+KERNEL ogclient/vmlinuz-$OGRELEASE
+APPEND initrd=ogclient/initrd.img-$OGRELEASE ip=dhcp ro boot=og vga=788 irqpoll acpi=on reposerver=
+LABEL pxe-2.6.32-21-generic-pae
+KERNEL ogclient/vmlinuz-2.6.32-21-generic-pae
+APPEND initrd=ogclient/initrd.img-2.6.32-21-generic-pae ip=dhcp ro boot=oginit vga=788 irqpoll acpi=on ogrepo=172.17.36.11 ogprotocol=nfs og2nd=sqfs
+LABEL cache
+KERNEL grub.exe
+APPEND --config-file="find --set-root /vmlinuz; kernel /vmlinuz ip=dhcp ro boot=og vga=788 irqpoll acpi=on engine=testing reposerver=172.17.32.242; initrd /initrd.img"
+LABEL net
+KERNEL grub.exe
+APPEND keeppxe --config-file="pxe detect; kernel (pd)/ogclient/vmlinuz-2.6.32-21-generic-pae ip=dhcp ro boot=og vga=788 irqpoll acpi=on engine=testing reposerver=172.17.32.242; initrd (pd)/ogclient/initrd.img-2.6.32-21-generic-pae"
+LABEL IfNOTcacheGOnet
+KERNEL grub.exe
+APPEND keeppxe --config-file="pxe detect; default 0; timeout 0; hiddenmenu; title cache; fallback 1; find --set-root /vmlinuz; kernel /vmlinuz ip=dhcp ro boot=og vga=788 irqpoll acpi=on engine=testing reposerver=172.17.32.242; initrd /initrd.img; boot; title net; kernel (pd)/ogclient/vmlinuz-2.6.32-21-generic-pae ip=dhcp ro boot=og vga=788 irqpoll acpi=on engine=testing reposerver=172.17.32.242; initrd (pd)/ogclient/initrd.img-2.6.32-21-generic-pae; boot"
+#LABEL pxe-2.6.32-21-generic-pae
+#KERNEL ogclient/vmlinuz-2.6.32-21-generic-pae
+#APPEND initrd=ogclient/initrd.img-2.6.32-21-generic-pae ip=dhcp ro boot=og vga=788 irqpoll acpi=on reposerver=172.17.32.242
+#LABEL grub
+#KERNEL grub.exe
+#APPEND keeppxe
+FIN
+#/etc/hosts
+echo "/var/lib/tftpboot *(ro,no_subtree_check,no_root_squash,sync)" > /etc/exportsNEWClient
+/etc/init.d/nfs-kernel-server restart
+#####################################################################
+}
+
+
+
+############### No usados en el instalador, solo en actualizaciones.
+#/**
+# ogClientMount [str_program]
+#@brief Acceso al 2nd FS del cliente desde el Servidor Opengnsys
+#@param 1 Opciona: scripts o programa a ejecutar para automatizaciones
+#@return Si no hay parametros: login de acceso.
+#@return con un parametro: La salida del programa ejecutado
+#@exception
+#@note
+#@todo
+#@version 0.9 - Primera versión para OpenGnSys
+#@author Antonio J. Doblas Viso, Universidad de Málaga
+#@date 2010/02/15
+#*/ ##
+function ogClientMount ()
+{
+ #TODO comprobar que OGFILE y OGFILEMOUNT existe.
+ mount | grep $OGCLIENTFILE > /dev/null || mount $OGCLIENTFILE $OGCLIENTMOUNT -o loop,offset=32256
+ mount | grep $OGCLIENTMOUNT/proc > /dev/null || mount --bind /proc $OGCLIENTMOUNT/proc
+ mount | grep $OGCLIENTMOUNT/sys > /dev/null || mount --bind /sys $OGCLIENTMOUNT/sys
+ mount | grep $OGCLIENTMOUNT/tmp > /dev/null || mount --bind /tmp $OGCLIENTMOUNT/tmp
+ mount | grep $OGCLIENTMOUNT/dev > /dev/null || mount --bind /dev $OGCLIENTMOUNT/dev
+ mount | grep $OGCLIENTMOUNT/dev/pts > /dev/null || mount --bind /dev/pts $OGCLIENTMOUNT/dev/pts
+
+
+ [ $# = 0 ] && $(chroot $OGCLIENTMOUNT /sbin/getty 38400 `tty`)
+ [ $# = 1 ] && chroot $OGCLIENTMOUNT $1
+
+}
+
+#/**
+# ogClientUnmount
+#@brief Desmonta el 2nd FS del cliente desde el Servidor Opengnsys
+#@param
+#@return
+#@exception
+#@note
+#@todo
+#@version 0.9 - Primera versión para OpenGnSys
+#@author Antonio J. Doblas Viso, Universidad de Málaga
+#@date 2010/02/15
+#*/ ##
+
+function ogClientUnmount ()
+{
+ cd /tmp
+ echo "desmontando cliente espere"
+ sleep 5
+ mount | grep $OGCLIENTMOUNT/dev > /dev/null && umount $OGCLIENTMOUNT/dev || ogClientUnmount
+ mount | grep $OGCLIENTMOUNT/dev/pts > /dev/null && umount $OGCLIENTMOUNT/dev/pts || ogClientUnmount
+ mount | grep $OGCLIENTMOUNT/proc > /dev/null && umount $OGCLIENTMOUNT/proc || ogClientUnmount
+ mount | grep $OGCLIENTMOUNT/sys > /dev/null && umount $OGCLIENTMOUNT/sys || ogClientUnmount
+ mount | grep $OGCLIENTMOUNT/tmp > /dev/null && umount $OGCLIENTMOUNT/tmp || ogClientUnmount
+ mount | grep $OGCLIENTMOUNT > /dev/null && umount $OGCLIENTMOUNT || ogClientUnmount
+ #-d -f -l
+
+}
+
+
+############################ hasta el final del archivo antiguos
+############################# ANTIGUOS
+function ogClientGetRelease ()
+{
+ #1 OSCODENAME jaunty|karmic|lucid
+ case $1 in
+ jaunty|JAUNTY)
+ OSCODENAME=jaunty
+ OGRELEASE="2.6.28-11-generic"
+ echo $OGRELEASE
+ ;;
+ lenny|LENNY)
+ OSCODENAME=lenny
+ OGRELEASE="2.6.28-11-generic"
+ echo $OGRELEASE
+ ;;
+ squeeze|SQUEEZE)
+ OSCODENAME=squeeze
+ OGRELEASE="2.6.28-11-generic"
+ echo $OGRELEASE
+ ;;
+ karmic|KARMIC)
+ OSCODENAME=karmic
+ OGRELEASE="2.6.31-14-generic"
+ echo $OGRELEASE
+ ;;
+ lucid|LUCID)
+ OSCODENAME=lucid
+ OGRELEASE="2.6.32-21-generic-pae"
+ echo $OGRELEASE
+ ;;
+ *)
+ return 1
+ ;;
+ esac
+
+}
+
+
+#/**
+# ogClientGenerator str_versionUbuntu str_release
+#@brief Crea el 2nd FS del cliente desde el Servidor Opengnsys
+#@param 1 Versión de ubuntu a generar, jaunty karmic
+#@return
+#@exception
+#@note
+#@todo
+#@version 0.9 - Primera versión para OpenGnSys
+#@author Antonio J. Doblas Viso, Universidad de Málaga
+#@date 2010/02/15
+#*/ ##
+
+function ogClientGeneratorDebootstrap ()
+{
+ if [ $# != 2 ]
+ then
+ echo Debes introducir como argumento1: jaunty karmic lucid
+ echo Debes introducir como argumento2: la release
+ echo utiliza como entrada ogClientCheckVersion
+ return
+ fi
+ OSCODENAME=$1
+ OGRELEASE=$2
+
+ # instalamos el ultimo debotstrap para permitir instalar versiones superiores a nuestro sistema
+ #apt-get install gdebi-core
+ #wget $LASTDEBOOTSTRAP
+ #gdebi -n debootstrap_1.0.20_all.deb
+
+ #Desmontamos por si acaso el dispositivo virtual
+ mount | grep $OGCLIENTMOUNT && umount $OGCLIENTMOUNT
+
+ #Creamos el directorio donde montaremos el disco virtual
+ mkdir -p $OGCLIENTMOUNT
+
+ #Creamos el disco virtual con el filesystem del cliente.
+ dd if=/dev/zero of=$OGCLIENTFILE bs=1048576 count=$OGCLIENTSIZEMB
+ #qemu-img create $OGCLIENTFILE 3G
+ #dd if=/dev/zero of=$OGCLIENTFILE bs=1k count=$OGCLIENTSIZEKB # necesita 500MB
+
+
+ #particionamos el disco virtual
+ losetup /dev/loop0 $OGCLIENTFILE
+ echo -e "n\np\n1\n\n\nt\n83\nw" | fdisk /dev/loop0
+ losetup -d /dev/loop0
+
+
+ #formateamos la particion principal.
+ losetup -o 32256 /dev/loop1 $OGCLIENTFILE
+ mkfs.ext3 -b 4096 -L $OGCLIENTLABEL /dev/loop1
+ #mkfs.ext3 -L $OGCLIENTLABEL /dev/loop1
+ #mkfs.ext3 -L $OGCLIENTLABEL /dev/loop1
+ losetup -d /dev/loop1
+
+ #Montamos el dispositivo virtual en su punto de montaje.
+ mount | grep $OGCLIENTMOUNT || mount $OGCLIENTFILE $OGCLIENTMOUNT -o loop,offset=32256
+
+ #TODO Comprobar arquitectura
+ #Iniciamos la creación del sistema en el directorio de clientes.
+ #echo debootstrap --include=linux-image-${OGRELEASE},dbus --arch=i386 --components=main,universe $OGVERSION $OGCLIENTMOUNT http://es.archive.ubuntu.com/ubuntu/
+ debootstrap --include=linux-image-${OGRELEASE},linux-headers-${OGRELEASE} --arch=i386 --components=main,universe $OSCODENAME $OGCLIENTMOUNT http://es.archive.ubuntu.com/ubuntu/
+ ##preubas
+ #debootstrap --include=linux-image-${OGRELEASE} --arch=i386 --variant=minbase $OGVERSION $OGCLIENTMOUNT http://es.archive.ubuntu.com/ubuntu/
+ #debootstrap --variant=minbase --include=linux-image-${OGRELEASE} --arch=i386 $OGVERSION $OGCLIENTMOUNT http://es.archive.ubuntu.com/ubuntu/
+
+ if [ $? -ne 0 ]; then
+ errorAndLog "ogClientGeneratorDebootstrap(): ha fallado!"
+ return 1
+ else
+ echoAndLog "ogClientGeneratorDebootstrap(): ok"
+ return 0
+ fi
+ sleep 5
+
+mount | grep $OGCLIENTMOUNT && umount $OGCLIENTFILE
+
+cat << EOF > /etc/schroot/schroot.conf
+[DIRogclient]
+type=directory
+directory=/var/lib/tftpboot/ogclient/ogclientmount
+description=ogclient ubuntu lucid DIR
+priority=2
+users=root
+groups=root
+root-groups=root
+root-users=root
+EOF
+}
+
+
+
+
+
diff --git a/client/boot-tools/ogInstaller.lib b/client/boot-tools/ogInstaller.lib
new file mode 100644
index 00000000..af0f18df
--- /dev/null
+++ b/client/boot-tools/ogInstaller.lib
@@ -0,0 +1,958 @@
+#!/bin/bash
+
+
+#####################################################################
+####### Algunas funciones útiles de propósito general:
+#####################################################################
+function getDateTime()
+{
+ echo `date +%Y%m%d-%H%M%S`
+}
+
+# Escribe a fichero y muestra por pantalla
+function echoAndLog()
+{
+ echo $1
+ FECHAHORA=`getDateTime`
+ echo "$FECHAHORA;$SSH_CLIENT;$1" >> $LOG_FILE
+}
+
+function errorAndLog()
+{
+ echo "ERROR: $1"
+ FECHAHORA=`getDateTime`
+ echo "$FECHAHORA;$SSH_CLIENT;ERROR: $1" >> $LOG_FILE
+}
+
+# comprueba si el elemento pasado en $2 esta en el array $1
+function isInArray()
+{
+ if [ $# -ne 2 ]; then
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
+ exit 1
+ fi
+
+ echoAndLog "${FUNCNAME}(): checking if $2 is in $1"
+ local deps
+ eval "deps=( \"\${$1[@]}\" )"
+ elemento=$2
+
+ local is_in_array=1
+ # copia local del array del parametro 1
+ for (( i = 0 ; i < ${#deps[@]} ; i++ ))
+ do
+ if [ "${deps[$i]}" = "${elemento}" ]; then
+ echoAndLog "isInArray(): $elemento found in array"
+ is_in_array=0
+ fi
+ done
+
+ if [ $is_in_array -ne 0 ]; then
+ echoAndLog "${FUNCNAME}(): $elemento NOT found in array"
+ fi
+
+ return $is_in_array
+
+}
+
+#####################################################################
+####### Funciones de manejo de paquetes Debian
+#####################################################################
+
+function checkPackage()
+{
+ package=$1
+ if [ -z $package ]; then
+ errorAndLog "checkPackage(): parameter required"
+ exit 1
+ fi
+ echoAndLog "checkPackage(): checking if package $package exists"
+ dpkg -s $package | grep Status | grep -qw install &>/dev/null
+ if [ $? -eq 0 ]; then
+ echoAndLog "checkPackage(): package $package exists"
+ return 0
+ else
+ echoAndLog "checkPackage(): package $package doesn't exists"
+ return 1
+ fi
+}
+
+# recibe array con dependencias
+# por referencia deja un array con las dependencias no resueltas
+# devuelve 1 si hay alguna dependencia no resuelta
+function checkDependencies()
+{
+ if [ $# -ne 2 ]; then
+ errorAndLog "checkDependencies(): invalid number of parameters"
+ exit 1
+ fi
+
+ echoAndLog "checkDependencies(): checking dependences"
+ uncompletedeps=0
+
+ # copia local del array del parametro 1
+ local deps
+ eval "deps=( \"\${$1[@]}\" )"
+
+ declare -a local_notinstalled
+
+ for (( i = 0 ; i < ${#deps[@]} ; i++ ))
+ do
+ checkPackage ${deps[$i]}
+ if [ $? -ne 0 ]; then
+ local_notinstalled[$uncompletedeps]=$package
+ let uncompletedeps=uncompletedeps+1
+ fi
+ done
+
+ # relleno el array especificado en $2 por referencia
+ for (( i = 0 ; i < ${#local_notinstalled[@]} ; i++ ))
+ do
+ eval "${2}[$i]=${local_notinstalled[$i]}"
+ done
+
+ # retorna el numero de paquetes no resueltos
+ echoAndLog "checkDependencies(): dependencies uncompleted: $uncompletedeps"
+ return $uncompletedeps
+}
+
+# Recibe un array con las dependencias y lo instala
+function installDependencies()
+{
+ if [ $# -ne 1 ]; then
+ errorAndLog "installDependencies(): invalid number of parameters"
+ exit 1
+ fi
+ echoAndLog "installDependencies(): installing uncompleted dependencies"
+
+ # copia local del array del parametro 1
+ local deps
+ eval "deps=( \"\${$1[@]}\" )"
+
+ local string_deps=""
+ for (( i = 0 ; i < ${#deps[@]} ; i++ ))
+ do
+ string_deps="$string_deps ${deps[$i]}"
+ done
+
+ if [ -z "${string_deps}" ]; then
+ errorAndLog "installDependencies(): array of dependeces is empty"
+ exit 1
+ fi
+
+ OLD_DEBIAN_FRONTEND=$DEBIAN_FRONTEND
+ export DEBIAN_FRONTEND=noninteractive
+
+ echoAndLog "installDependencies(): now ${string_deps} will be installed"
+ apt-get -y install --force-yes ${string_deps}
+ if [ $? -ne 0 ]; then
+ errorAndLog "installDependencies(): error installing dependencies"
+ return 1
+ fi
+
+ DEBIAN_FRONTEND=$OLD_DEBIAN_FRONTEND
+ echoAndLog "installDependencies(): dependencies installed"
+}
+
+# Hace un backup del fichero pasado por parámetro
+# deja un -last y uno para el día
+function backupFile()
+{
+ if [ $# -ne 1 ]; then
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
+ exit 1
+ fi
+
+ local fichero=$1
+ local fecha=`date +%Y%m%d`
+
+ if [ ! -f $fichero ]; then
+ errorAndLog "${FUNCNAME}(): file $fichero doesn't exists"
+ return 1
+ fi
+
+ echoAndLog "${FUNCNAME}(): realizando backup de $fichero"
+
+ # realiza una copia de la última configuración como last
+ cp -p $fichero "${fichero}-LAST"
+
+ # si para el día no hay backup lo hace, sino no
+ if [ ! -f "${fichero}-${fecha}" ]; then
+ cp -p $fichero "${fichero}-${fecha}"
+ fi
+
+ echoAndLog "${FUNCNAME}(): backup realizado"
+}
+
+#####################################################################
+####### Funciones para el manejo de bases de datos
+#####################################################################
+
+# This function set password to root
+function mysqlSetRootPassword()
+{
+ if [ $# -ne 1 ]; then
+ errorAndLog "mysqlSetRootPassword(): invalid number of parameters"
+ exit 1
+ fi
+
+ local root_mysql=$1
+ echoAndLog "mysqlSetRootPassword(): setting root password in MySQL server"
+ /usr/bin/mysqladmin -u root password ${root_mysql}
+ if [ $? -ne 0 ]; then
+ errorAndLog "mysqlSetRootPassword(): error while setting root password in MySQL server"
+ return 1
+ fi
+ echoAndLog "mysqlSetRootPassword(): root password saved!"
+ return 0
+}
+
+# Si el servicio mysql esta ya instalado cambia la variable de la clave del root por la ya existente
+function mysqlGetRootPassword(){
+ local pass_mysql
+ local pass_mysql2
+ # Comprobar si MySQL está instalado con la clave de root por defecto.
+ if mysql -u root -p"$MYSQL_ROOT_PASSWORD" <<<"quit" 2>/dev/null; then
+ echoAndLog "${FUNCNAME}(): Using default mysql root password."
+ else
+ stty -echo
+ echo "Existe un servicio mysql ya instalado"
+ read -p "Insertar clave de root de Mysql: " pass_mysql
+ echo ""
+ read -p "Confirmar clave:" pass_mysql2
+ echo ""
+ stty echo
+ if [ "$pass_mysql" == "$pass_mysql2" ] ;then
+ MYSQL_ROOT_PASSWORD=$pass_mysql
+ echo "La clave es: ${MYSQL_ROOT_PASSWORD}"
+ return 0
+ else
+ echo "Las claves no coinciden no se configura la clave del servidor de base de datos."
+ echo "las operaciones con la base de datos daran error"
+ return 1
+ fi
+ fi
+}
+
+# comprueba si puede conectar con mysql con el usuario root
+function mysqlTestConnection()
+{
+ if [ $# -ne 1 ]; then
+ errorAndLog "mysqlTestConnection(): invalid number of parameters"
+ exit 1
+ fi
+
+ local root_password="${1}"
+ echoAndLog "mysqlTestConnection(): checking connection to mysql..."
+ echo "" | mysql -uroot -p"${root_password}"
+ if [ $? -ne 0 ]; then
+ errorAndLog "mysqlTestConnection(): connection to mysql failed, check root password and if daemon is running!"
+ return 1
+ else
+ echoAndLog "mysqlTestConnection(): connection success"
+ return 0
+ fi
+}
+
+# comprueba si la base de datos existe
+function mysqlDbExists()
+{
+ if [ $# -ne 2 ]; then
+ errorAndLog "mysqlDbExists(): invalid number of parameters"
+ exit 1
+ fi
+
+ local root_password="${1}"
+ local database=$2
+ echoAndLog "mysqlDbExists(): checking if $database exists..."
+ echo "show databases" | mysql -uroot -p"${root_password}" | grep "^${database}$"
+ if [ $? -ne 0 ]; then
+ echoAndLog "mysqlDbExists():database $database doesn't exists"
+ return 1
+ else
+ echoAndLog "mysqlDbExists():database $database exists"
+ return 0
+ fi
+}
+
+function mysqlCheckDbIsEmpty()
+{
+ if [ $# -ne 2 ]; then
+ errorAndLog "mysqlCheckDbIsEmpty(): invalid number of parameters"
+ exit 1
+ fi
+
+ local root_password="${1}"
+ local database=$2
+ echoAndLog "mysqlCheckDbIsEmpty(): checking if $database is empty..."
+ num_tablas=`echo "show tables" | mysql -uroot -p"${root_password}" "${database}" | wc -l`
+ if [ $? -ne 0 ]; then
+ errorAndLog "mysqlCheckDbIsEmpty(): error executing query, check database and root password"
+ exit 1
+ fi
+
+ if [ $num_tablas -eq 0 ]; then
+ echoAndLog "mysqlCheckDbIsEmpty():database $database is empty"
+ return 0
+ else
+ echoAndLog "mysqlCheckDbIsEmpty():database $database has tables"
+ return 1
+ fi
+
+}
+
+
+function mysqlImportSqlFileToDb()
+{
+ if [ $# -ne 3 ]; then
+ errorAndLog "${FNCNAME}(): invalid number of parameters"
+ exit 1
+ fi
+
+ local root_password="${1}"
+ local database=$2
+ local sqlfile=$3
+
+ if [ ! -f $sqlfile ]; then
+ errorAndLog "${FUNCNAME}(): Unable to locate $sqlfile!!"
+ return 1
+ fi
+
+ echoAndLog "${FUNCNAME}(): importing sql file to ${database}..."
+ perl -pi -e "s/SERVERIP/$SERVERIP/g; s/DEFAULTUSER/$OPENGNSYS_DB_DEFAULTUSER/g; s/DEFAULTPASSWD/$OPENGNSYS_DB_DEFAULTPASSWD/g" $sqlfile
+ mysql -uroot -p"${root_password}" --default-character-set=utf8 "${database}" < $sqlfile
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while importing $sqlfile in database $database"
+ return 1
+ fi
+ echoAndLog "${FUNCNAME}(): file imported to database $database"
+ return 0
+}
+
+# Crea la base de datos
+function mysqlCreateDb()
+{
+ if [ $# -ne 2 ]; then
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
+ exit 1
+ fi
+
+ local root_password="${1}"
+ local database=$2
+
+ echoAndLog "${FUNCNAME}(): creating database..."
+ mysqladmin -u root --password="${root_password}" create $database
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while creating database $database"
+ return 1
+ fi
+ echoAndLog "${FUNCNAME}(): database $database created"
+ return 0
+}
+
+
+function mysqlCheckUserExists()
+{
+ if [ $# -ne 2 ]; then
+ errorAndLog "mysqlCheckUserExists(): invalid number of parameters"
+ exit 1
+ fi
+
+ local root_password="${1}"
+ local userdb=$2
+
+ echoAndLog "mysqlCheckUserExists(): checking if $userdb exists..."
+ echo "select user from user where user='${userdb}'\\G" |mysql -uroot -p"${root_password}" mysql | grep user
+ if [ $? -ne 0 ]; then
+ echoAndLog "mysqlCheckUserExists(): user doesn't exists"
+ return 1
+ else
+ echoAndLog "mysqlCheckUserExists(): user already exists"
+ return 0
+ fi
+
+}
+
+# Crea un usuario administrativo para la base de datos
+function mysqlCreateAdminUserToDb()
+{
+ if [ $# -ne 4 ]; then
+ errorAndLog "mysqlCreateAdminUserToDb(): invalid number of parameters"
+ exit 1
+ fi
+
+ local root_password=$1
+ local database=$2
+ local userdb=$3
+ local passdb=$4
+
+ echoAndLog "mysqlCreateAdminUserToDb(): creating admin user ${userdb} to database ${database}"
+
+ cat > $WORKDIR/create_${database}.sql <<EOF
+GRANT USAGE ON *.* TO '${userdb}'@'localhost' IDENTIFIED BY '${passdb}' ;
+GRANT ALL PRIVILEGES ON ${database}.* TO '${userdb}'@'localhost' WITH GRANT OPTION ;
+FLUSH PRIVILEGES ;
+EOF
+ mysql -u root --password=${root_password} < $WORKDIR/create_${database}.sql
+ if [ $? -ne 0 ]; then
+ errorAndLog "mysqlCreateAdminUserToDb(): error while creating user in mysql"
+ rm -f $WORKDIR/create_${database}.sql
+ return 1
+ else
+ echoAndLog "mysqlCreateAdminUserToDb(): user created ok"
+ rm -f $WORKDIR/create_${database}.sql
+ return 0
+ fi
+}
+
+
+#####################################################################
+####### Funciones para el manejo de Subversion
+#####################################################################
+
+function svnExportCode()
+{
+ if [ $# -ne 1 ]; then
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
+ exit 1
+ fi
+
+ local url=$1
+
+ echoAndLog "${FUNCNAME}(): downloading subversion code..."
+
+ svn export "${url}" opengnsys
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error getting code from ${url}, verify your user and password"
+ return 1
+ fi
+ echoAndLog "${FUNCNAME}(): subversion code downloaded"
+ return 0
+}
+
+
+############################################################
+### Detectar red
+############################################################
+
+function getNetworkSettings()
+{
+ # Variables globales definidas:
+ # - SERVERIP: IP local del servidor.
+ # - NETIP: IP de la red.
+ # - NETMASK: máscara de red.
+ # - NETBROAD: IP de difusión de la red.
+ # - ROUTERIP: IP del router.
+ # - DNSIP: IP del servidor DNS.
+
+ local MAINDEV
+
+ echoAndLog "${FUNCNAME}(): Detecting default network parameters."
+ MAINDEV=$(ip -o link show up | awk '!/loopback/ {d=d$2} END {sub(/:.*/,"",d); print d}')
+ if [ -z "$MAINDEV" ]; then
+ errorAndLog "${FUNCNAME}(): Network device not detected."
+ exit 1
+ fi
+ SERVERIP=$(ip -o addr show dev $MAINDEV | awk '$3~/inet$/ {sub (/\/.*/, ""); print ($4)}')
+ NETMASK=$(LANG=C ifconfig $MAINDEV | awk '/Mask/ {sub(/.*:/,"",$4); print $4}')
+ NETBROAD=$(ip -o addr show dev $MAINDEV | awk '$3~/inet$/ {print ($6)}')
+ NETIP=$(netstat -nr | grep $MAINDEV | awk '$1!~/0\.0\.0\.0/ {if (n=="") n=$1} END {print n}')
+ ROUTERIP=$(netstat -nr | awk '$1~/0\.0\.0\.0/ {print $2}')
+ DNSIP=$(awk '/nameserver/ {print $2}' /etc/resolv.conf | head -n1)
+ if [ -z "$NETIP" -o -z "$NETMASK" ]; then
+ errorAndLog "${FUNCNAME}(): Network not detected."
+ exit 1
+ fi
+
+ # Variables de ejecución de Apache
+ # - APACHE_RUN_USER
+ # - APACHE_RUN_GROUP
+ if [ -f /etc/apache2/envvars ]; then
+ source /etc/apache2/envvars
+ fi
+ APACHE_RUN_USER=${APACHE_RUN_USER:-"www-data"}
+ APACHE_RUN_GROUP=${APACHE_RUN_GROUP:-"www-data"}
+}
+
+
+############################################################
+### Esqueleto para el Servicio pxe y contenedor tftpboot ###
+############################################################
+
+function tftpConfigure() {
+ echo "Configurando el servicio tftp"
+ basetftp=/var/lib/tftpboot
+
+ # reiniciamos demonio internet ????? porque ????
+ /etc/init.d/openbsd-inetd start
+
+ # preparacion contenedor tftpboot
+ cp -pr /usr/lib/syslinux/ ${basetftp}/syslinux
+ cp /usr/lib/syslinux/pxelinux.0 ${basetftp}
+ # prepamos el directorio de la configuracion de pxe
+ mkdir -p ${basetftp}/pxelinux.cfg
+ cat > ${basetftp}/pxelinux.cfg/default <<EOF
+DEFAULT pxe
+
+LABEL pxe
+KERNEL linux
+APPEND initrd=initrd.gz ip=dhcp ro vga=788 irqpoll acpi=on
+EOF
+ # comprobamos el servicio tftp
+ sleep 1
+ testPxe
+ ## damos perfimos de lectura a usuario web.
+ chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP ${basetftp}
+}
+
+function testPxe () {
+ cd /tmp
+ echo "comprobando servicio pxe ..... Espere"
+ tftp -v localhost -c get pxelinux.0 /tmp/pxelinux.0 && echo "servidor tftp OK" || echo "servidor tftp KO"
+ cd /
+}
+
+########################################################################
+## Configuracion servicio NFS
+########################################################################
+
+# ADVERTENCIA: usa variables globales NETIP y NETMASK!
+function nfsConfigure()
+{
+ echoAndLog "${FUNCNAME}(): Config nfs server."
+
+ backupFile /etc/exports
+
+ nfsAddExport /opt/opengnsys/client ${NETIP}/${NETMASK}:ro,no_subtree_check,no_root_squash,sync
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while adding nfs client config"
+ return 1
+ fi
+
+ nfsAddExport /opt/opengnsys/images ${NETIP}/${NETMASK}:rw,no_subtree_check,no_root_squash,sync,crossmnt
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while adding nfs images config"
+ return 1
+ fi
+
+ nfsAddExport /opt/opengnsys/log/clients ${NETIP}/${NETMASK}:rw,no_subtree_check,no_root_squash,sync
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while adding logging client config"
+ return 1
+ fi
+
+ /etc/init.d/nfs-kernel-server restart
+
+ exportfs -va
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while configure exports"
+ return 1
+ fi
+
+ echoAndLog "${FUNCNAME}(): Added NFS configuration to file \"/etc/exports\"."
+ return 0
+}
+
+
+# ejemplos:
+#nfsAddExport /opt/opengnsys 192.168.0.0/255.255.255.0:ro,no_subtree_check,no_root_squash,sync
+#nfsAddExport /opt/opengnsys 192.168.0.0/255.255.255.0
+#nfsAddExport /opt/opengnsys 80.20.2.1:ro 192.123.32.2:rw
+function nfsAddExport()
+{
+ if [ $# -lt 2 ]; then
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
+ exit 1
+ fi
+
+ if [ ! -f /etc/exports ]; then
+ errorAndLog "${FUNCNAME}(): /etc/exports don't exists"
+ return 1
+ fi
+
+ local export="${1}"
+ local contador=0
+ local cadenaexport
+
+ grep "^${export}" /etc/exports > /dev/null
+ if [ $? -eq 0 ]; then
+ echoAndLog "${FUNCNAME}(): $export exists in /etc/exports, omiting"
+ return 0
+ fi
+
+ cadenaexport="${export}"
+ for parametro in $*
+ do
+ if [ $contador -gt 0 ]
+ then
+ host=`echo $parametro | awk -F: '{print $1}'`
+ options=`echo $parametro | awk -F: '{print $2}'`
+ if [ "${host}" == "" ]; then
+ errorAndLog "${FUNCNAME}(): host can't be empty"
+ return 1
+ fi
+ cadenaexport="${cadenaexport}\t${host}"
+
+ if [ "${options}" != "" ]; then
+ cadenaexport="${cadenaexport}(${options})"
+ fi
+ fi
+ let contador=contador+1
+ done
+
+ echo -en "$cadenaexport\n" >> /etc/exports
+
+ echoAndLog "${FUNCNAME}(): add $export to /etc/exports"
+
+ return 0
+}
+
+########################################################################
+## Configuracion servicio DHCP
+########################################################################
+
+function dhcpConfigure()
+{
+ echoAndLog "${FUNCNAME}(): Sample DHCP Configuration."
+
+ backupFile /etc/dhcp3/dhcpd.conf
+
+ sed -e "s/SERVERIP/$SERVERIP/g" \
+ -e "s/NETIP/$NETIP/g" \
+ -e "s/NETMASK/$NETMASK/g" \
+ -e "s/NETBROAD/$NETBROAD/g" \
+ -e "s/ROUTERIP/$ROUTERIP/g" \
+ -e "s/DNSIP/$DNSIP/g" \
+ $WORKDIR/opengnsys/server/DHCP/dhcpd.conf > /etc/dhcp3/dhcpd.conf
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while configuring dhcp server"
+ return 1
+ fi
+
+ /etc/init.d/dhcp3-server restart
+ echoAndLog "${FUNCNAME}(): Sample DHCP Configured in file \"/etc/dhcp3/dhcpd.conf\"."
+ return 0
+}
+
+
+#####################################################################
+####### Funciones específicas de la instalación de Opengnsys
+#####################################################################
+
+# Copiar ficheros del OpenGnSys Web Console.
+function installWebFiles()
+{
+ echoAndLog "${FUNCNAME}(): Installing web files..."
+ cp -ar $WORKDIR/opengnsys/admin/WebConsole/* $INSTALL_TARGET/www #*/ comentario para doxigen
+ if [ $? != 0 ]; then
+ errorAndLog "${FUNCNAME}(): Error copying web files."
+ exit 1
+ fi
+ find $INSTALL_TARGET/www -name .svn -type d -exec rm -fr {} \; 2>/dev/null
+ # Cambiar permisos para ficheros especiales.
+ chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP \
+ $INSTALL_TARGET/www/includes \
+ $INSTALL_TARGET/www/comandos/gestores/filescripts \
+ $INSTALL_TARGET/www/images/iconos
+ echoAndLog "${FUNCNAME}(): Web files installed successfully."
+}
+
+# Configuración específica de Apache.
+function openGnsysInstallWebConsoleApacheConf()
+{
+ if [ $# -ne 2 ]; then
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
+ exit 1
+ fi
+
+ local path_opengnsys_base=$1
+ local path_apache2_confd=$2
+ local path_web_console=${path_opengnsys_base}/www
+
+ if [ ! -d $path_apache2_confd ]; then
+ errorAndLog "${FUNCNAME}(): path to apache2 conf.d can not found, verify your server installation"
+ return 1
+ fi
+
+ mkdir -p $path_apache2_confd/{sites-available,sites-enabled}
+
+ echoAndLog "${FUNCNAME}(): creating apache2 config file.."
+
+
+ # genera configuración
+ cat > $path_opengnsys_base/etc/apache.conf <<EOF
+# OpenGnSys Web Console configuration for Apache
+
+Alias /opengnsys ${path_web_console}
+
+<Directory ${path_web_console}>
+ Options -Indexes FollowSymLinks
+ DirectoryIndex acceso.php
+</Directory>
+EOF
+
+ ln -fs $path_opengnsys_base/etc/apache.conf $path_apache2_confd/sites-available/opengnsys.conf
+ ln -fs $path_apache2_confd/sites-available/opengnsys.conf $path_apache2_confd/sites-enabled/opengnsys.conf
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): config file can't be linked to apache conf, verify your server installation"
+ return 1
+ else
+ echoAndLog "${FUNCNAME}(): config file created and linked, restarting apache daemon"
+ /etc/init.d/apache2 restart
+ return 0
+ fi
+}
+
+# Crear documentación Doxygen para la consola web.
+function makeDoxygenFiles()
+{
+ echoAndLog "${FUNCNAME}(): Making Doxygen web files..."
+ $WORKDIR/opengnsys/installer/ogGenerateDoc.sh \
+ $WORKDIR/opengnsys/client/engine $INSTALL_TARGET/www
+ if [ ! -d "$INSTALL_TARGET/www/html" ]; then
+ errorAndLog "${FUNCNAME}(): unable to create Doxygen web files."
+ return 1
+ fi
+ mv "$INSTALL_TARGET/www/html" "$INSTALL_TARGET/www/api"
+ chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/www/api
+ echoAndLog "${FUNCNAME}(): Doxygen web files created successfully."
+}
+
+
+# Crea la estructura base de la instalación de opengnsys
+function openGnsysInstallCreateDirs()
+{
+ if [ $# -ne 1 ]; then
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
+ exit 1
+ fi
+
+ local path_opengnsys_base=$1
+
+ echoAndLog "${FUNCNAME}(): creating directory paths in $path_opengnsys_base"
+
+ mkdir -p $path_opengnsys_base
+ mkdir -p $path_opengnsys_base/admin/{autoexec,comandos,menus,usuarios}
+ mkdir -p $path_opengnsys_base/bin
+ mkdir -p $path_opengnsys_base/client
+ mkdir -p $path_opengnsys_base/doc
+ mkdir -p $path_opengnsys_base/etc
+ mkdir -p $path_opengnsys_base/lib
+ mkdir -p $path_opengnsys_base/log/clients
+ mkdir -p $path_opengnsys_base/sbin
+ mkdir -p $path_opengnsys_base/www
+ mkdir -p $path_opengnsys_base/images
+ ln -fs /var/lib/tftpboot $path_opengnsys_base
+ ln -fs $path_opengnsys_base/log /var/log/opengnsys
+
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while creating dirs. Do you have write permissions?"
+ return 1
+ fi
+
+ echoAndLog "${FUNCNAME}(): directory paths created"
+ return 0
+}
+
+# Copia ficheros de configuración y ejecutables genéricos del servidor.
+function openGnsysCopyServerFiles () {
+ if [ $# -ne 1 ]; then
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
+ exit 1
+ fi
+
+ local path_opengnsys_base=$1
+
+ local SOURCES=( client/boot/initrd-generator \
+ client/boot/upgrade-clients-udeb.sh \
+ client/boot/udeblist.conf \
+ client/boot/udeblist-jaunty.conf \
+ client/boot/udeblist-karmic.conf \
+ client/boot/udeblist-lucid.conf \
+ server/PXE/pxelinux.cfg/default \
+ doc )
+ local TARGETS=( bin/initrd-generator \
+ bin/upgrade-clients-udeb.sh \
+ etc/udeblist.conf \
+ etc/udeblist-jaunty.conf \
+ etc/udeblist-karmic.conf \
+ etc/udeblist-lucid.conf \
+ tftpboot/pxelinux.cfg/default \
+ doc )
+
+ if [ ${#SOURCES[@]} != ${#TARGETS[@]} ]; then
+ errorAndLog "${FUNCNAME}(): inconsistent number of array items"
+ exit 1
+ fi
+
+ echoAndLog "${FUNCNAME}(): copying files to server directories"
+
+ pushd $WORKDIR/opengnsys
+ local i
+ for (( i = 0; i < ${#SOURCES[@]}; i++ )); do
+ if [ -f "${SOURCES[$i]}" ]; then
+ echoAndLog "Copying ${SOURCES[$i]} to $path_opengnsys_base/${TARGETS[$i]}"
+ cp -p "${SOURCES[$i]}" "${path_opengnsys_base}/${TARGETS[$i]}"
+ elif [ -d "${SOURCES[$i]}" ]; then
+ echoAndLog "Copying content of ${SOURCES[$i]} to $path_opengnsys_base/${TARGETS[$i]}"
+ cp -a "${SOURCES[$i]}"/* "${path_opengnsys_base}/${TARGETS[$i]}"
+ else
+ echoAndLog "Warning: Unable to copy ${SOURCES[$i]} to $path_opengnsys_base/${TARGETS[$i]}"
+ fi
+ done
+ popd
+}
+
+####################################################################
+### Funciones de compilación de códifo fuente de servicios
+####################################################################
+
+# Compilar los servicios de OpenGNsys
+function servicesCompilation ()
+{
+ local hayErrores=0
+
+ # Compilar OpenGnSys Server
+ echoAndLog "${FUNCNAME}(): Compiling OpenGnSys Admin Server"
+ pushd $WORKDIR/opengnsys/admin/Services/ogAdmServer
+ make && make install
+ if [ $? -ne 0 ]; then
+ echoAndLog "${FUNCNAME}(): error while compiling OpenGnSys Admin Server"
+ hayErrores=1
+ fi
+ popd
+ # Compilar OpenGnSys Repository Manager
+ echoAndLog "${FUNCNAME}(): Compiling OpenGnSys Repository Manager"
+ pushd $WORKDIR/opengnsys/admin/Services/ogAdmRepo
+ make && make install
+ if [ $? -ne 0 ]; then
+ echoAndLog "${FUNCNAME}(): error while compiling OpenGnSys Repository Manager"
+ hayErrores=1
+ fi
+ popd
+ # Compilar OpenGnSys Client
+ echoAndLog "${FUNCNAME}(): Compiling OpenGnSys Admin Client"
+ pushd $WORKDIR/opengnsys/admin/Services/ogAdmClient
+ make && mv ogAdmClient ../../../client/nfsexport/bin
+ if [ $? -ne 0 ]; then
+ echoAndLog "${FUNCNAME}(): error while compiling OpenGnSys Admin Client"
+ hayErrores=1
+ fi
+ popd
+
+ return $hayErrores
+}
+
+
+####################################################################
+### Funciones instalacion cliente opengnsys
+####################################################################
+
+function openGnsysClientCreate()
+{
+ local OSDISTRIB OSCODENAME
+
+ local hayErrores=0
+
+ echoAndLog "${FUNCNAME}(): Copying OpenGnSys Client files."
+ cp -ar $WORKDIR/opengnsys/client/nfsexport/* $INSTALL_TARGET/client
+ find $INSTALL_TARGET/client -name .svn -type d -exec rm -fr {} \; 2>/dev/null
+ echoAndLog "${FUNCNAME}(): Copying OpenGnSys Cloning Engine files."
+ mkdir -p $INSTALL_TARGET/client/lib/engine/bin
+ cp -ar $WORKDIR/opengnsys/client/engine/*.lib $INSTALL_TARGET/client/lib/engine/bin
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while copying engine files"
+ hayErrores=1
+ fi
+
+ # Cargar Kernel, Initrd y paquetes udeb para la distribución del servidor (o por defecto).
+ OSDISTRIB=$(lsb_release -i | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null
+ OSCODENAME=$(lsb_release -c | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null
+ if [ "$OSDISTRIB" = "Ubuntu" -a -n "$OSCODENAME" ]; then
+ echoAndLog "${FUNCNAME}(): Loading Kernel and Initrd files for $OSDISTRIB $OSCODENAME."
+ $INSTALL_TARGET/bin/initrd-generator -t $INSTALL_TARGET/tftpboot -v "$OSCODENAME"
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while generating initrd OpenGnSys Admin Client"
+ hayErrores=1
+ fi
+ echoAndLog "${FUNCNAME}(): Loading udeb files for $OSDISTRIB $OSCODENAME."
+ $INSTALL_TARGET/bin/upgrade-clients-udeb.sh "$OSCODENAME"
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while upgrading udeb files OpenGnSys Admin Client"
+ hayErrores=1
+ fi
+ else
+ echoAndLog "${FUNCNAME}(): Loading default Kernel and Initrd files."
+ $INSTALL_TARGET/bin/initrd-generator -t $INSTALL_TARGET/tftpboot/
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while generating initrd OpenGnSys Admin Client"
+ hayErrores=1
+ fi
+ echoAndLog "${FUNCNAME}(): Loading default udeb files."
+ $INSTALL_TARGET/bin/upgrade-clients-udeb.sh
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while upgrading udeb files OpenGnSys Admin Client"
+ hayErrores=1
+ fi
+ fi
+
+ if [ $hayErrores -eq 0 ]; then
+ echoAndLog "${FUNCNAME}(): Client generation success."
+ else
+ errorAndLog "${FUNCNAME}(): Client generation with errors"
+ fi
+
+ return $hayErrores
+}
+
+
+# Configuración básica de servicios de OpenGnSys
+function openGnsysConfigure()
+{
+ echoAndLog "openGnsysConfigure(): Copying init files."
+ cp -p $WORKDIR/opengnsys/admin/Services/opengnsys.init /etc/init.d/opengnsys
+ cp -p $WORKDIR/opengnsys/admin/Services/opengnsys.default /etc/default/opengnsys
+ update-rc.d opengnsys defaults
+ echoAndLog "openGnsysConfigure(): Creating OpenGnSys config file in \"$INSTALL_TARGET/etc\"."
+ perl -pi -e "s/SERVERIP/$SERVERIP/g" $INSTALL_TARGET/etc/ogAdmServer.cfg
+ perl -pi -e "s/SERVERIP/$SERVERIP/g" $INSTALL_TARGET/etc/ogAdmRepo.cfg
+ echoAndLog "${FUNCNAME}(): Creating Web Console config file"
+ OPENGNSYS_CONSOLEURL="http://$SERVERIP/opengnsys"
+ perl -pi -e "s/SERVERIP/$SERVERIP/g; s/OPENGNSYSURL/${OPENGNSYS_CONSOLEURL//\//\\/}/g" $INSTALL_TARGET/www/controlacceso.php
+ sed -e "s/SERVERIP/$SERVERIP/g" -e "s/OPENGNSYSURL/${OPENGNSYS_CONSOLEURL//\//\\/}/g" $WORKDIR/opengnsys/admin/Services/ogAdmClient/ogAdmClient.cfg > $INSTALL_TARGET/client/etc/ogAdmClient.cfg
+ echoAndLog "openGnsysConfiguration(): Starting OpenGnSys services."
+ /etc/init.d/opengnsys start
+}
+
+
+#####################################################################
+####### Función de resumen informativo de la instalación
+#####################################################################
+
+function installationSummary(){
+ echo
+ echoAndLog "OpenGnSys Installation Summary"
+ echo "=============================="
+ echoAndLog "Project version: $(cat $INSTALL_TARGET/doc/VERSION.txt 2>/dev/null)"
+ echoAndLog "Installation directory: $INSTALL_TARGET"
+ echoAndLog "Repository directory: $INSTALL_TARGET/images"
+ echoAndLog "TFTP configuracion directory: /var/lib/tftpboot"
+ echoAndLog "DHCP configuracion file: /etc/dhcp3/dhcpd.conf"
+ echoAndLog "NFS configuracion file: /etc/exports"
+ echoAndLog "Web Console URL: $OPENGNSYS_CONSOLEURL"
+ echoAndLog "Web Console admin user: $OPENGNSYS_DB_USER"
+ echoAndLog "Web Console admin password: $OPENGNSYS_DB_PASSWD"
+ echoAndLog "Web Console default user: $OPENGNSYS_DB_DEFAULTUSER"
+ echoAndLog "Web Console default password: $OPENGNSYS_DB_DEFAULTPASSWD"
+ echo
+ echoAndLog "Post-Installation Instructions:"
+ echo "==============================="
+ echoAndLog "Review or edit all configuration files."
+ echoAndLog "Insert DHCP configuration data and restart service."
+ echoAndLog "Log-in as Web Console admin user."
+ echoAndLog " - Review default Organization data and default user."
+ echoAndLog "Log-in as Web Console organization user."
+ echoAndLog " - Insert OpenGnSys data (rooms, computers, etc)."
+echo
+}
+
diff --git a/client/boot/README.es.txt b/client/boot/README.es.txt
deleted file mode 100644
index ea332621..00000000
--- a/client/boot/README.es.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-OpenGNSys Client Boot README
-==============================
-
-En este directorio se incluyen los scripts y ficheros, ejecutables
-directamente desde el servidor de OpenGNSys, y que son necesarios
-para configurar los procesos de arranque de los clientes.
-
-
-initrd-generator (copiar en /opt/opengnsys/bin)
- Script de generación de los básicos de arranque del cliente
- (initrd y kernel).
-
-upgrade-clients-udeb.sh (copiar en /opt/opengnsys/bin)
- Script de descarga de paquetes udeb, que serán incluidos en
- el directorio de librerías importadas por los clientes.
-
-udeblist.conf (copiar en /opt/opengnsys/etc)
- Fichero de configuración que incluye la lista de paquetes
- udeb que deben ser descargados o eliminados.
- El formato de las líneas del fichero es:
- install:paquete
- remove:paquete
diff --git a/client/boot/initrd-generator b/client/boot/initrd-generator
deleted file mode 100755
index 7ec1be9d..00000000
--- a/client/boot/initrd-generator
+++ /dev/null
@@ -1,314 +0,0 @@
-#!/bin/bash
-# Generador de ficheros "kernel" e "initrd.gz" para arranque de cliente OpenGnSys
-
-test "$(lsb_release -is 2>/dev/null)" == "Ubuntu" && DIST="$(lsb_release -cs)"
-DIST=${DIST:-"lucid"} # Si no se detecta, distribución Ubuntu por defecto.
-ARCH=$(arch) # Arquitectura del sistema: i386 (32 bits), amd64 (64 bits).
-ARCH=${ARCH:-"$(uname -m)"} # Corrección para Ubuntu Jaunty.
-ARCH=${ARCH/i[4-6]86/i386}
-ARCH=${ARCH/x86_64/amd64}
-URL=http://archive.ubuntu.com/ubuntu/dists/$DIST-updates/main/installer-$ARCH/current/images/netboot/ubuntu-installer/$ARCH
-if [ "$TMP" = "" ] ; then TMP=/tmp ; fi
-TMPINITRD=$TMP/initrd
-NEWROOT=$TMPINITRD/newroot
-ANTERIORPWD=$PWD
-DEST=$PWD
-LINUX=1
-CHROOTINITSCRIPT=/oginit
-INITSCRIPT=$NEWROOT$CHROOTINITSCRIPT
-
-# Comprueba los argumentos pasados para modificar los valores por defecto
-function parsearParametros
-{
- while [ $# -ne 0 ];do
- case $1 in
- ("-d")
- shift
- #URL=http://people.debian.org/~joeyh/d-i/images/daily/netboot/debian-installer/i386/
- URL=http://ftp.nl.debian.org/debian/dists/testing/main/installer-$ARCH/current/images/netboot/debian-installer/$ARCH/
- ;;
- ("-v")
- shift
- if [ $# -eq 0 ];then
- echo "Error en los argumentos"
- return -1
- else
- DIST=$1
- URL=http://archive.ubuntu.com/ubuntu/dists/$DIST-updates/main/installer-$ARCH/current/images/netboot/ubuntu-installer/$ARCH
- shift
- fi
- ;;
- ("-l")
- shift
- ;;
- ("-t")
- shift
- if [ $# -eq 0 ];then
- echo "Error en los argumentos"
- return -1
- else
- DEST=$1
- shift
- fi
- ;;
- esac
- done
-}
-
-function descargar
-{
- # Borramos si existe el directorio temporal
- if [ -d $TMPINITRD ]; then
- rm -r $TMPINITRD
- fi
- # Creamos directorio temporal y nos vamos alli
- mkdir -p $TMPINITRD
- cd $TMPINITRD
-
- # Ficheros a descargar: Initrd y Kernel (si está habilitado).
- FILES="initrd.gz"
- [ $LINUX ] && FILES="$FILES linux"
-
- for f in $FILES; do
- # Borrar fichero anterior
- [ -f "$f" ] && rm -f $f
- # Descargar fichero (intentar primero actualizaciones).
- wget $URL/$f || wget ${URL/-updates/}/$f
- if [ $? != 0 ]; then
- echo "Error no se ha podido descargar el fichero $f"
- exit 1
- fi
- done
-}
-
-# Descomprimimos el initrd
-function descomprimir
-{
- if [ ! -f $TMPINITRD/initrd.gz ]; then
- echo No se encuentra el initrd.gz
- exit -1
- fi
-
- if [ -f $NEWROOT ];then
- rm -rf $NEWROOT
- fi
-
- mkdir -p $NEWROOT
- cd $NEWROOT
-
- gzip -dc $TMPINITRD/initrd.gz | cpio -id
-}
-
-# Borrar todos los scripts del directorio actual
-function borrarScripts
-{
- # Primero los hacemos con los enlaces para que no se produzcan errores si borramos a lo que apunta primero
- for i in `ls -F -1 | grep @ | awk -F @ '{print $1}'`; do
- if [ $(file $i -L | grep "shell script" | wc -l) -gt 0 ]; then
- rm $i
- fi
- done
-
- # Ahora lo hacemos con todos los ejecutables
- for i in `ls`; do
- if [ $(file $i | grep "shell script" | wc -l) -gt 0 ]; then
- rm $i
- fi
- done
-}
-
-# Borra todos los ejecutables que enlacen con la libreria debian-installer
-function borrarEjecutablesDebinstall
-{
- # Primero lo hacemos con los enlaces para que no se produzcan errores si borramos a lo que apunta primero
- for i in `ls -F -1 | grep @ | awk -F @ '{print $1}'`; do
- if [ $(ldd $i | grep -e libdebian-installer -e libdebconf | wc -l) -gt 0 ]; then
- rm $i
- fi
- done
-
- # Ahora lo hacemos con todos los ejecutables
- for i in `ls`; do
- if [ $(ldd $i | grep -e libdebian-installer -e libdebconf | wc -l) -gt 0 ]; then
- rm $i
- fi
- done
-}
-
-# Elimina todos los fichero innecesarios del initrd
-function purgarFicherosDebian
-{
- mkdir -p $NEWROOT
- cd $NEWROOT
-
- rm init
-
- # Pasamos por todos los directorios y vamos borrando lo innecesario
- cd bin/
- borrarScripts
- borrarEjecutablesDebinstall
-
- cd ../etc/
- rm -rf cdebconf.conf default-release lsb-release preseed_aliases udebs-source
-
- cd ../lib/
- rm -rf chroot-setup.sh debian-installer* kickseed main-menu.d preseed libdebian-installer*
-
- cd ../sbin/
- borrarScripts
- borrarEjecutablesDebinstall
-
- cd ../usr/bin/
- borrarScripts
- borrarEjecutablesDebinstall
-
- cd ../lib/
- rm -rf base-installer.d debian-installer finish-install.d libdebconfclient* cdebconf fetch-url net-retriever post-base-installer.d
-
- # Solo queda un enlace simbolico que ya no apunta a nada
- cd ../sbin/
- rm -rf *
-
- cd ../share/
- rm -rf debconf keyrings save-logs
-
- cd ../../var/
- rm -rf cache/anna/ spool/kickseed/
-
- cd lib/
- rm -rf apt-install cdebconf dpkg
-
- cd ../..
-}
-
-# Le agrega los archivos necesarios para que arranque de otra manera
-function agregarNuevoArranque
-{
- cd $NEWROOT
-
- cd etc/
- # Script de arranque de OpenGnSys Client.
- perl -i -p -e "s/\/sbin\/debian-installer\$/${CHROOTINITSCRIPT//\//\/}/" inittab
- # Impedir usar shell en terminales 2 y 3
- # (NOTA: comentar la siguiente línea para sistemas en pruebas).
- #perl -n -i -e "print unless /^tty[23]/" inittab
-
- # Script inicial que ejecuta el resto de scripts de /etc/rcS.d/
- #echo "#! /bin/sh" >> rc
- #echo "for script in /etc/rcS.d/S[0-9][0-9]*; do if [ -x $script ]; then $script fi done" >> rc
- #chmod +x rc
-
- # Agregamos para que ejecute el script anterior lo primero
- #echo "::sysinit:/etc/init.d/rc" > inittab
- # Que ejecute el fichero /init cuando se reinicio el proceso init
- #echo "::restart:/sbin/init" >> inittab
- # Que funciona el control alt supr
- #echo "::ctrlaltdel:/sbin/reboot" >> inittab
-
- # Cosas que hacer si se apaga
- #echo "::shutdown:/bin/umount -a -r" >> inittab
- #echo "::shutdown:/sbin/swapoff -a" >> inittab
-
- # Primero ejecutamos el dhcp
- VERSION=$(cat /opt/opengnsys/doc/VERSION.txt 2>/dev/null)
- VERSION=${VERSION:-"OpenGnSys"}
- cat << FIN > $INITSCRIPT
-#! /bin/sh
-echo
-echo "Arranque cliente $VERSION"
-echo
-set -e
-# Exportando variables
-for i in \$(cat /proc/cmdline);
-do
- echo \$i | grep -q "=" && export \$i
-done
-# Configurar la red
-if [ "\$ip" == "dhcp" ]; then
- echo "Configurando red por DHCP"
- mkdir -p /var/state/dhcp
- /sbin/dhclient 2>/dev/null
-fi
-# Modo de trabajo del cliente: on-line/off-line
-status="\${status:-online}"
-echo "Comprobando modo de trabajo \$status"
-case "\$status" in
- online)
- if [ -z "\$repo" ]
- then
- SERVERIP=\$(grep -h dhcp-server-identifier /var/lib/dhcp3/dhclient.* | sed 's/[^0-9]*\(.*\);/\1/' | head -1)
- else
- SERVERIP="\$repo"
- fi
- echo "Preparando conexión con el Repositorio \$SERVERIP"
- # determinar el paramtro de boot para los permisos de los montajes de imagenes.
- BOOTMODE=\${boot:-"user"}
- case "\$BOOTMODE" in
- admin) MOUNTOPTS="rw" ;;
- user) MOUNTOPTS="ro" ;;
- *) echo "Aviso: Modo de arranque desconocido."
- BOOTMODE="user"
- MOUNTOPTS="ro" ;;
- esac
- # Montamos el resto de cosas necesarias
- echo "Montar repo en modo \$BOOTMODE"
- mkdir -p /opt/opengnsys
- DEFAULTOPTS="nolock,proto=tcp"
- if \$(mount | grep -q " /opt/opengnsys "); then
- DEFAULTOPTS="remount,\$DEFAULTOPTS"
- fi
- mount -t nfs -o "\$DEFAULTOPTS,ro" \$SERVERIP:/opt/opengnsys/client /opt/opengnsys
- mount -t nfs -o "\$DEFAULTOPTS,rw" \$SERVERIP:/opt/opengnsys/log/clients /opt/opengnsys/log
- mount -t nfs -o "\$DEFAULTOPTS,\$MOUNTOPTS" \$SERVERIP:/opt/opengnsys/images /opt/opengnsys/images
- ;;
- offline)
- echo "Off-line mode."
- ;;
-esac
-/opt/opengnsys/etc/preinit/default.sh
-FIN
- chmod +x $INITSCRIPT
-}
-
-# Función para corregir problemas detectados con módulos del kernel.
-function configurarModulos
-{
- cd $NEWROOT/lib/modules/*
-
- case "$DIST" in
- lucid) # Corregir problema de frame-buffer en Lucid.
- perl -p -i -e 's/vga16fb/vesafb/g' modules.alias ;;
- *) ;;
- esac
-}
-
-function comprimir
-{
- cd $NEWROOT
-
- if [ $? = 1 ] ; then
- exit -1
- fi
-
- find ./ | cpio -H newc -o > $TMPINITRD/new-initrd
- cd $TMPINITRD
- gzip -9 new-initrd
-}
-
-function finalizar
-{
- cd $ANTERIORPWD
- mv $TMPINITRD/new-initrd.gz $DEST/initrd.gz
- if [ $LINUX ] ; then
- mv $TMPINITRD/linux $DEST/linux
- fi
-}
-
-parsearParametros $@
-descargar
-descomprimir
-#purgarFicherosDebian
-agregarNuevoArranque
-configurarModulos
-comprimir
-finalizar
diff --git a/client/boot/ogClientNfs-generator.lib b/client/boot/ogClientNfs-generator.lib
deleted file mode 100755
index a077f4cb..00000000
--- a/client/boot/ogClientNfs-generator.lib
+++ /dev/null
@@ -1,139 +0,0 @@
-
-function BuildOSBase() {
-#/** @function BuildOSBase: @brief instala los componentes base de los opengnsys OS y muestra aquellos que hay que compilar.
-#@param $1 str_versionLinux
-#@param ejemplo BuildEACOSBase ubuntu904
-#@return
-#@warning Salidas de errores no determinada
-#@attention
-#@version 0.1 Date: 02/05/2009 Author Antonio J. Doblas Viso. Universidad de Malaga
-#@note version importada desde EAC para su adaptación a opengnsys. No testeada
-#*/
-#
-if [ $# = 0 ]
-then
- echo"InstallEACOSBase instala los componentes base de los EAC OS."
- echo "sintaxis: InstallEACOSBASE strVersionLinux --- Ejemplo: InstallEACOSBase ubuntu0904 "
- return
-fi
-if [ $# = 1 ]
-then
- case $1 in
- "ubuntu0904")
- cp -ra /etc/udev/rules.d /etc/udev/rules.d-old
- rm /etc/udev/rules.d/70-persistent-net.rules
- echo "###########START Especificos EAC############ " >> /etc/apt/sources.list
- echo "deb http://free.nchc.org.tw/ubuntu jaunty-security main restricted universe multiverse" >> /etc/apt/sources.list
- echo "deb http://free.nchc.org.tw/drbl-core drbl stable" >> /etc/apt/sources.list
- echo "deb http://www.geekconnection.org/remastersys/repository ubuntu/" >> /etc/apt/sources.list
- echo "###########END Especificos EAC############ " >> /etc/apt/sources.list
- apt-get update
- #apt-get install xorg-dev xorg lxde qingy roxterm
- #apt-get install firefox links midbrowser scite
- #apt-get install build-essential cmake m4 autoconf gettext libbz2-dev
- apt-get install nfs-common nfs-kernel-server openssh-server sshfs
- apt-get install reiser4progs hfsplus curl
- apt-get install fusesmb smbnetfs smbfs subversion
- apt-get install gkrellm saidar htop iptraf vnstat ethstatus darkstat ncdu xdiskusage iotop lshw lshw-gtk conky
- apt-get install dcfldd ddrescue di disktype dmraid hdparm sdparm hexedit lftp lsscsi lshw mc myrescue testdisk hwinfo
- apt-get install partimage ntfsprogs partclone mysql-client php5 php5-cli php5-cgi php5-mysql registry-tools sysv-rc-conf kexec-tools gparted parted parted-doc gnu-fdisk fatresize gparted
- apt-get install lzop ethtool etherwake remastersys bfr fbgrab fbset ksh registry-tools netpipes
- apt-get install drbl-partimage drbl-chntpw drbl-ntfsprogs drbl-lzop
- # desactivamos por si acaso alguno servicios, que en la distribucion base no son necesarios
- #/etc/init.d/apache2 stop && update-rc.d -f apache2 remove
- #update-rc.d -f gdm remove
- #apt-get install lighttpd
- #/etc/init.d/lighttpd stop && update-rc.d -f lighttpd remove
- ;;
- esac
-fi
-
-if [ $# = 1 ]
-then
-
- echo "creando la estrucutra de datos"
- mkdir -p /opt/opengnsys/{bin,etc,log,lib/{engine/bin,modules},images,init}
- cd /root/ && svn co svn://www.informatica.us.es:3690/eac-hidra
-fi
-
-
-if [ $# = 1 ]
-then
- read -p "pausa para configurar el framebuffer: abre una nueva consola y segue estas intrucciones, luego pulsa enter"
- echo "Activar el framebuffer: abre una consola y realiza estas operaciones"
- echo "/etc/modprobe.d/blacklist-framebuffer => le comentamos las lineas de vesafb, vga16fb y radeonfb"
- echo "/etc/initramfs-tools/modules => agregamos en una linea cada una de estas fbcon vesafb vga16b"
- echo "actualizamos con # update-initramfs -u"
- echo "acivadmos el framebuffer en /boot/grub/menu.lst y en el kernel que deseemos a�adimos vga=791"
-fi
-
-if [ $# = 1 ]
-then
- read -p "pausa para configurar el framebuffer: abre una nueva consola y segue estas intrucciones, luego pulsa enter"
- echo "configurar el lighttd"
- read -p "press enter"
-fi
-
-if [ $# = 1 ]
-then
- importclient=/opt/opengnsys
- echo "configurar el /etc/bash.bashrc"
- echo "####### EAC ##########" >> /etc/bash.bashrc
- echo "importclient=/opt/opengnsys" >> /etc/bash.bashrc
- echo "export PATH=$PATH:/sbin/:/bin/:/opt/:/usr/local/sbin/:/usr/local/bin/:/usr/bin/:/usr/sbin/:/opt/opengnsys/" >> /etc/bash.bashrc
- echo source ${importclient}/lib/engine/Settings.lib >> /etc/bash.bashrc
- echo source ${importclient}/lib/engine/ATA.lib >> /etc/bash.bashrc
- echo source ${importclient}/lib/engine/Boot.lib >> /etc/bash.bashrc
- echo source ${importclient}/lib/engine/Deploy.lib >> /etc/bash.bashrc
- echo source ${importclient}/lib/engine/FileSystem.lib >> /etc/bash.bashrc
- echo source ${importclient}/lib/engine/PostConf.lib >> /etc/bash.bashrc
-fi
-
-if [ $# = 1 ]
-then
- read -p "pausa para compilar los programas necesarios: abre una nueva consola y segue estas intrucciones, luego pulsa enter"
- echo "estos hay que compilarlos estan dentro de source"
- echo "partition saving http://partition-saving.com"
- echo "mbuffer (http://www.maier-komor.de/mbuffer.html) requiere ksh"
- echo "udp-cast 2008-09-14 http://udpcast.linux.lu/"
- echo "ctorrent 3.3.2 http://www.rahul.net/dholmes/ctorrent/"
- echo "wmi-client: https://launchpad.net/ubuntu/jaunty/+source/wmi/1:0.1.12-1"
- echo "ms-sys http://ms-sys.sourceforge.net/"
- echo "EACInterfaces copiar el binario a /usr/sbin"
- echo NameCompany copiar a /usr/sbin"
- echo NameNtpServer a /usr/sbin"
-fi
-}
-
-
-function BuildOgClientNfs () {
-#/** @function BuildOgClientNfs: @brief Genera una copia del sistema actual para convertirlo posteriormente en arranque pxe EAC.
-#@param $1 str_DirectorioDestino
-#@param $2 str_metodo (debootstrap o myfilsystem)
-#@param ejemplo: BuildOgClientNfs /opt/opengnsys/tftpboot/ogClinent/ogClientNfs debootstrap
-#@return: no definida
-#@warning No controla que el el directorio destino debe estar montado en una particion distinta al sistema raiz.
-#@attention
-#@version 0.1 Date: 03/06/2009 Author Antonio J. Doblas Viso. Universidad de Malaga
-#@note falta la creacion del kernel y el initrd
-#*/
-if [ $# = 0 ]
-then
- echo"BuildOgClientNfs"
- echo "sintaxis: BuildOfClientNfs str_path_contenedor str_metodo"
- return
-fi
-if [ $# = 2 ]
-then
- if [ $2 = "myfilesystem" ]
- then
- cd /
- cp -rav /. $1/.
- cp -rav -/dev/. $1/dev/.
- fi
- if [ $2 = "debootstrap" ]
- then
- echo "debo"
- fi
-fi
-} \ No newline at end of file
diff --git a/client/boot/udeblist-jaunty.conf b/client/boot/udeblist-jaunty.conf
deleted file mode 100644
index d5858518..00000000
--- a/client/boot/udeblist-jaunty.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-install:cryptsetup-udeb
-install:dmraid-udeb
-install:dmsetup-udeb
-install:e2fsprogs-udeb
-install:fbset-udeb
-install:fdisk-udeb
-install:fuse-utils-udeb
-install:jfsutils-udeb
-install:kbd-udeb
-install:lvm2-udeb
-install:mdadm-udeb
-install:mkreiserfs-udeb
-install:ntfs-3g-udeb
-install:ntfsprogs-udeb
-install:openssh-client-udeb
-install:openssh-server-udeb
-install:parted-udeb
-install:reiserfsprogs-udeb
-install:xfsprogs-udeb
-install:fs-core-modules-2.6.28-11-generic-di
-install:mouse-modules-2.6.28-11-generic-di
-remove:kernel-image-2.6.28-11-generic-di
diff --git a/client/boot/udeblist-karmic.conf b/client/boot/udeblist-karmic.conf
deleted file mode 100644
index 9ca151df..00000000
--- a/client/boot/udeblist-karmic.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-install:cryptsetup-udeb
-install:dmraid-udeb
-install:dmsetup-udeb
-install:e2fsprogs-udeb
-install:fbset-udeb
-install:fdisk-udeb
-install:fuse-utils-udeb
-install:jfsutils-udeb
-install:kbd-udeb
-install:lvm2-udeb
-install:mdadm-udeb
-install:mkreiserfs-udeb
-install:ntfs-3g-udeb
-install:ntfsprogs-udeb
-install:openssh-client-udeb
-install:openssh-server-udeb
-install:parted-udeb
-install:reiserfsprogs-udeb
-install:xfsprogs-udeb
-install:fs-core-modules-2.6.31-14-generic-di
-install:mouse-modules-2.6.31-14-generic-di
-remove:kernel-image-2.6.31-14-generic-di
diff --git a/client/boot/udeblist-lucid.conf b/client/boot/udeblist-lucid.conf
deleted file mode 100644
index dfb35622..00000000
--- a/client/boot/udeblist-lucid.conf
+++ /dev/null
@@ -1,31 +0,0 @@
-install:cryptsetup-udeb
-install:dmidecode-udeb
-install:dmraid-udeb
-install:dmsetup-udeb
-install:e2fsprogs-udeb
-install:fbset-udeb
-install:fdisk-udeb
-install:fuse-utils-udeb
-install:jfsutils-udeb
-install:kbd-udeb
-install:lvm2-udeb
-install:lsb-release-udeb
-install:mdadm-udeb
-install:mkreiser4-udeb
-install:mkreiserfs-udeb
-install:ntfs-3g-udeb
-install:ntfsprogs-udeb
-install:openssh-client-udeb
-install:openssh-server-udeb
-install:parted-udeb
-install:reiser4progs-udeb
-install:reiserfsprogs-udeb
-install:util-linux-udeb
-install:xfsprogs-udeb
-install:fs-core-modules-KERNELVERS-di
-install:fs-secondary-modules-KERNELVERS-di
-install:mouse-modules-KERNELVERS-di
-install:pata-modules-KERNELVERS-di
-install:sata-modules-KERNELVERS-di
-install:scsi-modules-KERNELVERS-di
-remove:kernel-image-KERNELVERS-di
diff --git a/client/boot/udeblist-maverick.conf b/client/boot/udeblist-maverick.conf
deleted file mode 100644
index d340ec65..00000000
--- a/client/boot/udeblist-maverick.conf
+++ /dev/null
@@ -1,28 +0,0 @@
-install:cryptsetup-udeb
-install:dmraid-udeb
-install:dmsetup-udeb
-install:e2fsprogs-udeb
-install:fbset-udeb
-install:fdisk-udeb
-install:fuse-utils-udeb
-install:jfsutils-udeb
-install:kbd-udeb
-install:lvm2-udeb
-install:lsb-release-udeb
-install:mdadm-udeb
-install:mkreiserfs-udeb
-install:ntfs-3g-udeb
-install:ntfsprogs-udeb
-install:openssh-client-udeb
-install:openssh-server-udeb
-install:parted-udeb
-install:reiserfsprogs-udeb
-install:util-linux-udeb
-install:xfsprogs-udeb
-install:fs-core-modules-2.6.35-22-generic-di
-install:fs-secondary-modules-2.6.35-22-generic-di
-install:mouse-modules-2.6.35-22-generic-di
-install:pata-modules-2.6.35-22-generic-di
-install:sata-modules-2.6.35-22-generic-di
-install:scsi-modules-2.6.35-22-generic-di
-remove:kernel-image-2.6.35-22-generic-di
diff --git a/client/boot/udeblist.conf b/client/boot/udeblist.conf
deleted file mode 120000
index 4ab23c79..00000000
--- a/client/boot/udeblist.conf
+++ /dev/null
@@ -1 +0,0 @@
-udeblist-jaunty.conf \ No newline at end of file
diff --git a/client/boot/upgrade-clients-udeb.sh b/client/boot/upgrade-clients-udeb.sh
deleted file mode 100755
index afc5229e..00000000
--- a/client/boot/upgrade-clients-udeb.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-#@file upgrade-clients-udeb.sh
-#@brief Actualiza los paquetes udeb que deben ser exportados a los clientes.
-#@arg \c distrib - nombre de la distribución de Ubuntu (karmic, jaunty, ...).
-#@note El script debe ser copiado a \c opengnsys/bin y el fichero de configuración a \c opengnsys/etc
-#@note Formato del fichero \c udeb.list : {install|remove}:paquete
-
-
-# Variables
-PROG="$(basename $0)"
-OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
-test "$(lsb_release -is 2>/dev/null)" == "Ubuntu" && DEFDISTRIB="$(lsb_release -cs)"
-DEFDISTRIB=${DEFDISTRIB:-"lucid"}
-DISTRIB=${1:-"$DEFDISTRIB"} # Si no se indica, usar distribución por defecto.
-CFGFILE="$OPENGNSYS/etc/udeblist-$DISTRIB.conf"
-OGUDEB="$OPENGNSYS/client/lib/udeb"
-TMPUDEB="/tmp/udeb"
-UDEBLIST="/etc/apt/sources.list.d/udeb.list"
-KERNELVERS=$(strings $OPENGNSYS/tftpboot/linux | awk '/2.6.*generic/ {print $1}')
-
-# Comprobar fichero de configuración.
-if [ ! -f "$CFGFILE" ]; then
- echo "$PROG: No existe el fichero de configuración \"$CFGFILE\"" >&2
- exit 1
-fi
-PACKAGES_INSTALL=$(awk -F: '$1~/install/ {print $2}' $CFGFILE)
-PACKAGES_INSTALL=${PACKAGES_INSTALL//KERNELVERS/$KERNELVERS}
-PACKAGES_REMOVE=$(awk -F: '$1~/remove/ {print $2}' $CFGFILE)
-PACKAGES_REMOVE=${PACKAGES_REMOVE//KERNELVERS/$KERNELVERS}
-if [ -z "$PACKAGES_INSTALL" ]; then
- echo "$PROG: No hay paquetes para descargar." >&2
- exit 2
-fi
-
-# Crear configuración para apt-get
-echo "deb http://archive.ubuntu.com/ubuntu/ $DISTRIB main/debian-installer universe/debian-installer" >$UDEBLIST
-echo "deb http://archive.ubuntu.com/ubuntu/ $DISTRIB-updates main/debian-installer universe/debian-installer" >>$UDEBLIST
-mkdir -p $TMPUDEB/partial
-rm -f $TMPUDEB/*.udeb
-
-# Descargar paquetes udeb, borrar los descartables y moverlos al NFS.
-apt-get update
-apt-get install -y -o dir::cache::archives=$TMPUDEB -d $PACKAGES_INSTALL
-for i in $PACKAGES_REMOVE; do
- rm -f $TMPUDEB/${i}_*.udeb
-done
-rm -f $OGUDEB/*.udeb
-mv $TMPUDEB/*.udeb $OGUDEB
-rm -f $UDEBLIST
-
diff --git a/client/browser/src/main.cpp b/client/browser/src/main.cpp
index 99c13812..dd3ac6ed 100644
--- a/client/browser/src/main.cpp
+++ b/client/browser/src/main.cpp
@@ -1,6 +1,7 @@
#include <QtGui/QApplication>
#include <stdio.h>
#include "mainwindow.h"
+#include <Qt/qtextcodec.h>
int main(int argc, char *argv[])
{
@@ -12,6 +13,7 @@ int main(int argc, char *argv[])
// Codificación UTF-8.
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
+ QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
QApplication a(argc, argv);
MainWindow w;
diff --git a/client/browser/src/mainwindow.cpp b/client/browser/src/mainwindow.cpp
index f49b6510..40a02ab5 100644
--- a/client/browser/src/mainwindow.cpp
+++ b/client/browser/src/mainwindow.cpp
@@ -30,7 +30,7 @@ MainWindow::MainWindow(QWidget *parent)
// Graphic
showFullScreen();
- setWindowTitle(tr("OpenGNSys Browser"));
+ setWindowTitle(tr("OpenGnSys Browser"));
setCentralWidget(m_web);
@@ -156,25 +156,31 @@ void MainWindow::slotLinkHandle(const QUrl &url)
}
QString urlString = url.toString();
- // Si es un link del tipo COMMAND lo ejecutamos
if(urlString.startsWith(COMMAND))
{
+ // Si es link de tipo COMMAND, ejecutar.
executeCommand(urlString.remove(0,QString(COMMAND).length()));
}
else if(urlString.startsWith(COMMAND_WITH_CONFIRMATION))
{
+ // Si es link de tipo COMMAND_WITH_CONFIRMATION, pedir confirmacin de ejecutar.
QMessageBox msgBox;
- msgBox.setText(tr("La siguiente accin puede tardar varios minutos. Mientras se realiza no podr usar el ordenador."));
- msgBox.setInformativeText(tr("Ests seguro de que quieres continuar?"));
- msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
- msgBox.setDefaultButton(QMessageBox::Ok);
- if (msgBox.exec() == QMessageBox::Ok)
+ msgBox.setIcon(QMessageBox::Question);
+ msgBox.setWindowTitle(tr("AVISO"));
+ msgBox.setTextFormat(Qt::RichText);
+ msgBox.setText(tr("La siguiente acci&oacute;n puede modificar datos o tardar varios minutos. El equipo no podr&aacute; ser utilizado durante su ejecuci&oacute;n."));
+ QPushButton *execButton = msgBox.addButton(tr("Ejecutar"), QMessageBox::ActionRole);
+ msgBox.addButton(tr("Cancelar"), QMessageBox::RejectRole);
+ msgBox.setDefaultButton(execButton);
+ msgBox.exec();
+ if (msgBox.clickedButton() == execButton)
{
executeCommand(urlString.remove(0,QString(COMMAND_WITH_CONFIRMATION).length()));
}
}
else
{
+ // Si es otro link, cargar pgina web.
m_web->load(url);
}
}
@@ -198,10 +204,13 @@ void MainWindow::slotWebLoadFinished(bool ok)
if(ok == false)
{
QMessageBox msgBox;
- msgBox.setText(tr("La pagina web no pudo ser cargada. Qu quieres hacer?"));
+ msgBox.setIcon(QMessageBox::Question);
+ msgBox.setWindowTitle(tr("AVISO"));
+ msgBox.setTextFormat(Qt::RichText);
+ msgBox.setText(tr("La p&aacute;gina no se puede cargar."));
QPushButton *reloadButton = msgBox.addButton(tr("Recargar"), QMessageBox::ActionRole);
- msgBox.addButton(QMessageBox::Abort);
+ msgBox.addButton(tr("Abortar"), QMessageBox::RejectRole);
msgBox.exec();
@@ -238,7 +247,7 @@ void MainWindow::slotProcessOutput()
while((m_process->readLine(buf,BUFFERSIZE) > 0))
{
QString s(buf);
- print(tr("Proc. Output: ")+s);
+ print(tr("Proc. stdout: ")+s);
captureOutputForStatusBar(s);
}
}
@@ -250,7 +259,10 @@ void MainWindow::slotProcessErrorOutput()
while((m_process->readLine(buf,BUFFERSIZE) > 0))
{
QString s(buf);
- print(tr("Proc. Error: ")+s);
+ m_output->insertPlainText(tr("Proc. stderr: "));
+ m_output->setTextColor(QColor(Qt::darkBlue));
+ print(s);
+ m_output->setTextColor(QColor(Qt::black));
}
}
@@ -262,23 +274,24 @@ void MainWindow::slotProcessFinished(int code,QProcess::ExitStatus status)
}
else
{
- print(tr("El proceso fall inesperadamente. Output: "+code));
+ print(tr("El proceso ha fallado inesperadamente. Salida: "+code));
}
finishProgressBar();
}
void MainWindow::slotProcessError(QProcess::ProcessError error)
{
+ m_output->setTextColor(QColor(Qt::darkRed));
switch(error)
{
case QProcess::FailedToStart:
print(tr("Imposible lanzar el proceso."));
break;
case QProcess::WriteError:
- print(tr("Write error happened in the process."));
+ print(tr("Error de escritura en el proceso."));
break;
case QProcess::ReadError:
- print(tr("Read error happened in the process."));
+ print(tr("Error de lectura del proceso."));
break;
// No capturo crashed porque la pillo por finished
case QProcess::Crashed:
@@ -286,10 +299,11 @@ void MainWindow::slotProcessError(QProcess::ProcessError error)
break;
case QProcess::UnknownError:
default:
- print(tr("Unknown error."));
+ print(tr("Error desconocido."));
break;
}
finishProgressBar();
+ m_output->setTextColor(QColor(Qt::black));
}
void MainWindow::slotCreateTerminal()
@@ -412,6 +426,9 @@ void MainWindow::executeCommand(QString &string)
// Le ponemos el mismo entorno que tiene el browser ahora mismo
m_process->setEnvironment(QProcess::systemEnvironment());
m_process->start(program,list);
- print(tr("Lanzando el comando: ")+program+" "+list.join(" ")+".");
+ m_output->insertPlainText(tr("Lanzando el comando: "));
+ m_output->setTextColor(QColor(Qt::darkGreen));
+ print(program+" "+list.join(" "));
+ m_output->setTextColor(QColor(Qt::black));
startProgressBar();
}
diff --git a/client/engine/Cache.lib b/client/engine/Cache.lib
index 79a800c6..341525e2 100755
--- a/client/engine/Cache.lib
+++ b/client/engine/Cache.lib
@@ -251,6 +251,9 @@ fi
#@version 0.91 - Adaptacion a la cache local de OpenGnSys.
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2010/03/16
+#@version 1.0 - Correccion multiples montajes de cache.
+#@author Antonio J. Doblas Viso, Universidad de Malaga
+#@date 2011/02/24
#*/ ##
function ogMountCache ()
{
@@ -260,9 +263,8 @@ if [ "$*" == "help" ]; then
return
fi
-OGCAC=$(ogMountFs $(ogFindCache) 2>/dev/null) || ogRaiseError $OG_ERR_PARTITION "$MSG_NOCACHE" || return $?
-echo $OGCAC
-export OGCAC
+ogMountFs $(ogFindCache) 2>/dev/null || ogRaiseError $OG_ERR_PARTITION "$MSG_NOCACHE" || return $?
+
}
@@ -278,6 +280,9 @@ export OGCAC
#@version 0.91 - Adaptacion a la cache local de OpenGnSys.
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2010/03/16
+#@version 1.0 - Correccion multiples montajes de cache.
+#@author Antonio J. Doblas Viso, Universidad de Malaga
+#@date 2011/02/24
#*/ ##
function ogUnmountCache ()
{
@@ -290,6 +295,7 @@ if [ "$*" == "help" ]; then
fi
CACHE=$(ogFindCache) || ogRaiseError $OG_ERR_PARTITION "$MSG_NOCACHE"
+ogIsMounted $CACHE || return 0
ogUnmountFs $CACHE
# Borrar enlace simbólico de /mnt/ParticiónCache.
rm -f $(ogDiskToDev $CACHE | sed 's/dev/mnt/')
diff --git a/client/engine/Disk.lib b/client/engine/Disk.lib
index 9b361eb9..8f7fd0d7 100755
--- a/client/engine/Disk.lib
+++ b/client/engine/Disk.lib
@@ -75,14 +75,13 @@ while [ $# -gt 0 ]; do
fi
# Leer formato de cada parámetro - Tipo:Tamaño
TYPE="${1%%:*}"
- [ "$TYPE" != "CACHE" ] || ogRaiseError $OG_ERR_FORMAT "$TYPE" || return $?
SIZE="${1#*:}"
- # Convertir en sectores de 512 B.
- SIZE=$(echo $SIZE|awk '{print $0*2}') # (solución error de sintaxis)
- [ $SIZE -ne 0 ] || ogRaiseError $OG_ERR_FORMAT "$SIZE" || return $?
- # Obtener identificador de tipo de partición.
+ # Obtener identificador de tipo de partición válido.
ID=$(ogFsToId "$TYPE")
- [ -n "$ID" ] || ogRaiseError $OG_ERR_PARTITION "$TYPE" || return $?
+ [ "$TYPE" != "CACHE" -a -n "$ID" ] || ogRaiseError $OG_ERR_PARTITION "$TYPE" || return $?
+ # Comprobar tamaño numérico y convertir en sectores de 512 B.
+ [[ "$SIZE" == *([0-9]) ]] || ogRaiseError $OG_ERR_FORMAT "$SIZE" || return $?
+ SIZE=$[SIZE*2]
# Comprobar si la partición es extendida.
if [ $ID = 5 ]; then
[ $PART -gt 4 ] && ogRaiseError $OG_ERR_FORMAT && return $?
@@ -124,7 +123,7 @@ ogUnmountAll $ND 2>/dev/null
# Si la tabla de particiones no es valida, volver a generarla.
[ $(parted -s $DISK print >/dev/null) ] || fdisk $DISK <<< "w"
# Definir particiones y notificar al kernel.
-sfdisk -f $DISK < $tmpsfdisk 2>/dev/null && partprobe
+sfdisk -f $DISK < $tmpsfdisk 2>/dev/null && partprobe $DISK
rm -f $tmpsfdisk
[ -n "$CACHESIZE" ] && ogMountCache 2>/dev/null
}
@@ -609,9 +608,10 @@ partprobe 2>/dev/null
function ogUpdatePartitionTable ()
{
-echo "Forzando al kernel la lectura de la tabla de particiones"
-list=`partprobe -s | cut -f1 -d: ` 2>/dev/null
-echo $list > /tmp/disk
+for i in `ogDiskToDev`
+do
+ partprobe $i
+done
}
@@ -727,7 +727,7 @@ PART=`ogDiskToDev $1 $2` || return $?
# Elección del tipo de partición.
ID=$(ogFsToId "$3")
-[ -n "$ID" ] || ogRaiseError $OG_ERR_PARTITION "$TYPE" || return $?
+[ -n "$ID" ] || ogRaiseError $OG_ERR_PARTITION "$3" || return $?
echo -ne "t\n$2\n${ID}\nw\n" | fdisk $DISK 1>/dev/null 2>&1
}
diff --git a/client/engine/FileSystem.lib b/client/engine/FileSystem.lib
index f282e9c9..b54854b3 100755
--- a/client/engine/FileSystem.lib
+++ b/client/engine/FileSystem.lib
@@ -311,7 +311,12 @@ case "$ID" in
82) TYPE="LINUX-SWAP" ;;
83) TYPE="$(parted -sm $DISK print 2>/dev/null | \
awk -F: -v fs=$2 '{if ($1==fs) {print toupper($5)}}')"
- TYPE=${TYPE:-"EXT3"}
+ # Si el tipo no es válido para partición Linux, Ext3 por defecto.
+ case "$TYPE" in
+ EXT[234]|REISERFS|REISER4|BTRFS|JFS|XFS)
+ ;;
+ *) TYPE="EXT3" ;;
+ esac
;;
8e) TYPE="LINUX-LVM" ;;
a7) TYPE="CACHE" ;; # (compatibilidad con Brutalix)
@@ -353,7 +358,7 @@ fi
# Obtener partición.
PART="$(ogDiskToDev $1 $2)" || return $?
-echo $(mount | awk -v P=$PART '{if ($1==P) {print $3}}')
+mount | awk -v P=$PART '{if ($1==P) {print $3}}'
}
@@ -543,7 +548,10 @@ MNTDIR="$(ogGetMountPoint $1 $2)"
# Si no, montarla en un directorio de sistema
if [ -z "$MNTDIR" ]; then
# Error si la particion esta bloqueada.
- ogIsLocked $1 $2 && ogRaiseError $OG_ERR_LOCKED "$1 $2" && return $?
+ if ogIsLocked $1 $2; then
+ ogRaiseError $OG_ERR_LOCKED "$MSG_PARTITION, $1 $2"
+ return $?
+ fi
# Crear punto de montaje o enlace símbolico para Caché local.
MNTDIR=${PART/dev/mnt}
TYPE="$(ogGetFsType $1 $2)" || return $?
@@ -571,12 +579,14 @@ if [ -z "$MNTDIR" ]; then
return $OG_ERR_PARTITION
;;
esac
- $MOUNT $PARAMS $PART $MNTDIR || $MOUNT $PARAMS $PART $MNTDIR -o force,remove_hiberfile || ogRaiseError $OG_ERR_PARTITION "$1, $2, $TYPE" || return $?
- # linea temporal durante desarrollo para poder usar el cliente completo nfs y testeas nuevas herramientas.
+ $MOUNT $PARAMS $PART $MNTDIR 2>/dev/null || \
+ $MOUNT $PARAMS $PART $MNTDIR -o force,remove_hiberfile 2>/dev/null || \
+ ogRaiseError $OG_ERR_PARTITION "$1, $2, $TYPE" || return $?
+ # linea temporal durante desarrollo para poder usar el cliente completo nfs y testeas nuevas herramientas.
if grep -q nfsroot /proc/cmdline; then
- echo "$PART $MNTDIR" >> /etc/mtab
- fi
- # fin linea temporal.
+ echo "$PART $MNTDIR" >> /etc/mtab
+ fi
+ # fin linea temporal.
fi
echo $MNTDIR
}
@@ -619,6 +629,9 @@ echo $MNTDIR
#@version 0.9.2 - Añadir un 10% al tamaño mínimo requerido.
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2010-09-27
+#@version 1.0 - Deteccion automatica del tamaño minimo adecuado
+#@author Antonio J. Doblas Viso. Universidad de Malaga
+#@date 2011-02-24
#*/ ##
function ogReduceFs ()
{
@@ -644,9 +657,10 @@ case "$(ogGetFsType $1 $2)" in
# Ext2/3/4: Tamaño de los bloques del sistema de archivos
BLKS=$(tune2fs -l $PART | awk '/Block size/ {print int($3/512)}')
# Traduce el num. en sectores de 512B a tamano en MB.
- SIZE=$(resize2fs -P $PART 2>/dev/null | \
- awk -v B=$BLKS '/minimum size/ {print int($7*1.1*B/2048)}')
- resize2fs -fp $PART "${SIZE}M" &>/dev/null || ogRaiseError $OG_ERR_PARTITION "$1,$2" || return $?
+ #SIZE=$(resize2fs -P $PART 2>/dev/null | \
+ # awk -v B=$BLKS '/minimum size/ {print int($7*1.1*B/2048)}')
+ #resize2fs -fp $PART "${SIZE}M" &>/dev/null || ogRaiseError $OG_ERR_PARTITION "$1,$2" || return $?
+ resize2fs -fpM $PART &>/dev/null || ogRaiseError $OG_ERR_PARTITION "$1,$2" || return $?
;;
# REISERFS) # Usar "resize_reiserfs"
# ;;
@@ -654,19 +668,79 @@ case "$(ogGetFsType $1 $2)" in
ogDeleteFile $1 $2 pagefile.sys
ogDeleteFile $1 $2 hiberfile.sys
ogUnmount $1 $2 2>/dev/null
- # NTFS: Obtiene tamaño mínimo en MB.
- SIZE=$(ntfsresize -fi $PART | awk '/resize at/ {print int($8*1.1)}')
- ntfsresize -fns "${SIZE}M" $PART >/dev/null || ogRaiseError $OG_ERR_PARTITION "$1,$2" || return $?
- ntfsresize -fs "${SIZE}M" $PART <<<"y" >/dev/null || ogRaiseError $OG_ERR_PARTITION "$1,$2" || return $?
+ ## NTFS: Obtiene tamaño mínimo en MB.
+ #SIZE=$(ntfsresize -fi $PART | awk '/resize at/ {print int($8*1.1)}')
+ #ntfsresize -fns "${SIZE}M" $PART >/dev/null || ogRaiseError $OG_ERR_PARTITION "$1,$2" || return $?
+ #ntfsresize -fs "${SIZE}M" $PART <<<"y" >/dev/null || ogRaiseError $OG_ERR_PARTITION "$1,$2" || return $?
+ SIZE=$(ogReduceFsCheck $1 $2)
+ [ "$SIZE" == 0 ] && return 1
+ ntfsresize -fs "${SIZE}M" $PART <<<"y" || ogRaiseError $OG_ERR_PARTITION "error reduciendo $1,$2" || return $?
;;
*) ogRaiseError $OG_ERR_PARTITION "$1,$2"
return $? ;;
esac
#/// Mostrar nuevo tamaño en KB.
-echo $[SIZE*1024]
+#echo $[SIZE*1024]
+ogGetFsSize $1 $2
}
+function ogReduceFsCheck ()
+{
+#IMPORTANTE: retorna el valor en MB que podrá reducir el FS de una particion ntfs
+#valor devuelto 0, y codigo error 1. No se puede reducir, probar a reiniciar windows y chkdsk
+
+
+local PART RC MODE SIZE SIZEDATA
+[ $# == 2 ] && MODE=STAGE1
+[ $# == 3 ] && MODE=STAGE2
+[ -z $MODE ] && return
+
+PART="$(ogDiskToDev $1 $2)" || return $?
+ogUnmount $1 $2 &>/dev/null
+
+
+case $MODE in
+ STAGE1)
+ # echo "primera etapa $*"
+ ntfsresize -fi $PART &>/dev/null
+ RC=`echo $?`
+ # echo "RC es" $RC
+ if [ "$RC" -eq "1" ]
+ then
+ echo "0"
+ return 1
+ fi
+ SIZEDATA=$(ntfsresize -fi $PART | awk '/resize at/ {print $8+1000}')
+ # echo "salida" $?
+ # echo $SIZEDATA
+ ogReduceFsCheck $1 $2 $SIZEDATA
+ return 0
+ ;;
+ STAGE2)
+ # echo "segunda etapa $*"
+ SIZEDATA=$3
+ ntfsresize -fns "${SIZEDATA}M" $PART &>/tmp/ntfsresize.txt
+ RC=$?
+ if [ "$RC" == "0" ]
+ then
+ SIZE=$SIZEDATA
+ echo $SIZE
+ else
+ SIZEEXTRA=$(cat /tmp/ntfsresize.txt | awk '/Needed relocations :/ {print $0}' | awk -F"(" '{print $2}' | awk '{print $1+500}')
+ SIZE=$(expr $SIZEDATA + $SIZEEXTRA)
+ ogReduceFsCheck $1 $2 $SIZE
+ return 0
+ fi
+ ;;
+ *)
+ return
+ ;;
+esac
+}
+
+
+
#/**
# ogUnlock int_ndisk int_npartition
#@see ogUnlockPartition
@@ -757,15 +831,18 @@ MNTDIR="$(ogGetMountPoint $1 $2)"
# Si está montada, desmontarla.
if [ -n "$MNTDIR" ]; then
# Error si la particion está bloqueada.
- ogIsLocked $1 $2 && ogRaiseError $OG_ERR_LOCKED "$1 $2" && return $?
+ if ogIsLocked $1 $2; then
+ ogRaiseError $OG_ERR_LOCKED "$MSG_PARTITION $1, $2"
+ return $?
+ fi
# Desmontar y borrar punto de montaje.
- umount $PART 2>/dev/null || ogEcho warning "$FUNCNAME: $MSG_DONTUNMOUNT: \"$1,$2\""
+ umount $PART 2>/dev/null || ogEcho warning "$FUNCNAME: $MSG_DONTUNMOUNT: \"$1, $2\""
rmdir $MNTDIR 2>/dev/null || rm -f $MNTDIR 2>/dev/null
- # linea temporal durante desarrollo para testear nuevas herramientas con el cliente completo nfs
+ # linea temporal durante desarrollo para testear nuevas herramientas con el cliente completo nfs
if grep -q nfsroot /proc/cmdline; then
- cat /etc/mtab | grep -v $PART > /var/tmp/mtab.temporal && cp /var/tmp/mtab.temporal /var/tmp/mtab && rm /var/tmp/mtab.temporal
- fi
- # fin linea temporal.
+ grep -v $PART /etc/mtab > /var/tmp/mtab.temporal && cp /var/tmp/mtab.temporal /var/tmp/mtab && rm /var/tmp/mtab.temporal
+ fi
+ # fin linea temporal.
else
ogEcho warning "$MSG_DONTMOUNT: \"$1,$2\""
fi
@@ -832,14 +909,15 @@ then
particion=`ogMount $1 $2 ` #1>/dev/null 2>&1
if [ -z $3 ]
then
- unit=GB # s B kB MB GB TB %
+ unit=kB # s B kB MB GB TB %
else
unit=$3
fi
case $unit in
kB)
factor="1.024";
- valor=`df | grep $particion | awk -F" " '{size=$2*1.024; used=$3*1.024; free=$4*1.024; printf "%d:%d:%d", size,used,free}'`
+ # valor=`df | grep $particion | awk -F" " '{size=$2*1.024; used=$3*1.024; free=$4*1.024; printf "%d:%d:%d", size,used,free}'`
+ valor=`df | grep $particion | awk -F" " '{size=$2*1.024; used=$3*1.024; free=$4*1.024; printf "%d", size}'`
;;
MB)
factor="1.024/1000";
@@ -857,5 +935,79 @@ then
echo $valor
fi
+}
+
+function ogGetFreeSize () {
+if [ $# = 0 ]
+then
+ echo "sintaxis: ogGetFreeSize int_disco int_partition str_SizeOutput [ kB MB GB -default GB]-]" red
+ echo "devuelve int_size : int_data : int_free" red
+return
+fi
+if [ $# -ge 2 ]
+then
+ particion=`ogMount $1 $2 ` #1>/dev/null 2>&1
+ if [ -z $3 ]
+ then
+ unit=kB # s B kB MB GB TB %
+ else
+ unit=$3
+ fi
+ case $unit in
+ kB)
+ factor="1.024";
+ #valor=`df | grep $particion | awk -F" " '{size=$2*1.024; used=$3*1.024; free=$4*1.024; printf "%d:%d:%d", size,used,free}'`
+ valor=`df | grep $particion | awk -F" " '{size=$2*1.024; used=$3*1.024; free=$4*1.024; printf "%d", free}'`
+ ;;
+ MB)
+ factor="1.024/1000";
+ valor=`df | grep $particion | awk -F" " '{size=$2*1.024/1000; used=$3*1.024/1000; free=$4*1.024/1000; printf "%d:%d:%d", size,used,free}'`
+ ;;
+ GB)
+ factor="1.024/1000000";
+ valor=`df | grep $particion | awk -F" " '{size=$2*1.024/1000000; used=$3*1.024/1000000; free=$4*1.024/1000000; printf "%f:%f:%f", size,used,free}'`
+ ;;
+ esac
+ #echo $valor
+ #NumberRound $valor
+ #valor=`NumberRound $valor`;
+ ogUnmount $1 $2 1>/dev/null 2>&1
+ echo $valor
+
+fi
+}
+
+
+
+function ogDeletePartitionsLabels ()
+{
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME " \
+ "$FUNCNAME "
+ return
+fi
+rm /dev/disk/by-label/* 2>/dev/null # */ COMENTARIO OBLIGATORIO PARA DOXYGEN
+}
+
+function ogDeletePartitionTable ()
+{
+
+# Variables locales.
+local DISK
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME int_disk" \
+ "$FUNCNAME 1"
+ return
+fi
+# Error si no se reciben 1 parámetros.
+[ $# == 1 ] || ogRaiseError $OG_ERR_FORMAT || return $?
+
+# Obteniendo Identificador linux de la particion.
+DISK=$(ogDiskToDev $1) || return $?
+# Elimando las particiones con fdisk
+echo -ne "o\nw" | fdisk $DISK
}
diff --git a/client/engine/Image.lib b/client/engine/Image.lib
index 8163df3f..399e3da1 100755
--- a/client/engine/Image.lib
+++ b/client/engine/Image.lib
@@ -4,11 +4,227 @@
#@brief Librería o clase Image
#@class Image
#@brief Funciones para creación, restauración y clonación de imágenes de sistemas.
-#@version 0.9
+#@version 1.0
#@warning License: GNU GPLv3+
#*/
+
+function ogPartcloneSyntax ()
+{
+#TODO: comprobar como unico parametro particion /dev/sda1
+#COMPAR="partclone.$FS --clone --force --source $PART"
+COMPAR="-F -c -s "
+TYPE="$(ogGetFsType `ogDevToDisk $1`)"
+case "$TYPE" in
+ EXT[234])
+ echo "partclone.extfs $COMPAR $1"
+ ;;
+ REISERFS|XFS|JFS)
+ echo "partclone.dd $COMPAR $1"
+ ;;
+ NTFS|HNTFS)
+ echo "partclone.ntfs $COMPAR $1"
+ ;;
+ FAT16|FAT32|HFAT16|HFAT32)
+ echo "partclone.fat $COMPAR $1"
+ ;;
+ HFS|HFS+)
+ echo "partclone.hfsp $COMPAR $1"
+ ;;
+ *) ogRaiseError $OG_ERR_PARTITION "$1 $TYPE"
+ return $? ;;
+esac
+}
+
+#/**
+# ogCreateImageSyntax partition filename [tools] [levelcompresor]
+#@brief Genera una cadena de texto con la instrucción para crear un fichero imagen
+#@param 1 partition identificador linux del dispositivo particion.
+#@param 2 filename path absoluto del fichero imagen
+#@param 3 [opcional] str_tools herrmaienta de clonacion [partimage, partclone, ntfsclone]
+#@param 4 [opcional] str_levelcompresor nivel de compresion. [0 -none-, 1-lzop-, 2-gzip]
+#@return cadena con el comando que se debe ejecutar.
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@warning En pruebas iniciales
+#@TODO introducir las herramientas fsarchiver, dd
+#@TODO introducir el nivel de compresion gzip
+#@version 1.0 - Primeras pruebas
+#@author Antonio J. Doblas Viso. Universidad de Málaga
+#@date 2010/02/08
+#*/ ##
+
+function ogCreateImageSyntax()
+{
+local FS TOOL LEVEL PART IMGFILE BUFFER
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME partition filename [tool] [levelcompresor]" \
+ "$FUNCNAME /dev/sda1 /opt/opengnsys/images/prueba.img partclone lzop"
+ return
+fi
+# Error si no se reciben al menos los 2 parámetros para obtener el valor default.
+[ $# -lt 2 ] && ogRaiseError $OG_ERR_FORMAT && return $?
+
+
+PART=`echo $1`
+IMGFILE=`echo $2`
+
+case "$#" in
+ "2")
+ # Sintaxis por defecto OG PART IMGFILE
+ #echo "partimage -M -f3 -o -d -V0 -B gui=no -c -z1 save $PART $IMGFILE"
+ # Se comenta la instruccion que debería ir aqui
+ ogCreateImageSyntax $1 $2 partclone gzip
+ ;;
+ "4")
+ # Sintaxis condicionada.
+ # comprobamos parametro herramienta compresion.
+ TOOL=$(echo $3 | tr [A-Z] [a-z])
+ #ogCheckProgram $TOOL
+ #comprobar parámetro compresor.
+ LEVEL=$(echo $4 | tr [A-Z] [a-z])
+ #ogCheckProgram $LEVEL
+
+ # herramienta
+ case "$TOOL" in
+ "ntfsclone")
+ PARAM1="ntfsclone --force --save-image -O - $PART"
+ ;;
+ "partimage"|DEFAULT)
+ PARAM1="partimage -M -f3 -o -d -B gui=no -c -z0 --volume=0 save $PART stdout"
+ ;;
+ "partclone")
+ PARAM1=`ogPartcloneSyntax $PART` || ogRaiseError $OG_ERR_FORMAT || return $?
+ ;;
+ esac
+ # mbuffer
+ which mbuffer > /dev/null && PARAM2="| mbuffer -q -m 40M " || PARAM2=" "
+
+ # nivel de compresion
+ case "$LEVEL" in
+ "0"|"none")
+ PARAM3=" > "
+ ;;
+ "1"|"lzop")
+ PARAM3=" | lzop > "
+ ;;
+ "2"|"gzip")
+ PARAM3=" | gzip -c > "
+ ;;
+ "3"|"bzip")
+ PARAM3=" | bzip -c > "
+ ;;
+ esac
+ #sintaxis final.
+ echo "$PARAM1 $PARAM2 $PARAM3 $IMGFILE"
+ ;;
+esac
+}
+
+
+#/**
+# ogRestoreImageSyntax filename partition [tools] [levelcompresor]
+#@brief Genera una cadena de texto con la instrucción para crear un fichero imagen
+#@param 1 filename path absoluto del fichero imagen
+#@param 2 partition identificador linux del dispositivo particion.
+#@param 3 [opcional] str_tools herrmaienta de clonacion [partimage, partclone, ntfsclone]
+#@param 4 [opcional] str_levelcompresor nivel de compresion. [0 -none-, 1-lzop-, 2-gzip]
+#@return cadena con el comando que se debe ejecutar.
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@warning En pruebas iniciales
+#@TODO introducir las herramientas fsarchiver, dd
+#@TODO introducir el nivel de compresion gzip
+#@version 1.0 - Primeras pruebas
+#@author Antonio J. Doblas Viso. Universidad de Málaga
+#@date 2010/02/08
+#*/ ##
+
+ogRestoreImageSyntax ()
+{
+local TOOL COMPRESSOR LEVEL PART IMGFILE FILEHEAD INFOIMG
+
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME filename partition [tool] [levelcompresor]" \
+ "$FUNCNAME /opt/opengnsys/images/prueba.img /dev/sda1 [partclone] [lzop]"
+ return
+fi
+
+# Error si no se reciben al menos 2 parámetros.
+[ $# -lt 2 ] && ogRaiseError $OG_ERR_FORMAT && return $?
+
+# controlamos que el parametro 1 (imagen) es tipo file.
+[ -f $1 ] || ogRaiseError $OG_ERR_NOTFOUND "$1" || return $?
+
+# Si 2 parametros (file-origen-, device-destino-) = ogGetImageFull($1)
+if [ "$#" -eq 2 ]; then
+ IMGFILE=$1
+ PART=$2
+ INFOIMG=$(ogGetImageInfo $IMGFILE) || ogRaiseError $OG_ERR_NOTFOUND "No Image $1" || return $?
+ TOOL=`echo $INFOIMG | cut -f1 -d:`
+ COMPRESSOR=`echo $INFOIMG | cut -f2 -d:`
+ ogRestoreImageSyntax $IMGFILE $PART $TOOL $COMPRESSOR
+fi
+
+
+# Si cuatro parametros genera sintaxis
+if [ "$#" -eq 4 ]; then
+ IMGFILE=$1
+ PART=$2
+ # comprobamos parametro herramienta compresion.
+ TOOL=$(echo $3 | tr [A-Z] [a-z])
+ #ogCheckProgram $TOOL
+ #comprobar parámetro compresor.
+ LEVEL=$(echo $4 | tr [A-Z] [a-z])
+ #ogCheckProgram $LEVEL
+
+ case "$LEVEL" in
+ "0"|"none")
+ COMPRESSOR=" "
+ ;;
+ "1"|"lzop" | "LZOP")
+ COMPRESSOR=" lzop -dc "
+ ;;
+ "2"|"gzip" | "GZIP")
+ COMPRESSOR=" gzip -dc "
+ ;;
+ "3"|"bzip" | "BZIP" )
+ COMPRESSOR=" bzip -dc "
+ ;;
+ *)
+ ogRaiseError $OG_ERR_NOTFOUND "Compressor no valid $TOOL" || return $?
+ ;;
+ esac
+ #comprobar mbuffer
+ which mbuffer > /dev/null && MBUFFER="| mbuffer -q -m 40M " || MBUFFER=" "
+
+ case "$TOOL" in
+ "ntfsclone" | "NTFSCLONE")
+ TOOL="| ntfsclone --restore-image --overwrite $PART -"
+ ;;
+ "partimage"| "PARTIMAGE")
+ TOOL="| partimage -f3 -B gui=no restore $PART stdin"
+ ;;
+ "partclone" | "PARTCLONE")
+ # -C para que no compruebe tamaños
+ TOOL="| partclone.restore -o $PART"
+ ;;
+ *)
+ ogRaiseError $OG_ERR_NOTFOUND "Tools imaging no valid $TOOL" || return $?
+ ;;
+ esac
+
+ echo "$COMPRESSOR $IMGFILE $MBUFFER $TOOL"
+fi
+
+}
+
+
+
+
#/**
# ogCreateImage int_ndisk int_npartition str_repo path_image
#@brief Crea una imagen a partir de una partición.
@@ -46,7 +262,7 @@ if [ "$*" == "help" ]; then
return
fi
# Error si no se reciben 4 parámetros.
-[ $# -ne 4 ] && ogRaiseError $OG_ERR_FORMAT && return $?
+[ $# -lt 4 ] && ogRaiseError $OG_ERR_FORMAT && return $?
# Comprobar que no está bloqueada ni la partición, ni la imagen.
PART="$(ogDiskToDev $1 $2)" || return $?
@@ -54,8 +270,9 @@ if ogIsLocked $1 $2; then
ogRaiseError $OG_ERR_LOCKED "$MSG_PARTITION $1, $2"
return $?
fi
-IMGTYPE="pgz" # Partclone / GZip
+IMGTYPE="img" # Extensión genérica de imágenes.
IMGDIR=$(ogGetParentPath "$3" "$4")
+
[ -n "$IMGDIR" ] || ogRaiseError $OG_ERR_NOTFOUND "$3 $(dirname $4)" || return $?
IMGFILE="$IMGDIR/$(basename "$4").$IMGTYPE"
if ogIsImageLocked "$IMGFILE"; then
@@ -69,22 +286,10 @@ ogLockImage "$3" "$4.$IMGTYPE" || return $?
# Crear Imagen.
trap "ogUnlock $1 $2; ogUnlockImage "$3" "$4.$IMGTYPE"; rm -f $IMGFILE" 1 2 3 6 9
-TYPE="$(ogGetFsType $1 $2)"
-case "$TYPE" in
- EXT[234])
- PROGRAM=partclone.extfs ;;
- REISERFS|XFS|JFS)
- PROGRAM=partclone.dd ;;
- NTFS|HNTFS)
- PROGRAM=partclone.ntfs ;;
- FAT16|FAT32|HFAT16|HFAT32)
- PROGRAM=partclone.fat ;;
- HFS|HFS+)
- PROGRAM=partclone.hfsp ;;
- *) ogRaiseError $OG_ERR_PARTITION "$1 $2 $TYPE"
- return $? ;;
-esac
-$PROGRAM -c -C -F -s $PART | mbuffer -q -m 70% | gzip -c > "$IMGFILE"
+#Solicitamos la generación de la instruccion a ejecutar
+PROGRAM=`ogCreateImageSyntax $PART $IMGFILE $5 $6`
+echo $PROGRAM
+eval $PROGRAM
# Controlar salida de error y desbloquear partición.
ERRCODE=$?
@@ -100,102 +305,97 @@ return $ERRCODE
#/**
-# ogGetImageFs str_repo path_image
-#@brief Devuelve el tipo de sistema de archivos almacenado en un fichero de imagen.
-#@param str_repo repositorio de imágenes o caché local
-#@param path_image camino de la imagen
-#@return str_imgtype - mnemónico del tipo de sistema de archivos
-#@exception OG_ERR_FORMAT formato incorrecto.
-#@exception OG_ERR_NOTFOUND fichero de imagen no encontrado.
-#@todo Comprobar salidas para todos los tipos de sistemas de archivos.
-#/**
-function ogGetImageFs ()
+# ogCreateMbrImage int_ndisk str_repo path_image
+#@brief Crea una imagen a partir del sector de arranque de un disco.
+#@param int_ndisk nº de orden del disco
+#@param str_repo repositorio de imágenes (remoto o caché local)
+#@param path_image camino de la imagen (sin extensión)
+#@return (nada, por determinar)
+#@note repo = { REPO, CACHE }
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@exception OG_ERR_NOTFOUND fichero o dispositivo no encontrado.
+#@exception OG_ERR_IMAGE error al crear la imagen del sistema.
+#@version 0.9 - Versión en pruebas para OpenGNSys
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2010/01/12
+#@version 1.0 - Adaptación a OpenGnSys 1.0
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2011/03/10
+#*/ ##
+function ogCreateMbrImage ()
{
-local IMGFILE IMGTYPE
-IMGTYPE=$(ogGetImageType "$1" "$2")
-IMGFILE=$(ogGetPath "$1" "$2.$IMGTYPE") || return $?
-[ -r "$IMGFILE" ] || ogRaiseError OG_ERR_NOTFOUND "$IMGFILE" || return $?
-case "$IMGTYPE" in
- img) # Partimage.
- partimage -B gui=no imginfo "$IMGFILE" 2>&1 | \
- awk '/^Filesystem/ {sub(/\.\.+/," "); if ($2=="ntfs") print NTFS;
- else { sub(/fs$/,""); print toupper($2);} }'
- ;;
- pgz) # Partclone / GZip
- gzip -dc "$IMGFILE" | partclone.chkimg -C -s - 2>&1 | \
- awk '/^File system/ {if ($2=="EXTFS") print "EXT3"; else print $3;}'
- ;;
- *) # Error si el fichero de imagen no es accesible.
- ogRaiseError OG_ERR_NOTFOUND "$IMGFILE"
- return $? ;;
-esac
+# Variables locales
+local DISK IMGDIR IMGFILE
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk path_dir str_image" \
+ "$FUNCNAME 1 REPO /aula1/mbr"
+ return
+fi
+# Error si no se reciben 3 parámetros.
+[ $# -lt 3 ] && ogRaiseError $OG_ERR_FORMAT && return $?
+
+DISK=$(ogDiskToDev "$1") || return $?
+IMGDIR=$(ogGetParentPath "$2" "$3")
+[ -n "$IMGDIR" ] || ogRaiseError $OG_ERR_NOTFOUND "$2 $(dirname $3)" || return $?
+IMGFILE="$IMGDIR/$(basename "$3").mbr"
+
+# Crear imagen del MBR.
+dd if="$DISK" of="$IMGFILE" bs=512 count=1 || ogRaiseError $OG_ERR_IMAGE "$1 $IMGFILE" || return $?
}
-# ogGetImageSize str_repo path_image
-#@brief Devuelve el tamaño del sistema de archivos almacenado en un fichero de imagen.
-#@param str_repo repositorio de imágenes o caché local
-#@param path_image camino de la imagen
-#@return int_size - tamaño (en KB)
-#@exception OG_ERR_FORMAT formato incorrecto.
-#@exception OG_ERR_NOTFOUND fichero de imagen no encontrado.
-#*/
-#@warning En pruebas iniciales
-#@todo Definición de parámetros y salidas.
-#@version 0.1 - Primera versión muy en pruebas para OpenGNSys
-#@author Ramon Gomez, ETSII Universidad de Sevilla
-#@date 2009/09/11
+#/**
+# ogCreateBootLoaderImage int_ndisk str_repo path_image
+#@brief Crea una imagen del boot loader a partir del sector de arranque de un disco.
+#@param int_ndisk nº de orden del disco
+#@param str_repo repositorio de imágenes (remoto o caché local)
+#@param path_image camino de la imagen (sin extensión)
+#@return (nada, por determinar)
+#@note repo = { REPO, CACHE }
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@exception OG_ERR_NOTFOUND fichero o dispositivo no encontrado.
+#@exception OG_ERR_IMAGE error al crear la imagen del sistema.
+#@version 1.0 - Adaptacion de ogCreateMbrImage para guardar solo el Boot Loader
+#@author Juan Carlos Xifre, SICUZ Universidad de Zaragoza
+#@date 2011/03/21
#*/ ##
-function ogGetImageSize ()
+function ogCreateBootLoaderImage ()
{
# Variables locales
-local IMGFILE IMGTYPE
-
+local DISK IMGDIR IMGFILE
# Si se solicita, mostrar ayuda.
if [ "$*" == "help" ]; then
- ogHelp "$FUNCNAME" "$FUNCNAME path_dir str_image int_ndisk int_npart" \
- "$FUNCNAME 1 1 REPO /aula1/winxp ==> 5642158"
+ ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk path_dir str_image" \
+ "$FUNCNAME 1 REPO /aula1/mbr"
return
fi
-# Error si no se reciben menos de 2 parámetros.
-[ $# -ne 2 ] && ogRaiseError $OG_ERR_FORMAT && return $?
-# Devuelve el tamaño de la imagen en KB.
-IMGTYPE=$(ogGetImageType "$1" "$2")
-IMGFILE=$(ogGetPath "$1" "$2.$IMGTYPE")
-case "$IMGTYPE" in
- img) # Partimage.
- partimage -B gui=no imginfo "$IMGFILE" 2>&1 | \
- awk '/Partition size/ {sub(/\.\.+/," "); ps=$3} END {print ps*1024*1024;}'
- ;;
- pgz) # Partclone / GZip
- gzip -dc "$IMGFILE" | partclone.chkimg -C -s - 2>&1 | \
- awk -F: '/Block size/ {bs=$2} /Used block/ {ub=$2} END {print bs*ub/1024}'
- ;;
- *) # Error si el fichero de imagen no es accesible.
- ogRaiseError OG_ERR_NOTFOUND "$IMGFILE"
- return $? ;;
-esac
-}
+# Error si no se reciben 3 parámetros.
+[ $# -lt 3 ] && ogRaiseError $OG_ERR_FORMAT && return $?
+DISK=$(ogDiskToDev "$1") || return $?
+IMGDIR=$(ogGetParentPath "$2" "$3")
+[ -n "$IMGDIR" ] || ogRaiseError $OG_ERR_NOTFOUND "$2 $(dirname $3)" || return $?
+IMGFILE="$IMGDIR/$(basename "$3").mbr"
-#### PRUEBAS
-# Obtener tipo de imagen
-function ogGetImageType ()
-{
-local IMGFILE IMGTYPE EXT
-for EXT in img pgz; do
- IMGFILE=$(ogGetPath "$1" "$2.$EXT")
- [ -r "$IMGFILE" ] && IMGTYPE="$EXT"
-done
-echo $IMGTYPE
+# Crear imagen del Boot Loader dentro del MBR.
+dd if="$DISK" of="$IMGFILE" bs=446 count=1 || ogRaiseError $OG_ERR_IMAGE "$1 $IMGFILE" || return $?
}
-# Comprobar si el fichero de bloqueo para una imagen.
+#/**
+# ogIsImageLocked [str_repo] path_image
+#@brief Comprueba si una imagen está bloqueada para uso exclusivo.
+#@param str_repo repositorio de imágenes (opcional)
+#@param path_image camino de la imagen (sin extensión)
+#@return Código de salida: 0 - sin bloquear, 1 - bloqueada.
+#@note repo = { REPO, CACHE }
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@version 1.0 - Adaptación a OpenGnSys 1.0
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2011/03/10
+#*/ ##
function ogIsImageLocked ()
{
-# Variables locales
-local IMGDIR
-
# Si se solicita, mostrar ayuda.
if [ "$*" == "help" ]; then
ogHelp "$FUNCNAME" "$FUNCNAME [str_repo] path_image" \
@@ -203,11 +403,27 @@ if [ "$*" == "help" ]; then
"if $FUNCNAME REPO /aula1/winxp.img; then ...; fi"
return
fi
+# Error si no se reciben 1 o 2 parámetros.
+[ $# -lt 1 -o $# -gt 2 ] && ogRaiseError $OG_ERR_FORMAT && return $?
+
# Comprobar si existe el fichero de bloqueo.
test -n "$(ogGetPath $@.lock)"
}
-# Bloquear imagen para creación.
+
+#/**
+# ogLockImage [str_repo] path_image
+#@brief Bloquea una imagen para uso exclusivo.
+#@param str_repo repositorio de imágenes (opcional)
+#@param path_image camino de la imagen (sin extensión)
+#@return Nada.
+#@note Se genera un fichero con extensión .lock
+#@note repo = { REPO, CACHE }
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@version 1.0 - Adaptación a OpenGnSys 1.0
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2011/03/10
+#*/ ##
function ogLockImage ()
{
# Variables locales
@@ -228,24 +444,6 @@ IMGDIR=$(ogGetParentPath $@) || return $?
touch $IMGDIR/$(basename "${!#}").lock
}
-# Desbloquear imagen (borrar fichero de bloqueo).
-function ogUnlockImage ()
-{
-# Variables locales
-local IMGDIR
-
-# Si se solicita, mostrar ayuda.
-if [ "$*" == "help" ]; then
- ogHelp "$FUNCNAME" "$FUNCNAME [str_repo] path_image" \
- "$FUNCNAME /opt/opengnsys/images/aula1/winxp.img" \
- "$FUNCNAME REPO /aula1/winxp.img"
- return
-fi
-# Error si no se reciben 1 o 2 parámetros.
-[ $# -lt 1 -o $# -gt 2 ] && ogRaiseError $OG_ERR_FORMAT && return $?
-# Borrar fichero de bloqueo para la imagen.
-rm -f $(ogGetPath $@.lock)
-}
#/**
# ogRestoreImage str_repo path_image int_ndisk int_npartition
@@ -284,7 +482,8 @@ fi
[ $# -lt 4 ] && ogRaiseError $OG_ERR_FORMAT && return $?
# Procesar parámetros.
PART="$(ogDiskToDev "$3" "$4")" || return $?
-IMGTYPE=$(ogGetImageType "$1" "$2")
+#IMGTYPE=$(ogGetImageType "$1" "$2")
+IMGTYPE=img
IMGFILE=$(ogGetPath "$1" "$2.$IMGTYPE")
[ -r "$IMGFILE" ] || ogRaiseError OG_ERR_NOTFOUND "$IMGFILE" || return $?
# Error si la imagen no cabe en la particion.
@@ -312,18 +511,11 @@ trap "ogUnlock $3 $4" 1 2 3 6 9
# Restaurar según el tipo de imagen.
# Atención: no se comprueba el tipo de sistema de archivos.
# Atención: no se comprueba incongruencia entre partición e imagen.
-#FSTYPE="$(ogGetFsType $3 $4)"
-case "$IMGTYPE" in
- img) # Partimage
- partimage -M -f3 -o -d -V0 -B gui=no -c -z1 --volume=0 restore $PART "$IMGFILE"
- ;;
- pgz) # Partclone / GZip
- gzip -dc "$IMGFILE" | mbuffer -q -m 70% | partclone.restore -C -F -o "$PART"
- ;;
- *) # Error si imagen no accesible o de tipo desconocido.
- ogRaiseError $OG_ERR_FORMAT
- return $? ;;
-esac
+#Solicitamos la generación de la instruccion a ejecutar
+PROGRAM=`ogRestoreImageSyntax $IMGFILE $PART`
+echo $PROGRAM
+eval $PROGRAM
+
ERRCODE=$?
if [ $ERRCODE != 0 ]; then
ogRaiseError $OG_ERR_IMAGE "$IMGFILE, $3, $4"
@@ -333,125 +525,324 @@ return $ERRCODE
}
-function ogCreateImageFromPartition () {
-#/** @function CreateImageFromPartition: @brief Crea una imagen de la particion indicada, utilizando el programa definido en las variable $CloneImageNTFS y $CloneImageEXT23
-#@param $1 int DiskEAC
-#@param $2 int_PartitionEAC
-#@param $3 str_Repositorio ......... parametro pasado a ConectToRepo, admite $REPO $CACHE str_IP_servidorAlterno
-#@param $4 str_pathbase .............. Pathbase, directorio relativo, de la imagen, en EAC, se ha definido que todo repositorio comience por hdimages, pero puede variar, para adaparse a usb, o cualquier otro almacenamiento.
-#@param $5 str_NameImage.str_compresion .......... (como compresion admite gzip y lzop)
-#@param ejemplo: CreateImageFromPartition 1 1 $IP hdimages/pruebas/ base.gzip
-#@return la propia de la herramienta de clonacion partimage o ntfsclone
-#@return genera la imagen con el nombre (imagen.compresion), y se le a?ade un guion y el numero de particion(parametro $2).
-#@return Tambien se solicita al servidor EAC, la creaci?n del fichero meta torrent, que tendra el nombre tal base.gzip-1.torrent,
-#@return Tambien se crea el fichero base.gzip-1.mcast con informacion para su uso con multicast, tal base.gzip-1.mcast
-#@warning Salidas de errores no determinada
-#@attention
-#@note Pendiente: que admita como segundo parametro el valor 0 (para que identifique el MBR del disco)
-#@version 0.1 Date: 27/10/2008 Author Antonio J. Doblas Viso. Universidad de Malaga
-#*/
-if [ $# != 5 ]
+#/**
+# ogRestoreMbrImage str_repo path_image int_ndisk
+#@brief Restaura la imagen del sector de arranque de un disco.
+#@param str_repo repositorio de imágenes o caché local
+#@param path_image camino de la imagen
+#@param int_ndisk nº de orden del disco
+#@return (por determinar)
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@exception OG_ERR_NOTFOUND fichero de imagen o partición no detectados.
+#@exception OG_ERR_IMAGE error al restaurar la imagen del sistema.
+#@version 0.9 - Primera versión en pruebas.
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2010/01/12
+#@version 1.0 - Adaptación a OpenGnSys 1.0
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2011/03/10
+#*/ ##
+function ogRestoreMbrImage ()
+{
+# Variables locales
+local DISK IMGFILE
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME path_dir str_image int_ndisk" \
+ "$FUNCNAME REPO /aula1/mbr 1"
+ return
+fi
+# Error si no se reciben 3 parámetros.
+[ $# -lt 3 ] && ogRaiseError $OG_ERR_FORMAT && return $?
+# Procesar parámetros.
+DISK=$(ogDiskToDev "$3") || return $?
+IMGFILE=$(ogGetPath "$1" "$2.mbr") || return $?
+[ -r "$IMGFILE" ] || ogRaiseError OG_ERR_NOTFOUND "$IMGFILE" || return $?
+
+# Restaurar imagen del MBR.
+dd if="$IMGFILE" of="$DISK" bs=512 count=1 || ogRaiseError $OG_ERR_IMAGE "$1 $IMGFILE" || return $?
+}
+
+
+#/**
+# ogRestoreBootLoaderImage str_repo path_image int_ndisk
+#@brief Restaura la imagen del boot loader del sector de arranque de un disco.
+#@param str_repo repositorio de imágenes o caché local
+#@param path_image camino de la imagen
+#@param int_ndisk nº de orden del disco
+#@return (por determinar)
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@exception OG_ERR_NOTFOUND fichero de imagen o partición no detectados.
+#@exception OG_ERR_IMAGE error al restaurar la imagen del sistema.
+#@version 1.0 - Adaptacion de ogRestoreMbrImage para restaurar solo el Boot Loader
+#@author Juan Carlos Xifre, SICUZ Universidad de Zaragoza
+#@date 2011/03/21
+#*/ ##
+function ogRestoreBootLoaderImage ()
+{
+# Variables locales
+local DISK IMGFILE
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME path_dir str_image int_ndisk" \
+ "$FUNCNAME REPO /aula1/mbr 1"
+ return
+fi
+# Error si no se reciben 3 parámetros.
+[ $# -lt 3 ] && ogRaiseError $OG_ERR_FORMAT && return $?
+# Procesar parámetros.
+DISK=$(ogDiskToDev "$3") || return $?
+IMGFILE=$(ogGetPath "$1" "$2.mbr") || return $?
+[ -r "$IMGFILE" ] || ogRaiseError OG_ERR_NOTFOUND "$IMGFILE" || return $?
+
+# Restaurar imagen del MBR.
+dd if="$IMGFILE" of="$DISK" bs=446 count=1 || ogRaiseError $OG_ERR_IMAGE "$1 $IMGFILE" || return $?
+}
+
+#/**
+# ogUnlockImage [str_repo] path_image
+#@brief Desbloquea una imagen con uso exclusivo.
+#@param str_repo repositorio de imágenes (opcional)
+#@param path_image camino de la imagen (sin extensión)
+#@return Nada.
+#@note repo = { REPO, CACHE }
+#@note Se elimina el fichero de bloqueo con extensión .lock
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@version 1.0 - Adaptación a OpenGnSys 1.0
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2011/03/10
+#*/ ##
+function ogUnlockImage ()
+{
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME [str_repo] path_image" \
+ "$FUNCNAME /opt/opengnsys/images/aula1/winxp.img" \
+ "$FUNCNAME REPO /aula1/winxp.img"
+ return
+fi
+# Error si no se reciben 1 o 2 parámetros.
+[ $# -lt 1 -o $# -gt 2 ] && ogRaiseError $OG_ERR_FORMAT && return $?
+
+# Borrar fichero de bloqueo para la imagen.
+rm -f $(ogGetPath $@.lock)
+}
+
+
+#/**
+# ogGetImageInfo filename
+#@brief muestra información sobre la imagen monolitica.
+#@param 1 filename path absoluto del fichero imagen
+#@return cadena compuesta por clonacion:compresor:sistemaarchivos:tamañoKB
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@exception OG_ERR_NOTFOUND fichero no encontrado.
+#@exception OG_ERR_IMAGE "Image format is not valid $IMGFILE"
+#@warning En pruebas iniciales
+#@TODO Definir sintaxis de salida (herramienta y compresor en minuscula)
+#@TODO Arreglar loop para ntfsclone
+#@TODO insertar parametros entrada tipo OG
+#@version 1.0 - Primeras pruebas
+#@author Antonio J. Doblas Viso. Universidad de Málaga
+#@date 2010/02/08
+#*/ ##
+
+function ogGetImageInfo () {
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME filename " \
+ "$FUNCNAME /opt/opengnsys/images/prueba.img "
+ return
+fi
+
+# Error si no se reciben 1 parámetros.
+[ $# == 1 ] || ogRaiseError $OG_ERR_FORMAT || return $?
+
+#comprobando que el parametro uno es un file.
+[ -f $1 ] || ogRaiseError $OG_ERR_NOTFOUND "$1" || return $?
+
+local TOOLS COMPRESSOR IMGFILE FILEHEAD FS SIZE SIZEFACTOR PARTIMAGEINFO PARTCLONEINFO NTFSCLONEINFO IMGDETECT
+IMGDETECT="FALSE"
+
+IMGFILE=$1
+FILEHEAD=/tmp/`basename $IMGFILE`.infohead
+COMPRESSOR=`file $IMGFILE | awk '{print $2}'`
+ogCheckStringInGroup "$COMPRESSOR" "gzip lzop" || ogRaiseError $OG_ERR_IMAGE "Image format is not valid $IMGFILE" || return $?
+$($COMPRESSOR -dc $IMGFILE 2>/dev/null | head > $FILEHEAD) || ogRaiseError $OG_ERR_IMAGE "Image format is not valid $IMGFILE" || return $?
+
+## buscando Primera opción.
+if [ "$IMGDETECT" == "FALSE" ]
+then
+ PARTCLONEINFO=$(partclone.info $FILEHEAD 2>&1)
+ if `echo $PARTCLONEINFO | grep size > /dev/null`
+ then
+ TOOLS=PARTCLONE
+ FS=$(echo $PARTCLONEINFO | awk '{gsub(/\: /,"\n"); print toupper($8);}')
+ echo $PARTCLONEINFO | grep GB > /dev/null && SIZEFACTOR=1048576 || SIZEFACTOR=1024
+ SIZE=$(echo $PARTCLONEINFO | awk -v FACTOR=$SIZEFACTOR '{gsub(/\: /,"\n"); printf "%d\n", $11*FACTOR;}')
+ IMGDETECT="TRUE"
+ fi
+fi
+#buscando segunda opcion.
+if [ "$IMGDETECT" == "FALSE" -a ! -f /dev/loop2 ]
+then
+ cat $FILEHEAD | grep -w ntfsclone-image > /dev/null && NTFSCLONEINFO=$(cat $FILEHEAD | ntfsclone --restore --overwrite /dev/loop2 - 2>&1)
+ if `echo $NTFSCLONEINFO | grep ntfsclone > /dev/null`
+ then
+ TOOLS=NTFSCLONE
+ SIZE=$(echo $NTFSCLONEINFO | awk '{gsub(/\(|\)|\./,""); printf "%d\n",$17/1000;}')
+ FS=NTFS
+ IMGDETECT="TRUE"
+ fi
+fi
+## buscando Tercer opción.
+if [ "$IMGDETECT" == "FALSE" ]
then
- echo "sintaxis: CreateImageFromPartition <ndisco> <nparticion> <iprespositorio> <pathbase> <nombreimagen.compresion>"
- echo "ejemplo: CreateImageFromPartition 1 1 \$IP images/pruebas/ base.gzip"
- echo " en iprepositorio admite cualquier ip de un servdior EAC, se llama a la funcion MountRepo ip"
+ PARTIMAGEINFO=$(partimage -B gui=no imginfo "$FILEHEAD" 2>&1)
+ if `echo $PARTIMAGEINFO | grep Partition > /dev/null`
+ then
+ TOOLS=PARTIMAGE
+ FS=$(echo $PARTIMAGEINFO | awk '{gsub(/ /,"\n"); print $17;}' | awk '{sub(/\.\.+/," "); print toupper($2)}')
+ SIZE=$( echo $PARTIMAGEINFO | awk '{gsub(/ /,"\n"); print $36;}' | awk '{sub(/\.\.+/," "); printf "%d\n",$2*1024*1024;}')
+ IMGDETECT="TRUE"
+ fi
fi
-if [ $# = 5 ]
+#comprobamos valores #Chequeamos los valores devueltos.
+if [ -z "$TOOLS" -o -z "$COMPRESSOR" -o "$IMGDETECT" == "FALSE" ]
then
- CloneImageNTFS="${CLONETOOLSNTFS:-partimage}"
- CloneImageEXT23="${CLONETOOLSEXT:-partimage}"
- CompresionImage="${CLONETOOLSCOMPRESSOR:-gzip}"
-
- disco=`ogDiskToDev $1 $2`
- ogUnmountPartition $1 $2
- fs=`ogGetFsType $1 $2`
-
- echo determinando tipo de Sistema Operativo y consulando la variable global CloneImageNTFS: $fs
- case $fs in
- "NTFS")
- case $CloneImageNTFS in
- "ntfsclone")
- #imaged="ntfsclone --force --save-image -O - $disco | "
- imaged="ntfsclone --force --save-image -O - $disco"
- program=ntfsclone
- ;;
- "partimage")
- #imaged="partimage -M -f3 -o -d -B gui=no -c -z0 --volume=0 save $disco stdout |"
- imaged="partimage -M -f3 -o -d -B gui=no -c -z0 --volume=0 save $disco stdout"
- program=partimage
- ;;
- "partimage-ng")
- #echo "partimage-ng"
- #imaged="partimage-ng save $disco stdout"
- program=partimage-ng
- ;;
- "partclone")
- #echo "partclone"
- #imaged="partclone.ntfs -c -F -s $disco | "
- imaged="partclone.ntfs -c -F -s $disco"
- program=partclone.ntfs
- #zcat ~/image_sda1.pcl.gz | partclone.ext4 -r -o /dev/sda1
- ;;
- esac
- ;;
- EXT[234]|REISERFS)
- case $CloneImageEXT23 in
- "partimage")
- imaged="partimage -M -f3 -o -d -B gui=no -c -z0 --volume=0 save $disco stdout"
- program=partimage
- ;;
- "partimage-ng")
- #echo "partimage-ng"
- imaged="partimage-ng save $disco stdout"
- program=partimage-ng
- ;;
- "partclone")
- echo "partclone"
- imaged="partclone.ext3 -c -F -C -s $disco"
- program=partclone.ext3
- #zcat ~/image_sda1.pcl.gz | partclone.ext4 -r -o /dev/sda1
- ;;
- esac
- ;;
- esac
+ ogRaiseError $OG_ERR_IMAGE "Image format is not valid $IMGFILE" || return $?
+else
+ COMPRESSOR=$(echo $COMPRESSOR | tr [a-z] [A-Z])
+ echo $TOOLS:$COMPRESSOR:$FS:$SIZE
+fi
+}
- # utilizando mbuffer para reducir posibles errores de acceso a discos
- imaged="$imaged | mbuffer -m 70%"
- #metodo de compresion.
- case $CompresionImage in
- "gzip")
- comando="$imaged | gzip -c >"
- ;;
- "lzop")
- comando="$imaged | lzop >"
- ;;
- esac
+function ogGetImageProgram ()
+{
+local IMGFILE
+IMGFILE=$(ogGetPath "$1" "$2.img") || return $?
+[ -r "$IMGFILE" ] || ogRaiseError OG_ERR_NOTFOUND "$IMGFILE" || return $?
+ogGetImageInfo $IMGFILE | awk -F: '{print $1}'
+
+}
+
+function ogGetImageCompressor ()
+{
+local IMGFILE
+IMGFILE=$(ogGetPath "$1" "$2.img") || return $?
+[ -r "$IMGFILE" ] || ogRaiseError OG_ERR_NOTFOUND "$IMGFILE" || return $?
+ogGetImageInfo $IMGFILE | awk -F: '{print $2}'
+}
- #. determnamos el fichero donde se almacenar? la image
- #camino=`ConnectToRepo $3 $4 $5`
- #MkdirPath $camino
- firstcamino=`ogNewPath $3 $4`
- camino=$firstcamino$5
- echo $camino
- sleep 1
-
- #preparamos y ejecutamos el comanod a realizar
- echo "Creando imagen particion $disco programa $program compresion $CompresionImage en el repositorio $3 como $4 $5 - $2"
- comando="$comando ${camino}-$2"
- echo "comando: $comando"
- echo $comando > /tmp/run.sh
- sh /tmp/run.sh
- unset comando
-
- #iniciamos la creacion del torrent
- echo "Iniciando la creacion del punto torrent con CreateTorrentFromImage ip=$3 path=$4 image=$5-$2" echo
- #CreateTorrentFromImage $3 $4 $5-$2
- # iniciacmos el putno mcast
- echo "creando un punto mcast ${camino}-$2.mcast"
- echo "program;$program" > ${camino}.mcast
- echo "compresion;$CompresionImage" >> ${camino}.mcast
- echo "fsimage;$fs" >> ${camino}.mcast
-
- #UmountRepo $3
+function ogGetImageType ()
+{
+local IMGFILE
+IMGFILE=$(ogGetPath "$1" "$2.img") || return $?
+[ -r "$IMGFILE" ] || ogRaiseError OG_ERR_NOTFOUND "$IMGFILE" || return $?
+#partimage -B gui=no imginfo "$IMGFILE" 2>&1 | \
+# awk '/^Filesystem/ {sub(/\.\.+/," "); sub(/fs$/,""); print toupper($2);}'
+ogGetImageInfo $IMGFILE | awk -F: '{print $3}'
+
+}
+
+function ogGetImageSize ()
+{
+# Variables locales
+local IMGFILE
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME testing path_dir str_image int_ndisk int_npart" \
+ "$FUNCNAME 1 1 REPO /aula1/winxp ==> 5642158"
+ return
fi
+# Error si no se reciben menos de 2 parámetros.
+[ $# -lt 2 ] && ogRaiseError $OG_ERR_FORMAT && return $?
+# Error si el fichero de imagen no es accesible.
+IMGFILE=$(ogGetPath "$1" "$2.img") || return $?
+[ -r "$IMGFILE" ] || ogRaiseError OG_ERR_NOTFOUND "$IMGFILE" || return $?
+
+# Devuelve el tamaño de la imagen en KB.
+#partimage -B gui=no imginfo "$IMGFILE" 2>&1 | \
+# awk '/Partition size/ {sub(/\.\.+/," "); printf "%d\n",$3*1024*1024;}'
+ogGetImageInfo $IMGFILE | awk -F: '{print $4}'
}
+
+
+#/**
+# ogGetImageFs str_repo path_image
+#@brief Devuelve el tipo de sistema de archivos almacenado en un fichero de imagen.
+#@param str_repo repositorio de imágenes o caché local
+#@param path_image camino de la imagen
+#@return str_imgtype - mnemónico del tipo de sistema de archivos
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@exception OG_ERR_NOTFOUND fichero de imagen no encontrado.
+#@todo Comprobar salidas para todos los tipos de sistemas de archivos.
+#/**
+function ogGetImageFsUS ()
+{
+local IMGFILE IMGTYPE
+IMGTYPE=$(ogGetImageType "$1" "$2")
+IMGFILE=$(ogGetPath "$1" "$2.$IMGTYPE") || return $?
+[ -r "$IMGFILE" ] || ogRaiseError OG_ERR_NOTFOUND "$IMGFILE" || return $?
+case "$IMGTYPE" in
+ img) # Partimage.
+ partimage -B gui=no imginfo "$IMGFILE" 2>&1 | \
+ awk '/^Filesystem/ {sub(/\.\.+/," "); if ($2=="ntfs") print NTFS;
+ else { sub(/fs$/,""); print toupper($2);} }'
+ ;;
+ pgz) # Partclone / GZip
+ gzip -dc "$IMGFILE" | partclone.chkimg -C -s - 2>&1 | \
+ awk '/^File system/ {if ($2=="EXTFS") print "EXT3"; else print $3;}'
+ ;;
+ *) # Error si el fichero de imagen no es accesible.
+ ogRaiseError OG_ERR_NOTFOUND "$IMGFILE"
+ return $? ;;
+esac
+}
+
+
+# ogGetImageSize str_repo path_image
+#@brief Devuelve el tamaño del sistema de archivos almacenado en un fichero de imagen.
+#@param str_repo repositorio de imágenes o caché local
+#@param path_image camino de la imagen
+#@return int_size - tamaño (en KB)
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@exception OG_ERR_NOTFOUND fichero de imagen no encontrado.
+#*/
+#@warning En pruebas iniciales
+#@todo Definición de parámetros y salidas.
+#@version 0.1 - Primera versión muy en pruebas para OpenGNSys
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2009/09/11
+#*/ ##
+function ogGetImageSizeUS ()
+{
+# Variables locales
+local IMGFILE IMGTYPE
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME path_dir str_image int_ndisk int_npart" \
+ "$FUNCNAME 1 1 REPO /aula1/winxp ==> 5642158"
+ return
+fi
+# Error si no se reciben menos de 2 parámetros.
+[ $# -ne 2 ] && ogRaiseError $OG_ERR_FORMAT && return $?
+# Devuelve el tamaño de la imagen en KB.
+IMGTYPE=$(ogGetImageType "$1" "$2")
+IMGFILE=$(ogGetPath "$1" "$2.$IMGTYPE")
+case "$IMGTYPE" in
+ img) # Partimage.
+ partimage -B gui=no imginfo "$IMGFILE" 2>&1 | \
+ awk '/Partition size/ {sub(/\.\.+/," "); ps=$3} END {print ps*1024*1024;}'
+ ;;
+ pgz) # Partclone / GZip
+ gzip -dc "$IMGFILE" | partclone.chkimg -C -s - 2>&1 | \
+ awk -F: '/Block size/ {bs=$2} /Used block/ {ub=$2} END {print bs*ub/1024}'
+ ;;
+ *) # Error si el fichero de imagen no es accesible.
+ ogRaiseError OG_ERR_NOTFOUND "$IMGFILE"
+ return $? ;;
+esac
+}
+
diff --git a/client/engine/Inventory.lib b/client/engine/Inventory.lib
index 7e731258..47ffd83d 100755
--- a/client/engine/Inventory.lib
+++ b/client/engine/Inventory.lib
@@ -242,7 +242,6 @@ case "$TYPE" in
esac
}
-function ogInfoCache () {
#/** @function ogInfoCache: @brief muestra la informacion de la CACHE.
#@param sin parametros
#@return texto que se almacena en $IP.-InfoCache. punto_montaje, tama?oTotal, TamanioOcupado, TaminioLibre, imagenes dentro de la cahce
@@ -251,6 +250,7 @@ function ogInfoCache () {
#@attention
#@version 0.1 Date: 27/10/2008 Author Antonio J. Doblas Viso. Universidad de Malaga
#*/
+function ogInfoCache () {
if ogMountCache
then
info=`df -h | grep $OGCAC`
diff --git a/client/engine/Net.lib b/client/engine/Net.lib
index 3bb03175..6ac5a94a 100755
--- a/client/engine/Net.lib
+++ b/client/engine/Net.lib
@@ -35,20 +35,47 @@ echo $HOST
#/**
+# ogGetNetInterface
+#@brief Muestra la interfaz de red del sistema
+#@return str_interfaz - interfaz de red
+#@version 1.0 - Integración OpenGnSys 0.10 Opengnsys 0.10-testing
+#@note Usa las variables utilizadas por el initrd "/etc/net-ethX.conf
+#@author Antonio J. Doblas Viso. Universidad de Malaga.
+#@date 2011-02-24
+#*/ ##
+function ogGetNetInterface ()
+{
+ echo $DEVICE
+
+}
+
+
+
+
+#/**
# ogGetIpAddress
#@brief Muestra la dirección IP del sistema
#@return str_ip - Dirección IP
#@version 0.10 - Integración en OpenGnSys 0.10
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2010-02-11
+#@version 1.0 - Integración OpenGnSys 0.10 Opengnsys 0.10-testing
+#@note Usa las variables utilizadas por el initrd "/etc/net-ethX.conf
+#@author Antonio J. Doblas Viso. Universidad de Malaga.
+#@date 2011-02-24
#*/ ##
function ogGetIpAddress ()
{
local IP
-# Obtener direcciones IP. /* (comentario para Doxygen)
-IP=$(ip address show | awk '$2!~/lo/ { readline; if ($1~/inet$/) {sub (/\/.*/, ""); printf ("%s ", $2)}}')
-# Mostrar sólo la primera. (comentario para Doxygen) */
-echo ${IP%% *}
+if [ -n $IPV4ADDR ]
+then
+ echo $IPV4ADDR
+else
+ # Obtener direcciones IP. /* (comentario para Doxygen)
+ IP=$(ip address show | awk '$2!~/lo/ { readline; if ($1~/inet$/) {sub (/\/.*/, ""); printf ("%s ", $2)}}')
+ # Mostrar sólo la primera. (comentario para Doxygen) */
+ echo ${IP%% *}
+fi
}
@@ -77,11 +104,20 @@ echo ${MAC%% *}
#@version 0.10 - Integración en OpenGnSys 0.10
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2011-01-13
+#@version 1.0 - Integración OpenGnSys 0.10 Opengnsys 0.10-testing
+#@note Comprobacion segun protocolo de conexion al Repo
+#@author Antonio J. Doblas Viso. Universidad de Malaga.
+#@date 2011-02-24
#*/ ##
function ogGetRepoIp ()
{
-# Obtener direcciones IP.
-[ -n "$OGIMG" ] && mount | grep " $OGIMG .* nfs " | cut -f1 -d:
+# Obtener direcciones IP, segun el protocolo de montaje
+if [ -n "$OGIMG" ]; then
+ case "$ogprotocol" in
+ nfs) mount | grep " on $OGIMG " | cut -f1 -d: ;;
+ smb) mount | grep " on $OGIMG " | cut -f3 -d/ ;;
+ esac
+fi
}
@@ -92,11 +128,19 @@ function ogGetRepoIp ()
#@version 0.10 - Integración en OpenGnSys 0.10
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2011-01-13
+#@version 1.0 - Integración OpenGnSys 0.10 Opengnsys 0.10-testing
+#@note Comprobacion segun protocolo de conexion al Repo
+#@author Antonio J. Doblas Viso. Universidad de Malaga.
+#@date 2011-02-24
#*/ ##
function ogGetServerIp ()
{
# Obtener direcciones IP.
-[ -n "$OPENGNSYS" ] && mount | grep " $OPENGNSYS .* nfs " | cut -f1 -d:
+if [ -n "$PENGNSYS" ]; then
+ case "$ogprotocol" in
+ nfs) mount | grep " on $OPENGNSYS " | cut -f1 -d: ;;
+ smb) mount | grep " on $OPENGNSYS " | cut -f3 -d/ ;;
+ esac
+fi
}
-
diff --git a/client/engine/Protocol.lib b/client/engine/Protocol.lib
index e1335bc1..96073ad2 100755
--- a/client/engine/Protocol.lib
+++ b/client/engine/Protocol.lib
@@ -8,131 +8,218 @@
#@warning License: GNU GPLv3+
#*/
-
#/**
-# ogCheckStringInGroup
-#@brief Función para determinar si el elemento pertenece a un conjunto
-#@param 1 elemento a comprobar
-#@param 2 grupo de elementos para comprobar tipo "valor1 valor2 valor3"
-#@return 0 si pertenece al grupo
-#@return 1 si NO pertenece al grupo
+# ogUcastSyntax
+#@brief Función para generar la instrucción de ejucucion la transferencia de datos unicast
+#@param 1 Tipo de operación [ SENDPARTITION RECEIVERPARTITION SENDFILE RECEIVERFILE ]
+#@param 2 Sesion Unicast
+#@param 3 Dispositivo (opción PARTITION) o fichero(opción FILE) que será enviado.
+#@param 4 Tools de clonación (opcion PARTITION)
+#@param 5 Tools de compresion (opcion PARTITION)
+#@return instrucción para ser ejecutada.
#@exception OG_ERR_FORMAT formato incorrecto.
-#@note
-#@todo
-#@version 0.91 - Definición de
+#@note Requisitos: mbuffer
+#@todo
+#@version 1.0 -
#@author Antonio Doblas Viso, Universidad de Málaga
-#@date 2010/05/09
+#@date 2011/03/09
#*/ ##
#/**
-ogCheckStringInGroup ()
+#
+
+##################### FUNCIONES UNICAST ################
+
+function ogUcastSyntax ()
{
+
+local PARM SESSION SESSIONPARM MODE PORTBASE PERROR
+local ADDRESS
+local TOOL LEVEL DEVICE MBUFFER SYNTAXSERVER SYNTAXCLIENT
+
# Si se solicita, mostrar ayuda.
-if [ "$*" == "help" ]; then
- ogHelp "$FUNCNAME str_elemento str_grupo" \
- "$FUNCNAME full-duplex \"full-duplex half-duplex broadcast\" "
+if [ "$*" == "help" -o "$2" == "help" ]; then
+ ogHelp "$FUNCNAME SENDPARTITION str_sessionSERVER str_device str_tools str_level" \
+ "$FUNCNAME RECEIVERPARTITION str_sessionCLIENT str_device str_tools str_level "\
+ "$FUNCNAME SENDFILE str_sessionSERVER str_file "\
+ "$FUNCNAME RECEIVERFILE str_sessionCLIENT str_file " \
+ "sessionServer syntax: portbase:ipCLIENT-1:ipCLIENT-2:ipCLIENT-N " \
+ "sessionServer example: 8000:172.17.36.11:172.17.36.12" \
+ "sessionClient syntax: portbase:ipMASTER " \
+ "sessionClient example: 8000:172.17.36.249 "
return
fi
+PERROR=0
+
+#TODO: controlar que mbuffer esta disponible para los clientes.
+
+
+# Error si no se reciben $PARM parámetros.
+echo "$1" | grep "PARTITION" > /dev/null && PARM=5 || PARM=3
+[ "$#" -eq "$PARM" ] || ogRaiseError $OG_ERR_FORMAT "sin parametros"|| return $?
+
+
+# 1er param check
+ogCheckStringInGroup "$1" "SENDPARTITION sendpartition RECEIVERPARTITION receiverpartition SENDFILE sendfile RECEIVERFILE receiverfile" || ogRaiseError $OG_ERR_FORMAT "1st param: $1" || PERROR=1 #return $?
+
+# 2º param check
+echo "$1" | grep "SEND" > /dev/null && MODE=server || MODE=client
+
+######### No controlamos el numero de elementos de la session unicast porque en el master es variable en numero
+#TODO: diferenciamos los paramatros especificos de la sessión unicast
+#SI: controlamos todos los parametros de la sessión unicast.
+#[ $MODE == "client" ] && SESSIONPARM=2 || SESSIONPARM=6
+OIFS=$IFS; IFS=':' ; SESSION=($2); IFS=$OIFS
+
+
+#[[ ${#SESSION[*]} == $SESSIONPARM ]] || ogRaiseError $OG_ERR_FORMAT "parametros session multicast no completa" || PERROR=2# return $?
+
+
+#controlamos el PORTBASE de la sesion. Comun.-
+PORTBASE=${SESSION[0]}
+ogCheckStringInGroup ${SESSION[0]} "8000 8001 8002 8003 8004 8005" || ogRaiseError $OG_ERR_FORMAT "McastSession portbase ${SESSION[0]}" || PERROR=3 #return $?
+
+if [ $MODE == "server" ]
+then
+ SIZEARRAY=${#SESSION[@]}
+ for (( i = 1 ; i < $SIZEARRAY ; i++ ))
+ do
+ ADDRESS="$ADDRESS -O ${SESSION[$i]}:$PORTBASE"
+ #echo " -O ${SESSION[$i]}:$PORTBASE"
+ done
+
+else
+ ADDRESS=${SESSION[1]}:${PORTBASE}
+fi
-# Error si no se recibe 2 parámetro.
-[ $# == 2 ] || ogRaiseError $OG_ERR_FORMAT || return $?
+#3er param check - que puede ser un dispositvo o un fichero.
+#ogGetPath "$3" > /dev/null || ogRaiseError $OG_ERR_NOTFOUND " device or file $3" || PERROR=9 #return $?
+DEVICE=$3
+#4 y 5 param check . solo si es sobre particiones.
+if [ "$PARM" == "5" ]
+then
+ # 4 param check
+ ogCheckStringInGroup "$4" "partclone partimage ntfsclone" || ogRaiseError $OG_ERR_NOTFOUND " herramienta $4 no soportada" || PERROR=10 #return $?
+ TOOL=$4
+ ogCheckStringInGroup "$5" "lzop gzip 0 1" || ogRaiseError $OG_ERR_NOTFOUND " compresor $5 no valido" || PERROR=11 #return $?
+ LEVEL=$5
+fi
-for i in `echo $2`
-do
- if [ "$1" == "$i" ]
- then
- return 0
- fi
-done
-return 1
-}
+[ "$PERROR" -gt "0" ] && return 1
+
+# Generamos la instrucción base de unicast -Envio,Recepcion-
+SYNTAXSERVER="mbuffer $ADDRESS"
+SYNTAXCLIENT="mbuffer -I $ADDRESS "
+
+
+case "$1" in
+SENDPARTITION)
+ PROG1=`ogCreateImageSyntax $DEVICE " " $TOOL $LEVEL | awk -F"|" '{print $1 "|" $3}' | tr -d ">"`
+ echo "$PROG1 | $SYNTAXSERVER"
+ ;;
+ RECEIVERPARTITION)
+ COMPRESSOR=`ogRestoreImageSyntax " " $DEVICE $TOOL $LEVEL | awk -F\| '{print $1}'`
+ TOOLS=`ogRestoreImageSyntax " " $DEVICE $TOOL $LEVEL | awk -F\| '{print $NF}'`
+ echo "$SYNTAXCLIENT | $COMPRESSOR | $TOOLS "
+ ;;
+ SENDFILE)
+ echo "$SYNTAXSERVER --file $3"
+ ;;
+ RECEIVERFILE)
+ echo "$SYNTAXCLIENT --file $3"
+ ;;
+ *)
+ ;;
+esac
+}
+
#/**
-# ogCheckStringInReg
-#@brief Función para determinar si el elemento contiene una "expresión regular"
-#@param 1 elemento a comprobar
-#@param 2 expresión regular"
-#@return 0 si coincide con la expresión
-#@return 1 si NO coincide con la expresión
-#@exception OG_ERR_FORMAT formato incorrecto.
-#@note
-#@todo
-#@version 0.91 - Definición de
-#@author Antonio Doblas Viso, Universidad de Málaga
-#@date 2010/05/09
+# ogUcastSendPartition
+#@brief Función para enviar el contenido de una partición a multiples particiones remotas usando UNICAST.
+#@param
+#@param
+#@param
+#@return
+#@exception
+#@note
+#@todo: ogIsLocked siempre devuelve 1. crear ticket
+#@version 0.1 - Integración para OpenGNSys.
+#@author
+#@date
#*/ ##
-#/**
-
-ogCheckStringInReg()
+ogUcastSendPartition ()
{
-local REG
+# Variables locales
+local PART COMMAND
# Si se solicita, mostrar ayuda.
if [ "$*" == "help" ]; then
- ogHelp "$FUNCNAME str_elemento str_expresión_regular" \
- "$FUNCNAME 50M \"^[0-9]{1,2}\M$\" "
+ ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npart SessionUNICAST-SERVER tools compresor" \
+ "$FUNCNAME 1 1 8000:172.17.36.11:172.17.36.12 partclone lzop"
return
fi
+# Error si no se reciben 5 parámetros.
+[ "$#" == 5 ] || ogRaiseError $OG_ERR_FORMAT || return $?
+#chequeamos la particion.
+PART=$(ogDiskToDev "$1" "$2") || return $?
-# Error si no se recibe 2 parámetro.
-[ $# == 2 ] || ogRaiseError $OG_ERR_FORMAT || return $?
-
-REG=$2
-[[ $1 =~ $REG ]] && return 0 || return 1
-}
+#ogIsLocked $1 $2 || ogRaiseError $OG_ERR_LOCKED "$1,$2" || return $?
+ogUnmount $1 $2
+#generamos la instrucción a ejecutar.
+COMMAND=`ogUcastSyntax SENDPARTITION "$3" $PART $4 $5`
+echo $COMMAND
+eval $COMMAND
+}
#/**
-# ogCheckIpAddress
-#@brief Función para determinar si una cadena es una dirección ipv4 válida
-#@param 1 string de la ip a comprobar
-#@return 0 si es una dirección válida
-#@return 1 si NO es una dirección válida
-#@exception OG_ERR_FORMAT formato incorrecto.
-#@note
-#@todo
-#@version 0.91 - Definición de
-#@author Antonio Doblas Viso, Universidad de Málaga
-#@date 2010/05/09
+# ogUcastReceiverPartition
+#@brief Función para recibir directamente en la partición el contenido de un fichero imagen remoto enviado por UNICAST.
+#@param
+#@param
+#@param
+#@return
+#@exception
+#@note
+#@todo:
+#@version 0.1 - Integración para OpenGNSys.
+#@author
+#@date
#*/ ##
-#/**
-ogCheckIpAddress()
+ogUcastReceiverPartition ()
{
-local REG IP arrIP
+# Variables locales
+local PART COMMAND
# Si se solicita, mostrar ayuda.
if [ "$*" == "help" ]; then
- ogHelp "$FUNCNAME str_IpAddressToCheck" \
- "$FUNCNAME 192.18.35.3"
+ ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npart SessionMulticastCLIENT tools compresor" \
+ "$FUNCNAME 1 1 8000:ipMASTER partclone lzop"
return
fi
+# Error si no se reciben 5 parámetros.
+[ "$#" == 5 ] || ogRaiseError $OG_ERR_FORMAT || return $?
+#chequeamos la particion.
+PART=$(ogDiskToDev "$1" "$2") || return $?
-# Error si no se recibe 1 parámetro.
-[ $# == 1 ] || ogRaiseError $OG_ERR_FORMAT || return $?
-
-
-IP=$1
-REG="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
-if [[ "$IP" =~ $REG ]]
-then
- OIFS=$IFS;
- IFS='.' ;
- arrIP=($IP)
- IFS=$OIFS
- if [[ ${arrIP[0]} -le 255 && ${arrIP[1]} -le 255 && ${arrIP[2]} -le 255 && ${arrIP[3]} -le 255 ]]
- then
- return 0
- fi
-fi
-return 1
+#ogIsLocked $1 $2 || ogRaiseError $OG_ERR_LOCKED "$1,$2" || return $?
+ogUnmount $1 $2
+
+#generamos la instrucción a ejecutar.
+COMMAND=`ogUcastSyntax RECEIVERPARTITION "$3" $PART $4 $5`
+echo $COMMAND
+eval $COMMAND
}
+
+
#/**
# ogMcastSyntax
#@brief Función para generar la instrucción de ejucción la transferencia de datos multicast
@@ -615,7 +702,7 @@ then
case "$MODE" in
peer|PEER)
echo "Donwloading Torrent as peer" ### echo "ctorrent -X 'sleep $TIME; kill -9 \$(pidof ctorrent)' -C 100 $SOURCE -s $TARGET -b ${SOURCE}.bf"
- ctorrent -v -f -X "sleep 15; kill -2 \$(pidof ctorrent)" -C 100 ${SOURCE} -s ${TARGET} -b ${SOURCE}.bf >> $OGLOGFILE
+ ctorrent -f -X "sleep 15; kill -2 \$(pidof ctorrent)" -C 100 ${SOURCE} -s ${TARGET} -b ${SOURCE}.bf >> $OGLOGFILE
;;
leecher|LEECHER)
echo "Donwloading Torrent as leecher" # echo "ctorrent ${SOURCE} -X 'sleep $TIME; kill -9 \$(pidof ctorrent)' -C 100 -U 0"
@@ -627,20 +714,6 @@ then
;;
esac
fi
-if [ "$OPTION" == "DOWNLOAD" ]
-then
- echo "comprobando el fichero descargado. Espere: "
- #echo " ctorrent -s $TARGET -c $SOURCE | tail -n1 | cut -f2 -d\( "
- TOTAL=`ctorrent -s $TARGET -c $SOURCE | tail -n1 | cut -f2 -d\(`
- if [ "$TOTAL" == "100%)" ]
- then
- return 0
- else
- return 1
- fi
-
- fi
-
cd /tmp
}
@@ -715,296 +788,99 @@ ctorrent -t `basename $SOURCE` -u http://$IPTORRENT:6969/announce -s $SOURCE.tor
}
-
-
-
-
-############################################################
-### FUNCIONES MULTICAST EN DESARROLLO ##########
-
-
-#/**
-# ogMcastSessionCheck [session]
-#@brief Controla los parámetros de una sessión multicast
-#@param str_session
-#@return (nada, por determinar)
-#@exception OG_ERR_FORMAT formato incorrecto.
-#@note Requisitos:
-#@version 0.91 - Definición de FileTransfer
-#@author Antonio Doblas Viso, Universidad de Málaga
-#@date 2010/05/09
-#*/ ##
-ogMcastSessionCheck ()
-{
-echo "en pruebas"
-#sessionSERVER PORTBASE:METHOD:ADDRESS:BITRATE:NCLINTS:MAXTIME:TOOLCLONE:COMPRESSOR
-#sessionCLIENT PORTBASE:TOOLCLONE:COMPRESSOR
-#PORTBASE: 9000 (incluye el 9001), 9002 (incluye el 9003), 9004
-#METHOD: full-duplex half-duplex brodcast
-#ADDRESS: Dirección habilitada para la transferencia. 339.194.ip2.ip3
-#BITRATE: 90M 80M 70M
-#NCLIENTS:
-#MAXTIME:
-#TOOLCLONE:
-#COMPRESSOR:
-}
-
-
-#/**
-# ogMcastSessionList
-#@brief Lista las sessiones abiertas multicast.
-#@param (en pruebas)
-#@return (nada, por determinar)
-#@exception OG_ERR_FORMAT formato incorrecto.
-#@note Requisitos:
-#@version 0.91 - Definición de FileTransfer
-#@author Antonio Doblas Viso, Universidad de Málaga
-#@date 2010/05/09
-#*/ ##
-ogMcastSessionList()
-{
-echo "en preubas"
-#puertos a utilizar 9000 - 9008 => se definen 10 sesiones
-#lsof -i -nP | grep 900 | awk '{print $9}' | awk -F: '{print $2}' | uniq
-}
-
-#/**
-# ogMcastSessionDelete
-#@brief Libera una session Mulitcast.
-#@param (en pruebas)
-#@return (nada, por determinar)
-#@exception OG_ERR_FORMAT formato incorrecto.
-#@note Requisitos:
-#@version 0.91 - Definición de FileTransfer
-#@author Antonio Doblas Viso, Universidad de Málaga
-#@date 2010/05/09
-#*/ ##
-ogMcastSessionDelete()
-{
-echo "en pruebas"
-}
-
-
-
-
-
-########################## FUNCIONES TORRENT EN DESARROLLO
-##################################################
#/**
-# ogStartTracker
-#@brief Inicia el tracker
-#@param str_pathDirectory str_Relative_path_file
-#@param int_disk int_partition str_Relative_path_file
-#@param str_REPOSITORY(CACHE - LOCAL) str_Relative_path_file
-#@return
-#@exception OG_ERR_FORMAT Formato incorrecto.
-#@exception OG_ERR_NOTFOUND Disco o particion no corresponden con un dispositivo.
-#@exception OG_ERR_PARTITION Tipo de partición desconocido o no se puede montar.
-#@exception OG_ERR_NOTOS La partición no tiene instalado un sistema operativo.
+# ogUpdateCacheIsNecesary [ str_repo ] Relative_path_file_OGIMG_with_/
+#@brief Comprueba que el fichero que se desea almacenar en la cache del cliente, no esta.
+#@param 1 str_REPO
+#@param 2 str_Relative_path_file_OGIMG_with_/
+#@return 0 si es necesario actualizar el fichero.
+#@return 1 si la imagen ya esta en la cache, por lo tanto no es necesario actualizar el fichero
#@note
-#@version 0.1 - Integración para OpenGNSys.
-#@author
+#@todo: Proceso en el caso de que el fichero tenga el mismo nombre, pero su contenido sea distinto.
+#@todo: Se dejan mensajes mientras se confirma su funcionamiento.
+#@version 0.1 - Integracion para OpenGNSys.
+#@author Antonio J. Doblas Viso. Universidad de Malaga
#@date
#*/ ##
-ogStartTracker ()
+function ogUpdateCacheIsNecesary ()
{
- echo " bug2: usar el tracker del bittornado. "
- echo " solucion bug2: apt-get autoremove bittorrent python-bittorrent "
- echo "soulución bug2: apt-get install bittornado. "
- echo "#Paso 2: iniciar track "
-local TESTBTT
-TESTBTT=`ps aux | grep bttrack | egrep -v grep | wc -l`
-if [ "$TESTBTT" == "0" ]; then
- bttrack --reannounce_interval 10 --port 6969 --dfile /root/dstate --logfile /root/bttracker.log --save_dfile_interval 10 --timeout_downloaders_interval 10 2>/dev/null &
-else
- echo "bttrack iniciado"
-fi
-
-}
-ogShareTorrent ()
-{
# Variables locales.
-local ARGS SOURCE EXT TARGET
-
+local ERROR SOURCE CACHE FILESOURCE MD5SOURCE FILETARGET MD5TARGET
+ERROR=0
# Si se solicita, mostrar ayuda.
if [ "$*" == "help" ]; then
- ogHelp "$FUNCNAME" "$FUNCNAME [str_REPOSITORY] [int_ndisk int_npart] Relative_path_file" \
- "$FUNCNAME 1 1 /aula1/winxp" \
- "$FUNCNAME REPO /aula1/winxp"
-
+ ogHelp "$FUNCNAME $FUNCNAME [ str_repo] [ [Relative_path_image] " \
+ "$FUNCNAME REPO /PS1_PH1.img" \
+ "$FUNCNAME REPO /ogclient.sqfs"
+
return
fi
-# Error si se quiere compartir un fichero en cache y no existe la cache
-[ "$1" != "CACHE" ] || `ogFindCache >/dev/null` || ogRaiseError $OG_ERR_NOTFOUND "CACHE"|| return $?
+# Error si no se reciben los argumentos ARG necesarios según la opcion.
+[ $# == "2" ] || ogRaiseError $OG_ERR_FORMAT "Parametros no admitidos"|| return $?
-case "$1" in
- /*) # Camino completo. */ (Comentrio Doxygen)
- SOURCE=$(ogGetPath "$1.img")
- ARG=1
- ;;
- [1-9]*) # ndisco npartición.
- SOURCE=$(ogGetPath "$1" "$2" "$3.img")
- ARG=3
- ;;
- *) # Otros: repo, cache, cdrom (no se permiten caminos relativos).
- EXT=$(ogGetImageType "$1" "$2")
- SOURCE=$(ogGetPath "$1" "$2.$EXT" 2>/dev/null)
- ARG=2
- ;;
-esac
+ogCheckStringInGroup "$1" "REPO repo" || ogRaiseError $OG_ERR_FORMAT "El contendor $1 no es valido, solo se admite REPO" || return $?
-# Error si no se reciben los argumentos ARG necesarios según la opcion.
-[ $# -ne "$ARG" ] && ogRaiseError $OG_ERR_FORMAT && return $?
+FILESOURCE=`ogGetPath $1 $2`
+FILETARGET=`ogGetPath CACHE $2`
-# Comprobar fichero origen
-[ -n "$SOURCE.torrent" ] || ogRaiseError $OG_ERR_NOTFOUND "${ARGS% $*}" || return $?
-
-echo ctorrent $SOURCE.torrent -d
-ctorrent $SOURCE.torrent -d
-
-}
-
-
-ogTorrentReceiverFile ()
-{
-# obligatorio disponer de cache
-# origen destino.
-#origen es el .torrent
-# origen: REPO /file.torrent
-# Si REPO, (nfs, http) copiamos a CACHE.
-
-# destino es el fichero final.
-# destino: CACHE /file
-# destino: disk part /file
-
-# Variables locales.
- local ARGS ARG SOURCEDIR SOURCEFILE TARGETDIR TARGETFILE
-
-# Si se solicita, mostrar ayuda.
-if [ "$*" == "help" ]; then
- ogHelp "$FUNCNAME" "$FUNCNAME [str_REPOSITORY] [int_ndisk int_npart] Relative_path_file" \
- "$FUNCNAME REPO /aula1/winxp.torrent CACHE /aula1/winxp" \
- "$FUNCNAME REPO /aula1/winxp.torrent 1 1 /iso"
+echo "paso 1. si no existe la imagen, confirmamos que es necesaria la actualizacion de la cache."
+if [ -z $FILETARGET ]
+then
+ # borramos el fichero bf del torrent, en el caso de que se hubiese quedado de algun proceso fallido
+ ogDeleteFile CACHE /$2.torrent.bf &> /dev/null
+ ogDeleteFile CACHE /$2.sum &> /dev/null
+ echo "Salida con valor 0, paso 1, la cache no contiene esa imagen "
+ return 0
fi
-# Comprobamos que existe Cache
-`ogFindCache > /dev/null` || ogRaiseError $OG_ERR_NOTFOUND "CACHE" || return $?
-
-# guardamos torrent. controlamos tamaño del fichero y comprobamos con cache.
-ogCopyFile $1 $2 $3 $4
-
-
-}
-
-ogReceiveTorrent ()
-{
-# Variables locales.
- local ARGS ARG TARGETDIR TARGETFILE
-
-
-
-# Si se solicita, mostrar ayuda.
-if [ "$*" == "help" ]; then
- ogHelp "$FUNCNAME" "$FUNCNAME [str_REPOSITORY] [int_ndisk int_npart] Relative_path_file" \
- "$FUNCNAME 1 1 /aula1/winxp" \
- "$FUNCNAME REPO /aula1/winxp" \
- "$FUNCNAME /mnt/sda2/winxp"
-
-
- return
+echo "Paso 2. Comprobamos que la imagen no estuviese en un proceso previo torrent"
+if ogGetPath $FILETARGET.torrent.bf > /dev/null
+then
+ echo "Salida con valor 0, paso 2 la imagen esta en un estado de descarga torrent interrumpido."
+ #TODO: comprobar los md5 para asegurarnos que la imagen es la misma.
+ return 0
fi
-# Comprobamos que existe Cache
-`ogFindCache > /dev/null` || ogRaiseError $OG_ERR_NOTFOUND "CACHE" || return $?
-
-ARGS="$*"
-case "$1" in
- /*) # Camino completo. */ (Comentrio Doxygen)
- TARGETDIR=$(ogGetParentPath "$1")
- ARG=1
- ;;
- [1-9]*) # ndisco npartición.
- TARGETDIR=$(ogGetParentPath "$1" "$2" "$3")
- ARG=3
- ;;
- *) # Otros: repo, cache, cdrom (no se permiten caminos relativos).
- EXT=$(ogGetImageType "$1" "$2")
- TARGETDIR=$(ogGetParentPath "$1" "$2")
- ARG=2
- ;;
-esac
-#echo $TARGETDIR
-EXT=${EXT:-"img"}
-
-# Error si no se reciben los argumentos ARG necesarios según la opcion.
-[ "$#" -ne "$ARG" ] && ogRaiseError $OG_ERR_FORMAT && return $?
-
-#obtenemos el nombre del fichero a descargar.
-TARGETFILE=`basename ${!ARG}`
-CACHE=`ogMountCache`
-
-# Error si no existe el fichero torrent
-[ -r $TARGETDIR/$TARGETFILE.$EXT.torrent ] || ogRaiseError $OG_ERR_NOTFOUND || return $?
-[ -d ${CACHE}/$OGIMG ] || ogRaiseError $OG_ERR_NOTFOUND || return $?
-
-TimeToWaitForCloseAfterDownload=20 # tiempo que deseamos que el cliente este como semilla, despues de la descarga.
-
-# Si el fichero ya se ha bajado antes de iniciar el ctorrent no se ejecuta el comando kill, siguen encendido siempre
-# Comprobamos si se ha descargado antes, si es asi nos salimos
-Total=`ctorrent -s ${CACHE}/$OGIMG/${TARGETFILE}.$EXT -c $TARGETDIR/$TARGETFILE.$EXT.torrent|tail -n1|cut -f2 -d\(`
-[ $Total == "100%)" ] && return 0
-
-#echo "ctorrent -X 'sleep $TimeToWaitForCloseAfterDownload; kill -9 \$(pidof ctorrent)' $TARGETDIR/$TARGETFILE.img.torrent -s ${CACHE}/$OGIMG/${TARGETFILE}.img -b ${CACHE}/$OGIMG/$TARGETFILE.bf -C 100"
-ctorrent -X "sleep $TimeToWaitForCloseAfterDownload; kill -9 \$(pidof ctorrent)" $TARGETDIR/$TARGETFILE.$EXT.torrent -s ${CACHE}/$OGIMG/${TARGETFILE}.$EXT -b ${CACHE}/$OGIMG/$TARGETFILE.bf -C 100
-
-[ -r ${CACHE}/$OGIMG/$TARGETFILE.bf ] && rm ${CACHE}/$OGIMG/$TARGETFILE.bf
-}
-
-ogCheckSessionMulticast ()
-{
-# $1 tipo de sesion server client
-# 2 la sesisón.
-#variables locales
-local NPARM MODE SESSION
-
-# Si se solicita, mostrar ayuda.
-if [ "$*" == "help" ]; then
- ogHelp "$FUNCNAME str_mode array_session" \
- "$FUNCNAME client PORTBASE"\
- "$FUNCNAME server PORTBASE:METHOD:ADDRESS:BITRATE:NCLIENTS:MAXTIME"
- return
+## En este punto la imagen en el repo y en la cache se llaman igual,
+echo "paso 4. recuperamos o calculamos los md5 de los ficheros"
+if [ -f $FILESOURCE.sum ]
+then
+ echo "leyendo el sum del fichero sum del repo"
+ MD5SOURCE=$(cat $FILESOURCE.sum)
+#elif [ -f $FILETARGET.torrent ]
+#then
+# echo "leyendo el sum del fichero torrent de la cache"
+# MD5SOURCE=$(ctorrent -x $FILETARGET.torrent | grep Comment | awk -F": " '{print $2}')
+else
+ echo "calculando el sun del repo"
+ MD5SOURCE=$(md5sum $FILESOURCE | cut -f1 -d" ")
+fi
+if [ -f $FILETARGET.sum ]
+then
+ echo "leyendo el sum de la cache"
+ MD5TARGET=$(cat $FILETARGET.sum)
+else
+ echo "calculando el sum de la cache"
+ md5sum $FILETARGET | cut -f1 -d" " > $FILETARGET.sum
+ MD5TARGET=$(cat $FILETARGET.sum)
fi
+echo "Paso 5. comparamos los md5"
+#TODO: que hacer cuando los md5 son distintos. Por defecto borrar.
+if [ "$MD5SOURCE" == "$MD5TARGET" ]
+then
+ echo "paso5.A la imagen esta en cache"
+ return 1
+else
+ echo "paso 5.b la imagen en cache es distinta, borramos la imagen anterior y devolvemos 0 para confirmar la actualizacion"
+ rm $FILETARGET
+ return 0
+fi
-# Error si no se recibe 2 parámetro.
-[ $# == 2 ] || ogRaiseError $OG_ERR_FORMAT || return $?
-
-# controlamos el primer parametro.
-ogCheckStringInGroup "$1" "client server" || ogRaiseError $OG_ERR_OUTOFLIMIT || return $?
+}
-#controlamos el segundo parametro. La sessión multicast.
-[ $1 == "client" ] && NPARM=1 || NPARM=6
-OIFS=$IFS; IFS=':' ; SESSION=($2); IFS=$OIFS
-[[ ${#SESSION[*]} == $NPARM ]] || ogRaiseError $OG_ERR_OUTOFLIMIT || return $?
-#controlamos el PORTBASE de la sesion. Comun.-
-ogCheckStringInGroup ${SESSION[0]} "9000 9002 9004 9006 9008 9010" || ogRaiseError $OG_ERR_OUTOFLIMIT || return $?
-if [ "$1" == "server" ]
-then
- # $METHOD
- ogCheckStringInGroup ${SESSION[1]} "full-duplex half-duplex broadcast" || ogRaiseError $OG_ERR_OUTOFLIMIT || return $?
- # $ADDRESS
- ogCheckIpAddress ${SESSION[2]} || ogRaiseError $OG_ERR_OUTOFLIMIT || return $?
- #BITRATE
- ogCheckStringInReg ${SESSION[3]} "^[1-9]{1,2}M$" || ogRaiseError $OG_ERR_OUTOFLIMIT || return $?
- #NCLIENTS
- ogCheckStringInReg ${SESSION[4]} "^[0-9]{1,10}$" || ogRaiseError $OG_ERR_OUTOFLIMIT || return $?
- #MAXTIME
- ogCheckStringInReg ${SESSION[5]} "^[0-9]{1,10}$" || ogRaiseError $OG_ERR_OUTOFLIMIT " " || return $?
-fi
-return 0
-}
diff --git a/client/engine/Protocol.lib.testing b/client/engine/Protocol.lib.testing
new file mode 100755
index 00000000..73a5e63a
--- /dev/null
+++ b/client/engine/Protocol.lib.testing
@@ -0,0 +1,676 @@
+#!/bin/bash
+#/**
+#@file Protocol.lib
+#@brief Librería o clase Protocol
+#@class FileTransfer
+#@brief Funciones para transmisión de datos
+#@version 0.91
+#@warning License: GNU GPLv3+
+#*/
+
+
+
+
+
+#/**
+# ogMcastSyntax
+#@brief Función para generar la instrucción de ejucción la transferencia de datos multicast
+#@param 1 Tipo de operación [ SENDPARTITION RECEIVERPARTITION SENDFILE RECEIVERFILE ]
+#@param 2 Sesión Mulicast
+#@param 3 Dispositivo (opción PARTITION) o fichero(opción FILE) que será enviado.
+#@param 4 Tools de clonación (opcion PARTITION)
+#@param 5 Tools de compresion (opcion PARTITION)
+#@return instrucción para ser ejecutada.
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@note Requisitos: upd-cast 2009
+#@todo localvar check versionudp
+#@version 0.91 - Definición de FileTransfer
+#@author Antonio Doblas Viso, Universidad de Málaga
+#@date 2010/05/09
+#*/ ##
+#/**
+#
+
+
+function ogMcastSyntax ()
+{
+
+local ISUDPCAST PARM SESSION SESSIONPARM MODE PORTBASE PERROR
+local METHOD ADDRESS BITRATE NCLIENTS MAXTIME CERROR
+local TOOL LEVEL DEVICE MBUFFER SYNTAXSERVER SYNTAXCLIENT
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" -o "$2" == "help" ]; then
+ ogHelp "$FUNCNAME SENDPARTITION str_sessionSERVER str_device str_tools str_level" \
+ "$FUNCNAME RECEIVERPARTITION str_sessionCLIENT str_device str_tools str_level "\
+ "$FUNCNAME SENDFILE str_sessionSERVER str_file "\
+ "$FUNCNAME RECEIVERFILE str_sessionCLIENT str_file " \
+ "sessionServer syntax: portbase:method:mcastaddress:speed:nclients:ntimeWaitingUntilNclients " \
+ "sessionServer example: 9000:full-duplex|half-duplex|broadcast:239.194.17.36:80M:50:60 " \
+ "sessionClient syntax: portbase " \
+ "sessionClient example: 9000 "
+ return
+fi
+PERROR=0
+
+#si no tenemos updcast o su version superior 2009 udpcast error.
+ISUDPCAST=$(udp-receiver --help 2>&1)
+echo $ISUDPCAST | grep start-timeout > /dev/null || ogRaiseError $OG_ERR_FORMAT "upd-cast no existe o version antigua -requerida 2009-"|| return $?
+
+
+# Error si no se reciben $PARM parámetros.
+echo "$1" | grep "PARTITION" > /dev/null && PARM=5 || PARM=3
+[ "$#" -eq "$PARM" ] || ogRaiseError $OG_ERR_FORMAT "sin parametros"|| return $?
+
+
+# 1er param check
+ogCheckStringInGroup "$1" "SENDPARTITION sendpartition RECEIVERPARTITION receiverpartition SENDFILE sendfile RECEIVERFILE receiverfile" || ogRaiseError $OG_ERR_FORMAT "1st param: $1" || PERROR=1 #return $?
+
+# 2º param check
+echo "$1" | grep "SEND" > /dev/null && MODE=server || MODE=client
+
+#TODO: diferenciamos los paramatros especificos de la sessión multicast
+#SI: controlamos todos los parametros de la sessión multicast.
+[ $MODE == "client" ] && SESSIONPARM=1 || SESSIONPARM=6
+OIFS=$IFS; IFS=':' ; SESSION=($2); IFS=$OIFS
+
+
+[[ ${#SESSION[*]} == $SESSIONPARM ]] || ogRaiseError $OG_ERR_FORMAT "parametros session multicast no completa" || PERROR=2# return $?
+
+
+#controlamos el PORTBASE de la sesion. Comun.-
+PORTBASE=${SESSION[0]}
+ogCheckStringInGroup ${SESSION[0]} "9000 9002 9004 9006 9008 9010" || ogRaiseError $OG_ERR_FORMAT "McastSession portbase ${SESSION[0]}" || PERROR=3 #return $?
+if [ $MODE == "server" ]
+then
+ ogCheckStringInGroup ${SESSION[1]} "full-duplex FULL-DUPLEX half-duplex HALF-DUPLEX broadcast BROADCAST" || ogRaiseError $OG_ERR_FORMAT "McastSession method ${SESSION[1]}" || PERROR=4 #return $?
+ METHOD=${SESSION[1]}
+ ogCheckIpAddress ${SESSION[2]} || ogRaiseError $OG_ERR_FORMAT "McastSession address ${SESSION[2]}" || PERROR=5 #return $?
+ ADDRESS=${SESSION[2]}
+ ogCheckStringInReg ${SESSION[3]} "^[0-9]{1,2}\M$" || ogRaiseError $OG_ERR_FORMAT "McastSession bitrate ${SESSION[3]}" || PERROR=6 # return $?
+ BITRATE=${SESSION[3]}
+ ogCheckStringInReg ${SESSION[4]} "^[0-9]{1,10}$" || ogRaiseError $OG_ERR_FORMAT "McastSession nclients ${SESSION[4]}" || PERROR=7 # return $?
+ NCLIENTS=${SESSION[4]}
+ ogCheckStringInReg ${SESSION[5]} "^[0-9]{1,10}$" || ogRaiseError $OG_ERR_FORMAT "McastSession maxtime ${SESSION[5]}" || PERROR=8 # return $?
+ MAXTIME=${SESSION[5]}
+fi
+
+#3er param check - que puede ser un dispositvo o un fichero.
+#ogGetPath "$3" > /dev/null || ogRaiseError $OG_ERR_NOTFOUND " device or file $3" || PERROR=9 #return $?
+DEVICE=$3
+
+#4 y 5 param check . solo si es sobre particiones.
+if [ "$PARM" == "5" ]
+then
+ # 4 param check
+ ogCheckStringInGroup "$4" "partclone partimage ntfsclone" || ogRaiseError $OG_ERR_NOTFOUND " herramienta $4 no soportada" || PERROR=10 #return $?
+ TOOL=$4
+ ogCheckStringInGroup "$5" "lzop gzip 0 1" || ogRaiseError $OG_ERR_NOTFOUND " compresor $5 no valido" || PERROR=11 #return $?
+ LEVEL=$5
+fi
+
+
+[ "$PERROR" -gt "0" ] && return 1
+
+# Valores estandar no configurables.
+CERROR="8x8/128"
+
+# opción del usuo de tuberia intermedia en memoria mbuffer.
+which mbuffer > /dev/null && MBUFFER=" --pipe 'mbuffer -q -m 20M' "
+
+# Generamos la instrucción base de multicast -Envio,Recepcion-
+SYNTAXSERVER="udp-sender $MBUFFER --portbase $PORTBASE --$METHOD --mcast-data-address $ADDRESS --fec $CERROR --max-bitrate $BITRATE --ttl 16 --min-clients $NCLIENTS --max-wait $MAXTIME "
+SYNTAXCLIENT="udp-receiver $MBUFFER --portbase $PORTBASE "
+
+
+case "$1" in
+SENDPARTITION)
+ PROG1=`ogCreateImageSyntax $DEVICE " " $TOOL $LEVEL | awk -F"|" '{print $1 "|" $3}' | tr -d ">"`
+ echo "$PROG1 | $SYNTAXSERVER"
+ ;;
+ RECEIVERPARTITION)
+ COMPRESSOR=`ogRestoreImageSyntax " " $DEVICE $TOOL $LEVEL | awk -F\| '{print $1}'`
+ TOOLS=`ogRestoreImageSyntax " " $DEVICE $TOOL $LEVEL | awk -F\| '{print $NF}'`
+ echo "$SYNTAXCLIENT | $COMPRESSOR | $TOOLS "
+ ;;
+ SENDFILE)
+ echo "$SYNTAXSERVER --file $3"
+ ;;
+ RECEIVERFILE)
+ echo "$SYNTAXCLIENT --file $3"
+ ;;
+ *)
+ ;;
+esac
+}
+
+
+
+#/**
+# ogMcastSendFile [ str_repo | int_ndisk int_npart ] /Relative_path_file sessionMulticast
+#@brief Envía un fichero por multicast ORIGEN(fichero) DESTINO(sessionmulticast)
+#@param (2 parámetros) $1 path_aboluto_fichero $2 sesionMcast
+#@param (3 parámetros) $1 Contenedor REPO|CACHE $2 path_absoluto_fichero $3 sesionMulticast
+#@param (4 parámetros) $1 disk $2 particion $3 path_absoluto_fichero $4 sesionMulticast
+#@return
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@note Requisitos:
+#@version 0.91 - Definición de Protocol.lib
+#@author Antonio Doblas Viso, Universidad de Málaga
+#@date 2010/05/09
+#*/ ##
+#/**
+#
+
+function ogMcastSendFile ()
+{
+# Variables locales.
+local ARGS SOURCE TARGET COMMAND DEVICE
+#ARGS usado para controlar ubicación de la sesion multicast
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME [str_REPOSITORY] [int_ndisk int_npart] /Relative_path_file sesionMcast" \
+ "$FUNCNAME 1 1 /aula1/winxp.img sesionMcast" \
+ "$FUNCNAME REPO /aula1/ubuntu.iso sesionMcast" \
+ "$FUNCNAME CACHE /aula1/winxp.img sesionMcast" \
+ "$FUNCNAME /opt/opengnsys/images/aula1/hd500.vmx sesionMcast"
+ return
+fi
+
+ARGS="$@"
+case "$1" in
+ /*) # Camino completo. */ (Comentrio Doxygen)
+ SOURCE=$(ogGetPath "$1")
+ ARG=2
+ DEVICE="$1"
+ ;;
+ [1-9]*) # ndisco npartición.
+ SOURCE=$(ogGetPath "$1" "$2" "$3")
+ ARG=4
+ DEVICE="$1 $2 $3"
+ ;;
+ *) # Otros: repo, cache, cdrom (no se permiten caminos relativos).
+ SOURCE=$(ogGetPath "$1" "$2")
+ ARG=3
+ DEVICE="$1 $2 "
+ ;;
+esac
+
+
+# Error si no se reciben los argumentos ARG necesarios según la opcion.
+[ $# == "$ARG" ] || ogRaiseError $OG_ERR_FORMAT || return $?
+
+# Comprobar fichero origen
+ogGetPath $SOURCE &> /dev/null || ogRaiseError $OG_ERR_NOTFOUND " device or file $DEVICE not found" || return $?
+
+SESSION=${!ARG}
+# llamando a la funcion con param1 session $SESSION y param2 $SOURCE
+COMMAND=`ogMcastSyntax "SENDFILE" "$SESSION" "$SOURCE"`
+echo $COMMAND
+eval $COMMAND
+}
+
+
+
+#/**
+# ogMcastReceiverFile sesion Multicast [ str_repo | int_ndisk int_npart ] /Relative_path_file
+#@brief Recibe un fichero multicast ORIGEN(sesionmulticast) DESTINO(fichero)
+#@param (2 parámetros) $1 sesionMcastCLIENT $2 path_aboluto_fichero_destino
+#@param (3 parámetros) $1 sesionMcastCLIENT $2 Contenedor REPO|CACHE $3 path_absoluto_fichero_destino
+#@param (4 parámetros) $1 sesionMcastCLIENT $2 disk $3 particion $4 path_absoluto_fichero_destino
+#@return
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@note Requisitos:
+#@version 0.91 - Definición de Protocol.lib
+#@author Antonio Doblas Viso, Universidad de Málaga
+#@date 2010/05/09
+#*/ ##
+#/**
+#
+
+ogMcastReceiverFile ()
+{
+
+# Variables locales.
+local ARGS ARG TARGETDIR TARGETFILE
+
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME [ str_portMcast] [ [Relative_path_file] | [str_REPOSITORY path_file] | [int_ndisk int_npart path_file ] ]" \
+ "$FUNCNAME 9000 /PS1_PH1.img" \
+ "$FUNCNAME 9000 CACHE /aula1/PS2_PH4.img" \
+ "$FUNCNAME 9000 1 1 /isos/linux.iso"
+ return
+fi
+
+ARGS="$@"
+case "$2" in
+ /*) # Camino completo. */ (Comentrio Doxygen)
+ TARGETDIR=$(ogGetParentPath "$2")
+ ARG=2
+ ;;
+ [1-9]*) # ndisco npartición.
+ TARGETDIR=$(ogGetParentPath "$2" "$3" "$4")
+ ARG=4
+ ;;
+ *) # Otros: repo, cache, cdrom (no se permiten caminos relativos).
+ TARGETDIR=$(ogGetParentPath "$2" "$3")
+ ARG=3
+ ;;
+esac
+
+# Error si no se reciben los argumentos ARG necesarios según la opcion.
+[ $# == "$ARG" ] || ogRaiseError $OG_ERR_FORMAT "Parametros no admitidos"|| return $?
+
+#obtenemos el nombre del fichero a descargar.
+TARGETFILE=`basename ${!ARG}`
+
+#generamos la instrucción a ejecutar.
+COMMAND=`ogMcastSyntax RECEIVERFILE "$1" $TARGETDIR/$TARGETFILE `
+echo $COMMAND
+eval $COMMAND
+}
+
+#/**
+# ogMcastSendPartition
+#@brief Función para enviar el contenido de una partición a multiples particiones remotas.
+#@param
+#@param
+#@param
+#@return
+#@exception
+#@note
+#@todo: ogIsLocked siempre devuelve 1. crear ticket
+#@version 0.1 - Integración para OpenGNSys.
+#@author
+#@date
+#*/ ##
+
+ogMcastSendPartition ()
+{
+
+# Variables locales
+local PART COMMAND
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npart SessionMulticastSERVER tools compresor" \
+ "$FUNCNAME 1 1 9000:full-duplex:239.194.37.31:50M:20:2 partclone lzop"
+ return
+fi
+# Error si no se reciben 5 parámetros.
+[ "$#" == 5 ] || ogRaiseError $OG_ERR_FORMAT || return $?
+#chequeamos la particion.
+PART=$(ogDiskToDev "$1" "$2") || return $?
+
+#ogIsLocked $1 $2 || ogRaiseError $OG_ERR_LOCKED "$1,$2" || return $?
+ogUnmount $1 $2
+
+
+#generamos la instrucción a ejecutar.
+COMMAND=`ogMcastSyntax SENDPARTITION "$3" $PART $4 $5`
+echo $COMMAND
+eval $COMMAND
+}
+
+#/**
+# ogMcastReceiverPartition
+#@brief Función para recibir directamente en la partición el contenido de un fichero imagen remoto enviado por multicast.
+#@param
+#@param
+#@param
+#@return
+#@exception
+#@note
+#@todo:
+#@version 0.1 - Integración para OpenGNSys.
+#@author
+#@date
+#*/ ##
+ogMcastReceiverPartition ()
+{
+# Variables locales
+local PART COMMAND
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npart SessionMulticastCLIENT tools compresor" \
+ "$FUNCNAME 1 1 9000 partclone lzop"
+ return
+fi
+# Error si no se reciben 5 parámetros.
+[ "$#" == 5 ] || ogRaiseError $OG_ERR_FORMAT || return $?
+#chequeamos la particion.
+PART=$(ogDiskToDev "$1" "$2") || return $?
+
+#ogIsLocked $1 $2 || ogRaiseError $OG_ERR_LOCKED "$1,$2" || return $?
+ogUnmount $1 $2
+
+#generamos la instrucción a ejecutar.
+COMMAND=`ogMcastSyntax RECEIVERPARTITION "$3" $PART $4 $5`
+echo $COMMAND
+eval $COMMAND
+}
+
+
+##########################################
+############## funciones torrent
+#/**
+# ogTorrentStart [ str_repo | int_ndisk int_npart ] Relative_path_file.torrent | SessionProtocol
+#@brief Función iniciar P2P - requiere un tracker para todos los modos, y un seeder para los modos peer y leecher y los ficheros .torrent.
+#@param str_pathDirectory str_Relative_path_file
+#@param int_disk int_partition str_Relative_path_file
+#@param str_REPOSITORY(CACHE - LOCAL) str_Relative_path_file
+#@param (2 parámetros) $1 path_aboluto_fichero_torrent $2 Parametros_Session_Torrent
+#@param (3 parámetros) $1 Contenedor CACHE $2 path_absoluto_fichero_Torrent $3 Parametros_Session_Torrent
+#@param (4 parámetros) $1 disk $2 particion $3 path_absoluto_fichero_Torrent 4$ Parametros_Session_Torrent
+
+#@return
+#@note
+#@todo:
+#@version 0.1 - Integración para OpenGNSys.
+#@author Antonio J. Doblas Viso. Universidad de Málaga
+#@date
+#@version 0.2 - Chequeo del tamaño de imagen descargado.
+#@author Irina . Univesidad de Sevilla.
+#@date
+#@version 0.3 - Control de los modos de operación, y estado de descarga.
+#@author Antonio J. Doblas Viso. Univesidad de Málaga.
+#@date
+#@version 0.4 - Enviadando señal (2) a ctorrent permiendo la comunicación final con tracker
+#@author Antonio J. Doblas Viso. Univesidad de Málaga.
+#@date
+#*/ ##
+
+#protocoloTORRENT mode:time
+#mode=seeder -> Dejar el equipo seedeando hasta que transcurra el tiempo indicado o un kill desde consola,
+#mode=peer -> seedear mientras descarga
+#mode=leecher -> NO seedear mientras descarga
+#time tiempo que una vez descargada la imagen queremos dejar al cliente como seeder.
+
+ogTorrentStart ()
+{
+
+# Variables locales.
+local ARGS ARG TARGETDIR TARGETFILE SESSION ERROR
+ERROR=0
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME $FUNCNAME [ str_repo] [ [Relative_path_fileTORRENT] | [str_REPOSITORY path_fileTORRENT] | [int_ndisk int_npart path_fileTORRENT ] ] SessionTorrent" \
+ "$FUNCNAME CACHE /PS1_PH1.img.torrent seeder:10000" \
+ "$FUNCNAME /opt/opengnsys/cache/linux.iso peer:60" \
+ "$FUNCNAME 1 1 /linux.iso.torrent leecher:60"
+ return
+fi
+
+case "$1" in
+ /*) # Camino completo. */ (Comentrio Doxygen)
+ SOURCE=$(ogGetPath "$1")
+ ARG=2
+ ;;
+ [1-9]*) # ndisco npartición.
+ SOURCE=$(ogGetPath "$1" "$2" "$3")
+ ARG=4
+ ;;
+ *) # Otros: Solo cache (no se permiten caminos relativos).
+ SOURCE=$(ogGetPath "$1" "$2" 2>/dev/null)
+ ARG=3
+ ;;
+esac
+
+# Error si no se reciben los argumentos ARG necesarios según la opcion.
+[ $# == "$ARG" ] || ogRaiseError $OG_ERR_FORMAT "Parametros no admitidos"|| return $?
+
+#controlar source, que no se haga al repo.
+if [ $ARG == "3" ]
+then
+ ogCheckStringInGroup "$1" "CACHE cache" || ogRaiseError $OG_ERR_FORMAT "La descarga torrent solo se hace desde local, copia el torrent a la cache y realiza la operación desde esa ubicación" || return $?
+fi
+if [ $ARG == "2" ]
+then
+ if `ogCheckStringInReg "$1" "^/opt/opengnsys/images"`
+ then
+ ogRaiseError $OG_ERR_FORMAT "La descarga torrent solo se hace desde local, copia el torrent a la cache y realiza la operación desde esa ubicación"
+ return $?
+ fi
+fi
+
+#controlar el source, para que sea un torrent.
+ctorrent -x ${SOURCE} &> /dev/null; [ $? -eq 0 ] || ogRaiseError $OG_ERR_NOTFOUND "${ARGS% $*}" || return $?
+
+TARGET=`echo $SOURCE | awk -F.torrent '{print $1}'`
+DIRSOURCE=`ogGetParentPath $SOURCE`
+cd $DIRSOURCE
+
+
+
+SESSION=${!ARG}
+OIFS=$IFS; IFS=':' ; SESSION=($SESSION); IFS=$OIFS
+[[ ${#SESSION[*]} == 2 ]] || ogRaiseError $OG_ERR_FORMAT "parametros session Torrent no completa: modo:tiempo" || ERROR=1# return $?
+#controlamos el modo de operación del cliente-
+ogCheckStringInGroup ${SESSION[0]} "seeder SEEDER peer PEER leecher LEECHER" || ogRaiseError $OG_ERR_FORMAT "valor modo Torrent no valido ${SESSION[0]}" || ERROR=1 #return $?
+MODE=${SESSION[0]}
+#contolamos el tiempo para el seeder o una vez descargada la imagen como peer o leecher.
+ogCheckStringInReg ${SESSION[1]} "^[0-9]{1,10}$" || ogRaiseError $OG_ERR_FORMAT "valor tiempo no valido ${SESSION[1]}" || ERROR=1 # return $?
+TIME=${SESSION[1]}
+# si ha habido error en el control de parametros error.
+[ "$ERROR" == "1" ] && return 1
+
+
+#SYNTAXSEEDER="echo MODE seeder ctorrent ; (sleep \$TIME && kill -9 \`pidof ctorrent\`) & ; ctorrent \${SOURCE}"
+
+# si No fichero .bf, y Si fichero destino imagen ya descargada y su chequeo fue comprobado en su descarga inicial.
+if [ ! -f ${SOURCE}.bf -a -f ${TARGET} ]
+then
+ echo "imagen ya descargada"
+ case "$MODE" in
+ seeder|SEEDER)
+ echo "MODE seeder ctorrent" #### ${SOURCE} -X 'sleep $TIME; kill -9 \$(pidof ctorrent)' -C 100"
+ (sleep $TIME && kill -2 `pidof ctorrent`) &
+ ctorrent -f ${SOURCE}
+ esac
+ return 0
+fi
+
+#Si no existe bf ni fichero destino descarga inicial.
+if [ ! -f ${SOURCE}.bf -a ! -f ${TARGET} ]
+then
+ OPTION=DOWNLOAD
+ echo "descarga inicial"
+fi
+
+# Si fichero bf descarga anterior no completada -.
+if [ -f ${SOURCE}.bf -a -f ${TARGET} ]
+then
+ echo Continuar con Descargar inicial no terminada.
+ OPTION=DOWNLOAD
+fi
+
+if [ "$OPTION" == "DOWNLOAD" ]
+then
+ case "$MODE" in
+ peer|PEER)
+ echo "Donwloading Torrent as peer" ### echo "ctorrent -X 'sleep $TIME; kill -9 \$(pidof ctorrent)' -C 100 $SOURCE -s $TARGET -b ${SOURCE}.bf"
+ ctorrent -f -X "sleep $TIME; kill -2 \$(pidof ctorrent)" -C 100 ${SOURCE} -s ${TARGET} -b ${SOURCE}.bf
+ ;;
+ leecher|LEECHER)
+ echo "Donwloading Torrent as leecher" # echo "ctorrent ${SOURCE} -X 'sleep $TIME; kill -9 \$(pidof ctorrent)' -C 100 -U 0"
+ ctorrent ${SOURCE} -X "sleep $TIME; kill -2 \$(pidof ctorrent)" -C 100 -U 0
+ ;;
+ seeder|SEEDER)
+ echo "MODE seeder ctorrent" #### ${SOURCE} -X 'sleep $TIME; kill -9 \$(pidof ctorrent)' -C 100"
+ ctorrent -f -X "sleep $TIME; kill -2 \$(pidof ctorrent)" -C 100 ${SOURCE} -s ${TARGET} -b ${SOURCE}.bf
+ ;;
+ esac
+fi
+cd /tmp
+}
+
+#/**
+# ogCreateTorrent [ str_repo | int_ndisk int_npart ] Relative_path_file
+#@brief Función para crear el fichero torrent.
+#@param str_pathDirectory str_Relative_path_file
+#@param int_disk int_partition str_Relative_path_file
+#@param str_REPOSITORY(CACHE - LOCAL) str_Relative_path_file
+#@return
+#@exception OG_ERR_FORMAT Formato incorrecto.
+#@exception OG_ERR_NOTFOUND Disco o particion no corresponden con un dispositivo.
+#@exception OG_ERR_PARTITION Tipo de partición desconocido o no se puede montar.
+#@exception OG_ERR_NOTOS La partición no tiene instalado un sistema operativo.
+#@note
+#@version 0.1 - Integración para OpenGNSys.
+#@author Antonio J. Doblas Viso. Universidad de Málaga
+#@date
+#@version 0.2 - Integración para btlaunch.
+#@author Irina . Univesidad de Sevilla.
+#@date
+#*/ ##
+
+ogCreateTorrent ()
+{
+# Variables locales.
+local ARGS ARG SOURCE EXT IPTORRENT
+
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME [str_REPOSITORY] [int_ndisk int_npart] Relative_path_file IpBttrack" \ "$FUNCNAME 1 1 /aula1/winxp 10.1.15.23" \
+ "$FUNCNAME REPO /aula1/winxp 10.1.15.45"
+
+ return
+fi
+
+# Error si se quiere crear el fichero en cache y no existe
+[ "$1" != "CACHE" ] || `ogFindCache >/dev/null` || ogRaiseError $OG_ERR_NOTFOUND "CACHE"|| return $?
+
+case "$1" in
+ /*) # Camino completo. */ (Comentrio Doxygen)
+ SOURCE=$(ogGetPath "$1.img")
+ ARG=2
+ ;;
+ [1-9]*) # ndisco npartición.
+ SOURCE=$(ogGetPath "$1" "$2" "$3.img")
+ ARG=4
+ ;;
+ *) # Otros: repo, cache, cdrom (no se permiten caminos relativos).
+ EXT=$(ogGetImageType "$1" "$2")
+ SOURCE=$(ogGetPath "$1" "$2.$EXT")
+ ARG=3
+ ;;
+esac
+
+# Error si no se reciben los argumentos ARG necesarios según la opcion.
+[ $# -eq "$ARG" ] || ogRaiseError $OG_ERR_FORMAT || return $?
+
+
+# Error si no existe la imagen
+[ $SOURCE ] || ogRaiseError $OG_ERR_NOTFOUND || return $?
+
+[ -r $SOURCE.torrent ] && mv "$SOURCE.torrent" "$SOURCE.torrent.ant" && echo "Esperamos que se refresque el servidor" && sleep 20
+
+IPTORRENT="${!#}"
+# Si ponemos el path completo cuando creamos el fichero torrent da error
+cd `dirname $SOURCE`
+echo ctorrent -t `basename $SOURCE` -u http://$IPTORRENT:6969/announce -s $SOURCE.torrent
+ctorrent -t `basename $SOURCE` -u http://$IPTORRENT:6969/announce -s $SOURCE.torrent
+
+}
+
+#/**
+# ogUpdateCacheIsNecesary [ str_repo ] Relative_path_file_OGIMG_with_/
+#@brief Comprueba que el fichero que se desea almacenar en la cache del cliente, no esta.
+#@param 1 str_REPO
+#@param 2 str_Relative_path_file_OGIMG_with_/
+#@return 0 si es necesario actualizar el fichero.
+#@return 1 si la imagen ya esta en la cache, por lo tanto no es necesario actualizar el fichero
+#@note
+#@todo: Proceso en el caso de que el fichero tenga el mismo nombre, pero su contenido sea distinto.
+#@todo: Se dejan mensajes mientras se confirma su funcionamiento.
+#@version 0.1 - Integracion para OpenGNSys.
+#@author Antonio J. Doblas Viso. Universidad de Malaga
+#@date
+#*/ ##
+function ogUpdateCacheIsNecesary ()
+{
+
+# Variables locales.
+local ERROR SOURCE CACHE FILESOURCE MD5SOURCE FILETARGET MD5TARGET
+ERROR=0
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME $FUNCNAME [ str_repo] [ [Relative_path_image] " \
+ "$FUNCNAME REPO /PS1_PH1.img" \
+ "$FUNCNAME REPO /ogclient.sqfs"
+
+ return
+fi
+
+# Error si no se reciben los argumentos ARG necesarios según la opcion.
+[ $# == "2" ] || ogRaiseError $OG_ERR_FORMAT "Parametros no admitidos"|| return $?
+
+
+ogCheckStringInGroup "$1" "REPO repo" || ogRaiseError $OG_ERR_FORMAT "El contendor $1 no es valido, solo se admite REPO" || return $?
+
+FILESOURCE=`ogGetPath $1 $2`
+FILETARGET=`ogGetPath CACHE $2`
+
+echo "paso 1. si no existe la imagen, confirmamos que es necesaria la actualizacion de la cache."
+if [ -z $FILETARGET ]
+then
+ # borramos el fichero bf del torrent, en el caso de que se hubiese quedado de algun proceso fallido
+ ogDeleteFile CACHE /$2.torrent.bf &> /dev/null
+ ogDeleteFile CACHE /$2.sum &> /dev/null
+ echo "Salida con valor 0, paso 1, la cache no contiene esa imagen "
+ return 0
+fi
+echo "Paso 2. Comprobamos que la imagen no estuviese en un proceso previo torrent"
+if ogGetPath $FILETARGET.torrent.bf > /dev/null
+then
+ echo "Salida con valor 0, paso 2 la imagen esta en un estado de descarga torrent interrumpido."
+ #TODO: comprobar los md5 para asegurarnos que la imagen es la misma.
+ return 0
+fi
+
+## En este punto la imagen en el repo y en la cache se llaman igual,
+echo "paso 4. recuperamos o calculamos los md5 de los ficheros"
+if [ -f $FILESOURCE.sum ]
+then
+ echo "leyendo el sum del fichero sum del repo"
+ MD5SOURCE=$(cat $FILESOURCE.sum)
+#elif [ -f $FILETARGET.torrent ]
+#then
+# echo "leyendo el sum del fichero torrent de la cache"
+# MD5SOURCE=$(ctorrent -x $FILETARGET.torrent | grep Comment | awk -F": " '{print $2}')
+else
+ echo "calculando el sun del repo"
+ MD5SOURCE=$(md5sum $FILESOURCE | cut -f1 -d" ")
+fi
+if [ -f $FILETARGET.sum ]
+then
+ echo "leyendo el sum de la cache"
+ MD5TARGET=$(cat $FILETARGET.sum)
+else
+ echo "calculando el sum de la cache"
+ md5sum $FILETARGET | cut -f1 -d" " > $FILETARGET.sum
+ MD5TARGET=$(cat $FILETARGET.sum)
+fi
+
+echo "Paso 5. comparamos los md5"
+#TODO: que hacer cuando los md5 son distintos. Por defecto borrar.
+if [ "$MD5SOURCE" == "$MD5TARGET" ]
+then
+ echo "paso5.A la imagen esta en cache"
+ return 1
+else
+ echo "paso 5.b la imagen en cache es distinta, borramos la imagen anterior y devolvemos 0 para confirmar la actualizacion"
+ rm $FILETARGET
+ return 0
+fi
+
+}
+
+
diff --git a/client/engine/String.lib b/client/engine/String.lib
new file mode 100644
index 00000000..a81e3b07
--- /dev/null
+++ b/client/engine/String.lib
@@ -0,0 +1,123 @@
+#!/bin/bash
+
+#/**
+# ogCheckStringInGroup
+#@brief Función para determinar si el elemento pertenece a un conjunto
+#@param 1 elemento a comprobar
+#@param 2 grupo de elementos para comprobar tipo "valor1 valor2 valor3"
+#@return 0 si pertenece al grupo
+#@return 1 si NO pertenece al grupo
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@note
+#@todo
+#@version 0.91 - Definición de
+#@author Antonio Doblas Viso, Universidad de Málaga
+#@date 2010/05/09
+#*/ ##
+#/**
+ogCheckStringInGroup ()
+{
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME str_elemento str_grupo" \
+ "$FUNCNAME full-duplex \"full-duplex half-duplex broadcast\" "
+ return
+fi
+
+# Error si no se recibe 2 parámetro.
+[ $# == 2 ] || ogRaiseError $OG_ERR_FORMAT || return $?
+
+
+for i in `echo $2`
+do
+ if [ "$1" == "$i" ]
+ then
+ return 0
+ fi
+done
+
+return 1
+}
+
+#/**
+# ogCheckStringInReg
+#@brief Función para determinar si el elemento contiene una "expresión regular"
+#@param 1 elemento a comprobar
+#@param 2 expresión regular"
+#@return 0 si coincide con la expresión
+#@return 1 si NO coincide con la expresión
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@note
+#@todo
+#@version 0.91 - Definición de
+#@author Antonio Doblas Viso, Universidad de Málaga
+#@date 2010/05/09
+#*/ ##
+#/**
+
+
+ogCheckStringInReg()
+{
+
+local REG
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME str_elemento str_expresión_regular" \
+ "$FUNCNAME 50M \"^[0-9]{1,2}\M$\" "
+ return
+fi
+
+# Error si no se recibe 2 parámetro.
+[ $# == 2 ] || ogRaiseError $OG_ERR_FORMAT || return $?
+
+REG=$2
+[[ $1 =~ $REG ]] && return 0 || return 1
+}
+
+
+
+#/**
+# ogCheckIpAddress
+#@brief Función para determinar si una cadena es una dirección ipv4 válida
+#@param 1 string de la ip a comprobar
+#@return 0 si es una dirección válida
+#@return 1 si NO es una dirección válida
+#@exception OG_ERR_FORMAT formato incorrecto.
+#@note
+#@todo
+#@version 0.91 - Definición de
+#@author Antonio Doblas Viso, Universidad de Málaga
+#@date 2010/05/09
+#*/ ##
+#/**
+ogCheckIpAddress()
+{
+local REG IP arrIP
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME str_IpAddressToCheck" \
+ "$FUNCNAME 192.18.35.3"
+ return
+fi
+
+# Error si no se recibe 1 parámetro.
+[ $# == 1 ] || ogRaiseError $OG_ERR_FORMAT || return $?
+
+
+IP=$1
+REG="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
+if [[ "$IP" =~ $REG ]]
+then
+ OIFS=$IFS;
+ IFS='.' ;
+ arrIP=($IP)
+ IFS=$OIFS
+ if [[ ${arrIP[0]} -le 255 && ${arrIP[1]} -le 255 && ${arrIP[2]} -le 255 && ${arrIP[3]} -le 255 ]]
+ then
+ return 0
+ fi
+fi
+return 1
+}
diff --git a/client/engine/System.lib b/client/engine/System.lib
index 6e41b634..9973b596 100755
--- a/client/engine/System.lib
+++ b/client/engine/System.lib
@@ -95,10 +95,8 @@ return $CODE
function ogGetCaller () {
# Obtener el nombre del programa o del script que ha llamado al proceso actual.
-basename $(ps | grep $PPID | \
- awk -v P=$PPID '{if ($1==P) {
- if ($5~/bash/ && $6!="") print $6
- else print $5; } }')
+basename $(ps hlp $PPID | awk '{if ($13~/bash/ && $14!="") print $14;
+ else print $13;}')
}
@@ -158,3 +156,34 @@ while [ $# -gt 0 ]; do
shift
done
}
+
+ogCheckProgram ()
+{
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME \"str_program1 program2 programN\" " \
+ "$FUNCNAME \"partimage partclone mbuffer\" "
+ return
+fi
+
+# Error si no se recibe 1 parámetro.
+[ $# == 1 ] || ogRaiseError $OG_ERR_FORMAT || return $?
+
+local PERROR PLOG
+PERROR=0
+PLOG=" "
+for i in `echo $1`
+do
+ if [ ! `which $i` ]
+ then
+ PERROR=1
+ PLOG="$PLOG $i"
+ fi
+done
+if [ "$PERROR" == "1" ]
+then
+ ogRaiseError $OG_ERR_NOTEXEC "$PLOG" || return $?
+else
+ return 0
+fi
+}
diff --git a/client/nfsexport/bin/awk b/client/nfsexport/bin/awk
deleted file mode 100755
index 572fd029..00000000
--- a/client/nfsexport/bin/awk
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/bash b/client/nfsexport/bin/bash
deleted file mode 100755
index 90c65ec6..00000000
--- a/client/nfsexport/bin/bash
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/chntpw b/client/nfsexport/bin/chntpw
deleted file mode 100755
index 2396206a..00000000
--- a/client/nfsexport/bin/chntpw
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ctorrent b/client/nfsexport/bin/ctorrent
deleted file mode 100755
index 5ffdcd83..00000000
--- a/client/nfsexport/bin/ctorrent
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/dosfsck b/client/nfsexport/bin/dosfsck
deleted file mode 100755
index b041e1bd..00000000
--- a/client/nfsexport/bin/dosfsck
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/dosfslabel b/client/nfsexport/bin/dosfslabel
deleted file mode 100755
index 007894bb..00000000
--- a/client/nfsexport/bin/dosfslabel
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/gzip b/client/nfsexport/bin/i386/gzip
deleted file mode 100755
index 4cd612a8..00000000
--- a/client/nfsexport/bin/i386/gzip
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/mbuffer b/client/nfsexport/bin/i386/mbuffer
deleted file mode 100755
index 913121fb..00000000
--- a/client/nfsexport/bin/i386/mbuffer
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/mkntfs b/client/nfsexport/bin/i386/mkntfs
deleted file mode 100755
index e3a32f2e..00000000
--- a/client/nfsexport/bin/i386/mkntfs
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/partclone.btrfs b/client/nfsexport/bin/i386/partclone.btrfs
deleted file mode 100755
index f2bcff85..00000000
--- a/client/nfsexport/bin/i386/partclone.btrfs
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/partclone.chkimg b/client/nfsexport/bin/i386/partclone.chkimg
deleted file mode 100755
index 9499a8fb..00000000
--- a/client/nfsexport/bin/i386/partclone.chkimg
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/partclone.dd b/client/nfsexport/bin/i386/partclone.dd
deleted file mode 100755
index 440ea69c..00000000
--- a/client/nfsexport/bin/i386/partclone.dd
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/partclone.extfs b/client/nfsexport/bin/i386/partclone.extfs
deleted file mode 100755
index 8f5b2890..00000000
--- a/client/nfsexport/bin/i386/partclone.extfs
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/partclone.fat b/client/nfsexport/bin/i386/partclone.fat
deleted file mode 100755
index 038ee0a2..00000000
--- a/client/nfsexport/bin/i386/partclone.fat
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/partclone.hfsp b/client/nfsexport/bin/i386/partclone.hfsp
deleted file mode 100755
index fd60a93b..00000000
--- a/client/nfsexport/bin/i386/partclone.hfsp
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/partclone.info b/client/nfsexport/bin/i386/partclone.info
deleted file mode 100755
index 8a3cdaad..00000000
--- a/client/nfsexport/bin/i386/partclone.info
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/partclone.ntfs b/client/nfsexport/bin/i386/partclone.ntfs
deleted file mode 100755
index 221353b2..00000000
--- a/client/nfsexport/bin/i386/partclone.ntfs
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/partclone.ntfsfixboot b/client/nfsexport/bin/i386/partclone.ntfsfixboot
deleted file mode 100755
index 888b5087..00000000
--- a/client/nfsexport/bin/i386/partclone.ntfsfixboot
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/partclone.restore b/client/nfsexport/bin/i386/partclone.restore
deleted file mode 100755
index ddb00d9a..00000000
--- a/client/nfsexport/bin/i386/partclone.restore
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/partprobe b/client/nfsexport/bin/i386/partprobe
deleted file mode 100755
index acba5c6e..00000000
--- a/client/nfsexport/bin/i386/partprobe
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/udp-receiver b/client/nfsexport/bin/i386/udp-receiver
deleted file mode 100755
index 6b230aaa..00000000
--- a/client/nfsexport/bin/i386/udp-receiver
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/i386/udp-sender b/client/nfsexport/bin/i386/udp-sender
deleted file mode 100755
index 87789a05..00000000
--- a/client/nfsexport/bin/i386/udp-sender
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/kexec b/client/nfsexport/bin/kexec
deleted file mode 100755
index 279c9d21..00000000
--- a/client/nfsexport/bin/kexec
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/lshw b/client/nfsexport/bin/lshw
deleted file mode 100755
index 2aba62b1..00000000
--- a/client/nfsexport/bin/lshw
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/mkdosfs b/client/nfsexport/bin/mkdosfs
deleted file mode 100755
index 2fe2ce1f..00000000
--- a/client/nfsexport/bin/mkdosfs
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ms-sys b/client/nfsexport/bin/ms-sys
deleted file mode 100755
index 28ebe4ff..00000000
--- a/client/nfsexport/bin/ms-sys
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ntfscat b/client/nfsexport/bin/ntfscat
deleted file mode 100755
index 87d95353..00000000
--- a/client/nfsexport/bin/ntfscat
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ntfsclone b/client/nfsexport/bin/ntfsclone
deleted file mode 100755
index 280371dd..00000000
--- a/client/nfsexport/bin/ntfsclone
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ntfscluster b/client/nfsexport/bin/ntfscluster
deleted file mode 100755
index da9107cf..00000000
--- a/client/nfsexport/bin/ntfscluster
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ntfscmp b/client/nfsexport/bin/ntfscmp
deleted file mode 100755
index 81680cf6..00000000
--- a/client/nfsexport/bin/ntfscmp
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ntfscp b/client/nfsexport/bin/ntfscp
deleted file mode 100755
index 041ab83d..00000000
--- a/client/nfsexport/bin/ntfscp
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ntfsfix b/client/nfsexport/bin/ntfsfix
deleted file mode 100755
index a1ddcb8c..00000000
--- a/client/nfsexport/bin/ntfsfix
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ntfsinfo b/client/nfsexport/bin/ntfsinfo
deleted file mode 100755
index 4a4c456a..00000000
--- a/client/nfsexport/bin/ntfsinfo
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ntfslabel b/client/nfsexport/bin/ntfslabel
deleted file mode 100755
index edf31d90..00000000
--- a/client/nfsexport/bin/ntfslabel
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ntfsls b/client/nfsexport/bin/ntfsls
deleted file mode 100755
index bfbdb87b..00000000
--- a/client/nfsexport/bin/ntfsls
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ntfsundelete b/client/nfsexport/bin/ntfsundelete
deleted file mode 100755
index 383b348b..00000000
--- a/client/nfsexport/bin/ntfsundelete
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/ogAdmClient b/client/nfsexport/bin/ogAdmClient
deleted file mode 100755
index 27bdd1aa..00000000
--- a/client/nfsexport/bin/ogAdmClient
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/partimage b/client/nfsexport/bin/partimage
deleted file mode 100755
index 7e9cd8ee..00000000
--- a/client/nfsexport/bin/partimage
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/ethtool b/client/nfsexport/bin/testing/ethtool
deleted file mode 100755
index 36a9677c..00000000
--- a/client/nfsexport/bin/testing/ethtool
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/faucet b/client/nfsexport/bin/testing/faucet
deleted file mode 100755
index 85afbb19..00000000
--- a/client/nfsexport/bin/testing/faucet
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/file b/client/nfsexport/bin/testing/file
deleted file mode 100755
index 589afdf6..00000000
--- a/client/nfsexport/bin/testing/file
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/fsarchiver b/client/nfsexport/bin/testing/fsarchiver
deleted file mode 100755
index 0eb4a594..00000000
--- a/client/nfsexport/bin/testing/fsarchiver
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/hdparm b/client/nfsexport/bin/testing/hdparm
deleted file mode 100755
index 6be2c3ca..00000000
--- a/client/nfsexport/bin/testing/hdparm
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/hose b/client/nfsexport/bin/testing/hose
deleted file mode 100755
index 69f68573..00000000
--- a/client/nfsexport/bin/testing/hose
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/ifconfig b/client/nfsexport/bin/testing/ifconfig
deleted file mode 100755
index 788f898e..00000000
--- a/client/nfsexport/bin/testing/ifconfig
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/libgcc_s.so.1 b/client/nfsexport/bin/testing/libgcc_s.so.1
deleted file mode 100755
index c57a3b64..00000000
--- a/client/nfsexport/bin/testing/libgcc_s.so.1
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/libmagic.so.1 b/client/nfsexport/bin/testing/libmagic.so.1
deleted file mode 100644
index deb6107a..00000000
--- a/client/nfsexport/bin/testing/libmagic.so.1
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/lzop b/client/nfsexport/bin/testing/lzop
deleted file mode 100755
index 1389feb3..00000000
--- a/client/nfsexport/bin/testing/lzop
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/magic b/client/nfsexport/bin/testing/magic
deleted file mode 100644
index 7ae875db..00000000
--- a/client/nfsexport/bin/testing/magic
+++ /dev/null
@@ -1,15283 +0,0 @@
-# Magic data for file(1) command.
-# Format is described in magic(5).
-# Don't edit this file, edit /etc/magic or send your suggested inclusions to
-# this file as a wishlist bug against file (using the reportbug utility).
-
-
-#------------------------------------------------------------------------------
-# Localstuff: file(1) magic for locally observed files
-#
-# $File: Localstuff,v 1.4 2003/03/23 04:17:27 christos Exp $
-# Add any locally observed files here. Remember:
-# text if readable, executable if runnable binary, data if unreadable.
-#------------------------------------------------------------------------------
-# acorn: file(1) magic for files found on Acorn systems
-#
-
-# RISC OS Chunk File Format
-# From RISC OS Programmer's Reference Manual, Appendix D
-# We guess the file type from the type of the first chunk.
-0 lelong 0xc3cbc6c5 RISC OS Chunk data
->12 string OBJ_ \b, AOF object
->12 string LIB_ \b, ALF library
-
-# RISC OS AIF, contains "SWI OS_Exit" at offset 16.
-16 lelong 0xef000011 RISC OS AIF executable
-
-# RISC OS Draw files
-# From RISC OS Programmer's Reference Manual, Appendix E
-0 string Draw RISC OS Draw file data
-
-# RISC OS new format font files
-# From RISC OS Programmer's Reference Manual, Appendix E
-0 string FONT\0 RISC OS outline font data,
->5 byte x version %d
-0 string FONT\1 RISC OS 1bpp font data,
->5 byte x version %d
-0 string FONT\4 RISC OS 4bpp font data
->5 byte x version %d
-
-# RISC OS Music files
-# From RISC OS Programmer's Reference Manual, Appendix E
-0 string Maestro\r RISC OS music file
->8 byte x version %d
-
->8 byte x type %d
-
-# Digital Symphony data files
-# From: Bernard Jungen (bern8817@euphonynet.be)
-0 string \x02\x01\x13\x13\x13\x01\x0d\x10 Digital Symphony sound sample (RISC OS),
->8 byte x version %d,
->9 pstring x named "%s",
->(9.b+19) byte =0 8-bit logarithmic
->(9.b+19) byte =1 LZW-compressed linear
->(9.b+19) byte =2 8-bit linear signed
->(9.b+19) byte =3 16-bit linear signed
->(9.b+19) byte =4 SigmaDelta-compressed linear
->(9.b+19) byte =5 SigmaDelta-compressed logarithmic
->(9.b+19) byte >5 unknown format
-
-0 string \x02\x01\x13\x13\x14\x12\x01\x0b Digital Symphony song (RISC OS),
->8 byte x version %d,
->9 byte =1 1 voice,
->9 byte !1 %d voices,
->10 leshort =1 1 track,
->10 leshort !1 %d tracks,
->12 leshort =1 1 pattern
->12 leshort !1 %d patterns
-
-0 string \x02\x01\x13\x13\x10\x14\x12\x0e
->9 byte =0 Digital Symphony sequence (RISC OS),
->>8 byte x version %d,
->>10 byte =1 1 line,
->>10 byte !1 %d lines,
->>11 leshort =1 1 position
->>11 leshort !1 %d positions
->9 byte =1 Digital Symphony pattern data (RISC OS),
->>8 byte x version %d,
->>10 leshort =1 1 pattern
->>10 leshort !1 %d patterns
-
-#------------------------------------------------------------------------------
-# adi: file(1) magic for ADi's objects
-# From Gregory McGarry <g.mcgarry@ieee.org>
-#
-0 leshort 0x521c COFF DSP21k
->18 lelong &02 executable,
->18 lelong ^02
->>18 lelong &01 static object,
->>18 lelong ^01 relocatable object,
->18 lelong &010 stripped
->18 lelong ^010 not stripped
-
-#------------------------------------------------------------------------------
-# adventure: file(1) magic for Adventure game files
-#
-# from Allen Garvin <earendil@faeryland.tamu-commerce.edu>
-# Edited by Dave Chapeskie <dchapes@ddm.on.ca> Jun 28, 1998
-# Edited by Chris Chittleborough <cchittleborough@yahoo.com.au>, March 2002
-#
-# ALAN
-# I assume there are other, lower versions, but these are the only ones I
-# saw in the archive.
-0 beshort 0x0206 ALAN game data
->2 byte <10 version 2.6%d
-
-
-# Infocom (see z-machine)
-#------------------------------------------------------------------------------
-# Z-machine: file(1) magic for Z-machine binaries.
-#
-# Updated by Adam Buchbinder <adam.buchbinder@gmail.com>
-#
-# The first byte is the Z-machine revision; it is always between 1 and 8. We
-# had false matches (for instance, inbig5.ocp from the Omega TeX extension as
-# well as an occasional MP3 file), so we sanity-check the version number.
-#
-# It might be possible to sanity-check the release number as well, as it seems
-# (at least in classic Infocom games) to always be a relatively small number,
-# always under 150 or so, but as this isn't rigorous, we'll wait on that until
-# it becomes clear that it's needed.
-#
-0 ubyte >0
->0 ubyte <9
->>16 belong&0xfe00f0f0 0x3030 Infocom game data
->>>0 ubyte x (Z-machine %d,
->>>>2 ubeshort x Release %d /
->>>>18 string >\0 Serial %.6s)
-
-#------------------------------------------------------------------------------
-# Glulx: file(1) magic for Glulx binaries.
-#
-# I haven't checked for false matches yet.
-#
-0 string Glul Glulx game data
->4 beshort x (Version %d
->>6 byte x \b.%d
->>8 byte x \b.%d)
->36 string Info Compiled by Inform
-
-
-
-# For Quetzal and blorb magic see iff
-
-
-# TADS (Text Adventure Development System)
-# All files are machine-independent (games compile to byte-code) and are tagged
-# with a version string of the form "V2.<digit>.<digit>\0" (but TADS 3 is
-# on the way).
-# Game files start with "TADS2 bin\n\r\032\0" then the compiler version.
-0 string TADS2\ bin TADS
->9 belong !0x0A0D1A00 game data, CORRUPTED
->9 belong 0x0A0D1A00
->>13 string >\0 %s game data
-# Resource files start with "TADS2 rsc\n\r\032\0" then the compiler version.
-0 string TADS2\ rsc TADS
->9 belong !0x0A0D1A00 resource data, CORRUPTED
->9 belong 0x0A0D1A00
->>13 string >\0 %s resource data
-# Some saved game files start with "TADS2 save/g\n\r\032\0", a little-endian
-# 2-byte length N, the N-char name of the game file *without* a NUL (darn!),
-# "TADS2 save\n\r\032\0" and the interpreter version.
-0 string TADS2\ save/g TADS
->12 belong !0x0A0D1A00 saved game data, CORRUPTED
->12 belong 0x0A0D1A00
->>(16.s+32) string >\0 %s saved game data
-# Other saved game files start with "TADS2 save\n\r\032\0" and the interpreter
-# version.
-0 string TADS2\ save TADS
->10 belong !0x0A0D1A00 saved game data, CORRUPTED
->10 belong 0x0A0D1A00
->>14 string >\0 %s saved game data
-
-# Danny Milosavljevic <danny.milo@gmx.net>
-# this are adrift (adventure game standard) game files, extension .taf
-# depending on version magic continues with 0x93453E6139FA (V 4.0)
-# 0x9445376139FA (V 3.90)
-# 0x9445366139FA (V 3.80)
-# this is from source (http://www.adrift.org.uk/) and I have some taf
-# files, and checked them.
-#0 belong 0x3C423FC9
-#>4 belong 0x6A87C2CF Adrift game file
-#!:mime application/x-adrift
-#------------------------------------------------------------------------------
-# allegro: file(1) magic for Allegro datafiles
-# Toby Deshane <hac@shoelace.digivill.net>
-#
-0 belong 0x736C6821 Allegro datafile (packed)
-0 belong 0x736C682E Allegro datafile (not packed/autodetect)
-0 belong 0x736C682B Allegro datafile (appended exe data)
-
-#------------------------------------------------------------------------------
-# alliant: file(1) magic for Alliant FX series a.out files
-#
-# If the FX series is the one that had a processor with a 68K-derived
-# instruction set, the "short" should probably become "beshort" and the
-# "long" should probably become "belong".
-# If it's the i860-based one, they should probably become either the
-# big-endian or little-endian versions, depending on the mode they ran
-# the 860 in....
-#
-0 short 0420 0420 Alliant virtual executable
->2 short &0x0020 common library
->16 long >0 not stripped
-0 short 0421 0421 Alliant compact executable
->2 short &0x0020 common library
->16 long >0 not stripped
-#------------------------------------------------------------------------------
-# alpha architecture description
-#
-
-0 leshort 0603 COFF format alpha
->22 leshort&030000 !020000 executable
->24 leshort 0410 pure
->24 leshort 0413 paged
->22 leshort&020000 !0 dynamically linked
->16 lelong !0 not stripped
->16 lelong 0 stripped
->22 leshort&030000 020000 shared library
->24 leshort 0407 object
->27 byte x - version %d
->26 byte x .%d
->28 byte x -%d
-
-# Basic recognition of Digital UNIX core dumps - Mike Bremford <mike@opac.bl.uk>
-#
-# The actual magic number is just "Core", followed by a 2-byte version
-# number; however, treating any file that begins with "Core" as a Digital
-# UNIX core dump file may produce too many false hits, so we include one
-# byte of the version number as well; DU 5.0 appears only to be up to
-# version 2.
-#
-0 string Core\001 Alpha COFF format core dump (Digital UNIX)
->24 string >\0 \b, from '%s'
-0 string Core\002 Alpha COFF format core dump (Digital UNIX)
->24 string >\0 \b, from '%s'
-
-#------------------------------------------------------------------------------
-# amanda: file(1) magic for amanda file format
-#
-0 string AMANDA:\ AMANDA
->8 string TAPESTART\ DATE tape header file,
->>23 string X
->>>25 string >\ Unused %s
->>23 string >\ DATE %s
->8 string FILE\ dump file,
->>13 string >\ DATE %s
-#------------------------------------------------------------------------------
-# amigaos: file(1) magic for AmigaOS binary formats:
-
-#
-# From ignatios@cs.uni-bonn.de (Ignatios Souvatzis)
-#
-0 belong 0x000003fa AmigaOS shared library
-0 belong 0x000003f3 AmigaOS loadseg()ble executable/binary
-0 belong 0x000003e7 AmigaOS object/library data
-#
-0 beshort 0xe310 Amiga Workbench
->2 beshort 1
->>48 byte 1 disk icon
->>48 byte 2 drawer icon
->>48 byte 3 tool icon
->>48 byte 4 project icon
->>48 byte 5 garbage icon
->>48 byte 6 device icon
->>48 byte 7 kickstart icon
->>48 byte 8 workbench application icon
->2 beshort >1 icon, vers. %d
-#
-# various sound formats from the Amiga
-# G=F6tz Waschk <waschk@informatik.uni-rostock.de>
-#
-0 string FC14 Future Composer 1.4 Module sound file
-0 string SMOD Future Composer 1.3 Module sound file
-0 string AON4artofnoise Art Of Noise Module sound file
-1 string MUGICIAN/SOFTEYES Mugician Module sound file
-58 string SIDMON\ II\ -\ THE Sidmon 2.0 Module sound file
-0 string Synth4.0 Synthesis Module sound file
-0 string ARP. The Holy Noise Module sound file
-0 string BeEp\0 JamCracker Module sound file
-0 string COSO\0 Hippel-COSO Module sound file
-# Too simple (short, pure ASCII, deep), MPi
-#26 string V.3 Brian Postma's Soundmon Module sound file v3
-#26 string BPSM Brian Postma's Soundmon Module sound file v3
-#26 string V.2 Brian Postma's Soundmon Module sound file v2
-
-# The following are from: "Stefan A. Haubenthal" <polluks@web.de>
-0 beshort 0x0f00 AmigaOS bitmap font
-0 beshort 0x0f03 AmigaOS outline font
-0 belong 0x80001001 AmigaOS outline tag
-0 string ##\ version catalog translation
-0 string EMOD\0 Amiga E module
-8 string ECXM\0 ECX module
-0 string/c @database AmigaGuide file
-
-# Amiga disk types
-#
-0 string RDSK Rigid Disk Block
->160 string x on %.24s
-0 string DOS\0 Amiga DOS disk
-0 string DOS\1 Amiga FFS disk
-0 string DOS\2 Amiga Inter DOS disk
-0 string DOS\3 Amiga Inter FFS disk
-0 string DOS\4 Amiga Fastdir DOS disk
-0 string DOS\5 Amiga Fastdir FFS disk
-0 string KICK Kickstart disk
-
-# From: Alex Beregszaszi <alex@fsn.hu>
-0 string LZX LZX compressed archive (Amiga)
-
-
-#------------------------------------------------------------------------------
-# animation: file(1) magic for animation/movie formats
-#
-# animation formats
-# MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
-# FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
-
-# SGI and Apple formats
-0 string MOVI Silicon Graphics movie file
-!:mime video/x-sgi-movie
-4 string moov Apple QuickTime
-!:mime video/quicktime
->12 string mvhd \b movie (fast start)
->12 string mdra \b URL
->12 string cmov \b movie (fast start, compressed header)
->12 string rmra \b multiple URLs
-4 string mdat Apple QuickTime movie (unoptimized)
-!:mime video/quicktime
-#4 string wide Apple QuickTime movie (unoptimized)
-#!:mime video/quicktime
-#4 string skip Apple QuickTime movie (modified)
-#!:mime video/quicktime
-#4 string free Apple QuickTime movie (modified)
-#!:mime video/quicktime
-4 string idsc Apple QuickTime image (fast start)
-!:mime image/x-quicktime
-#4 string idat Apple QuickTime image (unoptimized)
-#!:mime image/x-quicktime
-4 string pckg Apple QuickTime compressed archive
-!:mime application/x-quicktime-player
-4 string/B jP JPEG 2000 image
-!:mime image/jp2
-4 string ftyp ISO Media
->8 string isom \b, MPEG v4 system, version 1
-!:mime video/mp4
->8 string iso2 \b, MPEG v4 system, part 12 revision
->8 string mp41 \b, MPEG v4 system, version 1
-!:mime video/mp4
->8 string mp42 \b, MPEG v4 system, version 2
-!:mime video/mp4
->8 string mp7t \b, MPEG v4 system, MPEG v7 XML
->8 string mp7b \b, MPEG v4 system, MPEG v7 binary XML
->8 string/B jp2 \b, JPEG 2000
-!:mime image/jp2
->8 string 3gp \b, MPEG v4 system, 3GPP
-!:mime video/3gpp
->>11 byte 4 \b v4 (H.263/AMR GSM 6.10)
->>11 byte 5 \b v5 (H.263/AMR GSM 6.10)
->>11 byte 6 \b v6 (ITU H.264/AMR GSM 6.10)
->8 string mmp4 \b, MPEG v4 system, 3GPP Mobile
-!:mime video/mp4
->8 string avc1 \b, MPEG v4 system, 3GPP JVT AVC
-!:mime video/3gpp
->8 string/B M4A \b, MPEG v4 system, iTunes AAC-LC
-!:mime audio/mp4
->8 string/B M4V \b, MPEG v4 system, iTunes AVC-LC
-!:mime video/mp4
->8 string/B M4P \b, MPEG v4 system, iTunes AES encrypted
->8 string/B M4B \b, MPEG v4 system, iTunes bookmarked
->8 string/B qt \b, Apple QuickTime movie
-!:mime video/quicktime
-
-# MPEG sequences
-# Scans for all common MPEG header start codes
-0 belong 0x00000001
->4 byte&0x1F 0x07 JVT NAL sequence, H.264 video
->>5 byte 66 \b, baseline
->>5 byte 77 \b, main
->>5 byte 88 \b, extended
->>7 byte x \b @ L %u
-0 belong&0xFFFFFF00 0x00000100
->3 byte 0xBA MPEG sequence
->>4 byte &0x40 \b, v2, program multiplex
->>4 byte ^0x40 \b, v1, system multiplex
->3 byte 0xBB MPEG sequence, v1/2, multiplex (missing pack header)
->3 byte&0x1F 0x07 MPEG sequence, H.264 video
->>4 byte 66 \b, baseline
->>4 byte 77 \b, main
->>4 byte 88 \b, extended
->>6 byte x \b @ L %u
->3 byte 0xB0 MPEG sequence, v4
->>5 belong 0x000001B5
->>>9 byte &0x80
->>>>10 byte&0xF0 16 \b, video
->>>>10 byte&0xF0 32 \b, still texture
->>>>10 byte&0xF0 48 \b, mesh
->>>>10 byte&0xF0 64 \b, face
->>>9 byte&0xF8 8 \b, video
->>>9 byte&0xF8 16 \b, still texture
->>>9 byte&0xF8 24 \b, mesh
->>>9 byte&0xF8 32 \b, face
->>4 byte 1 \b, simple @ L1
->>4 byte 2 \b, simple @ L2
->>4 byte 3 \b, simple @ L3
->>4 byte 4 \b, simple @ L0
->>4 byte 17 \b, simple scalable @ L1
->>4 byte 18 \b, simple scalable @ L2
->>4 byte 33 \b, core @ L1
->>4 byte 34 \b, core @ L2
->>4 byte 50 \b, main @ L2
->>4 byte 51 \b, main @ L3
->>4 byte 53 \b, main @ L4
->>4 byte 66 \b, n-bit @ L2
->>4 byte 81 \b, scalable texture @ L1
->>4 byte 97 \b, simple face animation @ L1
->>4 byte 98 \b, simple face animation @ L2
->>4 byte 99 \b, simple face basic animation @ L1
->>4 byte 100 \b, simple face basic animation @ L2
->>4 byte 113 \b, basic animation text @ L1
->>4 byte 114 \b, basic animation text @ L2
->>4 byte 129 \b, hybrid @ L1
->>4 byte 130 \b, hybrid @ L2
->>4 byte 145 \b, advanced RT simple @ L!
->>4 byte 146 \b, advanced RT simple @ L2
->>4 byte 147 \b, advanced RT simple @ L3
->>4 byte 148 \b, advanced RT simple @ L4
->>4 byte 161 \b, core scalable @ L1
->>4 byte 162 \b, core scalable @ L2
->>4 byte 163 \b, core scalable @ L3
->>4 byte 177 \b, advanced coding efficiency @ L1
->>4 byte 178 \b, advanced coding efficiency @ L2
->>4 byte 179 \b, advanced coding efficiency @ L3
->>4 byte 180 \b, advanced coding efficiency @ L4
->>4 byte 193 \b, advanced core @ L1
->>4 byte 194 \b, advanced core @ L2
->>4 byte 209 \b, advanced scalable texture @ L1
->>4 byte 210 \b, advanced scalable texture @ L2
->>4 byte 211 \b, advanced scalable texture @ L3
->>4 byte 225 \b, simple studio @ L1
->>4 byte 226 \b, simple studio @ L2
->>4 byte 227 \b, simple studio @ L3
->>4 byte 228 \b, simple studio @ L4
->>4 byte 229 \b, core studio @ L1
->>4 byte 230 \b, core studio @ L2
->>4 byte 231 \b, core studio @ L3
->>4 byte 232 \b, core studio @ L4
->>4 byte 240 \b, advanced simple @ L0
->>4 byte 241 \b, advanced simple @ L1
->>4 byte 242 \b, advanced simple @ L2
->>4 byte 243 \b, advanced simple @ L3
->>4 byte 244 \b, advanced simple @ L4
->>4 byte 245 \b, advanced simple @ L5
->>4 byte 247 \b, advanced simple @ L3b
->>4 byte 248 \b, FGS @ L0
->>4 byte 249 \b, FGS @ L1
->>4 byte 250 \b, FGS @ L2
->>4 byte 251 \b, FGS @ L3
->>4 byte 252 \b, FGS @ L4
->>4 byte 253 \b, FGS @ L5
->3 byte 0xB5 MPEG sequence, v4
->>4 byte &0x80
->>>5 byte&0xF0 16 \b, video (missing profile header)
->>>5 byte&0xF0 32 \b, still texture (missing profile header)
->>>5 byte&0xF0 48 \b, mesh (missing profile header)
->>>5 byte&0xF0 64 \b, face (missing profile header)
->>4 byte&0xF8 8 \b, video (missing profile header)
->>4 byte&0xF8 16 \b, still texture (missing profile header)
->>4 byte&0xF8 24 \b, mesh (missing profile header)
->>4 byte&0xF8 32 \b, face (missing profile header)
->3 byte 0xB3 MPEG sequence
->>12 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
->>12 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
->>12 belong 0x000001B5 \b, v2,
->>>16 byte&0x0F 1 \b HP
->>>16 byte&0x0F 2 \b Spt
->>>16 byte&0x0F 3 \b SNR
->>>16 byte&0x0F 4 \b MP
->>>16 byte&0x0F 5 \b SP
->>>17 byte&0xF0 64 \b@HL
->>>17 byte&0xF0 96 \b@H-14
->>>17 byte&0xF0 128 \b@ML
->>>17 byte&0xF0 160 \b@LL
->>>17 byte &0x08 \b progressive
->>>17 byte ^0x08 \b interlaced
->>>17 byte&0x06 2 \b Y'CbCr 4:2:0 video
->>>17 byte&0x06 4 \b Y'CbCr 4:2:2 video
->>>17 byte&0x06 6 \b Y'CbCr 4:4:4 video
->>11 byte &0x02
->>>75 byte &0x01
->>>>140 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
->>>>140 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
->>>>140 belong 0x000001B5 \b, v2,
->>>>>144 byte&0x0F 1 \b HP
->>>>>144 byte&0x0F 2 \b Spt
->>>>>144 byte&0x0F 3 \b SNR
->>>>>144 byte&0x0F 4 \b MP
->>>>>144 byte&0x0F 5 \b SP
->>>>>145 byte&0xF0 64 \b@HL
->>>>>145 byte&0xF0 96 \b@H-14
->>>>>145 byte&0xF0 128 \b@ML
->>>>>145 byte&0xF0 160 \b@LL
->>>>>145 byte &0x08 \b progressive
->>>>>145 byte ^0x08 \b interlaced
->>>>>145 byte&0x06 2 \b Y'CbCr 4:2:0 video
->>>>>145 byte&0x06 4 \b Y'CbCr 4:2:2 video
->>>>>145 byte&0x06 6 \b Y'CbCr 4:4:4 video
->>76 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
->>76 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
->>76 belong 0x000001B5 \b, v2,
->>>80 byte&0x0F 1 \b HP
->>>80 byte&0x0F 2 \b Spt
->>>80 byte&0x0F 3 \b SNR
->>>80 byte&0x0F 4 \b MP
->>>80 byte&0x0F 5 \b SP
->>>81 byte&0xF0 64 \b@HL
->>>81 byte&0xF0 96 \b@H-14
->>>81 byte&0xF0 128 \b@ML
->>>81 byte&0xF0 160 \b@LL
->>>81 byte &0x08 \b progressive
->>>81 byte ^0x08 \b interlaced
->>>81 byte&0x06 2 \b Y'CbCr 4:2:0 video
->>>81 byte&0x06 4 \b Y'CbCr 4:2:2 video
->>>81 byte&0x06 6 \b Y'CbCr 4:4:4 video
->>4 belong&0xFFFFFF00 0x78043800 \b, HD-TV 1920P
->>>7 byte&0xF0 0x10 \b, 16:9
->>4 belong&0xFFFFFF00 0x50002D00 \b, SD-TV 1280I
->>>7 byte&0xF0 0x10 \b, 16:9
->>4 belong&0xFFFFFF00 0x30024000 \b, PAL Capture
->>>7 byte&0xF0 0x10 \b, 4:3
->>4 beshort&0xFFF0 0x2C00 \b, 4CIF
->>>5 beshort&0x0FFF 0x01E0 \b NTSC
->>>5 beshort&0x0FFF 0x0240 \b PAL
->>>7 byte&0xF0 0x20 \b, 4:3
->>>7 byte&0xF0 0x30 \b, 16:9
->>>7 byte&0xF0 0x40 \b, 11:5
->>>7 byte&0xF0 0x80 \b, PAL 4:3
->>>7 byte&0xF0 0xC0 \b, NTSC 4:3
->>4 belong&0xFFFFFF00 0x2801E000 \b, LD-TV 640P
->>>7 byte&0xF0 0x10 \b, 4:3
->>4 belong&0xFFFFFF00 0x1400F000 \b, 320x240
->>>7 byte&0xF0 0x10 \b, 4:3
->>4 belong&0xFFFFFF00 0x0F00A000 \b, 240x160
->>>7 byte&0xF0 0x10 \b, 4:3
->>4 belong&0xFFFFFF00 0x0A007800 \b, 160x120
->>>7 byte&0xF0 0x10 \b, 4:3
->>4 beshort&0xFFF0 0x1600 \b, CIF
->>>5 beshort&0x0FFF 0x00F0 \b NTSC
->>>5 beshort&0x0FFF 0x0120 \b PAL
->>>7 byte&0xF0 0x20 \b, 4:3
->>>7 byte&0xF0 0x30 \b, 16:9
->>>7 byte&0xF0 0x40 \b, 11:5
->>>7 byte&0xF0 0x80 \b, PAL 4:3
->>>7 byte&0xF0 0xC0 \b, NTSC 4:3
->>>5 beshort&0x0FFF 0x0240 \b PAL 625
->>>>7 byte&0xF0 0x20 \b, 4:3
->>>>7 byte&0xF0 0x30 \b, 16:9
->>>>7 byte&0xF0 0x40 \b, 11:5
->>4 beshort&0xFFF0 0x2D00 \b, CCIR/ITU
->>>5 beshort&0x0FFF 0x01E0 \b NTSC 525
->>>5 beshort&0x0FFF 0x0240 \b PAL 625
->>>7 byte&0xF0 0x20 \b, 4:3
->>>7 byte&0xF0 0x30 \b, 16:9
->>>7 byte&0xF0 0x40 \b, 11:5
->>4 beshort&0xFFF0 0x1E00 \b, SVCD
->>>5 beshort&0x0FFF 0x01E0 \b NTSC 525
->>>5 beshort&0x0FFF 0x0240 \b PAL 625
->>>7 byte&0xF0 0x20 \b, 4:3
->>>7 byte&0xF0 0x30 \b, 16:9
->>>7 byte&0xF0 0x40 \b, 11:5
->>7 byte&0x0F 1 \b, 23.976 fps
->>7 byte&0x0F 2 \b, 24 fps
->>7 byte&0x0F 3 \b, 25 fps
->>7 byte&0x0F 4 \b, 29.97 fps
->>7 byte&0x0F 5 \b, 30 fps
->>7 byte&0x0F 6 \b, 50 fps
->>7 byte&0x0F 7 \b, 59.94 fps
->>7 byte&0x0F 8 \b, 60 fps
->>11 byte &0x04 \b, Constrained
-
-# MPEG ADTS Audio (*.mpx/mxa/aac)
-# from dreesen@math.fu-berlin.de
-# modified to fully support MPEG ADTS
-
-# MP3, M1A
-# modified by Joerg Jenderek
-# GRR the original test are too common for many DOS files
-# so don't accept as MP3 until we've tested the rate
-0 beshort&0xFFFE 0xFFFA
-# rates
->2 byte&0xF0 0x10 MPEG ADTS, layer III, v1, 32 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0x20 MPEG ADTS, layer III, v1, 40 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0x30 MPEG ADTS, layer III, v1, 48 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0x40 MPEG ADTS, layer III, v1, 56 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0x50 MPEG ADTS, layer III, v1, 64 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0x60 MPEG ADTS, layer III, v1, 80 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0x70 MPEG ADTS, layer III, v1, 96 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0x80 MPEG ADTS, layer III, v1, 112 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0x90 MPEG ADTS, layer III, v1, 128 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0xA0 MPEG ADTS, layer III, v1, 160 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0xB0 MPEG ADTS, layer III, v1, 192 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0xC0 MPEG ADTS, layer III, v1, 224 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0xD0 MPEG ADTS, layer III, v1, 256 kbps
-!:mime audio/mpeg
->2 byte&0xF0 0xE0 MPEG ADTS, layer III, v1, 320 kbps
-!:mime audio/mpeg
-# timing
->2 byte&0x0C 0x00 \b, 44.1 kHz
->2 byte&0x0C 0x04 \b, 48 kHz
->2 byte&0x0C 0x08 \b, 32 kHz
-# channels/options
->3 byte&0xC0 0x00 \b, Stereo
->3 byte&0xC0 0x40 \b, JntStereo
->3 byte&0xC0 0x80 \b, 2x Monaural
->3 byte&0xC0 0xC0 \b, Monaural
-#>1 byte ^0x01 \b, Data Verify
-#>2 byte &0x02 \b, Packet Pad
-#>2 byte &0x01 \b, Custom Flag
-#>3 byte &0x08 \b, Copyrighted
-#>3 byte &0x04 \b, Original Source
-#>3 byte&0x03 1 \b, NR: 50/15 ms
-#>3 byte&0x03 3 \b, NR: CCIT J.17
-
-# MP2, M1A
-0 beshort&0xFFFE 0xFFFC MPEG ADTS, layer II, v1
-!:mime audio/mpeg
-# rates
->2 byte&0xF0 0x10 \b, 32 kbps
->2 byte&0xF0 0x20 \b, 48 kbps
->2 byte&0xF0 0x30 \b, 56 kbps
->2 byte&0xF0 0x40 \b, 64 kbps
->2 byte&0xF0 0x50 \b, 80 kbps
->2 byte&0xF0 0x60 \b, 96 kbps
->2 byte&0xF0 0x70 \b, 112 kbps
->2 byte&0xF0 0x80 \b, 128 kbps
->2 byte&0xF0 0x90 \b, 160 kbps
->2 byte&0xF0 0xA0 \b, 192 kbps
->2 byte&0xF0 0xB0 \b, 224 kbps
->2 byte&0xF0 0xC0 \b, 256 kbps
->2 byte&0xF0 0xD0 \b, 320 kbps
->2 byte&0xF0 0xE0 \b, 384 kbps
-# timing
->2 byte&0x0C 0x00 \b, 44.1 kHz
->2 byte&0x0C 0x04 \b, 48 kHz
->2 byte&0x0C 0x08 \b, 32 kHz
-# channels/options
->3 byte&0xC0 0x00 \b, Stereo
->3 byte&0xC0 0x40 \b, JntStereo
->3 byte&0xC0 0x80 \b, 2x Monaural
->3 byte&0xC0 0xC0 \b, Monaural
-#>1 byte ^0x01 \b, Data Verify
-#>2 byte &0x02 \b, Packet Pad
-#>2 byte &0x01 \b, Custom Flag
-#>3 byte &0x08 \b, Copyrighted
-#>3 byte &0x04 \b, Original Source
-#>3 byte&0x03 1 \b, NR: 50/15 ms
-#>3 byte&0x03 3 \b, NR: CCIT J.17
-
-# MPA, M1A
-# updated by Joerg Jenderek
-# GRR the original test are too common for many DOS files, so test 32 <= kbits <= 448
-# GRR this test is still too general as it catches a BOM of UTF-16 files (0xFFFE)
-# FIXME: Almost all little endian UTF-16 text with BOM are clobbered by these entries
-#0 beshort&0xFFFE 0xFFFE
-#>2 ubyte&0xF0 >0x0F
-#>>2 ubyte&0xF0 <0xE1 MPEG ADTS, layer I, v1
-## rate
-#>>>2 byte&0xF0 0x10 \b, 32 kbps
-#>>>2 byte&0xF0 0x20 \b, 64 kbps
-#>>>2 byte&0xF0 0x30 \b, 96 kbps
-#>>>2 byte&0xF0 0x40 \b, 128 kbps
-#>>>2 byte&0xF0 0x50 \b, 160 kbps
-#>>>2 byte&0xF0 0x60 \b, 192 kbps
-#>>>2 byte&0xF0 0x70 \b, 224 kbps
-#>>>2 byte&0xF0 0x80 \b, 256 kbps
-#>>>2 byte&0xF0 0x90 \b, 288 kbps
-#>>>2 byte&0xF0 0xA0 \b, 320 kbps
-#>>>2 byte&0xF0 0xB0 \b, 352 kbps
-#>>>2 byte&0xF0 0xC0 \b, 384 kbps
-#>>>2 byte&0xF0 0xD0 \b, 416 kbps
-#>>>2 byte&0xF0 0xE0 \b, 448 kbps
-## timing
-#>>>2 byte&0x0C 0x00 \b, 44.1 kHz
-#>>>2 byte&0x0C 0x04 \b, 48 kHz
-#>>>2 byte&0x0C 0x08 \b, 32 kHz
-## channels/options
-#>>>3 byte&0xC0 0x00 \b, Stereo
-#>>>3 byte&0xC0 0x40 \b, JntStereo
-#>>>3 byte&0xC0 0x80 \b, 2x Monaural
-#>>>3 byte&0xC0 0xC0 \b, Monaural
-##>1 byte ^0x01 \b, Data Verify
-##>2 byte &0x02 \b, Packet Pad
-##>2 byte &0x01 \b, Custom Flag
-##>3 byte &0x08 \b, Copyrighted
-##>3 byte &0x04 \b, Original Source
-##>3 byte&0x03 1 \b, NR: 50/15 ms
-##>3 byte&0x03 3 \b, NR: CCIT J.17
-
-# MP3, M2A
-0 beshort&0xFFFE 0xFFF2 MPEG ADTS, layer III, v2
-!:mime audio/mpeg
-# rate
->2 byte&0xF0 0x10 \b, 8 kbps
->2 byte&0xF0 0x20 \b, 16 kbps
->2 byte&0xF0 0x30 \b, 24 kbps
->2 byte&0xF0 0x40 \b, 32 kbps
->2 byte&0xF0 0x50 \b, 40 kbps
->2 byte&0xF0 0x60 \b, 48 kbps
->2 byte&0xF0 0x70 \b, 56 kbps
->2 byte&0xF0 0x80 \b, 64 kbps
->2 byte&0xF0 0x90 \b, 80 kbps
->2 byte&0xF0 0xA0 \b, 96 kbps
->2 byte&0xF0 0xB0 \b, 112 kbps
->2 byte&0xF0 0xC0 \b, 128 kbps
->2 byte&0xF0 0xD0 \b, 144 kbps
->2 byte&0xF0 0xE0 \b, 160 kbps
-# timing
->2 byte&0x0C 0x00 \b, 22.05 kHz
->2 byte&0x0C 0x04 \b, 24 kHz
->2 byte&0x0C 0x08 \b, 16 kHz
-# channels/options
->3 byte&0xC0 0x00 \b, Stereo
->3 byte&0xC0 0x40 \b, JntStereo
->3 byte&0xC0 0x80 \b, 2x Monaural
->3 byte&0xC0 0xC0 \b, Monaural
-#>1 byte ^0x01 \b, Data Verify
-#>2 byte &0x02 \b, Packet Pad
-#>2 byte &0x01 \b, Custom Flag
-#>3 byte &0x08 \b, Copyrighted
-#>3 byte &0x04 \b, Original Source
-#>3 byte&0x03 1 \b, NR: 50/15 ms
-#>3 byte&0x03 3 \b, NR: CCIT J.17
-
-# MP2, M2A
-0 beshort&0xFFFE 0xFFF4 MPEG ADTS, layer II, v2
-# rate
->2 byte&0xF0 0x10 \b, 8 kbps
->2 byte&0xF0 0x20 \b, 16 kbps
->2 byte&0xF0 0x30 \b, 24 kbps
->2 byte&0xF0 0x40 \b, 32 kbps
->2 byte&0xF0 0x50 \b, 40 kbps
->2 byte&0xF0 0x60 \b, 48 kbps
->2 byte&0xF0 0x70 \b, 56 kbps
->2 byte&0xF0 0x80 \b, 64 kbps
->2 byte&0xF0 0x90 \b, 80 kbps
->2 byte&0xF0 0xA0 \b, 96 kbps
->2 byte&0xF0 0xB0 \b, 112 kbps
->2 byte&0xF0 0xC0 \b, 128 kbps
->2 byte&0xF0 0xD0 \b, 144 kbps
->2 byte&0xF0 0xE0 \b, 160 kbps
-# timing
->2 byte&0x0C 0x00 \b, 22.05 kHz
->2 byte&0x0C 0x04 \b, 24 kHz
->2 byte&0x0C 0x08 \b, 16 kHz
-# channels/options
->3 byte&0xC0 0x00 \b, Stereo
->3 byte&0xC0 0x40 \b, JntStereo
->3 byte&0xC0 0x80 \b, 2x Monaural
->3 byte&0xC0 0xC0 \b, Monaural
-#>1 byte ^0x01 \b, Data Verify
-#>2 byte &0x02 \b, Packet Pad
-#>2 byte &0x01 \b, Custom Flag
-#>3 byte &0x08 \b, Copyrighted
-#>3 byte &0x04 \b, Original Source
-#>3 byte&0x03 1 \b, NR: 50/15 ms
-#>3 byte&0x03 3 \b, NR: CCIT J.17
-
-# MPA, M2A
-0 beshort&0xFFFE 0xFFF6 MPEG ADTS, layer I, v2
-# rate
->2 byte&0xF0 0x10 \b, 32 kbps
->2 byte&0xF0 0x20 \b, 48 kbps
->2 byte&0xF0 0x30 \b, 56 kbps
->2 byte&0xF0 0x40 \b, 64 kbps
->2 byte&0xF0 0x50 \b, 80 kbps
->2 byte&0xF0 0x60 \b, 96 kbps
->2 byte&0xF0 0x70 \b, 112 kbps
->2 byte&0xF0 0x80 \b, 128 kbps
->2 byte&0xF0 0x90 \b, 144 kbps
->2 byte&0xF0 0xA0 \b, 160 kbps
->2 byte&0xF0 0xB0 \b, 176 kbps
->2 byte&0xF0 0xC0 \b, 192 kbps
->2 byte&0xF0 0xD0 \b, 224 kbps
->2 byte&0xF0 0xE0 \b, 256 kbps
-# timing
->2 byte&0x0C 0x00 \b, 22.05 kHz
->2 byte&0x0C 0x04 \b, 24 kHz
->2 byte&0x0C 0x08 \b, 16 kHz
-# channels/options
->3 byte&0xC0 0x00 \b, Stereo
->3 byte&0xC0 0x40 \b, JntStereo
->3 byte&0xC0 0x80 \b, 2x Monaural
->3 byte&0xC0 0xC0 \b, Monaural
-#>1 byte ^0x01 \b, Data Verify
-#>2 byte &0x02 \b, Packet Pad
-#>2 byte &0x01 \b, Custom Flag
-#>3 byte &0x08 \b, Copyrighted
-#>3 byte &0x04 \b, Original Source
-#>3 byte&0x03 1 \b, NR: 50/15 ms
-#>3 byte&0x03 3 \b, NR: CCIT J.17
-
-# MP3, M25A
-0 beshort&0xFFFE 0xFFE2 MPEG ADTS, layer III, v2.5
-# rate
->2 byte&0xF0 0x10 \b, 8 kbps
->2 byte&0xF0 0x20 \b, 16 kbps
->2 byte&0xF0 0x30 \b, 24 kbps
->2 byte&0xF0 0x40 \b, 32 kbps
->2 byte&0xF0 0x50 \b, 40 kbps
->2 byte&0xF0 0x60 \b, 48 kbps
->2 byte&0xF0 0x70 \b, 56 kbps
->2 byte&0xF0 0x80 \b, 64 kbps
->2 byte&0xF0 0x90 \b, 80 kbps
->2 byte&0xF0 0xA0 \b, 96 kbps
->2 byte&0xF0 0xB0 \b, 112 kbps
->2 byte&0xF0 0xC0 \b, 128 kbps
->2 byte&0xF0 0xD0 \b, 144 kbps
->2 byte&0xF0 0xE0 \b, 160 kbps
-# timing
->2 byte&0x0C 0x00 \b, 11.025 kHz
->2 byte&0x0C 0x04 \b, 12 kHz
->2 byte&0x0C 0x08 \b, 8 kHz
-# channels/options
->3 byte&0xC0 0x00 \b, Stereo
->3 byte&0xC0 0x40 \b, JntStereo
->3 byte&0xC0 0x80 \b, 2x Monaural
->3 byte&0xC0 0xC0 \b, Monaural
-#>1 byte ^0x01 \b, Data Verify
-#>2 byte &0x02 \b, Packet Pad
-#>2 byte &0x01 \b, Custom Flag
-#>3 byte &0x08 \b, Copyrighted
-#>3 byte &0x04 \b, Original Source
-#>3 byte&0x03 1 \b, NR: 50/15 ms
-#>3 byte&0x03 3 \b, NR: CCIT J.17
-
-# AAC (aka MPEG-2 NBC audio) and MPEG-4 audio
-
-# Stored AAC streams (instead of the MP4 format)
-0 string ADIF MPEG ADIF, AAC
-!:mime audio/x-hx-aac-adif
->4 byte &0x80
->>13 byte &0x10 \b, VBR
->>13 byte ^0x10 \b, CBR
->>16 byte&0x1E 0x02 \b, single stream
->>16 byte&0x1E 0x04 \b, 2 streams
->>16 byte&0x1E 0x06 \b, 3 streams
->>16 byte &0x08 \b, 4 or more streams
->>16 byte &0x10 \b, 8 or more streams
->>4 byte &0x80 \b, Copyrighted
->>13 byte &0x40 \b, Original Source
->>13 byte &0x20 \b, Home Flag
->4 byte ^0x80
->>4 byte &0x10 \b, VBR
->>4 byte ^0x10 \b, CBR
->>7 byte&0x1E 0x02 \b, single stream
->>7 byte&0x1E 0x04 \b, 2 streams
->>7 byte&0x1E 0x06 \b, 3 streams
->>7 byte &0x08 \b, 4 or more streams
->>7 byte &0x10 \b, 8 or more streams
->>4 byte &0x40 \b, Original Stream(s)
->>4 byte &0x20 \b, Home Source
-
-# Live or stored single AAC stream (used with MPEG-2 systems)
-0 beshort&0xFFF6 0xFFF0 MPEG ADTS, AAC
-!:mime audio/x-hx-aac-adts
->1 byte &0x08 \b, v2
->1 byte ^0x08 \b, v4
-# profile
->>2 byte &0xC0 \b LTP
->2 byte&0xc0 0x00 \b Main
->2 byte&0xc0 0x40 \b LC
->2 byte&0xc0 0x80 \b SSR
-# timing
->2 byte&0x3c 0x00 \b, 96 kHz
->2 byte&0x3c 0x04 \b, 88.2 kHz
->2 byte&0x3c 0x08 \b, 64 kHz
->2 byte&0x3c 0x0c \b, 48 kHz
->2 byte&0x3c 0x10 \b, 44.1 kHz
->2 byte&0x3c 0x14 \b, 32 kHz
->2 byte&0x3c 0x18 \b, 24 kHz
->2 byte&0x3c 0x1c \b, 22.05 kHz
->2 byte&0x3c 0x20 \b, 16 kHz
->2 byte&0x3c 0x24 \b, 12 kHz
->2 byte&0x3c 0x28 \b, 11.025 kHz
->2 byte&0x3c 0x2c \b, 8 kHz
-# channels
->2 beshort&0x01c0 0x0040 \b, monaural
->2 beshort&0x01c0 0x0080 \b, stereo
->2 beshort&0x01c0 0x00c0 \b, stereo + center
->2 beshort&0x01c0 0x0100 \b, stereo+center+LFE
->2 beshort&0x01c0 0x0140 \b, surround
->2 beshort&0x01c0 0x0180 \b, surround + LFE
->2 beshort &0x01C0 \b, surround + side
-#>1 byte ^0x01 \b, Data Verify
-#>2 byte &0x02 \b, Custom Flag
-#>3 byte &0x20 \b, Original Stream
-#>3 byte &0x10 \b, Home Source
-#>3 byte &0x08 \b, Copyrighted
-
-# Live MPEG-4 audio streams (instead of RTP FlexMux)
-0 beshort&0xFFE0 0x56E0 MPEG-4 LOAS
-!:mime audio/x-mp4a-latm
-#>1 beshort&0x1FFF x \b, %u byte packet
->3 byte&0xE0 0x40
->>4 byte&0x3C 0x04 \b, single stream
->>4 byte&0x3C 0x08 \b, 2 streams
->>4 byte&0x3C 0x0C \b, 3 streams
->>4 byte &0x08 \b, 4 or more streams
->>4 byte &0x20 \b, 8 or more streams
->3 byte&0xC0 0
->>4 byte&0x78 0x08 \b, single stream
->>4 byte&0x78 0x10 \b, 2 streams
->>4 byte&0x78 0x18 \b, 3 streams
->>4 byte &0x20 \b, 4 or more streams
->>4 byte &0x40 \b, 8 or more streams
-# This magic isn't strong enough (matches plausible ISO-8859-1 text)
-#0 beshort 0x4DE1 MPEG-4 LO-EP audio stream
-#!:mime audio/x-mp4a-latm
-
-# Summary: FLI animation format
-# Created by: Daniel Quinlan <quinlan@yggdrasil.com>
-# Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
-4 leshort 0xAF11
-# standard FLI always has 320x200 resolution and 8 bit color
->8 leshort 320
->>10 leshort 200
->>>12 leshort 8 FLI animation, 320x200x8
-!:mime video/x-fli
->>>>6 leshort x \b, %d frames
-# frame speed is multiple of 1/70s
->>>>16 leshort x \b, %d/70s per frame
-
-# Summary: FLC animation format
-# Created by: Daniel Quinlan <quinlan@yggdrasil.com>
-# Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
-4 leshort 0xAF12
-# standard FLC always use 8 bit color
->12 leshort 8 FLC animation
-!:mime video/x-flc
->>8 leshort x \b, %d
->>10 leshort x \bx%dx8
->>6 uleshort x \b, %d frames
->>16 uleshort x \b, %dms per frame
-
-# DL animation format
-# XXX - collision with most `mips' magic
-#
-# I couldn't find a real magic number for these, however, this
-# -appears- to work. Note that it might catch other files, too, so be
-# careful!
-#
-# Note that title and author appear in the two 20-byte chunks
-# at decimal offsets 2 and 22, respectively, but they are XOR'ed with
-# 255 (hex FF)! The DL format is really bad.
-#
-#0 byte 1 DL version 1, medium format (160x100, 4 images/screen)
-#!:mime video/x-unknown
-#>42 byte x - %d screens,
-#>43 byte x %d commands
-#0 byte 2 DL version 2
-#!:mime video/x-unknown
-#>1 byte 1 - large format (320x200,1 image/screen),
-#>1 byte 2 - medium format (160x100,4 images/screen),
-#>1 byte >2 - unknown format,
-#>42 byte x %d screens,
-#>43 byte x %d commands
-# Based on empirical evidence, DL version 3 have several nulls following the
-# \003. Most of them start with non-null values at hex offset 0x34 or so.
-#0 string \3\0\0\0\0\0\0\0\0\0\0\0 DL version 3
-
-# iso 13818 transport stream
-#
-# from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
-# (the following is a little bit restrictive and works fine for a stream
-# that starts with PAT properly. it won't work for stream data, that is
-# cut from an input device data right in the middle, but this shouldn't
-# disturb)
-# syncbyte 8 bit 0x47
-# error_ind 1 bit -
-# payload_start 1 bit 1
-# priority 1 bit -
-# PID 13 bit 0x0000
-# scrambling 2 bit -
-# adaptfld_ctrl 2 bit 1 or 3
-# conti_count 4 bit 0
-0 belong&0xFF5FFF1F 0x47400010 MPEG transport stream data
->188 byte !0x47 CORRUPTED
-
-# DIF digital video file format <mpruett@sgi.com>
-0 belong&0xffffff00 0x1f070000 DIF
->4 byte &0x01 (DVCPRO) movie file
->4 byte ^0x01 (DV) movie file
->3 byte &0x80 (PAL)
->3 byte ^0x80 (NTSC)
-
-# Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
-0 belong 0x3026b275 Microsoft ASF
-!:mime video/x-ms-asf
-
-# MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
-0 string \x8aMNG MNG video data,
-!:mime video/x-mng
->4 belong !0x0d0a1a0a CORRUPTED,
->4 belong 0x0d0a1a0a
->>16 belong x %ld x
->>20 belong x %ld
-
-# JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
-0 string \x8bJNG JNG video data,
-!:mime video/x-jng
->4 belong !0x0d0a1a0a CORRUPTED,
->4 belong 0x0d0a1a0a
->>16 belong x %ld x
->>20 belong x %ld
-
-# Vivo video (Wolfram Kleff)
-3 string \x0D\x0AVersion:Vivo Vivo video data
-
-# VRML (Virtual Reality Modelling Language)
-0 string/b #VRML\ V1.0\ ascii VRML 1 file
-!:mime model/vrml
-0 string/b #VRML\ V2.0\ utf8 ISO/IEC 14772 VRML 97 file
-!:mime model/vrml
-
-# X3D (Extensible 3D) [http://www.web3d.org/specifications/x3d-3.0.dtd]
-# From Michel Briand <michelbriand@free.fr>
-0 string \<?xml\ version="
-!:strength +1
->20 search/1000/cb \<!DOCTYPE\ X3D X3D (Extensible 3D) model xml text
-!:mime model/x3d
-
-#---------------------------------------------------------------------------
-# HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
-# From Mark Sheppard <msheppard@climax.co.uk>, 2002-10-03
-#
-0 string HVQM4 %s
->6 string >\0 v%s
->0 byte x GameCube movie,
->0x34 ubeshort x %d x
->0x36 ubeshort x %d,
->0x26 ubeshort x %dµs,
->0x42 ubeshort 0 no audio
->0x42 ubeshort >0 %dHz audio
-
-# From: "Stefan A. Haubenthal" <polluks@web.de>
-0 string DVDVIDEO-VTS Video title set,
->0x21 byte x v%x
-0 string DVDVIDEO-VMG Video manager,
->0x21 byte x v%x
-
-# From: Behan Webster <behanw@websterwood.com>
-# NuppelVideo used by Mythtv (*.nuv)
-# Note: there are two identical stanzas here differing only in the
-# initial string matched. It used to be done with a regex, but we're
-# trying to get rid of those.
-0 string NuppelVideo MythTV NuppelVideo
->12 string x v%s
->20 lelong x (%d
->24 lelong x \bx%d),
->36 string P \bprogressive,
->36 string I \binterlaced,
->40 ledouble x \baspect:%.2f,
->48 ledouble x \bfps:%.2f
-0 string MythTV MythTV NuppelVideo
->12 string x v%s
->20 lelong x (%d
->24 lelong x \bx%d),
->36 string P \bprogressive,
->36 string I \binterlaced,
->40 ledouble x \baspect:%.2f,
->48 ledouble x \bfps:%.2f
-
-# MPEG file
-# MPEG sequences
-# FIXME: This section is from the old magic.mime file and needs integrating with the rest
-0 belong 0x000001BA
->4 byte &0x40
-!:mime video/mp2p
->4 byte ^0x40
-!:mime video/mpeg
-0 belong 0x000001BB
-!:mime video/mpeg
-0 belong 0x000001B0
-!:mime video/mp4v-es
-0 belong 0x000001B5
-!:mime video/mp4v-es
-0 belong 0x000001B3
-!:mime video/mpv
-0 belong&0xFF5FFF1F 0x47400010
-!:mime video/mp2t
-0 belong 0x00000001
->4 byte&0x1F 0x07
-!:mime video/h264
-
-# Type: Bink Video
-# URL: http://wiki.multimedia.cx/index.php?title=3DBink_Container
-# From: <hoehle@users.sourceforge.net> 2008-07-18
-0 string BIK Bink Video
->3 regex =[a-z] rev.%s
-#>4 ulelong x size %d
->20 ulelong x \b, %d
->24 ulelong x \bx%d
->8 ulelong x \b, %d frames
->32 ulelong x at rate %d/
->28 ulelong >1 \b%d
->40 ulelong =0 \b, no audio
->40 ulelong !0 \b, %d audio track
->>40 ulelong !1 \bs
-# follow properties of the first audio track only
->>48 uleshort x %dHz
->>51 byte&0x20 0 mono
->>51 byte&0x20 !0 stereo
-#>>51 byte&0x10 0 FFT
-#>>51 byte&0x10 !0 DCT
-
-#------------------------------------------------------------------------------
-# apl: file(1) magic for APL (see also "pdp" and "vax" for other APL
-# workspaces)
-#
-0 long 0100554 APL workspace (Ken's original?)
-#------------------------------------------------------------------------------
-# apple: file(1) magic for Apple file formats
-#
-0 search/1 FiLeStArTfIlEsTaRt binscii (apple ][) text
-0 string \x0aGL Binary II (apple ][) data
-0 string \x76\xff Squeezed (apple ][) data
-0 string NuFile NuFile archive (apple ][) data
-0 string N\xf5F\xe9l\xe5 NuFile archive (apple ][) data
-0 belong 0x00051600 AppleSingle encoded Macintosh file
-0 belong 0x00051607 AppleDouble encoded Macintosh file
-
-# Type: Apple Emulator 2IMG format
-# From: Radek Vokal <rvokal@redhat.com>
-0 string 2IMG Apple ][ 2IMG Disk Image
->4 string XGS! \b, XGS
->4 string CTKG \b, Catakig
->4 string ShIm \b, Sheppy's ImageMaker
->4 string WOOF \b, Sweet 16
->4 string B2TR \b, Bernie ][ the Rescue
->4 string !nfc \b, ASIMOV2
->4 string x \b, Unknown Format
->0xc byte 00 \b, DOS 3.3 sector order
->>0x10 byte 00 \b, Volume 254
->>0x10 byte&0x7f x \b, Volume %u
->0xc byte 01 \b, ProDOS sector order
->>0x14 short x \b, %u Blocks
->0xc byte 02 \b, NIB data
-
-# magic for Newton PDA package formats
-# from Ruda Moura <ruda@helllabs.org>
-0 string package0 Newton package, NOS 1.x,
->12 belong &0x80000000 AutoRemove,
->12 belong &0x40000000 CopyProtect,
->12 belong &0x10000000 NoCompression,
->12 belong &0x04000000 Relocation,
->12 belong &0x02000000 UseFasterCompression,
->16 belong x version %d
-
-0 string package1 Newton package, NOS 2.x,
->12 belong &0x80000000 AutoRemove,
->12 belong &0x40000000 CopyProtect,
->12 belong &0x10000000 NoCompression,
->12 belong &0x04000000 Relocation,
->12 belong &0x02000000 UseFasterCompression,
->16 belong x version %d
-
-0 string package4 Newton package,
->8 byte 8 NOS 1.x,
->8 byte 9 NOS 2.x,
->12 belong &0x80000000 AutoRemove,
->12 belong &0x40000000 CopyProtect,
->12 belong &0x10000000 NoCompression,
-
-# The following entries for the Apple II are for files that have
-# been transferred as raw binary data from an Apple, without having
-# been encapsulated by any of the above archivers.
-#
-# In general, Apple II formats are hard to identify because Apple DOS
-# and especially Apple ProDOS have strong typing in the file system and
-# therefore programmers never felt much need to include type information
-# in the files themselves.
-#
-# Eric Fischer <enf@pobox.com>
-
-# AppleWorks word processor:
-#
-# This matches the standard tab stops for an AppleWorks file, but if
-# a file has a tab stop set in the first four columns this will fail.
-#
-# The "O" is really the magic number, but that's so common that it's
-# necessary to check the tab stops that follow it to avoid false positives.
-
-4 string O==== AppleWorks word processor data
->85 byte&0x01 >0 \b, zoomed
->90 byte&0x01 >0 \b, paginated
->92 byte&0x01 >0 \b, with mail merge
-#>91 byte x \b, left margin %d
-
-# AppleWorks database:
-#
-# This isn't really a magic number, but it's the closest thing to one
-# that I could find. The 1 and 2 really mean "order in which you defined
-# categories" and "left to right, top to bottom," respectively; the D and R
-# mean that the cursor should move either down or right when you press Return.
-
-#30 string \x01D AppleWorks database data
-#30 string \x02D AppleWorks database data
-#30 string \x01R AppleWorks database data
-#30 string \x02R AppleWorks database data
-
-# AppleWorks spreadsheet:
-#
-# Likewise, this isn't really meant as a magic number. The R or C means
-# row- or column-order recalculation; the A or M means automatic or manual
-# recalculation.
-
-#131 string RA AppleWorks spreadsheet data
-#131 string RM AppleWorks spreadsheet data
-#131 string CA AppleWorks spreadsheet data
-#131 string CM AppleWorks spreadsheet data
-
-# Applesoft BASIC:
-#
-# This is incredibly sloppy, but will be true if the program was
-# written at its usual memory location of 2048 and its first line
-# number is less than 256. Yuck.
-
-0 belong&0xff00ff 0x80000 Applesoft BASIC program data
-#>2 leshort x \b, first line number %d
-
-# ORCA/EZ assembler:
-#
-# This will not identify ORCA/M source files, since those have
-# some sort of date code instead of the two zero bytes at 6 and 7
-# XXX Conflicts with ELF
-#4 belong&0xff00ffff 0x01000000 ORCA/EZ assembler source data
-#>5 byte x \b, build number %d
-
-# Broderbund Fantavision
-#
-# I don't know what these values really mean, but they seem to recur.
-# Will they cause too many conflicts?
-
-# Probably :-)
-#2 belong&0xFF00FF 0x040008 Fantavision movie data
-
-# Some attempts at images.
-#
-# These are actually just bit-for-bit dumps of the frame buffer, so
-# there's really no reasonably way to distinguish them except for their
-# address (if preserved) -- 8192 or 16384 -- and their length -- 8192
-# or, occasionally, 8184.
-#
-# Nevertheless this will manage to catch a lot of images that happen
-# to have a solid-colored line at the bottom of the screen.
-
-# GRR: Magic too weak
-#8144 string \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F Apple II image with white background
-#8144 string \x55\x2A\x55\x2A\x55\x2A\x55\x2A Apple II image with purple background
-#8144 string \x2A\x55\x2A\x55\x2A\x55\x2A\x55 Apple II image with green background
-#8144 string \xD5\xAA\xD5\xAA\xD5\xAA\xD5\xAA Apple II image with blue background
-#8144 string \xAA\xD5\xAA\xD5\xAA\xD5\xAA\xD5 Apple II image with orange background
-
-# Beagle Bros. Apple Mechanic fonts
-
-0 belong&0xFF00FFFF 0x6400D000 Apple Mechanic font
-
-# Apple Universal Disk Image Format (UDIF) - dmg files.
-# From Johan Gade.
-# These entries are disabled for now until we fix the following issues.
-#
-# Note there might be some problems with the "VAX COFF executable"
-# entry. Note this entry should be placed before the mac filesystem section,
-# particularly the "Apple Partition data" entry.
-#
-# The intended meaning of these tests is, that the file is only of the
-# specified type if both of the lines are correct - i.e. if the first
-# line matches and the second doesn't then it is not of that type.
-#
-#0 long 0x7801730d
-#>4 long 0x62626060 UDIF read-only zlib-compressed image (UDZO)
-#
-# Note that this entry is recognized correctly by the "Apple Partition
-# data" entry - however since this entry is more specific - this
-# information seems to be more useful.
-#0 long 0x45520200
-#>0x410 string disk\ image UDIF read/write image (UDRW)
-
-# From: Toby Peterson <toby@apple.com>
-0 string bplist00 Apple binary property list
-
-# Apple binary property list (bplist)
-# Assumes version bytes are hex.
-# Provides content hints for version 0 files. Assumes that the root
-# object is the first object (true for CoreFoundation implementation).
-# From: David Remahl <dremahl@apple.com>
-0 string bplist
->6 byte x \bCoreFoundation binary property list data, version 0x%c
->>7 byte x \b%c
->6 string 00 \b
->>8 byte&0xF0 0x00 \b
->>>8 byte&0x0F 0x00 \b, root type: null
->>>8 byte&0x0F 0x08 \b, root type: false boolean
->>>8 byte&0x0F 0x09 \b, root type: true boolean
->>8 byte&0xF0 0x10 \b, root type: integer
->>8 byte&0xF0 0x20 \b, root type: real
->>8 byte&0xF0 0x30 \b, root type: date
->>8 byte&0xF0 0x40 \b, root type: data
->>8 byte&0xF0 0x50 \b, root type: ascii string
->>8 byte&0xF0 0x60 \b, root type: unicode string
->>8 byte&0xF0 0x80 \b, root type: uid (CORRUPT)
->>8 byte&0xF0 0xa0 \b, root type: array
->>8 byte&0xF0 0xd0 \b, root type: dictionary
-
-# Apple/NeXT typedstream data
-# Serialization format used by NeXT and Apple for various
-# purposes in YellowStep/Cocoa, including some nib files.
-# From: David Remahl <dremahl@apple.com>
-2 string typedstream NeXT/Apple typedstream data, big endian
->0 byte x \b, version %hhd
->0 byte <5 \b
->>13 byte 0x81 \b
->>>14 ubeshort x \b, system %hd
-2 string streamtyped NeXT/Apple typedstream data, little endian
->0 byte x \b, version %hhd
->0 byte <5 \b
->>13 byte 0x81 \b
->>>14 uleshort x \b, system %hd
-
-#------------------------------------------------------------------------------
-# CAF: Apple CoreAudio File Format
-#
-# Container format for high-end audio purposes.
-# From: David Remahl <dremahl@apple.com>
-#
-0 string caff CoreAudio Format audio file
->4 beshort <10 version %d
->6 beshort x
-
-
-#------------------------------------------------------------------------------
-# Keychain database files
-0 string kych Mac OS X Keychain File
-
-#------------------------------------------------------------------------------
-# Code Signing related file types
-0 belong 0xfade0c00 Mac OS X Code Requirement
->8 belong 1 (opExpr)
->4 belong x - %d bytes
-
-0 belong 0xfade0c01 Mac OS X Code Requirement Set
->8 belong >1 containing %d items
->4 belong x - %d bytes
-
-0 belong 0xfade0c02 Mac OS X Code Directory
->8 belong x version %x
->12 belong >0 flags 0x%x
->4 belong x - %d bytes
-
-0 belong 0xfade0cc0 Mac OS X Detached Code Signature (non-executable)
->4 belong x - %d bytes
-
-0 belong 0xfade0cc1 Mac OS X Detached Code Signature
->8 belong >1 (%d elements)
->4 belong x - %d bytes
-
-# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
-# .vdi
-4 string innotek\ VirtualBox\ Disk\ Image %s
-
-#------------------------------------------------------------------------------
-# applix: file(1) magic for Applixware
-# From: Peter Soos <sp@osb.hu>
-#
-0 string *BEGIN Applixware
->7 string WORDS Words Document
->7 string GRAPHICS Graphic
->7 string RASTER Bitmap
->7 string SPREADSHEETS Spreadsheet
->7 string MACRO Macro
->7 string BUILDER Builder Object
-#------------------------------------------------------------------------------
-# archive: file(1) magic for archive formats (see also "msdos" for self-
-# extracting compressed archives)
-#
-# cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
-# pre-POSIX "tar" archives are handled in the C code.
-
-# POSIX tar archives
-257 string ustar\0 POSIX tar archive
-!:mime application/x-tar # encoding: posix
-257 string ustar\040\040\0 GNU tar archive
-!:mime application/x-tar # encoding: gnu
-
-# cpio archives
-#
-# Yes, the top two "cpio archive" formats *are* supposed to just be "short".
-# The idea is to indicate archives produced on machines with the same
-# byte order as the machine running "file" with "cpio archive", and
-# to indicate archives produced on machines with the opposite byte order
-# from the machine running "file" with "byte-swapped cpio archive".
-#
-# The SVR4 "cpio(4)" hints that there are additional formats, but they
-# are defined as "short"s; I think all the new formats are
-# character-header formats and thus are strings, not numbers.
-0 short 070707 cpio archive
-!:mime application/x-cpio
-0 short 0143561 byte-swapped cpio archive
-!:mime application/x-cpio # encoding: swapped
-0 string 070707 ASCII cpio archive (pre-SVR4 or odc)
-0 string 070701 ASCII cpio archive (SVR4 with no CRC)
-0 string 070702 ASCII cpio archive (SVR4 with CRC)
-
-# Debian package (needs to go before regular portable archives)
-#
-0 string =!<arch>\ndebian
-!:mime application/x-debian-package
->8 string debian-split part of multipart Debian package
->8 string debian-binary Debian binary package
->8 string !debian
->68 string >\0 (format %s)
-# These next two lines do not work, because a bzip2 Debian archive
-# still uses gzip for the control.tar (first in the archive). Only
-# data.tar varies, and the location of its filename varies too.
-# file/libmagic does not current have support for ascii-string based
-# (offsets) as of 2005-09-15.
-#>81 string bz2 \b, uses bzip2 compression
-#>84 string gz \b, uses gzip compression
-#>136 ledate x created: %s
-
-# other archives
-0 long 0177555 very old archive
-0 short 0177555 very old PDP-11 archive
-0 long 0177545 old archive
-0 short 0177545 old PDP-11 archive
-0 long 0100554 apl workspace
-0 string =<ar> archive
-!:mime application/x-archive
-
-# MIPS archive (needs to go before regular portable archives)
-#
-0 string =!<arch>\n__________E MIPS archive
->20 string U with MIPS Ucode members
->21 string L with MIPSEL members
->21 string B with MIPSEB members
->19 string L and an EL hash table
->19 string B and an EB hash table
->22 string X -- out of date
-
-0 search/1 -h- Software Tools format archive text
-
-#
-# XXX - why are there multiple <ar> thingies? Note that 0x213c6172 is
-# "!<ar", so, for new-style (4.xBSD/SVR2andup) archives, we have:
-#
-# 0 string =!<arch> current ar archive
-# 0 long 0x213c6172 archive file
-#
-# and for SVR1 archives, we have:
-#
-# 0 string \<ar> System V Release 1 ar archive
-# 0 string =<ar> archive
-#
-# XXX - did Aegis really store shared libraries, breakpointed modules,
-# and absolute code program modules in the same format as new-style
-# "ar" archives?
-#
-0 string =!<arch> current ar archive
-!:mime application/x-archive
->8 string __.SYMDEF random library
->0 belong =65538 - pre SR9.5
->0 belong =65539 - post SR9.5
->0 beshort 2 - object archive
->0 beshort 3 - shared library module
->0 beshort 4 - debug break-pointed module
->0 beshort 5 - absolute code program module
-0 string \<ar> System V Release 1 ar archive
-0 string =<ar> archive
-#
-# XXX - from "vax", which appears to collect a bunch of byte-swapped
-# thingies, to help you recognize VAX files on big-endian machines;
-# with "leshort", "lelong", and "string", that's no longer necessary....
-#
-0 belong 0x65ff0000 VAX 3.0 archive
-0 belong 0x3c61723e VAX 5.0 archive
-#
-0 long 0x213c6172 archive file
-0 lelong 0177555 very old VAX archive
-0 leshort 0177555 very old PDP-11 archive
-#
-# XXX - "pdp" claims that 0177545 can have an __.SYMDEF member and thus
-# be a random library (it said 0xff65 rather than 0177545).
-#
-0 lelong 0177545 old VAX archive
->8 string __.SYMDEF random library
-0 leshort 0177545 old PDP-11 archive
->8 string __.SYMDEF random library
-#
-# From "pdp" (but why a 4-byte quantity?)
-#
-0 lelong 0x39bed PDP-11 old archive
-0 lelong 0x39bee PDP-11 4.0 archive
-
-# ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
-#
-# The first byte is the magic (0x1a), byte 2 is the compression type for
-# the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
-# filename of the first file (null terminated). Since some types collide
-# we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
-# 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%). 0x01 collides with terminfo.
-0 lelong&0x8080ffff 0x0000081a ARC archive data, dynamic LZW
-!:mime application/x-arc
-0 lelong&0x8080ffff 0x0000091a ARC archive data, squashed
-!:mime application/x-arc
-0 lelong&0x8080ffff 0x0000021a ARC archive data, uncompressed
-!:mime application/x-arc
-0 lelong&0x8080ffff 0x0000031a ARC archive data, packed
-!:mime application/x-arc
-0 lelong&0x8080ffff 0x0000041a ARC archive data, squeezed
-!:mime application/x-arc
-0 lelong&0x8080ffff 0x0000061a ARC archive data, crunched
-!:mime application/x-arc
-# [JW] stuff taken from idarc, obviously ARC successors:
-0 lelong&0x8080ffff 0x00000a1a PAK archive data
-!:mime application/x-arc
-0 lelong&0x8080ffff 0x0000141a ARC+ archive data
-!:mime application/x-arc
-0 lelong&0x8080ffff 0x0000481a HYP archive data
-!:mime application/x-arc
-
-# Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
-# I can't create either SPARK or ArcFS archives so I have not tested this stuff
-# [GRR: the original entries collide with ARC, above; replaced with combined
-# version (not tested)]
-#0 byte 0x1a RISC OS archive (spark format)
-0 string \032archive RISC OS archive (ArcFS format)
-0 string Archive\000 RISC OS archive (ArcFS format)
-
-# All these were taken from idarc, many could not be verified. Unfortunately,
-# there were many low-quality sigs, i.e. easy to trigger false positives.
-# Please notify me of any real-world fishy/ambiguous signatures and I'll try
-# to get my hands on the actual archiver and see if I find something better. [JW]
-# probably many can be enhanced by finding some 0-byte or control char near the start
-
-# idarc calls this Crush/Uncompressed... *shrug*
-0 string CRUSH Crush archive data
-# Squeeze It (.sqz)
-0 string HLSQZ Squeeze It archive data
-# SQWEZ
-0 string SQWEZ SQWEZ archive data
-# HPack (.hpk)
-0 string HPAK HPack archive data
-# HAP
-0 string \x91\x33HF HAP archive data
-# MD/MDCD
-0 string MDmd MDCD archive data
-# LIM
-0 string LIM\x1a LIM archive data
-# SAR
-3 string LH5 SAR archive data
-# BSArc/BS2
-0 string \212\3SB \0 BSArc/BS2 archive data
-# MAR
-2 string =-ah MAR archive data
-# ACB
-0 belong&0x00f800ff 0x00800000 ACB archive data
-# CPZ
-# TODO, this is what idarc says: 0 string \0\0\0 CPZ archive data
-# JRC
-0 string JRchive JRC archive data
-# Quantum
-0 string DS\0 Quantum archive data
-# ReSOF
-0 string PK\3\6 ReSOF archive data
-# QuArk
-0 string 7\4 QuArk archive data
-# YAC
-14 string YC YAC archive data
-# X1
-0 string X1 X1 archive data
-0 string XhDr X1 archive data
-# CDC Codec (.dqt)
-0 belong&0xffffe000 0x76ff2000 CDC Codec archive data
-# AMGC
-0 string \xad6" AMGC archive data
-# NuLIB
-0 string NõFélå NuLIB archive data
-# PakLeo
-0 string LEOLZW PAKLeo archive data
-# ChArc
-0 string SChF ChArc archive data
-# PSA
-0 string PSA PSA archive data
-# CrossePAC
-0 string DSIGDCC CrossePAC archive data
-# Freeze
-0 string \x1f\x9f\x4a\x10\x0a Freeze archive data
-# KBoom
-0 string ¨MP¨ KBoom archive data
-# NSQ, must go after CDC Codec
-0 string \x76\xff NSQ archive data
-# DPA
-0 string Dirk\ Paehl DPA archive data
-# BA
-# TODO: idarc says "bytes 0-2 == bytes 3-5"
-# TTComp
-0 string \0\6 TTComp archive data
-# ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation?
-0 string ESP ESP archive data
-# ZPack
-0 string \1ZPK\1 ZPack archive data
-# Sky
-0 string \xbc\x40 Sky archive data
-# UFA
-0 string UFA UFA archive data
-# Dry
-0 string =-H2O DRY archive data
-# FoxSQZ
-0 string FOXSQZ FoxSQZ archive data
-# AR7
-0 string ,AR7 AR7 archive data
-# PPMZ
-0 string PPMZ PPMZ archive data
-# MS Compress
-4 string \x88\xf0\x27 MS Compress archive data
-# updated by Joerg Jenderek
->9 string \0
->>0 string KWAJ
->>>7 string \321\003 MS Compress archive data
->>>>14 ulong >0 \b, original size: %ld bytes
->>>>18 ubyte >0x65
->>>>>18 string x \b, was %.8s
->>>>>(10.b-4) string x \b.%.3s
-# MP3 (archiver, not lossy audio compression)
-0 string MP3\x1a MP3-Archiver archive data
-# ZET
-0 string OZÝ ZET archive data
-# TSComp
-0 string \x65\x5d\x13\x8c\x08\x01\x03\x00 TSComp archive data
-# ARQ
-0 string gW\4\1 ARQ archive data
-# Squash
-3 string OctSqu Squash archive data
-# Terse
-0 string \5\1\1\0 Terse archive data
-# PUCrunch
-0 string \x01\x08\x0b\x08\xef\x00\x9e\x32\x30\x36\x31 PUCrunch archive data
-# UHarc
-0 string UHA UHarc archive data
-# ABComp
-0 string \2AB ABComp archive data
-0 string \3AB2 ABComp archive data
-# CMP
-0 string CO\0 CMP archive data
-# Splint
-0 string \x93\xb9\x06 Splint archive data
-# InstallShield
-0 string \x13\x5d\x65\x8c InstallShield Z archive Data
-# Gather
-1 string GTH Gather archive data
-# BOA
-0 string BOA BOA archive data
-# RAX
-0 string ULEB\xa RAX archive data
-# Xtreme
-0 string ULEB\0 Xtreme archive data
-# Pack Magic
-0 string @â\1\0 Pack Magic archive data
-# BTS
-0 belong&0xfeffffff 0x1a034465 BTS archive data
-# ELI 5750
-0 string Ora\ ELI 5750 archive data
-# QFC
-0 string \x1aFC\x1a QFC archive data
-0 string \x1aQF\x1a QFC archive data
-# PRO-PACK
-0 string RNC PRO-PACK archive data
-# 777
-0 string 777 777 archive data
-# LZS221
-0 string sTaC LZS221 archive data
-# HPA
-0 string HPA HPA archive data
-# Arhangel
-0 string LG Arhangel archive data
-# EXP1, uses bzip2
-0 string 0123456789012345BZh EXP1 archive data
-# IMP
-0 string IMP\xa IMP archive data
-# NRV
-0 string \x00\x9E\x6E\x72\x76\xFF NRV archive data
-# Squish
-0 string \x73\xb2\x90\xf4 Squish archive data
-# Par
-0 string PHILIPP Par archive data
-0 string PAR Par archive data
-# HIT
-0 string UB HIT archive data
-# SBX
-0 belong&0xfffff000 0x53423000 SBX archive data
-# NaShrink
-0 string NSK NaShrink archive data
-# SAPCAR
-0 string #\ CAR\ archive\ header SAPCAR archive data
-0 string CAR\ 2.00RG SAPCAR archive data
-# Disintegrator
-0 string DST Disintegrator archive data
-# ASD
-0 string ASD ASD archive data
-# InstallShield CAB
-0 string ISc( InstallShield CAB
-# TOP4
-0 string T4\x1a TOP4 archive data
-# BatComp left out: sig looks like COM executable
-# so TODO: get real 4dos batcomp file and find sig
-# BlakHole
-0 string BH\5\7 BlakHole archive data
-# BIX
-0 string BIX0 BIX archive data
-# ChiefLZA
-0 string ChfLZ ChiefLZA archive data
-# Blink
-0 string Blink Blink archive data
-# Logitech Compress
-0 string \xda\xfa Logitech Compress archive data
-# ARS-Sfx (FIXME: really a SFX? then goto COM/EXE)
-1 string (C)\ STEPANYUK ARS-Sfx archive data
-# AKT/AKT32
-0 string AKT32 AKT32 archive data
-0 string AKT AKT archive data
-# NPack
-0 string MSTSM NPack archive data
-# PFT
-0 string \0\x50\0\x14 PFT archive data
-# SemOne
-0 string SEM SemOne archive data
-# PPMD
-0 string \x8f\xaf\xac\x84 PPMD archive data
-# FIZ
-0 string FIZ FIZ archive data
-# MSXiE
-0 belong&0xfffff0f0 0x4d530000 MSXiE archive data
-# DeepFreezer
-0 belong&0xfffffff0 0x797a3030 DeepFreezer archive data
-# DC
-0 string =<DC- DC archive data
-# TPac
-0 string \4TPAC\3 TPac archive data
-# Ai
-0 string Ai\1\1\0 Ai archive data
-0 string Ai\1\0\0 Ai archive data
-# Ai32
-0 string Ai\2\0 Ai32 archive data
-0 string Ai\2\1 Ai32 archive data
-# SBC
-0 string SBC SBC archive data
-# Ybs
-0 string YBS Ybs archive data
-# DitPack
-0 string \x9e\0\0 DitPack archive data
-# DMS
-0 string DMS! DMS archive data
-# EPC
-0 string \x8f\xaf\xac\x8c EPC archive data
-# VSARC
-0 string VS\x1a VSARC archive data
-# PDZ
-0 string PDZ PDZ archive data
-# ReDuq
-0 string rdqx ReDuq archive data
-# GCA
-0 string GCAX GCA archive data
-# PPMN
-0 string pN PPMN archive data
-# WinImage
-3 string WINIMAGE WinImage archive data
-# Compressia
-0 string CMP0CMP Compressia archive data
-# UHBC
-0 string UHB UHBC archive data
-# WinHKI
-0 string \x61\x5C\x04\x05 WinHKI archive data
-# WWPack data file
-0 string WWP WWPack archive data
-# BSN (BSA, PTS-DOS)
-0 string \xffBSG BSN archive data
-1 string \xffBSG BSN archive data
-3 string \xffBSG BSN archive data
-1 string \0\xae\2 BSN archive data
-1 string \0\xae\3 BSN archive data
-1 string \0\xae\7 BSN archive data
-# AIN
-0 string \x33\x18 AIN archive data
-0 string \x33\x17 AIN archive data
-# XPA32
-0 string xpa\0\1 XPA32 archive data
-# SZip (TODO: doesn't catch all versions)
-0 string SZ\x0a\4 SZip archive data
-# XPack DiskImage
-0 string jm XPack DiskImage archive data
-# XPack Data
-0 string xpa XPack archive data
-# XPack Single Data
-0 string Í\ jm XPack single archive data
-
-# TODO: missing due to unknown magic/magic at end of file:
-#DWC
-#ARG
-#ZAR
-#PC/3270
-#InstallIt
-#RKive
-#RK
-#XPack Diskimage
-
-# These were inspired by idarc, but actually verified
-# Dzip archiver (.dz)
-0 string DZ Dzip archive data
->2 byte x \b, version %i
->3 byte x \b.%i
-# ZZip archiver (.zz)
-0 string ZZ\ \0\0 ZZip archive data
-0 string ZZ0 ZZip archive data
-# PAQ archiver (.paq)
-0 string \xaa\x40\x5f\x77\x1f\xe5\x82\x0d PAQ archive data
-0 string PAQ PAQ archive data
->3 byte&0xf0 0x30
->>3 byte x (v%c)
-# JAR archiver (.j), this is the successor to ARJ, not Java's JAR (which is essentially ZIP)
-0xe string \x1aJar\x1b JAR (ARJ Software, Inc.) archive data
-0 string JARCS JAR (ARJ Software, Inc.) archive data
-
-# ARJ archiver (jason@jarthur.Claremont.EDU)
-0 leshort 0xea60 ARJ archive data
-!:mime application/x-arj
->5 byte x \b, v%d,
->8 byte &0x04 multi-volume,
->8 byte &0x10 slash-switched,
->8 byte &0x20 backup,
->34 string x original name: %s,
->7 byte 0 os: MS-DOS
->7 byte 1 os: PRIMOS
->7 byte 2 os: Unix
->7 byte 3 os: Amiga
->7 byte 4 os: Macintosh
->7 byte 5 os: OS/2
->7 byte 6 os: Apple ][ GS
->7 byte 7 os: Atari ST
->7 byte 8 os: NeXT
->7 byte 9 os: VAX/VMS
->3 byte >0 %d]
-# [JW] idarc says this is also possible
-2 leshort 0xea60 ARJ archive data
-
-# HA archiver (Greg Roelofs, newt@uchicago.edu)
-# This is a really bad format. A file containing HAWAII will match this...
-#0 string HA HA archive data,
-#>2 leshort =1 1 file,
-#>2 leshort >1 %u files,
-#>4 byte&0x0f =0 first is type CPY
-#>4 byte&0x0f =1 first is type ASC
-#>4 byte&0x0f =2 first is type HSC
-#>4 byte&0x0f =0x0e first is type DIR
-#>4 byte&0x0f =0x0f first is type SPECIAL
-# suggestion: at least identify small archives (<1024 files)
-0 belong&0xffff00fc 0x48410000 HA archive data
->2 leshort =1 1 file,
->2 leshort >1 %u files,
->4 byte&0x0f =0 first is type CPY
->4 byte&0x0f =1 first is type ASC
->4 byte&0x0f =2 first is type HSC
->4 byte&0x0f =0x0e first is type DIR
->4 byte&0x0f =0x0f first is type SPECIAL
-
-# HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
-0 string HPAK HPACK archive data
-
-# JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
-0 string \351,\001JAM\ JAM archive,
->7 string >\0 version %.4s
->0x26 byte =0x27 -
->>0x2b string >\0 label %.11s,
->>0x27 lelong x serial %08x,
->>0x36 string >\0 fstype %.8s
-
-# LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
-2 string -lh0- LHarc 1.x/ARX archive data [lh0]
-!:mime application/x-lharc
-2 string -lh1- LHarc 1.x/ARX archive data [lh1]
-!:mime application/x-lharc
-2 string -lz4- LHarc 1.x archive data [lz4]
-!:mime application/x-lharc
-2 string -lz5- LHarc 1.x archive data [lz5]
-!:mime application/x-lharc
-# [never seen any but the last; -lh4- reported in comp.compression:]
-2 string -lzs- LHa/LZS archive data [lzs]
-!:mime application/x-lha
-2 string -lh\40- LHa 2.x? archive data [lh ]
-!:mime application/x-lha
-2 string -lhd- LHa 2.x? archive data [lhd]
-!:mime application/x-lha
-2 string -lh2- LHa 2.x? archive data [lh2]
-!:mime application/x-lha
-2 string -lh3- LHa 2.x? archive data [lh3]
-!:mime application/x-lha
-2 string -lh4- LHa (2.x) archive data [lh4]
-!:mime application/x-lha
-2 string -lh5- LHa (2.x) archive data [lh5]
-!:mime application/x-lha
-2 string -lh6- LHa (2.x) archive data [lh6]
-!:mime application/x-lha
-2 string -lh7- LHa (2.x)/LHark archive data [lh7]
-!:mime application/x-lha
->20 byte x - header level %d
-# taken from idarc [JW]
-2 string -lZ PUT archive data
-2 string -lz LZS archive data
-2 string -sw1- Swag archive data
-
-# RAR archiver (Greg Roelofs, newt@uchicago.edu)
-0 string Rar! RAR archive data,
-!:mime application/x-rar
->44 byte x v%0x,
->10 byte >0 flags:
->>10 byte &0x01 Archive volume,
->>10 byte &0x02 Commented,
->>10 byte &0x04 Locked,
->>10 byte &0x08 Solid,
->>10 byte &0x20 Authenticated,
->35 byte 0 os: MS-DOS
->35 byte 1 os: OS/2
->35 byte 2 os: Win32
->35 byte 3 os: Unix
-# some old version? idarc says:
-0 string RE\x7e\x5e RAR archive data
-
-# SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
-0 string SQSH squished archive data (Acorn RISCOS)
-
-# UC2 archiver (Greg Roelofs, newt@uchicago.edu)
-# [JW] see exe section for self-extracting version
-0 string UC2\x1a UC2 archive data
-
-# ZIP archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
-0 string PK\003\004
->4 byte 0x00 Zip archive data
-!:mime application/zip
->4 byte 0x09 Zip archive data, at least v0.9 to extract
-!:mime application/zip
->4 byte 0x0a Zip archive data, at least v1.0 to extract
-!:mime application/zip
->4 byte 0x0b Zip archive data, at least v1.1 to extract
-!:mime application/zip
->0x161 string WINZIP Zip archive data, WinZIP self-extracting
-!:mime application/zip
->4 byte 0x14
->>30 ubelong !0x6d696d65 Zip archive data, at least v2.0 to extract
-!:mime application/zip
-
-# OpenOffice.org / KOffice / StarOffice documents
-# Listed here because they ARE zip files
-#
-# From: Abel Cheung <abel@oaka.org>
->4 byte 0x14
->>30 string mimetype
-
-# KOffice (1.2 or above) formats
->>>50 string vnd.kde. KOffice (>=1.2)
->>>>58 string karbon Karbon document
->>>>58 string kchart KChart document
->>>>58 string kformula KFormula document
->>>>58 string kivio Kivio document
->>>>58 string kontour Kontour document
->>>>58 string kpresenter KPresenter document
->>>>58 string kspread KSpread document
->>>>58 string kword KWord document
-
-# OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7)
->>>50 string vnd.sun.xml. OpenOffice.org 1.x
->>>>62 string writer Writer
->>>>>68 byte !0x2e document
->>>>>68 string .template template
->>>>>68 string .global global document
->>>>62 string calc Calc
->>>>>66 byte !0x2e spreadsheet
->>>>>66 string .template template
->>>>62 string draw Draw
->>>>>66 byte !0x2e document
->>>>>66 string .template template
->>>>62 string impress Impress
->>>>>69 byte !0x2e presentation
->>>>>69 string .template template
->>>>62 string math Math document
->>>>62 string base Database file
-
-# OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
-# http://lists.oasis-open.org/archives/office/200505/msg00006.html
->>>50 string vnd.oasis.opendocument. OpenDocument
->>>>73 string text
->>>>>77 byte !0x2d Text
-!:mime application/vnd.oasis.opendocument.text
->>>>>77 string -template Text Template
->>>>>77 string -web HTML Document Template
->>>>>77 string -master Master Document
->>>>73 string graphics Drawing
->>>>>81 string -template Template
->>>>73 string presentation Presentation
->>>>>85 string -template Template
->>>>73 string spreadsheet Spreadsheet
->>>>>84 string -template Template
->>>>73 string chart Chart
->>>>>78 string -template Template
->>>>73 string formula Formula
->>>>>80 string -template Template
->>>>73 string database Database
->>>>73 string image Image
-
-# Zoo archiver
-20 lelong 0xfdc4a7dc Zoo archive data
-!:mime application/x-zoo
->4 byte >48 \b, v%c.
->>6 byte >47 \b%c
->>>7 byte >47 \b%c
->32 byte >0 \b, modify: v%d
->>33 byte x \b.%d+
->42 lelong 0xfdc4a7dc \b,
->>70 byte >0 extract: v%d
->>>71 byte x \b.%d+
-
-# Shell archives
-10 string #\ This\ is\ a\ shell\ archive shell archive text
-!:mime application/octet-stream
-
-#
-# LBR. NB: May conflict with the questionable
-# "binary Computer Graphics Metafile" format.
-#
-0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data
-#
-# PMA (CP/M derivative of LHA)
-#
-2 string -pm0- PMarc archive data [pm0]
-2 string -pm1- PMarc archive data [pm1]
-2 string -pm2- PMarc archive data [pm2]
-2 string -pms- PMarc SFX archive (CP/M, DOS)
-5 string -pc1- PopCom compressed executable (CP/M)
-
-# From Rafael Laboissiere <rafael@laboissiere.net>
-# The Project Revision Control System (see
-# http://prcs.sourceforge.net) generates a packaged project
-# file which is recognized by the following entry:
-0 leshort 0xeb81 PRCS packaged project
-
-# Microsoft cabinets
-# by David Necas (Yeti) <yeti@physics.muni.cz>
-#0 string MSCF\0\0\0\0 Microsoft cabinet file data,
-#>25 byte x v%d
-#>24 byte x \b.%d
-# MPi: All CABs have version 1.3, so this is pointless.
-# Better magic in debian-additions.
-
-# GTKtalog catalogs
-# by David Necas (Yeti) <yeti@physics.muni.cz>
-4 string gtktalog\ GTKtalog catalog data,
->13 string 3 version 3
->>14 beshort 0x677a (gzipped)
->>14 beshort !0x677a (not gzipped)
->13 string >3 version %s
-
-############################################################################
-# Parity archive reconstruction file, the 'par' file format now used on Usenet.
-0 string PAR\0 PARity archive data
->48 leshort =0 - Index file
->48 leshort >0 - file number %d
-
-# Felix von Leitner <felix-file@fefe.de>
-0 string d8:announce BitTorrent file
-!:mime application/x-bittorrent
-
-# Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
-0 beshort 0x0e0f Atari MSA archive data
->2 beshort x \b, %d sectors per track
->4 beshort 0 \b, 1 sided
->4 beshort 1 \b, 2 sided
->6 beshort x \b, starting track: %d
->8 beshort x \b, ending track: %d
-
-# Alternate ZIP string (amc@arwen.cs.berkeley.edu)
-0 string PK00PK\003\004 Zip archive data
-
-# ACE archive (from http://www.wotsit.org/download.asp?f=ace)
-# by Stefan `Sec` Zehl <sec@42.org>
-7 string **ACE** ACE archive data
->15 byte >0 version %d
->16 byte =0x00 \b, from MS-DOS
->16 byte =0x01 \b, from OS/2
->16 byte =0x02 \b, from Win/32
->16 byte =0x03 \b, from Unix
->16 byte =0x04 \b, from MacOS
->16 byte =0x05 \b, from WinNT
->16 byte =0x06 \b, from Primos
->16 byte =0x07 \b, from AppleGS
->16 byte =0x08 \b, from Atari
->16 byte =0x09 \b, from Vax/VMS
->16 byte =0x0A \b, from Amiga
->16 byte =0x0B \b, from Next
->14 byte x \b, version %d to extract
->5 leshort &0x0080 \b, multiple volumes,
->>17 byte x \b (part %d),
->5 leshort &0x0002 \b, contains comment
->5 leshort &0x0200 \b, sfx
->5 leshort &0x0400 \b, small dictionary
->5 leshort &0x0800 \b, multi-volume
->5 leshort &0x1000 \b, contains AV-String
->>30 string \x16*UNREGISTERED\x20VERSION* (unregistered)
->5 leshort &0x2000 \b, with recovery record
->5 leshort &0x4000 \b, locked
->5 leshort &0x8000 \b, solid
-# Date in MS-DOS format (whatever that is)
-#>18 lelong x Created on
-
-# sfArk : compression program for Soundfonts (sf2) by Dirk Jagdmann
-# <doj@cubic.org>
-0x1A string sfArk sfArk compressed Soundfont
->0x15 string 2
->>0x1 string >\0 Version %s
->>0x2A string >\0 : %s
-
-# DR-DOS 7.03 Packed File *.??_
-0 string Packed\ File\ Personal NetWare Packed File
->12 string x \b, was "%.12s"
-
-# EET archive
-# From: Tilman Sauerbeck <tilman@code-monkey.de>
-0 belong 0x1ee7ff00 EET archive
-!:mime application/x-eet
-
-# rzip archives
-0 string RZIP rzip compressed data
->4 byte x - version %d
->5 byte x \b.%d
->6 belong x (%d bytes)
-
-# From: "Robert Dale" <robdale@gmail.com>
-0 belong 123 dar archive,
->4 belong x label "%.8x
->>8 belong x %.8x
->>>12 beshort x %.4x"
->14 byte 0x54 end slice
->14 beshort 0x4e4e multi-part
->14 beshort 0x4e53 multi-part, with -S
-
-# Symbian installation files
-# http://www.thouky.co.uk/software/psifs/sis.html
-# http://developer.symbian.com/main/downloads/papers/SymbianOSv91/softwareinstallsis.pdf
-8 lelong 0x10000419 Symbian installation file
-!:mime application/vnd.symbian.install
->4 lelong 0x1000006D (EPOC release 3/4/5)
->4 lelong 0x10003A12 (EPOC release 6)
-0 lelong 0x10201A7A Symbian installation file (Symbian OS 9.x)
-!:mime x-epoc/x-sisx-app
-
-# From "Nelson A. de Oliveira" <naoliv@gmail.com>
-0 string MPQ\032 MoPaQ (MPQ) archive
-
-# From: Dirk Jagdmann <doj@cubic.org>
-# xar archive format: http://code.google.com/p/xar/
-0 string xar! xar archive
->6 beshort x - version %ld
-
-# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
-# .kgb
-0 string KGB_arch KGB Archiver file
->10 string x with compression level %.1s
-
-# xar (eXtensible ARchiver) archive
-# From: "David Remahl" <dremahl@apple.com>
-0 string xar! xar archive
-#>4 beshort x header size %d
->6 beshort x version %d,
-#>8 quad x compressed TOC: %d,
-#>16 quad x uncompressed TOC: %d,
->24 belong 0 no checksum
->24 belong 1 SHA-1 checksum
->24 belong 2 MD5 checksum
-
-# Type: Parity Archive
-# From: Daniel van Eeden <daniel_e@dds.nl>
-0 string PAR2 Parity Archive Volume Set
-
-#------------------------------------------------------------------------------
-# asterix: file(1) magic for Aster*x; SunOS 5.5.1 gave the 4-character
-# strings as "long" - we assume they're just strings:
-# From: guy@netapp.com (Guy Harris)
-#
-0 string *STA Aster*x
->7 string WORD Words Document
->7 string GRAP Graphic
->7 string SPRE Spreadsheet
->7 string MACR Macro
-0 string 2278 Aster*x Version 2
->29 byte 0x36 Words Document
->29 byte 0x35 Graphic
->29 byte 0x32 Spreadsheet
->29 byte 0x38 Macro
-
-
-#------------------------------------------------------------------------------
-# att3b: file(1) magic for AT&T 3B machines
-#
-# The `versions' should be un-commented if they work for you.
-# (Was the problem just one of endianness?)
-#
-# 3B20
-#
-# The 3B20 conflicts with SCCS.
-#0 beshort 0550 3b20 COFF executable
-#>12 belong >0 not stripped
-#>22 beshort >0 - version %ld
-#0 beshort 0551 3b20 COFF executable (TV)
-#>12 belong >0 not stripped
-#>22 beshort >0 - version %ld
-#
-# WE32K
-#
-0 beshort 0560 WE32000 COFF
->18 beshort ^00000020 object
->18 beshort &00000020 executable
->12 belong >0 not stripped
->18 beshort ^00010000 N/A on 3b2/300 w/paging
->18 beshort &00020000 32100 required
->18 beshort &00040000 and MAU hardware required
->20 beshort 0407 (impure)
->20 beshort 0410 (pure)
->20 beshort 0413 (demand paged)
->20 beshort 0443 (target shared library)
->22 beshort >0 - version %ld
-0 beshort 0561 WE32000 COFF executable (TV)
->12 belong >0 not stripped
-#>18 beshort &00020000 - 32100 required
-#>18 beshort &00040000 and MAU hardware required
-#>22 beshort >0 - version %ld
-#
-# core file for 3b2
-0 string \000\004\036\212\200 3b2 core file
->364 string >\0 of '%s'
-#------------------------------------------------------------------------------
-# audio: file(1) magic for sound formats (see also "iff")
-#
-# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
-# and others
-#
-
-# Sun/NeXT audio data
-0 string .snd Sun/NeXT audio data:
->12 belong 1 8-bit ISDN mu-law,
-!:mime audio/basic
->12 belong 2 8-bit linear PCM [REF-PCM],
-!:mime audio/basic
->12 belong 3 16-bit linear PCM,
-!:mime audio/basic
->12 belong 4 24-bit linear PCM,
-!:mime audio/basic
->12 belong 5 32-bit linear PCM,
-!:mime audio/basic
->12 belong 6 32-bit IEEE floating point,
-!:mime audio/basic
->12 belong 7 64-bit IEEE floating point,
-!:mime audio/basic
->12 belong 8 Fragmented sample data,
->12 belong 10 DSP program,
->12 belong 11 8-bit fixed point,
->12 belong 12 16-bit fixed point,
->12 belong 13 24-bit fixed point,
->12 belong 14 32-bit fixed point,
->12 belong 18 16-bit linear with emphasis,
->12 belong 19 16-bit linear compressed,
->12 belong 20 16-bit linear with emphasis and compression,
->12 belong 21 Music kit DSP commands,
->12 belong 23 8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice enc.),
-!:mime audio/x-adpcm
->12 belong 24 compressed (8-bit CCITT G.722 ADPCM)
->12 belong 25 compressed (3-bit CCITT G.723.3 ADPCM),
->12 belong 26 compressed (5-bit CCITT G.723.5 ADPCM),
->12 belong 27 8-bit A-law (CCITT G.711),
->20 belong 1 mono,
->20 belong 2 stereo,
->20 belong 4 quad,
->16 belong >0 %d Hz
-
-# DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
-# that uses little-endian encoding and has a different magic number
-0 lelong 0x0064732E DEC audio data:
->12 lelong 1 8-bit ISDN mu-law,
-!:mime audio/x-dec-basic
->12 lelong 2 8-bit linear PCM [REF-PCM],
-!:mime audio/x-dec-basic
->12 lelong 3 16-bit linear PCM,
-!:mime audio/x-dec-basic
->12 lelong 4 24-bit linear PCM,
-!:mime audio/x-dec-basic
->12 lelong 5 32-bit linear PCM,
-!:mime audio/x-dec-basic
->12 lelong 6 32-bit IEEE floating point,
-!:mime audio/x-dec-basic
->12 lelong 7 64-bit IEEE floating point,
-!:mime audio/x-dec-basic
->12 belong 8 Fragmented sample data,
->12 belong 10 DSP program,
->12 belong 11 8-bit fixed point,
->12 belong 12 16-bit fixed point,
->12 belong 13 24-bit fixed point,
->12 belong 14 32-bit fixed point,
->12 belong 18 16-bit linear with emphasis,
->12 belong 19 16-bit linear compressed,
->12 belong 20 16-bit linear with emphasis and compression,
->12 belong 21 Music kit DSP commands,
->12 lelong 23 8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice enc.),
-!:mime audio/x-dec-basic
->12 belong 24 compressed (8-bit CCITT G.722 ADPCM)
->12 belong 25 compressed (3-bit CCITT G.723.3 ADPCM),
->12 belong 26 compressed (5-bit CCITT G.723.5 ADPCM),
->12 belong 27 8-bit A-law (CCITT G.711),
->20 lelong 1 mono,
->20 lelong 2 stereo,
->20 lelong 4 quad,
->16 lelong >0 %d Hz
-
-# Creative Labs AUDIO stuff
-0 string MThd Standard MIDI data
-!:mime audio/midi
->8 beshort x (format %d)
->10 beshort x using %d track
->10 beshort >1 \bs
->12 beshort&0x7fff x at 1/%d
->12 beshort&0x8000 >0 SMPTE
-
-0 string CTMF Creative Music (CMF) data
-!:mime audio/x-unknown
-0 string SBI SoundBlaster instrument data
-!:mime audio/x-unknown
-0 string Creative\ Voice\ File Creative Labs voice data
-!:mime audio/x-unknown
-# is this next line right? it came this way...
->19 byte 0x1A
->23 byte >0 - version %d
->22 byte >0 \b.%d
-
-# first entry is also the string "NTRK"
-0 belong 0x4e54524b MultiTrack sound data
->4 belong x - version %ld
-
-# Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED
-# [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi]
-0 string EMOD Extended MOD sound data,
->4 byte&0xf0 x version %d
->4 byte&0x0f x \b.%d,
->45 byte x %d instruments
->83 byte 0 (module)
->83 byte 1 (song)
-
-# Real Audio (Magic .ra\0375)
-0 belong 0x2e7261fd RealAudio sound file
-!:mime audio/x-pn-realaudio
-0 string .RMF\0\0\0 RealMedia file
-!:mime application/vnd.rn-realmedia
-#video/x-pn-realvideo
-#video/vnd.rn-realvideo
-#application/vnd.rn-realmedia
-# sigh, there are many mimes for that but the above are the most common.
-
-# MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net]
-# Oct 31, 1995
-# fixed by <doj@cubic.org> 2003-06-24
-# Too short...
-#0 string MTM MultiTracker Module sound file
-#0 string if Composer 669 Module sound data
-#0 string JN Composer 669 Module sound data (extended format)
-0 string MAS_U ULT(imate) Module sound data
-
-#0 string FAR Module sound data
-#>4 string >\15 Title: "%s"
-
-0x2c string SCRM ScreamTracker III Module sound data
->0 string >\0 Title: "%s"
-
-# Gravis UltraSound patches
-# From <ache@nagual.ru>
-
-0 string GF1PATCH110\0ID#000002\0 GUS patch
-0 string GF1PATCH100\0ID#000002\0 Old GUS patch
-
-# mime types according to http://www.geocities.com/nevilo/mod.htm:
-# audio/it .it
-# audio/x-zipped-it .itz
-# audio/xm fasttracker modules
-# audio/x-s3m screamtracker modules
-# audio/s3m screamtracker modules
-# audio/x-zipped-mod mdz
-# audio/mod mod
-# audio/x-mod All modules (mod, s3m, 669, mtm, med, xm, it, mdz, stm, itz, xmz, s3z)
-
-#
-# Taken from loader code from mikmod version 2.14
-# by Steve McIntyre (stevem@chiark.greenend.org.uk)
-# <doj@cubic.org> added title printing on 2003-06-24
-0 string MAS_UTrack_V00
->14 string >/0 ultratracker V1.%.1s module sound data
-!:mime audio/x-mod
-#audio/x-tracker-module
-
-0 string UN05 MikMod UNI format module sound data
-
-0 string Extended\ Module: Fasttracker II module sound data
-!:mime audio/x-mod
-#audio/x-tracker-module
->17 string >\0 Title: "%s"
-
-21 string/c =!SCREAM! Screamtracker 2 module sound data
-!:mime audio/x-mod
-#audio/x-screamtracker-module
-21 string BMOD2STM Screamtracker 2 module sound data
-!:mime audio/x-mod
-#audio/x-screamtracker-module
-1080 string M.K. 4-channel Protracker module sound data
-!:mime audio/x-mod
-#audio/x-protracker-module
->0 string >\0 Title: "%s"
-1080 string M!K! 4-channel Protracker module sound data
-!:mime audio/x-mod
-#audio/x-protracker-module
->0 string >\0 Title: "%s"
-1080 string FLT4 4-channel Startracker module sound data
-!:mime audio/x-mod
-#audio/x-startracker-module
->0 string >\0 Title: "%s"
-1080 string FLT8 8-channel Startracker module sound data
-!:mime audio/x-mod
-#audio/x-startracker-module
->0 string >\0 Title: "%s"
-1080 string 4CHN 4-channel Fasttracker module sound data
-!:mime audio/x-mod
-#audio/x-fasttracker-module
->0 string >\0 Title: "%s"
-1080 string 6CHN 6-channel Fasttracker module sound data
-!:mime audio/x-mod
-#audio/x-fasttracker-module
->0 string >\0 Title: "%s"
-1080 string 8CHN 8-channel Fasttracker module sound data
-!:mime audio/x-mod
-#audio/x-fasttracker-module
->0 string >\0 Title: "%s"
-1080 string CD81 8-channel Octalyser module sound data
-!:mime audio/x-mod
-#audio/x-octalysertracker-module
->0 string >\0 Title: "%s"
-1080 string OKTA 8-channel Octalyzer module sound data
-!:mime audio/x-mod
-#audio/x-octalysertracker-module
->0 string >\0 Title: "%s"
-# Not good enough.
-#1082 string CH
-#>1080 string >/0 %.2s-channel Fasttracker "oktalyzer" module sound data
-1080 string 16CN 16-channel Taketracker module sound data
-!:mime audio/x-mod
-#audio/x-taketracker-module
->0 string >\0 Title: "%s"
-1080 string 32CN 32-channel Taketracker module sound data
-!:mime audio/x-mod
-#audio/x-taketracker-module
->0 string >\0 Title: "%s"
-
-# TOC sound files -Trevor Johnson <trevor@jpj.net>
-#
-0 string TOC TOC sound file
-
-# sidfiles <pooka@iki.fi>
-# added name,author,(c) and new RSID type by <doj@cubic.org> 2003-06-24
-0 string SIDPLAY\ INFOFILE Sidplay info file
-
-0 string PSID PlaySID v2.2+ (AMIGA) sidtune
->4 beshort >0 w/ header v%d,
->14 beshort =1 single song,
->14 beshort >1 %d songs,
->16 beshort >0 default song: %d
->0x16 string >\0 name: "%s"
->0x36 string >\0 author: "%s"
->0x56 string >\0 copyright: "%s"
-
-0 string RSID RSID sidtune PlaySID compatible
->4 beshort >0 w/ header v%d,
->14 beshort =1 single song,
->14 beshort >1 %d songs,
->16 beshort >0 default song: %d
->0x16 string >\0 name: "%s"
->0x36 string >\0 author: "%s"
->0x56 string >\0 copyright: "%s"
-
-# IRCAM <mpruett@sgi.com>
-# VAX and MIPS files are little-endian; Sun and NeXT are big-endian
-0 belong 0x64a30100 IRCAM file (VAX)
-0 belong 0x64a30200 IRCAM file (Sun)
-0 belong 0x64a30300 IRCAM file (MIPS little-endian)
-0 belong 0x64a30400 IRCAM file (NeXT)
-
-# NIST SPHERE <mpruett@sgi.com>
-0 string NIST_1A\n\ \ \ 1024\n NIST SPHERE file
-
-# Sample Vision <mpruett@sgi.com>
-0 string SOUND\ SAMPLE\ DATA\ Sample Vision file
-
-# Audio Visual Research <tonigonenstein@users.sourceforge.net>
-0 string 2BIT Audio Visual Research file,
->12 beshort =0 mono,
->12 beshort =-1 stereo,
->14 beshort x %d bits
->16 beshort =0 unsigned,
->16 beshort =-1 signed,
->22 belong&0x00ffffff x %d Hz,
->18 beshort =0 no loop,
->18 beshort =-1 loop,
->21 ubyte <128 note %d,
->22 byte =0 replay 5.485 KHz
->22 byte =1 replay 8.084 KHz
->22 byte =2 replay 10.971 Khz
->22 byte =3 replay 16.168 Khz
->22 byte =4 replay 21.942 KHz
->22 byte =5 replay 32.336 KHz
->22 byte =6 replay 43.885 KHz
->22 byte =7 replay 47.261 KHz
-
-# SGI SoundTrack <mpruett@sgi.com>
-0 string _SGI_SoundTrack SGI SoundTrack project file
-# ID3 version 2 tags <waschk@informatik.uni-rostock.de>
-0 string ID3 Audio file with ID3 version 2
->3 byte x \b.%d
->4 byte x \b.%d
->>5 byte &0x80 \b, unsynchronized frames
->>5 byte &0x40 \b, extended header
->>5 byte &0x20 \b, experimental
->>5 byte &0x10 \b, footer present
->(6.I) indirect x \b, contains:
-
-# NSF (NES sound file) magic
-0 string NESM\x1a NES Sound File
->14 string >\0 ("%s" by
->46 string >\0 %s, copyright
->78 string >\0 %s),
->5 byte x version %d,
->6 byte x %d tracks,
->122 byte&0x2 =1 dual PAL/NTSC
->122 byte&0x1 =1 PAL
->122 byte&0x1 =0 NTSC
-
-# Type: SNES SPC700 sound files
-# From: Josh Triplett <josh@freedesktop.org>
-0 string SNES-SPC700\ Sound\ File\ Data\ v SNES SPC700 sound file
->&0 string 0.30 \b, version %s
->>0x23 byte 0x1B \b, without ID666 tag
->>0x23 byte 0x1A \b, with ID666 tag
->>>0x2E string >\0 \b, song "%.32s"
->>>0x4E string >\0 \b, game "%.32s"
-
-# Impulse tracker module (audio/x-it)
-0 string IMPM Impulse Tracker module sound data -
-!:mime audio/x-mod
->4 string >\0 "%s"
->40 leshort !0 compatible w/ITv%x
->42 leshort !0 created w/ITv%x
-
-# Imago Orpheus module (audio/x-imf)
-60 string IM10 Imago Orpheus module sound data -
->0 string >\0 "%s"
-
-# From <collver1@attbi.com>
-# These are the /etc/magic entries to decode modules, instruments, and
-# samples in Impulse Tracker's native format.
-
-0 string IMPS Impulse Tracker Sample
->18 byte &2 16 bit
->18 byte ^2 8 bit
->18 byte &4 stereo
->18 byte ^4 mono
-0 string IMPI Impulse Tracker Instrument
->28 leshort !0 ITv%x
->30 byte !0 %d samples
-
-# Yamaha TX Wave: file(1) magic for Yamaha TX Wave audio files
-# From <collver1@attbi.com>
-0 string LM8953 Yamaha TX Wave
->22 byte 0x49 looped
->22 byte 0xC9 non-looped
->23 byte 1 33kHz
->23 byte 2 50kHz
->23 byte 3 16kHz
-
-# scream tracker: file(1) magic for Scream Tracker sample files
-#
-# From <collver1@attbi.com>
-76 string SCRS Scream Tracker Sample
->0 byte 1 sample
->0 byte 2 adlib melody
->0 byte >2 adlib drum
->31 byte &2 stereo
->31 byte ^2 mono
->31 byte &4 16bit little endian
->31 byte ^4 8bit
->30 byte 0 unpacked
->30 byte 1 packed
-
-# audio
-# From: Cory Dikkers <cdikkers@swbell.net>
-0 string MMD0 MED music file, version 0
-0 string MMD1 OctaMED Pro music file, version 1
-0 string MMD3 OctaMED Soundstudio music file, version 3
-0 string OctaMEDCmpr OctaMED Soundstudio compressed file
-0 string MED MED_Song
-0 string SymM Symphonie SymMOD music file
-#
-0 string THX AHX version
->3 byte =0 1 module data
->3 byte =1 2 module data
-#
-0 string OKTASONG Oktalyzer module data
-#
-0 string DIGI\ Booster\ module\0 %s
->20 byte >0 %c
->>21 byte >0 \b%c
->>>22 byte >0 \b%c
->>>>23 byte >0 \b%c
->610 string >\0 \b, "%s"
-#
-0 string DBM0 DIGI Booster Pro Module
->4 byte >0 V%X.
->>5 byte x \b%02X
->16 string >\0 \b, "%s"
-#
-0 string FTMN FaceTheMusic module
->16 string >\0d \b, "%s"
-
-# From: <doj@cubic.org> 2003-06-24
-0 string AMShdr\32 Velvet Studio AMS Module v2.2
-0 string Extreme Extreme Tracker AMS Module v1.3
-0 string DDMF Xtracker DMF Module
->4 byte x v%i
->0xD string >\0 Title: "%s"
->0x2B string >\0 Composer: "%s"
-0 string DSM\32 Dynamic Studio Module DSM
-0 string SONG DigiTrekker DTM Module
-0 string DMDL DigiTrakker MDL Module
-0 string PSM\32 Protracker Studio PSM Module
-44 string PTMF Poly Tracker PTM Module
->0 string >\32 Title: "%s"
-0 string MT20 MadTracker 2.0 Module MT2
-0 string RAD\40by\40REALiTY!! RAD Adlib Tracker Module RAD
-0 string RTMM RTM Module
-0x426 string MaDoKaN96 XMS Adlib Module
->0 string >\0 Composer: "%s"
-0 string AMF AMF Module
->4 string >\0 Title: "%s"
-0 string MODINFO1 Open Cubic Player Module Inforation MDZ
-0 string Extended\40Instrument: Fast Tracker II Instrument
-
-# From: Takeshi Hamasaki <hma@syd.odn.ne.jp>
-# NOA Nancy Codec file
-0 string \210NOA\015\012\032 NOA Nancy Codec Movie file
-# Yamaha SMAF format
-0 string MMMD Yamaha SMAF file
-# Sharp Jisaku Melody format for PDC
-0 string \001Sharp\040JisakuMelody SHARP Cell-Phone ringing Melody
->20 string Ver01.00 Ver. 1.00
->>32 byte x , %d tracks
-
-# Free lossless audio codec <http://flac.sourceforge.net>
-# From: Przemyslaw Augustyniak <silvathraec@rpg.pl>
-0 string fLaC FLAC audio bitstream data
-!:mime audio/x-flac
->4 byte&0x7f >0 \b, unknown version
->4 byte&0x7f 0 \b
-# some common bits/sample values
->>20 beshort&0x1f0 0x030 \b, 4 bit
->>20 beshort&0x1f0 0x050 \b, 6 bit
->>20 beshort&0x1f0 0x070 \b, 8 bit
->>20 beshort&0x1f0 0x0b0 \b, 12 bit
->>20 beshort&0x1f0 0x0f0 \b, 16 bit
->>20 beshort&0x1f0 0x170 \b, 24 bit
->>20 byte&0xe 0x0 \b, mono
->>20 byte&0xe 0x2 \b, stereo
->>20 byte&0xe 0x4 \b, 3 channels
->>20 byte&0xe 0x6 \b, 4 channels
->>20 byte&0xe 0x8 \b, 5 channels
->>20 byte&0xe 0xa \b, 6 channels
->>20 byte&0xe 0xc \b, 7 channels
->>20 byte&0xe 0xe \b, 8 channels
-# some common sample rates
->>17 belong&0xfffff0 0x0ac440 \b, 44.1 kHz
->>17 belong&0xfffff0 0x0bb800 \b, 48 kHz
->>17 belong&0xfffff0 0x07d000 \b, 32 kHz
->>17 belong&0xfffff0 0x056220 \b, 22.05 kHz
->>17 belong&0xfffff0 0x05dc00 \b, 24 kHz
->>17 belong&0xfffff0 0x03e800 \b, 16 kHz
->>17 belong&0xfffff0 0x02b110 \b, 11.025 kHz
->>17 belong&0xfffff0 0x02ee00 \b, 12 kHz
->>17 belong&0xfffff0 0x01f400 \b, 8 kHz
->>17 belong&0xfffff0 0x177000 \b, 96 kHz
->>17 belong&0xfffff0 0x0fa000 \b, 64 kHz
->>21 byte&0xf >0 \b, >4G samples
->>21 byte&0xf 0 \b
->>>22 belong >0 \b, %u samples
->>>22 belong 0 \b, length unknown
-
-# (ISDN) VBOX voice message file (Wolfram Kleff)
-0 string VBOX VBOX voice message data
-
-# ReBorn Song Files (.rbs)
-# David J. Singer <doc@deadvirgins.org.uk>
-8 string RB40 RBS Song file
->29 string ReBorn created by ReBorn
->37 string Propellerhead created by ReBirth
-
-# Synthesizer Generator and Kimwitu share their file format
-0 string A#S#C#S#S#L#V#3 Synthesizer Generator or Kimwitu data
-# Kimwitu++ uses a slightly different magic
-0 string A#S#C#S#S#L#HUB Kimwitu++ data
-
-# From "Simon Hosie
-0 string TFMX-SONG TFMX module sound data
-
-# Monkey's Audio compressed audio format (.ape)
-# From danny.milo@gmx.net (Danny Milosavljevic)
-# New version from Abel Cheung <abel (@) oaka.org>
-0 string MAC\040 Monkey's Audio compressed format
->4 uleshort >0x0F8B version %d
->>(0x08.l) uleshort =1000 with fast compression
->>(0x08.l) uleshort =2000 with normal compression
->>(0x08.l) uleshort =3000 with high compression
->>(0x08.l) uleshort =4000 with extra high compression
->>(0x08.l) uleshort =5000 with insane compression
->>(0x08.l+18) uleshort =1 \b, mono
->>(0x08.l+18) uleshort =2 \b, stereo
->>(0x08.l+20) ulelong x \b, sample rate %d
->4 uleshort <0x0F8C version %d
->>6 uleshort =1000 with fast compression
->>6 uleshort =2000 with normal compression
->>6 uleshort =3000 with high compression
->>6 uleshort =4000 with extra high compression
->>6 uleshort =5000 with insane compression
->>10 uleshort =1 \b, mono
->>10 uleshort =2 \b, stereo
->>12 ulelong x \b, sample rate %d
-
-# adlib sound files
-# From Gürkan Sengün <gurkan@linuks.mine.nu>, http://www.linuks.mine.nu
-0 string RAWADATA RdosPlay RAW
-
-1068 string RoR AMUSIC Adlib Tracker
-
-0 string JCH EdLib
-
-0 string mpu401tr MPU-401 Trakker
-
-0 string SAdT Surprise! Adlib Tracker
->4 byte x Version %d
-
-0 string XAD! eXotic ADlib
-
-0 string ofTAZ! eXtra Simple Music
-
-# Spectrum 128 tunes (.ay files).
-# From: Emanuel Haupt <ehaupt@critical.ch>
-0 string ZXAYEMUL Spectrum 128 tune
-
-0 string \0BONK BONK,
-#>5 byte x version %d
->14 byte x %d channel(s),
->15 byte =1 lossless,
->15 byte =0 lossy,
->16 byte x mid-side
-
-384 string LockStream LockStream Embedded file (mostly MP3 on old Nokia phones)
-
-# format VQF (proprietary codec for sound)
-# some infos on the header file available at :
-# http://www.twinvq.org/english/technology_format.html
-0 string TWIN97012000 VQF data
->27 short 0 \b, Mono
->27 short 1 \b, Stereo
->31 short >0 \b, %d kbit/s
->35 short >0 \b, %d kHz
-
-# Nelson A. de Oliveira (naoliv@gmail.com)
-# .eqf
-0 string Winamp\ EQ\ library\ file %s
-# it will match only versions like v<digit>.<digit>
-# Since I saw only eqf files with version v1.1 I think that it's OK
->23 string x \b%.4s
-# .preset
-0 string [Equalizer\ preset] XMMS equalizer preset
-# .m3u
-0 search/1 #EXTM3U M3U playlist text
-# .pls
-0 search/1 [playlist] PLS playlist text
-# licq.conf
-1 string [licq] LICQ configuration file
-
-# Atari ST audio files by Dirk Jagdmann <doj@cubic.org>
-0 string ICE! SNDH Atari ST music
-0 string SC68\ Music-file\ /\ (c)\ (BeN)jami sc68 Atari ST music
-
-# musepak support From: "Jiri Pejchal" <jiri.pejchal@gmail.com>
-0 string MP+ Musepack audio
->3 byte 255 \b, SV pre8
->3 byte&0xF 0x6 \b, SV 6
->3 byte&0xF 0x8 \b, SV 8
->3 byte&0xF 0x7 \b, SV 7
->>3 byte&0xF0 0x0 \b.0
->>3 byte&0xF0 0x10 \b.1
->>3 byte&0xF0 240 \b.15
->>10 byte&0xF0 0x0 \b, no profile
->>10 byte&0xF0 0x10 \b, profile 'Unstable/Experimental'
->>10 byte&0xF0 0x50 \b, quality 0
->>10 byte&0xF0 0x60 \b, quality 1
->>10 byte&0xF0 0x70 \b, quality 2 (Telephone)
->>10 byte&0xF0 0x80 \b, quality 3 (Thumb)
->>10 byte&0xF0 0x90 \b, quality 4 (Radio)
->>10 byte&0xF0 0xA0 \b, quality 5 (Standard)
->>10 byte&0xF0 0xB0 \b, quality 6 (Xtreme)
->>10 byte&0xF0 0xC0 \b, quality 7 (Insane)
->>10 byte&0xF0 0xD0 \b, quality 8 (BrainDead)
->>10 byte&0xF0 0xE0 \b, quality 9
->>10 byte&0xF0 0xF0 \b, quality 10
->>27 byte 0x0 \b, Buschmann 1.7.0-9, Klemm 0.90-1.05
->>27 byte 102 \b, Beta 1.02
->>27 byte 104 \b, Beta 1.04
->>27 byte 105 \b, Alpha 1.05
->>27 byte 106 \b, Beta 1.06
->>27 byte 110 \b, Release 1.1
->>27 byte 111 \b, Alpha 1.11
->>27 byte 112 \b, Beta 1.12
->>27 byte 113 \b, Alpha 1.13
->>27 byte 114 \b, Beta 1.14
->>27 byte 115 \b, Alpha 1.15
-
-# IMY
-# from http://filext.com/detaillist.php?extdetail=IMY
-# http://cellphones.about.com/od/cellularfaqs/f/rf_imelody.htm
-# http://download.ncl.ie/doc/api/ie/ncl/media/music/IMelody.html
-# http://www.wx800.com/msg/download/irda/iMelody.pdf
-0 string BEGIN:IMELODY iMelody Ringtone Format
-
-# From: "Mateus Caruccio" <mateus@caruccio.com>
-# guitar pro v3,4,5 from http://filext.com/file-extension/gp3
-0 string \030FICHIER\ GUITAR\ PRO\ v3. Guitar Pro Ver. 3 Tablature
-
-# From: "Leslie P. Polzer" <leslie.polzer@gmx.net>
-60 string SONG SoundFX Module sound file
-
-# Type: Adaptive Multi-Rate Codec
-# URL: http://filext.com/detaillist.php?extdetail=AMR
-# From: Russell Coker <russell@coker.com.au>
-0 string #!AMR Adaptive Multi-Rate Codec (GSM telephony)
-
-# Type: SuperCollider 3 Synth Definition File Format
-# From: Mario Lang <mlang@debian.org>
-0 string SCgf SuperCollider3 Synth Definition file,
->4 belong x version %d
-#----------------------------------------------------------------
-# basis: file(1) magic for BBx/Pro5-files
-# Oliver Dammer <dammer@olida.de> 2005/11/07
-# http://www.basis.com business-basic-files.
-#
-0 string \074\074bbx\076\076 BBx
->7 string \000 indexed file
->7 string \001 serial file
->7 string \002 keyed file
->>13 short 0 (sort)
->7 string \004 program
->>18 byte x (LEVEL %d)
->>>23 string >\000 psaved
->7 string \006 mkeyed file
->>13 short 0 (sort)
->>8 string \000 (mkey)
-#------------------------------------------------------------------------------
-# bFLT: file(1) magic for BFLT uclinux binary files
-#
-# From Philippe De Muyter <phdm@macqel.be>
-#
-0 string bFLT BFLT executable
->4 belong x - version %ld
->4 belong 4
->>36 belong&0x1 0x1 ram
->>36 belong&0x2 0x2 gotpic
->>36 belong&0x4 0x4 gzip
->>36 belong&0x8 0x8 gzdata
-#------------------------------------------------------------------------------
-# blender: file(1) magic for Blender 3D related files
-#
-# Native format rule v1.2. For questions use the developers list
-# http://lists.blender.org/mailman/listinfo/bf-committers
-# GLOB chunk was moved near start and provides subversion info since 2.42
-
-0 string =BLENDER Blender3D,
->7 string =_ saved as 32-bits
->>8 string =v little endian
->>>9 byte x with version %c.
->>>10 byte x \b%c
->>>11 byte x \b%c
->>>0x40 string =GLOB \b.
->>>>0x58 leshort x \b%.4d
->>8 string =V big endian
->>>9 byte x with version %c.
->>>10 byte x \b%c
->>>11 byte x \b%c
->>>0x40 string =GLOB \b.
->>>>0x58 beshort x \b%.4d
->7 string =- saved as 64-bits
->>8 string =v little endian
->>9 byte x with version %c.
->>10 byte x \b%c
->>11 byte x \b%c
->>0x44 string =GLOB \b.
->>>0x60 leshort x \b%.4d
->>8 string =V big endian
->>>9 byte x with version %c.
->>>10 byte x \b%c
->>>11 byte x \b%c
->>>0x44 string =GLOB \b.
->>>>0x60 beshort x \b%.4d
-
-# Scripts that run in the embeded Python interpreter
-0 string #!BPY Blender3D BPython script
-
-#------------------------------------------------------------------------------
-# blit: file(1) magic for 68K Blit stuff as seen from 680x0 machine
-#
-# Note that this 0407 conflicts with several other a.out formats...
-#
-# XXX - should this be redone with "be" and "le", so that it works on
-# little-endian machines as well? If so, what's the deal with
-# "VAX-order" and "VAX-order2"?
-#
-#0 long 0407 68K Blit (standalone) executable
-#0 short 0407 VAX-order2 68K Blit (standalone) executable
-0 short 03401 VAX-order 68K Blit (standalone) executable
-0 long 0406 68k Blit mpx/mux executable
-0 short 0406 VAX-order2 68k Blit mpx/mux executable
-0 short 03001 VAX-order 68k Blit mpx/mux executable
-# Need more values for WE32 DMD executables.
-# Note that 0520 is the same as COFF
-#0 short 0520 tty630 layers executable
-#
-# i80960 b.out objects and archives
-#
-0 long 0x10d i960 b.out relocatable object
->16 long >0 not stripped
-#
-# b.out archive (hp-rt on i960)
-0 string =!<bout> b.out archive
->8 string __.SYMDEF random library
-#------------------------------------------------------------------------------
-# bsdi: file(1) magic for BSD/OS (from BSDI) objects
-#
-
-0 lelong 0314 386 compact demand paged pure executable
->16 lelong >0 not stripped
->32 byte 0x6a (uses shared libs)
-
-0 lelong 0407 386 executable
->16 lelong >0 not stripped
->32 byte 0x6a (uses shared libs)
-
-0 lelong 0410 386 pure executable
->16 lelong >0 not stripped
->32 byte 0x6a (uses shared libs)
-
-0 lelong 0413 386 demand paged pure executable
->16 lelong >0 not stripped
->32 byte 0x6a (uses shared libs)
-
-# same as in SunOS 4.x, except for static shared libraries
-0 belong&077777777 0600413 sparc demand paged
->0 byte &0x80
->>20 belong <4096 shared library
->>20 belong =4096 dynamically linked executable
->>20 belong >4096 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
->36 belong 0xb4100001 (uses shared libs)
-
-0 belong&077777777 0600410 sparc pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
->36 belong 0xb4100001 (uses shared libs)
-
-0 belong&077777777 0600407 sparc
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
->36 belong 0xb4100001 (uses shared libs)
-#------------------------------------------------------------------------------
-# BTSnoop: file(1) magic for BTSnoop files
-#
-# From <marcel@holtmann.org>
-0 string btsnoop\0 BTSnoop
->8 belong x version %d,
->12 belong 1001 Unencapsulated HCI
->12 belong 1002 HCI UART (H4)
->12 belong 1003 HCI BCSP
->12 belong 1004 HCI Serial (H5)
->>12 belong x type %d
-#------------------------------------------------------------------------------
-# c-lang: file(1) magic for C programs (or REXX)
-#
-
-# XPM icons (Greg Roelofs, newt@uchicago.edu)
-# if you uncomment "/*" for C/REXX below, also uncomment this entry
-#0 string /*\ XPM\ */ X pixmap image data
-#!:mime image/x-xpmi
-
-# 3DS (3d Studio files) Conflicts with diff output 0x3d '='
-#16 beshort 0x3d3d image/x-3ds
-
-# this first will upset you if you're a PL/1 shop...
-# in which case rm it; ascmagic will catch real C programs
-#0 search/1 /* C or REXX program text
-#0 search/1 // C++ program text
-
-# From: Mikhail Teterin <mi@aldan.algebra.com>
-0 string cscope cscope reference data
->7 string x version %.2s
-# We skip the path here, because it is often long (so file will
-# truncate it) and mostly redundant.
-# The inverted index functionality was added some time betwen
-# versions 11 and 15, so look for -q if version is above 14:
->7 string >14
->>10 search/100 \ -q\ with inverted index
->10 search/100 \ -c\ text (non-compressed)
-#------------------------------------------------------------------------------
-# c64: file(1) magic for various commodore 64 related files
-#
-# From: Dirk Jagdmann <doj@cubic.org>
-
-0x16500 belong 0x12014100 D64 Image
-0x16500 belong 0x12014180 D71 Image
-0x61800 belong 0x28034400 D81 Image
-0 string C64\40CARTRIDGE CCS C64 Emultar Cartridge Image
-0 belong 0x43154164 X64 Image
-
-0 string GCR-1541 GCR Image
->8 byte x version: %i
->9 byte x tracks: %i
-
-9 string PSUR ARC archive (c64)
-2 string -LH1- LHA archive (c64)
-
-0 string C64File PC64 Emulator file
->8 string >\0 "%s"
-0 string C64Image PC64 Freezer Image
-
-0 beshort 0x38CD C64 PCLink Image
-0 string CBM\144\0\0 Power 64 C64 Emulator Snapshot
-
-0 belong 0xFF424CFF WRAptor packer (c64)
-
-0 string C64S\x20tape\x20file T64 tape Image
->32 leshort x Version:0x%x
->36 leshort !0 Entries:%i
->40 string x Name:%.24s
-
-0 string C64\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 T64 tape Image
->32 leshort x Version:0x%x
->36 leshort !0 Entries:%i
->40 string x Name:%.24s
-
-0 string C64S\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 T64 tape Image
->32 leshort x Version:0x%x
->36 leshort !0 Entries:%i
->40 string x Name:%.24s
-
-#------------------------------------------------------------------------------
-# autocad: file(1) magic for cad files
-#
-
-# AutoCAD DWG versions R13/R14 (www.autodesk.com)
-# Written December 01, 2003 by Lester Hightower
-# Based on the DWG File Format Specifications at http://www.opendwg.org/
-0 string \101\103\061\060\061 AutoCAD
->5 string \062\000\000\000\000 DWG ver. R13
->5 string \064\000\000\000\000 DWG ver. R14
-
-# Microstation DGN/CIT Files (www.bentley.com)
-# Last updated July 29, 2005 by Lester Hightower
-# DGN is the default file extension of Microstation/Intergraph CAD files.
-# CIT is the proprietary raster format (similar to TIFF) used to attach
-# raster underlays to Microstation DGN (vector) drawings.
-#
-# http://www.wotsit.org/search.asp
-# http://filext.com/detaillist.php?extdetail=DGN
-# http://filext.com/detaillist.php?extdetail=CIT
-#
-# http://www.bentley.com/products/default.cfm?objectid=97F351F5-9C35-4E5E-89C2
-# 3F86C928&method=display&p_objectid=97F351F5-9C35-4E5E-89C280A93F86C928
-# http://www.bentley.com/products/default.cfm?objectid=A5C2FD43-3AC9-4C71-B682
-# 721C479F&method=display&p_objectid=A5C2FD43-3AC9-4C71-B682C7BE721C479F
-0 string \010\011\376 Microstation
->3 string \002
->>30 string \026\105 DGNFile
->>30 string \034\105 DGNFile
->>30 string \073\107 DGNFile
->>30 string \073\110 DGNFile
->>30 string \106\107 DGNFile
->>30 string \110\103 DGNFile
->>30 string \120\104 DGNFile
->>30 string \172\104 DGNFile
->>30 string \172\105 DGNFile
->>30 string \172\106 DGNFile
->>30 string \234\106 DGNFile
->>30 string \273\105 DGNFile
->>30 string \306\106 DGNFile
->>30 string \310\104 DGNFile
->>30 string \341\104 DGNFile
->>30 string \372\103 DGNFile
->>30 string \372\104 DGNFile
->>30 string \372\106 DGNFile
->>30 string \376\103 DGNFile
->4 string \030\000\000 CITFile
->4 string \030\000\003 CITFile
-
-# AutoCad, from Nahuel Greco
-# AutoCAD DWG versions R12/R13/R14 (www.autodesk.com)
-0 string AC1012 AutoCad (release 12)
-0 string AC1013 AutoCad (release 13)
-0 string AC1014 AutoCad (release 14)
-
-# CAD: file(1) magic for computer aided design files
-# Phillip Griffith <phillip dot griffith at gmail dot com>
-# AutoCAD magic taken from the Open Design Alliance's OpenDWG specifications.
-#
-0 belong 0x08051700 Bentley/Intergraph MicroStation DGN cell library
-0 belong 0x0809fe02 Bentley/Intergraph MicroStation DGN vector CAD
-0 belong 0xc809fe02 Bentley/Intergraph MicroStation DGN vector CAD
-0 beshort 0x0809 Bentley/Intergraph MicroStation
->0x02 byte 0xfe
->>0x04 beshort 0x1800 CIT raster CAD
-0 string AC1012 AutoDesk AutoCAD R13
-0 string AC1014 AutoDesk AutoCAD R14
-0 string AC1015 AutoDesk AutoCAD R2000
-#------------------------------------------------------------------------------
-# Cafe Babes unite!
-#
-# Since Java bytecode and Mach-O fat-files have the same magic number, the test
-# must be performed in the same "magic" sequence to get both right. The long
-# at offset 4 in a mach-O fat file tells the number of architectures; the short at
-# offset 4 in a Java bytecode file is the JVM minor version and the
-# short at offset 6 is the JVM major version. Since there are only
-# only 18 labeled Mach-O architectures at current, and the first released
-# Java class format was version 43.0, we can safely choose any number
-# between 18 and 39 to test the number of architectures against
-# (and use as a hack). Let's not use 18, because the Mach-O people
-# might add another one or two as time goes by...
-#
-0 belong 0xcafebabe
-!:mime application/x-java-applet
->4 belong >30 compiled Java class data,
->>6 beshort x version %d.
->>4 beshort x \b%d
-# Which is which?
-#>>4 belong 0x032d (Java 1.0)
-#>>4 belong 0x032d (Java 1.1)
->>4 belong 0x002e (Java 1.2)
->>4 belong 0x002f (Java 1.3)
->>4 belong 0x0030 (Java 1.4)
->>4 belong 0x0031 (Java 1.5)
->>4 belong 0x0032 (Java 1.6)
-
-
-0 belong 0xcafebabe
->4 belong 1 Mach-O fat file with 1 architecture
->4 belong >1
->>4 belong <20 Mach-O fat file with %ld architectures
-
-0 belong 0xcafed00d JAR compressed with pack200,
->>5 byte x version %d.
->>4 byte x \b%d
-!:mime application/x-java-pack200
-#------------------------------------------------------------------------------
-# CDDB: file(1) magic for CDDB(tm) format CD text data files
-#
-# From <steve@gracenote.com>
-#
-# This is the /etc/magic entry to decode datafiles as used by
-# CDDB-enabled CD player applications.
-#
-
-0 search/1/b #\040xmcd CDDB(tm) format CD text data
-
-#------------------------------------------------------------------------------
-# chord: file(1) magic for Chord music sheet typesetting utility input files
-#
-# From Philippe De Muyter <phdm@macqel.be>
-# File format is actually free, but many distributed files begin with `{title'
-#
-0 string {title Chord text file
-
-# Type: PowerTab file format
-# URL: http://www.power-tab.net/
-# From: Jelmer Vernooij <jelmer@samba.org>
-0 string ptab\003\000 Power-Tab v3 Tablature File
-0 string ptab\004\000 Power-Tab v4 Tablature File
-#------------------------------------------------------------------------------
-# cisco: file(1) magic for cisco Systems routers
-#
-# Most cisco file-formats are covered by the generic elf code
-#
-# Microcode files are non-ELF, 0x8501 conflicts with NetBSD/alpha.
-0 belong&0xffffff00 0x85011400 cisco IOS microcode
->7 string >\0 for '%s'
-0 belong&0xffffff00 0x8501cb00 cisco IOS experimental microcode
->7 string >\0 for '%s'
-#------------------------------------------------------------------------------
-# citrus locale declaration
-#
-
-0 string RuneCT Citrus locale declaration for LC_CTYPE
-
-
-#------------------------------------------------------------------------------
-# clarion: file(1) magic for # Clarion Personal/Professional Developer
-# (v2 and above)
-# From: Julien Blache <jb@jblache.org>
-
-# Database files
-# signature
-0 leshort 0x3343 Clarion Developer (v2 and above) data file
-# attributes
->2 leshort &0x0001 \b, locked
->2 leshort &0x0004 \b, encrypted
->2 leshort &0x0008 \b, memo file exists
->2 leshort &0x0010 \b, compressed
->2 leshort &0x0040 \b, read only
-# number of records
->5 lelong x \b, %ld records
-
-# Memo files
-0 leshort 0x334d Clarion Developer (v2 and above) memo data
-
-# Key/Index files
-# No magic? :(
-
-# Help files
-0 leshort 0x49e0 Clarion Developer (v2 and above) help data
-
-#------------------------------------------------------------------------------
-# claris: file(1) magic for claris
-# "H. Nanosecond" <aldomel@ix.netcom.com>
-# Claris Works a word processor, etc.
-# Version 3.0
-
-# .pct claris works clip art files
-#0000000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
-#*
-#0001000 #010 250 377 377 377 377 000 213 000 230 000 021 002 377 014 000
-#null to byte 1000 octal
-514 string \377\377\377\377\000 Claris clip art?
->0 string \0\0\0\0\0\0\0\0\0\0\0\0\0 yes.
-514 string \377\377\377\377\001 Claris clip art?
->0 string \0\0\0\0\0\0\0\0\0\0\0\0\0 yes.
-
-# Claris works files
-# .cwk
-0 string \002\000\210\003\102\117\102\117\000\001\206 Claris works document
-# .plt
-0 string \020\341\000\000\010\010 Claris Works pallete files .plt
-
-# .msp a dictionary file I am not sure about this I have only one .msp file
-0 string \002\271\262\000\040\002\000\164 Claris works dictionary
-
-# .usp are user dictionary bits
-# I am not sure about a magic header:
-#0000000 001 123 160 146 070 125 104 040 136 123 015 012 160 157 144 151
-# soh S p f 8 U D sp ^ S cr nl p o d i
-#0000020 141 164 162 151 163 164 040 136 123 015 012 144 151 166 040 043
-# a t r i s t sp ^ S cr nl d i v sp #
-
-# .mth Thesaurus
-# starts with \0 but no magic header
-
-# .chy Hyphenation file
-# I am not sure: 000 210 034 000 000
-
-# other claris files
-#./windows/claris/useng.ndx: data
-#./windows/claris/xtndtran.l32: data
-#./windows/claris/xtndtran.lst: data
-#./windows/claris/clworks.lbl: data
-#./windows/claris/clworks.prf: data
-#./windows/claris/userd.spl: data
-
-#------------------------------------------------------------------------------
-# clipper: file(1) magic for Intergraph (formerly Fairchild) Clipper.
-#
-# XXX - what byte order does the Clipper use?
-#
-# XXX - what's the "!" stuff:
-#
-# >18 short !074000,000000 C1 R1
-# >18 short !074000,004000 C2 R1
-# >18 short !074000,010000 C3 R1
-# >18 short !074000,074000 TEST
-#
-# I shall assume it's ANDing the field with the first value and
-# comparing it with the second, and rewrite it as:
-#
-# >18 short&074000 000000 C1 R1
-# >18 short&074000 004000 C2 R1
-# >18 short&074000 010000 C3 R1
-# >18 short&074000 074000 TEST
-#
-# as SVR3.1's "file" doesn't support anything of the "!074000,000000"
-# sort, nor does SunOS 4.x, so either it's something Intergraph added
-# in CLIX, or something AT&T added in SVR3.2 or later, or something
-# somebody else thought was a good idea; it's not documented in the
-# man page for this version of "magic", nor does it appear to be
-# implemented (at least not after I blew off the bogus code to turn
-# old-style "&"s into new-style "&"s, which just didn't work at all).
-#
-0 short 0575 CLIPPER COFF executable (VAX #)
->20 short 0407 (impure)
->20 short 0410 (5.2 compatible)
->20 short 0411 (pure)
->20 short 0413 (demand paged)
->20 short 0443 (target shared library)
->12 long >0 not stripped
->22 short >0 - version %ld
-0 short 0577 CLIPPER COFF executable
->18 short&074000 000000 C1 R1
->18 short&074000 004000 C2 R1
->18 short&074000 010000 C3 R1
->18 short&074000 074000 TEST
->20 short 0407 (impure)
->20 short 0410 (pure)
->20 short 0411 (separate I&D)
->20 short 0413 (paged)
->20 short 0443 (target shared library)
->12 long >0 not stripped
->22 short >0 - version %ld
->48 long&01 01 alignment trap enabled
->52 byte 1 -Ctnc
->52 byte 2 -Ctsw
->52 byte 3 -Ctpw
->52 byte 4 -Ctcb
->53 byte 1 -Cdnc
->53 byte 2 -Cdsw
->53 byte 3 -Cdpw
->53 byte 4 -Cdcb
->54 byte 1 -Csnc
->54 byte 2 -Cssw
->54 byte 3 -Cspw
->54 byte 4 -Cscb
-4 string pipe CLIPPER instruction trace
-4 string prof CLIPPER instruction profile
-
-#------------------------------------------------------------------------------
-# commands: file(1) magic for various shells and interpreters
-#
-#0 string : shell archive or script for antique kernel text
-0 string/b #!\ /bin/sh POSIX shell script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /bin/csh C shell script text executable
-!:mime text/x-shellscript
-# korn shell magic, sent by George Wu, gwu@clyde.att.com
-0 string/b #!\ /bin/ksh Korn shell script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /bin/tcsh Tenex C shell script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /usr/bin/tcsh Tenex C shell script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /usr/local/tcsh Tenex C shell script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /usr/local/bin/tcsh Tenex C shell script text executable
-!:mime text/x-shellscript
-
-#
-# zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
-0 string/b #!\ /bin/zsh Paul Falstad's zsh script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /usr/bin/zsh Paul Falstad's zsh script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /usr/local/bin/zsh Paul Falstad's zsh script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /usr/local/bin/ash Neil Brown's ash script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /usr/local/bin/ae Neil Brown's ae script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /bin/nawk new awk script text executable
-!:mime text/x-nawk
-0 string/b #!\ /usr/bin/nawk new awk script text executable
-!:mime text/x-nawk
-0 string/b #!\ /usr/local/bin/nawk new awk script text executable
-!:mime text/x-nawk
-0 string/b #!\ /bin/gawk GNU awk script text executable
-!:mime text/x-gawk
-0 string/b #!\ /usr/bin/gawk GNU awk script text executable
-!:mime text/x-gawk
-0 string/b #!\ /usr/local/bin/gawk GNU awk script text executable
-!:mime text/x-gawk
-#
-0 string/b #!\ /bin/awk awk script text executable
-!:mime text/x-awk
-0 string/b #!\ /usr/bin/awk awk script text executable
-!:mime text/x-awk
-# update to distinguish from *.vcf files
-# this is broken because postscript has /EBEGIN{ for example.
-#0 search/Bb BEGIN { awk script text
-0 regex =^\\s*BEGIN\\s*[{] awk script text
-
-# AT&T Bell Labs' Plan 9 shell
-0 string/b #!\ /bin/rc Plan 9 rc shell script text executable
-
-# bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
-0 string/b #!\ /bin/bash Bourne-Again shell script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /usr/bin/bash Bourne-Again shell script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /usr/local/bash Bourne-Again shell script text executable
-!:mime text/x-shellscript
-0 string/b #!\ /usr/local/bin/bash Bourne-Again shell script text executable
-!:mime text/x-shellscript
-
-# using env
-0 string #!/usr/bin/env a
->15 string >\0 %s script text executable
-0 string #!\ /usr/bin/env a
->16 string >\0 %s script text executable
-
-# PHP scripts
-# Ulf Harnhammar <ulfh@update.uu.se>
-0 search/1/c =<?php PHP script text
-!:mime text/x-php
-0 search/1 =<?\n PHP script text
-!:mime text/x-php
-0 search/1 =<?\r PHP script text
-!:mime text/x-php
-0 search/1/b #!\ /usr/local/bin/php PHP script text executable
-!:mime text/x-php
-0 search/1/b #!\ /usr/bin/php PHP script text executable
-!:mime text/x-php
-
-0 string Zend\x00 PHP script Zend Optimizer data
-
-0 string $! DCL command file
-
-# Type: Pdmenu
-# URL: http://packages.debian.org/pdmenu
-# From: Edward Betts <edward@debian.org>
-0 string #!/usr/bin/pdmenu Pdmenu configuration file text
-
-#----------------------------------------------------------------------------
-# communication
-
-# TTCN is the Tree and Tabular Combined Notation described in ISO 9646-3.
-# It is used for conformance testing of communication protocols.
-# Added by W. Borgert <debacle@debian.org>.
-0 string $Suite TTCN Abstract Test Suite
->&1 string $SuiteId
->>&1 string >\n %s
->&2 string $SuiteId
->>&1 string >\n %s
->&3 string $SuiteId
->>&1 string >\n %s
-
-# MSC (message sequence charts) are a formal description technique,
-# described in ITU-T Z.120, mainly used for communication protocols.
-# Added by W. Borgert <debacle@debian.org>.
-0 string mscdocument Message Sequence Chart (document)
-0 string msc Message Sequence Chart (chart)
-0 string submsc Message Sequence Chart (subchart)
-
-#------------------------------------------------------------------------------
-# compress: file(1) magic for pure-compression formats (no archives)
-#
-# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
-#
-# Formats for various forms of compressed data
-# Formats for "compress" proper have been moved into "compress.c",
-# because it tries to uncompress it to figure out what's inside.
-
-# standard unix compress
-0 string \037\235 compress'd data
-!:mime application/x-compress
-!:apple LZIVZIVU
->2 byte&0x80 >0 block compressed
->2 byte&0x1f x %d bits
-
-# gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
-# Edited by Chris Chittleborough <cchittleborough@yahoo.com.au>, March 2002
-# * Original filename is only at offset 10 if "extra field" absent
-# * Produce shorter output - notably, only report compression methods
-# other than 8 ("deflate", the only method defined in RFC 1952).
-0 string \037\213 gzip compressed data
-!:mime application/x-gzip
->2 byte <8 \b, reserved method
->2 byte >8 \b, unknown method
->3 byte &0x01 \b, ASCII
->3 byte &0x02 \b, has CRC
->3 byte &0x04 \b, extra field
->3 byte&0xC =0x08
->>10 string x \b, was "%s"
->3 byte &0x10 \b, has comment
->9 byte =0x00 \b, from FAT filesystem (MS-DOS, OS/2, NT)
->9 byte =0x01 \b, from Amiga
->9 byte =0x02 \b, from VMS
->9 byte =0x03 \b, from Unix
->9 byte =0x04 \b, from VM/CMS
->9 byte =0x05 \b, from Atari
->9 byte =0x06 \b, from HPFS filesystem (OS/2, NT)
->9 byte =0x07 \b, from MacOS
->9 byte =0x08 \b, from Z-System
->9 byte =0x09 \b, from CP/M
->9 byte =0x0A \b, from TOPS/20
->9 byte =0x0B \b, from NTFS filesystem (NT)
->9 byte =0x0C \b, from QDOS
->9 byte =0x0D \b, from Acorn RISCOS
->3 byte &0x10 \b, comment
->3 byte &0x20 \b, encrypted
->4 ledate >0 \b, last modified: %s
->8 byte 2 \b, max compression
->8 byte 4 \b, max speed
-
-# packed data, Huffman (minimum redundancy) codes on a byte-by-byte basis
-0 string \037\036 packed data
-!:mime application/octet-stream
->2 belong >1 \b, %d characters originally
->2 belong =1 \b, %d character originally
-#
-# This magic number is byte-order-independent.
-0 short 0x1f1f old packed data
-!:mime application/octet-stream
-
-# XXX - why *two* entries for "compacted data", one of which is
-# byte-order independent, and one of which is byte-order dependent?
-#
-0 short 0x1fff compacted data
-!:mime application/octet-stream
-# This string is valid for SunOS (BE) and a matching "short" is listed
-# in the Ultrix (LE) magic file.
-0 string \377\037 compacted data
-!:mime application/octet-stream
-0 short 0145405 huf output
-!:mime application/octet-stream
-
-# bzip2
-0 string BZh bzip2 compressed data
-!:mime application/x-bzip2
->3 byte >47 \b, block size = %c00k
-
-# lzip
-0 string LZIP lzip compressed data
-!:mime application/x-lzip
->4 byte x \b, version: %d
-
-# squeeze and crunch
-# Michael Haardt <michael@cantor.informatik.rwth-aachen.de>
-0 beshort 0x76FF squeezed data,
->4 string x original name %s
-0 beshort 0x76FE crunched data,
->2 string x original name %s
-0 beshort 0x76FD LZH compressed data,
->2 string x original name %s
-
-# Freeze
-0 string \037\237 frozen file 2.1
-0 string \037\236 frozen file 1.0 (or gzip 0.5)
-
-# SCO compress -H (LZH)
-0 string \037\240 SCO compress -H (LZH) data
-
-# European GSM 06.10 is a provisional standard for full-rate speech
-# transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse
-# excitation/long term prediction) coding at 13 kbit/s.
-#
-# There's only a magic nibble (4 bits); that nibble repeats every 33
-# bytes. This isn't suited for use, but maybe we can use it someday.
-#
-# This will cause very short GSM files to be declared as data and
-# mismatches to be declared as data too!
-#0 byte&0xF0 0xd0 data
-#>33 byte&0xF0 0xd0
-#>66 byte&0xF0 0xd0
-#>99 byte&0xF0 0xd0
-#>132 byte&0xF0 0xd0 GSM 06.10 compressed audio
-
-# bzip a block-sorting file compressor
-# by Julian Seward <sewardj@cs.man.ac.uk> and others
-#
-#0 string BZ bzip compressed data
-#>2 byte x \b, version: %c
-#>3 string =1 \b, compression block size 100k
-#>3 string =2 \b, compression block size 200k
-#>3 string =3 \b, compression block size 300k
-#>3 string =4 \b, compression block size 400k
-#>3 string =5 \b, compression block size 500k
-#>3 string =6 \b, compression block size 600k
-#>3 string =7 \b, compression block size 700k
-#>3 string =8 \b, compression block size 800k
-#>3 string =9 \b, compression block size 900k
-
-# lzop from <markus.oberhumer@jk.uni-linz.ac.at>
-0 string \x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a lzop compressed data
->9 beshort <0x0940
->>9 byte&0xf0 =0x00 - version 0.
->>9 beshort&0x0fff x \b%03x,
->>13 byte 1 LZO1X-1,
->>13 byte 2 LZO1X-1(15),
->>13 byte 3 LZO1X-999,
-## >>22 bedate >0 last modified: %s,
->>14 byte =0x00 os: MS-DOS
->>14 byte =0x01 os: Amiga
->>14 byte =0x02 os: VMS
->>14 byte =0x03 os: Unix
->>14 byte =0x05 os: Atari
->>14 byte =0x06 os: OS/2
->>14 byte =0x07 os: MacOS
->>14 byte =0x0A os: Tops/20
->>14 byte =0x0B os: WinNT
->>14 byte =0x0E os: Win32
->9 beshort >0x0939
->>9 byte&0xf0 =0x00 - version 0.
->>9 byte&0xf0 =0x10 - version 1.
->>9 byte&0xf0 =0x20 - version 2.
->>9 beshort&0x0fff x \b%03x,
->>15 byte 1 LZO1X-1,
->>15 byte 2 LZO1X-1(15),
->>15 byte 3 LZO1X-999,
-## >>25 bedate >0 last modified: %s,
->>17 byte =0x00 os: MS-DOS
->>17 byte =0x01 os: Amiga
->>17 byte =0x02 os: VMS
->>17 byte =0x03 os: Unix
->>17 byte =0x05 os: Atari
->>17 byte =0x06 os: OS/2
->>17 byte =0x07 os: MacOS
->>17 byte =0x0A os: Tops/20
->>17 byte =0x0B os: WinNT
->>17 byte =0x0E os: Win32
-
-# 4.3BSD-Quasijarus Strong Compression
-# http://minnie.tuhs.org/Quasijarus/compress.html
-0 string \037\241 Quasijarus strong compressed data
-
-# From: Cory Dikkers <cdikkers@swbell.net>
-0 string XPKF Amiga xpkf.library compressed data
-0 string PP11 Power Packer 1.1 compressed data
-0 string PP20 Power Packer 2.0 compressed data,
->4 belong 0x09090909 fast compression
->4 belong 0x090A0A0A mediocre compression
->4 belong 0x090A0B0B good compression
->4 belong 0x090A0C0C very good compression
->4 belong 0x090A0C0D best compression
-
-# 7-zip archiver, from Thomas Klausner (wiz@danbala.tuwien.ac.at)
-# http://www.7-zip.org or DOC/7zFormat.txt
-#
-0 string 7z\274\257\047\034 7-zip archive data,
->6 byte x version %d
->7 byte x \b.%d
-
-# Type: LZMA
-# URL: http://www.7-zip.org/sdk.html
-# From: Robert Millan <rmh@aybabtu.com> and Reuben Thomas <rrt@sc3d.org>
-# Commented out because apparently not reliable (according to Debian
-# bug #364260)
-#0 string ]\000\000\200\000 LZMA compressed data
-
-# http://tukaani.org/xz/xz-file-format.txt
-0 ustring \xFD7zXZ\x00 xz compressed data
-!:mime application/x-xz
-
-# AFX compressed files (Wolfram Kleff)
-2 string -afx- AFX compressed file data
-
-# Supplementary magic data for the file(1) command to support
-# rzip(1). The format is described in magic(5).
-#
-# Copyright (C) 2003 by Andrew Tridgell. You may do whatever you want with
-# this file.
-#
-0 string RZIP rzip compressed data
->4 byte x - version %d
->5 byte x \b.%d
->6 belong x (%d bytes)
-
-# Type: XZ
-# URL: http://tukaani.org/xz/
-0 string \xfd\x37\x7a\x58\x5a\x00 XZ compressed data
-!:mime application/x-xz
-#------------------------------------------------------------------------------
-# Console game magic
-# Toby Deshane <hac@shoelace.digivill.net>
-# ines: file(1) magic for Marat's iNES Nintendo Entertainment System
-# ROM dump format
-
-0 string NES\032 iNES ROM dump,
->4 byte x %dx16k PRG
->5 byte x \b, %dx8k CHR
->6 byte&0x01 =0x1 \b, [Vert.]
->6 byte&0x01 =0x0 \b, [Horiz.]
->6 byte&0x02 =0x2 \b, [SRAM]
->6 byte&0x04 =0x4 \b, [Trainer]
->6 byte&0x04 =0x8 \b, [4-Scr]
-
-#------------------------------------------------------------------------------
-# gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format
-#
-0x104 belong 0xCEED6666 Gameboy ROM:
->0x134 string >\0 "%.16s"
->0x146 byte 0x03 \b,[SGB]
->0x147 byte 0x00 \b, [ROM ONLY]
->0x147 byte 0x01 \b, [ROM+MBC1]
->0x147 byte 0x02 \b, [ROM+MBC1+RAM]
->0x147 byte 0x03 \b, [ROM+MBC1+RAM+BATT]
->0x147 byte 0x05 \b, [ROM+MBC2]
->0x147 byte 0x06 \b, [ROM+MBC2+BATTERY]
->0x147 byte 0x08 \b, [ROM+RAM]
->0x147 byte 0x09 \b, [ROM+RAM+BATTERY]
->0x147 byte 0x0B \b, [ROM+MMM01]
->0x147 byte 0x0C \b, [ROM+MMM01+SRAM]
->0x147 byte 0x0D \b, [ROM+MMM01+SRAM+BATT]
->0x147 byte 0x0F \b, [ROM+MBC3+TIMER+BATT]
->0x147 byte 0x10 \b, [ROM+MBC3+TIMER+RAM+BATT]
->0x147 byte 0x11 \b, [ROM+MBC3]
->0x147 byte 0x12 \b, [ROM+MBC3+RAM]
->0x147 byte 0x13 \b, [ROM+MBC3+RAM+BATT]
->0x147 byte 0x19 \b, [ROM+MBC5]
->0x147 byte 0x1A \b, [ROM+MBC5+RAM]
->0x147 byte 0x1B \b, [ROM+MBC5+RAM+BATT]
->0x147 byte 0x1C \b, [ROM+MBC5+RUMBLE]
->0x147 byte 0x1D \b, [ROM+MBC5+RUMBLE+SRAM]
->0x147 byte 0x1E \b, [ROM+MBC5+RUMBLE+SRAM+BATT]
->0x147 byte 0x1F \b, [Pocket Camera]
->0x147 byte 0xFD \b, [Bandai TAMA5]
->0x147 byte 0xFE \b, [Hudson HuC-3]
->0x147 byte 0xFF \b, [Hudson HuC-1]
-
->0x148 byte 0 \b, ROM: 256Kbit
->0x148 byte 1 \b, ROM: 512Kbit
->0x148 byte 2 \b, ROM: 1Mbit
->0x148 byte 3 \b, ROM: 2Mbit
->0x148 byte 4 \b, ROM: 4Mbit
->0x148 byte 5 \b, ROM: 8Mbit
->0x148 byte 6 \b, ROM: 16Mbit
->0x148 byte 0x52 \b, ROM: 9Mbit
->0x148 byte 0x53 \b, ROM: 10Mbit
->0x148 byte 0x54 \b, ROM: 12Mbit
-
->0x149 byte 1 \b, RAM: 16Kbit
->0x149 byte 2 \b, RAM: 64Kbit
->0x149 byte 3 \b, RAM: 128Kbit
->0x149 byte 4 \b, RAM: 1Mbit
-
-#>0x14e long x \b, CRC: %x
-
-#------------------------------------------------------------------------------
-# genesis: file(1) magic for the Sega MegaDrive/Genesis raw ROM format
-#
-0x100 string SEGA Sega MegaDrive/Genesis raw ROM dump
->0x120 string >\0 Name: "%.16s"
->0x110 string >\0 %.16s
->0x1B0 string RA with SRAM
-
-#------------------------------------------------------------------------------
-# genesis: file(1) magic for the Super MegaDrive ROM dump format
-#
-0x280 string EAGN Super MagicDrive ROM dump
->0 byte x %dx16k blocks
->2 byte 0 \b, last in series or standalone
->2 byte >0 \b, split ROM
->8 byte 0xAA
->9 byte 0xBB
-
-#------------------------------------------------------------------------------
-# genesis: file(1) alternate magic for the Super MegaDrive ROM dump format
-#
-0x280 string EAMG Super MagicDrive ROM dump
->0 byte x %dx16k blocks
->2 byte x \b, last in series or standalone
->8 byte 0xAA
->9 byte 0xBB
-
-#------------------------------------------------------------------------------
-# smsgg: file(1) magic for Sega Master System and Game Gear ROM dumps
-#
-# Does not detect all images. Very preliminary guesswork. Need more data
-# on format.
-#
-# FIXME: need a little more info...;P
-#
-#0 byte 0xF3
-#>1 byte 0xED Sega Master System/Game Gear ROM dump
-#>1 byte 0x31 Sega Master System/Game Gear ROM dump
-#>1 byte 0xDB Sega Master System/Game Gear ROM dump
-#>1 byte 0xAF Sega Master System/Game Gear ROM dump
-#>1 byte 0xC3 Sega Master System/Game Gear ROM dump
-
-#------------------------------------------------------------------------------
-# dreamcast: file(1) uncertain magic for the Sega Dreamcast VMU image format
-#
-0 belong 0x21068028 Sega Dreamcast VMU game image
-0 string LCDi Dream Animator file
-
-#------------------------------------------------------------------------------
-# v64: file(1) uncertain magic for the V64 format N64 ROM dumps
-#
-0 belong 0x37804012 V64 Nintendo 64 ROM dump
-
-# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
-# Nintendo .nds
-192 string \044\377\256Qi\232 Nintendo DS Game ROM Image
-# Nintendo .gba
-0 string \056\000\000\352$\377\256Qi Nintendo Game Boy Advance ROM Image
-
-#------------------------------------------------------------------------------
-# msx: file(1) magic for MSX game cartridge dumps
-# Too simple - MPi
-#0 beshort 0x4142 MSX game cartridge dump
-
-#------------------------------------------------------------------------------
-# Sony Playstation executables (Adam Sjoegren <asjo@diku.dk>) :
-0 string PS-X\ EXE Sony Playstation executable
-# Area:
->113 string x (%s)
-
-#------------------------------------------------------------------------------
-# Microsoft Xbox executables .xbe (Esa Hyytiä <ehyytia@cc.hut.fi>)
-0 string XBEH XBE, Microsoft Xbox executable
-# probabilistic checks whether signed or not
->0x0004 ulelong =0x0
->>&2 ulelong =0x0
->>>&2 ulelong =0x0 \b, not signed
->0x0004 ulelong >0
->>&2 ulelong >0
->>>&2 ulelong >0 \b, signed
-# expect base address of 0x10000
->0x0104 ulelong =0x10000
->>(0x0118-0x0FF60) ulelong&0x80000007 0x80000007 \b, all regions
->>(0x0118-0x0FF60) ulelong&0x80000007 !0x80000007
->>>(0x0118-0x0FF60) ulelong >0 (regions:
->>>>(0x0118-0x0FF60) ulelong &0x00000001 NA
->>>>(0x0118-0x0FF60) ulelong &0x00000002 Japan
->>>>(0x0118-0x0FF60) ulelong &0x00000004 Rest_of_World
->>>>(0x0118-0x0FF60) ulelong &0x80000000 Manufacturer
->>>(0x0118-0x0FF60) ulelong >0 \b)
-
-# --------------------------------
-# Microsoft Xbox data file formats
-0 string XIP0 XIP, Microsoft Xbox data
-0 string XTF0 XTF, Microsoft Xbox data
-
-# Atari Lynx cartridge dump (EXE/BLL header)
-# From: "Stefan A. Haubenthal" <polluks@web.de>
-
-0 beshort 0x8008 Lynx cartridge,
->2 beshort x RAM start $%04x
->6 string BS93
-
-# Opera file system that is used on the 3DO console
-# From: Serge van den Boom <svdb@stack.nl>
-0 string \x01ZZZZZ\x01 3DO "Opera" file system
-
-# From Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
-0 string GBS Nintendo Gameboy Music/Audio Data
-12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module
-
-# Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at>
-0 string PPF30 Playstation Patch File version 3.0
->5 byte 0 \b, PPF 1.0 patch
->5 byte 1 \b, PPF 2.0 patch
->5 byte 2 \b, PPF 3.0 patch
->>56 byte 0 \b, Imagetype BIN (any)
->>56 byte 1 \b, Imagetype GI (PrimoDVD)
->>57 byte 0 \b, Blockcheck disabled
->>57 byte 1 \b, Blockcheck enabled
->>58 byte 0 \b, Undo data not available
->>58 byte 1 \b, Undo data available
->6 string x \b, description: %s
-
-0 string PPF20 Playstation Patch File version 2.0
->5 byte 0 \b, PPF 1.0 patch
->5 byte 1 \b, PPF 2.0 patch
->>56 lelong >0 \b, size of file to patch %d
->6 string x \b, description: %s
-
-0 string PPF10 Playstation Patch File version 1.0
->5 byte 0 \b, Simple Encoding
->6 string x \b, description: %s
-
-# From: Daniel Dawson <ddawson@icehouse.net>
-# SNES9x .smv "movie" file format.
-0 string SMV\x1A SNES9x input recording
->0x4 lelong x \b, version %d
-# version 4 is latest so far
->0x4 lelong <5
->>0x8 ledate x \b, recorded at %s
->>0xc lelong >0 \b, rerecorded %d times
->>0x10 lelong x \b, %d frames long
->>0x14 byte >0 \b, data for controller(s):
->>>0x14 byte &0x1 #1
->>>0x14 byte &0x2 #2
->>>0x14 byte &0x4 #3
->>>0x14 byte &0x8 #4
->>>0x14 byte &0x10 #5
->>0x15 byte ^0x1 \b, begins from snapshot
->>0x15 byte &0x1 \b, begins from reset
->>0x15 byte ^0x2 \b, NTSC standard
->>0x15 byte &0x2 \b, PAL standard
->>0x17 byte &0x1 \b, settings:
-# WIP1Timing not used as of version 4
->>>0x4 lelong <4
->>>>0x17 byte &0x2 WIP1Timing
->>>0x17 byte &0x4 Left+Right
->>>0x17 byte &0x8 VolumeEnvX
->>>0x17 byte &0x10 FakeMute
->>>0x17 byte &0x20 SyncSound
-# New flag as of version 4
->>>0x4 lelong >3
->>>>0x17 byte &0x80 NoCPUShutdown
->>0x4 lelong <4
->>>0x18 lelong >0x23
->>>>0x20 leshort !0
->>>>>0x20 lestring16 x \b, metadata: "%s"
->>0x4 lelong >3
->>>0x24 byte >0 \b, port 1:
->>>>0x24 byte 1 joypad
->>>>0x24 byte 2 mouse
->>>>0x24 byte 3 SuperScope
->>>>0x24 byte 4 Justifier
->>>>0x24 byte 5 multitap
->>>0x24 byte >0 \b, port 2:
->>>>0x25 byte 1 joypad
->>>>0x25 byte 2 mouse
->>>>0x25 byte 3 SuperScope
->>>>0x25 byte 4 Justifier
->>>>0x25 byte 5 multitap
->>>0x18 lelong >0x43
->>>>0x40 leshort !0
->>>>>0x40 lestring16 x \b, metadata: "%s"
->>0x17 byte &0x40 \b, ROM:
->>>(0x18.l-26) lelong x CRC32 0x%08x
->>>(0x18.l-23) string x "%s"
-
-# Type: scummVM savegame files
-# From: Sven Hartge <debian@ds9.argh.org>
-0 string SCVM ScummVM savegame
->12 string >\0 "%s"
-#------------------------------------------------------------------------------
-# convex: file(1) magic for Convex boxes
-#
-# Convexes are big-endian.
-#
-# /*\
-# * Below are the magic numbers and tests added for Convex.
-# * Added at beginning, because they are expected to be used most.
-# \*/
-0 belong 0507 Convex old-style object
->16 belong >0 not stripped
-0 belong 0513 Convex old-style demand paged executable
->16 belong >0 not stripped
-0 belong 0515 Convex old-style pre-paged executable
->16 belong >0 not stripped
-0 belong 0517 Convex old-style pre-paged, non-swapped executable
->16 belong >0 not stripped
-0 belong 0x011257 Core file
-#
-# The following are a series of dump format magic numbers. Each one
-# corresponds to a drastically different dump format. The first on is
-# the original dump format on a 4.1 BSD or earlier file system. The
-# second marks the change between the 4.1 file system and the 4.2 file
-# system. The Third marks the changing of the block size from 1K
-# to 2K to be compatible with an IDC file system. The fourth indicates
-# a dump that is dependent on Convex Storage Manager, because data in
-# secondary storage is not physically contained within the dump.
-# The restore program uses these number to determine how the data is
-# to be extracted.
-#
-24 belong =60011 dump format, 4.1 BSD or earlier
-24 belong =60012 dump format, 4.2 or 4.3 BSD without IDC
-24 belong =60013 dump format, 4.2 or 4.3 BSD (IDC compatible)
-24 belong =60014 dump format, Convex Storage Manager by-reference dump
-#
-# what follows is a bunch of bit-mask checks on the flags field of the opthdr.
-# If there is no `=' sign, assume just checking for whether the bit is set?
-#
-0 belong 0601 Convex SOFF
->88 belong&0x000f0000 =0x00000000 c1
->88 belong &0x00010000 c2
->88 belong &0x00020000 c2mp
->88 belong &0x00040000 parallel
->88 belong &0x00080000 intrinsic
->88 belong &0x00000001 demand paged
->88 belong &0x00000002 pre-paged
->88 belong &0x00000004 non-swapped
->88 belong &0x00000008 POSIX
-#
->84 belong &0x80000000 executable
->84 belong &0x40000000 object
->84 belong&0x20000000 =0 not stripped
->84 belong&0x18000000 =0x00000000 native fpmode
->84 belong&0x18000000 =0x10000000 ieee fpmode
->84 belong&0x18000000 =0x18000000 undefined fpmode
-#
-0 belong 0605 Convex SOFF core
-#
-0 belong 0607 Convex SOFF checkpoint
->88 belong&0x000f0000 =0x00000000 c1
->88 belong &0x00010000 c2
->88 belong &0x00020000 c2mp
->88 belong &0x00040000 parallel
->88 belong &0x00080000 intrinsic
->88 belong &0x00000008 POSIX
-#
->84 belong&0x18000000 =0x00000000 native fpmode
->84 belong&0x18000000 =0x10000000 ieee fpmode
->84 belong&0x18000000 =0x18000000 undefined fpmode
-
-#------------------------------------------------------------------------------
-# cracklib: file (1) magic for cracklib v2.7
-
-0 lelong 0x70775631 Cracklib password index, little endian
->4 long >0 (%i words)
->4 long 0 ("64-bit")
->>8 long >-1 (%i words)
-0 belong 0x70775631 Cracklib password index, big endian
->4 belong >-1 (%i words)
-# really bellong 0x0000000070775631
-0 search/1 \0\0\0\0pwV1 Cracklib password index, big endian ("64-bit")
->12 belong >0 (%i words)
-# ----------------------------------------------------------------------------
-# ctags: file (1) magic for Exuberant Ctags files
-# From: Alexander Mai <mai@migdal.ikp.physik.tu-darmstadt.de>
-0 search/1 =!_TAG Exuberant Ctags tag file text
-
-#------------------------------------------------------------------------------
-# dact: file(1) magic for DACT compressed files
-#
-0 long 0x444354C3 DACT compressed data
->4 byte >-1 (version %i.
->5 byte >-1 $BS%i.
->6 byte >-1 $BS%i)
->7 long >0 $BS, original size: %i bytes
->15 long >30 $BS, block size: %i bytes
-
-#------------------------------------------------------------------------------
-# database: file(1) magic for various databases
-#
-# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
-#
-#
-# GDBM magic numbers
-# Will be maintained as part of the GDBM distribution in the future.
-# <downsj@teeny.org>
-0 belong 0x13579ace GNU dbm 1.x or ndbm database, big endian
-!:mime application/x-gdbm
-0 lelong 0x13579ace GNU dbm 1.x or ndbm database, little endian
-!:mime application/x-gdbm
-0 string GDBM GNU dbm 2.x database
-!:mime application/x-gdbm
-#
-# Berkeley DB
-#
-# Ian Darwin's file /etc/magic files: big/little-endian version.
-#
-# Hash 1.85/1.86 databases store metadata in network byte order.
-# Btree 1.85/1.86 databases store the metadata in host byte order.
-# Hash and Btree 2.X and later databases store the metadata in host byte order.
-
-0 long 0x00061561 Berkeley DB
-!:mime application/x-dbm
->8 belong 4321
->>4 belong >2 1.86
->>4 belong <3 1.85
->>4 belong >0 (Hash, version %d, native byte-order)
->8 belong 1234
->>4 belong >2 1.86
->>4 belong <3 1.85
->>4 belong >0 (Hash, version %d, little-endian)
-
-0 belong 0x00061561 Berkeley DB
->8 belong 4321
->>4 belong >2 1.86
->>4 belong <3 1.85
->>4 belong >0 (Hash, version %d, big-endian)
->8 belong 1234
->>4 belong >2 1.86
->>4 belong <3 1.85
->>4 belong >0 (Hash, version %d, native byte-order)
-
-0 long 0x00053162 Berkeley DB 1.85/1.86
->4 long >0 (Btree, version %d, native byte-order)
-0 belong 0x00053162 Berkeley DB 1.85/1.86
->4 belong >0 (Btree, version %d, big-endian)
-0 lelong 0x00053162 Berkeley DB 1.85/1.86
->4 lelong >0 (Btree, version %d, little-endian)
-
-12 long 0x00061561 Berkeley DB
->16 long >0 (Hash, version %d, native byte-order)
-12 belong 0x00061561 Berkeley DB
->16 belong >0 (Hash, version %d, big-endian)
-12 lelong 0x00061561 Berkeley DB
->16 lelong >0 (Hash, version %d, little-endian)
-
-12 long 0x00053162 Berkeley DB
->16 long >0 (Btree, version %d, native byte-order)
-12 belong 0x00053162 Berkeley DB
->16 belong >0 (Btree, version %d, big-endian)
-12 lelong 0x00053162 Berkeley DB
->16 lelong >0 (Btree, version %d, little-endian)
-
-12 long 0x00042253 Berkeley DB
->16 long >0 (Queue, version %d, native byte-order)
-12 belong 0x00042253 Berkeley DB
->16 belong >0 (Queue, version %d, big-endian)
-12 lelong 0x00042253 Berkeley DB
->16 lelong >0 (Queue, version %d, little-endian)
-
-# From Max Bowsher.
-12 long 0x00040988 Berkeley DB
->16 long >0 (Log, version %d, native byte-order)
-12 belong 0x00040988 Berkeley DB
->16 belong >0 (Log, version %d, big-endian)
-12 lelong 0x00040988 Berkeley DB
->16 lelong >0 (Log, version %d, little-endian)
-
-#
-#
-# Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch>
-0 string RRD RRDTool DB
->4 string x version %s
-#----------------------------------------------------------------------
-# ROOT: file(1) magic for ROOT databases
-#
-0 string root\0 ROOT file
->4 belong x Version %d
->33 belong x (Compression: %d)
-
-# XXX: Weak magic.
-# Alex Ott <ott@jet.msk.su>
-## Paradox file formats
-#2 leshort 0x0800 Paradox
-#>0x39 byte 3 v. 3.0
-#>0x39 byte 4 v. 3.5
-#>0x39 byte 9 v. 4.x
-#>0x39 byte 10 v. 5.x
-#>0x39 byte 11 v. 5.x
-#>0x39 byte 12 v. 7.x
-#>>0x04 byte 0 indexed .DB data file
-#>>0x04 byte 1 primary index .PX file
-#>>0x04 byte 2 non-indexed .DB data file
-#>>0x04 byte 3 non-incrementing secondary index .Xnn file
-#>>0x04 byte 4 secondary index .Ynn file
-#>>0x04 byte 5 incrementing secondary index .Xnn file
-#>>0x04 byte 6 non-incrementing secondary index .XGn file
-#>>0x04 byte 7 secondary index .YGn file
-#>>>0x04 byte 8 incrementing secondary index .XGn file
-
-## XBase database files
-#0 byte 0x02
-#>8 leshort >0
-#>>12 leshort 0 FoxBase
-#!:mime application/x-dbf
-#>>>0x04 lelong 0 (no records)
-#>>>0x04 lelong >0 (%ld records)
-#
-#0 byte 0x03
-#!:mime application/x-dbf
-#>8 leshort >0
-#>>12 leshort 0 FoxBase+, FoxPro, dBaseIII+, dBaseIV, no memo
-#>>>0x04 lelong 0 (no records)
-#>>>0x04 lelong >0 (%ld records)
-#
-#0 byte 0x04
-#!:mime application/x-dbf
-#>8 leshort >0
-#>>12 leshort 0 dBASE IV no memo file
-#>>>0x04 lelong 0 (no records)
-#>>>0x04 lelong >0 (%ld records)
-#
-#0 byte 0x05
-#!:mime application/x-dbf
-#>8 leshort >0
-#>>12 leshort 0 dBASE V no memo file
-#>>>0x04 lelong 0 (no records)
-#>>>0x04 lelong >0 (%ld records)
-#
-#0 byte 0x30
-#!:mime application/x-dbf
-#>8 leshort >0
-#>>12 leshort 0 Visual FoxPro
-#>>>0x04 lelong 0 (no records)
-#>>>0x04 lelong >0 (%ld records)
-#
-#0 byte 0x43
-#!:mime application/x-dbf
-#>8 leshort >0
-#>>12 leshort 0 FlagShip with memo var size
-#>>>0x04 lelong 0 (no records)
-#>>>0x04 lelong >0 (%ld records)
-#
-#0 byte 0x7b
-#!:mime application/x-dbf
-#>8 leshort >0
-#>>12 leshort 0 dBASEIV with memo
-#>>>0x04 lelong 0 (no records)
-#>>>0x04 lelong >0 (%ld records)
-#
-#0 byte 0x83
-#!:mime application/x-dbf
-#>8 leshort >0
-#>>12 leshort 0 FoxBase+, dBaseIII+ with memo
-#>>>0x04 lelong 0 (no records)
-#>>>0x04 lelong >0 (%ld records)
-#
-#0 byte 0x8b
-#!:mime application/x-dbf
-#>8 leshort >0
-#>>12 leshort 0 dBaseIV with memo
-#>>>0x04 lelong 0 (no records)
-#>>>0x04 lelong >0 (%ld records)
-#
-#0 byte 0x8e
-#!:mime application/x-dbf
-#>8 leshort >0
-#>>12 leshort 0 dBaseIV with SQL Table
-#>>>0x04 lelong 0 (no records)
-#>>>0x04 lelong >0 (%ld records)
-#
-#0 byte 0xb3
-#!:mime application/x-dbf
-#>8 leshort >0
-#>>12 leshort 0 FlagShip with .dbt memo
-#>>>0x04 lelong 0 (no records)
-#>>>0x04 lelong >0 (%ld records)
-#
-#0 byte 0xf5
-#!:mime application/x-dbf
-#>8 leshort >0
-#>>12 leshort 0 FoxPro with memo
-#>>>0x04 lelong 0 (no records)
-#>>>0x04 lelong >0 (%ld records)
-#
-#0 leshort 0x0006 DBase 3 index file
-
-# MS Access database
-4 string Standard\ Jet\ DB Microsoft Access Database
-!:mime application/x-msaccess
-
-# TDB database from Samba et al - Martin Pool <mbp@samba.org>
-0 string TDB\ file TDB database
->32 lelong 0x2601196D version 6, little-endian
->>36 lelong x hash size %d bytes
-
-# SE Linux policy database
-0 lelong 0xf97cff8c SE Linux policy
->16 lelong x v%d
->20 lelong 1 MLS
->24 lelong x %d symbols
->28 lelong x %d ocons
-
-# ICE authority file data (Wolfram Kleff)
-2 string ICE ICE authority data
-
-# X11 Xauthority file (Wolfram Kleff)
-10 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
-11 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
-12 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
-13 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
-14 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
-15 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
-16 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
-17 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
-18 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
-
-# From: Maxime Henrion <mux@FreeBSD.org>
-# PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org>
-0 string PGDMP PostgreSQL custom database dump
->5 byte x - v%d
->6 byte x \b.%d
->5 beshort <0x101 \b-0
->5 beshort >0x100
->>7 byte x \b-%d
-
-# Type: Advanced Data Format (ADF) database
-# URL: http://www.grc.nasa.gov/WWW/cgns/adf/
-# From: Nicolas Chauvat <nicolas.chauvat@logilab.fr>
-0 string @(#)ADF\ Database CGNS Advanced Data Format
-
-# Tokyo Cabinet magic data
-# http://tokyocabinet.sourceforge.net/index.html
-0 string ToKyO\ CaBiNeT\n Tokyo Cabinet
->14 string x \b (%s)
->32 byte 0 \b, Hash
-!:mime application/x-tokyocabinet-hash
->32 byte 1 \b, B+ tree
-!:mime application/x-tokyocabinet-btree
->32 byte 2 \b, Fixed-length
-!:mime application/x-tokyocabinet-fixed
->32 byte 3 \b, Table
-!:mime application/x-tokyocabinet-table
->33 byte &1 \b, [open]
->33 byte &2 \b, [fatal]
->34 byte x \b, apow=%d
->35 byte x \b, fpow=%d
->36 byte &0x01 \b, [large]
->36 byte &0x02 \b, [deflate]
->36 byte &0x04 \b, [bzip]
->36 byte &0x08 \b, [tcbs]
->36 byte &0x10 \b, [excodec]
->40 lequad x \b, bnum=%lld
->48 lequad x \b, rnum=%lld
->56 lequad x \b, fsiz=%lld
-
-# Type: QDBM Quick Database Manager
-# From: Benoit Sibaud <bsibaud@april.org>
-0 string \\[depot\\]\n\f Quick Database Manager, little endian
-0 string \\[DEPOT\\]\n\f Quick Database Manager, big endian
-
-# Type: TokyoCabinet database
-# URL: http://tokyocabinet.sourceforge.net/
-# From: Benoit Sibaud <bsibaud@april.org>
-0 string ToKyO\ CaBiNeT\n TokyoCabinet database
->14 string x (version %s)
-
-#------------------------------------------------------------------------------
-# diamond: file(1) magic for Diamond system
-#
-# ... diamond is a multi-media mail and electronic conferencing system....
-#
-# XXX - I think it was either renamed Slate, or replaced by Slate....
-#
-# The full deal is too long...
-#0 string <list>\n<protocol\ bbn-multimedia-format> Diamond Multimedia Document
-0 string =<list>\n<protocol\ bbn-m Diamond Multimedia Document
-#------------------------------------------------------------------------------
-# diff: file(1) magic for diff(1) output
-#
-0 search/1 diff\ diff output text
-!:mime text/x-diff
-0 search/1 ***\ diff output text
-!:mime text/x-diff
-0 search/1 Only\ in\ diff output text
-!:mime text/x-diff
-0 search/1 Common\ subdirectories:\ diff output text
-!:mime text/x-diff
-
-0 search/1 Index: RCS/CVS diff output text
-!:mime text/x-diff
-# Digital UNIX - Info
-#
-0 string =!<arch>\n________64E Alpha archive
->22 string X -- out of date
-#
-# Alpha COFF Based Executables
-# The stripped stuff really needs to be an 8 byte (64 bit) compare,
-# but this works
-0 leshort 0x183 COFF format alpha
->22 leshort&020000 &010000 sharable library,
->22 leshort&020000 ^010000 dynamically linked,
->24 leshort 0410 pure
->24 leshort 0413 demand paged
->8 lelong >0 executable or object module, not stripped
->8 lelong 0
->>12 lelong 0 executable or object module, stripped
->>12 lelong >0 executable or object module, not stripped
->27 byte >0 - version %d.
->26 byte >0 %d-
->28 leshort >0 %d
-#
-# The next is incomplete, we could tell more about this format,
-# but its not worth it.
-0 leshort 0x188 Alpha compressed COFF
-0 leshort 0x18f Alpha u-code object
-#
-#
-# Some other interesting Digital formats,
-0 string \377\377\177 ddis/ddif
-0 string \377\377\174 ddis/dots archive
-0 string \377\377\176 ddis/dtif table data
-0 string \033c\033 LN03 output
-0 long 04553207 X image
-#
-0 string =!<PDF>!\n profiling data file
-#
-# Locale data tables (MIPS and Alpha).
-#
-0 short 0x0501 locale data table
->6 short 0x24 for MIPS
->6 short 0x40 for Alpha
-# ATSC A/53 aka AC-3 aka Dolby Digital <ashitaka@gmx.at>
-# from http://www.atsc.org/standards/a_52a.pdf
-# corrections, additions, etc. are always welcome!
-#
-# syncword
-0 beshort 0x0b77 ATSC A/52 aka AC-3 aka Dolby Digital stream,
-# fscod
->4 byte&0xc0 0x00 48 kHz,
->4 byte&0xc0 0x40 44.1 kHz,
->4 byte&0xc0 0x80 32 kHz,
-# is this one used for 96 kHz?
->4 byte&0xc0 0xc0 reserved frequency,
-#
->5 byte&7 = 0 \b, complete main (CM)
->5 byte&7 = 1 \b, music and effects (ME)
->5 byte&7 = 2 \b, visually impaired (VI)
->5 byte&7 = 3 \b, hearing impaired (HI)
->5 byte&7 = 4 \b, dialogue (D)
->5 byte&7 = 5 \b, commentary (C)
->5 byte&7 = 6 \b, emergency (E)
-# acmod
->6 byte&0xe0 0x00 1+1 front,
->6 byte&0xe0 0x20 1 front/0 rear,
->6 byte&0xe0 0x40 2 front/0 rear,
->6 byte&0xe0 0x60 3 front/0 rear,
->6 byte&0xe0 0x80 2 front/1 rear,
->6 byte&0xe0 0xa0 3 front/1 rear,
->6 byte&0xe0 0xc0 2 front/2 rear,
->6 byte&0xe0 0xe0 3 front/2 rear,
-# lfeon (these may be incorrect)
->7 byte&0x40 0x00 LFE off,
->7 byte&0x40 0x40 LFE on,
-#
->4 byte&0x3e = 0x00 \b, 32 kbit/s
->4 byte&0x3e = 0x02 \b, 40 kbit/s
->4 byte&0x3e = 0x04 \b, 48 kbit/s
->4 byte&0x3e = 0x06 \b, 56 kbit/s
->4 byte&0x3e = 0x08 \b, 64 kbit/s
->4 byte&0x3e = 0x0a \b, 80 kbit/s
->4 byte&0x3e = 0x0c \b, 96 kbit/s
->4 byte&0x3e = 0x0e \b, 112 kbit/s
->4 byte&0x3e = 0x10 \b, 128 kbit/s
->4 byte&0x3e = 0x12 \b, 160 kbit/s
->4 byte&0x3e = 0x14 \b, 192 kbit/s
->4 byte&0x3e = 0x16 \b, 224 kbit/s
->4 byte&0x3e = 0x18 \b, 256 kbit/s
->4 byte&0x3e = 0x1a \b, 320 kbit/s
->4 byte&0x3e = 0x1c \b, 384 kbit/s
->4 byte&0x3e = 0x1e \b, 448 kbit/s
->4 byte&0x3e = 0x20 \b, 512 kbit/s
->4 byte&0x3e = 0x22 \b, 576 kbit/s
->4 byte&0x3e = 0x24 \b, 640 kbit/s
-# dsurmod (these may be incorrect)
->6 beshort&0x0180 0x0000 Dolby Surround not indicated
->6 beshort&0x0180 0x0080 not Dolby Surround encoded
->6 beshort&0x0180 0x0100 Dolby Surround encoded
->6 beshort&0x0180 0x0180 reserved Dolby Surround mode
-
-#------------------------------------------------------------------------------
-# dump: file(1) magic for dump file format--for new and old dump filesystems
-#
-# We specify both byte orders in order to recognize byte-swapped dumps.
-#
-24 belong 60012 new-fs dump file (big endian),
->4 bedate x Previous dump %s,
->8 bedate x This dump %s,
->12 belong >0 Volume %ld,
->692 belong 0 Level zero, type:
->692 belong >0 Level %d, type:
->0 belong 1 tape header,
->0 belong 2 beginning of file record,
->0 belong 3 map of inodes on tape,
->0 belong 4 continuation of file record,
->0 belong 5 end of volume,
->0 belong 6 map of inodes deleted,
->0 belong 7 end of medium (for floppy),
->676 string >\0 Label %s,
->696 string >\0 Filesystem %s,
->760 string >\0 Device %s,
->824 string >\0 Host %s,
->888 belong >0 Flags %x
-
-24 belong 60011 old-fs dump file (big endian),
-#>4 bedate x Previous dump %s,
-#>8 bedate x This dump %s,
->12 belong >0 Volume %ld,
->692 belong 0 Level zero, type:
->692 belong >0 Level %d, type:
->0 belong 1 tape header,
->0 belong 2 beginning of file record,
->0 belong 3 map of inodes on tape,
->0 belong 4 continuation of file record,
->0 belong 5 end of volume,
->0 belong 6 map of inodes deleted,
->0 belong 7 end of medium (for floppy),
->676 string >\0 Label %s,
->696 string >\0 Filesystem %s,
->760 string >\0 Device %s,
->824 string >\0 Host %s,
->888 belong >0 Flags %x
-
-24 lelong 60012 new-fs dump file (little endian),
->4 ledate x This dump %s,
->8 ledate x Previous dump %s,
->12 lelong >0 Volume %ld,
->692 lelong 0 Level zero, type:
->692 lelong >0 Level %d, type:
->0 lelong 1 tape header,
->0 lelong 2 beginning of file record,
->0 lelong 3 map of inodes on tape,
->0 lelong 4 continuation of file record,
->0 lelong 5 end of volume,
->0 lelong 6 map of inodes deleted,
->0 lelong 7 end of medium (for floppy),
->676 string >\0 Label %s,
->696 string >\0 Filesystem %s,
->760 string >\0 Device %s,
->824 string >\0 Host %s,
->888 lelong >0 Flags %x
-
-24 lelong 60011 old-fs dump file (little endian),
-#>4 ledate x Previous dump %s,
-#>8 ledate x This dump %s,
->12 lelong >0 Volume %ld,
->692 lelong 0 Level zero, type:
->692 lelong >0 Level %d, type:
->0 lelong 1 tape header,
->0 lelong 2 beginning of file record,
->0 lelong 3 map of inodes on tape,
->0 lelong 4 continuation of file record,
->0 lelong 5 end of volume,
->0 lelong 6 map of inodes deleted,
->0 lelong 7 end of medium (for floppy),
->676 string >\0 Label %s,
->696 string >\0 Filesystem %s,
->760 string >\0 Device %s,
->824 string >\0 Host %s,
->888 lelong >0 Flags %x
-
-18 leshort 60011 old-fs dump file (16-bit, assuming PDP-11 endianness),
->2 medate x Previous dump %s,
->6 medate x This dump %s,
->10 leshort >0 Volume %ld,
->0 leshort 1 tape header.
->0 leshort 2 beginning of file record.
->0 leshort 3 map of inodes on tape.
->0 leshort 4 continuation of file record.
->0 leshort 5 end of volume.
->0 leshort 6 map of inodes deleted.
->0 leshort 7 end of medium (for floppy).
-
-24 belong 0x19540119 new-fs dump file (ufs2, big endian),
->896 beqdate x Previous dump %s,
->904 beqdate x This dump %s,
->12 belong >0 Volume %ld,
->692 belong 0 Level zero, type:
->692 belong >0 Level %d, type:
->0 belong 1 tape header,
->0 belong 2 beginning of file record,
->0 belong 3 map of inodes on tape,
->0 belong 4 continuation of file record,
->0 belong 5 end of volume,
->0 belong 6 map of inodes deleted,
->0 belong 7 end of medium (for floppy),
->676 string >\0 Label %s,
->696 string >\0 Filesystem %s,
->760 string >\0 Device %s,
->824 string >\0 Host %s,
->888 belong >0 Flags %x
-
-24 lelong 0x19540119 new-fs dump file (ufs2, little endian),
->896 leqdate x This dump %s,
->904 leqdate x Previous dump %s,
->12 lelong >0 Volume %ld,
->692 lelong 0 Level zero, type:
->692 lelong >0 Level %d, type:
->0 lelong 1 tape header,
->0 lelong 2 beginning of file record,
->0 lelong 3 map of inodes on tape,
->0 lelong 4 continuation of file record,
->0 lelong 5 end of volume,
->0 lelong 6 map of inodes deleted,
->0 lelong 7 end of medium (for floppy),
->676 string >\0 Label %s,
->696 string >\0 Filesystem %s,
->760 string >\0 Device %s,
->824 string >\0 Host %s,
->888 lelong >0 Flags %x
-
-#------------------------------------------------------------------------------
-# Dyadic: file(1) magic for Dyalog APL.
-#
-0 byte 0xaa
->1 byte <4 Dyalog APL
->>1 byte 0x00 incomplete workspace
->>1 byte 0x01 component file
->>1 byte 0x02 external variable
->>1 byte 0x03 workspace
->>2 byte x version %d
->>3 byte x .%d
-
-#------------------------------------------------------------------------------
-# T602 editor documents
-# by David Necas <yeti@physics.muni.cz>
-0 string @CT\ T602 document data,
->4 string 0 Kamenicky
->4 string 1 CP 852
->4 string 2 KOI8-CS
->4 string >2 unknown encoding
-
-# Vi IMproved Encrypted file
-# by David Necas <yeti@physics.muni.cz>
-0 string VimCrypt~ Vim encrypted file data
-# Vi IMproved Swap file
-# by Sven Wegener <swegener@gentoo.org>
-0 string b0VIM\ Vim swap file
->&0 string >\0 \b, version %s
-
-#------------------------------------------------------------------------------
-# efi: file(1) magic for Universal EFI binaries
-
-0 lelong 0x0ef1fab9
->4 lelong 1 Universal EFI binary with 1 architecture
->>&0 lelong 7 \b, i386
->>&0 lelong 0x01000007 \b, x86_64
->4 lelong 2 Universal EFI binary with 2 architectures
->>&0 lelong 7 \b, i386
->>&0 lelong 0x01000007 \b, x86_64
->>&20 lelong 7 \b, i386
->>&20 lelong 0x01000007 \b, x86_64
->4 lelong >2 Universal EFI binary with %ld architectures
-
-#------------------------------------------------------------------------------
-# elf: file(1) magic for ELF executables
-#
-# We have to check the byte order flag to see what byte order all the
-# other stuff in the header is in.
-#
-# What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
-#
-# Created by: unknown
-# Modified by (1): Daniel Quinlan <quinlan@yggdrasil.com>
-# Modified by (2): Peter Tobias <tobias@server.et-inf.fho-emden.de> (core support)
-# Modified by (3): Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de> (fix of core support)
-# Modified by (4): <gerardo.cacciari@gmail.com> (VMS Itanium)
-# Modified by (5): Matthias Urlichs <smurf@debian.org> (Listing of many architectures)
-0 string \177ELF ELF
->4 byte 0 invalid class
->4 byte 1 32-bit
->4 byte 2 64-bit
->5 byte 0 invalid byte order
->5 byte 1 LSB
->>16 leshort 0 no file type,
-!:strength *2
-!:mime application/octet-stream
->>16 leshort 1 relocatable,
-!:mime application/x-object
->>16 leshort 2 executable,
-!:mime application/x-executable
->>16 leshort 3 shared object,
-!:mime application/x-sharedlib
->>16 leshort 4 core file
-!:mime application/x-coredump
-# Core file detection is not reliable.
-#>>>(0x38+0xcc) string >\0 of '%s'
-#>>>(0x38+0x10) lelong >0 (signal %d),
->>16 leshort &0xff00 processor-specific,
->>18 leshort 0 no machine,
->>18 leshort 1 AT&T WE32100 - invalid byte order,
->>18 leshort 2 SPARC - invalid byte order,
->>18 leshort 3 Intel 80386,
->>18 leshort 4 Motorola
->>>36 lelong &0x01000000 68000 - invalid byte order,
->>>36 lelong &0x00810000 CPU32 - invalid byte order,
->>>36 lelong 0 68020 - invalid byte order,
->>18 leshort 5 Motorola 88000 - invalid byte order,
->>18 leshort 6 Intel 80486,
->>18 leshort 7 Intel 80860,
-# The official e_machine number for MIPS is now #8, regardless of endianness.
-# The second number (#10) will be deprecated later. For now, we still
-# say something if #10 is encountered, but only gory details for #8.
->>18 leshort 8 MIPS,
->>>36 lelong &0x20 N32
->>18 leshort 10 MIPS,
->>>36 lelong &0x20 N32
->>18 leshort 8
-# only for 32-bit
->>>4 byte 1
->>>>36 lelong&0xf0000000 0x00000000 MIPS-I
->>>>36 lelong&0xf0000000 0x10000000 MIPS-II
->>>>36 lelong&0xf0000000 0x20000000 MIPS-III
->>>>36 lelong&0xf0000000 0x30000000 MIPS-IV
->>>>36 lelong&0xf0000000 0x40000000 MIPS-V
->>>>36 lelong&0xf0000000 0x50000000 MIPS32
->>>>36 lelong&0xf0000000 0x60000000 MIPS64
->>>>36 lelong&0xf0000000 0x70000000 MIPS32 rel2
->>>>36 lelong&0xf0000000 0x80000000 MIPS64 rel2
-# only for 64-bit
->>>4 byte 2
->>>>48 lelong&0xf0000000 0x00000000 MIPS-I
->>>>48 lelong&0xf0000000 0x10000000 MIPS-II
->>>>48 lelong&0xf0000000 0x20000000 MIPS-III
->>>>48 lelong&0xf0000000 0x30000000 MIPS-IV
->>>>48 lelong&0xf0000000 0x40000000 MIPS-V
->>>>48 lelong&0xf0000000 0x50000000 MIPS32
->>>>48 lelong&0xf0000000 0x60000000 MIPS64
->>>>48 lelong&0xf0000000 0x70000000 MIPS32 rel2
->>>>48 lelong&0xf0000000 0x80000000 MIPS64 rel2
->>18 leshort 9 Amdahl - invalid byte order,
->>18 leshort 10 MIPS (deprecated),
->>18 leshort 11 RS6000 - invalid byte order,
->>18 leshort 15 PA-RISC - invalid byte order,
->>>50 leshort 0x0214 2.0
->>>48 leshort &0x0008 (LP64),
->>18 leshort 16 nCUBE,
->>18 leshort 17 Fujitsu VPP500,
->>18 leshort 18 SPARC32PLUS - invalid byte order,
->>18 leshort 20 PowerPC,
->>18 leshort 22 IBM S/390,
->>18 leshort 36 NEC V800,
->>18 leshort 37 Fujitsu FR20,
->>18 leshort 38 TRW RH-32,
->>18 leshort 39 Motorola RCE,
->>18 leshort 40 ARM,
->>18 leshort 41 Alpha,
->>18 leshort 0xa390 IBM S/390 (obsolete),
->>18 leshort 42 Renesas SH,
->>18 leshort 43 SPARC V9 - invalid byte order,
->>18 leshort 44 Siemens Tricore Embedded Processor,
->>18 leshort 45 Argonaut RISC Core, Argonaut Technologies Inc.,
->>18 leshort 46 Renesas H8/300,
->>18 leshort 47 Renesas H8/300H,
->>18 leshort 48 Renesas H8S,
->>18 leshort 49 Renesas H8/500,
->>18 leshort 50 IA-64,
->>18 leshort 51 Stanford MIPS-X,
->>18 leshort 52 Motorola Coldfire,
->>18 leshort 53 Motorola M68HC12,
->>18 leshort 54 Fujitsu MMA,
->>18 leshort 55 Siemens PCP,
->>18 leshort 56 Sony nCPU,
->>18 leshort 57 Denso NDR1,
->>18 leshort 58 Start*Core,
->>18 leshort 59 Toyota ME16,
->>18 leshort 60 ST100,
->>18 leshort 61 Tinyj emb.,
->>18 leshort 62 x86-64,
->>18 leshort 63 Sony DSP,
->>18 leshort 66 FX66,
->>18 leshort 67 ST9+ 8/16 bit,
->>18 leshort 68 ST7 8 bit,
->>18 leshort 69 MC68HC16,
->>18 leshort 70 MC68HC11,
->>18 leshort 71 MC68HC08,
->>18 leshort 72 MC68HC05,
->>18 leshort 73 SGI SVx,
->>18 leshort 74 ST19 8 bit,
->>18 leshort 75 Digital VAX,
->>18 leshort 76 Axis cris,
->>18 leshort 77 Infineon 32-bit embedded,
->>18 leshort 78 Element 14 64-bit DSP,
->>18 leshort 79 LSI Logic 16-bit DSP,
->>18 leshort 80 MMIX,
->>18 leshort 81 Harvard machine-independent,
->>18 leshort 82 SiTera Prism,
->>18 leshort 83 Atmel AVR 8-bit,
->>18 leshort 84 Fujitsu FR30,
->>18 leshort 85 Mitsubishi D10V,
->>18 leshort 86 Mitsubishi D30V,
->>18 leshort 87 NEC v850,
->>18 leshort 88 Renesas M32R,
->>18 leshort 89 Matsushita MN10300,
->>18 leshort 90 Matsushita MN10200,
->>18 leshort 91 picoJava,
->>18 leshort 92 OpenRISC,
->>18 leshort 93 ARC Cores Tangent-A5,
->>18 leshort 94 Tensilica Xtensa,
->>18 leshort 97 NatSemi 32k,
->>18 leshort 106 Analog Devices Blackfin,
->>18 leshort 113 Altera Nios II,
->>18 leshort 0xae META,
->>18 leshort 0x3426 OpenRISC (obsolete),
->>18 leshort 0x8472 OpenRISC (obsolete),
->>18 leshort 0x9026 Alpha (unofficial),
->>20 lelong 0 invalid version
->>20 lelong 1 version 1
->>36 lelong 1 MathCoPro/FPU/MAU Required
->5 byte 2 MSB
->>16 beshort 0 no file type,
-!:mime application/octet-stream
->>16 beshort 1 relocatable,
-!:mime application/x-object
->>16 beshort 2 executable,
-!:mime application/x-executable
->>16 beshort 3 shared object,
-!:mime application/x-sharedlib
->>16 beshort 4 core file,
-!:mime application/x-coredump
-#>>>(0x38+0xcc) string >\0 of '%s'
-#>>>(0x38+0x10) belong >0 (signal %d),
->>16 beshort &0xff00 processor-specific,
->>18 beshort 0 no machine,
->>18 beshort 1 AT&T WE32100,
->>18 beshort 2 SPARC,
->>18 beshort 3 Intel 80386 - invalid byte order,
->>18 beshort 4 Motorola
->>>36 belong &0x01000000 68000,
->>>36 belong &0x00810000 CPU32,
->>>36 belong 0 68020,
->>18 beshort 5 Motorola 88000,
->>18 beshort 6 Intel 80486 - invalid byte order,
->>18 beshort 7 Intel 80860,
-# only for MIPS - see comment in little-endian section above.
->>18 beshort 8 MIPS,
->>>36 belong &0x20 N32
->>18 beshort 10 MIPS,
->>>36 belong &0x20 N32
->>18 beshort 8
-# only for 32-bit
->>>4 byte 1
->>>>36 belong&0xf0000000 0x00000000 MIPS-I
->>>>36 belong&0xf0000000 0x10000000 MIPS-II
->>>>36 belong&0xf0000000 0x20000000 MIPS-III
->>>>36 belong&0xf0000000 0x30000000 MIPS-IV
->>>>36 belong&0xf0000000 0x40000000 MIPS-V
->>>>36 belong&0xf0000000 0x50000000 MIPS32
->>>>36 belong&0xf0000000 0x60000000 MIPS64
->>>>36 belong&0xf0000000 0x70000000 MIPS32 rel2
->>>>36 belong&0xf0000000 0x80000000 MIPS64 rel2
-# only for 64-bit
->>>4 byte 2
->>>>48 belong&0xf0000000 0x00000000 MIPS-I
->>>>48 belong&0xf0000000 0x10000000 MIPS-II
->>>>48 belong&0xf0000000 0x20000000 MIPS-III
->>>>48 belong&0xf0000000 0x30000000 MIPS-IV
->>>>48 belong&0xf0000000 0x40000000 MIPS-V
->>>>48 belong&0xf0000000 0x50000000 MIPS32
->>>>48 belong&0xf0000000 0x60000000 MIPS64
->>>>48 belong&0xf0000000 0x70000000 MIPS32 rel2
->>>>48 belong&0xf0000000 0x80000000 MIPS64 rel2
->>18 beshort 9 Amdahl,
->>18 beshort 10 MIPS (deprecated),
->>18 beshort 11 RS6000,
->>18 beshort 15 PA-RISC
->>>50 beshort 0x0214 2.0
->>>48 beshort &0x0008 (LP64)
->>18 beshort 16 nCUBE,
->>18 beshort 17 Fujitsu VPP500,
->>18 beshort 18 SPARC32PLUS,
->>>36 belong&0xffff00 0x000100 V8+ Required,
->>>36 belong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
->>>36 belong&0xffff00 0x000400 HaL R1 Extensions Required,
->>>36 belong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
->>18 beshort 20 PowerPC or cisco 4500,
->>18 beshort 21 64-bit PowerPC or cisco 7500,
->>18 beshort 22 IBM S/390,
->>18 beshort 23 Cell SPU,
->>18 beshort 24 cisco SVIP,
->>18 beshort 25 cisco 7200,
->>18 beshort 36 NEC V800 or cisco 12000,
->>18 beshort 37 Fujitsu FR20,
->>18 beshort 38 TRW RH-32,
->>18 beshort 39 Motorola RCE,
->>18 beshort 40 ARM,
->>18 beshort 41 Alpha,
->>18 beshort 42 Renesas SH,
->>18 beshort 43 SPARC V9,
->>>48 belong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
->>>48 belong&0xffff00 0x000400 HaL R1 Extensions Required,
->>>48 belong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
->>>48 belong&0x3 0 total store ordering,
->>>48 belong&0x3 1 partial store ordering,
->>>48 belong&0x3 2 relaxed memory ordering,
->>18 beshort 44 Siemens Tricore Embedded Processor,
->>18 beshort 45 Argonaut RISC Core, Argonaut Technologies Inc.,
->>18 beshort 46 Renesas H8/300,
->>18 beshort 47 Renesas H8/300H,
->>18 beshort 48 Renesas H8S,
->>18 beshort 49 Renesas H8/500,
->>18 beshort 50 IA-64,
->>18 beshort 51 Stanford MIPS-X,
->>18 beshort 52 Motorola Coldfire,
->>18 beshort 53 Motorola M68HC12,
->>18 beshort 73 Cray NV1,
->>18 beshort 75 Digital VAX,
->>18 beshort 88 Renesas M32R,
->>18 leshort 92 OpenRISC,
->>18 leshort 0x3426 OpenRISC (obsolete),
->>18 leshort 0x8472 OpenRISC (obsolete),
->>18 beshort 94 Tensilica Xtensa,
->>18 beshort 97 NatSemi 32k,
->>18 beshort 0x18ad AVR32 (unofficial),
->>18 beshort 0x9026 Alpha (unofficial),
->>18 beshort 0xa390 IBM S/390 (obsolete),
->>20 belong 0 invalid version
->>20 belong 1 version 1
->>36 belong 1 MathCoPro/FPU/MAU Required
-# Up to now only 0, 1 and 2 are defined; I've seen a file with 0x83, it seemed
-# like proper ELF, but extracting the string had bad results.
->4 byte <0x80
->>8 string >\0 (%s)
->8 string \0
->>7 byte 0 (SYSV)
->>7 byte 1 (HP-UX)
->>7 byte 2 (NetBSD)
->>7 byte 3 (GNU/Linux)
->>7 byte 4 (GNU/Hurd)
->>7 byte 5 (86Open)
->>7 byte 6 (Solaris)
->>7 byte 7 (Monterey)
->>7 byte 8 (IRIX)
->>7 byte 9 (FreeBSD)
->>7 byte 10 (Tru64)
->>7 byte 11 (Novell Modesto)
->>7 byte 12 (OpenBSD)
->8 string \2
->>7 byte 13 (OpenVMS)
->>7 byte 97 (ARM)
->>7 byte 255 (embedded)
-
-#------------------------------------------------------------------------------
-# encore: file(1) magic for Encore machines
-#
-# XXX - needs to have the byte order specified (NS32K was little-endian,
-# dunno whether they run the 88K in little-endian mode or not).
-#
-0 short 0x154 Encore
->20 short 0x107 executable
->20 short 0x108 pure executable
->20 short 0x10b demand-paged executable
->20 short 0x10f unsupported executable
->12 long >0 not stripped
->22 short >0 - version %ld
->22 short 0 -
-#>4 date x stamp %s
-0 short 0x155 Encore unsupported executable
->12 long >0 not stripped
->22 short >0 - version %ld
->22 short 0 -
-#>4 date x stamp %s
-#------------------------------------------------------------------------------
-# EPOC : file(1) magic for EPOC documents [Psion Series 5/Osaris/Geofox 1]
-# Stefan Praszalowicz (hpicollo@worldnet.fr)
-# Useful information for improving this file can be found at:
-# http://software.frodo.looijaard.name/psiconv/formats/Index.html
-0 lelong 0x10000037
->4 lelong 0x1000006D
->>8 lelong 0x1000007F Psion Word
->>8 lelong 0x10000088 Psion Sheet
->>8 lelong 0x1000007D Psion Sketch
->>8 lelong 0x10000085 Psion TextEd
-
-#------------------------------------------------------------------------------
-# erlang: file(1) magic for Erlang JAM and BEAM files
-# URL: http://www.erlang.org/faq/x779.html#AEN812
-
-# OTP R3-R4
-0 string \0177BEAM! Old Erlang BEAM file
->6 short >0 - version %d
-
-# OTP R5 and onwards
-0 string FOR1
->8 string BEAM Erlang BEAM file
-
-# 4.2 version may have a copyright notice!
-4 string Tue\ Jan\ 22\ 14:32:44\ MET\ 1991 Erlang JAM file - version 4.2
-79 string Tue\ Jan\ 22\ 14:32:44\ MET\ 1991 Erlang JAM file - version 4.2
-
-4 string 1.0\ Fri\ Feb\ 3\ 09:55:56\ MET\ 1995 Erlang JAM file - version 4.3
-
-#------------------------------------------------------------------------------
-# ESRI Shapefile format (.shp .shx .dbf=DBaseIII)
-# Based on info from
-# <URL:http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf>
-0 belong 9994 ESRI Shapefile
->4 belong =0
->8 belong =0
->12 belong =0
->16 belong =0
->20 belong =0
->28 lelong x version %d
->24 belong x length %d
->32 lelong =0 type Null Shape
->32 lelong =1 type Point
->32 lelong =3 type PolyLine
->32 lelong =5 type Polygon
->32 lelong =8 type MultiPoint
->32 lelong =11 type PointZ
->32 lelong =13 type PolyLineZ
->32 lelong =15 type PolygonZ
->32 lelong =18 type MultiPointZ
->32 lelong =21 type PointM
->32 lelong =23 type PolyLineM
->32 lelong =25 type PolygonM
->32 lelong =28 type MultiPointM
->32 lelong =31 type MultiPatch
-
-#------------------------------------------------------------------------------
-# fcs: file(1) magic for FCS (Flow Cytometry Standard) data files
-# From Roger Leigh <roger@whinlatter.uklinux.net>
-0 string FCS1.0 Flow Cytometry Standard (FCS) data, version 1.0
-0 string FCS2.0 Flow Cytometry Standard (FCS) data, version 2.0
-0 string FCS3.0 Flow Cytometry Standard (FCS) data, version 3.0
-
-
-#------------------------------------------------------------------------------
-# filesystems: file(1) magic for different filesystems
-#
-0 string \366\366\366\366 PC formatted floppy with no filesystem
-# Sun disk labels
-# From /usr/include/sun/dklabel.h:
-0774 beshort 0xdabe
-# modified by Joerg Jenderek, because original test
-# succeeds for Cabinet archive dao360.dl_ with negative blocks
->0770 long >0 Sun disk label
->>0 string x '%s
->>>31 string >\0 \b%s
->>>>63 string >\0 \b%s
->>>>>95 string >\0 \b%s
->>0 string x \b'
->>0734 short >0 %d rpm,
->>0736 short >0 %d phys cys,
->>0740 short >0 %d alts/cyl,
->>0746 short >0 %d interleave,
->>0750 short >0 %d data cyls,
->>0752 short >0 %d alt cyls,
->>0754 short >0 %d heads/partition,
->>0756 short >0 %d sectors/track,
->>0764 long >0 start cyl %ld,
->>0770 long x %ld blocks
-# Is there a boot block written 1 sector in?
->512 belong&077777777 0600407 \b, boot block present
-# Joerg Jenderek: Smart Boot Manager backup file is 41 byte header + first sectors of disc
-# (http://btmgr.sourceforge.net/docs/user-guide-3.html)
-0 string SBMBAKUP_ Smart Boot Manager backup file
->9 string x \b, version %-5.5s
->>14 string =_
->>>15 string x %-.1s
->>>>16 string =_ \b.
->>>>>17 string x \b%-.1s
->>>>>>18 string =_ \b.
->>>>>>>19 string x \b%-.1s
->>>22 ubyte 0
->>>>21 ubyte x \b, from drive 0x%x
->>>22 ubyte >0
->>>>21 string x \b, from drive %s
-
-# Joerg Jenderek
-# DOS Emulator image is 128 byte, null right padded header + harddisc image
-0 string DOSEMU\0
->0x27E leshort 0xAA55
-#offset is 128
->>19 ubyte 128
->>>(19.b-1) ubyte 0x0 DOS Emulator image
->>>>7 ulelong >0 \b, %u heads
->>>>11 ulelong >0 \b, %d sectors/track
->>>>15 ulelong >0 \b, %d cylinders
-
-# updated by Joerg Jenderek at Sep 2007
-# only for sector sizes with 512 or more Bytes
-0x1FE leshort 0xAA55 x86 boot sector
-# to do also for sectors < than 512 Bytes and some other files, GRR
-#30 search/481 \x55\xAA x86 boot sector
-# not for BeOS floppy 1440k, MBRs
-#(11.s-2) uleshort 0xAA55 x86 boot sector
->2 string OSBS \b, OS/BS MBR
-# J\xf6rg Jenderek <joerg dot jenderek at web dot de>
->0x8C string Invalid\ partition\ table \b, MS-DOS MBR
-# dr-dos with some upper-, lowercase variants
->0x9D string Invalid\ partition\ table$
->>181 string No\ Operating\ System$
->>>201 string Operating\ System\ load\ error$ \b, DR-DOS MBR, Version 7.01 to 7.03
->0x9D string Invalid\ partition\ table$
->>181 string No\ operating\ system$
->>>201 string Operating\ system\ load\ error$ \b, DR-DOS MBR, Version 7.01 to 7.03
->342 string Invalid\ partition\ table$
->>366 string No\ operating\ system$
->>>386 string Operating\ system\ load\ error$ \b, DR-DOS MBR, version 7.01 to 7.03
->295 string NEWLDR\0
->>302 string Bad\ PT\ $
->>>310 string No\ OS\ $
->>>>317 string OS\ load\ err$
->>>>>329 string Moved\ or\ missing\ IBMBIO.LDR\n\r
->>>>>>358 string Press\ any\ key\ to\ continue.\n\r$
->>>>>>>387 string Copyright\ (c)\ 1984,1998
->>>>>>>>411 string Caldera\ Inc.\0 \b, DR-DOS MBR (IBMBIO.LDR)
->0x10F string Ung\201ltige\ Partitionstabelle \b, MS-DOS MBR, german version 4.10.1998, 4.10.2222
->>0x1B8 ubelong >0 \b, Serial 0x%-.4x
->0x8B string Ung\201ltige\ Partitionstabelle \b, MS-DOS MBR, german version 5.00 to 4.00.950
->271 string Invalid\ partition\ table\0
->>295 string Error\ loading\ operating\ system\0
->>>326 string Missing\ operating\ system\0 \b, mbr
-#
->139 string Invalid\ partition\ table\0
->>163 string Error\ loading\ operating\ system\0
->>>194 string Missing\ operating\ system\0 \b, Microsoft Windows XP mbr
-# http://www.heise.de/ct/05/09/006/ page 184
-#HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices\DosDevices\?:=Serial4Bytes+8Bytes
->>>>0x1B8 ulelong >0 \b,Serial 0x%-.4x
->300 string Invalid\ partition\ table\0
->>324 string Error\ loading\ operating\ system\0
->>>355 string Missing\ operating\ system\0 \b, Microsoft Windows XP MBR
-#??>>>389 string Invalid\ system\ disk
->>>>0x1B8 ulelong >0 \b, Serial 0x%-.4x
->300 string Ung\201ltige\ Partitionstabelle
-#split string to avoid error: String too long
->>328 string Fehler\ beim\ Laden\
->>>346 string des\ Betriebssystems
->>>>366 string Betriebssystem\ nicht\ vorhanden \b, Microsoft Windows XP MBR (german)
->>>>>0x1B8 ulelong >0 \b, Serial 0x%-.4x
-#>0x145 string Default:\ F \b, FREE-DOS MBR
-#>0x14B string Default:\ F \b, FREE-DOS 1.0 MBR
->0x145 search/7 Default:\ F \b, FREE-DOS MBR
-#>>313 string F0\ .\ .\ .
-#>>>322 string disk\ 1
-#>>>>382 string FAT3
->64 string no\ active\ partition\ found
->>96 string read\ error\ while\ reading\ drive \b, FREE-DOS Beta 0.9 MBR
-# Ranish Partition Manager http://www.ranish.com/part/
->387 search/4 \0\ Error!\r
->>378 search/7 Virus!
->>>397 search/4 Booting\
->>>>408 search/4 HD1/\0 \b, Ranish MBR (
->>>>>416 string Writing\ changes... \b2.37
->>>>>>438 ubyte x \b,0x%x dots
->>>>>>440 ubyte >0 \b,virus check
->>>>>>441 ubyte >0 \b,partition %c
-#2.38,2.42,2.44
->>>>>416 string !Writing\ changes... \b
->>>>>>418 ubyte 1 \bvirus check,
->>>>>>419 ubyte x \b0x%x seconds
->>>>>>420 ubyte&0x0F >0 \b,partition
->>>>>>>420 ubyte&0x0F <5 \b %x
->>>>>>>420 ubyte&0x0F 0Xf \b ask
->>>>>420 ubyte x \b)
-#
->271 string Operating\ system\ loading
->>296 string error\r \b, SYSLINUX MBR (2.10)
-# http://www.acronis.de/
->362 string MBR\ Error\ \0\r
->>376 string ress\ any\ key\ to\
->>>392 string boot\ from\ floppy...\0 \b, Acronis MBR
-# added by Joerg Jenderek
-# http://www.visopsys.org/
-# http://partitionlogic.org.uk/
->309 string No\ bootable\ partition\ found\r
->>339 string I/O\ Error\ reading\ boot\ sector\r \b, Visopsys MBR
->349 string No\ bootable\ partition\ found\r
->>379 string I/O\ Error\ reading\ boot\ sector\r \b, simple Visopsys MBR
-# bootloader, bootmanager
->0x40 string SBML
-# label with 11 characters of FAT 12 bit filesystem
->>43 string SMART\ BTMGR
->>>430 string SBMK\ Bad!\r \b, Smart Boot Manager
-# OEM-ID not always "SBM"
-#>>>>3 strings SBM
->>>>6 string >\0 \b, version %s
->382 string XOSLLOADXCF \b, eXtended Operating System Loader
->6 string LILO \b, LInux i386 boot LOader
->>120 string LILO \b, version 22.3.4 SuSe
->>172 string LILO \b, version 22.5.8 Debian
-# updated by Joerg Jenderek at Oct 2008
-# variables according to grub-0.97/stage1/stage1.S or
-# http://www.gnu.org/software/grub/manual/grub.html#Embedded-data
-# usual values are marked with comments to get only informations of strange GRUB loaders
->342 search/60 \0Geom\0
-#>0 ulelong x %x=0x009048EB , 0x2a9048EB 0
->>0x41 ubyte <2
->>>0x3E ubyte >2 \b; GRand Unified Bootloader
-# 0x3 for 0.5.95,0.93,0.94,0.96 0x4 for 1.90
->>>>0x3E ubyte x \b, stage1 version 0x%x
-#If it is 0xFF, use a drive passed by BIOS
->>>>0x40 ubyte <0xFF \b, boot drive 0x%x
-# in most case 0,1,0x2e for GRUB 0.5.95
->>>>0x41 ubyte >0 \b, LBA flag 0x%x
->>>>0x42 uleshort <0x8000 \b, stage2 address 0x%x
-#>>>>0x42 uleshort =0x8000 \b, stage2 address 0x%x (usual)
->>>>0x42 uleshort >0x8000 \b, stage2 address 0x%x
-#>>>>0x44 ulelong =1 \b, 1st sector stage2 0x%x (default)
->>>>0x44 ulelong >1 \b, 1st sector stage2 0x%x
->>>>0x48 uleshort <0x800 \b, stage2 segment 0x%x
-#>>>>0x48 uleshort =0x800 \b, stage2 segment 0x%x (usual)
->>>>0x48 uleshort >0x800 \b, stage2 segment 0x%x
->>>>402 string Geom\0Hard\ Disk\0Read\0\ Error\0
->>>>>394 string stage1 \b, GRUB version 0.5.95
->>>>382 string Geom\0Hard\ Disk\0Read\0\ Error\0
->>>>>376 string GRUB\ \0 \b, GRUB version 0.93 or 1.94
->>>>383 string Geom\0Hard\ Disk\0Read\0\ Error\0
->>>>>377 string GRUB\ \0 \b, GRUB version 0.94
->>>>385 string Geom\0Hard\ Disk\0Read\0\ Error\0
->>>>>379 string GRUB\ \0 \b, GRUB version 0.95 or 0.96
->>>>391 string Geom\0Hard\ Disk\0Read\0\ Error\0
->>>>>385 string GRUB\ \0 \b, GRUB version 0.97
-#unkown version
->>>343 string Geom\0Read\0\ Error\0
->>>>321 string Loading\ stage1.5 \b, GRUB version x.y
->>>380 string Geom\0Hard\ Disk\0Read\0\ Error\0
->>>>374 string GRUB\ \0 \b, GRUB version n.m
-# http://syslinux.zytor.com/
->478 string Boot\ failed\r
->>495 string LDLINUX\ SYS \b, SYSLINUX bootloader (1.62)
->480 string Boot\ failed\r
->>495 string LDLINUX\ SYS \b, SYSLINUX bootloader (2.06 or 2.11)
->484 string Boot\ error\r \b, SYSLINUX bootloader (3.11)
->395 string chksum\0\ ERROR!\0 \b, Gujin bootloader
-# http://www.bcdwb.de/bcdw/index_e.htm
->3 string BCDL
->>498 string BCDL\ \ \ \ BIN \b, Bootable CD Loader (1.50Z)
-# mbr partion table entries
-# OEM-ID does not contain MicroSoft,NEWLDR,DOS,SYSLINUX,or MTOOLs
->3 string !MS
->>3 string !SYSLINUX
->>>3 string !MTOOL
->>>>3 string !NEWLDR
->>>>>5 string !DOS
-# not FAT (32 bit)
->>>>>>82 string !FAT32
-#not Linux kernel
->>>>>>>514 string !HdrS
-#not BeOS
->>>>>>>>422 string !Be\ Boot\ Loader
-# active flag 0 or 0x80 and type > 0
->>>>>>>>>446 ubyte <0x81
->>>>>>>>>>446 ubyte&0x7F 0
->>>>>>>>>>>450 ubyte >0 \b; partition 1: ID=0x%x
->>>>>>>>>>>>446 ubyte 0x80 \b, active
->>>>>>>>>>>>447 ubyte x \b, starthead %u
-#>>>>>>>>>>>>448 ubyte x \b, start C_S: 0x%x
-#>>>>>>>>>>>>448 ubeshort&1023 x \b, startcylinder? %d
->>>>>>>>>>>>454 ulelong x \b, startsector %u
->>>>>>>>>>>>458 ulelong x \b, %u sectors
-#
->>>>>>>>>462 ubyte <0x81
->>>>>>>>>>462 ubyte&0x7F 0
->>>>>>>>>>>466 ubyte >0 \b; partition 2: ID=0x%x
->>>>>>>>>>>>462 ubyte 0x80 \b, active
->>>>>>>>>>>>463 ubyte x \b, starthead %u
-#>>>>>>>>>>>>464 ubyte x \b, start C_S: 0x%x
-#>>>>>>>>>>>>464 ubeshort&1023 x \b, startcylinder? %d
->>>>>>>>>>>>470 ulelong x \b, startsector %u
->>>>>>>>>>>>474 ulelong x \b, %u sectors
-#
->>>>>>>>>478 ubyte <0x81
->>>>>>>>>>478 ubyte&0x7F 0
->>>>>>>>>>>482 ubyte >0 \b; partition 3: ID=0x%x
->>>>>>>>>>>>478 ubyte 0x80 \b, active
->>>>>>>>>>>>479 ubyte x \b, starthead %u
-#>>>>>>>>>>>>480 ubyte x \b, start C_S: 0x%x
-#>>>>>>>>>>>>481 ubyte x \b, start C2S: 0x%x
-#>>>>>>>>>>>>480 ubeshort&1023 x \b, startcylinder? %d
->>>>>>>>>>>>486 ulelong x \b, startsector %u
->>>>>>>>>>>>490 ulelong x \b, %u sectors
-#
->>>>>>>>>494 ubyte <0x81
->>>>>>>>>>494 ubyte&0x7F 0
->>>>>>>>>>>498 ubyte >0 \b; partition 4: ID=0x%x
->>>>>>>>>>>>494 ubyte 0x80 \b, active
->>>>>>>>>>>>495 ubyte x \b, starthead %u
-#>>>>>>>>>>>>496 ubyte x \b, start C_S: 0x%x
-#>>>>>>>>>>>>496 ubeshort&1023 x \b, startcylinder? %d
->>>>>>>>>>>>502 ulelong x \b, startsector %u
->>>>>>>>>>>>506 ulelong x \b, %u sectors
-# mbr partion table entries end
-# http://www.acronis.de/
-#FAT label=ACRONIS\ SZ
-#OEM-ID=BOOTWIZ0
->442 string Non-system\ disk,\
->>459 string press\ any\ key...\x7\0 \b, Acronis Startup Recovery Loader
-# DOS names like F11.SYS are 8 right space padded bytes+3 bytes
->>>477 ubyte&0xDF >0
->>>>477 string x \b %-.3s
->>>>>480 ubyte&0xDF >0
->>>>>>480 string x \b%-.5s
->>>>485 ubyte&0xDF >0
->>>>>485 string x \b.%-.3s
-#
->185 string FDBOOT\ Version\
->>204 string \rNo\ Systemdisk.\
->>>220 string Booting\ from\ harddisk.\n\r
->>>245 string Cannot\ load\ from\ harddisk.\n\r
->>>>273 string Insert\ Systemdisk\
->>>>>291 string and\ press\ any\ key.\n\r \b, FDBOOT harddisk Bootloader
->>>>>>200 string >\0 \b, version %-3s
->242 string Bootsector\ from\ C.H.\ Hochst\204
->>278 string No\ Systemdisk.\
->>>293 string Booting\ from\ harddisk.\n\r
->>>441 string Cannot\ load\ from\ harddisk.\n\r
->>>>469 string Insert\ Systemdisk\
->>>>>487 string and\ press\ any\ key.\n\r \b, WinImage harddisk Bootloader
->>>>>>209 string >\0 \b, version %-4.4s
->(1.b+2) ubyte 0xe
->>(1.b+3) ubyte 0x1f
->>>(1.b+4) ubyte 0xbe
->>>>(1.b+5) ubyte 0x77
->>>>(1.b+6) ubyte 0x7c
->>>>>(1.b+7) ubyte 0xac
->>>>>>(1.b+8) ubyte 0x22
->>>>>>>(1.b+9) ubyte 0xc0
->>>>>>>>(1.b+10) ubyte 0x74
->>>>>>>>>(1.b+11) ubyte 0xb
->>>>>>>>>>(1.b+12) ubyte 0x56
->>>>>>>>>>(1.b+13) ubyte 0xb4 \b, mkdosfs boot message display
->214 string Please\ try\ to\ install\ FreeDOS\ \b, DOS Emulator boot message display
-#>>244 string from\ dosemu-freedos-*-bin.tgz\r
-#>>>170 string Sorry,\ could\ not\ load\ an\
-#>>>>195 string operating\ system.\r\n
-#
->103 string This\ is\ not\ a\ bootable\ disk.\
->>132 string Please\ insert\ a\ bootable\
->>>157 string floppy\ and\r\n
->>>>169 string press\ any\ key\ to\ try\ again...\r \b, FREE-DOS message display
-#
->66 string Solaris\ Boot\ Sector
->>99 string Incomplete\ MDBoot\ load.
->>>89 string Version \b, Sun Solaris Bootloader
->>>>97 byte x version %c
-#
->408 string OS/2\ !!\ SYS01475\r\0
->>429 string OS/2\ !!\ SYS02025\r\0
->>>450 string OS/2\ !!\ SYS02027\r\0
->>>469 string OS2BOOT\ \ \ \ \b, IBM OS/2 Warp bootloader
-#
->409 string OS/2\ !!\ SYS01475\r\0
->>430 string OS/2\ !!\ SYS02025\r\0
->>>451 string OS/2\ !!\ SYS02027\r\0
->>>470 string OS2BOOT\ \ \ \ \b, IBM OS/2 Warp Bootloader
->112 string This\ disk\ is\ not\ bootable\r
->>142 string If\ you\ wish\ to\ make\ it\ bootable
->>>176 string run\ the\ DOS\ program\ SYS\
->>>200 string after\ the\r
->>>>216 string system\ has\ been\ loaded\r\n
->>>>>242 string Please\ insert\ a\ DOS\ diskette\
->>>>>271 string into\r\n\ the\ drive\ and\
->>>>>>292 string strike\ any\ key...\0 \b, IBM OS/2 Warp message display
-# XP
->430 string NTLDR\ is\ missing\xFF\r\n
->>449 string Disk\ error\xFF\r\n
->>>462 string Press\ any\ key\ to\ restart\r \b, Microsoft Windows XP Bootloader
-# DOS names like NTLDR,CMLDR,$LDR$ are 8 right space padded bytes+3 bytes
->>>>417 ubyte&0xDF >0
->>>>>417 string x %-.5s
->>>>>>422 ubyte&0xDF >0
->>>>>>>422 string x \b%-.3s
->>>>>425 ubyte&0xDF >0
->>>>>>425 string >\ \b.%-.3s
-#
->>>>371 ubyte >0x20
->>>>>368 ubyte&0xDF >0
->>>>>>368 string x %-.5s
->>>>>>>373 ubyte&0xDF >0
->>>>>>>>373 string x \b%-.3s
->>>>>>376 ubyte&0xDF >0
->>>>>>>376 string x \b.%-.3s
-#
->430 string NTLDR\ nicht\ gefunden\xFF\r\n
->>453 string Datentr\204gerfehler\xFF\r\n
->>>473 string Neustart\ mit\ beliebiger\ Taste\r \b, Microsoft Windows XP Bootloader (german)
->>>>417 ubyte&0xDF >0
->>>>>417 string x %-.5s
->>>>>>422 ubyte&0xDF >0
->>>>>>>422 string x \b%-.3s
->>>>>425 ubyte&0xDF >0
->>>>>>425 string >\ \b.%-.3s
-# offset variant
->>>>379 string \0
->>>>>368 ubyte&0xDF >0
->>>>>>368 string x %-.5s
->>>>>>>373 ubyte&0xDF >0
->>>>>>>>373 string x \b%-.3s
-#
->430 string NTLDR\ fehlt\xFF\r\n
->>444 string Datentr\204gerfehler\xFF\r\n
->>>464 string Neustart\ mit\ beliebiger\ Taste\r \b, Microsoft Windows XP Bootloader (2.german)
->>>>417 ubyte&0xDF >0
->>>>>417 string x %-.5s
->>>>>>422 ubyte&0xDF >0
->>>>>>>422 string x \b%-.3s
->>>>>425 ubyte&0xDF >0
->>>>>>425 string >\ \b.%-.3s
-# variant
->>>>371 ubyte >0x20
->>>>>368 ubyte&0xDF >0
->>>>>>368 string x %-.5s
->>>>>>>373 ubyte&0xDF >0
->>>>>>>>373 string x \b%-.3s
->>>>>>376 ubyte&0xDF >0
->>>>>>>376 string x \b.%-.3s
-#
->430 string NTLDR\ fehlt\xFF\r\n
->>444 string Medienfehler\xFF\r\n
->>>459 string Neustart:\ Taste\ dr\201cken\r \b, Microsoft Windows XP Bootloader (3.german)
->>>>371 ubyte >0x20
->>>>>368 ubyte&0xDF >0
->>>>>>368 string x %-.5s
->>>>>>>373 ubyte&0xDF >0
->>>>>>>>373 string x \b%-.3s
->>>>>>376 ubyte&0xDF >0
->>>>>>>376 string x \b.%-.3s
-# variant
->>>>417 ubyte&0xDF >0
->>>>>417 string x %-.5s
->>>>>>422 ubyte&0xDF >0
->>>>>>>422 string x \b%-.3s
->>>>>425 ubyte&0xDF >0
->>>>>>425 string >\ \b.%-.3s
-#
->430 string Datentr\204ger\ entfernen\xFF\r\n
->>454 string Medienfehler\xFF\r\n
->>>469 string Neustart:\ Taste\ dr\201cken\r \b, Microsoft Windows XP Bootloader (4.german)
->>>>379 string \0
->>>>>368 ubyte&0xDF >0
->>>>>>368 string x %-.5s
->>>>>>>373 ubyte&0xDF >0
->>>>>>>>373 string x \b%-.3s
->>>>>>376 ubyte&0xDF >0
->>>>>>>376 string x \b.%-.3s
-# variant
->>>>417 ubyte&0xDF >0
->>>>>417 string x %-.5s
->>>>>>422 ubyte&0xDF >0
->>>>>>>422 string x \b%-.3s
->>>>>425 ubyte&0xDF >0
->>>>>>425 string >\ \b.%-.3s
-#
-
-#>3 string NTFS\ \ \ \
->389 string Fehler\ beim\ Lesen\
->>407 string des\ Datentr\204gers
->>>426 string NTLDR\ fehlt
->>>>440 string NTLDR\ ist\ komprimiert
->>>>>464 string Neustart\ mit\ Strg+Alt+Entf\r \b, Microsoft Windows XP Bootloader NTFS (german)
-#>3 string NTFS\ \ \ \
->313 string A\ disk\ read\ error\ occurred.\r
->>345 string A\ kernel\ file\ is\ missing\
->>>370 string from\ the\ disk.\r
->>>>484 string NTLDR\ is\ compressed
->>>>>429 string Insert\ a\ system\ diskette\
->>>>>>454 string and\ restart\r\nthe\ system.\r \b, Microsoft Windows XP Bootloader NTFS
-# DOS loader variants different languages,offsets
->472 ubyte&0xDF >0
->>389 string Invalid\ system\ disk\xFF\r\n
->>>411 string Disk\ I/O\ error
->>>>428 string Replace\ the\ disk,\ and\
->>>>>455 string press\ any\ key \b, Microsoft Windows 98 Bootloader
-#IO.SYS
->>>>>>472 ubyte&0xDF >0
->>>>>>>472 string x \b %-.2s
->>>>>>>>474 ubyte&0xDF >0
->>>>>>>>>474 string x \b%-.5s
->>>>>>>>>>479 ubyte&0xDF >0
->>>>>>>>>>>479 string x \b%-.1s
->>>>>>>480 ubyte&0xDF >0
->>>>>>>>480 string x \b.%-.3s
-#MSDOS.SYS
->>>>>>>483 ubyte&0xDF >0 \b+
->>>>>>>>483 string x \b%-.5s
->>>>>>>>>488 ubyte&0xDF >0
->>>>>>>>>>488 string x \b%-.3s
->>>>>>>>491 ubyte&0xDF >0
->>>>>>>>>491 string x \b.%-.3s
-#
->>390 string Invalid\ system\ disk\xFF\r\n
->>>412 string Disk\ I/O\ error\xFF\r\n
->>>>429 string Replace\ the\ disk,\ and\
->>>>>451 string then\ press\ any\ key\r \b, Microsoft Windows 98 Bootloader
->>388 string Ungueltiges\ System\ \xFF\r\n
->>>410 string E/A-Fehler\ \ \ \ \xFF\r\n
->>>>427 string Datentraeger\ wechseln\ und\
->>>>>453 string Taste\ druecken\r \b, Microsoft Windows 95/98/ME Bootloader (german)
-#WINBOOT.SYS only not spaces (0xDF)
->>>>>>497 ubyte&0xDF >0
->>>>>>>497 string x %-.5s
->>>>>>>>502 ubyte&0xDF >0
->>>>>>>>>502 string x \b%-.1s
->>>>>>>>>>503 ubyte&0xDF >0
->>>>>>>>>>>503 string x \b%-.1s
->>>>>>>>>>>>504 ubyte&0xDF >0
->>>>>>>>>>>>>504 string x \b%-.1s
->>>>>>505 ubyte&0xDF >0
->>>>>>>505 string x \b.%-.3s
-#IO.SYS
->>>>>>472 ubyte&0xDF >0 or
->>>>>>>472 string x \b %-.2s
->>>>>>>>474 ubyte&0xDF >0
->>>>>>>>>474 string x \b%-.5s
->>>>>>>>>>479 ubyte&0xDF >0
->>>>>>>>>>>479 string x \b%-.1s
->>>>>>>480 ubyte&0xDF >0
->>>>>>>>480 string x \b.%-.3s
-#MSDOS.SYS
->>>>>>>483 ubyte&0xDF >0 \b+
->>>>>>>>483 string x \b%-.5s
->>>>>>>>>488 ubyte&0xDF >0
->>>>>>>>>>488 string x \b%-.3s
->>>>>>>>491 ubyte&0xDF >0
->>>>>>>>>491 string x \b.%-.3s
-#
->>390 string Ungueltiges\ System\ \xFF\r\n
->>>412 string E/A-Fehler\ \ \ \ \xFF\r\n
->>>>429 string Datentraeger\ wechseln\ und\
->>>>>455 string Taste\ druecken\r \b, Microsoft Windows 95/98/ME Bootloader (German)
-#WINBOOT.SYS only not spaces (0xDF)
->>>>>>497 ubyte&0xDF >0
->>>>>>>497 string x %-.7s
->>>>>>>>504 ubyte&0xDF >0
->>>>>>>>>504 string x \b%-.1s
->>>>>>505 ubyte&0xDF >0
->>>>>>>505 string x \b.%-.3s
-#IO.SYS
->>>>>>472 ubyte&0xDF >0 or
->>>>>>>472 string x \b %-.2s
->>>>>>>>474 ubyte&0xDF >0
->>>>>>>>>474 string x \b%-.6s
->>>>>>>480 ubyte&0xDF >0
->>>>>>>>480 string x \b.%-.3s
-#MSDOS.SYS
->>>>>>>483 ubyte&0xDF >0 \b+
->>>>>>>>483 string x \b%-.5s
->>>>>>>>>488 ubyte&0xDF >0
->>>>>>>>>>488 string x \b%-.3s
->>>>>>>>491 ubyte&0xDF >0
->>>>>>>>>491 string x \b.%-.3s
-#
->>389 string Ungueltiges\ System\ \xFF\r\n
->>>411 string E/A-Fehler\ \ \ \ \xFF\r\n
->>>>428 string Datentraeger\ wechseln\ und\
->>>>>454 string Taste\ druecken\r \b, Microsoft Windows 95/98/ME Bootloader (GERMAN)
-# DOS names like IO.SYS,WINBOOT.SYS,MSDOS.SYS,WINBOOT.INI are 8 right space padded bytes+3 bytes
->>>>>>472 string x %-.2s
->>>>>>>474 ubyte&0xDF >0
->>>>>>>>474 string x \b%-.5s
->>>>>>>>479 ubyte&0xDF >0
->>>>>>>>>479 string x \b%-.1s
->>>>>>480 ubyte&0xDF >0
->>>>>>>480 string x \b.%-.3s
->>>>>>483 ubyte&0xDF >0 \b+
->>>>>>>483 string x \b%-.5s
->>>>>>>488 ubyte&0xDF >0
->>>>>>>>488 string x \b%-.2s
->>>>>>>>490 ubyte&0xDF >0
->>>>>>>>>490 string x \b%-.1s
->>>>>>>491 ubyte&0xDF >0
->>>>>>>>491 string x \b.%-.3s
->479 ubyte&0xDF >0
->>416 string Kein\ System\ oder\
->>>433 string Laufwerksfehler
->>>>450 string Wechseln\ und\ Taste\ dr\201cken \b, Microsoft DOS Bootloader (german)
-#IO.SYS
->>>>>479 string x \b %-.2s
->>>>>>481 ubyte&0xDF >0
->>>>>>>481 string x \b%-.6s
->>>>>487 ubyte&0xDF >0
->>>>>>487 string x \b.%-.3s
-#MSDOS.SYS
->>>>>>490 ubyte&0xDF >0 \b+
->>>>>>>490 string x \b%-.5s
->>>>>>>>495 ubyte&0xDF >0
->>>>>>>>>495 string x \b%-.3s
->>>>>>>498 ubyte&0xDF >0
->>>>>>>>498 string x \b.%-.3s
-#
->376 search/41 Non-System\ disk\ or\
->>395 search/41 disk\ error\r
->>>407 search/41 Replace\ and\
->>>>419 search/41 press\ \b,
->>>>419 search/41 strike\ \b, old
->>>>426 search/41 any\ key\ when\ ready\r MS or PC-DOS bootloader
-#449 Disk\ Boot\ failure\r MS 3.21
-#466 Boot\ Failure\r MS 3.30
->>>>>468 search/18 \0
-#IO.SYS,IBMBIO.COM
->>>>>>&0 string x \b %-.2s
->>>>>>>&-20 ubyte&0xDF >0
->>>>>>>>&-1 string x \b%-.4s
->>>>>>>>>&-16 ubyte&0xDF >0
->>>>>>>>>>&-1 string x \b%-.2s
->>>>>>&8 ubyte&0xDF >0 \b.
->>>>>>>&-1 string x \b%-.3s
-#MSDOS.SYS,IBMDOS.COM
->>>>>>&11 ubyte&0xDF >0 \b+
->>>>>>>&-1 string x \b%-.5s
->>>>>>>>&-6 ubyte&0xDF >0
->>>>>>>>>&-1 string x \b%-.1s
->>>>>>>>>>&-5 ubyte&0xDF >0
->>>>>>>>>>>&-1 string x \b%-.2s
->>>>>>>&7 ubyte&0xDF >0 \b.
->>>>>>>>&-1 string x \b%-.3s
->441 string Cannot\ load\ from\ harddisk.\n\r
->>469 string Insert\ Systemdisk\
->>>487 string and\ press\ any\ key.\n\r \b, MS (2.11) DOS bootloader
-#>43 string \224R-LOADER\ \ SYS =label
->54 string SYS
->>324 string VASKK
->>>495 string NEWLDR\0 \b, DR-DOS Bootloader (LOADER.SYS)
-#
->98 string Press\ a\ key\ to\ retry\0\r
->>120 string Cannot\ find\ file\ \0\r
->>>139 string Disk\ read\ error\0\r
->>>>156 string Loading\ ...\0 \b, DR-DOS (3.41) Bootloader
-#DRBIOS.SYS
->>>>>44 ubyte&0xDF >0
->>>>>>44 string x \b %-.6s
->>>>>>>50 ubyte&0xDF >0
->>>>>>>>50 string x \b%-.2s
->>>>>>52 ubyte&0xDF >0
->>>>>>>52 string x \b.%-.3s
-#
->70 string IBMBIO\ \ COM
->>472 string Cannot\ load\ DOS!\
->>>489 string Any\ key\ to\ retry \b, DR-DOS Bootloader
->>471 string Cannot\ load\ DOS\
->>487 string press\ key\ to\ retry \b, Open-DOS Bootloader
-#??
->444 string KERNEL\ \ SYS
->>314 string BOOT\ error! \b, FREE-DOS Bootloader
->499 string KERNEL\ \ SYS
->>305 string BOOT\ err!\0 \b, Free-DOS Bootloader
->449 string KERNEL\ \ SYS
->>319 string BOOT\ error! \b, FREE-DOS 0.5 Bootloader
-#
->449 string Loading\ FreeDOS
->>0x1AF ulelong >0 \b, FREE-DOS 0.95,1.0 Bootloader
->>>497 ubyte&0xDF >0
->>>>497 string x \b %-.6s
->>>>>503 ubyte&0xDF >0
->>>>>>503 string x \b%-.1s
->>>>>>>504 ubyte&0xDF >0
->>>>>>>>504 string x \b%-.1s
->>>>505 ubyte&0xDF >0
->>>>>505 string x \b.%-.3s
-#
->331 string Error!.0 \b, FREE-DOS 1.0 bootloader
-#
->125 string Loading\ FreeDOS...\r
->>311 string BOOT\ error!\r \b, FREE-DOS bootloader
->>>441 ubyte&0xDF >0
->>>>441 string x \b %-.6s
->>>>>447 ubyte&0xDF >0
->>>>>>447 string x \b%-.1s
->>>>>>>448 ubyte&0xDF >0
->>>>>>>>448 string x \b%-.1s
->>>>449 ubyte&0xDF >0
->>>>>449 string x \b.%-.3s
->124 string FreeDOS\0
->>331 string \ err\0 \b, FREE-DOS BETa 0.9 Bootloader
-# DOS names like KERNEL.SYS,KERNEL16.SYS,KERNEL32.SYS,METAKERN.SYS are 8 right space padded bytes+3 bytes
->>>497 ubyte&0xDF >0
->>>>497 string x \b %-.6s
->>>>>503 ubyte&0xDF >0
->>>>>>503 string x \b%-.1s
->>>>>>>504 ubyte&0xDF >0
->>>>>>>>504 string x \b%-.1s
->>>>505 ubyte&0xDF >0
->>>>>505 string x \b.%-.3s
->>333 string \ err\0 \b, FREE-DOS BEta 0.9 Bootloader
->>>497 ubyte&0xDF >0
->>>>497 string x \b %-.6s
->>>>>503 ubyte&0xDF >0
->>>>>>503 string x \b%-.1s
->>>>>>>504 ubyte&0xDF >0
->>>>>>>>504 string x \b%-.1s
->>>>505 ubyte&0xDF >0
->>>>>505 string x \b.%-.3s
->>334 string \ err\0 \b, FREE-DOS Beta 0.9 Bootloader
->>>497 ubyte&0xDF >0
->>>>497 string x \b %-.6s
->>>>>503 ubyte&0xDF >0
->>>>>>503 string x \b%-.1s
->>>>>>>504 ubyte&0xDF >0
->>>>>>>>504 string x \b%-.1s
->>>>505 ubyte&0xDF >0
->>>>>505 string x \b.%-.3s
->336 string Error!\
->>343 string Hit\ a\ key\ to\ reboot. \b, FREE-DOS Beta 0.9sr1 Bootloader
->>>497 ubyte&0xDF >0
->>>>497 string x \b %-.6s
->>>>>503 ubyte&0xDF >0
->>>>>>503 string x \b%-.1s
->>>>>>>504 ubyte&0xDF >0
->>>>>>>>504 string x \b%-.1s
->>>>505 ubyte&0xDF >0
->>>>>505 string x \b.%-.3s
-# added by Joerg Jenderek
-# http://www.visopsys.org/
-# http://partitionlogic.org.uk/
-# OEM-ID=Visopsys
->478 ulelong 0
->>(1.b+326) string I/O\ Error\ reading\
->>>(1.b+344) string Visopsys\ loader\r
->>>>(1.b+361) string Press\ any\ key\ to\ continue.\r \b, Visopsys loader
-# http://alexfru.chat.ru/epm.html#bootprog
->494 ubyte >0x4D
->>495 string >E
->>>495 string <S
-#OEM-ID is not reliable
->>>>3 string BootProg
-# It just looks for a program file name at the root directory
-# and loads corresponding file with following execution.
-# DOS names like STARTUP.BIN,STARTUPC.COM,STARTUPE.EXE are 8 right space padded bytes+3 bytes
->>>>499 ubyte&0xDF >0 \b, COM/EXE Bootloader
->>>>>499 string x \b %-.1s
->>>>>>500 ubyte&0xDF >0
->>>>>>>500 string x \b%-.1s
->>>>>>>>501 ubyte&0xDF >0
->>>>>>>>>501 string x \b%-.1s
->>>>>>>>>>502 ubyte&0xDF >0
->>>>>>>>>>>502 string x \b%-.1s
->>>>>>>>>>>>503 ubyte&0xDF >0
->>>>>>>>>>>>>503 string x \b%-.1s
->>>>>>>>>>>>>>504 ubyte&0xDF >0
->>>>>>>>>>>>>>>504 string x \b%-.1s
->>>>>>>>>>>>>>>>505 ubyte&0xDF >0
->>>>>>>>>>>>>>>>>505 string x \b%-.1s
->>>>>>>>>>>>>>>>>>506 ubyte&0xDF >0
->>>>>>>>>>>>>>>>>>>506 string x \b%-.1s
-#name extension
->>>>>507 ubyte&0xDF >0 \b.
->>>>>>507 string x \b%-.1s
->>>>>>>508 ubyte&0xDF >0
->>>>>>>>508 string x \b%-.1s
->>>>>>>>>509 ubyte&0xDF >0
->>>>>>>>>>509 string x \b%-.1s
-#If the boot sector fails to read any other sector,
-#it prints a very short message ("RE") to the screen and hangs the computer.
-#If the boot sector fails to find needed program in the root directory,
-#it also hangs with another message ("NF").
->>>>>492 string RENF \b, FAT (12 bit)
->>>>>495 string RENF \b, FAT (16 bit)
-# http://alexfru.chat.ru/epm.html#bootprog
->494 ubyte >0x4D
->>495 string >E
->>>495 string <S
-#OEM-ID is not reliable
->>>>3 string BootProg
-# It just looks for a program file name at the root directory
-# and loads corresponding file with following execution.
-# DOS names like STARTUP.BIN,STARTUPC.COM,STARTUPE.EXE are 8 right space padded bytes+3 bytes
->>>>499 ubyte&0xDF >0 \b, COM/EXE Bootloader
->>>>>499 string x \b %-.1s
->>>>>>500 ubyte&0xDF >0
->>>>>>>500 string x \b%-.1s
->>>>>>>>501 ubyte&0xDF >0
->>>>>>>>>501 string x \b%-.1s
->>>>>>>>>>502 ubyte&0xDF >0
->>>>>>>>>>>502 string x \b%-.1s
->>>>>>>>>>>>503 ubyte&0xDF >0
->>>>>>>>>>>>>503 string x \b%-.1s
->>>>>>>>>>>>>>504 ubyte&0xDF >0
->>>>>>>>>>>>>>>504 string x \b%-.1s
->>>>>>>>>>>>>>>>505 ubyte&0xDF >0
->>>>>>>>>>>>>>>>>505 string x \b%-.1s
->>>>>>>>>>>>>>>>>>506 ubyte&0xDF >0
->>>>>>>>>>>>>>>>>>>506 string x \b%-.1s
-#name extension
->>>>>507 ubyte&0xDF >0 \b.
->>>>>>507 string x \b%-.1s
->>>>>>>508 ubyte&0xDF >0
->>>>>>>>508 string x \b%-.1s
->>>>>>>>>509 ubyte&0xDF >0
->>>>>>>>>>509 string x \b%-.1s
-#If the boot sector fails to read any other sector,
-#it prints a very short message ("RE") to the screen and hangs the computer.
-#If the boot sector fails to find needed program in the root directory,
-#it also hangs with another message ("NF").
->>>>>492 string RENF \b, FAT (12 bit)
->>>>>495 string RENF \b, FAT (16 bit)
-# x86 bootloader end
-# updated by Joerg Jenderek at Sep 2007
->3 ubyte 0
-#no active flag
->>446 ubyte 0
-# partition 1 not empty
->>>450 ubyte >0
-# partitions 3,4 empty
->>>>482 ubyte 0
->>>>>498 ubyte 0
-# partition 2 ID=0,5,15
->>>>>>466 ubyte <0x10
->>>>>>>466 ubyte 0x05 \b, extended partition table
->>>>>>>466 ubyte 0x0F \b, extended partition table (LBA)
->>>>>>>466 ubyte 0x0 \b, extended partition table (last)
-# JuMP short bootcodeoffset NOP assembler instructions will usually be EB xx 90
-# http://mirror.href.com/thestarman/asm/2bytejumps.htmm#FWD
-# older drives may use Near JuMP instruction E9 xx xx
->0 lelong&0x009000EB 0x009000EB
->0 lelong&0x000000E9 0x000000E9
-# minimal short forward jump found 03cx??
-# maximal short forward jump is 07fx
->1 ubyte <0xff \b, code offset 0x%x
-# mtools-3.9.8/msdos.h
-# usual values are marked with comments to get only informations of strange FAT systems
-# valid sectorsize must be a power of 2 from 32 to 32768
->>11 uleshort&0x000f x
->>>11 uleshort <32769
->>>>11 uleshort >31
->>>>>21 ubyte&0xf0 0xF0
->>>>>>3 string >\0 \b, OEM-ID "%8.8s"
-#http://mirror.href.com/thestarman/asm/debug/debug2.htm#IHC
->>>>>>>8 string IHC \b cached by Windows 9M
->>>>>>11 uleshort >512 \b, Bytes/sector %u
-#>>>>>>11 uleshort =512 \b, Bytes/sector %u=512 (usual)
->>>>>>11 uleshort <512 \b, Bytes/sector %u
->>>>>>13 ubyte >1 \b, sectors/cluster %u
-#>>>>>>13 ubyte =1 \b, sectors/cluster %u (usual on Floppies)
->>>>>>14 uleshort >32 \b, reserved sectors %u
-#>>>>>>14 uleshort =32 \b, reserved sectors %u (usual Fat32)
-#>>>>>>14 uleshort >1 \b, reserved sectors %u
-#>>>>>>14 uleshort =1 \b, reserved sectors %u (usual FAT12,FAT16)
->>>>>>14 uleshort <1 \b, reserved sectors %u
->>>>>>16 ubyte >2 \b, FATs %u
-#>>>>>>16 ubyte =2 \b, FATs %u (usual)
->>>>>>16 ubyte =1 \b, FAT %u
->>>>>>16 ubyte >0
->>>>>>17 uleshort >0 \b, root entries %u
-#>>>>>>17 uleshort =0 \b, root entries %u=0 (usual Fat32)
->>>>>>19 uleshort >0 \b, sectors %u (volumes <=32 MB)
-#>>>>>>19 uleshort =0 \b, sectors %u=0 (usual Fat32)
->>>>>>21 ubyte >0xF0 \b, Media descriptor 0x%x
-#>>>>>>21 ubyte =0xF0 \b, Media descriptor 0x%x (usual floppy)
->>>>>>21 ubyte <0xF0 \b, Media descriptor 0x%x
->>>>>>22 uleshort >0 \b, sectors/FAT %u
-#>>>>>>22 uleshort =0 \b, sectors/FAT %u=0 (usual Fat32)
->>>>>>26 ubyte >2 \b, heads %u
-#>>>>>>26 ubyte =2 \b, heads %u (usual floppy)
->>>>>>26 ubyte =1 \b, heads %u
-#skip for Digital Research DOS (version 3.41) 1440 kB Bootdisk
->>>>>>38 ubyte !0x70
->>>>>>>28 ulelong >0 \b, hidden sectors %u
-#>>>>>>>28 ulelong =0 \b, hidden sectors %u (usual floppy)
->>>>>>>32 ulelong >0 \b, sectors %u (volumes > 32 MB)
-#>>>>>>>32 ulelong =0 \b, sectors %u (volumes > 32 MB)
-# FAT<32 specific
->>>>>>82 string !FAT32
-#>>>>>>>36 ubyte 0x80 \b, physical drive 0x%x=0x80 (usual harddisk)
-#>>>>>>>36 ubyte 0 \b, physical drive 0x%x=0 (usual floppy)
->>>>>>>36 ubyte !0x80
->>>>>>>>36 ubyte !0 \b, physical drive 0x%x
->>>>>>>37 ubyte >0 \b, reserved 0x%x
-#>>>>>>>37 ubyte =0 \b, reserved 0x%x
->>>>>>>38 ubyte >0x29 \b, dos < 4.0 BootSector (0x%x)
->>>>>>>38 ubyte <0x29 \b, dos < 4.0 BootSector (0x%x)
->>>>>>>38 ubyte =0x29
->>>>>>>>39 ulelong x \b, serial number 0x%x
->>>>>>>>43 string <NO\ NAME \b, label: "%11.11s"
->>>>>>>>43 string >NO\ NAME \b, label: "%11.11s"
->>>>>>>>43 string =NO\ NAME \b, unlabeled
->>>>>>>54 string FAT \b, FAT
->>>>>>>>54 string FAT12 \b (12 bit)
->>>>>>>>54 string FAT16 \b (16 bit)
-# FAT32 specific
->>>>>>82 string FAT32 \b, FAT (32 bit)
->>>>>>>36 ulelong x \b, sectors/FAT %u
->>>>>>>40 uleshort >0 \b, extension flags %u
-#>>>>>>>40 uleshort =0 \b, extension flags %u
->>>>>>>42 uleshort >0 \b, fsVersion %u
-#>>>>>>>42 uleshort =0 \b, fsVersion %u (usual)
->>>>>>>44 ulelong >2 \b, rootdir cluster %u
-#>>>>>>>44 ulelong =2 \b, rootdir cluster %u
-#>>>>>>>44 ulelong =1 \b, rootdir cluster %u
->>>>>>>48 uleshort >1 \b, infoSector %u
-#>>>>>>>48 uleshort =1 \b, infoSector %u (usual)
->>>>>>>48 uleshort <1 \b, infoSector %u
->>>>>>>50 uleshort >6 \b, Backup boot sector %u
-#>>>>>>>50 uleshort =6 \b, Backup boot sector %u (usual)
->>>>>>>50 uleshort <6 \b, Backup boot sector %u
->>>>>>>54 ulelong >0 \b, reserved1 0x%x
->>>>>>>58 ulelong >0 \b, reserved2 0x%x
->>>>>>>62 ulelong >0 \b, reserved3 0x%x
-# same structure as FAT1X
->>>>>>>64 ubyte >0x80 \b, physical drive 0x%x
-#>>>>>>>64 ubyte =0x80 \b, physical drive 0x%x=80 (usual harddisk)
->>>>>>>64 ubyte&0x7F >0 \b, physical drive 0x%x
-#>>>>>>>64 ubyte =0 \b, physical drive 0x%x=0 (usual floppy)
->>>>>>>65 ubyte >0 \b, reserved 0x%x
->>>>>>>66 ubyte >0x29 \b, dos < 4.0 BootSector (0x%x)
->>>>>>>66 ubyte <0x29 \b, dos < 4.0 BootSector (0x%x)
->>>>>>>66 ubyte =0x29
->>>>>>>>67 ulelong x \b, serial number 0x%x
->>>>>>>>71 string <NO\ NAME \b, label: "%11.11s"
->>>>>>>71 string >NO\ NAME \b, label: "%11.11s"
->>>>>>>71 string =NO\ NAME \b, unlabeled
-### FATs end
->0x200 lelong 0x82564557 \b, BSD disklabel
-# FATX
-0 string FATX FATX filesystem data
-
-
-# Minix filesystems - Juan Cespedes <cespedes@debian.org>
-0x410 leshort 0x137f Minix filesystem
-0x410 beshort 0x137f Minix filesystem (big endian)
->0x402 beshort !0 \b, %d zones
->0x1e string minix \b, bootable
-0x410 leshort 0x138f Minix filesystem, 30 char names
-0x410 leshort 0x2468 Minix filesystem, version 2
-0x410 leshort 0x2478 Minix filesystem, version 2, 30 char names
-
-# romfs filesystems - Juan Cespedes <cespedes@debian.org>
-0 string -rom1fs- romfs filesystem, version 1
->8 belong x %d bytes,
->16 string x named %s.
-
-# netboot image - Juan Cespedes <cespedes@debian.org>
-0 lelong 0x1b031336L Netboot image,
->4 lelong&0xFFFFFF00 0
->>4 lelong&0x100 0x000 mode 2
->>4 lelong&0x100 0x100 mode 3
->4 lelong&0xFFFFFF00 !0 unknown mode
-
-0x18b string OS/2 OS/2 Boot Manager
-
-# updated by Joerg Jenderek at Oct 2008!!
-# http://syslinux.zytor.com/iso.php
-0 ulelong 0x7c40eafa isolinux Loader
-# http://syslinux.zytor.com/pxe.php
-0 ulelong 0x007c05ea pxelinux Loader
-0 ulelong 0x60669c66 pxelinux Loader
-
-# added by Joerg Jenderek
-# In the second sector (+0x200) are variables according to grub-0.97/stage2/asm.S or
-# grub-1.94/kern/i386/pc/startup.S
-# http://www.gnu.org/software/grub/manual/grub.html#Embedded-data
-# usual values are marked with comments to get only informations of strange GRUB loaders
-0x200 uleshort 0x70EA
-# found only version 3.{1,2}
->0x206 ubeshort >0x0300
-# GRUB version (0.5.)95,0.93,0.94,0.96,0.97 > "00"
->>0x212 ubyte >0x29
->>>0x213 ubyte >0x29
-# not iso9660_stage1_5
-#>>>0 ulelong&0x00BE5652 0x00BE5652
->>>>0x213 ubyte >0x29 GRand Unified Bootloader
-# config_file for stage1_5 is 0xffffffff + default "/boot/grub/stage2"
->>>>0x217 ubyte 0xFF stage1_5
->>>>0x217 ubyte <0xFF stage2
->>>>0x206 ubyte x \b version %u
->>>>0x207 ubyte x \b.%u
-# module_size for 1.94
->>>>0x208 ulelong <0xffffff \b, installed partition %u
-#>>>>0x208 ulelong =0xffffff \b, %u (default)
->>>>0x208 ulelong >0xffffff \b, installed partition %u
-# GRUB 0.5.95 unofficial
->>>>0x20C ulelong&0x2E300000 0x2E300000
-# 0=stage2 1=ffs 2=e2fs 3=fat 4=minix 5=reiserfs
->>>>>0x20C ubyte x \b, identifier 0x%x
-#>>>>>0x20D ubyte =0 \b, LBA flag 0x%x (default)
->>>>>0x20D ubyte >0 \b, LBA flag 0x%x
-# GRUB version as string
->>>>>0x20E string >\0 \b, GRUB version %-s
-# for stage1_5 is 0xffffffff + config_file "/boot/grub/stage2" default
->>>>>>0x215 ulong 0xffffffff
->>>>>>>0x219 string >\0 \b, configuration file %-s
->>>>>>0x215 ulong !0xffffffff
->>>>>>>0x215 string >\0 \b, configuration file %-s
-# newer GRUB versions
->>>>0x20C ulelong&0x2E300000 !0x2E300000
-##>>>>>0x20C ulelong =0 \b, saved entry %d (usual)
->>>>>0x20C ulelong >0 \b, saved entry %d
-# for 1.94 contains kernel image size
-# for 0.93,0.94,0.96,0.97
-# 0=stage2 1=ffs 2=e2fs 3=fat 4=minix 5=reiserfs 6=vstafs 7=jfs 8=xfs 9=iso9660 a=ufs2
->>>>>0x210 ubyte x \b, identifier 0x%x
-# The flag for LBA forcing is in most cases 0
-#>>>>>0x211 ubyte =0 \b, LBA flag 0x%x (default)
->>>>>0x211 ubyte >0 \b, LBA flag 0x%x
-# GRUB version as string
->>>>>0x212 string >\0 \b, GRUB version %-s
-# for stage1_5 is 0xffffffff + config_file "/boot/grub/stage2" default
->>>>>0x217 ulong 0xffffffff
->>>>>>0x21b string >\0 \b, configuration file %-s
->>>>>0x217 ulong !0xffffffff
->>>>>>0x217 string >\0 \b, configuration file %-s
-
-9564 lelong 0x00011954 Unix Fast File system [v1] (little-endian),
->8404 string x last mounted on %s,
-#>9504 ledate x last checked at %s,
->8224 ledate x last written at %s,
->8401 byte x clean flag %d,
->8228 lelong x number of blocks %d,
->8232 lelong x number of data blocks %d,
->8236 lelong x number of cylinder groups %d,
->8240 lelong x block size %d,
->8244 lelong x fragment size %d,
->8252 lelong x minimum percentage of free blocks %d,
->8256 lelong x rotational delay %dms,
->8260 lelong x disk rotational speed %drps,
->8320 lelong 0 TIME optimization
->8320 lelong 1 SPACE optimization
-
-42332 lelong 0x19540119 Unix Fast File system [v2] (little-endian)
->&-1164 string x last mounted on %s,
->&-696 string >\0 volume name %s,
->&-304 leqldate x last written at %s,
->&-1167 byte x clean flag %d,
->&-1168 byte x readonly flag %d,
->&-296 lequad x number of blocks %lld,
->&-288 lequad x number of data blocks %lld,
->&-1332 lelong x number of cylinder groups %d,
->&-1328 lelong x block size %d,
->&-1324 lelong x fragment size %d,
->&-180 lelong x average file size %d,
->&-176 lelong x average number of files in dir %d,
->&-272 lequad x pending blocks to free %lld,
->&-264 lelong x pending inodes to free %ld,
->&-664 lequad x system-wide uuid %0llx,
->&-1316 lelong x minimum percentage of free blocks %d,
->&-1248 lelong 0 TIME optimization
->&-1248 lelong 1 SPACE optimization
-
-66908 lelong 0x19540119 Unix Fast File system [v2] (little-endian)
->&-1164 string x last mounted on %s,
->&-696 string >\0 volume name %s,
->&-304 leqldate x last written at %s,
->&-1167 byte x clean flag %d,
->&-1168 byte x readonly flag %d,
->&-296 lequad x number of blocks %lld,
->&-288 lequad x number of data blocks %lld,
->&-1332 lelong x number of cylinder groups %d,
->&-1328 lelong x block size %d,
->&-1324 lelong x fragment size %d,
->&-180 lelong x average file size %d,
->&-176 lelong x average number of files in dir %d,
->&-272 lequad x pending blocks to free %lld,
->&-264 lelong x pending inodes to free %ld,
->&-664 lequad x system-wide uuid %0llx,
->&-1316 lelong x minimum percentage of free blocks %d,
->&-1248 lelong 0 TIME optimization
->&-1248 lelong 1 SPACE optimization
-
-9564 belong 0x00011954 Unix Fast File system [v1] (big-endian),
->7168 belong 0x4c41424c Apple UFS Volume
->>7186 string x named %s,
->>7176 belong x volume label version %d,
->>7180 bedate x created on %s,
->8404 string x last mounted on %s,
-#>9504 bedate x last checked at %s,
->8224 bedate x last written at %s,
->8401 byte x clean flag %d,
->8228 belong x number of blocks %d,
->8232 belong x number of data blocks %d,
->8236 belong x number of cylinder groups %d,
->8240 belong x block size %d,
->8244 belong x fragment size %d,
->8252 belong x minimum percentage of free blocks %d,
->8256 belong x rotational delay %dms,
->8260 belong x disk rotational speed %drps,
->8320 belong 0 TIME optimization
->8320 belong 1 SPACE optimization
-
-42332 belong 0x19540119 Unix Fast File system [v2] (big-endian)
->&-1164 string x last mounted on %s,
->&-696 string >\0 volume name %s,
->&-304 beqldate x last written at %s,
->&-1167 byte x clean flag %d,
->&-1168 byte x readonly flag %d,
->&-296 bequad x number of blocks %lld,
->&-288 bequad x number of data blocks %lld,
->&-1332 belong x number of cylinder groups %d,
->&-1328 belong x block size %d,
->&-1324 belong x fragment size %d,
->&-180 belong x average file size %d,
->&-176 belong x average number of files in dir %d,
->&-272 bequad x pending blocks to free %lld,
->&-264 belong x pending inodes to free %ld,
->&-664 bequad x system-wide uuid %0llx,
->&-1316 belong x minimum percentage of free blocks %d,
->&-1248 belong 0 TIME optimization
->&-1248 belong 1 SPACE optimization
-
-66908 belong 0x19540119 Unix Fast File system [v2] (big-endian)
->&-1164 string x last mounted on %s,
->&-696 string >\0 volume name %s,
->&-304 beqldate x last written at %s,
->&-1167 byte x clean flag %d,
->&-1168 byte x readonly flag %d,
->&-296 bequad x number of blocks %lld,
->&-288 bequad x number of data blocks %lld,
->&-1332 belong x number of cylinder groups %d,
->&-1328 belong x block size %d,
->&-1324 belong x fragment size %d,
->&-180 belong x average file size %d,
->&-176 belong x average number of files in dir %d,
->&-272 bequad x pending blocks to free %lld,
->&-264 belong x pending inodes to free %ld,
->&-664 bequad x system-wide uuid %0llx,
->&-1316 belong x minimum percentage of free blocks %d,
->&-1248 belong 0 TIME optimization
->&-1248 belong 1 SPACE optimization
-
-# ext2/ext3 filesystems - Andreas Dilger <adilger@dilger.ca>
-# ext4 filesystem - Eric Sandeen <sandeen@sandeen.net>
-# volume label and UUID Russell Coker
-# http://etbe.coker.com.au/2008/07/08/label-vs-uuid-vs-device/
-0x438 leshort 0xEF53 Linux
->0x44c lelong x rev %d
->0x43e leshort x \b.%d
-# No journal? ext2
->0x45c lelong ^0x0000004 ext2 filesystem data
->>0x43a leshort ^0x0000001 (mounted or unclean)
-# Has a journal? ext3 or ext4
->0x45c lelong &0x0000004
-# and small INCOMPAT?
->>0x460 lelong <0x0000040
-# and small RO_COMPAT?
->>>0x464 lelong <0x0000008 ext3 filesystem data
-# else large RO_COMPAT?
->>>0x464 lelong >0x0000007 ext4 filesystem data
-# else large INCOMPAT?
->>0x460 lelong >0x000003f ext4 filesystem data
->0x468 belong x \b, UUID=%08x
->0x46c beshort x \b-%04x
->0x46e beshort x \b-%04x
->0x470 beshort x \b-%04x
->0x472 belong x \b-%08x
->0x476 beshort x \b%04x
->0x478 string >0 \b, volume name "%s"
-# General flags for any ext* fs
->0x460 lelong &0x0000004 (needs journal recovery)
->0x43a leshort &0x0000002 (errors)
-# INCOMPAT flags
->0x460 lelong &0x0000001 (compressed)
-#>0x460 lelong &0x0000002 (filetype)
-#>0x460 lelong &0x0000010 (meta bg)
->0x460 lelong &0x0000040 (extents)
->0x460 lelong &0x0000080 (64bit)
-#>0x460 lelong &0x0000100 (mmp)
-#>0x460 lelong &0x0000200 (flex bg)
-# RO_INCOMPAT flags
-#>0x464 lelong &0x0000001 (sparse super)
->0x464 lelong &0x0000002 (large files)
->0x464 lelong &0x0000008 (huge files)
-#>0x464 lelong &0x0000010 (gdt checksum)
-#>0x464 lelong &0x0000020 (many subdirs)
-#>0x463 lelong &0x0000040 (extra isize)
-
-# SGI disk labels - Nathan Scott <nathans@debian.org>
-0 belong 0x0BE5A941 SGI disk label (volume header)
-
-# SGI XFS filesystem - Nathan Scott <nathans@debian.org>
-0 belong 0x58465342 SGI XFS filesystem data
->0x4 belong x (blksz %d,
->0x68 beshort x inosz %d,
->0x64 beshort ^0x2004 v1 dirs)
->0x64 beshort &0x2004 v2 dirs)
-
-############################################################################
-# Minix-ST kernel floppy
-0x800 belong 0x46fc2700 Atari-ST Minix kernel image
->19 string \240\5\371\5\0\011\0\2\0 \b, 720k floppy
->19 string \320\2\370\5\0\011\0\1\0 \b, 360k floppy
-
-############################################################################
-# Hmmm, is this a better way of detecting _standard_ floppy images ?
-19 string \320\2\360\3\0\011\0\1\0 DOS floppy 360k
->0x1FE leshort 0xAA55 \b, x86 hard disk boot sector
-19 string \240\5\371\3\0\011\0\2\0 DOS floppy 720k
->0x1FE leshort 0xAA55 \b, x86 hard disk boot sector
-19 string \100\013\360\011\0\022\0\2\0 DOS floppy 1440k
->0x1FE leshort 0xAA55 \b, x86 hard disk boot sector
-
-19 string \240\5\371\5\0\011\0\2\0 DOS floppy 720k, IBM
->0x1FE leshort 0xAA55 \b, x86 hard disk boot sector
-19 string \100\013\371\5\0\011\0\2\0 DOS floppy 1440k, mkdosfs
->0x1FE leshort 0xAA55 \b, x86 hard disk boot sector
-
-19 string \320\2\370\5\0\011\0\1\0 Atari-ST floppy 360k
-19 string \240\5\371\5\0\011\0\2\0 Atari-ST floppy 720k
-
-# Valid media descriptor bytes for MS-DOS:
-#
-# Byte Capacity Media Size and Type
-# -------------------------------------------------
-#
-# F0 2.88 MB 3.5-inch, 2-sided, 36-sector
-# F0 1.44 MB 3.5-inch, 2-sided, 18-sector
-# F9 720K 3.5-inch, 2-sided, 9-sector
-# F9 1.2 MB 5.25-inch, 2-sided, 15-sector
-# FD 360K 5.25-inch, 2-sided, 9-sector
-# FF 320K 5.25-inch, 2-sided, 8-sector
-# FC 180K 5.25-inch, 1-sided, 9-sector
-# FE 160K 5.25-inch, 1-sided, 8-sector
-# FE 250K 8-inch, 1-sided, single-density
-# FD 500K 8-inch, 2-sided, single-density
-# FE 1.2 MB 8-inch, 2-sided, double-density
-# F8 ----- Fixed disk
-#
-# FC xxxK Apricot 70x1x9 boot disk.
-#
-# Originally a bitmap:
-# xxxxxxx0 Not two sided
-# xxxxxxx1 Double sided
-# xxxxxx0x Not 8 SPT
-# xxxxxx1x 8 SPT
-# xxxxx0xx Not Removable drive
-# xxxxx1xx Removable drive
-# 11111xxx Must be one.
-#
-# But now it's rather random:
-# 111111xx Low density disk
-# 00 SS, Not 8 SPT
-# 01 DS, Not 8 SPT
-# 10 SS, 8 SPT
-# 11 DS, 8 SPT
-#
-# 11111001 Double density 3 floppy disk, high density 5
-# 11110000 High density 3 floppy disk
-# 11111000 Hard disk any format
-#
-
-# CDROM Filesystems
-# Modified for UDF by gerardo.cacciari@gmail.com
-32769 string CD001
-!:mime application/x-iso9660-image
->38913 string !NSR0 ISO 9660 CD-ROM filesystem data
->38913 string NSR0 UDF filesystem data
->>38917 string 1 (version 1.0)
->>38917 string 2 (version 1.5)
->>38917 string 3 (version 2.0)
->>38917 byte >0x33 (unknown version, ID 0x%X)
->>38917 byte <0x31 (unknown version, ID 0x%X)
-# "application id" which appears to be used as a volume label
->32808 string >\0 '%s'
->34816 string \000CD001\001EL\ TORITO\ SPECIFICATION (bootable)
-37633 string CD001 ISO 9660 CD-ROM filesystem data (raw 2352 byte sectors)
-!:mime application/x-iso9660-image
-32776 string CDROM High Sierra CD-ROM filesystem data
-
-# cramfs filesystem - russell@coker.com.au
-0 lelong 0x28cd3d45 Linux Compressed ROM File System data, little endian
->4 lelong x size %lu
->8 lelong &1 version #2
->8 lelong &2 sorted_dirs
->8 lelong &4 hole_support
->32 lelong x CRC 0x%x,
->36 lelong x edition %lu,
->40 lelong x %lu blocks,
->44 lelong x %lu files
-
-0 belong 0x28cd3d45 Linux Compressed ROM File System data, big endian
->4 belong x size %lu
->8 belong &1 version #2
->8 belong &2 sorted_dirs
->8 belong &4 hole_support
->32 belong x CRC 0x%x,
->36 belong x edition %lu,
->40 belong x %lu blocks,
->44 belong x %lu files
-
-# reiserfs - russell@coker.com.au
-0x10034 string ReIsErFs ReiserFS V3.5
-0x10034 string ReIsEr2Fs ReiserFS V3.6
-0x10034 string ReIsEr3Fs ReiserFS V3.6.19
->0x1002c leshort x block size %d
->0x10032 leshort &2 (mounted or unclean)
->0x10000 lelong x num blocks %d
->0x10040 lelong 1 tea hash
->0x10040 lelong 2 yura hash
->0x10040 lelong 3 r5 hash
-
-# JFFS - russell@coker.com.au
-0 lelong 0x34383931 Linux Journalled Flash File system, little endian
-0 belong 0x34383931 Linux Journalled Flash File system, big endian
-
-# EST flat binary format (which isn't, but anyway)
-# From: Mark Brown <broonie@sirena.org.uk>
-0 string ESTFBINR EST flat binary
-
-# Aculab VoIP firmware
-# From: Mark Brown <broonie@sirena.org.uk>
-0 string VoIP\ Startup\ and Aculab VoIP firmware
->35 string x format %s
-
-# u-boot/PPCBoot image file
-# From: Mark Brown <broonie@sirena.org.uk>
-0 belong 0x27051956 u-boot/PPCBoot image
->4 string PPCBoot
->>12 string x version %s
-
-# JFFS2 file system
-0 leshort 0x1984 Linux old jffs2 filesystem data little endian
-0 leshort 0x1985 Linux jffs2 filesystem data little endian
-
-# Squashfs
-0 string sqsh Squashfs filesystem, big endian,
->28 beshort x version %d.
->30 beshort x \b%d,
->28 beshort <3
->>8 belong x %d bytes,
->28 beshort >2
->>63 bequad x %lld bytes,
-#>>67 belong x %d bytes,
->4 belong x %d inodes,
->28 beshort <2
->>32 beshort x blocksize: %d bytes,
->28 beshort >1
->>51 belong x blocksize: %d bytes,
->39 bedate x created: %s
-0 string hsqs Squashfs filesystem, little endian,
->28 leshort x version %d.
->30 leshort x \b%d,
->28 leshort <3
->>8 lelong x %d bytes,
->28 leshort >2
->>63 lequad x %lld bytes,
-#>>63 lelong x %d bytes,
->4 lelong x %d inodes,
->28 leshort <2
->>32 leshort x blocksize: %d bytes,
->28 leshort >1
->>51 lelong x blocksize: %d bytes,
->39 ledate x created: %s
-
-0 string td\000 floppy image data (TeleDisk)
-
-# AFS Dump Magic
-# From: Ty Sarna <tsarna@sarna.org>
-0 string \x01\xb3\xa1\x13\x22 AFS Dump
->&0 belong x (v%d)
->>&0 byte 0x76
->>>&0 belong x Vol %d,
->>>>&0 byte 0x6e
->>>>>&0 string x %s
->>>>>>&1 byte 0x74
->>>>>>>&0 beshort 2
->>>>>>>>&4 bedate x on: %s
->>>>>>>>&0 bedate =0 full dump
->>>>>>>>&0 bedate !0 incremental since: %s
-
-#----------------------------------------------------------
-# VMS backup savesets - gerardo.cacciari@gmail.com
-#
-4 string \x01\x00\x01\x00\x01\x00
->(0.s+16) string \x01\x01
->>&(&0.b+8) byte 0x42 OpenVMS backup saveset data
->>>40 lelong x (block size %d,
->>>49 string >\0 original name '%s',
->>>2 short 1024 VAX generated)
->>>2 short 2048 AXP generated)
->>>2 short 4096 I64 generated)
-
-# Summary: Oracle Clustered Filesystem
-# Created by: Aaron Botsis <redhat@digitalmafia.org>
-8 string OracleCFS Oracle Clustered Filesystem,
->4 long x rev %d
->0 long x \b.%d,
->560 string x label: %.64s,
->136 string x mountpoint: %.128s
-
-# Summary: Oracle ASM tagged volume
-# Created by: Aaron Botsis <redhat@digitalmafia.org>
-32 string ORCLDISK Oracle ASM Volume,
->40 string x Disk Name: %0.12s
-32 string ORCLCLRD Oracle ASM Volume (cleared),
->40 string x Disk Name: %0.12s
-
-# Oracle Clustered Filesystem - Aaron Botsis <redhat@digitalmafia.org>
-8 string OracleCFS Oracle Clustered Filesystem,
->4 long x rev %d
->0 long x \b.%d,
->560 string x label: %.64s,
->136 string x mountpoint: %.128s
-
-# Oracle ASM tagged volume - Aaron Botsis <redhat@digitalmafia.org>
-32 string ORCLDISK Oracle ASM Volume,
->40 string x Disk Name: %0.12s
-32 string ORCLCLRD Oracle ASM Volume (cleared),
->40 string x Disk Name: %0.12s
-
-# Compaq/HP RILOE floppy image
-# From: Dirk Jagdmann <doj@cubic.org>
-0 string CPQRFBLO Compaq/HP RILOE floppy image
-
-#------------------------------------------------------------------------------
-# Files-11 On-Disk Structure (OpenVMS file system) - gerardo.cacciari@gmail.com
-# These bits come from LBN 1 (home block) of ODS-2 and ODS-5 volumes, which is
-# mapped to VBN 2 of [000000]INDEXF.SYS;1
-#
-1008 string DECFILE11B Files-11 On-Disk Structure
->525 byte x Level %d
->525 byte x (ODS-%d OpenVMS file system),
->984 string x volume label is '%-12.12s'
-
-# From: Thomas Klausner <wiz@NetBSD.org>
-# http://filext.com/file-extension/DAA
-# describes the daa file format. The magic would be:
-0 string DAA\x0\x0\x0\x0\x0 PowerISO Direct-Access-Archive
-
-# From Albert Cahalan <acahalan@gmail.com>
-# really le32 operation,destination,payloadsize (but quite predictable)
-# 01 00 00 00 00 00 00 c0 00 02 00 00
-0 string \1\0\0\0\0\0\0\300\0\2\0\0 Marvell Libertas firmware
-
-# From Eric Sandeen
-# GFS2
-0x10000 belong 0x01161970 GFS2 Filesystem
->0x10024 belong x (blocksize %d,
->0x10060 string >\0 lockproto %s)
-
-# BTRFS
-0x10040 string _BHRfS_M BTRFS Filesystem
->0x1012b string >\0 (label "%s",
->0x10090 lelong x sectorsize %d,
->0x10094 lelong x nodesize %d,
->0x10098 lelong x leafsize %d)
-
-
-# dvdisaster's .ecc
-# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
-0 string *dvdisaster* dvdisaster error correction file
-
-# Type: CROM filesystem
-# From: Werner Fink <werner@suse.de>
-0 string CROMFS CROMFS
->6 string >\0 \b version %2.2s,
->8 ulequad >0 \b block data at %lld,
->16 ulequad >0 \b fblock table at %lld,
->24 ulequad >0 \b inode table at %lld,
->32 ulequad >0 \b root at %lld,
->40 ulelong >0 \b fblock size = %ld,
->44 ulelong >0 \b block size = %ld,
->48 ulequad >0 \b bytes = %lld
-
-#------------------------------------------------------------------------------
-# flash: file(1) magic for Macromedia Flash file format
-#
-# See
-#
-# http://www.macromedia.com/software/flash/open/
-#
-0 string FWS Macromedia Flash data,
->3 byte x version %d
-!:mime application/x-shockwave-flash
-0 string CWS Macromedia Flash data (compressed),
-!:mime application/x-shockwave-flash
->3 byte x version %d
-# From: Cal Peake <cp@absolutedigital.net>
-0 string FLV Macromedia Flash Video
-!:mime video/x-flv
-
-#
-# From Dave Wilson
-0 string AGD4\xbe\xb8\xbb\xcb\x00 Macromedia Freehand 9 Document
-#------------------------------------------------------------------------------
-# fonts: file(1) magic for font data
-#
-0 search/1 FONT ASCII vfont text
-0 short 0436 Berkeley vfont data
-0 short 017001 byte-swapped Berkeley vfont data
-
-# PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com
-0 string %!PS-AdobeFont-1. PostScript Type 1 font text
->20 string >\0 (%s)
-6 string %!PS-AdobeFont-1. PostScript Type 1 font program data
-
-# X11 font files in SNF (Server Natural Format) format
-0 belong 00000004 X11 SNF font data, MSB first
-0 lelong 00000004 X11 SNF font data, LSB first
-
-# X11 Bitmap Distribution Format, from Daniel Quinlan (quinlan@yggdrasil.com)
-0 search/1 STARTFONT\ X11 BDF font text
-
-# X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com)
-# PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides)
-0 string \001fcp X11 Portable Compiled Font data
->12 byte 0x02 \b, LSB first
->12 byte 0x0a \b, MSB first
-0 string D1.0\015 X11 Speedo font data
-
-#------------------------------------------------------------------------------
-# FIGlet fonts and controlfiles
-# From figmagic supplied with Figlet version 2.2
-# "David E. O'Brien" <obrien@FreeBSD.ORG>
-0 string flf FIGlet font
->3 string >2a version %-2.2s
-0 string flc FIGlet controlfile
->3 string >2a version %-2.2s
-
-# libGrx graphics lib fonts, from Albert Cahalan (acahalan@cs.uml.edu)
-# Used with djgpp (DOS Gnu C++), sometimes Linux or Turbo C++
-0 belong 0x14025919 libGrx font data,
->8 leshort x %dx
->10 leshort x \b%d
->40 string x %s
-# Misc. DOS VGA fonts, from Albert Cahalan (acahalan@cs.uml.edu)
-0 belong 0xff464f4e DOS code page font data collection
-7 belong 0x00454741 DOS code page font data
-7 belong 0x00564944 DOS code page font data (from Linux?)
-4098 string DOSFONT DOSFONT2 encrypted font data
-
-# downloadable fonts for browser (prints type) anthon@mnt.org
-0 string PFR1 PFR1 font
->102 string >0 \b: %s
-
-# True Type fonts
-0 string \000\001\000\000\000 TrueType font data
-
-0 string \007\001\001\000Copyright\ (c)\ 199 Adobe Multiple Master font
-0 string \012\001\001\000Copyright\ (c)\ 199 Adobe Multiple Master font
-
-0 string ttcf TrueType font collection data
-
-# Opentype font data from Avi Bercovich
-0 string OTTO OpenType font data
-
-# Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
-0 string SplineFontDB: Spline Font Database
->14 string x version %s
-# FORTRAN source
-0 regex/100 \^[Cc][\ \t] FORTRAN program
-!:mime text/x-fortran
-#------------------------------------------------------------------------------
-# frame: file(1) magic for FrameMaker files
-#
-# This stuff came on a FrameMaker demo tape, most of which is
-# copyright, but this file is "published" as witness the following:
-#
-# Note that this is the Framemaker Maker Interchange Format, not the
-# Normal format which would be application/vnd.framemaker.
-#
-0 string \<MakerFile FrameMaker document
-!:mime application/x-mif
->11 string 5.5 (5.5
->11 string 5.0 (5.0
->11 string 4.0 (4.0
->11 string 3.0 (3.0
->11 string 2.0 (2.0
->11 string 1.0 (1.0
->14 byte x %c)
-0 string \<MIFFile FrameMaker MIF (ASCII) file
-!:mime application/x-mif
->9 string 4.0 (4.0)
->9 string 3.0 (3.0)
->9 string 2.0 (2.0)
->9 string 1.0 (1.x)
-0 search/1 \<MakerDictionary FrameMaker Dictionary text
-!:mime application/x-mif
->17 string 3.0 (3.0)
->17 string 2.0 (2.0)
->17 string 1.0 (1.x)
-0 string \<MakerScreenFont FrameMaker Font file
-!:mime application/x-mif
->17 string 1.01 (%s)
-0 string \<MML FrameMaker MML file
-!:mime application/x-mif
-0 string \<BookFile FrameMaker Book file
-!:mime application/x-mif
->10 string 3.0 (3.0
->10 string 2.0 (2.0
->10 string 1.0 (1.0
->13 byte x %c)
-# XXX - this book entry should be verified, if you find one, uncomment this
-#0 string \<Book\ FrameMaker Book (ASCII) file
-#!:mime application/x-mif
-#>6 string 3.0 (3.0)
-#>6 string 2.0 (2.0)
-#>6 string 1.0 (1.0)
-0 string \<Maker Intermediate Print File FrameMaker IPL file
-!:mime application/x-mif
-
-#------------------------------------------------------------------------------
-# freebsd: file(1) magic for FreeBSD objects
-#
-# All new-style FreeBSD magic numbers are in host byte order (i.e.,
-# little-endian on x86).
-#
-# XXX - this comes from the file "freebsd" in a recent FreeBSD version of
-# "file"; it, and the NetBSD stuff in "netbsd", appear to use different
-# schemes for distinguishing between executable images, shared libraries,
-# and object files.
-#
-# FreeBSD says:
-#
-# Regardless of whether it's pure, demand-paged, or none of the
-# above:
-#
-# if the entry point is < 4096, then it's a shared library if
-# the "has run-time loader information" bit is set, and is
-# position-independent if the "is position-independent" bit
-# is set;
-#
-# if the entry point is >= 4096 (or >4095, same thing), then it's
-# an executable, and is dynamically-linked if the "has run-time
-# loader information" bit is set.
-#
-# On x86, NetBSD says:
-#
-# If it's neither pure nor demand-paged:
-#
-# if it has the "has run-time loader information" bit set, it's
-# a dynamically-linked executable;
-#
-# if it doesn't have that bit set, then:
-#
-# if it has the "is position-independent" bit set, it's
-# position-independent;
-#
-# if the entry point is non-zero, it's an executable, otherwise
-# it's an object file.
-#
-# If it's pure:
-#
-# if it has the "has run-time loader information" bit set, it's
-# a dynamically-linked executable, otherwise it's just an
-# executable.
-#
-# If it's demand-paged:
-#
-# if it has the "has run-time loader information" bit set,
-# then:
-#
-# if the entry point is < 4096, it's a shared library;
-#
-# if the entry point is = 4096 or > 4096 (i.e., >= 4096),
-# it's a dynamically-linked executable);
-#
-# if it doesn't have the "has run-time loader information" bit
-# set, then it's just an executable.
-#
-# (On non-x86, NetBSD does much the same thing, except that it uses
-# 8192 on 68K - except for "68k4k", which is presumably "68K with 4K
-# pages - SPARC, and MIPS, presumably because Sun-3's and Sun-4's
-# had 8K pages; dunno about MIPS.)
-#
-# I suspect the two will differ only in perverse and uninteresting cases
-# ("shared" libraries that aren't demand-paged and whose pages probably
-# won't actually be shared, executables with entry points <4096).
-#
-# I leave it to those more familiar with FreeBSD and NetBSD to figure out
-# what the right answer is (although using ">4095", FreeBSD-style, is
-# probably better than separately checking for "=4096" and ">4096",
-# NetBSD-style). (The old "netbsd" file analyzed FreeBSD demand paged
-# executables using the NetBSD technique.)
-#
-0 lelong&0377777777 041400407 FreeBSD/i386
->20 lelong <4096
->>3 byte&0xC0 &0x80 shared library
->>3 byte&0xC0 0x40 PIC object
->>3 byte&0xC0 0x00 object
->20 lelong >4095
->>3 byte&0x80 0x80 dynamically linked executable
->>3 byte&0x80 0x00 executable
->16 lelong >0 not stripped
-
-0 lelong&0377777777 041400410 FreeBSD/i386 pure
->20 lelong <4096
->>3 byte&0xC0 &0x80 shared library
->>3 byte&0xC0 0x40 PIC object
->>3 byte&0xC0 0x00 object
->20 lelong >4095
->>3 byte&0x80 0x80 dynamically linked executable
->>3 byte&0x80 0x00 executable
->16 lelong >0 not stripped
-
-0 lelong&0377777777 041400413 FreeBSD/i386 demand paged
->20 lelong <4096
->>3 byte&0xC0 &0x80 shared library
->>3 byte&0xC0 0x40 PIC object
->>3 byte&0xC0 0x00 object
->20 lelong >4095
->>3 byte&0x80 0x80 dynamically linked executable
->>3 byte&0x80 0x00 executable
->16 lelong >0 not stripped
-
-0 lelong&0377777777 041400314 FreeBSD/i386 compact demand paged
->20 lelong <4096
->>3 byte&0xC0 &0x80 shared library
->>3 byte&0xC0 0x40 PIC object
->>3 byte&0xC0 0x00 object
->20 lelong >4095
->>3 byte&0x80 0x80 dynamically linked executable
->>3 byte&0x80 0x00 executable
->16 lelong >0 not stripped
-
-# XXX gross hack to identify core files
-# cores start with a struct tss; we take advantage of the following:
-# byte 7: highest byte of the kernel stack pointer, always 0xfe
-# 8/9: kernel (ring 0) ss value, always 0x0010
-# 10 - 27: ring 1 and 2 ss/esp, unused, thus always 0
-# 28: low order byte of the current PTD entry, always 0 since the
-# PTD is page-aligned
-#
-7 string \357\020\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 FreeBSD/i386 a.out core file
->1039 string >\0 from '%s'
-
-# /var/run/ld.so.hints
-# What are you laughing about?
-0 lelong 011421044151 ld.so hints file (Little Endian
->4 lelong >0 \b, version %d)
->4 belong <1 \b)
-0 belong 011421044151 ld.so hints file (Big Endian
->4 belong >0 \b, version %d)
->4 belong <1 \b)
-
-#
-# Files generated by FreeBSD scrshot(1)/vidcontrol(1) utilities
-#
-0 string SCRSHOT_ scrshot(1) screenshot,
->8 byte x version %d,
->9 byte 2 %d bytes in header,
->>10 byte x %d chars wide by
->>11 byte x %d chars high
-
-#------------------------------------------------------------------------------
-# fsav: file(1) magic for datafellows fsav virus definition files
-# Anthon van der Neut (anthon@mnt.org)
-
-# ftp://ftp.f-prot.com/pub/{macrdef2.zip,nomacro.def}
-0 beshort 0x1575 fsav macro virus signatures
->8 leshort >0 (%d-
->11 byte >0 \b%02d-
->10 byte >0 \b%02d)
-# ftp://ftp.f-prot.com/pub/sign.zip
-#10 ubyte <12
-#>9 ubyte <32
-#>>8 ubyte 0x0a
-#>>>12 ubyte 0x07
-#>>>>11 uleshort >0 fsav DOS/Windows virus signatures (%d-
-#>>>>10 byte 0 \b01-
-#>>>>10 byte 1 \b02-
-#>>>>10 byte 2 \b03-
-#>>>>10 byte 3 \b04-
-#>>>>10 byte 4 \b05-
-#>>>>10 byte 5 \b06-
-#>>>>10 byte 6 \b07-
-#>>>>10 byte 7 \b08-
-#>>>>10 byte 8 \b09-
-#>>>>10 byte 9 \b10-
-#>>>>10 byte 10 \b11-
-#>>>>10 byte 11 \b12-
-#>>>>9 ubyte >0 \b%02d)
-# ftp://ftp.f-prot.com/pub/sign2.zip
-#0 ubyte 0x62
-#>1 ubyte 0xF5
-#>>2 ubyte 0x1
-#>>>3 ubyte 0x1
-#>>>>4 ubyte 0x0e
-#>>>>>13 ubyte >0 fsav virus signatures
-#>>>>>>11 ubyte x size 0x%02x
-#>>>>>>12 ubyte x \b%02x
-#>>>>>>13 ubyte x \b%02x bytes
-
-# Joerg Jenderek: joerg dot jenderek at web dot de
-# http://www.clamav.net/doc/latest/html/node45.html
-# .cvd files start with a 512 bytes colon separated header
-# ClamAV-VDB:buildDate:version:signaturesNumbers:functionalityLevelRequired:MD5:Signature:builder:buildTime
-# + gzipped tarball files
-0 string ClamAV-VDB:
->11 string >\0 Clam AntiVirus database %-.23s
->>34 string :
->>>35 string !: \b, version
->>>>35 string x \b%-.1s
->>>>>36 string !:
->>>>>>36 string x \b%-.1s
->>>>>>>37 string !:
->>>>>>>>37 string x \b%-.1s
->>>>>>>>>38 string !:
->>>>>>>>>>38 string x \b%-.1s
->512 string \037\213 \b, gzipped
->769 string ustar\0 \b, tarred
-
-# Type: Grisoft AVG AntiVirus
-# From: David Newgas <david@newgas.net>
-0 string AVG7_ANTIVIRUS_VAULT_FILE AVG 7 Antivirus vault file data
-#------------------------------------------------------------------------------
-# games: file(1) for games
-
-# Fabio Bonelli <fabiobonelli@libero.it>
-# Quake II - III data files
-0 string IDP2 Quake II 3D Model file,
->20 long x %lu skin(s),
->8 long x (%lu x
->12 long x %lu),
->40 long x %lu frame(s),
->16 long x Frame size %lu bytes,
->24 long x %lu vertices/frame,
->28 long x %lu texture coordinates,
->32 long x %lu triangles/frame
-
-0 string IBSP Quake
->4 long 0x26 II Map file (BSP)
->4 long 0x2E III Map file (BSP)
-
-0 string IDS2 Quake II SP2 sprite file
-
-#---------------------------------------------------------------------------
-# Doom and Quake
-# submitted by Nicolas Patrois
-
-0 string \xcb\x1dBoom\xe6\xff\x03\x01 Boom or linuxdoom demo
-# some doom lmp files don't match, I've got one beginning with \x6d\x02\x01\x01
-
-24 string LxD\ 203 Linuxdoom save
->0 string x , name=%s
->44 string x , world=%s
-
-# Quake
-
-0 string PACK Quake I or II world or extension
->8 lelong >0 \b, %d entries
-
-#0 string -1\x0a Quake I demo
-#>30 string x version %.4s
-#>61 string x level %s
-
-#0 string 5\x0a Quake I save
-
-# The levels
-
-# Quake 1
-
-0 string 5\x0aIntroduction Quake I save: start Introduction
-0 string 5\x0athe_Slipgate_Complex Quake I save: e1m1 The slipgate complex
-0 string 5\x0aCastle_of_the_Damned Quake I save: e1m2 Castle of the damned
-0 string 5\x0athe_Necropolis Quake I save: e1m3 The necropolis
-0 string 5\x0athe_Grisly_Grotto Quake I save: e1m4 The grisly grotto
-0 string 5\x0aZiggurat_Vertigo Quake I save: e1m8 Ziggurat vertigo (secret)
-0 string 5\x0aGloom_Keep Quake I save: e1m5 Gloom keep
-0 string 5\x0aThe_Door_To_Chthon Quake I save: e1m6 The door to Chthon
-0 string 5\x0aThe_House_of_Chthon Quake I save: e1m7 The house of Chthon
-0 string 5\x0athe_Installation Quake I save: e2m1 The installation
-0 string 5\x0athe_Ogre_Citadel Quake I save: e2m2 The ogre citadel
-0 string 5\x0athe_Crypt_of_Decay Quake I save: e2m3 The crypt of decay (dopefish lives!)
-0 string 5\x0aUnderearth Quake I save: e2m7 Underearth (secret)
-0 string 5\x0athe_Ebon_Fortress Quake I save: e2m4 The ebon fortress
-0 string 5\x0athe_Wizard's_Manse Quake I save: e2m5 The wizard's manse
-0 string 5\x0athe_Dismal_Oubliette Quake I save: e2m6 The dismal oubliette
-0 string 5\x0aTermination_Central Quake I save: e3m1 Termination central
-0 string 5\x0aVaults_of_Zin Quake I save: e3m2 Vaults of Zin
-0 string 5\x0athe_Tomb_of_Terror Quake I save: e3m3 The tomb of terror
-0 string 5\x0aSatan's_Dark_Delight Quake I save: e3m4 Satan's dark delight
-0 string 5\x0athe_Haunted_Halls Quake I save: e3m7 The haunted halls (secret)
-0 string 5\x0aWind_Tunnels Quake I save: e3m5 Wind tunnels
-0 string 5\x0aChambers_of_Torment Quake I save: e3m6 Chambers of torment
-0 string 5\x0athe_Sewage_System Quake I save: e4m1 The sewage system
-0 string 5\x0aThe_Tower_of_Despair Quake I save: e4m2 The tower of despair
-0 string 5\x0aThe_Elder_God_Shrine Quake I save: e4m3 The elder god shrine
-0 string 5\x0athe_Palace_of_Hate Quake I save: e4m4 The palace of hate
-0 string 5\x0aHell's_Atrium Quake I save: e4m5 Hell's atrium
-0 string 5\x0athe_Nameless_City Quake I save: e4m8 The nameless city (secret)
-0 string 5\x0aThe_Pain_Maze Quake I save: e4m6 The pain maze
-0 string 5\x0aAzure_Agony Quake I save: e4m7 Azure agony
-0 string 5\x0aShub-Niggurath's_Pit Quake I save: end Shub-Niggurath's pit
-
-# Quake DeathMatch levels
-
-0 string 5\x0aPlace_of_Two_Deaths Quake I save: dm1 Place of two deaths
-0 string 5\x0aClaustrophobopolis Quake I save: dm2 Claustrophobopolis
-0 string 5\x0aThe_Abandoned_Base Quake I save: dm3 The abandoned base
-0 string 5\x0aThe_Bad_Place Quake I save: dm4 The bad place
-0 string 5\x0aThe_Cistern Quake I save: dm5 The cistern
-0 string 5\x0aThe_Dark_Zone Quake I save: dm6 The dark zone
-
-# Scourge of Armagon
-
-0 string 5\x0aCommand_HQ Quake I save: start Command HQ
-0 string 5\x0aThe_Pumping_Station Quake I save: hip1m1 The pumping station
-0 string 5\x0aStorage_Facility Quake I save: hip1m2 Storage facility
-0 string 5\x0aMilitary_Complex Quake I save: hip1m5 Military complex (secret)
-0 string 5\x0athe_Lost_Mine Quake I save: hip1m3 The lost mine
-0 string 5\x0aResearch_Facility Quake I save: hip1m4 Research facility
-0 string 5\x0aAncient_Realms Quake I save: hip2m1 Ancient realms
-0 string 5\x0aThe_Gremlin's_Domain Quake I save: hip2m6 The gremlin's domain (secret)
-0 string 5\x0aThe_Black_Cathedral Quake I save: hip2m2 The black cathedral
-0 string 5\x0aThe_Catacombs Quake I save: hip2m3 The catacombs
-0 string 5\x0athe_Crypt__ Quake I save: hip2m4 The crypt
-0 string 5\x0aMortum's_Keep Quake I save: hip2m5 Mortum's keep
-0 string 5\x0aTur_Torment Quake I save: hip3m1 Tur torment
-0 string 5\x0aPandemonium Quake I save: hip3m2 Pandemonium
-0 string 5\x0aLimbo Quake I save: hip3m3 Limbo
-0 string 5\x0athe_Edge_of_Oblivion Quake I save: hipdm1 The edge of oblivion (secret)
-0 string 5\x0aThe_Gauntlet Quake I save: hip3m4 The gauntlet
-0 string 5\x0aArmagon's_Lair Quake I save: hipend Armagon's lair
-
-# Malice
-
-0 string 5\x0aThe_Academy Quake I save: start The academy
-0 string 5\x0aThe_Lab Quake I save: d1 The lab
-0 string 5\x0aArea_33 Quake I save: d1b Area 33
-0 string 5\x0aSECRET_MISSIONS Quake I save: d3b Secret missions
-0 string 5\x0aThe_Hospital Quake I save: d10 The hospital (secret)
-0 string 5\x0aThe_Genetics_Lab Quake I save: d11 The genetics lab (secret)
-0 string 5\x0aBACK_2_MALICE Quake I save: d4b Back to Malice
-0 string 5\x0aArea44 Quake I save: d1c Area 44
-0 string 5\x0aTakahiro_Towers Quake I save: d2 Takahiro towers
-0 string 5\x0aA_Rat's_Life Quake I save: d3 A rat's life
-0 string 5\x0aInto_The_Flood Quake I save: d4 Into the flood
-0 string 5\x0aThe_Flood Quake I save: d5 The flood
-0 string 5\x0aNuclear_Plant Quake I save: d6 Nuclear plant
-0 string 5\x0aThe_Incinerator_Plant Quake I save: d7 The incinerator plant
-0 string 5\x0aThe_Foundry Quake I save: d7b The foundry
-0 string 5\x0aThe_Underwater_Base Quake I save: d8 The underwater base
-0 string 5\x0aTakahiro_Base Quake I save: d9 Takahiro base
-0 string 5\x0aTakahiro_Laboratories Quake I save: d12 Takahiro laboratories
-0 string 5\x0aStayin'_Alive Quake I save: d13 Stayin' alive
-0 string 5\x0aB.O.S.S._HQ Quake I save: d14 B.O.S.S. HQ
-0 string 5\x0aSHOWDOWN! Quake I save: d15 Showdown!
-
-# Malice DeathMatch levels
-
-0 string 5\x0aThe_Seventh_Precinct Quake I save: ddm1 The seventh precinct
-0 string 5\x0aSub_Station Quake I save: ddm2 Sub station
-0 string 5\x0aCrazy_Eights! Quake I save: ddm3 Crazy eights!
-0 string 5\x0aEast_Side_Invertationa Quake I save: ddm4 East side invertationa
-0 string 5\x0aSlaughterhouse Quake I save: ddm5 Slaughterhouse
-0 string 5\x0aDOMINO Quake I save: ddm6 Domino
-0 string 5\x0aSANDRA'S_LADDER Quake I save: ddm7 Sandra's ladder
-
-
-0 string MComprHD MAME CHD compressed hard disk image,
->12 belong x version %lu
-
-# doom - submitted by Jon Dowland
-
-0 string =IWAD doom main IWAD data
->4 lelong x containing %d lumps
-0 string =PWAD doom patch PWAD data
->4 lelong x containing %d lumps
-
-
-# Summary: Warcraft 3 save
-# Extension: .w3g
-# Created by: "Nelson A. de Oliveira" <naoliv@gmail.com>
-0 string Warcraft\ III\ recorded\ game %s
-
-
-# Summary: Warcraft 3 map
-# Extension: .w3m
-# Created by: "Nelson A. de Oliveira" <naoliv@gmail.com>
-0 string HM3W Warcraft III map file
-
-
-# Summary: SGF Smart Game Format
-# Extension: .sgf
-# Reference: http://www.red-bean.com/sgf/
-# Created by: Eduardo Sabbatella <eduardo_sabbatella@yahoo.com.ar>
-# Modified by (1): Abel Cheung (regex, more game format)
-# FIXME: Some games don't have GM (game type)
-0 regex \\(;.*GM\\[[0-9]{1,2}\\] Smart Game Format
->2 search/0x200 GM[
->>&0 string 1] (Go)
->>&0 string 2] (Othello)
->>&0 string 3] (chess)
->>&0 string 4] (Gomoku+Renju)
->>&0 string 5] (Nine Men's Morris)
->>&0 string 6] (Backgammon)
->>&0 string 7] (Chinese chess)
->>&0 string 8] (Shogi)
->>&0 string 9] (Lines of Action)
->>&0 string 10] (Ataxx)
->>&0 string 11] (Hex)
->>&0 string 12] (Jungle)
->>&0 string 13] (Neutron)
->>&0 string 14] (Philosopher's Football)
->>&0 string 15] (Quadrature)
->>&0 string 16] (Trax)
->>&0 string 17] (Tantrix)
->>&0 string 18] (Amazons)
->>&0 string 19] (Octi)
->>&0 string 20] (Gess)
->>&0 string 21] (Twixt)
->>&0 string 22] (Zertz)
->>&0 string 23] (Plateau)
->>&0 string 24] (Yinsh)
->>&0 string 25] (Punct)
->>&0 string 26] (Gobblet)
->>&0 string 27] (hive)
->>&0 string 28] (Exxit)
->>&0 string 29] (Hnefatal)
->>&0 string 30] (Kuba)
->>&0 string 31] (Tripples)
->>&0 string 32] (Chase)
->>&0 string 33] (Tumbling Down)
->>&0 string 34] (Sahara)
->>&0 string 35] (Byte)
->>&0 string 36] (Focus)
->>&0 string 37] (Dvonn)
->>&0 string 38] (Tamsk)
->>&0 string 39] (Gipf)
->>&0 string 40] (Kropki)
-
-
-# Summary: Civilization 4 video
-# Extension: .bik
-# Created by: Abel Cheung <abelcheung@gmail.com>
-0 string BIKi Civilization 4 Video
-
-
-##############################################
-# NetImmerse/Gamebryo game engine entries
-
-# Summary: Gamebryo game engine file
-# Extension: .nif, .kf
-# Created by: Abel Cheung <abelcheung@gmail.com>
-0 string Gamebryo\ File\ Format,\ Version\ Gamebryo game engine file
->&0 regex [0-9a-z.]+ \b, version %s
-
-# Summary: Gamebryo game engine file
-# Extension: .kfm
-# Created by: Abel Cheung <abelcheung@gmail.com>
-0 string ;Gamebryo\ KFM\ File\ Version\ Gamebryo game engine animation File
->&0 regex [0-9a-z.]+ \b, version %s
-
-# Summary: NetImmerse game engine file
-# Extension .nif
-# Created by: Abel Cheung <abelcheung@gmail.com>
-0 string NetImmerse\ File\ Format,\ Versio
->&0 string n\ NetImmerse game engine file
->>&0 regex [0-9a-z.]+ \b, version %s
-
-# Type: SGF Smart Game Format
-# URL: http://www.red-bean.com/sgf/
-# From: Eduardo Sabbatella <eduardo_sabbatella@yahoo.com.ar>
-2 regex/c \\(;.*GM\\[[0-9]{1,2}\\] Smart Game Format
->2 regex/c GM\\[1\\] - Go Game
->2 regex/c GM\\[6\\] - BackGammon Game
->2 regex/c GM\\[11\\] - Hex Game
->2 regex/c GM\\[18\\] - Amazons Game
->2 regex/c GM\\[19\\] - Octi Game
->2 regex/c GM\\[20\\] - Gess Game
->2 regex/c GM\\[21\\] - twix Game
-
-#------------------------------------------------------------------------------
-# gcc: file(1) magic for GCC special files
-#
-0 string gpch GCC precompiled header
-
-# The version field is annoying. It's 3 characters, not zero-terminated.
->5 byte x (version %c
->6 byte x \b%c
->7 byte x \b%c)
-
-# 67 = 'C', 111 = 'o', 43 = '+', 79 = 'O'
->4 byte 67 for C
->4 byte 111 for Objective C
->4 byte 43 for C++
->4 byte 79 for Objective C++
-
-#------------------------------------------------------------------------------
-# GEOS files (Vidar Madsen, vidar@gimp.org)
-# semi-commonly used in embedded and handheld systems.
-0 belong 0xc745c153 GEOS
->40 byte 1 executable
->40 byte 2 VMFile
->40 byte 3 binary
->40 byte 4 directory label
->40 byte <1 unknown
->40 byte >4 unknown
->4 string >\0 \b, name "%s"
-#>44 short x \b, version %d
-#>46 short x \b.%d
-#>48 short x \b, rev %d
-#>50 short x \b.%d
-#>52 short x \b, proto %d
-#>54 short x \br%d
-#>168 string >\0 \b, copyright "%s"
-#------------------------------------------------------------------------------
-# GIMP Gradient: file(1) magic for the GIMP's gradient data files
-# by Federico Mena <federico@nuclecu.unam.mx>
-
-0 string GIMP\ Gradient GIMP gradient data
-
-#------------------------------------------------------------------------------
-# XCF: file(1) magic for the XCF image format used in the GIMP developed
-# by Spencer Kimball and Peter Mattis
-# ('Bucky' LaDieu, nega@vt.edu)
-
-0 string gimp\ xcf GIMP XCF image data,
-!:mime image/x-xcf
->9 string file version 0,
->9 string v version
->>10 string >\0 %s,
->14 belong x %lu x
->18 belong x %lu,
->22 belong 0 RGB Color
->22 belong 1 Greyscale
->22 belong 2 Indexed Color
->22 belong >2 Unknown Image Type.
-
-#------------------------------------------------------------------------------
-# XCF: file(1) magic for the patterns used in the GIMP, developed
-# by Spencer Kimball and Peter Mattis
-# ('Bucky' LaDieu, nega@vt.edu)
-
-20 string GPAT GIMP pattern data,
->24 string x %s
-
-#------------------------------------------------------------------------------
-# XCF: file(1) magic for the brushes used in the GIMP, developed
-# by Spencer Kimball and Peter Mattis
-# ('Bucky' LaDieu, nega@vt.edu)
-
-20 string GIMP GIMP brush data
-
-# GIMP Curves File
-# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
-0 string #\040GIMP\040Curves\040File GIMP curve file
-# GNOME keyring
-# Contributed by Josh Triplett
-# FIXME: Could be simplified if pstring supported two-byte counts
-0 string GnomeKeyring\n\r\0\n GNOME keyring
->&0 ubyte 0 \b, major version 0
->>&0 ubyte 0 \b, minor version 0
->>>&0 ubyte 0 \b, crypto type 0 (AEL)
->>>&0 ubyte >0 \b, crypto type %hhu (unknown)
->>>&1 ubyte 0 \b, hash type 0 (MD5)
->>>&1 ubyte >0 \b, hash type %hhu (unknown)
->>>&2 ubelong 0xFFFFFFFF \b, name NULL
->>>&2 ubelong !0xFFFFFFFF
->>>>&-4 ubelong >255 \b, name too long for file's pstring type
->>>>&-4 ubelong <256
->>>>>&-1 pstring x \b, name "%s"
->>>>>>&0 ubeqdate x \b, last modified %s
->>>>>>&8 ubeqdate x \b, created %s
->>>>>>&16 ubelong &1
->>>>>>>&0 ubelong x \b, locked if idle for %u seconds
->>>>>>&16 ubelong ^1 \b, not locked if idle
->>>>>>&24 ubelong x \b, hash iterations %u
->>>>>>&28 ubequad x \b, salt %llu
->>>>>>&52 ubelong x \b, %u item(s)
-#------------------------------------------------------------------------------
-# gnu: file(1) magic for various GNU tools
-#
-# GNU nlsutils message catalog file format
-#
-0 string \336\22\4\225 GNU message catalog (little endian),
->4 lelong x revision %d,
->8 lelong x %d messages
-0 string \225\4\22\336 GNU message catalog (big endian),
->4 belong x revision %d,
->8 belong x %d messages
-# message catalogs, from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
-0 string *nazgul* Nazgul style compiled message catalog
->8 lelong >0 \b, version %ld
-
-# GnuPG
-# The format is very similar to pgp
-0 string \001gpg GPG key trust database
->4 byte x version %d
-# Note: magic.mime had 0x8501 for the next line instead of 0x8502
-0 beshort 0x8502 GPG encrypted data
-!:mime text/PGP # encoding: data
-
-# This magic is not particularly good, as the keyrings don't have true
-# magic. Nevertheless, it covers many keyrings.
-0 beshort 0x9901 GPG key public ring
-!:mime application/x-gnupg-keyring
-
-# Gnumeric spreadsheet
-# This entry is only semi-helpful, as Gnumeric compresses its files, so
-# they will ordinarily reported as "compressed", but at least -z helps
-39 string =<gmr:Workbook Gnumeric spreadsheet
-
-# From: James Youngman <jay@gnu.org>
-# gnu find magic
-0 string \0LOCATE GNU findutils locate database data
->7 string >\0 \b, format %s
->7 string 02 \b (frcode)
-
-# Files produced by GNU gettext
-0 long 0xDE120495 GNU-format message catalog data
-0 long 0x950412DE GNU-format message catalog data
-
-#------------------------------------------------------------------------------
-# gnumeric: file(1) magic for Gnumeric spreadsheet
-# This entry is only semi-helpful, as Gnumeric compresses its files, so
-# they will ordinarily reported as "compressed", but at least -z helps
-39 string =<gmr:Workbook Gnumeric spreadsheet
-!:mime application/x-gnumeric
-
-#------------------------------------------------------------------------------
-# ACE/gr and Grace type files - PLEASE DO NOT REMOVE THIS LINE
-#
-# ACE/gr binary
-0 string \000\000\0001\000\000\0000\000\000\0000\000\000\0002\000\000\0000\000\000\0000\000\000\0003 old ACE/gr binary file
->39 byte >0 - version %c
-# ACE/gr ascii
-0 string #\ xvgr\ parameter\ file ACE/gr ascii file
-0 string #\ xmgr\ parameter\ file ACE/gr ascii file
-0 string #\ ACE/gr\ parameter\ file ACE/gr ascii file
-# Grace projects
-0 string #\ Grace\ project\ file Grace project file
->23 string @version\ (version
->>32 byte >0 %c
->>33 string >\0 \b.%.2s
->>35 string >\0 \b.%.2s)
-# ACE/gr fit description files
-0 string #\ ACE/gr\ fit\ description\ ACE/gr fit description file
-# end of ACE/gr and Grace type files - PLEASE DO NOT REMOVE THIS LINE
-#------------------------------------------------------------------------------
-# graphviz: file(1) magic for http://www.graphviz.org/
-
-# FIXME: These patterns match too generally. For example, the first
-# line matches a LaTeX file containing the word "graph" (with a {
-# following later) and the second line matches this file.
-#0 regex/100 [\r\n\t\ ]*graph[\r\n\t\ ]+.*\\{ graphviz graph text
-#!:mime text/vnd.graphviz
-#0 regex/100 [\r\n\t\ ]*digraph[\r\n\t\ ]+.*\\{ graphviz digraph text
-#!:mime text/vnd.graphviz
-
-#------------------------------------------------------------------------------
-# gringotts: file(1) magic for Gringotts
-# http://devel.pluto.linux.it/projects/Gringotts/
-# author: Germano Rizzo <mano@pluto.linux.it>
-#GRG3????Y
-0 string GRG Gringotts data file
-#file format 1
->3 string 1 v.1, MCRYPT S2K, SERPENT crypt, SHA-256 hash, ZLib lvl.9
-#file format 2
->3 string 2 v.2, MCRYPT S2K,
->>8 byte&0x70 0x00 RIJNDAEL-128 crypt,
->>8 byte&0x70 0x10 SERPENT crypt,
->>8 byte&0x70 0x20 TWOFISH crypt,
->>8 byte&0x70 0x30 CAST-256 crypt,
->>8 byte&0x70 0x40 SAFER+ crypt,
->>8 byte&0x70 0x50 LOKI97 crypt,
->>8 byte&0x70 0x60 3DES crypt,
->>8 byte&0x70 0x70 RIJNDAEL-256 crypt,
->>8 byte&0x08 0x00 SHA1 hash,
->>8 byte&0x08 0x08 RIPEMD-160 hash,
->>8 byte&0x04 0x00 ZLib
->>8 byte&0x04 0x04 BZip2
->>8 byte&0x03 0x00 lvl.0
->>8 byte&0x03 0x01 lvl.3
->>8 byte&0x03 0x02 lvl.6
->>8 byte&0x03 0x03 lvl.9
-#file format 3
->3 string 3 v.3, OpenPGP S2K,
->>8 byte&0x70 0x00 RIJNDAEL-128 crypt,
->>8 byte&0x70 0x10 SERPENT crypt,
->>8 byte&0x70 0x20 TWOFISH crypt,
->>8 byte&0x70 0x30 CAST-256 crypt,
->>8 byte&0x70 0x40 SAFER+ crypt,
->>8 byte&0x70 0x50 LOKI97 crypt,
->>8 byte&0x70 0x60 3DES crypt,
->>8 byte&0x70 0x70 RIJNDAEL-256 crypt,
->>8 byte&0x08 0x00 SHA1 hash,
->>8 byte&0x08 0x08 RIPEMD-160 hash,
->>8 byte&0x04 0x00 ZLib
->>8 byte&0x04 0x04 BZip2
->>8 byte&0x03 0x00 lvl.0
->>8 byte&0x03 0x01 lvl.3
->>8 byte&0x03 0x02 lvl.6
->>8 byte&0x03 0x03 lvl.9
-#file format >3
->3 string >3 v.%.1s (unknown details)
-
-#------------------------------------------------------------------------------
-# hitach-sh: file(1) magic for Hitachi Super-H
-#
-# Super-H COFF
-#
-0 beshort 0x0500 Hitachi SH big-endian COFF
->18 beshort&0x0002 =0x0000 object
->18 beshort&0x0002 =0x0002 executable
->18 beshort&0x0008 =0x0008 \b, stripped
->18 beshort&0x0008 =0x0000 \b, not stripped
-#
-0 leshort 0x0550 Hitachi SH little-endian COFF
->18 leshort&0x0002 =0x0000 object
->18 leshort&0x0002 =0x0002 executable
->18 leshort&0x0008 =0x0008 \b, stripped
->18 leshort&0x0008 =0x0000 \b, not stripped
-
-#------------------------------------------------------------------------------
-# hp: file(1) magic for Hewlett Packard machines (see also "printer")
-#
-# XXX - somebody should figure out whether any byte order needs to be
-# applied to the "TML" stuff; I'm assuming the Apollo stuff is
-# big-endian as it was mostly 68K-based.
-#
-# I think the 500 series was the old stack-based machines, running a
-# UNIX environment atop the "SUN kernel"; dunno whether it was
-# big-endian or little-endian.
-#
-# Daniel Quinlan (quinlan@yggdrasil.com): hp200 machines are 68010 based;
-# hp300 are 68020+68881 based; hp400 are also 68k. The following basic
-# HP magic is useful for reference, but using "long" magic is a better
-# practice in order to avoid collisions.
-#
-# Guy Harris (guy@netapp.com): some additions to this list came from
-# HP-UX 10.0's "/usr/include/sys/unistd.h" (68030, 68040, PA-RISC 1.1,
-# 1.2, and 2.0). The 1.2 and 2.0 stuff isn't in the HP-UX 10.0
-# "/etc/magic", though, except for the "archive file relocatable library"
-# stuff, and the 68030 and 68040 stuff isn't there at all - are they not
-# used in executables, or have they just not yet updated "/etc/magic"
-# completely?
-#
-# 0 beshort 200 hp200 (68010) BSD binary
-# 0 beshort 300 hp300 (68020+68881) BSD binary
-# 0 beshort 0x20c hp200/300 HP-UX binary
-# 0 beshort 0x20d hp400 (68030) HP-UX binary
-# 0 beshort 0x20e hp400 (68040?) HP-UX binary
-# 0 beshort 0x20b PA-RISC1.0 HP-UX binary
-# 0 beshort 0x210 PA-RISC1.1 HP-UX binary
-# 0 beshort 0x211 PA-RISC1.2 HP-UX binary
-# 0 beshort 0x214 PA-RISC2.0 HP-UX binary
-
-#
-# The "misc" stuff needs a byte order; the archives look suspiciously
-# like the old 177545 archives (0xff65 = 0177545).
-#
-#### Old Apollo stuff
-0 beshort 0627 Apollo m68k COFF executable
->18 beshort ^040000 not stripped
->22 beshort >0 - version %ld
-0 beshort 0624 apollo a88k COFF executable
->18 beshort ^040000 not stripped
->22 beshort >0 - version %ld
-0 long 01203604016 TML 0123 byte-order format
-0 long 01702407010 TML 1032 byte-order format
-0 long 01003405017 TML 2301 byte-order format
-0 long 01602007412 TML 3210 byte-order format
-#### PA-RISC 1.1
-0 belong 0x02100106 PA-RISC1.1 relocatable object
-0 belong 0x02100107 PA-RISC1.1 executable
->168 belong &0x00000004 dynamically linked
->(144) belong 0x054ef630 dynamically linked
->96 belong >0 - not stripped
-
-0 belong 0x02100108 PA-RISC1.1 shared executable
->168 belong&0x4 0x4 dynamically linked
->(144) belong 0x054ef630 dynamically linked
->96 belong >0 - not stripped
-
-0 belong 0x0210010b PA-RISC1.1 demand-load executable
->168 belong&0x4 0x4 dynamically linked
->(144) belong 0x054ef630 dynamically linked
->96 belong >0 - not stripped
-
-0 belong 0x0210010e PA-RISC1.1 shared library
->96 belong >0 - not stripped
-
-0 belong 0x0210010d PA-RISC1.1 dynamic load library
->96 belong >0 - not stripped
-
-#### PA-RISC 2.0
-0 belong 0x02140106 PA-RISC2.0 relocatable object
-
-0 belong 0x02140107 PA-RISC2.0 executable
->168 belong &0x00000004 dynamically linked
->(144) belong 0x054ef630 dynamically linked
->96 belong >0 - not stripped
-
-0 belong 0x02140108 PA-RISC2.0 shared executable
->168 belong &0x00000004 dynamically linked
->(144) belong 0x054ef630 dynamically linked
->96 belong >0 - not stripped
-
-0 belong 0x0214010b PA-RISC2.0 demand-load executable
->168 belong &0x00000004 dynamically linked
->(144) belong 0x054ef630 dynamically linked
->96 belong >0 - not stripped
-
-0 belong 0x0214010e PA-RISC2.0 shared library
->96 belong >0 - not stripped
-
-0 belong 0x0214010d PA-RISC2.0 dynamic load library
->96 belong >0 - not stripped
-
-#### 800
-0 belong 0x020b0106 PA-RISC1.0 relocatable object
-
-0 belong 0x020b0107 PA-RISC1.0 executable
->168 belong&0x4 0x4 dynamically linked
->(144) belong 0x054ef630 dynamically linked
->96 belong >0 - not stripped
-
-0 belong 0x020b0108 PA-RISC1.0 shared executable
->168 belong&0x4 0x4 dynamically linked
->(144) belong 0x054ef630 dynamically linked
->96 belong >0 - not stripped
-
-0 belong 0x020b010b PA-RISC1.0 demand-load executable
->168 belong&0x4 0x4 dynamically linked
->(144) belong 0x054ef630 dynamically linked
->96 belong >0 - not stripped
-
-0 belong 0x020b010e PA-RISC1.0 shared library
->96 belong >0 - not stripped
-
-0 belong 0x020b010d PA-RISC1.0 dynamic load library
->96 belong >0 - not stripped
-
-0 belong 0x213c6172 archive file
->68 belong 0x020b0619 - PA-RISC1.0 relocatable library
->68 belong 0x02100619 - PA-RISC1.1 relocatable library
->68 belong 0x02110619 - PA-RISC1.2 relocatable library
->68 belong 0x02140619 - PA-RISC2.0 relocatable library
-
-#### 500
-0 long 0x02080106 HP s500 relocatable executable
->16 long >0 - version %ld
-
-0 long 0x02080107 HP s500 executable
->16 long >0 - version %ld
-
-0 long 0x02080108 HP s500 pure executable
->16 long >0 - version %ld
-
-#### 200
-0 belong 0x020c0108 HP s200 pure executable
->4 beshort >0 - version %ld
->8 belong &0x80000000 save fp regs
->8 belong &0x40000000 dynamically linked
->8 belong &0x20000000 debuggable
->36 belong >0 not stripped
-
-0 belong 0x020c0107 HP s200 executable
->4 beshort >0 - version %ld
->8 belong &0x80000000 save fp regs
->8 belong &0x40000000 dynamically linked
->8 belong &0x20000000 debuggable
->36 belong >0 not stripped
-
-0 belong 0x020c010b HP s200 demand-load executable
->4 beshort >0 - version %ld
->8 belong &0x80000000 save fp regs
->8 belong &0x40000000 dynamically linked
->8 belong &0x20000000 debuggable
->36 belong >0 not stripped
-
-0 belong 0x020c0106 HP s200 relocatable executable
->4 beshort >0 - version %ld
->6 beshort >0 - highwater %d
->8 belong &0x80000000 save fp regs
->8 belong &0x20000000 debuggable
->8 belong &0x10000000 PIC
-
-0 belong 0x020a0108 HP s200 (2.x release) pure executable
->4 beshort >0 - version %ld
->36 belong >0 not stripped
-
-0 belong 0x020a0107 HP s200 (2.x release) executable
->4 beshort >0 - version %ld
->36 belong >0 not stripped
-
-0 belong 0x020c010e HP s200 shared library
->4 beshort >0 - version %ld
->6 beshort >0 - highwater %d
->36 belong >0 not stripped
-
-0 belong 0x020c010d HP s200 dynamic load library
->4 beshort >0 - version %ld
->6 beshort >0 - highwater %d
->36 belong >0 not stripped
-
-#### MISC
-0 long 0x0000ff65 HP old archive
-0 long 0x020aff65 HP s200 old archive
-0 long 0x020cff65 HP s200 old archive
-0 long 0x0208ff65 HP s500 old archive
-
-0 long 0x015821a6 HP core file
-
-0 long 0x4da7eee8 HP-WINDOWS font
->8 byte >0 - version %ld
-0 string Bitmapfile HP Bitmapfile
-
-0 string IMGfile CIS compimg HP Bitmapfile
-# XXX - see "lif"
-#0 short 0x8000 lif file
-0 long 0x020c010c compiled Lisp
-
-0 string msgcat01 HP NLS message catalog,
->8 long >0 %d messages
-
-# Summary: HP-48/49 calculator
-# Created by: phk@data.fls.dk
-# Modified by (1): AMAKAWA Shuhei <sa264@cam.ac.uk>
-# Modified by (2): Samuel Thibault <samuel.thibault@ens-lyon.org> (HP49 support)
-0 string HPHP HP
->4 string 48 48 binary
->4 string 49 49 binary
->7 byte >64 - Rev %c
->8 leshort 0x2911 (ADR)
->8 leshort 0x2933 (REAL)
->8 leshort 0x2955 (LREAL)
->8 leshort 0x2977 (COMPLX)
->8 leshort 0x299d (LCOMPLX)
->8 leshort 0x29bf (CHAR)
->8 leshort 0x29e8 (ARRAY)
->8 leshort 0x2a0a (LNKARRAY)
->8 leshort 0x2a2c (STRING)
->8 leshort 0x2a4e (HXS)
->8 leshort 0x2a74 (LIST)
->8 leshort 0x2a96 (DIR)
->8 leshort 0x2ab8 (ALG)
->8 leshort 0x2ada (UNIT)
->8 leshort 0x2afc (TAGGED)
->8 leshort 0x2b1e (GROB)
->8 leshort 0x2b40 (LIB)
->8 leshort 0x2b62 (BACKUP)
->8 leshort 0x2b88 (LIBDATA)
->8 leshort 0x2d9d (PROG)
->8 leshort 0x2dcc (CODE)
->8 leshort 0x2e48 (GNAME)
->8 leshort 0x2e6d (LNAME)
->8 leshort 0x2e92 (XLIB)
-
-0 string %%HP: HP text
->6 string T(0) - T(0)
->6 string T(1) - T(1)
->6 string T(2) - T(2)
->6 string T(3) - T(3)
->10 string A(D) A(D)
->10 string A(R) A(R)
->10 string A(G) A(G)
->14 string F(.) F(.);
->14 string F(,) F(,);
-
-
-# Summary: HP-38/39 calculator
-# Created by: Samuel Thibault <samuel.thibault@ens-lyon.org>
-0 string HP3
->3 string 8 HP 38
->3 string 9 HP 39
->4 string Bin binary
->4 string Asc ASCII
->7 string A (Directory List)
->7 string B (Zaplet)
->7 string C (Note)
->7 string D (Program)
->7 string E (Variable)
->7 string F (List)
->7 string G (Matrix)
->7 string H (Library)
->7 string I (Target List)
->7 string J (ASCII Vector specification)
->7 string K (wildcard)
-
-# Summary: HP-38/39 calculator
-# Created by: Samuel Thibault <samuel.thibault@ens-lyon.org>
-0 string HP3
->3 string 8 HP 38
->3 string 9 HP 39
->4 string Bin binary
->4 string Asc ASCII
->7 string A (Directory List)
->7 string B (Zaplet)
->7 string C (Note)
->7 string D (Program)
->7 string E (Variable)
->7 string F (List)
->7 string G (Matrix)
->7 string H (Library)
->7 string I (Target List)
->7 string J (ASCII Vector specification)
->7 string K (wildcard)
-
-# hpBSD magic numbers
-0 beshort 200 hp200 (68010) BSD
->2 beshort 0407 impure binary
->2 beshort 0410 read-only binary
->2 beshort 0413 demand paged binary
-0 beshort 300 hp300 (68020+68881) BSD
->2 beshort 0407 impure binary
->2 beshort 0410 read-only binary
->2 beshort 0413 demand paged binary
-#
-# From David Gero <dgero@nortelnetworks.com>
-# HP-UX 10.20 core file format from /usr/include/sys/core.h
-# Unfortunately, HP-UX uses corehead blocks without specifying the order
-# There are four we care about:
-# CORE_KERNEL, which starts with the string "HP-UX"
-# CORE_EXEC, which contains the name of the command
-# CORE_PROC, which contains the signal number that caused the core dump
-# CORE_FORMAT, which contains the version of the core file format (== 1)
-# The only observed order in real core files is KERNEL, EXEC, FORMAT, PROC
-# but we include all 6 variations of the order of the first 3, and
-# assume that PROC will always be last
-# Order 1: KERNEL, EXEC, FORMAT, PROC
-0x10 string HP-UX
->0 belong 2
->>0xC belong 0x3C
->>>0x4C belong 0x100
->>>>0x58 belong 0x44
->>>>>0xA0 belong 1
->>>>>>0xAC belong 4
->>>>>>>0xB0 belong 1
->>>>>>>>0xB4 belong 4 core file
->>>>>>>>>0x90 string >\0 from '%s'
->>>>>>>>>0xC4 belong 3 - received SIGQUIT
->>>>>>>>>0xC4 belong 4 - received SIGILL
->>>>>>>>>0xC4 belong 5 - received SIGTRAP
->>>>>>>>>0xC4 belong 6 - received SIGABRT
->>>>>>>>>0xC4 belong 7 - received SIGEMT
->>>>>>>>>0xC4 belong 8 - received SIGFPE
->>>>>>>>>0xC4 belong 10 - received SIGBUS
->>>>>>>>>0xC4 belong 11 - received SIGSEGV
->>>>>>>>>0xC4 belong 12 - received SIGSYS
->>>>>>>>>0xC4 belong 33 - received SIGXCPU
->>>>>>>>>0xC4 belong 34 - received SIGXFSZ
-# Order 2: KERNEL, FORMAT, EXEC, PROC
->>>0x4C belong 1
->>>>0x58 belong 4
->>>>>0x5C belong 1
->>>>>>0x60 belong 0x100
->>>>>>>0x6C belong 0x44
->>>>>>>>0xB4 belong 4 core file
->>>>>>>>>0xA4 string >\0 from '%s'
->>>>>>>>>0xC4 belong 3 - received SIGQUIT
->>>>>>>>>0xC4 belong 4 - received SIGILL
->>>>>>>>>0xC4 belong 5 - received SIGTRAP
->>>>>>>>>0xC4 belong 6 - received SIGABRT
->>>>>>>>>0xC4 belong 7 - received SIGEMT
->>>>>>>>>0xC4 belong 8 - received SIGFPE
->>>>>>>>>0xC4 belong 10 - received SIGBUS
->>>>>>>>>0xC4 belong 11 - received SIGSEGV
->>>>>>>>>0xC4 belong 12 - received SIGSYS
->>>>>>>>>0xC4 belong 33 - received SIGXCPU
->>>>>>>>>0xC4 belong 34 - received SIGXFSZ
-# Order 3: FORMAT, KERNEL, EXEC, PROC
-0x24 string HP-UX
->0 belong 1
->>0xC belong 4
->>>0x10 belong 1
->>>>0x14 belong 2
->>>>>0x20 belong 0x3C
->>>>>>0x60 belong 0x100
->>>>>>>0x6C belong 0x44
->>>>>>>>0xB4 belong 4 core file
->>>>>>>>>0xA4 string >\0 from '%s'
->>>>>>>>>0xC4 belong 3 - received SIGQUIT
->>>>>>>>>0xC4 belong 4 - received SIGILL
->>>>>>>>>0xC4 belong 5 - received SIGTRAP
->>>>>>>>>0xC4 belong 6 - received SIGABRT
->>>>>>>>>0xC4 belong 7 - received SIGEMT
->>>>>>>>>0xC4 belong 8 - received SIGFPE
->>>>>>>>>0xC4 belong 10 - received SIGBUS
->>>>>>>>>0xC4 belong 11 - received SIGSEGV
->>>>>>>>>0xC4 belong 12 - received SIGSYS
->>>>>>>>>0xC4 belong 33 - received SIGXCPU
->>>>>>>>>0xC4 belong 34 - received SIGXFSZ
-# Order 4: EXEC, KERNEL, FORMAT, PROC
-0x64 string HP-UX
->0 belong 0x100
->>0xC belong 0x44
->>>0x54 belong 2
->>>>0x60 belong 0x3C
->>>>>0xA0 belong 1
->>>>>>0xAC belong 4
->>>>>>>0xB0 belong 1
->>>>>>>>0xB4 belong 4 core file
->>>>>>>>>0x44 string >\0 from '%s'
->>>>>>>>>0xC4 belong 3 - received SIGQUIT
->>>>>>>>>0xC4 belong 4 - received SIGILL
->>>>>>>>>0xC4 belong 5 - received SIGTRAP
->>>>>>>>>0xC4 belong 6 - received SIGABRT
->>>>>>>>>0xC4 belong 7 - received SIGEMT
->>>>>>>>>0xC4 belong 8 - received SIGFPE
->>>>>>>>>0xC4 belong 10 - received SIGBUS
->>>>>>>>>0xC4 belong 11 - received SIGSEGV
->>>>>>>>>0xC4 belong 12 - received SIGSYS
->>>>>>>>>0xC4 belong 33 - received SIGXCPU
->>>>>>>>>0xC4 belong 34 - received SIGXFSZ
-# Order 5: FORMAT, EXEC, KERNEL, PROC
-0x78 string HP-UX
->0 belong 1
->>0xC belong 4
->>>0x10 belong 1
->>>>0x14 belong 0x100
->>>>>0x20 belong 0x44
->>>>>>0x68 belong 2
->>>>>>>0x74 belong 0x3C
->>>>>>>>0xB4 belong 4 core file
->>>>>>>>>0x58 string >\0 from '%s'
->>>>>>>>>0xC4 belong 3 - received SIGQUIT
->>>>>>>>>0xC4 belong 4 - received SIGILL
->>>>>>>>>0xC4 belong 5 - received SIGTRAP
->>>>>>>>>0xC4 belong 6 - received SIGABRT
->>>>>>>>>0xC4 belong 7 - received SIGEMT
->>>>>>>>>0xC4 belong 8 - received SIGFPE
->>>>>>>>>0xC4 belong 10 - received SIGBUS
->>>>>>>>>0xC4 belong 11 - received SIGSEGV
->>>>>>>>>0xC4 belong 12 - received SIGSYS
->>>>>>>>>0xC4 belong 33 - received SIGXCPU
->>>>>>>>>0xC4 belong 34 - received SIGXFSZ
-# Order 6: EXEC, FORMAT, KERNEL, PROC
->0 belong 0x100
->>0xC belong 0x44
->>>0x54 belong 1
->>>>0x60 belong 4
->>>>>0x64 belong 1
->>>>>>0x68 belong 2
->>>>>>>0x74 belong 0x2C
->>>>>>>>0xB4 belong 4 core file
->>>>>>>>>0x44 string >\0 from '%s'
->>>>>>>>>0xC4 belong 3 - received SIGQUIT
->>>>>>>>>0xC4 belong 4 - received SIGILL
->>>>>>>>>0xC4 belong 5 - received SIGTRAP
->>>>>>>>>0xC4 belong 6 - received SIGABRT
->>>>>>>>>0xC4 belong 7 - received SIGEMT
->>>>>>>>>0xC4 belong 8 - received SIGFPE
->>>>>>>>>0xC4 belong 10 - received SIGBUS
->>>>>>>>>0xC4 belong 11 - received SIGSEGV
->>>>>>>>>0xC4 belong 12 - received SIGSYS
->>>>>>>>>0xC4 belong 33 - received SIGXCPU
->>>>>>>>>0xC4 belong 34 - received SIGXFSZ
-
-
-
-#------------------------------------------------------------------------------
-# human68k: file(1) magic for Human68k (X680x0 DOS) binary formats
-# Magic too short!
-#0 string HU Human68k
-#>68 string LZX LZX compressed
-#>>72 string >\0 (version %s)
-#>(8.L+74) string LZX LZX compressed
-#>>(8.L+78) string >\0 (version %s)
-#>60 belong >0 binded
-#>(8.L+66) string #HUPAIR hupair
-#>0 string HU X executable
-#>(8.L+74) string #LIBCV1 - linked PD LIBC ver 1
-#>4 belong >0 - base address 0x%x
-#>28 belong >0 not stripped
-#>32 belong >0 with debug information
-#0 beshort 0x601a Human68k Z executable
-#0 beshort 0x6000 Human68k object file
-#0 belong 0xd1000000 Human68k ar binary archive
-#0 belong 0xd1010000 Human68k ar ascii archive
-#0 beshort 0x0068 Human68k lib archive
-#4 string LZX Human68k LZX compressed
-#>8 string >\0 (version %s)
-#>4 string LZX R executable
-#2 string #HUPAIR Human68k hupair R executable
-
-#------------------------------------------------------------------------------
-# ibm370: file(1) magic for IBM 370 and compatibles.
-#
-# "ibm370" said that 0x15d == 0535 was "ibm 370 pure executable".
-# What the heck *is* "USS/370"?
-# AIX 4.1's "/etc/magic" has
-#
-# 0 short 0535 370 sysV executable
-# >12 long >0 not stripped
-# >22 short >0 - version %d
-# >30 long >0 - 5.2 format
-# 0 short 0530 370 sysV pure executable
-# >12 long >0 not stripped
-# >22 short >0 - version %d
-# >30 long >0 - 5.2 format
-#
-# instead of the "USS/370" versions of the same magic numbers.
-#
-0 beshort 0537 370 XA sysV executable
->12 belong >0 not stripped
->22 beshort >0 - version %d
->30 belong >0 - 5.2 format
-0 beshort 0532 370 XA sysV pure executable
->12 belong >0 not stripped
->22 beshort >0 - version %d
->30 belong >0 - 5.2 format
-0 beshort 054001 370 sysV pure executable
->12 belong >0 not stripped
-0 beshort 055001 370 XA sysV pure executable
->12 belong >0 not stripped
-0 beshort 056401 370 sysV executable
->12 belong >0 not stripped
-0 beshort 057401 370 XA sysV executable
->12 belong >0 not stripped
-0 beshort 0531 SVR2 executable (Amdahl-UTS)
->12 belong >0 not stripped
->24 belong >0 - version %ld
-0 beshort 0534 SVR2 pure executable (Amdahl-UTS)
->12 belong >0 not stripped
->24 belong >0 - version %ld
-0 beshort 0530 SVR2 pure executable (USS/370)
->12 belong >0 not stripped
->24 belong >0 - version %ld
-0 beshort 0535 SVR2 executable (USS/370)
->12 belong >0 not stripped
->24 belong >0 - version %ld
-
-#------------------------------------------------------------------------------
-# ibm6000: file(1) magic for RS/6000 and the RT PC.
-#
-0 beshort 0x01df executable (RISC System/6000 V3.1) or obj module
->12 belong >0 not stripped
-# Breaks sun4 statically linked execs.
-#0 beshort 0x0103 executable (RT Version 2) or obj module
-#>2 byte 0x50 pure
-#>28 belong >0 not stripped
-#>6 beshort >0 - version %ld
-0 beshort 0x0104 shared library
-0 beshort 0x0105 ctab data
-0 beshort 0xfe04 structured file
-0 string 0xabcdef AIX message catalog
-0 belong 0x000001f9 AIX compiled message catalog
-0 string \<aiaff> archive
-0 string \<bigaf> archive (big format)
-
-
-#------------------------------------------------------------------------------
-# iff: file(1) magic for Interchange File Format (see also "audio" & "images")
-#
-# Daniel Quinlan (quinlan@yggdrasil.com) -- IFF was designed by Electronic
-# Arts for file interchange. It has also been used by Apple, SGI, and
-# especially Commodore-Amiga.
-#
-# IFF files begin with an 8 byte FORM header, followed by a 4 character
-# FORM type, which is followed by the first chunk in the FORM.
-
-0 string FORM IFF data
-#>4 belong x \b, FORM is %d bytes long
-# audio formats
->8 string AIFF \b, AIFF audio
-!:mime audio/x-aiff
->8 string AIFC \b, AIFF-C compressed audio
-!:mime audio/x-aiff
->8 string 8SVX \b, 8SVX 8-bit sampled sound voice
-!:mime audio/x-aiff
->8 string 16SV \b, 16SV 16-bit sampled sound voice
->8 string SAMP \b, SAMP sampled audio
->8 string MAUD \b, MAUD MacroSystem audio
->8 string SMUS \b, SMUS simple music
->8 string CMUS \b, CMUS complex music
-# image formats
->8 string ILBMBMHD \b, ILBM interleaved image
->>20 beshort x \b, %d x
->>22 beshort x %d
->8 string RGBN \b, RGBN 12-bit RGB image
->8 string RGB8 \b, RGB8 24-bit RGB image
->8 string DEEP \b, DEEP TVPaint/XiPaint image
->8 string DR2D \b, DR2D 2-D object
->8 string TDDD \b, TDDD 3-D rendering
->8 string LWOB \b, LWOB 3-D object
->8 string LWO2 \b, LWO2 3-D object, v2
->8 string LWLO \b, LWLO 3-D layered object
->8 string REAL \b, REAL Real3D rendering
->8 string MC4D \b, MC4D MaxonCinema4D rendering
->8 string ANIM \b, ANIM animation
->8 string YAFA \b, YAFA animation
->8 string SSA\ \b, SSA super smooth animation
->8 string ACBM \b, ACBM continuous image
->8 string FAXX \b, FAXX fax image
-# other formats
->8 string FTXT \b, FTXT formatted text
->8 string CTLG \b, CTLG message catalog
->8 string PREF \b, PREF preferences
->8 string DTYP \b, DTYP datatype description
->8 string PTCH \b, PTCH binary patch
->8 string AMFF \b, AMFF AmigaMetaFile format
->8 string WZRD \b, WZRD StormWIZARD resource
->8 string DOC\ \b, DOC desktop publishing document
-
-# These go at the end of the iff rules
-#
-# I don't see why these might collide with anything else.
-#
-# Interactive Fiction related formats
-#
->8 string IFRS \b, Blorb Interactive Fiction
->>24 string Exec with executable chunk
->8 string IFZS \b, Z-machine or Glulx saved game file (Quetzal)
-#------------------------------------------------------------------------------
-# images: file(1) magic for image formats (see also "iff", and "c-lang" for
-# XPM bitmaps)
-#
-# originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
-# additions by janl@ifi.uio.no as well as others. Jan also suggested
-# merging several one- and two-line files into here.
-#
-# little magic: PCX (first byte is 0x0a)
-
-# Targa - matches `povray', `ppmtotga' and `xv' outputs
-# by Philippe De Muyter <phdm@macqel.be>
-# at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11
-# at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise
-# at 3, leshort Index is 0 for povray, ppmtotga and xv outputs
-# `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
-# `tgatoppm' recognizes a superset (Index may be anything)
-1 belong&0xfff7ffff 0x01010000 Targa image data - Map
->2 byte&8 8 - RLE
->12 leshort >0 %hd x
->14 leshort >0 %hd
-1 belong&0xfff7ffff 0x00020000 Targa image data - RGB
->2 byte&8 8 - RLE
->12 leshort >0 %hd x
->14 leshort >0 %hd
-1 belong&0xfff7ffff 0x00030000 Targa image data - Mono
->2 byte&8 8 - RLE
->12 leshort >0 %hd x
->14 leshort >0 %hd
-
-# PBMPLUS images
-# The next byte following the magic is always whitespace.
-0 search/1 P1 Netpbm PBM image text
-!:mime image/x-portable-bitmap
-0 search/1 P2 Netpbm PGM image text
-!:mime image/x-portable-greymap
-0 search/1 P3 Netpbm PPM image text
-!:mime image/x-portable-pixmap
-0 string P4 Netpbm PBM "rawbits" image data
-!:mime image/x-portable-bitmap
-0 string P5 Netpbm PGM "rawbits" image data
-!:mime image/x-portable-greymap
-0 string P6 Netpbm PPM "rawbits" image data
-!:mime image/x-portable-pixmap
-0 string P7 Netpbm PAM image file
-!:mime image/x-portable-pixmap
-
-# From: bryanh@giraffe-data.com (Bryan Henderson)
-0 string \117\072 Solitaire Image Recorder format
->4 string \013 MGI Type 11
->4 string \021 MGI Type 17
-0 string .MDA MicroDesign data
->21 byte 48 version 2
->21 byte 51 version 3
-0 string .MDP MicroDesign page data
->21 byte 48 version 2
->21 byte 51 version 3
-
-# NIFF (Navy Interchange File Format, a modification of TIFF) images
-# [GRR: this *must* go before TIFF]
-0 string IIN1 NIFF image data
-!:mime image/x-niff
-
-# Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
-# The second word of TIFF files is the TIFF version number, 42, which has
-# never changed. The TIFF specification recommends testing for it.
-0 string MM\x00\x2a TIFF image data, big-endian
-!:mime image/tiff
-0 string II\x2a\x00 TIFF image data, little-endian
-!:mime image/tiff
-
-# PNG [Portable Network Graphics, or "PNG's Not GIF"] images
-# (Greg Roelofs, newt@uchicago.edu)
-# (Albert Cahalan, acahalan@cs.uml.edu)
-#
-# 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
-#
-0 string \x89PNG\x0d\x0a\x1a\x0a PNG image
-!:mime image/png
->16 belong x \b, %ld x
->20 belong x %ld,
->24 byte x %d-bit
->25 byte 0 grayscale,
->25 byte 2 \b/color RGB,
->25 byte 3 colormap,
->25 byte 4 gray+alpha,
->25 byte 6 \b/color RGBA,
-#>26 byte 0 deflate/32K,
->28 byte 0 non-interlaced
->28 byte 1 interlaced
-
-# possible GIF replacements; none yet released!
-# (Greg Roelofs, newt@uchicago.edu)
-#
-# GRR 950115: this was mine ("Zip GIF"):
-0 string GIF94z ZIF image (GIF+deflate alpha)
-!:mime image/x-unknown
-#
-# GRR 950115: this is Jeremy Wohl's Free Graphics Format (better):
-#
-0 string FGF95a FGF image (GIF+deflate beta)
-!:mime image/x-unknown
-#
-# GRR 950115: this is Thomas Boutell's Portable Bitmap Format proposal
-# (best; not yet implemented):
-#
-0 string PBF PBF image (deflate compression)
-!:mime image/x-unknown
-
-# GIF
-0 string GIF8 GIF image data
-!:mime image/gif
-!:apple 8BIMGIFf
->4 string 7a \b, version 8%s,
->4 string 9a \b, version 8%s,
->6 leshort >0 %hd x
->8 leshort >0 %hd
-#>10 byte &0x80 color mapped,
-#>10 byte&0x07 =0x00 2 colors
-#>10 byte&0x07 =0x01 4 colors
-#>10 byte&0x07 =0x02 8 colors
-#>10 byte&0x07 =0x03 16 colors
-#>10 byte&0x07 =0x04 32 colors
-#>10 byte&0x07 =0x05 64 colors
-#>10 byte&0x07 =0x06 128 colors
-#>10 byte&0x07 =0x07 256 colors
-
-# ITC (CMU WM) raster files. It is essentially a byte-reversed Sun raster,
-# 1 plane, no encoding.
-0 string \361\0\100\273 CMU window manager raster image data
->4 lelong >0 %d x
->8 lelong >0 %d,
->12 lelong >0 %d-bit
-
-# Magick Image File Format
-0 string id=ImageMagick MIFF image data
-
-# Artisan
-0 long 1123028772 Artisan image data
->4 long 1 \b, rectangular 24-bit
->4 long 2 \b, rectangular 8-bit with colormap
->4 long 3 \b, rectangular 32-bit (24-bit with matte)
-
-# FIG (Facility for Interactive Generation of figures), an object-based format
-0 search/1 #FIG FIG image text
->5 string x \b, version %.3s
-
-# PHIGS
-0 string ARF_BEGARF PHIGS clear text archive
-0 string @(#)SunPHIGS SunPHIGS
-# version number follows, in the form m.n
->40 string SunBin binary
->32 string archive archive
-
-# GKS (Graphics Kernel System)
-0 string GKSM GKS Metafile
->24 string SunGKS \b, SunGKS
-
-# CGM image files
-0 string BEGMF clear text Computer Graphics Metafile
-
-# MGR bitmaps (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
-0 string yz MGR bitmap, modern format, 8-bit aligned
-0 string zz MGR bitmap, old format, 1-bit deep, 16-bit aligned
-0 string xz MGR bitmap, old format, 1-bit deep, 32-bit aligned
-0 string yx MGR bitmap, modern format, squeezed
-
-# Fuzzy Bitmap (FBM) images
-0 string %bitmap\0 FBM image data
->30 long 0x31 \b, mono
->30 long 0x33 \b, color
-
-# facsimile data
-1 string PC\ Research,\ Inc group 3 fax data
->29 byte 0 \b, normal resolution (204x98 DPI)
->29 byte 1 \b, fine resolution (204x196 DPI)
-# From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
-0 string Sfff structured fax file
-
-
-# PC bitmaps (OS/2, Windows BMP files) (Greg Roelofs, newt@uchicago.edu)
-0 string BM
->14 leshort 12 PC bitmap, OS/2 1.x format
-!:mime image/x-ms-bmp
->>18 leshort x \b, %d x
->>20 leshort x %d
->14 leshort 64 PC bitmap, OS/2 2.x format
-!:mime image/x-ms-bmp
->>18 leshort x \b, %d x
->>20 leshort x %d
->14 leshort 40 PC bitmap, Windows 3.x format
-!:mime image/x-ms-bmp
->>18 lelong x \b, %d x
->>22 lelong x %d x
->>28 leshort x %d
->14 leshort 128 PC bitmap, Windows NT/2000 format
-!:mime image/x-ms-bmp
->>18 lelong x \b, %d x
->>22 lelong x %d x
->>28 leshort x %d
-# Too simple - MPi
-#0 string IC PC icon data
-#0 string PI PC pointer image data
-#0 string CI PC color icon data
-#0 string CP PC color pointer image data
-# Conflicts with other entries [BABYL]
-#0 string BA PC bitmap array data
-
-# XPM icons (Greg Roelofs, newt@uchicago.edu)
-# note possible collision with C/REXX entry in c-lang; currently commented out
-0 search/1 /*\ XPM\ */ X pixmap image text
-
-# Utah Raster Toolkit RLE images (janl@ifi.uio.no)
-0 leshort 0xcc52 RLE image data,
->6 leshort x %d x
->8 leshort x %d
->2 leshort >0 \b, lower left corner: %d
->4 leshort >0 \b, lower right corner: %d
->10 byte&0x1 =0x1 \b, clear first
->10 byte&0x2 =0x2 \b, no background
->10 byte&0x4 =0x4 \b, alpha channel
->10 byte&0x8 =0x8 \b, comment
->11 byte >0 \b, %d color channels
->12 byte >0 \b, %d bits per pixel
->13 byte >0 \b, %d color map channels
-
-# image file format (Robert Potter, potter@cs.rochester.edu)
-0 string Imagefile\ version- iff image data
-# this adds the whole header (inc. version number), informative but longish
->10 string >\0 %s
-
-# Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
-0 belong 0x59a66a95 Sun raster image data
->4 belong >0 \b, %d x
->8 belong >0 %d,
->12 belong >0 %d-bit,
-#>16 belong >0 %d bytes long,
->20 belong 0 old format,
-#>20 belong 1 standard,
->20 belong 2 compressed,
->20 belong 3 RGB,
->20 belong 4 TIFF,
->20 belong 5 IFF,
->20 belong 0xffff reserved for testing,
->24 belong 0 no colormap
->24 belong 1 RGB colormap
->24 belong 2 raw colormap
-#>28 belong >0 colormap is %d bytes long
-
-# SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
-#
-# See
-# http://reality.sgi.com/grafica/sgiimage.html
-#
-0 beshort 474 SGI image data
-#>2 byte 0 \b, verbatim
->2 byte 1 \b, RLE
-#>3 byte 1 \b, normal precision
->3 byte 2 \b, high precision
->4 beshort x \b, %d-D
->6 beshort x \b, %d x
->8 beshort x %d
->10 beshort x \b, %d channel
->10 beshort !1 \bs
->80 string >0 \b, "%s"
-
-0 string IT01 FIT image data
->4 belong x \b, %d x
->8 belong x %d x
->12 belong x %d
-#
-0 string IT02 FIT image data
->4 belong x \b, %d x
->8 belong x %d x
->12 belong x %d
-#
-2048 string PCD_IPI Kodak Photo CD image pack file
->0xe02 byte&0x03 0x00 , landscape mode
->0xe02 byte&0x03 0x01 , portrait mode
->0xe02 byte&0x03 0x02 , landscape mode
->0xe02 byte&0x03 0x03 , portrait mode
-0 string PCD_OPA Kodak Photo CD overview pack file
-
-# FITS format. Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
-# FITS is the Flexible Image Transport System, the de facto standard for
-# data and image transfer, storage, etc., for the astronomical community.
-# (FITS floating point formats are big-endian.)
-0 string SIMPLE\ \ = FITS image data
->109 string 8 \b, 8-bit, character or unsigned binary integer
->108 string 16 \b, 16-bit, two's complement binary integer
->107 string \ 32 \b, 32-bit, two's complement binary integer
->107 string -32 \b, 32-bit, floating point, single precision
->107 string -64 \b, 64-bit, floating point, double precision
-
-# other images
-0 string This\ is\ a\ BitMap\ file Lisp Machine bit-array-file
-
-# From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
-# stuff.
-#
-0 beshort 0x1010 PEX Binary Archive
-
-# DICOM medical imaging data
-128 string DICM DICOM medical imaging data
-!:mime application/dicom
-
-# XWD - X Window Dump file.
-# As described in /usr/X11R6/include/X11/XWDFile.h
-# used by the xwd program.
-# Bradford Castalia, idaeim, 1/01
-# updated by Adam Buchbinder, 2/09
-# The following assumes version 7 of the format; the first long is the length
-# of the header, which is at least 25 4-byte longs, and the one at offset 8
-# is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
-# which is a maximum of 32.
-0 belong >100
->8 belong <3
->>12 belong <33
->>>4 belong 7 XWD X Window Dump image data
-!:mime image/x-xwindowdump
->>>>100 string >\0 \b, "%s"
->>>>16 belong x \b, %dx
->>>>20 belong x \b%dx
->>>>12 belong x \b%d
-
-# PDS - Planetary Data System
-# These files use Parameter Value Language in the header section.
-# Unfortunately, there is no certain magic, but the following
-# strings have been found to be most likely.
-0 string NJPL1I00 PDS (JPL) image data
-2 string NJPL1I PDS (JPL) image data
-0 string CCSD3ZF PDS (CCSD) image data
-2 string CCSD3Z PDS (CCSD) image data
-0 string PDS_ PDS image data
-0 string LBLSIZE= PDS (VICAR) image data
-
-# pM8x: ATARI STAD compressed bitmap format
-#
-# from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
-# p M 8 5/6 xx yy zz data...
-# Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
-# bytes either run horizontally (pM85) or vertically (pM86). yy is the
-# most frequent byte, xx and zz are runlength escape codes, where xx is
-# used for runs of yy.
-#
-0 string pM85 Atari ST STAD bitmap image data (hor)
->5 byte 0x00 (white background)
->5 byte 0xFF (black background)
-0 string pM86 Atari ST STAD bitmap image data (vert)
->5 byte 0x00 (white background)
->5 byte 0xFF (black background)
-
-# Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
-# http://www.atarimax.com/jindroush.atari.org/afmtatr.html
-0 leshort 0x0296 Atari ATR image
-
-# XXX:
-# This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
-# magic.
-# SGI RICE image file <mpruett@sgi.com>
-#0 beshort 0x5249 RICE image
-#>2 beshort x v%d
-#>4 beshort x (%d x
-#>6 beshort x %d)
-#>8 beshort 0 8 bit
-#>8 beshort 1 10 bit
-#>8 beshort 2 12 bit
-#>8 beshort 3 13 bit
-#>10 beshort 0 4:2:2
-#>10 beshort 1 4:2:2:4
-#>10 beshort 2 4:4:4
-#>10 beshort 3 4:4:4:4
-#>12 beshort 1 RGB
-#>12 beshort 2 CCIR601
-#>12 beshort 3 RP175
-#>12 beshort 4 YUV
-
-#------------------------------------------------------------------------------
-#
-# Marco Schmidt (marcoschmidt@users.sourceforge.net) -- an image file format
-# for the EPOC operating system, which is used with PDAs like those from Psion
-#
-# see http://huizen.dds.nl/~frodol/psiconv/html/Index.html for a description
-# of various EPOC file formats
-
-0 string \x37\x00\x00\x10\x42\x00\x00\x10\x00\x00\x00\x00\x39\x64\x39\x47 EPOC MBM image file
-
-# PCX image files
-# From: Dan Fandrich <dan@coneharvesters.com>
-0 beshort 0x0a00 PCX ver. 2.5 image data
-0 beshort 0x0a02 PCX ver. 2.8 image data, with palette
-0 beshort 0x0a03 PCX ver. 2.8 image data, without palette
-0 beshort 0x0a04 PCX for Windows image data
-0 beshort 0x0a05 PCX ver. 3.0 image data
->4 leshort x bounding box [%hd,
->6 leshort x %hd] -
->8 leshort x [%hd,
->10 leshort x %hd],
->65 byte >1 %d planes each of
->3 byte x %hhd-bit
->68 byte 0 image,
->68 byte 1 colour,
->68 byte 2 grayscale,
->68 byte >2 image,
->68 byte <0 image,
->12 leshort >0 %hd x
->>14 leshort x %hd dpi,
->2 byte 0 uncompressed
->2 byte 1 RLE compressed
-
-# Adobe Photoshop
-0 string 8BPS Adobe Photoshop Image
-!:mime image/vnd.adobe.photoshop
-
-# XV thumbnail indicator (ThMO)
-0 string P7\ 332 XV thumbnail image data
-
-# NITF is defined by United States MIL-STD-2500A
-0 string NITF National Imagery Transmission Format
->25 string >\0 dated %.14s
-
-# GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
-0 belong 0x00010008 GEM Image data
->12 beshort x %d x
->14 beshort x %d,
->4 beshort x %d planes,
->8 beshort x %d x
->10 beshort x %d pixelsize
-
-# GEM Metafile (Wolfram Kleff)
-0 lelong 0x0018FFFF GEM Metafile data
->4 leshort x version %d
-
-#
-# SMJPEG. A custom Motion JPEG format used by Loki Entertainment
-# Software Torbjorn Andersson <d91tan@Update.UU.SE>.
-#
-0 string \0\nSMJPEG SMJPEG
->8 belong x %d.x data
-# According to the specification you could find any number of _TXT
-# headers here, but I can't think of any way of handling that. None of
-# the SMJPEG files I tried it on used this feature. Even if such a
-# file is encountered the output should still be reasonable.
->16 string _SND \b,
->>24 beshort >0 %d Hz
->>26 byte 8 8-bit
->>26 byte 16 16-bit
->>28 string NONE uncompressed
-# >>28 string APCM ADPCM compressed
->>27 byte 1 mono
->>28 byte 2 stereo
-# Help! Isn't there any way to avoid writing this part twice?
->>32 string _VID \b,
-# >>>48 string JFIF JPEG
->>>40 belong >0 %d frames
->>>44 beshort >0 (%d x
->>>46 beshort >0 %d)
->16 string _VID \b,
-# >>32 string JFIF JPEG
->>24 belong >0 %d frames
->>28 beshort >0 (%d x
->>30 beshort >0 %d)
-
-0 string Paint\ Shop\ Pro\ Image\ File Paint Shop Pro Image File
-
-# "thumbnail file" (icon)
-# descended from "xv", but in use by other applications as well (Wolfram Kleff)
-0 string P7\ 332 XV "thumbnail file" (icon) data
-
-# taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
-0 string KiSS KISS/GS
->4 byte 16 color
->>5 byte x %d bit
->>8 leshort x %d colors
->>10 leshort x %d groups
->4 byte 32 cell
->>5 byte x %d bit
->>8 leshort x %d x
->>10 leshort x %d
->>12 leshort x +%d
->>14 leshort x +%d
-
-# Webshots (www.webshots.com), by John Harrison
-0 string C\253\221g\230\0\0\0 Webshots Desktop .wbz file
-
-# Hercules DASD image files
-# From Jan Jaeger <jj@septa.nl>
-0 string CKD_P370 Hercules CKD DASD image file
->8 long x \b, %d heads per cylinder
->12 long x \b, track size %d bytes
->16 byte x \b, device type 33%2.2X
-
-0 string CKD_C370 Hercules compressed CKD DASD image file
->8 long x \b, %d heads per cylinder
->12 long x \b, track size %d bytes
->16 byte x \b, device type 33%2.2X
-
-0 string CKD_S370 Hercules CKD DASD shadow file
->8 long x \b, %d heads per cylinder
->12 long x \b, track size %d bytes
->16 byte x \b, device type 33%2.2X
-
-# Squeak images and programs - etoffi@softhome.net
-0 string \146\031\0\0 Squeak image data
-0 search/1 'From\040Squeak Squeak program text
-
-# partimage: file(1) magic for PartImage files (experimental, incomplete)
-# Author: Hans-Joachim Baader <hjb@pro-linux.de>
-0 string PaRtImAgE-VoLuMe PartImage
->0x0020 string 0.6.1 file version %s
->>0x0060 lelong >-1 volume %ld
-#>>0x0064 8 byte identifier
-#>>0x007c reserved
->>0x0200 string >\0 type %s
->>0x1400 string >\0 device %s,
->>0x1600 string >\0 original filename %s,
-# Some fields omitted
->>0x2744 lelong 0 not compressed
->>0x2744 lelong 1 gzip compressed
->>0x2744 lelong 2 bzip2 compressed
->>0x2744 lelong >2 compressed with unknown algorithm
->0x0020 string >0.6.1 file version %s
->0x0020 string <0.6.1 file version %s
-
-# DCX is multi-page PCX, using a simple header of up to 1024
-# offsets for the respective PCX components.
-# From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
-0 lelong 987654321 DCX multi-page PCX image data
-
-# Simon Walton <simonw@matteworld.com>
-# Kodak Cineon format for scanned negatives
-# http://www.kodak.com/US/en/motion/support/dlad/
-0 lelong 0xd75f2a80 Cineon image data
->200 belong >0 \b, %ld x
->204 belong >0 %ld
-
-
-# Bio-Rad .PIC is an image format used by microscope control systems
-# and related image processing software used by biologists.
-# From: Vebjorn Ljosa <vebjorn@ljosa.com>
-54 leshort 12345 Bio-Rad .PIC Image File
->0 leshort >0 %hd x
->2 leshort >0 %hd,
->4 leshort =1 1 image in file
->4 leshort >1 %hd images in file
-
-# From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
-# The description of *.mrw format can be found at
-# http://www.dalibor.cz/minolta/raw_file_format.htm
-0 string \000MRM Minolta Dimage camera raw image data
-
-# Summary: DjVu image / document
-# Extension: .djvu
-# Reference: http://djvu.org/docs/DjVu3Spec.djvu
-# Submitted by: Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
-# Modified by (1): Abel Cheung <abelcheung@gmail.com>
-0 string AT&TFORM
-!:mime image/vnd.djvu
->12 string DJVM DjVu multiple page document
->12 string DJVU DjVu image or single page document
->12 string DJVI DjVu shared document
->12 string THUM DjVu page thumbnails
-
-
-# From Marc Espie
-0 lelong 20000630 OpenEXR image data
-
-# From: Tom Hilinski <tom.hilinski@comcast.net>
-# http://www.unidata.ucar.edu/packages/netcdf/
-0 string CDF\001 NetCDF Data Format data
-
-#-----------------------------------------------------------------------
-# Hierarchical Data Format, used to facilitate scientific data exchange
-# specifications at http://hdf.ncsa.uiuc.edu/
-0 belong 0x0e031301 Hierarchical Data Format (version 4) data
-!:mime application/x-hdf
-0 string \211HDF\r\n\032 Hierarchical Data Format (version 5) data
-!:mime application/x-hdf
-
-# From: Tobias Burnus <burnus@net-b.de>
-# Xara (for a while: Corel Xara) is a graphic package, see
-# http://www.xara.com/ for Windows and as GPL application for Linux
-0 string XARA\243\243 Xara graphics file
-
-# http://www.cartesianinc.com/Tech/
-0 string CPC\262 Cartesian Perceptual Compression image
-!:mime image/x-cpi
-
-# From Albert Cahalan <acahalan@gmail.com>
-# puredigital used it for the CVS disposable camcorder
-#8 lelong 4 ZBM bitmap image data
-#>4 leshort x %u x
-#>6 leshort x %u
-
-# From Albert Cahalan <acahalan@gmail.com>
-# uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
-0 string C565 OLPC firmware icon image data
->4 leshort x %u x
->6 leshort x %u
-
-# Applied Images - Image files from Cytovision
-# Gustavo Junior Alves <gjalves@gjalves.com.br>
-0 string \xce\xda\xde\xfa Cytovision Metaphases file
-0 string \xed\xad\xef\xac Cytovision Karyotype file
-0 string \x0b\x00\x03\x00 Cytovision FISH Probe file
-0 string \xed\xfe\xda\xbe Cytovision FLEX file
-0 string \xed\xab\xed\xfe Cytovision FLEX file
-0 string \xad\xfd\xea\xad Cytovision RATS file
-
-# Wavelet Scalar Quantization format used in gray-scale fingerprint images
-# From Tano M Fotang <mfotang@quanteq.com>
-0 string \xff\xa0\xff\xa8\x00 Wavelet Scalar Quantization image data
-
-# JPEG 2000 Code Stream Bitmap
-# From Petr Splichal <psplicha@redhat.com>
-0 string \xFF\x4F\xFF\x51\x00 JPEG-2000 Code Stream Bitmap data
-
-# Type: Ulead Photo Explorer5 (.pe5)
-# URL: http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
-# From: Simon Horman <horms@debian.org>
-0 string IIO2H Ulead Photo Explorer5
-
-# Type: X11 cursor
-# URL: http://webcvs.freedesktop.org/mime/shared-mime-info/freedesktop.org.xml.in?view=markup
-# From: Mathias Brodala <info@noctus.net>
-0 string Xcur X11 cursor
-
-#------------------------------------------------------------------------------
-# inform: file(1) magic for Inform interactive fiction language
-
-# URL: http://www.inform-fiction.org/
-# From: Reuben Thomas <rrt@sc3d.org>
-
-0 search/cB/100 constant\ story Inform source text
-
-#------------------------------------------------------------------------------
-# intel: file(1) magic for x86 Unix
-#
-# Various flavors of x86 UNIX executable/object (other than Xenix, which
-# is in "microsoft"). DOS is in "msdos"; the ambitious soul can do
-# Windows as well.
-#
-# Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and
-# whatever comes next (HP-PA Hummingbird?). OS/2 may also go elsewhere
-# as well, if, as, and when IBM makes it portable.
-#
-# The `versions' should be un-commented if they work for you.
-# (Was the problem just one of endianness?)
-#
-0 leshort 0502 basic-16 executable
->12 lelong >0 not stripped
-#>22 leshort >0 - version %ld
-0 leshort 0503 basic-16 executable (TV)
->12 lelong >0 not stripped
-#>22 leshort >0 - version %ld
-0 leshort 0510 x86 executable
->12 lelong >0 not stripped
-0 leshort 0511 x86 executable (TV)
->12 lelong >0 not stripped
-0 leshort =0512 iAPX 286 executable small model (COFF)
->12 lelong >0 not stripped
-#>22 leshort >0 - version %ld
-0 leshort =0522 iAPX 286 executable large model (COFF)
->12 lelong >0 not stripped
-#>22 leshort >0 - version %ld
-# SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan
-0 leshort =0514 80386 COFF executable
->12 lelong >0 not stripped
->22 leshort >0 - version %ld
-
-# rom: file(1) magic for BIOS ROM Extensions found in intel machines
-# mapped into memory between 0xC0000 and 0xFFFFF
-# From Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
-0 beshort 0x55AA BIOS (ia32) ROM Ext.
->5 string USB USB
->7 string LDR UNDI image
->30 string IBM IBM comp. Video
->26 string Adaptec Adaptec
->28 string Adaptec Adaptec
->42 string PROMISE Promise
->2 byte x (%d*512)
-
-#------------------------------------------------------------------------------
-# interleaf: file(1) magic for InterLeaf TPS:
-#
-0 string =\210OPS Interleaf saved data
-0 string =<!OPS Interleaf document text
->5 string ,\ Version\ = \b, version
->>17 string >\0 %.3s
-
-#------------------------------------------------------------------------------
-# island: file(1) magic for IslandWite/IslandDraw, from SunOS 5.5.1
-# "/etc/magic":
-# From: guy@netapp.com (Guy Harris)
-#
-4 string pgscriptver IslandWrite document
-13 string DrawFile IslandDraw document
-
-
-#------------------------------------------------------------------------------
-# ispell: file(1) magic for ispell
-#
-# Ispell 3.0 has a magic of 0x9601 and ispell 3.1 has 0x9602. This magic
-# will match 0x9600 through 0x9603 in *both* little endian and big endian.
-# (No other current magic entries collide.)
-#
-# Updated by Daniel Quinlan (quinlan@yggdrasil.com)
-#
-0 leshort&0xFFFC 0x9600 little endian ispell
->0 byte 0 hash file (?),
->0 byte 1 3.0 hash file,
->0 byte 2 3.1 hash file,
->0 byte 3 hash file (?),
->2 leshort 0x00 8-bit, no capitalization, 26 flags
->2 leshort 0x01 7-bit, no capitalization, 26 flags
->2 leshort 0x02 8-bit, capitalization, 26 flags
->2 leshort 0x03 7-bit, capitalization, 26 flags
->2 leshort 0x04 8-bit, no capitalization, 52 flags
->2 leshort 0x05 7-bit, no capitalization, 52 flags
->2 leshort 0x06 8-bit, capitalization, 52 flags
->2 leshort 0x07 7-bit, capitalization, 52 flags
->2 leshort 0x08 8-bit, no capitalization, 128 flags
->2 leshort 0x09 7-bit, no capitalization, 128 flags
->2 leshort 0x0A 8-bit, capitalization, 128 flags
->2 leshort 0x0B 7-bit, capitalization, 128 flags
->2 leshort 0x0C 8-bit, no capitalization, 256 flags
->2 leshort 0x0D 7-bit, no capitalization, 256 flags
->2 leshort 0x0E 8-bit, capitalization, 256 flags
->2 leshort 0x0F 7-bit, capitalization, 256 flags
->4 leshort >0 and %d string characters
-0 beshort&0xFFFC 0x9600 big endian ispell
->1 byte 0 hash file (?),
->1 byte 1 3.0 hash file,
->1 byte 2 3.1 hash file,
->1 byte 3 hash file (?),
->2 beshort 0x00 8-bit, no capitalization, 26 flags
->2 beshort 0x01 7-bit, no capitalization, 26 flags
->2 beshort 0x02 8-bit, capitalization, 26 flags
->2 beshort 0x03 7-bit, capitalization, 26 flags
->2 beshort 0x04 8-bit, no capitalization, 52 flags
->2 beshort 0x05 7-bit, no capitalization, 52 flags
->2 beshort 0x06 8-bit, capitalization, 52 flags
->2 beshort 0x07 7-bit, capitalization, 52 flags
->2 beshort 0x08 8-bit, no capitalization, 128 flags
->2 beshort 0x09 7-bit, no capitalization, 128 flags
->2 beshort 0x0A 8-bit, capitalization, 128 flags
->2 beshort 0x0B 7-bit, capitalization, 128 flags
->2 beshort 0x0C 8-bit, no capitalization, 256 flags
->2 beshort 0x0D 7-bit, no capitalization, 256 flags
->2 beshort 0x0E 8-bit, capitalization, 256 flags
->2 beshort 0x0F 7-bit, capitalization, 256 flags
->4 beshort >0 and %d string characters
-# ispell 4.0 hash files kromJx <kromJx@crosswinds.net>
-# Ispell 4.0
-0 string ISPL ispell
->4 long x hash file version %d,
->8 long x lexletters %d,
->12 long x lexsize %d,
->16 long x hashsize %d,
->20 long x stblsize %d
-#------------------------------------------------------------
-# Java ByteCode and Mach-O binaries (e.g., Mac OS X) use the
-# same magic number, 0xcafebabe, so they are both handled
-# in the entry called "cafebabe".
-#------------------------------------------------------------
-# Java serialization
-# From Martin Pool (m.pool@pharos.com.au)
-0 beshort 0xaced Java serialization data
->2 beshort >0x0004 \b, version %d
-
-0 belong 0xfeedfeed Java KeyStore
-!:mime application/x-java-keystore
-0 belong 0xcececece Java JCE KeyStore
-!:mime application/x-java-jce-keystore
-
-# Dalvik .dex format. http://retrodev.com/android/dexformat.html
-# From <mkf@google.com> "Mike Fleming"
-0 string dex\n
->0 regex dex\n[0-9][0-9][0-9]\0 Dalvik dex file
->4 string >000 version %s
-0 string dey\n
->0 regex dey\n[0-9][0-9][0-9]\0 Dalvik dex file (optimized for host)
->4 string >000 version %s
-
-
-#------------------------------------------------------------------------------
-# JPEG images
-# SunOS 5.5.1 had
-#
-# 0 string \377\330\377\340 JPEG file
-# 0 string \377\330\377\356 JPG file
-#
-# both of which turn into "JPEG image data" here.
-#
-0 beshort 0xffd8 JPEG image data
-!:mime image/jpeg
-!:apple 8BIMJPEG
-!:strength +1
->6 string JFIF \b, JFIF standard
-# The following added by Erik Rossen <rossen@freesurf.ch> 1999-09-06
-# in a vain attempt to add image size reporting for JFIF. Note that these
-# tests are not fool-proof since some perfectly valid JPEGs are currently
-# impossible to specify in magic(4) format.
-# First, a little JFIF version info:
->>11 byte x \b %d.
->>12 byte x \b%02d
-# Next, the resolution or aspect ratio of the image:
-#>>13 byte 0 \b, aspect ratio
-#>>13 byte 1 \b, resolution (DPI)
-#>>13 byte 2 \b, resolution (DPCM)
-#>>4 beshort x \b, segment length %d
-# Next, show thumbnail info, if it exists:
->>18 byte !0 \b, thumbnail %dx
->>>19 byte x \b%d
-
-# EXIF moved down here to avoid reporting a bogus version number,
-# and EXIF version number printing added.
-# - Patrik R=E5dman <patrik+file-magic@iki.fi>
->6 string Exif \b, EXIF standard
-# Look for EXIF IFD offset in IFD 0, and then look for EXIF version tag in EXIF IFD.
-# All possible combinations of entries have to be enumerated, since no looping
-# is possible. And both endians are possible...
-# The combinations included below are from real-world JPEGs.
-# Little-endian
->>12 string II
-# IFD 0 Entry #5:
->>>70 leshort 0x8769
-# EXIF IFD Entry #1:
->>>>(78.l+14) leshort 0x9000
->>>>>(78.l+23) byte x %c
->>>>>(78.l+24) byte x \b.%c
->>>>>(78.l+25) byte !0x30 \b%c
-# IFD 0 Entry #9:
->>>118 leshort 0x8769
-# EXIF IFD Entry #3:
->>>>(126.l+38) leshort 0x9000
->>>>>(126.l+47) byte x %c
->>>>>(126.l+48) byte x \b.%c
->>>>>(126.l+49) byte !0x30 \b%c
-# IFD 0 Entry #10
->>>130 leshort 0x8769
-# EXIF IFD Entry #3:
->>>>(138.l+38) leshort 0x9000
->>>>>(138.l+47) byte x %c
->>>>>(138.l+48) byte x \b.%c
->>>>>(138.l+49) byte !0x30 \b%c
-# EXIF IFD Entry #4:
->>>>(138.l+50) leshort 0x9000
->>>>>(138.l+59) byte x %c
->>>>>(138.l+60) byte x \b.%c
->>>>>(138.l+61) byte !0x30 \b%c
-# EXIF IFD Entry #5:
->>>>(138.l+62) leshort 0x9000
->>>>>(138.l+71) byte x %c
->>>>>(138.l+72) byte x \b.%c
->>>>>(138.l+73) byte !0x30 \b%c
-# IFD 0 Entry #11
->>>142 leshort 0x8769
-# EXIF IFD Entry #3:
->>>>(150.l+38) leshort 0x9000
->>>>>(150.l+47) byte x %c
->>>>>(150.l+48) byte x \b.%c
->>>>>(150.l+49) byte !0x30 \b%c
-# EXIF IFD Entry #4:
->>>>(150.l+50) leshort 0x9000
->>>>>(150.l+59) byte x %c
->>>>>(150.l+60) byte x \b.%c
->>>>>(150.l+61) byte !0x30 \b%c
-# EXIF IFD Entry #5:
->>>>(150.l+62) leshort 0x9000
->>>>>(150.l+71) byte x %c
->>>>>(150.l+72) byte x \b.%c
->>>>>(150.l+73) byte !0x30 \b%c
-# Big-endian
->>12 string MM
-# IFD 0 Entry #9:
->>>118 beshort 0x8769
-# EXIF IFD Entry #1:
->>>>(126.L+14) beshort 0x9000
->>>>>(126.L+23) byte x %c
->>>>>(126.L+24) byte x \b.%c
->>>>>(126.L+25) byte !0x30 \b%c
-# EXIF IFD Entry #3:
->>>>(126.L+38) beshort 0x9000
->>>>>(126.L+47) byte x %c
->>>>>(126.L+48) byte x \b.%c
->>>>>(126.L+49) byte !0x30 \b%c
-# IFD 0 Entry #10
->>>130 beshort 0x8769
-# EXIF IFD Entry #3:
->>>>(138.L+38) beshort 0x9000
->>>>>(138.L+47) byte x %c
->>>>>(138.L+48) byte x \b.%c
->>>>>(138.L+49) byte !0x30 \b%c
-# EXIF IFD Entry #5:
->>>>(138.L+62) beshort 0x9000
->>>>>(138.L+71) byte x %c
->>>>>(138.L+72) byte x \b.%c
->>>>>(138.L+73) byte !0x30 \b%c
-# IFD 0 Entry #11
->>>142 beshort 0x8769
-# EXIF IFD Entry #4:
->>>>(150.L+50) beshort 0x9000
->>>>>(150.L+59) byte x %c
->>>>>(150.L+60) byte x \b.%c
->>>>>(150.L+61) byte !0x30 \b%c
-# Here things get sticky. We can do ONE MORE marker segment with
-# indirect addressing, and that's all. It would be great if we could
-# do pointer arithemetic like in an assembler language. Christos?
-# And if there was some sort of looping construct to do searches, plus a few
-# named accumulators, it would be even more effective...
-# At least we can show a comment if no other segments got inserted before:
->(4.S+5) byte 0xFE
->>(4.S+8) string >\0 \b, comment: "%s"
-# FIXME: When we can do non-byte counted strings, we can use that to get
-# the string's count, and fix Debian bug #283760
-#>(4.S+5) byte 0xFE \b, comment
-#>>(4.S+6) beshort x \b length=%d
-#>>(4.S+8) string >\0 \b, "%s"
-# Or, we can show the encoding type (I've included only the three most common)
-# and image dimensions if we are lucky and the SOFn (image segment) is here:
->(4.S+5) byte 0xC0 \b, baseline
->>(4.S+6) byte x \b, precision %d
->>(4.S+7) beshort x \b, %dx
->>(4.S+9) beshort x \b%d
->(4.S+5) byte 0xC1 \b, extended sequential
->>(4.S+6) byte x \b, precision %d
->>(4.S+7) beshort x \b, %dx
->>(4.S+9) beshort x \b%d
->(4.S+5) byte 0xC2 \b, progressive
->>(4.S+6) byte x \b, precision %d
->>(4.S+7) beshort x \b, %dx
->>(4.S+9) beshort x \b%d
-# I've commented-out quantisation table reporting. I doubt anyone cares yet.
-#>(4.S+5) byte 0xDB \b, quantisation table
-#>>(4.S+6) beshort x \b length=%d
-#>14 beshort x \b, %d x
-#>16 beshort x \b %d
-
-# HSI is Handmade Software's proprietary JPEG encoding scheme
-0 string hsi1 JPEG image data, HSI proprietary
-
-# From: David Santinoli <david@santinoli.com>
-0 string \x00\x00\x00\x0C\x6A\x50\x20\x20\x0D\x0A\x87\x0A JPEG 2000 image data
-
-# Type: JPEG 2000 codesream
-# From: Mathieu Malaterre <mathieu.malaterre@gmail.com>
-0 belong 0xff4fff51 JPEG 2000 codestream
-45 beshort 0xff52
-
-#------------------------------------------------------------------------------
-# karma: file(1) magic for Karma data files
-#
-# From <rgooch@atnf.csiro.au>
-
-0 string KarmaRHD Version Karma Data Structure Version
->16 belong x %lu
-
-#------------------------------------------------------------------------------
-# kde: file(1) magic for KDE
-
-0 string [KDE\ Desktop\ Entry] KDE desktop entry
-!:mime application/x-kdelnk
-0 string #\ KDE\ Config\ File KDE config file
-!:mime application/x-kdelnk
-0 string #\ xmcd xmcd database file for kscd
-!:mime text/x-xmcd
-#------------------------------------------------------------------------------
-# Type: Google KML, formerly Keyhole Markup Language
-# Future development of this format has been handed
-# over to the Open Geospatial Consortium.
-# http://www.opengeospatial.org/standards/kml/
-# From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
-0 string \<?xml
->20 search/400 \ xmlns=
->>&0 regex ['"]http://earth.google.com/kml Google KML document
-!:mime application/vnd.google-earth.kml+xml
->>>&1 string 2.0' \b, version 2.0
->>>&1 string 2.1' \b, version 2.1
->>>&1 string 2.2' \b, version 2.2
-
-#------------------------------------------------------------------------------
-# Type: OpenGIS KML, formerly Keyhole Markup Language
-# This standard is maintained by the
-# Open Geospatial Consortium.
-# http://www.opengeospatial.org/standards/kml/
-# From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
->>&0 regex ['"]http://www.opengis.net/kml OpenGIS KML document
-!:mime application/vnd.google-earth.kml+xml
->>>&1 string 2.2 \b, version 2.2
-
-#------------------------------------------------------------------------------
-# Type: Google KML Archive (ZIP based)
-# http://code.google.com/apis/kml/documentation/kml_tut.html
-# From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
-0 string PK\003\004
->4 byte 0x14
->>30 string doc.kml Compressed Google KML Document, including resources.
-!:mime application/vnd.google-earth.kmz
-#------------------------------------------------------------------------------
-# DEC SRC Virtual Paper: Lectern files
-# Karl M. Hegbloom <karlheg@inetarena.com>
-0 string lect DEC SRC Virtual Paper Lectern file
-#------------------------------------------------------------------------------
-# lex: file(1) magic for lex
-#
-# derived empirically, your offsets may vary!
-0 search/100 yyprevious C program text (from lex)
->3 search/1 >\0 for %s
-# C program text from GNU flex, from Daniel Quinlan <quinlan@yggdrasil.com>
-0 search/100 generated\ by\ flex C program text (from flex)
-# lex description file, from Daniel Quinlan <quinlan@yggdrasil.com>
-0 search/1 %{ lex description text
-
-#------------------------------------------------------------------------------
-# lif: file(1) magic for lif
-#
-# (Daniel Quinlan <quinlan@yggdrasil.com>)
-#
-0 beshort 0x8000 lif file
-#------------------------------------------------------------------------------
-# linux: file(1) magic for Linux files
-#
-# Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
-# The following basic Linux magic is useful for reference, but using
-# "long" magic is a better practice in order to avoid collisions.
-#
-# 2 leshort 100 Linux/i386
-# >0 leshort 0407 impure executable (OMAGIC)
-# >0 leshort 0410 pure executable (NMAGIC)
-# >0 leshort 0413 demand-paged executable (ZMAGIC)
-# >0 leshort 0314 demand-paged executable (QMAGIC)
-#
-0 lelong 0x00640107 Linux/i386 impure executable (OMAGIC)
->16 lelong 0 \b, stripped
-0 lelong 0x00640108 Linux/i386 pure executable (NMAGIC)
->16 lelong 0 \b, stripped
-0 lelong 0x0064010b Linux/i386 demand-paged executable (ZMAGIC)
->16 lelong 0 \b, stripped
-0 lelong 0x006400cc Linux/i386 demand-paged executable (QMAGIC)
->16 lelong 0 \b, stripped
-#
-0 string \007\001\000 Linux/i386 object file
->20 lelong >0x1020 \b, DLL library
-# Linux-8086 stuff:
-0 string \01\03\020\04 Linux-8086 impure executable
->28 long !0 not stripped
-0 string \01\03\040\04 Linux-8086 executable
->28 long !0 not stripped
-#
-0 string \243\206\001\0 Linux-8086 object file
-#
-0 string \01\03\020\20 Minix-386 impure executable
->28 long !0 not stripped
-0 string \01\03\040\20 Minix-386 executable
->28 long !0 not stripped
-# core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
-216 lelong 0421 Linux/i386 core file
->220 string >\0 of '%s'
->200 lelong >0 (signal %d)
-#
-# LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
-# this can be overridden by the DOS executable (COM) entry
-2 string LILO Linux/i386 LILO boot/chain loader
-#
-# PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
-0 leshort 0x0436 Linux/i386 PC Screen Font data,
->2 byte 0 256 characters, no directory,
->2 byte 1 512 characters, no directory,
->2 byte 2 256 characters, Unicode directory,
->2 byte 3 512 characters, Unicode directory,
->3 byte >0 8x%d
-# Linux swap file, from Daniel Quinlan <quinlan@yggdrasil.com>
-4086 string SWAP-SPACE Linux/i386 swap file
-# From: Jeff Bailey <jbailey@ubuntu.com>
-# Linux swap file with swsusp1 image, from Jeff Bailey <jbailey@ubuntu.com>
-4076 string SWAPSPACE2S1SUSPEND Linux/i386 swap file (new style) with SWSUSP1 image
-# according to man page of mkswap (8) March 1999
-# volume label and UUID Russell Coker
-# http://etbe.coker.com.au/2008/07/08/label-vs-uuid-vs-device/
-4086 string SWAPSPACE2 Linux/i386 swap file (new style),
->0x400 long x version %d (4K pages),
->0x404 long x size %d pages,
->1052 string \0 no label,
->1052 string >\0 LABEL=%s,
->0x40c belong x UUID=%08x
->0x410 beshort x \b-%04x
->0x412 beshort x \b-%04x
->0x414 beshort x \b-%04x
->0x416 belong x \b-%08x
->0x41a beshort x \b%04x
-# ECOFF magic for OSF/1 and Linux (only tested under Linux though)
-#
-# from Erik Troan (ewt@redhat.com) examining od dumps, so this
-# could be wrong
-# updated by David Mosberger (davidm@azstarnet.com) based on
-# GNU BFD and MIPS info found below.
-#
-0 leshort 0x0183 ECOFF alpha
->24 leshort 0407 executable
->24 leshort 0410 pure
->24 leshort 0413 demand paged
->8 long >0 not stripped
->8 long 0 stripped
->23 leshort >0 - version %ld.
-#
-# Linux kernel boot images, from Albert Cahalan <acahalan@cs.uml.edu>
-# and others such as Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
-# and Nicols Lichtmaier <nick@debian.org>
-# All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
-# Linux kernel boot images (i386 arch) (Wolfram Kleff)
-514 string HdrS Linux kernel
->510 leshort 0xAA55 x86 boot executable
->>518 leshort >0x1ff
->>>529 byte 0 zImage,
->>>529 byte 1 bzImage,
->>>(526.s+0x200) string >\0 version %s,
->>498 leshort 1 RO-rootFS,
->>498 leshort 0 RW-rootFS,
->>508 leshort >0 root_dev 0x%X,
->>502 leshort >0 swap_dev 0x%X,
->>504 leshort >0 RAMdisksize %u KB,
->>506 leshort 0xFFFF Normal VGA
->>506 leshort 0xFFFE Extended VGA
->>506 leshort 0xFFFD Prompt for Videomode
->>506 leshort >0 Video mode %d
-# This also matches new kernels, which were caught above by "HdrS".
-0 belong 0xb8c0078e Linux kernel
->0x1e3 string Loading version 1.3.79 or older
->0x1e9 string Loading from prehistoric times
-
-# System.map files - Nicols Lichtmaier <nick@debian.org>
-8 search/1 \ A\ _text Linux kernel symbol map text
-
-# LSM entries - Nicols Lichtmaier <nick@debian.org>
-0 search/1 Begin3 Linux Software Map entry text
-0 search/1 Begin4 Linux Software Map entry text (new format)
-
-# From Matt Zimmerman, enhanced for v3 by Matthew Palmer
-0 belong 0x4f4f4f4d User-mode Linux COW file
->4 belong <3 \b, version %d
->>8 string >\0 \b, backing file %s
->4 belong >2 \b, version %d
->>32 string >\0 \b, backing file %s
-
-############################################################################
-# Linux kernel versions
-
-0 string \xb8\xc0\x07\x8e\xd8\xb8\x00\x90 Linux
->497 leshort 0 x86 boot sector
->>514 belong 0x8e of a kernel from the dawn of time!
->>514 belong 0x908ed8b4 version 0.99-1.1.42
->>514 belong 0x908ed8b8 for memtest86
-
->497 leshort !0 x86 kernel
->>504 leshort >0 RAMdisksize=%u KB
->>502 leshort >0 swap=0x%X
->>508 leshort >0 root=0x%X
->>>498 leshort 1 \b-ro
->>>498 leshort 0 \b-rw
->>506 leshort 0xFFFF vga=normal
->>506 leshort 0xFFFE vga=extended
->>506 leshort 0xFFFD vga=ask
->>506 leshort >0 vga=%d
->>514 belong 0x908ed881 version 1.1.43-1.1.45
->>514 belong 0x15b281cd
->>>0xa8e belong 0x55AA5a5a version 1.1.46-1.2.13,1.3.0
->>>0xa99 belong 0x55AA5a5a version 1.3.1,2
->>>0xaa3 belong 0x55AA5a5a version 1.3.3-1.3.30
->>>0xaa6 belong 0x55AA5a5a version 1.3.31-1.3.41
->>>0xb2b belong 0x55AA5a5a version 1.3.42-1.3.45
->>>0xaf7 belong 0x55AA5a5a version 1.3.46-1.3.72
->>514 string HdrS
->>>518 leshort >0x1FF
->>>>529 byte 0 \b, zImage
->>>>529 byte 1 \b, bzImage
->>>>(526.s+0x200) string >\0 \b, version %s
-
-# Linux boot sector thefts.
-0 belong 0xb8c0078e Linux
->0x1e6 belong 0x454c4b53 ELKS Kernel
->0x1e6 belong !0x454c4b53 style boot sector
-
-############################################################################
-# Linux 8086 executable
-0 lelong&0xFF0000FF 0xC30000E9 Linux-Dev86 executable, headerless
->5 string .
->>4 string >\0 \b, libc version %s
-
-0 lelong&0xFF00FFFF 0x4000301 Linux-8086 executable
->2 byte&0x01 !0 \b, unmapped zero page
->2 byte&0x20 0 \b, impure
->2 byte&0x20 !0
->>2 byte&0x10 !0 \b, A_EXEC
->2 byte&0x02 !0 \b, A_PAL
->2 byte&0x04 !0 \b, A_NSYM
->2 byte&0x08 !0 \b, A_STAND
->2 byte&0x40 !0 \b, A_PURE
->2 byte&0x80 !0 \b, A_TOVLY
->28 long !0 \b, not stripped
->37 string .
->>36 string >\0 \b, libc version %s
-
-# 0 lelong&0xFF00FFFF 0x10000301 ld86 I80386 executable
-# 0 lelong&0xFF00FFFF 0xB000301 ld86 M68K executable
-# 0 lelong&0xFF00FFFF 0xC000301 ld86 NS16K executable
-# 0 lelong&0xFF00FFFF 0x17000301 ld86 SPARC executable
-
-# SYSLINUX boot logo files (from 'ppmtolss16' sources)
-# http://syslinux.zytor.com/
-#
-0 lelong =0x1413f33d SYSLINUX' LSS16 image data
->4 leshort x \b, width %d
->6 leshort x \b, height %d
-
-0 string OOOM User-Mode-Linux's Copy-On-Write disk image
->4 belong x version %d
-
-# SE Linux policy database
-# From: Mike Frysinger <vapier@gentoo.org>
-0 lelong 0xf97cff8c SE Linux policy
->16 lelong x v%d
->20 lelong 1 MLS
->24 lelong x %d symbols
->28 lelong x %d ocons
-
-# Linux Logical Volume Manager (LVM)
-# Emmanuel VARAGNAT <emmanuel.varagnat@guzu.net>
-#
-# System ID, UUID and volume group name are 128 bytes long
-# but they should never be full and initialized with zeros...
-#
-# LVM1
-#
-0x0 string HM\001 LVM1 (Linux Logical Volume Manager), version 1
->0x12c string >\0 , System ID: %s
-
-0x0 string HM\002 LVM1 (Linux Logical Volume Manager), version 2
->0x12c string >\0 , System ID: %s
-
-# LVM2
-#
-# It seems that the label header can be in one the four first sector
-# of the disk... (from _find_labeller in lib/label/label.c of LVM2)
-#
-# 0x200 seems to be the common case
-
-0x218 string LVM2\ 001 LVM2 (Linux Logical Volume Manager)
-# read the offset to add to the start of the header, and the header
-# start in 0x200
->(0x214.l+0x200) string >\0 , UUID: %s
-
-0x018 string LVM2\ 001 LVM2 (Linux Logical Volume Manager)
->(0x014.l) string >\0 , UUID: %s
-
-0x418 string LVM2\ 001 LVM2 (Linux Logical Volume Manager)
->(0x414.l+0x400) string >\0 , UUID: %s
-
-0x618 string LVM2\ 001 LVM2 (Linux Logical Volume Manager)
->(0x614.l+0x600) string >\0 , UUID: %s
-
-# LVM snapshot
-# from Jason Farrel
-0 string SnAp LVM Snapshot (CopyOnWrite store)
->4 lelong !0 - valid,
->4 lelong 0 - invalid,
->8 lelong x version %d,
->12 lelong x chunk_size %d
-
-# SE Linux policy database
-0 lelong 0xf97cff8c SE Linux policy
->16 lelong x v%d
->20 lelong 1 MLS
->24 lelong x %d symbols
->28 lelong x %d ocons
-
-# LUKS: Linux Unified Key Setup, On-Disk Format, http://luks.endorphin.org/spec
-# Anthon van der Neut (anthon@mnt.org)
-0 string LUKS\xba\xbe LUKS encrypted file,
->6 beshort x ver %d
->8 string x [%s,
->40 string x %s,
->72 string x %s]
->168 string x UUID: %s
-
-
-# Summary: Xen saved domain file
-# Created by: Radek Vokal <rvokal@redhat.com>
-0 string LinuxGuestRecord Xen saved domain
->20 search/256 (name
->>&1 string x (name %s)
-
-# Type: Xen, the virtual machine monitor
-# From: Radek Vokal <rvokal@redhat.com>
-0 string LinuxGuestRecord Xen saved domain
-#>2 regex \(name\ [^)]*\) %s
->20 search/256 (name (name
->>&1 string x %s...)
-#------------------------------------------------------------------------------
-# lisp: file(1) magic for lisp programs
-#
-# various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
-
-# updated by Joerg Jenderek
-# GRR: This lot is too weak
-#0 string ;;
-# windows INF files often begin with semicolon and use CRLF as line end
-# lisp files are mainly created on unix system with LF as line end
-#>2 search/4096 !\r Lisp/Scheme program text
-#>2 search/4096 \r Windows INF file
-
-0 search/4096 (if\ Lisp/Scheme program text
-!:mime text/x-lisp
-0 search/4096 (setq\ Lisp/Scheme program text
-!:mime text/x-lisp
-0 search/4096 (defvar\ Lisp/Scheme program text
-!:mime text/x-lisp
-0 search/4096 (defparam\ Lisp/Scheme program text
-!:mime text/x-lisp
-0 search/4096 (defun\ Lisp/Scheme program text
-!:mime text/x-lisp
-0 search/4096 (autoload\ Lisp/Scheme program text
-!:mime text/x-lisp
-0 search/4096 (custom-set-variables\ Lisp/Scheme program text
-!:mime text/x-lisp
-
-# Emacs 18 - this is always correct, but not very magical.
-0 string \012( Emacs v18 byte-compiled Lisp data
-!:mime application/x-elc
-# Emacs 19+ - ver. recognition added by Ian Springer
-# Also applies to XEmacs 19+ .elc files; could tell them apart with regexs
-# - Chris Chittleborough <cchittleborough@yahoo.com.au>
-0 string ;ELC
->4 byte >18
->4 byte <32 Emacs/XEmacs v%d byte-compiled Lisp data
-!:mime application/x-elc
-
-# Files produced by CLISP Common Lisp From: Bruno Haible <haible@ilog.fr>
-0 string (SYSTEM::VERSION\040' CLISP byte-compiled Lisp program (pre 2004-03-27)
-0 string (|SYSTEM|::|VERSION|\040' CLISP byte-compiled Lisp program text
-
-0 long 0x70768BD2 CLISP memory image data
-0 long 0xD28B7670 CLISP memory image data, other endian
-
-#.com and .bin for MIT scheme
-0 string \372\372\372\372 MIT scheme (library?)
-
-# From: David Allouche <david@allouche.net>
-0 search/1 \<TeXmacs| TeXmacs document text
-!:mime text/texmacs
-
-#------------------------------------------------------------------------------
-# llvm: file(1) magic for LLVM byte-codes
-# URL: http://llvm.org/docs/BitCodeFormat.html
-# From: Al Stone <ahs3@fc.hp.com>
-
-0 string llvm LLVM byte-codes, uncompressed
-0 string llvc0 LLVM byte-codes, null compression
-0 string llvc1 LLVM byte-codes, gzip compression
-0 string llvc2 LLVM byte-codes, bzip2 compression
-0 string \xde\xc0\x17\x0b LLVM bitcode, wrapper
-0 string BC\xc0\xde LLVM bitcode
-#------------------------------------------------------------------------------
-# lua: file(1) magic for Lua scripting language
-# URL: http://www.lua.org/
-# From: Reuben Thomas <rrt@sc3d.org>, Seo Sanghyeon <tinuviel@sparcs.kaist.ac.kr>
-
-# Lua scripts
-0 search/1/b #!\ /usr/bin/lua Lua script text executable
-!:mime text/x-lua
-0 search/1/b #!\ /usr/local/bin/lua Lua script text executable
-!:mime text/x-lua
-0 search/1 #!/usr/bin/env\ lua Lua script text executable
-!:mime text/x-lua
-0 search/1 #!\ /usr/bin/env\ lua Lua script text executable
-!:mime text/x-lua
-
-# Lua bytecode
-0 string \033Lua Lua bytecode,
->4 byte 0x50 version 5.0
->4 byte 0x51 version 5.1
-
-#------------------------------------------------------------------------------
-# luks: file(1) magic for Linux Unified Key Setup
-# URL: http://luks.endorphin.org/spec
-# From: Anthon van der Neut <anthon@mnt.org>
-
-0 string LUKS\xba\xbe LUKS encrypted file,
->6 beshort x ver %d
->8 string x [%s,
->40 string x %s,
->72 string x %s]
->168 string x UUID: %s
-#------------------------------------------------------------
-# Mach has two magic numbers, 0xcafebabe and 0xfeedface.
-# Unfortunately the first, cafebabe, is shared with
-# Java ByteCode, so they are both handled in the file "cafebabe".
-# The "feedface" ones are handled herein.
-#------------------------------------------------------------
-0 lelong&0xfffffffe 0xfeedface Mach-O
->0 byte 0xcf 64-bit
->12 lelong 1 object
->12 lelong 2 executable
->12 lelong 3 fixed virtual memory shared library
->12 lelong 4 core
->12 lelong 5 preload executable
->12 lelong 6 dynamically linked shared library
->12 lelong 7 dynamic linker
->12 lelong 8 bundle
->12 lelong 9 dynamically linked shared library stub
->12 lelong >9
->>12 lelong x filetype=%ld
->4 lelong <0
->>4 lelong x architecture=%ld
->4 lelong 1 vax
->4 lelong 2 romp
->4 lelong 3 architecture=3
->4 lelong 4 ns32032
->4 lelong 5 ns32332
->4 lelong 6 m68k
->4 lelong 7 i386
->4 lelong 8 mips
->4 lelong 9 ns32532
->4 lelong 10 architecture=10
->4 lelong 11 hppa
->4 lelong 12 acorn
->4 lelong 13 m88k
->4 lelong 14 sparc
->4 lelong 15 i860-big
->4 lelong 16 i860
->4 lelong 17 rs6000
->4 lelong 18 ppc
->4 lelong 16777234 ppc64
->4 lelong >16777234
->>4 lelong x architecture=%ld
-#
-0 belong&0xfffffffe 0xfeedface Mach-O
->3 byte 0xcf 64-bit
->12 belong 1 object
->12 belong 2 executable
->12 belong 3 fixed virtual memory shared library
->12 belong 4 core
->12 belong 5 preload executable
->12 belong 6 dynamically linked shared library
->12 belong 7 dynamic linker
->12 belong 8 bundle
->12 belong 9 dynamically linked shared library stub
->12 belong >9
->>12 belong x filetype=%ld
->4 belong <0
->>4 belong x architecture=%ld
->4 belong 1 vax
->4 belong 2 romp
->4 belong 3 architecture=3
->4 belong 4 ns32032
->4 belong 5 ns32332
->4 belong 6 for m68k architecture
-# from NeXTstep 3.0 <mach/machine.h>
-# i.e. mc680x0_all, ignore
-# >>8 belong 1 (mc68030)
->>8 belong 2 (mc68040)
->>8 belong 3 (mc68030 only)
->4 belong 7 i386
->4 belong 8 mips
->4 belong 9 ns32532
->4 belong 10 architecture=10
->4 belong 11 hppa
->4 belong 12 acorn
->4 belong 13 m88k
->4 belong 14 sparc
->4 belong 15 i860-big
->4 belong 16 i860
->4 belong 17 rs6000
->4 belong 18 ppc
->4 belong 16777234 ppc64
->4 belong >16777234
->>4 belong x architecture=%ld
-
-#------------------------------------------------------------------------------
-# macintosh description
-#
-# BinHex is the Macintosh ASCII-encoded file format (see also "apple")
-# Daniel Quinlan, quinlan@yggdrasil.com
-11 string must\ be\ converted\ with\ BinHex BinHex binary text
-!:mime application/mac-binhex40
->41 string x \b, version %.3s
-
-# Stuffit archives are the de facto standard of compression for Macintosh
-# files obtained from most archives. (franklsm@tuns.ca)
-0 string SIT! StuffIt Archive (data)
-!:mime application/x-stuffit
-!:apple SIT!SIT!
->2 string x : %s
-0 string SITD StuffIt Deluxe (data)
->2 string x : %s
-0 string Seg StuffIt Deluxe Segment (data)
->2 string x : %s
-
-# Newer StuffIt archives (grant@netbsd.org)
-0 string StuffIt StuffIt Archive
-!:mime application/x-stuffit
-!:apple SIT!SIT!
-#>162 string >0 : %s
-
-# Macintosh Applications and Installation binaries (franklsm@tuns.ca)
-# GRR: Too weak
-#0 string APPL Macintosh Application (data)
-#>2 string x \b: %s
-
-# Macintosh System files (franklsm@tuns.ca)
-# GRR: Too weak
-#0 string zsys Macintosh System File (data)
-#0 string FNDR Macintosh Finder (data)
-#0 string libr Macintosh Library (data)
-#>2 string x : %s
-#0 string shlb Macintosh Shared Library (data)
-#>2 string x : %s
-#0 string cdev Macintosh Control Panel (data)
-#>2 string x : %s
-#0 string INIT Macintosh Extension (data)
-#>2 string x : %s
-#0 string FFIL Macintosh Truetype Font (data)
-#>2 string x : %s
-#0 string LWFN Macintosh Postscript Font (data)
-#>2 string x : %s
-
-# Additional Macintosh Files (franklsm@tuns.ca)
-# GRR: Too weak
-#0 string PACT Macintosh Compact Pro Archive (data)
-#>2 string x : %s
-#0 string ttro Macintosh TeachText File (data)
-#>2 string x : %s
-#0 string TEXT Macintosh TeachText File (data)
-#>2 string x : %s
-#0 string PDF Macintosh PDF File (data)
-#>2 string x : %s
-
-# MacBinary format (Eric Fischer, enf@pobox.com)
-#
-# Unfortunately MacBinary doesn't really have a magic number prior
-# to the MacBinary III format. The checksum is really the way to
-# do it, but the magic file format isn't up to the challenge.
-#
-# 0 byte 0
-# 1 byte # filename length
-# 2 string # filename
-# 65 string # file type
-# 69 string # file creator
-# 73 byte # Finder flags
-# 74 byte 0
-# 75 beshort # vertical posn in window
-# 77 beshort # horiz posn in window
-# 79 beshort # window or folder ID
-# 81 byte # protected?
-# 82 byte 0
-# 83 belong # length of data segment
-# 87 belong # length of resource segment
-# 91 belong # file creation date
-# 95 belong # file modification date
-# 99 beshort # length of comment after resource
-# 101 byte # new Finder flags
-# 102 string mBIN # (only in MacBinary III)
-# 106 byte # char. code of file name
-# 107 byte # still more Finder flags
-# 116 belong # total file length
-# 120 beshort # length of add'l header
-# 122 byte 129 # for MacBinary II
-# 122 byte 130 # for MacBinary III
-# 123 byte 129 # minimum version that can read fmt
-# 124 beshort # checksum
-#
-# This attempts to use the version numbers as a magic number, requiring
-# that the first one be 0x80, 0x81, 0x82, or 0x83, and that the second
-# be 0x81. This works for the files I have, but maybe not for everyone's.
-
-# Unfortunately, this magic is quite weak - MPi
-#122 beshort&0xFCFF 0x8081 Macintosh MacBinary data
-
-# MacBinary I doesn't have the version number field at all, but MacBinary II
-# has been in use since 1987 so I hope there aren't many really old files
-# floating around that this will miss. The original spec calls for using
-# the nulls in 0, 74, and 82 as the magic number.
-#
-# Another possibility, that would also work for MacBinary I, is to use
-# the assumption that 65-72 will all be ASCII (0x20-0x7F), that 73 will
-# have bits 1 (changed), 2 (busy), 3 (bozo), and 6 (invisible) unset,
-# and that 74 will be 0. So something like
-#
-# 71 belong&0x80804EFF 0x00000000 Macintosh MacBinary data
-#
-# >73 byte&0x01 0x01 \b, inited
-# >73 byte&0x02 0x02 \b, changed
-# >73 byte&0x04 0x04 \b, busy
-# >73 byte&0x08 0x08 \b, bozo
-# >73 byte&0x10 0x10 \b, system
-# >73 byte&0x10 0x20 \b, bundle
-# >73 byte&0x10 0x40 \b, invisible
-# >73 byte&0x10 0x80 \b, locked
-
-#>65 string x \b, type "%4.4s"
-
-#>65 string 8BIM (PhotoShop)
-#>65 string ALB3 (PageMaker 3)
-#>65 string ALB4 (PageMaker 4)
-#>65 string ALT3 (PageMaker 3)
-#>65 string APPL (application)
-#>65 string AWWP (AppleWorks word processor)
-#>65 string CIRC (simulated circuit)
-#>65 string DRWG (MacDraw)
-#>65 string EPSF (Encapsulated PostScript)
-#>65 string FFIL (font suitcase)
-#>65 string FKEY (function key)
-#>65 string FNDR (Macintosh Finder)
-#>65 string GIFf (GIF image)
-#>65 string Gzip (GNU gzip)
-#>65 string INIT (system extension)
-#>65 string LIB\ (library)
-#>65 string LWFN (PostScript font)
-#>65 string MSBC (Microsoft BASIC)
-#>65 string PACT (Compact Pro archive)
-#>65 string PDF\ (Portable Document Format)
-#>65 string PICT (picture)
-#>65 string PNTG (MacPaint picture)
-#>65 string PREF (preferences)
-#>65 string PROJ (Think C project)
-#>65 string QPRJ (Think Pascal project)
-#>65 string SCFL (Defender scores)
-#>65 string SCRN (startup screen)
-#>65 string SITD (StuffIt Deluxe)
-#>65 string SPn3 (SuperPaint)
-#>65 string STAK (HyperCard stack)
-#>65 string Seg\ (StuffIt segment)
-#>65 string TARF (Unix tar archive)
-#>65 string TEXT (ASCII)
-#>65 string TIFF (TIFF image)
-#>65 string TOVF (Eudora table of contents)
-#>65 string WDBN (Microsoft Word word processor)
-#>65 string WORD (MacWrite word processor)
-#>65 string XLS\ (Microsoft Excel)
-#>65 string ZIVM (compress (.Z))
-#>65 string ZSYS (Pre-System 7 system file)
-#>65 string acf3 (Aldus FreeHand)
-#>65 string cdev (control panel)
-#>65 string dfil (Desk Acessory suitcase)
-#>65 string libr (library)
-#>65 string nX^d (WriteNow word processor)
-#>65 string nX^w (WriteNow dictionary)
-#>65 string rsrc (resource)
-#>65 string scbk (Scrapbook)
-#>65 string shlb (shared library)
-#>65 string ttro (SimpleText read-only)
-#>65 string zsys (system file)
-
-#>69 string x \b, creator "%4.4s"
-
-# Somewhere, Apple has a repository of registered Creator IDs. These are
-# just the ones that I happened to have files from and was able to identify.
-
-#>69 string 8BIM (Adobe Photoshop)
-#>69 string ALD3 (PageMaker 3)
-#>69 string ALD4 (PageMaker 4)
-#>69 string ALFA (Alpha editor)
-#>69 string APLS (Apple Scanner)
-#>69 string APSC (Apple Scanner)
-#>69 string BRKL (Brickles)
-#>69 string BTFT (BitFont)
-#>69 string CCL2 (Common Lisp 2)
-#>69 string CCL\ (Common Lisp)
-#>69 string CDmo (The Talking Moose)
-#>69 string CPCT (Compact Pro)
-#>69 string CSOm (Eudora)
-#>69 string DMOV (Font/DA Mover)
-#>69 string DSIM (DigSim)
-#>69 string EDIT (Macintosh Edit)
-#>69 string ERIK (Macintosh Finder)
-#>69 string EXTR (self-extracting archive)
-#>69 string Gzip (GNU gzip)
-#>69 string KAHL (Think C)
-#>69 string LWFU (LaserWriter Utility)
-#>69 string LZIV (compress)
-#>69 string MACA (MacWrite)
-#>69 string MACS (Macintosh operating system)
-#>69 string MAcK (MacKnowledge terminal emulator)
-#>69 string MLND (Defender)
-#>69 string MPNT (MacPaint)
-#>69 string MSBB (Microsoft BASIC (binary))
-#>69 string MSWD (Microsoft Word)
-#>69 string NCSA (NCSA Telnet)
-#>69 string PJMM (Think Pascal)
-#>69 string PSAL (Hunt the Wumpus)
-#>69 string PSI2 (Apple File Exchange)
-#>69 string R*ch (BBEdit)
-#>69 string RMKR (Resource Maker)
-#>69 string RSED (Resource Editor)
-#>69 string Rich (BBEdit)
-#>69 string SIT! (StuffIt)
-#>69 string SPNT (SuperPaint)
-#>69 string Unix (NeXT Mac filesystem)
-#>69 string VIM! (Vim editor)
-#>69 string WILD (HyperCard)
-#>69 string XCEL (Microsoft Excel)
-#>69 string aCa2 (Fontographer)
-#>69 string aca3 (Aldus FreeHand)
-#>69 string dosa (Macintosh MS-DOS file system)
-#>69 string movr (Font/DA Mover)
-#>69 string nX^n (WriteNow)
-#>69 string pdos (Apple ProDOS file system)
-#>69 string scbk (Scrapbook)
-#>69 string ttxt (SimpleText)
-#>69 string ufox (Foreign File Access)
-
-# Just in case...
-
-102 string mBIN MacBinary III data with surprising version number
-
-# sas magic from Bruce Foster (bef@nwu.edu)
-#
-#0 string SAS SAS
-#>8 string x %s
-0 string SAS SAS
->24 string DATA data file
->24 string CATALOG catalog
->24 string INDEX data file index
->24 string VIEW data view
-# sas 7+ magic from Reinhold Koch (reinhold.koch@roche.com)
-#
-0x54 string SAS SAS 7+
->0x9C string DATA data file
->0x9C string CATALOG catalog
->0x9C string INDEX data file index
->0x9C string VIEW data view
-
-# spss magic for SPSS system and portable files,
-# from Bruce Foster (bef@nwu.edu).
-
-0 long 0xc1e2c3c9 SPSS Portable File
->40 string x %s
-
-0 string $FL2 SPSS System File
->24 string x %s
-
-# Macintosh filesystem data
-# From "Tom N Harris" <telliamed@mac.com>
-# Fixed HFS+ and Partition map magic: Ethan Benson <erbenson@alaska.net>
-# The MacOS epoch begins on 1 Jan 1904 instead of 1 Jan 1970, so these
-# entries depend on the data arithmetic added after v.35
-# There's also some Pascal strings in here, ditto...
-
-# The boot block signature, according to IM:Files, is
-# "for HFS volumes, this field always contains the value 0x4C4B."
-# But if this is true for MFS or HFS+ volumes, I don't know.
-# Alternatively, the boot block is supposed to be zeroed if it's
-# unused, so a simply >0 should suffice.
-
-0x400 beshort 0xD2D7 Macintosh MFS data
->0 beshort 0x4C4B (bootable)
->0x40a beshort &0x8000 (locked)
->0x402 beldate-0x7C25B080 x created: %s,
->0x406 beldate-0x7C25B080 >0 last backup: %s,
->0x414 belong x block size: %d,
->0x412 beshort x number of blocks: %d,
->0x424 pstring x volume name: %s
-
-# "BD" is has many false positives
-#0x400 beshort 0x4244 Macintosh HFS data
-#>0 beshort 0x4C4B (bootable)
-#>0x40a beshort &0x8000 (locked)
-#>0x40a beshort ^0x0100 (mounted)
-#>0x40a beshort &0x0200 (spared blocks)
-#>0x40a beshort &0x0800 (unclean)
-#>0x47C beshort 0x482B (Embedded HFS+ Volume)
-#>0x402 beldate-0x7C25B080 x created: %s,
-#>0x406 beldate-0x7C25B080 x last modified: %s,
-#>0x440 beldate-0x7C25B080 >0 last backup: %s,
-#>0x414 belong x block size: %d,
-#>0x412 beshort x number of blocks: %d,
-#>0x424 pstring x volume name: %s
-
-0x400 beshort 0x482B Macintosh HFS Extended
->&0 beshort x version %d data
->0 beshort 0x4C4B (bootable)
->0x404 belong ^0x00000100 (mounted)
->&2 belong &0x00000200 (spared blocks)
->&2 belong &0x00000800 (unclean)
->&2 belong &0x00008000 (locked)
->&6 string x last mounted by: '%.4s',
-# really, that should be treated as a belong and we print a string
-# based on the value. TN1150 only mentions '8.10' for "MacOS 8.1"
->&14 beldate-0x7C25B080 x created: %s,
-# only the creation date is local time, all other timestamps in HFS+ are UTC.
->&18 bedate-0x7C25B080 x last modified: %s,
->&22 bedate-0x7C25B080 >0 last backup: %s,
->&26 bedate-0x7C25B080 >0 last checked: %s,
->&38 belong x block size: %d,
->&42 belong x number of blocks: %d,
->&46 belong x free blocks: %d
-
-# I don't think this is really necessary since it doesn't do much and
-# anything with a valid driver descriptor will also have a valid
-# partition map
-#0 beshort 0x4552 Apple Device Driver data
-#>&24 beshort =1 \b, MacOS
-
-# Is that the partition type a cstring or a pstring? Well, IM says "strings
-# shorter than 32 bytes must be terminated with NULL" so I'll treat it as a
-# cstring. Of course, partitions can contain more than four entries, but
-# what're you gonna do?
-# GRR: This magic is too weak, it is just "PM"
-#0x200 beshort 0x504D Apple Partition data
-#>0x2 beshort x (block size: %d):
-#>0x230 string x first type: %s,
-#>0x210 string x name: %s,
-#>0x254 belong x number of blocks: %d,
-#>0x400 beshort 0x504D
-#>>0x430 string x second type: %s,
-#>>0x410 string x name: %s,
-#>>0x454 belong x number of blocks: %d,
-#>>0x600 beshort 0x504D
-#>>>0x630 string x third type: %s,
-#>>>0x610 string x name: %s,
-#>>>0x654 belong x number of blocks: %d,
-#>>0x800 beshort 0x504D
-#>>>0x830 string x fourth type: %s,
-#>>>0x810 string x name: %s,
-#>>>0x854 belong x number of blocks: %d,
-#>>>0xa00 beshort 0x504D
-#>>>>0xa30 string x fifth type: %s,
-#>>>>0xa10 string x name: %s,
-#>>>>0xa54 belong x number of blocks: %d
-#>>>0xc00 beshort 0x504D
-#>>>>0xc30 string x sixth type: %s,
-#>>>>0xc10 string x name: %s,
-#>>>>0xc54 belong x number of blocks: %d
-## AFAIK, only the signature is different
-#0x200 beshort 0x5453 Apple Old Partition data
-#>0x2 beshort x block size: %d,
-#>0x230 string x first type: %s,
-#>0x210 string x name: %s,
-#>0x254 belong x number of blocks: %d,
-#>0x400 beshort 0x504D
-#>>0x430 string x second type: %s,
-#>>0x410 string x name: %s,
-#>>0x454 belong x number of blocks: %d,
-#>>0x800 beshort 0x504D
-#>>>0x830 string x third type: %s,
-#>>>0x810 string x name: %s,
-#>>>0x854 belong x number of blocks: %d,
-#>>>0xa00 beshort 0x504D
-#>>>>0xa30 string x fourth type: %s,
-#>>>>0xa10 string x name: %s,
-#>>>>0xa54 belong x number of blocks: %d
-
-# From: Remi Mommsen <mommsen@slac.stanford.edu>
-0 string BOMStore Mac OS X bill of materials (BOM) file
-
-#------------------------------------------------------------------------------
-# magic: file(1) magic for magic files
-#
-0 string #\ Magic magic text file for file(1) cmd
-0 lelong 0xF11E041C magic binary file for file(1) cmd
->4 lelong x (version %d) (little endian)
-0 belong 0xF11E041C magic binary file for file(1) cmd
->4 belong x (version %d) (big endian)
-#------------------------------------------------------------------------------
-# mail.news: file(1) magic for mail and news
-#
-# Unfortunately, saved netnews also has From line added in some news software.
-#0 string From mail text
-# There are tests to ascmagic.c to cope with mail and news.
-0 string Relay-Version: old news text
-!:mime message/rfc822
-0 string #!\ rnews batched news text
-!:mime message/rfc822
-0 string N#!\ rnews mailed, batched news text
-!:mime message/rfc822
-0 string Forward\ to mail forwarding text
-!:mime message/rfc822
-0 string Pipe\ to mail piping text
-!:mime message/rfc822
-0 string Return-Path: smtp mail text
-!:mime message/rfc822
-0 string Path: news text
-!:mime message/news
-0 string Xref: news text
-!:mime message/news
-0 string From: news or mail text
-!:mime message/rfc822
-0 string Article saved news text
-!:mime message/news
-0 string BABYL Emacs RMAIL text
-0 string Received: RFC 822 mail text
-!:mime message/rfc822
-0 string MIME-Version: MIME entity text
-#0 string Content- MIME entity text
-
-# TNEF files...
-0 lelong 0x223E9F78 Transport Neutral Encapsulation Format
-
-# From: Kevin Sullivan <ksulliva@psc.edu>
-0 string *mbx* MBX mail folder
-
-# From: Simon Matter <simon.matter@invoca.ch>
-0 string \241\002\213\015skiplist\ file\0\0\0 Cyrus skiplist DB
-
-# JAM(mbp) Fidonet message area databases
-# JHR file
-0 string JAM\0 JAM message area header file
->12 leshort >0 (%d messages)
-
-# Squish Fidonet message area databases
-# SQD file (requires at least one message in the area)
-# XXX: Weak magic
-#256 leshort 0xAFAE4453 Squish message area data file
-#>4 leshort >0 (%d messages)
-
-#0 string \<!--\ MHonArc text/html; x-type=mhonarc
-
-#------------------------------------------------------------------------------
-# maple: file(1) magic for maple files
-# "H. Nanosecond" <aldomel@ix.netcom.com>
-# Maple V release 4, a multi-purpose math program
-#
-
-# maple library .lib
-0 string \000MVR4\nI MapleVr4 library
-
-# .ind
-# no magic for these :-(
-# they are compiled indexes for maple files
-
-# .hdb
-0 string \000\004\000\000 Maple help database
-
-# .mhp
-# this has the form <PACKAGE=name>
-0 string \<PACKAGE= Maple help file
-0 string \<HELP\ NAME= Maple help file
-0 string \n\<HELP\ NAME= Maple help file with extra carriage return at start (yuck)
-#0 string #\ Newton Maple help file, old style
-0 string #\ daub Maple help file, old style
-#0 string #=========== Maple help file, old style
-
-# .mws
-0 string \000\000\001\044\000\221 Maple worksheet
-#this is anomalous
-0 string WriteNow\000\002\000\001\000\000\000\000\100\000\000\000\000\000 Maple worksheet, but weird
-# this has the form {VERSION 2 3 "IBM INTEL NT" "2.3" }\n
-# that is {VERSION major_version miunor_version computer_type version_string}
-0 string {VERSION\ Maple worksheet
->9 string >\0 version %.1s.
->>>11 string >\0 %.1s
-
-# .mps
-0 string \0\0\001$ Maple something
-# from byte 4 it is either 'nul E' or 'soh R'
-# I think 'nul E' means a file that was saved as a different name
-# a sort of revision marking
-# 'soh R' means new
->4 string \000\105 An old revision
->4 string \001\122 The latest save
-
-# .mpl
-# some of these are the same as .mps above
-#0000000 000 000 001 044 000 105 same as .mps
-#0000000 000 000 001 044 001 122 same as .mps
-
-0 string #\n##\ <SHAREFILE= Maple something
-0 string \n#\n##\ <SHAREFILE= Maple something
-0 string ##\ <SHAREFILE= Maple something
-0 string #\r##\ <SHAREFILE= Maple something
-0 string \r#\r##\ <SHAREFILE= Maple something
-0 string #\ \r##\ <DESCRIBE> Maple something anomalous.
-
-#------------------------------------------------------------------------------
-# mathcad: file(1) magic for Mathcad documents
-# URL: http://www.mathsoft.com/
-# From: Josh Triplett <josh@freedesktop.org>
-
-0 string .MCAD\t Mathcad document
-#------------------------------------------------------------------------------
-# mathematica: file(1) magic for mathematica files
-# "H. Nanosecond" <aldomel@ix.netcom.com>
-# Mathematica a multi-purpose math program
-# versions 2.2 and 3.0
-
-#mathematica .mb
-0 string \064\024\012\000\035\000\000\000 Mathematica version 2 notebook
-0 string \064\024\011\000\035\000\000\000 Mathematica version 2 notebook
-
-# .ma
-# multiple possibilites:
-
-0 string (*^\n\n::[\011frontEndVersion\ =\ Mathematica notebook
-#>41 string >\0 %s
-
-#0 string (*^\n\n::[\011palette Mathematica notebook version 2.x
-
-#0 string (*^\n\n::[\011Information Mathematica notebook version 2.x
-#>675 string >\0 %s #doesn't work well
-
-# there may be 'cr' instread of 'nl' in some does this matter?
-
-# generic:
-0 string (*^\r\r::[\011 Mathematica notebook version 2.x
-0 string (*^\r\n\r\n::[\011 Mathematica notebook version 2.x
-0 string (*^\015 Mathematica notebook version 2.x
-0 string (*^\n\r\n\r::[\011 Mathematica notebook version 2.x
-0 string (*^\r::[\011 Mathematica notebook version 2.x
-0 string (*^\r\n::[\011 Mathematica notebook version 2.x
-0 string (*^\n\n::[\011 Mathematica notebook version 2.x
-0 string (*^\n::[\011 Mathematica notebook version 2.x
-
-
-# Mathematica .mx files
-
-#0 string (*This\ is\ a\ Mathematica\ binary\ dump\ file.\ It\ can\ be\ loaded\ with\ Get.*) Mathematica binary file
-0 string (*This\ is\ a\ Mathematica\ binary\ Mathematica binary file
-#>71 string \000\010\010\010\010\000\000\000\000\000\000\010\100\010\000\000\000
-# >71... is optional
->88 string >\0 from %s
-
-
-# Mathematica files PBF:
-# 115 115 101 120 102 106 000 001 000 000 000 203 000 001 000
-0 string MMAPBF\000\001\000\000\000\203\000\001\000 Mathematica PBF (fonts I think)
-
-# .ml files These are menu resources I think
-# these start with "[0-9][0-9][0-9]\ A~[0-9][0-9][0-9]\
-# how to put that into a magic rule?
-4 string \ A~ MAthematica .ml file
-
-# .nb files
-#too long 0 string (***********************************************************************\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Mathematica-Compatible Notebook Mathematica 3.0 notebook
-0 string (*********************** Mathematica 3.0 notebook
-
-# other (* matches it is a comment start in these langs
-# GRR: Too weak; also matches other languages e.g. ML
-#0 string (* Mathematica, or Pascal, Modula-2 or 3 code text
-
-#########################
-# MatLab v5
-0 string MATLAB Matlab v5 mat-file
->126 short 0x494d (big endian)
->>124 beshort x version 0x%04x
->126 short 0x4d49 (little endian)
->>124 leshort x version 0x%04x
-
-
-#------------------------------------------------------------------------------
-# matroska: file(1) magic for Matroska files
-#
-# See http://www.matroska.org/
-#
-
-# EBML id:
-0 belong 0x1a45dfa3
-# DocType id:
->5 beshort 0x4282
-# DocType contents:
->>8 string matroska Matroska data
-
-#------------------------------------------------------------------------------
-# Mavroyanopoulos Nikos <nmav@hellug.gr>
-# mcrypt: file(1) magic for mcrypt 2.2.x;
-0 string \0m\3 mcrypt 2.5 encrypted data,
->4 string >\0 algorithm: %s,
->>&1 leshort >0 keysize: %d bytes,
->>>&0 string >\0 mode: %s,
-
-0 string \0m\2 mcrypt 2.2 encrypted data,
->3 byte 0 algorithm: blowfish-448,
->3 byte 1 algorithm: DES,
->3 byte 2 algorithm: 3DES,
->3 byte 3 algorithm: 3-WAY,
->3 byte 4 algorithm: GOST,
->3 byte 6 algorithm: SAFER-SK64,
->3 byte 7 algorithm: SAFER-SK128,
->3 byte 8 algorithm: CAST-128,
->3 byte 9 algorithm: xTEA,
->3 byte 10 algorithm: TWOFISH-128,
->3 byte 11 algorithm: RC2,
->3 byte 12 algorithm: TWOFISH-192,
->3 byte 13 algorithm: TWOFISH-256,
->3 byte 14 algorithm: blowfish-128,
->3 byte 15 algorithm: blowfish-192,
->3 byte 16 algorithm: blowfish-256,
->3 byte 100 algorithm: RC6,
->3 byte 101 algorithm: IDEA,
->4 byte 0 mode: CBC,
->4 byte 1 mode: ECB,
->4 byte 2 mode: CFB,
->4 byte 3 mode: OFB,
->4 byte 4 mode: nOFB,
->5 byte 0 keymode: 8bit
->5 byte 1 keymode: 4bit
->5 byte 2 keymode: SHA-1 hash
->5 byte 3 keymode: MD5 hash
-
-#------------------------------------------------------------------------------
-# mercurial: file(1) magic for Mercurial changeset bundles
-# http://www.selenic.com/mercurial/wiki/
-#
-# Jesse Glick (jesse.glick@sun.com)
-#
-
-0 string HG10 Mercurial changeset bundle
->4 string UN (uncompressed)
->4 string GZ (gzip compressed)
->4 string BZ (bzip2 compressed)
-#------------------------------------------------------------------------------
-# mime: file(1) magic for MIME encoded files
-#
-0 string Content-Type:\
->14 string >\0 %s
-0 string Content-Type:
->13 string >\0 %s
-
-#------------------------------------------------------------------------------
-# mips: file(1) magic for Silicon Graphics (MIPS, IRIS, IRIX, etc.)
-# Dec Ultrix (MIPS)
-# all of SGI's *current* machines and OSes run in big-endian mode on the
-# MIPS machines, as far as I know.
-#
-# XXX - what is the blank "-" line?
-#
-# kbd file definitions
-0 string kbd!map kbd map file
->8 byte >0 Ver %d:
->10 short >0 with %d table(s)
-0 belong 0407 old SGI 68020 executable
-0 belong 0410 old SGI 68020 pure executable
-0 beshort 0x8765 disk quotas file
-0 beshort 0x0506 IRIS Showcase file
->2 byte 0x49 -
->3 byte x - version %ld
-0 beshort 0x0226 IRIS Showcase template
->2 byte 0x63 -
->3 byte x - version %ld
-0 belong 0x5343464d IRIS Showcase file
->4 byte x - version %ld
-0 belong 0x5443464d IRIS Showcase template
->4 byte x - version %ld
-0 belong 0xdeadbabe IRIX Parallel Arena
->8 belong >0 - version %ld
-#
-0 beshort 0x0160 MIPSEB ECOFF executable
->20 beshort 0407 (impure)
->20 beshort 0410 (swapped)
->20 beshort 0413 (paged)
->8 belong >0 not stripped
->8 belong 0 stripped
->22 byte x - version %ld
->23 byte x .%ld
-#
-0 beshort 0x0162 MIPSEL-BE ECOFF executable
->20 beshort 0407 (impure)
->20 beshort 0410 (swapped)
->20 beshort 0413 (paged)
->8 belong >0 not stripped
->8 belong 0 stripped
->23 byte x - version %d
->22 byte x .%ld
-#
-0 beshort 0x6001 MIPSEB-LE ECOFF executable
->20 beshort 03401 (impure)
->20 beshort 04001 (swapped)
->20 beshort 05401 (paged)
->8 belong >0 not stripped
->8 belong 0 stripped
->23 byte x - version %d
->22 byte x .%ld
-#
-0 beshort 0x6201 MIPSEL ECOFF executable
->20 beshort 03401 (impure)
->20 beshort 04001 (swapped)
->20 beshort 05401 (paged)
->8 belong >0 not stripped
->8 belong 0 stripped
->23 byte x - version %ld
->22 byte x .%ld
-#
-# MIPS 2 additions
-#
-0 beshort 0x0163 MIPSEB MIPS-II ECOFF executable
->20 beshort 0407 (impure)
->20 beshort 0410 (swapped)
->20 beshort 0413 (paged)
->8 belong >0 not stripped
->8 belong 0 stripped
->22 byte x - version %ld
->23 byte x .%ld
-#
-0 beshort 0x0166 MIPSEL-BE MIPS-II ECOFF executable
->20 beshort 0407 (impure)
->20 beshort 0410 (swapped)
->20 beshort 0413 (paged)
->8 belong >0 not stripped
->8 belong 0 stripped
->22 byte x - version %ld
->23 byte x .%ld
-#
-0 beshort 0x6301 MIPSEB-LE MIPS-II ECOFF executable
->20 beshort 03401 (impure)
->20 beshort 04001 (swapped)
->20 beshort 05401 (paged)
->8 belong >0 not stripped
->8 belong 0 stripped
->23 byte x - version %ld
->22 byte x .%ld
-#
-0 beshort 0x6601 MIPSEL MIPS-II ECOFF executable
->20 beshort 03401 (impure)
->20 beshort 04001 (swapped)
->20 beshort 05401 (paged)
->8 belong >0 not stripped
->8 belong 0 stripped
->23 byte x - version %ld
->22 byte x .%ld
-#
-# MIPS 3 additions
-#
-0 beshort 0x0140 MIPSEB MIPS-III ECOFF executable
->20 beshort 0407 (impure)
->20 beshort 0410 (swapped)
->20 beshort 0413 (paged)
->8 belong >0 not stripped
->8 belong 0 stripped
->22 byte x - version %ld
->23 byte x .%ld
-#
-0 beshort 0x0142 MIPSEL-BE MIPS-III ECOFF executable
->20 beshort 0407 (impure)
->20 beshort 0410 (swapped)
->20 beshort 0413 (paged)
->8 belong >0 not stripped
->8 belong 0 stripped
->22 byte x - version %ld
->23 byte x .%ld
-#
-0 beshort 0x4001 MIPSEB-LE MIPS-III ECOFF executable
->20 beshort 03401 (impure)
->20 beshort 04001 (swapped)
->20 beshort 05401 (paged)
->8 belong >0 not stripped
->8 belong 0 stripped
->23 byte x - version %ld
->22 byte x .%ld
-#
-0 beshort 0x4201 MIPSEL MIPS-III ECOFF executable
->20 beshort 03401 (impure)
->20 beshort 04001 (swapped)
->20 beshort 05401 (paged)
->8 belong >0 not stripped
->8 belong 0 stripped
->23 byte x - version %ld
->22 byte x .%ld
-#
-0 beshort 0x180 MIPSEB Ucode
-0 beshort 0x182 MIPSEL-BE Ucode
-# 32bit core file
-0 belong 0xdeadadb0 IRIX core dump
->4 belong 1 of
->16 string >\0 '%s'
-# 64bit core file
-0 belong 0xdeadad40 IRIX 64-bit core dump
->4 belong 1 of
->16 string >\0 '%s'
-# N32bit core file
-0 belong 0xbabec0bb IRIX N32 core dump
->4 belong 1 of
->16 string >\0 '%s'
-# New style crash dump file
-0 string \x43\x72\x73\x68\x44\x75\x6d\x70 IRIX vmcore dump of
->36 string >\0 '%s'
-# Trusted IRIX info
-0 string SGIAUDIT SGI Audit file
->8 byte x - version %d
->9 byte x .%ld
-#
-0 string WNGZWZSC Wingz compiled script
-0 string WNGZWZSS Wingz spreadsheet
-0 string WNGZWZHP Wingz help file
-#
-0 string #Inventor V IRIS Inventor 1.0 file
-0 string #Inventor V2 Open Inventor 2.0 file
-# GLF is OpenGL stream encoding
-0 string glfHeadMagic(); GLF_TEXT
-4 belong 0x7d000000 GLF_BINARY_LSB_FIRST
-4 belong 0x0000007d GLF_BINARY_MSB_FIRST
-# GLS is OpenGL stream encoding; GLS is the successor of GLF
-0 string glsBeginGLS( GLS_TEXT
-4 belong 0x10000000 GLS_BINARY_LSB_FIRST
-4 belong 0x00000010 GLS_BINARY_MSB_FIRST
-
-#------------------------------------------------------------------------------
-# mirage: file(1) magic for Mirage executables
-#
-# XXX - byte order?
-#
-0 long 31415 Mirage Assembler m.out executable
-#-----------------------------------------------------------------------------
-# misctools: file(1) magic for miscellaneous UNIX tools.
-#
-0 search/1 %%!! X-Post-It-Note text
-0 string/c BEGIN:VCALENDAR vCalendar calendar file
-0 string/c BEGIN:VCARD vCard visiting card
-!:mime text/x-vcard
-
-# From: Alex Beregszaszi <alex@fsn.hu>
-4 string gtktalog GNOME Catalogue (gtktalog)
->13 string >\0 version %s
-
-# Summary: Libtool library file
-# Extension: .la
-# Submitted by: Tomasz Trojanowski <tomek@uninet.com.pl>
-0 search/80 .la\ -\ a\ libtool\ library\ file libtool library file
-
-# Summary: Libtool object file
-# Extension: .lo
-# Submitted by: Abel Cheung <abelcheung@gmail.com>
-0 search/80 .lo\ -\ a\ libtool\ object\ file libtool object file
-
-#------------------------------------------------------------------------------
-# mkid: file(1) magic for mkid(1) databases
-#
-# ID is the binary tags database produced by mkid(1).
-#
-# XXX - byte order?
-#
-0 string \311\304 ID tags data
->2 short >0 version %d
-
-#------------------------------------------------------------------------------
-# mlssa: file(1) magic for MLSSA datafiles
-#
-0 lelong 0xffffabcd MLSSA datafile,
->4 leshort x algorithm %d,
->10 lelong x %d samples
-
-#------------------------------------------------------------------------------
-# mmdf: file(1) magic for MMDF mail files
-#
-0 string \001\001\001\001 MMDF mailbox
-#------------------------------------------------------------------------------
-# modem: file(1) magic for modem programs
-#
-# From: Florian La Roche <florian@knorke.saar.de>
-1 string PC\ Research,\ Inc Digifax-G3-File
->29 byte 1 \b, fine resolution
->29 byte 0 \b, normal resolution
-
-0 short 0x0100 raw G3 data, byte-padded
-0 short 0x1400 raw G3 data
-#
-# Magic data for vgetty voice formats
-# (Martin Seine & Marc Eberhard)
-
-#
-# raw modem data version 1
-#
-0 string RMD1 raw modem data
->4 string >\0 (%s /
->20 short >0 compression type 0x%04x)
-
-#
-# portable voice format 1
-#
-0 string PVF1\n portable voice format
->5 string >\0 (binary %s)
-
-#
-# portable voice format 2
-#
-0 string PVF2\n portable voice format
->5 string >\0 (ascii %s)
-
-
-#------------------------------------------------------------------------------
-# motorola: file(1) magic for Motorola 68K and 88K binaries
-#
-# 68K
-#
-0 beshort 0520 mc68k COFF
->18 beshort ^00000020 object
->18 beshort &00000020 executable
->12 belong >0 not stripped
->168 string .lowmem Apple toolbox
->20 beshort 0407 (impure)
->20 beshort 0410 (pure)
->20 beshort 0413 (demand paged)
->20 beshort 0421 (standalone)
-0 beshort 0521 mc68k executable (shared)
->12 belong >0 not stripped
-0 beshort 0522 mc68k executable (shared demand paged)
->12 belong >0 not stripped
-#
-# Motorola/UniSoft 68K Binary Compatibility Standard (BCS)
-#
-0 beshort 0554 68K BCS executable
-#
-# 88K
-#
-# Motorola/88Open BCS
-#
-0 beshort 0555 88K BCS executable
-#
-# Motorola S-Records, from Gerd Truschinski <gt@freebsd.first.gmd.de>
-0 string S0 Motorola S-Record; binary data in text format
-
-# ATARI ST relocatable PRG
-#
-# from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001
-# (according to Roland Waldi, Oct 21, 1987)
-# besides the magic 0x601a, the text segment size is checked to be
-# not larger than 1 MB (which is a lot on ST).
-# The additional 0x601b distinction I took from Doug Lee's magic.
-0 belong&0xFFFFFFF0 0x601A0000 Atari ST M68K contiguous executable
->2 belong x (txt=%ld,
->6 belong x dat=%ld,
->10 belong x bss=%ld,
->14 belong x sym=%ld)
-0 belong&0xFFFFFFF0 0x601B0000 Atari ST M68K non-contig executable
->2 belong x (txt=%ld,
->6 belong x dat=%ld,
->10 belong x bss=%ld,
->14 belong x sym=%ld)
-
-# Atari ST/TT... program format (sent by Wolfram Kleff <kleff@cs.uni-bonn.de>)
-0 beshort 0x601A Atari 68xxx executable,
->2 belong x text len %lu,
->6 belong x data len %lu,
->10 belong x BSS len %lu,
->14 belong x symboltab len %lu,
->18 belong 0
->22 belong &0x01 fastload flag,
->22 belong &0x02 may be loaded to alternate RAM,
->22 belong &0x04 malloc may be from alternate RAM,
->22 belong x flags: 0x%lX,
->26 beshort 0 no relocation tab
->26 beshort !0 + relocation tab
->30 string SFX [Self-Extracting LZH SFX archive]
->38 string SFX [Self-Extracting LZH SFX archive]
->44 string ZIP! [Self-Extracting ZIP SFX archive]
-
-0 beshort 0x0064 Atari 68xxx CPX file
->8 beshort x (version %04lx)
-
-#------------------------------------------------------------------------------
-# mozilla: file(1) magic for Mozilla XUL fastload files
-# (XUL.mfasl and XPC.mfasl)
-# URL: http://www.mozilla.org/
-# From: Josh Triplett <josh@freedesktop.org>
-
-0 string XPCOM\nMozFASL\r\n\x1A Mozilla XUL fastload data
-
-#------------------------------------------------------------------------------
-# msdos: file(1) magic for MS-DOS files
-#
-
-# .BAT files (Daniel Quinlan, quinlan@yggdrasil.com)
-# updated by Joerg Jenderek at Oct 2008
-0 string @
->1 string/cB \ echo\ off DOS batch file text
-!:mime text/x-msdos-batch
->1 string/cB echo\ off DOS batch file text
-!:mime text/x-msdos-batch
->1 string/cB rem\ DOS batch file text
-!:mime text/x-msdos-batch
->1 string/cB set\ DOS batch file text
-!:mime text/x-msdos-batch
-
-
-# OS/2 batch files are REXX. the second regex is a bit generic, oh well
-# the matched commands seem to be common in REXX and uncommon elsewhere
-100 search/0xffff rxfuncadd
->100 regex/c =^[\ \t]{0,10}call[\ \t]{1,10}rxfunc OS/2 REXX batch file text
-100 search/0xffff say
->100 regex/c =^[\ \t]{0,10}say\ ['"] OS/2 REXX batch file text
-
-0 leshort 0x14c MS Windows COFF Intel 80386 object file
-#>4 ledate x stamp %s
-0 leshort 0x166 MS Windows COFF MIPS R4000 object file
-#>4 ledate x stamp %s
-0 leshort 0x184 MS Windows COFF Alpha object file
-#>4 ledate x stamp %s
-0 leshort 0x268 MS Windows COFF Motorola 68000 object file
-#>4 ledate x stamp %s
-0 leshort 0x1f0 MS Windows COFF PowerPC object file
-#>4 ledate x stamp %s
-0 leshort 0x290 MS Windows COFF PA-RISC object file
-#>4 ledate x stamp %s
-
-# XXX - according to Microsoft's spec, at an offset of 0x3c in a
-# PE-format executable is the offset in the file of the PE header;
-# unfortunately, that's a little-endian offset, and there's no way
-# to specify an indirect offset with a specified byte order.
-# So, for now, we assume the standard MS-DOS stub, which puts the
-# PE header at 0x80 = 128.
-#
-# Required OS version and subsystem version were 4.0 on some NT 3.51
-# executables built with Visual C++ 4.0, so it's not clear that
-# they're interesting. The user version was 0.0, but there's
-# probably some linker directive to set it. The linker version was
-# 3.0, except for one ".exe" which had it as 4.20 (same damn linker!).
-#
-# many of the compressed formats were extraced from IDARC 1.23 source code
-#
-0 string MZ
-!:mime application/x-dosexec
->0x18 leshort <0x40 MS-DOS executable
->0 string MZ\0\0\0\0\0\0\0\0\0\0PE\0\0 \b, PE for MS Windows
->>&18 leshort&0x2000 >0 (DLL)
->>&88 leshort 0 (unknown subsystem)
->>&88 leshort 1 (native)
->>&88 leshort 2 (GUI)
->>&88 leshort 3 (console)
->>&88 leshort 7 (POSIX)
->>&0 leshort 0x0 unknown processor
->>&0 leshort 0x14c Intel 80386
->>&0 leshort 0x166 MIPS R4000
->>&0 leshort 0x184 Alpha
->>&0 leshort 0x268 Motorola 68000
->>&0 leshort 0x1f0 PowerPC
->>&0 leshort 0x290 PA-RISC
->>&18 leshort&0x0100 >0 32-bit
->>&18 leshort&0x1000 >0 system file
->>&228 lelong >0 \b, Mono/.Net assembly
->>&0xf4 search/0x140 \x0\x40\x1\x0
->>>(&0.l+(4)) string MSCF \b, WinHKI CAB self-extracting archive
->30 string Copyright\ 1989-1990\ PKWARE\ Inc. Self-extracting PKZIP archive
-!:mime application/zip
-# Is next line correct? One might expect "Corp." not "Copr." If it is right, add a note to that effect.
->30 string PKLITE\ Copr. Self-extracting PKZIP archive
-!:mime application/zip
-
->0x18 leshort >0x3f
->>(0x3c.l) string PE\0\0 PE
->>>(0x3c.l+25) byte 1 \b32 executable
->>>(0x3c.l+25) byte 2 \b32+ executable
-# hooray, there's a DOS extender using the PE format, with a valid PE
-# executable inside (which just prints a message and exits if run in win)
->>>(0x3c.l+92) leshort <10
->>>>(8.s*16) string 32STUB for MS-DOS, 32rtm DOS extender
->>>>(8.s*16) string !32STUB for MS Windows
->>>>>(0x3c.l+22) leshort&0x2000 >0 (DLL)
->>>>>(0x3c.l+92) leshort 0 (unknown subsystem)
->>>>>(0x3c.l+92) leshort 1 (native)
->>>>>(0x3c.l+92) leshort 2 (GUI)
->>>>>(0x3c.l+92) leshort 3 (console)
->>>>>(0x3c.l+92) leshort 7 (POSIX)
->>>(0x3c.l+92) leshort 10 (EFI application)
->>>(0x3c.l+92) leshort 11 (EFI boot service driver)
->>>(0x3c.l+92) leshort 12 (EFI runtime driver)
->>>(0x3c.l+92) leshort 13 (XBOX)
->>>(0x3c.l+4) leshort 0x0 unknown processor
->>>(0x3c.l+4) leshort 0x14c Intel 80386
->>>(0x3c.l+4) leshort 0x166 MIPS R4000
->>>(0x3c.l+4) leshort 0x184 Alpha
->>>(0x3c.l+4) leshort 0x268 Motorola 68000
->>>(0x3c.l+4) leshort 0x1f0 PowerPC
->>>(0x3c.l+4) leshort 0x290 PA-RISC
->>>(0x3c.l+4) leshort 0x200 Intel Itanium
->>>(0x3c.l+22) leshort&0x0100 >0 32-bit
->>>(0x3c.l+22) leshort&0x1000 >0 system file
->>>(0x3c.l+232) lelong >0 Mono/.Net assembly
-
->>>>(0x3c.l+0xf8) string UPX0 \b, UPX compressed
->>>>(0x3c.l+0xf8) search/0x140 PEC2 \b, PECompact2 compressed
->>>>(0x3c.l+0xf8) search/0x140 UPX2
->>>>>(&0x10.l+(-4)) string PK\3\4 \b, ZIP self-extracting archive (Info-Zip)
->>>>(0x3c.l+0xf8) search/0x140 .idata
->>>>>(&0xe.l+(-4)) string PK\3\4 \b, ZIP self-extracting archive (Info-Zip)
->>>>>(&0xe.l+(-4)) string ZZ0 \b, ZZip self-extracting archive
->>>>>(&0xe.l+(-4)) string ZZ1 \b, ZZip self-extracting archive
->>>>(0x3c.l+0xf8) search/0x140 .rsrc
->>>>>(&0x0f.l+(-4)) string a\\\4\5 \b, WinHKI self-extracting archive
->>>>>(&0x0f.l+(-4)) string Rar! \b, RAR self-extracting archive
->>>>>(&0x0f.l+(-4)) search/0x3000 MSCF \b, InstallShield self-extracting archive
->>>>>(&0x0f.l+(-4)) search/32 Nullsoft \b, Nullsoft Installer self-extracting archive
->>>>(0x3c.l+0xf8) search/0x140 .data
->>>>>(&0x0f.l) string WEXTRACT \b, MS CAB-Installer self-extracting archive
->>>>(0x3c.l+0xf8) search/0x140 .petite\0 \b, Petite compressed
->>>>>(0x3c.l+0xf7) byte x
->>>>>>(&0x104.l+(-4)) string =!sfx! \b, ACE self-extracting archive
->>>>(0x3c.l+0xf8) search/0x140 .WISE \b, WISE installer self-extracting archive
->>>>(0x3c.l+0xf8) search/0x140 .dz\0\0\0 \b, Dzip self-extracting archive
->>>>(0x3c.l+0xf8) search/0x140 .reloc
->>>>>(&0xe.l+(-4)) search/0x180 PK\3\4 \b, ZIP self-extracting archive (WinZip)
-
->>>>&(0x3c.l+0xf8) search/0x100 _winzip_ \b, ZIP self-extracting archive (WinZip)
->>>>&(0x3c.l+0xf8) search/0x100 SharedD \b, Microsoft Installer self-extracting archive
->>>>0x30 string Inno \b, InnoSetup self-extracting archive
-
->>(0x3c.l) string !PE\0\0 MS-DOS executable
-
->>(0x3c.l) string NE \b, NE
->>>(0x3c.l+0x36) byte 0 (unknown OS)
->>>(0x3c.l+0x36) byte 1 for OS/2 1.x
->>>(0x3c.l+0x36) byte 2 for MS Windows 3.x
->>>(0x3c.l+0x36) byte 3 for MS-DOS
->>>(0x3c.l+0x36) byte >3 (unknown OS)
->>>(0x3c.l+0x36) byte 0x81 for MS-DOS, Phar Lap DOS extender
->>>(0x3c.l+0x0c) leshort&0x8003 0x8002 (DLL)
->>>(0x3c.l+0x0c) leshort&0x8003 0x8001 (driver)
->>>&(&0x24.s-1) string ARJSFX \b, ARJ self-extracting archive
->>>(0x3c.l+0x70) search/0x80 WinZip(R)\ Self-Extractor \b, ZIP self-extracting archive (WinZip)
-
->>(0x3c.l) string LX\0\0 \b, LX
->>>(0x3c.l+0x0a) leshort <1 (unknown OS)
->>>(0x3c.l+0x0a) leshort 1 for OS/2
->>>(0x3c.l+0x0a) leshort 2 for MS Windows
->>>(0x3c.l+0x0a) leshort 3 for DOS
->>>(0x3c.l+0x0a) leshort >3 (unknown OS)
->>>(0x3c.l+0x10) lelong&0x28000 =0x8000 (DLL)
->>>(0x3c.l+0x10) lelong&0x20000 >0 (device driver)
->>>(0x3c.l+0x10) lelong&0x300 0x300 (GUI)
->>>(0x3c.l+0x10) lelong&0x28300 <0x300 (console)
->>>(0x3c.l+0x08) leshort 1 i80286
->>>(0x3c.l+0x08) leshort 2 i80386
->>>(0x3c.l+0x08) leshort 3 i80486
->>>(8.s*16) string emx \b, emx
->>>>&1 string x %s
->>>&(&0x54.l-3) string arjsfx \b, ARJ self-extracting archive
-
-# MS Windows system file, supposedly a collection of LE executables
->>(0x3c.l) string W3 \b, W3 for MS Windows
-
->>(0x3c.l) string LE\0\0 \b, LE executable
->>>(0x3c.l+0x0a) leshort 1
-# some DOS extenders use LE files with OS/2 header
->>>>0x240 search/0x100 DOS/4G for MS-DOS, DOS4GW DOS extender
->>>>0x240 search/0x200 WATCOM\ C/C++ for MS-DOS, DOS4GW DOS extender
->>>>0x440 search/0x100 CauseWay\ DOS\ Extender for MS-DOS, CauseWay DOS extender
->>>>0x40 search/0x40 PMODE/W for MS-DOS, PMODE/W DOS extender
->>>>0x40 search/0x40 STUB/32A for MS-DOS, DOS/32A DOS extender (stub)
->>>>0x40 search/0x80 STUB/32C for MS-DOS, DOS/32A DOS extender (configurable stub)
->>>>0x40 search/0x80 DOS/32A for MS-DOS, DOS/32A DOS extender (embedded)
-# this is a wild guess; hopefully it is a specific signature
->>>>&0x24 lelong <0x50
->>>>>(&0x4c.l) string \xfc\xb8WATCOM
->>>>>>&0 search/8 3\xdbf\xb9 \b, 32Lite compressed
-# another wild guess: if real OS/2 LE executables exist, they probably have higher start EIP
-#>>>>(0x3c.l+0x1c) lelong >0x10000 for OS/2
-# fails with DOS-Extenders.
->>>(0x3c.l+0x0a) leshort 2 for MS Windows
->>>(0x3c.l+0x0a) leshort 3 for DOS
->>>(0x3c.l+0x0a) leshort 4 for MS Windows (VxD)
->>>(&0x7c.l+0x26) string UPX \b, UPX compressed
->>>&(&0x54.l-3) string UNACE \b, ACE self-extracting archive
-
-# looks like ASCII, probably some embedded copyright message.
-# and definitely not NE/LE/LX/PE
->>0x3c lelong >0x20000000
->>>(4.s*512) leshort !0x014c \b, MZ for MS-DOS
-# header data too small for extended executable
->2 long !0
->>0x18 leshort <0x40
->>>(4.s*512) leshort !0x014c
-
->>>>&(2.s-514) string !LE
->>>>>&-2 string !BW \b, MZ for MS-DOS
->>>>&(2.s-514) string LE \b, LE
->>>>>0x240 search/0x100 DOS/4G for MS-DOS, DOS4GW DOS extender
-# educated guess since indirection is still not capable enough for complex offset
-# calculations (next embedded executable would be at &(&2*512+&0-2)
-# I suspect there are only LE executables in these multi-exe files
->>>>&(2.s-514) string BW
->>>>>0x240 search/0x100 DOS/4G ,\b LE for MS-DOS, DOS4GW DOS extender (embedded)
->>>>>0x240 search/0x100 !DOS/4G ,\b BW collection for MS-DOS
-
-# This sequence skips to the first COFF segment, usually .text
->(4.s*512) leshort 0x014c \b, COFF
->>(8.s*16) string go32stub for MS-DOS, DJGPP go32 DOS extender
->>(8.s*16) string emx
->>>&1 string x for DOS, Win or OS/2, emx %s
->>&(&0x42.l-3) byte x
->>>&0x26 string UPX \b, UPX compressed
-# and yet another guess: small .text, and after large .data is unusal, could be 32lite
->>&0x2c search/0xa0 .text
->>>&0x0b lelong <0x2000
->>>>&0 lelong >0x6000 \b, 32lite compressed
-
->(8.s*16) string $WdX \b, WDos/X DOS extender
-
-# .EXE formats (Greg Roelofs, newt@uchicago.edu)
-#
->0x35 string \x8e\xc0\xb9\x08\x00\xf3\xa5\x4a\x75\xeb\x8e\xc3\x8e\xd8\x33\xff\xbe\x30\x00\x05 \b, aPack compressed
->0xe7 string LH/2\ Self-Extract \b, %s
->0x1c string diet \b, diet compressed
->0x1c string LZ09 \b, LZEXE v0.90 compressed
->0x1c string LZ91 \b, LZEXE v0.91 compressed
->0x1c string tz \b, TinyProg compressed
->0x1e string PKLITE \b, %s compressed
->0x64 string W\ Collis\0\0 \b, Compack compressed
->0x24 string LHa's\ SFX \b, LHa self-extracting archive
-!:mime application/x-lha
->0x24 string LHA's\ SFX \b, LHa self-extracting archive
-!:mime application/x-lha
->0x24 string \ $ARX \b, ARX self-extracting archive
->0x24 string \ $LHarc \b, LHarc self-extracting archive
->0x20 string SFX\ by\ LARC \b, LARC self-extracting archive
->1638 string -lh5- \b, LHa self-extracting archive v2.13S
->0x17888 string Rar! \b, RAR self-extracting archive
->0x40 string aPKG \b, aPackage self-extracting archive
-
->32 string AIN
->>35 string 2 \b, AIN 2.x compressed
->>35 string <2 \b, AIN 1.x compressed
->>35 string >2 \b, AIN 1.x compressed
->28 string UC2X \b, UCEXE compressed
->28 string WWP\ \b, WWPACK compressed
-
-# skip to the end of the exe
->(4.s*512) long x
->>&(2.s-517) byte x
->>>&0 string PK\3\4 \b, ZIP self-extracting archive
->>>&0 string Rar! \b, RAR self-extracting archive
->>>&0 string =!\x11 \b, AIN 2.x self-extracting archive
->>>&0 string =!\x12 \b, AIN 2.x self-extracting archive
->>>&0 string =!\x17 \b, AIN 1.x self-extracting archive
->>>&0 string =!\x18 \b, AIN 1.x self-extracting archive
->>>&7 search/400 **ACE** \b, ACE self-extracting archive
->>>&0 search/0x480 UC2SFX\ Header \b, UC2 self-extracting archive
-
->0x1c string RJSX \b, ARJ self-extracting archive
-# winarj stores a message in the stub instead of the sig in the MZ header
->0x20 search/0xe0 aRJsfX \b, ARJ self-extracting archive
-
-# a few unknown ZIP sfxes, no idea if they are needed or if they are
-# already captured by the generic patterns above
->0x7a string Windows\ self-extracting\ ZIP \b, ZIP self-extracting archive
->(8.s*16) search/0x20 PKSFX \b, ZIP self-extracting archive (PKZIP)
-# TODO: how to add this? >FileSize-34 string Windows\ Self-Installing\ Executable \b, ZIP self-extracting archive
-#
-
-# TELVOX Teleinformatica CODEC self-extractor for OS/2:
->49801 string \x79\xff\x80\xff\x76\xff \b, CODEC archive v3.21
->>49824 leshort =1 \b, 1 file
->>49824 leshort >1 \b, %u files
-
-# .COM formats (Daniel Quinlan, quinlan@yggdrasil.com)
-# Uncommenting only the first two lines will cover about 2/3 of COM files,
-# but it isn't feasible to match all COM files since there must be at least
-# two dozen different one-byte "magics".
-# test too generic ?
-0 byte 0xe9 DOS executable (COM)
->0x1FE leshort 0xAA55 \b, boot code
->6 string SFX\ of\ LHarc (%s)
-0 belong 0xffffffff DOS executable (device driver)
-#CMD640X2.SYS
->10 string >\x23
->>10 string !\x2e
->>>17 string <\x5B
->>>>10 string x \b, name: %.8s
-#UDMA.SYS KEYB.SYS CMD640X2.SYS
->10 string <\x41
->>12 string >\x40
->>>10 string !$
->>>>12 string x \b, name: %.8s
-#BTCDROM.SYS ASPICD.SYS
->22 string >\x40
->>22 string <\x5B
->>>23 string <\x5B
->>>>22 string x \b, name: %.8s
-#ATAPICD.SYS
->76 string \0
->>77 string >\x40
->>>77 string <\x5B
->>>>77 string x \b, name: %.8s
-# test too generic ?
-0 byte 0x8c DOS executable (COM)
-# updated by Joerg Jenderek at Oct 2008
-0 ulelong 0xffff10eb DR-DOS executable (COM)
-# byte 0xeb conflicts with "sequent" magic leshort 0xn2eb
-0 ubeshort&0xeb8d >0xeb00
-# DR-DOS STACKER.COM SCREATE.SYS missed
->0 byte 0xeb DOS executable (COM)
->>0x1FE leshort 0xAA55 \b, boot code
->>85 string UPX \b, UPX compressed
->>4 string \ $ARX \b, ARX self-extracting archive
->>4 string \ $LHarc \b, LHarc self-extracting archive
->>0x20e string SFX\ by\ LARC \b, LARC self-extracting archive
-# updated by Joerg Jenderek at Oct 2008
-#0 byte 0xb8 COM executable
-0 uleshort&0x80ff 0x00b8
-# modified by Joerg Jenderek
->1 lelong !0x21cd4cff COM executable for DOS
-# http://syslinux.zytor.com/comboot.php
-# (32-bit COMBOOT) programs *.C32 contain 32-bit code and run in flat-memory 32-bit protected mode
-# start with assembler instructions mov eax,21cd4cffh
-0 uleshort&0xc0ff 0xc0b8
->1 lelong 0x21cd4cff COM executable (32-bit COMBOOT)
-0 string \x81\xfc
->4 string \x77\x02\xcd\x20\xb9
->>36 string UPX! FREE-DOS executable (COM), UPX compressed
-252 string Must\ have\ DOS\ version DR-DOS executable (COM)
-# added by Joerg Jenderek at Oct 2008
-# GRR search is not working
-#34 search/2 UPX! FREE-DOS executable (COM), UPX compressed
-34 string UPX! FREE-DOS executable (COM), UPX compressed
-35 string UPX! FREE-DOS executable (COM), UPX compressed
-# GRR search is not working
-#2 search/28 \xcd\x21 COM executable for MS-DOS
-#WHICHFAT.cOM
-2 string \xcd\x21 COM executable for DOS
-#DELTREE.cOM DELTREE2.cOM
-4 string \xcd\x21 COM executable for DOS
-#IFMEMDSK.cOM ASSIGN.cOM COMP.cOM
-5 string \xcd\x21 COM executable for DOS
-#DELTMP.COm HASFAT32.cOM
-7 string \xcd\x21
->0 byte !0xb8 COM executable for DOS
-#COMP.cOM MORE.COm
-10 string \xcd\x21
->5 string !\xcd\x21 COM executable for DOS
-#comecho.com
-13 string \xcd\x21 COM executable for DOS
-#HELP.COm EDIT.coM
-18 string \xcd\x21 COM executable for MS-DOS
-#NWRPLTRM.COm
-23 string \xcd\x21 COM executable for MS-DOS
-#LOADFIX.cOm LOADFIX.cOm
-30 string \xcd\x21 COM executable for MS-DOS
-#syslinux.com 3.11
-70 string \xcd\x21 COM executable for DOS
-# many compressed/converted COMs start with a copy loop instead of a jump
-0x6 search/0xa \xfc\x57\xf3\xa5\xc3 COM executable for MS-DOS
-0x6 search/0xa \xfc\x57\xf3\xa4\xc3 COM executable for DOS
->0x18 search/0x10 \x50\xa4\xff\xd5\x73 \b, aPack compressed
-0x3c string W\ Collis\0\0 COM executable for MS-DOS, Compack compressed
-# FIXME: missing diet .com compression
-
-# miscellaneous formats
-0 string LZ MS-DOS executable (built-in)
-#0 byte 0xf0 MS-DOS program library data
-#
-
-# AAF files:
-# <stuartc@rd.bbc.co.uk> Stuart Cunningham
-0 string \320\317\021\340\241\261\032\341AAFB\015\000OM\006\016\053\064\001\001\001\377 AAF legacy file using MS Structured Storage
->30 byte 9 (512B sectors)
->30 byte 12 (4kB sectors)
-0 string \320\317\021\340\241\261\032\341\001\002\001\015\000\002\000\000\006\016\053\064\003\002\001\001 AAF file using MS Structured Storage
->30 byte 9 (512B sectors)
->30 byte 12 (4kB sectors)
-
-# Popular applications
-2080 string Microsoft\ Word\ 6.0\ Document %s
-!:mime application/msword
-2080 string Documento\ Microsoft\ Word\ 6 Spanish Microsoft Word 6 document data
-!:mime application/msword
-# Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Word)
-2112 string MSWordDoc Microsoft Word document data
-!:mime application/msword
-#
-0 belong 0x31be0000 Microsoft Word Document
-!:mime application/msword
-#
-0 string PO^Q` Microsoft Word 6.0 Document
-!:mime application/msword
-#
-0 string \376\067\0\043 Microsoft Office Document
-!:mime application/msword
-0 string \333\245-\0\0\0 Microsoft Office Document
-!:mime application/msword
-512 string \354\245\301 Microsoft Word Document
-!:mime application/msword
-#
-2080 string Microsoft\ Excel\ 5.0\ Worksheet %s
-!:mime application/vnd.ms-excel
-
-2080 string Foglio\ di\ lavoro\ Microsoft\ Exce %s
-!:mime application/vnd.ms-excel
-#
-# Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Excel)
-2114 string Biff5 Microsoft Excel 5.0 Worksheet
-!:mime application/vnd.ms-excel
-# Italian MS-Excel
-2121 string Biff5 Microsoft Excel 5.0 Worksheet
-!:mime application/vnd.ms-excel
-0 string \x09\x04\x06\x00\x00\x00\x10\x00 Microsoft Excel Worksheet
-!:mime application/vnd.ms-excel
-#
-0 belong 0x00001a00 Lotus 1-2-3
-!:mime application/x-123
->4 belong 0x00100400 wk3 document data
->4 belong 0x02100400 wk4 document data
->4 belong 0x07800100 fm3 or fmb document data
->4 belong 0x07800000 fm3 or fmb document data
-#
-0 belong 0x00000200 Lotus 1-2-3
-!:mime application/x-123
->4 belong 0x06040600 wk1 document data
->4 belong 0x06800200 fmt document data
-0 string WordPro\0 Lotus WordPro
-!:mime application/vnd.lotus-wordpro
-0 string WordPro\r\373 Lotus WordPro
-!:mime application/vnd.lotus-wordpro
-
-
-# Summary: Script used by InstallScield to uninstall applications
-# Extension: .isu
-# Submitted by: unknown
-# Modified by (1): Abel Cheung <abelcheung@gmail.com> (replace useless entry)
-0 string \x71\xa8\x00\x00\x01\x02
->12 string Stirling\ Technologies, InstallShield Uninstall Script
-
-# Winamp .avs
-#0 string Nullsoft\ AVS\ Preset\ \060\056\061\032 A plug in for Winamp ms-windows Freeware media player
-0 string Nullsoft\ AVS\ Preset\ Winamp plug in
-
-# Windows Metafont .WMF
-0 string \327\315\306\232 ms-windows metafont .wmf
-0 string \002\000\011\000 ms-windows metafont .wmf
-0 string \001\000\011\000 ms-windows metafont .wmf
-
-#tz3 files whatever that is (MS Works files)
-0 string \003\001\001\004\070\001\000\000 tz3 ms-works file
-0 string \003\002\001\004\070\001\000\000 tz3 ms-works file
-0 string \003\003\001\004\070\001\000\000 tz3 ms-works file
-
-# PGP sig files .sig
-#0 string \211\000\077\003\005\000\063\237\127 065 to \027\266\151\064\005\045\101\233\021\002 PGP sig
-0 string \211\000\077\003\005\000\063\237\127\065\027\266\151\064\005\045\101\233\021\002 PGP sig
-0 string \211\000\077\003\005\000\063\237\127\066\027\266\151\064\005\045\101\233\021\002 PGP sig
-0 string \211\000\077\003\005\000\063\237\127\067\027\266\151\064\005\045\101\233\021\002 PGP sig
-0 string \211\000\077\003\005\000\063\237\127\070\027\266\151\064\005\045\101\233\021\002 PGP sig
-0 string \211\000\077\003\005\000\063\237\127\071\027\266\151\064\005\045\101\233\021\002 PGP sig
-0 string \211\000\225\003\005\000\062\122\207\304\100\345\042 PGP sig
-
-# windows zips files .dmf
-0 string MDIF\032\000\010\000\000\000\372\046\100\175\001\000\001\036\001\000 MS Windows special zipped file
-
-
-#ico files
-0 string \102\101\050\000\000\000\056\000\000\000\000\000\000\000 Icon for MS Windows
-
-# Windows icons (Ian Springer <ips@fpk.hp.com>)
-0 string \000\000\001\000 MS Windows icon resource
-!:mime image/x-ico
->4 byte 1 - 1 icon
->4 byte >1 - %d icons
->>6 byte >0 \b, %dx
->>>7 byte >0 \b%d
->>8 byte 0 \b, 256-colors
->>8 byte >0 \b, %d-colors
-
-
-# .chr files
-0 string PK\010\010BGI Borland font
->4 string >\0 %s
-# then there is a copyright notice
-
-
-# .bgi files
-0 string pk\010\010BGI Borland device
->4 string >\0 %s
-# then there is a copyright notice
-
-
-# Windows Recycle Bin record file (named INFO2)
-# By Abel Cheung (abelcheung AT gmail dot com)
-# Version 4 always has 280 bytes (0x118) per record, version 5 has 800 bytes
-# Since Vista uses another structure, INFO2 structure probably won't change
-# anymore. Detailed analysis in:
-# http://www.cybersecurityinstitute.biz/downloads/INFO2.pdf
-0 lelong 0x00000004
->12 lelong 0x00000118 Windows Recycle Bin INFO2 file (Win98 or below)
-
-0 lelong 0x00000005
->12 lelong 0x00000320 Windows Recycle Bin INFO2 file (Win2k - WinXP)
-
-
-##### put in Either Magic/font or Magic/news
-# Acroread or something files wrongly identified as G3 .pfm
-# these have the form \000 \001 any? \002 \000 \000
-# or \000 \001 any? \022 \000 \000
-0 belong&0xffff00ff 0x00010012 PFM data
->4 string \000\000
->6 string >\060 - %s
-
-0 belong&0xffff00ff 0x00010002 PFM data
->4 string \000\000
->6 string >\060 - %s
-#0 string \000\001 pfm?
-#>3 string \022\000\000Copyright\ yes
-#>3 string \002\000\000Copyright\ yes
-#>3 string >\0 oops, not a font file. Cancel that.
-#it clashes with ttf files so put it lower down.
-
-# From Doug Lee via a FreeBSD pr
-9 string GERBILDOC First Choice document
-9 string GERBILDB First Choice database
-9 string GERBILCLIP First Choice database
-0 string GERBIL First Choice device file
-9 string RABBITGRAPH RabbitGraph file
-0 string DCU1 Borland Delphi .DCU file
-0 string =!<spell> MKS Spell hash list (old format)
-0 string =!<spell2> MKS Spell hash list
-# Too simple - MPi
-#0 string AH Halo(TM) bitmapped font file
-0 lelong 0x08086b70 TurboC BGI file
-0 lelong 0x08084b50 TurboC Font file
-
-# WARNING: below line conflicts with Infocom game data Z-machine 3
-0 byte 0x03 DBase 3 data file
->0x04 lelong 0 (no records)
->0x04 lelong >0 (%ld records)
-0 byte 0x83 DBase 3 data file with memo(s)
->0x04 lelong 0 (no records)
->0x04 lelong >0 (%ld records)
-0 leshort 0x0006 DBase 3 index file
-0 string PMCC Windows 3.x .GRP file
-1 string RDC-meg MegaDots
->8 byte >0x2F version %c
->9 byte >0x2F \b.%c file
-0 lelong 0x4C
->4 lelong 0x00021401 Windows shortcut file
-
-# DOS EPS Binary File Header
-# From: Ed Sznyter <ews@Black.Market.NET>
-0 belong 0xC5D0D3C6 DOS EPS Binary File
->4 long >0 Postscript starts at byte %d
->>8 long >0 length %d
->>>12 long >0 Metafile starts at byte %d
->>>>16 long >0 length %d
->>>20 long >0 TIFF starts at byte %d
->>>>24 long >0 length %d
-
-# TNEF magic From "Joomy" <joomy@se-ed.net>
-# Microsoft Outlook's Transport Neutral Encapsulation Format (TNEF)
-0 leshort 0x223e9f78 TNEF
-!:mime application/vnd.ms-tnef
-
-# HtmlHelp files (.chm)
-0 string ITSF\003\000\000\000\x60\000\000\000\001\000\000\000 MS Windows HtmlHelp Data
-
-# GFA-BASIC (Wolfram Kleff)
-2 string GFA-BASIC3 GFA-BASIC 3 data
-
-#------------------------------------------------------------------------------
-# From Stuart Caie <kyzer@4u.net> (developer of cabextract)
-# Microsoft Cabinet files
-0 string MSCF\0\0\0\0 Microsoft Cabinet archive data
-!:mime application/vnd.ms-cab-compressed
->8 lelong x \b, %u bytes
->28 leshort 1 \b, 1 file
->28 leshort >1 \b, %u files
-
-# InstallShield Cabinet files
-0 string ISc( InstallShield Cabinet archive data
->5 byte&0xf0 =0x60 version 6,
->5 byte&0xf0 !0x60 version 4/5,
->(12.l+40) lelong x %u files
-
-# Windows CE package files
-0 string MSCE\0\0\0\0 Microsoft WinCE install header
->20 lelong 0 \b, architecture-independent
->20 lelong 103 \b, Hitachi SH3
->20 lelong 104 \b, Hitachi SH4
->20 lelong 0xA11 \b, StrongARM
->20 lelong 4000 \b, MIPS R4000
->20 lelong 10003 \b, Hitachi SH3
->20 lelong 10004 \b, Hitachi SH3E
->20 lelong 10005 \b, Hitachi SH4
->20 lelong 70001 \b, ARM 7TDMI
->52 leshort 1 \b, 1 file
->52 leshort >1 \b, %u files
->56 leshort 1 \b, 1 registry entry
->56 leshort >1 \b, %u registry entries
-
-
-# Windows Enhanced Metafile (EMF)
-# See msdn.microsoft.com/archive/en-us/dnargdi/html/msdn_enhmeta.asp
-# for further information.
-0 ulelong 1
->40 string \ EMF Windows Enhanced Metafile (EMF) image data
->>44 ulelong x version 0x%x
-
-# From: Alex Beregszaszi <alex@fsn.hu>
-0 string COWD VMWare3
->4 byte 3 disk image
->>32 lelong x (%d/
->>36 lelong x \b%d/
->>40 lelong x \b%d)
->4 byte 2 undoable disk image
->>32 string >\0 (%s)
-
-0 string VMDK VMware4 disk image
-0 string KDMV VMware4 disk image
-
-#--------------------------------------------------------------------
-# Qemu Emulator Images
-# Lines written by Friedrich Schwittay (f.schwittay@yousable.de)
-# Made by reading sources and doing trial and error on existing
-# qcow files
-0 string QFI Qemu Image, Format: Qcow
-
-# Uncomment the following line to display Magic (only used for debugging
-# this magic number)
-#>0 string x , Magic: %s
-
-# There are currently 2 Versions: "1" and "2"
-# I do not use Version 2 and therefor branch here
-# but can assure: it works (tested on both versions)
-# Also my Qemu 0.9.0 which uses this Version 2 refuses
-# to start in its bios
->0x04 belong 2 , Version: 2
->0x04 belong 1 , Version: 1
-
-# Using the existence of the Backing File Offset to Branch or not
-# to read Backing File Information
->>0xc belong >0 , Backing File( Offset: %lu
->>>(0xc.L) string >\0 , Path: %s
-
-# Didn't get the trick here how qemu stores the "Size" at this Position
-# There is actually something stored but nothing makes sense
-# The header in the sources talks about it
-#>>>16 lelong x , Size: %lu
-
-# Modification time of the Backing File
-# Really useful if you want to know if your backing
-# file is still usable together with this image
->>>20 bedate x , Mtime: %s )
-
-# Don't know how to calculate in Magicfiles
-# Also: this Information is not reliably
-# stored in image-files
->>24 lelong x , Disk Size could be: %d * 256 bytes
-
-0 string QEVM QEMU's suspend to disk image
-
-0 string Bochs\ Virtual\ HD\ Image Bochs disk image,
->32 string x type %s,
->48 string x subtype %s
-
-0 lelong 0x02468ace Bochs Sparse disk image
-
-# from http://filext.com by Derek M Jones <derek@knosof.co.uk>
-# False positive with PPT (also currently this string is too long)
-#0 string \xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF\x09\x00\x06 Microsoft Installer
-0 string \320\317\021\340\241\261\032\341 Microsoft Office Document
-#>48 byte 0x1B Excel Document
-#!:mime application/vnd.ms-excel
->546 string bjbj Microsoft Word Document
-!:mime application/msword
->546 string jbjb Microsoft Word Document
-!:mime application/msword
-
-0 string \224\246\056 Microsoft Word Document
-!:mime application/msword
-
-512 string R\0o\0o\0t\0\ \0E\0n\0t\0r\0y Microsoft Word Document
-!:mime application/msword
-
-# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
-# Magic type for Dell's BIOS .hdr files
-# Dell's .hdr
-0 string $RBU
->23 string Dell %s system BIOS
->48 string x version %.3s
-
-# Type: Microsoft DirectDraw Surface
-# URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
-# From: Morten Hustveit <morten@debian.org>
-0 string DDS\040\174\000\000\000 Microsoft DirectDraw Surface (DDS),
->16 lelong >0 %hd x
->12 lelong >0 %hd,
->84 string x %.4s
-
-# Type: Microsoft Document Imaging Format (.mdi)
-# URL: http://en.wikipedia.org/wiki/Microsoft_Document_Imaging_Format
-# From: Daniele Sempione <scrows@oziosi.org>
-0 short 0x5045 Microsoft Document Imaging Format
-
-# MS eBook format (.lit)
-0 string ITOLITLS Microsoft Reader eBook Data
->8 lelong x \b, version %u
-!:mime application/x-ms-reader
-
-#------------------------------------------------------------------------------
-# msvc: file(1) magic for msvc
-# "H. Nanosecond" <aldomel@ix.netcom.com>
-# Microsoft visual C
-#
-# I have version 1.0
-
-# .aps
-0 string HWB\000\377\001\000\000\000 Microsoft Visual C .APS file
-
-# .ide
-#too long 0 string \102\157\162\154\141\156\144\040\103\053\053\040\120\162\157\152\145\143\164\040\106\151\154\145\012\000\032\000\002\000\262\000\272\276\372\316 MSVC .ide
-0 string \102\157\162\154\141\156\144\040\103\053\053\040\120\162\157 MSVC .ide
-
-# .res
-0 string \000\000\000\000\040\000\000\000\377 MSVC .res
-0 string \377\003\000\377\001\000\020\020\350 MSVC .res
-0 string \377\003\000\377\001\000\060\020\350 MSVC .res
-
-#.lib
-0 string \360\015\000\000 Microsoft Visual C library
-0 string \360\075\000\000 Microsoft Visual C library
-0 string \360\175\000\000 Microsoft Visual C library
-
-#.pch
-0 string DTJPCH0\000\022\103\006\200 Microsoft Visual C .pch
-
-# .pdb
-# too long 0 string Microsoft\ C/C++\ program\ database\
-0 string Microsoft\ C/C++\ MSVC program database
->18 string program\ database\
->33 string >\0 ver %s
-
-#.sbr
-0 string \000\002\000\007\000 MSVC .sbr
->5 string >\0 %s
-
-#.bsc
-0 string \002\000\002\001 MSVC .bsc
-
-#.wsp
-0 string 1.00\ .0000.0000\000\003 MSVC .wsp version 1.0000.0000
-# these seem to start with the version and contain menus
-# ------------------------------------------------------------------------
-# mup: file(1) magic for Mup (Music Publisher) input file.
-#
-# From: Abel Cheung <abel (@) oaka.org>
-#
-# NOTE: This header is mainly proposed in the Arkkra mailing list,
-# and is not a mandatory header because of old mup input file
-# compatibility. Noteedit also use mup format, but is not forcing
-# user to use any header as well.
-#
-0 search/1 //!Mup Mup music publication program input text
->6 string -Arkkra (Arkkra)
->>13 string -
->>>16 string .
->>>>14 string x \b, need V%.4s
->>>15 string .
->>>>14 string x \b, need V%.3s
->6 string -
->>9 string .
->>>7 string x \b, need V%.4s
->>8 string .
->>>7 string x \b, need V%.3s
-
-#-----------------------------------------------------------------------------
-# natinst: file(1) magic for National Instruments Code Files
-
-#
-# From <egamez@fcfm.buap.mx> Enrique Gmez-Flores
-# version 1
-# Many formats still missing, we use, for the moment LabVIEW
-# We guess VXI format file. VISA, LabWindowsCVI, BridgeVIEW, etc, are missing
-#
-0 string RSRC National Instruments,
-# Check if it's a LabVIEW File
->8 string LV LabVIEW File,
-# Check wich kind of file is
->>10 string SB Code Resource File, data
->>10 string IN Virtual Instrument Program, data
->>10 string AR VI Library, data
-# This is for Menu Libraries
->8 string LMNULBVW Portable File Names, data
-# This is for General Resources
->8 string rsc Resources File, data
-# This is for VXI Package
-0 string VMAP National Instruments, VXI File, data
-
-#------------------------------------------------------------------------------
-# ncr: file(1) magic for NCR Tower objects
-#
-# contributed by
-# Michael R. Wayne *** TMC & Associates *** INTERNET: wayne@ford-vax.arpa
-# uucp: {philabs | pyramid} !fmsrl7!wayne OR wayne@fmsrl7.UUCP
-#
-0 beshort 000610 Tower/XP rel 2 object
->12 belong >0 not stripped
->20 beshort 0407 executable
->20 beshort 0410 pure executable
->22 beshort >0 - version %ld
-0 beshort 000615 Tower/XP rel 2 object
->12 belong >0 not stripped
->20 beshort 0407 executable
->20 beshort 0410 pure executable
->22 beshort >0 - version %ld
-0 beshort 000620 Tower/XP rel 3 object
->12 belong >0 not stripped
->20 beshort 0407 executable
->20 beshort 0410 pure executable
->22 beshort >0 - version %ld
-0 beshort 000625 Tower/XP rel 3 object
->12 belong >0 not stripped
->20 beshort 0407 executable
->20 beshort 0410 pure executable
->22 beshort >0 - version %ld
-0 beshort 000630 Tower32/600/400 68020 object
->12 belong >0 not stripped
->20 beshort 0407 executable
->20 beshort 0410 pure executable
->22 beshort >0 - version %ld
-0 beshort 000640 Tower32/800 68020
->18 beshort &020000 w/68881 object
->18 beshort &040000 compatible object
->18 beshort &060000 object
->20 beshort 0407 executable
->20 beshort 0413 pure executable
->12 belong >0 not stripped
->22 beshort >0 - version %ld
-0 beshort 000645 Tower32/800 68010
->18 beshort &040000 compatible object
->18 beshort &060000 object
->20 beshort 0407 executable
->20 beshort 0413 pure executable
->12 belong >0 not stripped
->22 beshort >0 - version %ld
-
-#------------------------------------------------------------------------------
-# netbsd: file(1) magic for NetBSD objects
-#
-# All new-style magic numbers are in network byte order.
-#
-
-0 lelong 000000407 a.out NetBSD little-endian object file
->16 lelong >0 not stripped
-0 belong 000000407 a.out NetBSD big-endian object file
->16 belong >0 not stripped
-
-0 belong&0377777777 041400413 a.out NetBSD/i386 demand paged
->0 byte &0x80
->>20 lelong <4096 shared library
->>20 lelong =4096 dynamically linked executable
->>20 lelong >4096 dynamically linked executable
->0 byte ^0x80 executable
->16 lelong >0 not stripped
-0 belong&0377777777 041400410 a.out NetBSD/i386 pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 lelong >0 not stripped
-0 belong&0377777777 041400407 a.out NetBSD/i386
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80
->>0 byte &0x40 position independent
->>20 lelong !0 executable
->>20 lelong =0 object file
->16 lelong >0 not stripped
-0 belong&0377777777 041400507 a.out NetBSD/i386 core
->12 string >\0 from '%s'
->32 lelong !0 (signal %d)
-
-0 belong&0377777777 041600413 a.out NetBSD/m68k demand paged
->0 byte &0x80
->>20 belong <8192 shared library
->>20 belong =8192 dynamically linked executable
->>20 belong >8192 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-0 belong&0377777777 041600410 a.out NetBSD/m68k pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-0 belong&0377777777 041600407 a.out NetBSD/m68k
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80
->>0 byte &0x40 position independent
->>20 belong !0 executable
->>20 belong =0 object file
->16 belong >0 not stripped
-0 belong&0377777777 041600507 a.out NetBSD/m68k core
->12 string >\0 from '%s'
->32 belong !0 (signal %d)
-
-0 belong&0377777777 042000413 a.out NetBSD/m68k4k demand paged
->0 byte &0x80
->>20 belong <4096 shared library
->>20 belong =4096 dynamically linked executable
->>20 belong >4096 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-0 belong&0377777777 042000410 a.out NetBSD/m68k4k pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-0 belong&0377777777 042000407 a.out NetBSD/m68k4k
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80
->>0 byte &0x40 position independent
->>20 belong !0 executable
->>20 belong =0 object file
->16 belong >0 not stripped
-0 belong&0377777777 042000507 a.out NetBSD/m68k4k core
->12 string >\0 from '%s'
->32 belong !0 (signal %d)
-
-0 belong&0377777777 042200413 a.out NetBSD/ns32532 demand paged
->0 byte &0x80
->>20 lelong <4096 shared library
->>20 lelong =4096 dynamically linked executable
->>20 lelong >4096 dynamically linked executable
->0 byte ^0x80 executable
->16 lelong >0 not stripped
-0 belong&0377777777 042200410 a.out NetBSD/ns32532 pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 lelong >0 not stripped
-0 belong&0377777777 042200407 a.out NetBSD/ns32532
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80
->>0 byte &0x40 position independent
->>20 lelong !0 executable
->>20 lelong =0 object file
->16 lelong >0 not stripped
-0 belong&0377777777 042200507 a.out NetBSD/ns32532 core
->12 string >\0 from '%s'
->32 lelong !0 (signal %d)
-
-0 belong&0377777777 045200507 a.out NetBSD/powerpc core
->12 string >\0 from '%s'
-
-0 belong&0377777777 042400413 a.out NetBSD/sparc demand paged
->0 byte &0x80
->>20 belong <8192 shared library
->>20 belong =8192 dynamically linked executable
->>20 belong >8192 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-0 belong&0377777777 042400410 a.out NetBSD/sparc pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-0 belong&0377777777 042400407 a.out NetBSD/sparc
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80
->>0 byte &0x40 position independent
->>20 belong !0 executable
->>20 belong =0 object file
->16 belong >0 not stripped
-0 belong&0377777777 042400507 a.out NetBSD/sparc core
->12 string >\0 from '%s'
->32 belong !0 (signal %d)
-
-0 belong&0377777777 042600413 a.out NetBSD/pmax demand paged
->0 byte &0x80
->>20 lelong <4096 shared library
->>20 lelong =4096 dynamically linked executable
->>20 lelong >4096 dynamically linked executable
->0 byte ^0x80 executable
->16 lelong >0 not stripped
-0 belong&0377777777 042600410 a.out NetBSD/pmax pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 lelong >0 not stripped
-0 belong&0377777777 042600407 a.out NetBSD/pmax
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80
->>0 byte &0x40 position independent
->>20 lelong !0 executable
->>20 lelong =0 object file
->16 lelong >0 not stripped
-0 belong&0377777777 042600507 a.out NetBSD/pmax core
->12 string >\0 from '%s'
->32 lelong !0 (signal %d)
-
-0 belong&0377777777 043000413 a.out NetBSD/vax 1k demand paged
->0 byte &0x80
->>20 lelong <4096 shared library
->>20 lelong =4096 dynamically linked executable
->>20 lelong >4096 dynamically linked executable
->0 byte ^0x80 executable
->16 lelong >0 not stripped
-0 belong&0377777777 043000410 a.out NetBSD/vax 1k pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 lelong >0 not stripped
-0 belong&0377777777 043000407 a.out NetBSD/vax 1k
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80
->>0 byte &0x40 position independent
->>20 lelong !0 executable
->>20 lelong =0 object file
->16 lelong >0 not stripped
-0 belong&0377777777 043000507 a.out NetBSD/vax 1k core
->12 string >\0 from '%s'
->32 lelong !0 (signal %d)
-
-0 belong&0377777777 045400413 a.out NetBSD/vax 4k demand paged
->0 byte &0x80
->>20 lelong <4096 shared library
->>20 lelong =4096 dynamically linked executable
->>20 lelong >4096 dynamically linked executable
->0 byte ^0x80 executable
->16 lelong >0 not stripped
-0 belong&0377777777 045400410 a.out NetBSD/vax 4k pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 lelong >0 not stripped
-0 belong&0377777777 045400407 a.out NetBSD/vax 4k
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80
->>0 byte &0x40 position independent
->>20 lelong !0 executable
->>20 lelong =0 object file
->16 lelong >0 not stripped
-0 belong&0377777777 045400507 a.out NetBSD/vax 4k core
->12 string >\0 from '%s'
->32 lelong !0 (signal %d)
-
-# NetBSD/alpha does not support (and has never supported) a.out objects,
-# so no rules are provided for them. NetBSD/alpha ELF objects are
-# dealt with in "elf".
-0 lelong 0x00070185 ECOFF NetBSD/alpha binary
->10 leshort 0x0001 not stripped
->10 leshort 0x0000 stripped
-0 belong&0377777777 043200507 a.out NetBSD/alpha core
->12 string >\0 from '%s'
->32 lelong !0 (signal %d)
-
-0 belong&0377777777 043400413 a.out NetBSD/mips demand paged
->0 byte &0x80
->>20 belong <8192 shared library
->>20 belong =8192 dynamically linked executable
->>20 belong >8192 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-0 belong&0377777777 043400410 a.out NetBSD/mips pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-0 belong&0377777777 043400407 a.out NetBSD/mips
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80
->>0 byte &0x40 position independent
->>20 belong !0 executable
->>20 belong =0 object file
->16 belong >0 not stripped
-0 belong&0377777777 043400507 a.out NetBSD/mips core
->12 string >\0 from '%s'
->32 belong !0 (signal %d)
-
-0 belong&0377777777 043600413 a.out NetBSD/arm32 demand paged
->0 byte &0x80
->>20 lelong <4096 shared library
->>20 lelong =4096 dynamically linked executable
->>20 lelong >4096 dynamically linked executable
->0 byte ^0x80 executable
->16 lelong >0 not stripped
-0 belong&0377777777 043600410 a.out NetBSD/arm32 pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 lelong >0 not stripped
-0 belong&0377777777 043600407 a.out NetBSD/arm32
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80
->>0 byte &0x40 position independent
->>20 lelong !0 executable
->>20 lelong =0 object file
->16 lelong >0 not stripped
-# NetBSD/arm26 has always used ELF objects, but it shares a core file
-# format with NetBSD/arm32.
-0 belong&0377777777 043600507 a.out NetBSD/arm core
->12 string >\0 from '%s'
->32 lelong !0 (signal %d)
-
-#------------------------------------------------------------------------------
-# netscape: file(1) magic for Netscape files
-# "H. Nanosecond" <aldomel@ix.netcom.com>
-# version 3 and 4 I think
-#
-
-# Netscape Address book .nab
-0 string \000\017\102\104\000\000\000\000\000\000\001\000\000\000\000\002\000\000\000\002\000\000\004\000 Netscape Address book
-
-# Netscape Communicator address book
-0 string \000\017\102\111 Netscape Communicator address book
-
-# .snm Caches
-0 string #\ Netscape\ folder\ cache Netscape folder cache
-0 string \000\036\204\220\000 Netscape folder cache
-# .n2p
-# Net 2 Phone
-#0 string 123\130\071\066\061\071\071\071\060\070\061\060\061\063\060
-0 string SX961999 Net2phone
-
-#
-#This is files ending in .art, FIXME add more rules
-0 string JG\004\016\0\0\0\0 ART
-
-#------------------------------------------------------------------------------
-# netware: file(1) magic for NetWare Loadable Modules (NLMs)
-# From: Mads Martin Joergensen <mmj@suse.de>
-
-0 string NetWare\ Loadable\ Module NetWare Loadable Module
-
-#------------------------------------------------------------------------------
-# news: file(1) magic for SunOS NeWS fonts (not "news" as in "netnews")
-#
-0 string StartFontMetrics ASCII font metrics
-0 string StartFont ASCII font bits
-0 belong 0x137A2944 NeWS bitmap font
-0 belong 0x137A2947 NeWS font family
-0 belong 0x137A2950 scalable OpenFont binary
-0 belong 0x137A2951 encrypted scalable OpenFont binary
-8 belong 0x137A2B45 X11/NeWS bitmap font
-8 belong 0x137A2B48 X11/NeWS font family
-#------------------------------------------------------------------------------
-# nitpicker: file(1) magic for Flowfiles.
-# From: Christian Jachmann <C.Jachmann@gmx.net> http://www.nitpicker.de
-0 string NPFF NItpicker Flow File
->4 byte x V%d.
->5 byte x %d
->6 bedate x started: %s
->10 bedate x stopped: %s
->14 belong x Bytes: %u
->18 belong x Bytes1: %u
->22 belong x Flows: %u
->26 belong x Pkts: %u
-
-#------------------------------------------------------------------------------
-# ocaml: file(1) magic for Objective Caml files.
-0 string Caml1999 OCaml
->8 string X exec file
->8 string I interface file (.cmi)
->8 string O object file (.cmo)
->8 string A library file (.cma)
->8 string Y native object file (.cmx)
->8 string Z native library file (.cmxa)
->8 string M abstract syntax tree implementation file
->8 string N abstract syntax tree interface file
->9 string >\0 (Version %3.3s)
-#------------------------------------------------------------------------------
-# octave binary data file(1) magic, from Dirk Eddelbuettel <edd@debian.org>
-0 string Octave-1-L Octave binary data (little endian)
-0 string Octave-1-B Octave binary data (big endian)
-
-#------------------------------------------------------------------------------
-# Microsoft OLE 2 Compound Documents : file(1) magic for Microsoft Structured
-# storage (http://en.wikipedia.org/wiki/Structured_Storage)
-# Additional tests for OLE 2 Compound Documents should be under this recipe.
-
-0 string \320\317\021\340\241\261\032\341 OLE 2 Compound Document
-# - Microstation V8 DGN files (www.bentley.com)
-# Last update on 10/23/2006 by Lester Hightower
-> 0x480 string D\000g\000n\000~\000H : Microstation V8 DGN
-# - Visio documents
-# Last update on 10/23/2006 by Lester Hightower
-> 0x480 string V\000i\000s\000i\000o\000D\000o\000c : Visio Document
-
-#------------------------------------------------------------------------------
-# olf: file(1) magic for OLF executables
-#
-# We have to check the byte order flag to see what byte order all the
-# other stuff in the header is in.
-#
-# MIPS R3000 may also be for MIPS R2000.
-# What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
-#
-# Created by Erik Theisen <etheisen@openbsd.org>
-# Based on elf from Daniel Quinlan <quinlan@yggdrasil.com>
-0 string \177OLF OLF
->4 byte 0 invalid class
->4 byte 1 32-bit
->4 byte 2 64-bit
->7 byte 0 invalid os
->7 byte 1 OpenBSD
->7 byte 2 NetBSD
->7 byte 3 FreeBSD
->7 byte 4 4.4BSD
->7 byte 5 Linux
->7 byte 6 SVR4
->7 byte 7 esix
->7 byte 8 Solaris
->7 byte 9 Irix
->7 byte 10 SCO
->7 byte 11 Dell
->7 byte 12 NCR
->5 byte 0 invalid byte order
->5 byte 1 LSB
->>16 leshort 0 no file type,
->>16 leshort 1 relocatable,
->>16 leshort 2 executable,
->>16 leshort 3 shared object,
-# Core handling from Peter Tobias <tobias@server.et-inf.fho-emden.de>
-# corrections by Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de>
->>16 leshort 4 core file
->>>(0x38+0xcc) string >\0 of '%s'
->>>(0x38+0x10) lelong >0 (signal %d),
->>16 leshort &0xff00 processor-specific,
->>18 leshort 0 no machine,
->>18 leshort 1 AT&T WE32100 - invalid byte order,
->>18 leshort 2 SPARC - invalid byte order,
->>18 leshort 3 Intel 80386,
->>18 leshort 4 Motorola 68000 - invalid byte order,
->>18 leshort 5 Motorola 88000 - invalid byte order,
->>18 leshort 6 Intel 80486,
->>18 leshort 7 Intel 80860,
->>18 leshort 8 MIPS R3000_BE - invalid byte order,
->>18 leshort 9 Amdahl - invalid byte order,
->>18 leshort 10 MIPS R3000_LE,
->>18 leshort 11 RS6000 - invalid byte order,
->>18 leshort 15 PA-RISC - invalid byte order,
->>18 leshort 16 nCUBE,
->>18 leshort 17 VPP500,
->>18 leshort 18 SPARC32PLUS,
->>18 leshort 20 PowerPC,
->>18 leshort 0x9026 Alpha,
->>20 lelong 0 invalid version
->>20 lelong 1 version 1
->>36 lelong 1 MathCoPro/FPU/MAU Required
->8 string >\0 (%s)
->5 byte 2 MSB
->>16 beshort 0 no file type,
->>16 beshort 1 relocatable,
->>16 beshort 2 executable,
->>16 beshort 3 shared object,
->>16 beshort 4 core file,
->>>(0x38+0xcc) string >\0 of '%s'
->>>(0x38+0x10) belong >0 (signal %d),
->>16 beshort &0xff00 processor-specific,
->>18 beshort 0 no machine,
->>18 beshort 1 AT&T WE32100,
->>18 beshort 2 SPARC,
->>18 beshort 3 Intel 80386 - invalid byte order,
->>18 beshort 4 Motorola 68000,
->>18 beshort 5 Motorola 88000,
->>18 beshort 6 Intel 80486 - invalid byte order,
->>18 beshort 7 Intel 80860,
->>18 beshort 8 MIPS R3000_BE,
->>18 beshort 9 Amdahl,
->>18 beshort 10 MIPS R3000_LE - invalid byte order,
->>18 beshort 11 RS6000,
->>18 beshort 15 PA-RISC,
->>18 beshort 16 nCUBE,
->>18 beshort 17 VPP500,
->>18 beshort 18 SPARC32PLUS,
->>18 beshort 20 PowerPC or cisco 4500,
->>18 beshort 21 cisco 7500,
->>18 beshort 24 cisco SVIP,
->>18 beshort 25 cisco 7200,
->>18 beshort 36 cisco 12000,
->>18 beshort 0x9026 Alpha,
->>20 belong 0 invalid version
->>20 belong 1 version 1
->>36 belong 1 MathCoPro/FPU/MAU Required
-#------------------------------------------------------------------------------
-# os2: file(1) magic for OS/2 files
-#
-
-# Provided 1998/08/22 by
-# David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
-1 search/1 InternetShortcut MS Windows 95 Internet shortcut text
->24 search/1 >\ (URL=<%s>)
-
-# OS/2 URL objects
-# Provided 1998/08/22 by
-# David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
-#0 string http: OS/2 URL object text
-#>5 string >\ (WWW) <http:%s>
-#0 string mailto: OS/2 URL object text
-#>7 string >\ (email) <%s>
-#0 string news: OS/2 URL object text
-#>5 string >\ (Usenet) <%s>
-#0 string ftp: OS/2 URL object text
-#>4 string >\ (FTP) <ftp:%s>
-#0 string file: OS/2 URL object text
-#>5 string >\ (Local file) <%s>
-
-# >>>>> OS/2 INF/HLP <<<<< (source: Daniel Dissett ddissett@netcom.com)
-# Carl Hauser (chauser.parc@xerox.com) and
-# Marcus Groeber (marcusg@ph-cip.uni-koeln.de)
-# list the following header format in inf02a.doc:
-#
-# int16 ID; // ID magic word (5348h = "HS")
-# int8 unknown1; // unknown purpose, could be third letter of ID
-# int8 flags; // probably a flag word...
-# // bit 0: set if INF style file
-# // bit 4: set if HLP style file
-# // patching this byte allows reading HLP files
-# // using the VIEW command, while help files
-# // seem to work with INF settings here as well.
-# int16 hdrsize; // total size of header
-# int16 unknown2; // unknown purpose
-#
-0 string HSP\x01\x9b\x00 OS/2 INF
->107 string >0 (%s)
-0 string HSP\x10\x9b\x00 OS/2 HLP
->107 string >0 (%s)
-
-# OS/2 INI (this is a guess)
-0 string \xff\xff\xff\xff\x14\0\0\0 OS/2 INI
-#------------------------------------------------------------------------------
-# os400: file(1) magic for IBM OS/400 files
-#
-# IBM OS/400 (i5/OS) Save file (SAVF) - gerardo.cacciari@gmail.com
-# In spite of its quite variable format (due to internal memory page
-# length differences between CISC and RISC versions of the OS) the
-# SAVF structure hasn't suitable offsets to identify the catalog
-# header in the first descriptor where there are some useful infos,
-# so we must search in a somewhat large area for a particular string
-# that represents the EBCDIC encoding of 'QSRDSSPC' (save/restore
-# descriptor space) preceded by a two byte constant.
-#
-1090 search/7393 \x19\xDB\xD8\xE2\xD9\xC4\xE2\xE2\xD7\xC3 IBM OS/400 save file data
->&212 byte 0x01 \b, created with SAVOBJ
->&212 byte 0x02 \b, created with SAVLIB
->&212 byte 0x07 \b, created with SAVCFG
->&212 byte 0x08 \b, created with SAVSECDTA
->&212 byte 0x0A \b, created with SAVSECDTA
->&212 byte 0x0B \b, created with SAVDLO
->&212 byte 0x0D \b, created with SAVLICPGM
->&212 byte 0x11 \b, created with SAVCHGOBJ
->&213 byte 0x44 \b, at least V5R4 to open
->&213 byte 0x43 \b, at least V5R3 to open
->&213 byte 0x42 \b, at least V5R2 to open
->&213 byte 0x41 \b, at least V5R1 to open
->&213 byte 0x40 \b, at least V4R5 to open
->&213 byte 0x3F \b, at least V4R4 to open
->&213 byte 0x3E \b, at least V4R3 to open
->&213 byte 0x3C \b, at least V4R2 to open
->&213 byte 0x3D \b, at least V4R1M4 to open
->&213 byte 0x3B \b, at least V4R1 to open
->&213 byte 0x3A \b, at least V3R7 to open
->&213 byte 0x35 \b, at least V3R6 to open
->&213 byte 0x36 \b, at least V3R2 to open
->&213 byte 0x34 \b, at least V3R1 to open
->&213 byte 0x31 \b, at least V3R0M5 to open
->&213 byte 0x30 \b, at least V2R3 to open
-#
-# Copyright (c) 1996 Ignatios Souvatzis. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Ignatios Souvatzis for
-# the NetBSD project.
-# 4. The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-# OS9/6809 module descriptions:
-#
-0 beshort 0x87CD OS9/6809 module:
-#
->6 byte&0x0f 0x00 non-executable
->6 byte&0x0f 0x01 machine language
->6 byte&0x0f 0x02 BASIC I-code
->6 byte&0x0f 0x03 Pascal P-code
->6 byte&0x0f 0x04 C I-code
->6 byte&0x0f 0x05 COBOL I-code
->6 byte&0x0f 0x06 Fortran I-code
-#
->6 byte&0xf0 0x10 program executable
->6 byte&0xf0 0x20 subroutine
->6 byte&0xf0 0x30 multi-module
->6 byte&0xf0 0x40 data module
-#
->6 byte&0xf0 0xC0 system module
->6 byte&0xf0 0xD0 file manager
->6 byte&0xf0 0xE0 device driver
->6 byte&0xf0 0xF0 device descriptor
-#
-# OS9/m68k stuff (to be continued)
-#
-0 beshort 0x4AFC OS9/68K module:
-#
-# attr
->0x14 byte&0x80 0x80 re-entrant
->0x14 byte&0x40 0x40 ghost
->0x14 byte&0x20 0x20 system-state
-#
-# lang:
-#
->0x13 byte 1 machine language
->0x13 byte 2 BASIC I-code
->0x13 byte 3 Pascal P-code
->0x13 byte 4 C I-code
->0x13 byte 5 COBOL I-code
->0x13 byte 6 Fortran I-code
-#
-#
-# type:
-#
->0x12 byte 1 program executable
->0x12 byte 2 subroutine
->0x12 byte 3 multi-module
->0x12 byte 4 data module
->0x12 byte 11 trap library
->0x12 byte 12 system module
->0x12 byte 13 file manager
->0x12 byte 14 device driver
->0x12 byte 15 device descriptor
-#
-# Mach magic number info
-#
-0 long 0xefbe OSF/Rose object
-# I386 magic number info
-#
-0 short 0565 i386 COFF object
-
-#------------------------------------------------------------------------------
-# palm: file(1) magic for PalmOS {.prc,.pdb}: applications, docfiles, and hacks
-#
-# Brian Lalor <blalor@hcirisc.cs.binghamton.edu>
-
-# appl
-60 belong 0x6170706c PalmOS application
->0 string >\0 "%s"
-# TEXt
-60 belong 0x54455874 AportisDoc file
->0 string >\0 "%s"
-# HACK
-60 belong 0x4841434b HackMaster hack
->0 string >\0 "%s"
-
-# Variety of PalmOS document types
-# Michael-John Turner <mj@debian.org>
-# Thanks to Hasan Umit Ezerce <humit@tr-net.net.tr> for his DocType
-60 string BVokBDIC BDicty PalmOS document
->0 string >\0 "%s"
-60 string DB99DBOS DB PalmOS document
->0 string >\0 "%s"
-60 string vIMGView FireViewer/ImageViewer PalmOS document
->0 string >\0 "%s"
-60 string PmDBPmDB HanDBase PalmOS document
->0 string >\0 "%s"
-60 string InfoINDB InfoView PalmOS document
->0 string >\0 "%s"
-60 string ToGoToGo iSilo PalmOS document
->0 string >\0 "%s"
-60 string JfDbJBas JFile PalmOS document
->0 string >\0 "%s"
-60 string JfDbJFil JFile Pro PalmOS document
->0 string >\0 "%s"
-60 string DATALSdb List PalmOS document
->0 string >\0 "%s"
-60 string Mdb1Mdb1 MobileDB PalmOS document
->0 string >\0 "%s"
-60 string PNRdPPrs PeanutPress PalmOS document
->0 string >\0 "%s"
-60 string DataPlkr Plucker PalmOS document
->0 string >\0 "%s"
-60 string DataSprd QuickSheet PalmOS document
->0 string >\0 "%s"
-60 string SM01SMem SuperMemo PalmOS document
->0 string >\0 "%s"
-60 string TEXtTlDc TealDoc PalmOS document
->0 string >\0 "%s"
-60 string InfoTlIf TealInfo PalmOS document
->0 string >\0 "%s"
-60 string DataTlMl TealMeal PalmOS document
->0 string >\0 "%s"
-60 string DataTlPt TealPaint PalmOS document
->0 string >\0 "%s"
-60 string dataTDBP ThinkDB PalmOS document
->0 string >\0 "%s"
-60 string TdatTide Tides PalmOS document
->0 string >\0 "%s"
-60 string ToRaTRPW TomeRaider PalmOS document
->0 string >\0 "%s"
-
-# A GutenPalm zTXT etext for use on Palm Pilots (http://gutenpalm.sf.net)
-# For version 1.xx zTXTs, outputs version and numbers of bookmarks and
-# annotations.
-# For other versions, just outputs version.
-#
-60 string zTXT A GutenPalm zTXT e-book
->0 string >\0 "%s"
->(0x4E.L) byte 0
->>(0x4E.L+1) byte x (v0.%02d)
->(0x4E.L) byte 1
->>(0x4E.L+1) byte x (v1.%02d)
->>>(0x4E.L+10) beshort >0
->>>>(0x4E.L+10) beshort <2 - 1 bookmark
->>>>(0x4E.L+10) beshort >1 - %d bookmarks
->>>(0x4E.L+14) beshort >0
->>>>(0x4E.L+14) beshort <2 - 1 annotation
->>>>(0x4E.L+14) beshort >1 - %d annotations
->(0x4E.L) byte >1 (v%d.
->>(0x4E.L+1) byte x %02d)
-
-# Palm OS .prc file types
-60 string libr Palm OS dynamic library data
->0 string >\0 "%s"
-60 string ptch Palm OS operating system patch data
->0 string >\0 "%s"
-
-# Mobipocket (www.mobipocket.com), donated by Carl Witty
-60 string BOOKMOBI Mobipocket E-book
->0 string >\0 "%s"
-
-#------------------------------------------------------------------------------
-#
-# Parix COFF executables
-# From: Ignatios Souvatzis <ignatios@cs.uni-bonn.de>
-#
-0 beshort&0xfff 0xACE PARIX
->0 byte&0xf0 0x80 T800
->0 byte&0xf0 0x90 T9000
->19 byte&0x02 0x02 executable
->19 byte&0x02 0x00 object
->19 byte&0x0c 0x00 not stripped
-
-#------------------------------------------------------------------------------
-# pbm: file(1) magic for Portable Bitmap files
-#
-# XXX - byte order?
-#
-0 short 0x2a17 "compact bitmap" format (Poskanzer)
-#------------------------------------------------------------------------------
-# pdf: file(1) magic for Portable Document Format
-#
-
-0 string %PDF- PDF document
-!:mime application/pdf
->5 byte x \b, version %c
->7 byte x \b.%c
-
-# From: Nick Schmalenberger <nick@schmalenberger.us>
-# Forms Data Format
-0 string %FDF- FDF document
->5 byte x \b, version %c
->7 byte x \b.%c
-
-#------------------------------------------------------------------------------
-# pdp: file(1) magic for PDP-11 executable/object and APL workspace
-#
-0 lelong 0101555 PDP-11 single precision APL workspace
-0 lelong 0101554 PDP-11 double precision APL workspace
-#
-# PDP-11 a.out
-#
-0 leshort 0407 PDP-11 executable
->8 leshort >0 not stripped
->15 byte >0 - version %ld
-
-0 leshort 0401 PDP-11 UNIX/RT ldp
-0 leshort 0405 PDP-11 old overlay
-
-0 leshort 0410 PDP-11 pure executable
->8 leshort >0 not stripped
->15 byte >0 - version %ld
-
-0 leshort 0411 PDP-11 separate I&D executable
->8 leshort >0 not stripped
->15 byte >0 - version %ld
-
-0 leshort 0437 PDP-11 kernel overlay
-
-# These last three are derived from 2.11BSD file(1)
-0 leshort 0413 PDP-11 demand-paged pure executable
->8 leshort >0 not stripped
-
-0 leshort 0430 PDP-11 overlaid pure executable
->8 leshort >0 not stripped
-
-0 leshort 0431 PDP-11 overlaid separate executable
->8 leshort >0 not stripped
-#------------------------------------------------------------------------------
-# perl: file(1) magic for Larry Wall's perl language.
-#
-# The `eval' lines recognizes an outrageously clever hack.
-# Keith Waclena <keith@cerberus.uchicago.edu>
-# Send additions to <perl5-porters@perl.org>
-0 search/1/b #!\ /bin/perl Perl script text executable
-!:mime text/x-perl
-0 search/1 eval\ "exec\ /bin/perl Perl script text
-!:mime text/x-perl
-0 search/1/b #!\ /usr/bin/perl Perl script text executable
-!:mime text/x-perl
-0 search/1 eval\ "exec\ /usr/bin/perl Perl script text
-!:mime text/x-perl
-0 search/1/b #!\ /usr/local/bin/perl Perl script text executable
-!:mime text/x-perl
-0 search/1 eval\ "exec\ /usr/local/bin/perl Perl script text
-!:mime text/x-perl
-0 search/1 eval\ '(exit\ $?0)'\ &&\ eval\ 'exec Perl script text
-!:mime text/x-perl
-
-
-# by Dmitry V. Levin and Alexey Tourbin
-# check the first line
-0 search/1 package
->0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *; Perl5 module source text
-# not 'p', check other lines
-0 search/1 !p
->0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *;
->>0 regex \^1\ *;|\^(use|sub|my)\ .*[(;{=] Perl5 module source text
-
-
-
-# Perl POD documents
-# From: Tom Hukins <tom@eborcom.com>
-0 search/1/B \=pod\n Perl POD document text
-0 search/1/B \n\=pod\n Perl POD document text
-0 search/1/B \=head1\ Perl POD document text
-0 search/1/B \n\=head1\ Perl POD document text
-0 search/1/B \=head2\ Perl POD document text
-0 search/1/B \n\=head2\ Perl POD document text
-
-# Perl Storable data files.
-0 string perl-store perl Storable (v0.6) data
->4 byte >0 (net-order %d)
->>4 byte &01 (network-ordered)
->>4 byte =3 (major 1)
->>4 byte =2 (major 1)
-
-0 string pst0 perl Storable (v0.7) data
->4 byte >0
->>4 byte &01 (network-ordered)
->>4 byte =5 (major 2)
->>4 byte =4 (major 2)
->>5 byte >0 (minor %d)
-
-#------------------------------------------------------------------------------
-# pgp: file(1) magic for Pretty Good Privacy
-# see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
-#
-0 beshort 0x9900 PGP key public ring
-!:mime application/x-pgp-keyring
-0 beshort 0x9501 PGP key security ring
-!:mime application/x-pgp-keyring
-0 beshort 0x9500 PGP key security ring
-!:mime application/x-pgp-keyring
-0 beshort 0xa600 PGP encrypted data
-#!:mime application/pgp-encrypted
-#0 string -----BEGIN\040PGP text/PGP armored data
-!:mime text/PGP # encoding: armored data
-#>15 string PUBLIC\040KEY\040BLOCK- public key block
-#>15 string MESSAGE- message
-#>15 string SIGNED\040MESSAGE- signed message
-#>15 string PGP\040SIGNATURE- signature
-
-2 string ---BEGIN\ PGP\ PUBLIC\ KEY\ BLOCK- PGP public key block
-!:mime application/pgp-keys
-0 string -----BEGIN\040PGP\40MESSAGE- PGP message
-!:mime application/pgp
-0 string -----BEGIN\040PGP\40SIGNATURE- PGP signature
-!:mime application/pgp-signature
-
-#------------------------------------------------------------------------------
-# pkgadd: file(1) magic for SysV R4 PKG Datastreams
-#
-0 string #\ PaCkAgE\ DaTaStReAm pkg Datastream (SVR4)
-!:mime application/x-svr4-package
-
-#------------------------------------------------------------------------------
-# plan9: file(1) magic for AT&T Bell Labs' Plan 9 executables
-# From: "Stefan A. Haubenthal" <polluks@web.de>
-#
-0 belong 0x00000107 Plan 9 executable, Motorola 68k
-0 belong 0x000001EB Plan 9 executable, Intel 386
-0 belong 0x00000247 Plan 9 executable, Intel 960
-0 belong 0x000002AB Plan 9 executable, SPARC
-0 belong 0x00000407 Plan 9 executable, MIPS R3000
-0 belong 0x0000048B Plan 9 executable, AT&T DSP 3210
-0 belong 0x00000517 Plan 9 executable, MIPS R4000 BE
-0 belong 0x000005AB Plan 9 executable, AMD 29000
-0 belong 0x00000647 Plan 9 executable, ARM 7-something
-0 belong 0x000006EB Plan 9 executable, PowerPC
-0 belong 0x00000797 Plan 9 executable, MIPS R4000 LE
-0 belong 0x0000084B Plan 9 executable, DEC Alpha
-
-#------------------------------------------------------------------------------
-# plus5: file(1) magic for Plus Five's UNIX MUMPS
-#
-# XXX - byte order? Paging Hokey....
-#
-0 short 0x259 mumps avl global
->2 byte >0 (V%d)
->6 byte >0 with %d byte name
->7 byte >0 and %d byte data cells
-0 short 0x25a mumps blt global
->2 byte >0 (V%d)
->8 short >0 - %d byte blocks
->15 byte 0x00 - P/D format
->15 byte 0x01 - P/K/D format
->15 byte 0x02 - K/D format
->15 byte >0x02 - Bad Flags
-
-#------------------------------------------------------------------------------
-# printer: file(1) magic for printer-formatted files
-#
-
-# PostScript, updated by Daniel Quinlan (quinlan@yggdrasil.com)
-0 string %! PostScript document text
-!:mime application/postscript
-!:apple ASPSTEXT
->2 string PS-Adobe- conforming
->>11 string >\0 DSC level %.3s
->>>15 string EPS \b, type %s
->>>15 string Query \b, type %s
->>>15 string ExitServer \b, type %s
->>>15 search/1000 %%LanguageLevel:\
->>>>&0 string >\0 \b, Level %s
-# Some PCs have the annoying habit of adding a ^D as a document separator
-0 string \004%! PostScript document text
-!:mime application/postscript
-!:apple ASPSTEXT
->3 string PS-Adobe- conforming
->>12 string >\0 DSC level %.3s
->>>16 string EPS \b, type %s
->>>16 string Query \b, type %s
->>>16 string ExitServer \b, type %s
->>>16 search/1000 %%LanguageLevel:\
->>>>&0 string >\0 \b, Level %s
-0 string \033%-12345X%!PS PostScript document
-
-# DOS EPS Binary File Header
-# From: Ed Sznyter <ews@Black.Market.NET>
-0 belong 0xC5D0D3C6 DOS EPS Binary File
->4 long >0 Postscript starts at byte %d
->>8 long >0 length %d
->>>12 long >0 Metafile starts at byte %d
->>>>16 long >0 length %d
->>>20 long >0 TIFF starts at byte %d
->>>>24 long >0 length %d
-
-# Summary: Adobe's PostScript Printer Description File
-# Extension: .ppd
-# Reference: http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf, Section 3.8
-# Submitted by: Yves Arrouye <arrouye@marin.fdn.fr>
-#
-0 string *PPD-Adobe:\x20 PPD file
->&0 string x \b, version %s
-
-# HP Printer Job Language
-0 string \033%-12345X@PJL HP Printer Job Language data
-# HP Printer Job Language
-# The header found on Win95 HP plot files is the "Silliest Thing possible"
-# (TM)
-# Every driver puts the language at some random position, with random case
-# (LANGUAGE and Language)
-# For example the LaserJet 5L driver puts the "PJL ENTER LANGUAGE" in line 10
-# From: Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
-#
-0 string \033%-12345X@PJL HP Printer Job Language data
->&0 string >\0 %s
->>&0 string >\0 %s
->>>&0 string >\0 %s
->>>>&0 string >\0 %s
-#>15 string \ ENTER\ LANGUAGE\ =
-#>31 string PostScript PostScript
-
-# HP Printer Control Language, Daniel Quinlan (quinlan@yggdrasil.com)
-0 string \033E\033 HP PCL printer data
->3 string \&l0A - default page size
->3 string \&l1A - US executive page size
->3 string \&l2A - US letter page size
->3 string \&l3A - US legal page size
->3 string \&l26A - A4 page size
->3 string \&l80A - Monarch envelope size
->3 string \&l81A - No. 10 envelope size
->3 string \&l90A - Intl. DL envelope size
->3 string \&l91A - Intl. C5 envelope size
->3 string \&l100A - Intl. B5 envelope size
->3 string \&l-81A - No. 10 envelope size (landscape)
->3 string \&l-90A - Intl. DL envelope size (landscape)
-
-# IMAGEN printer-ready files:
-0 string @document( Imagen printer
-# this only works if "language xxx" is first item in Imagen header.
->10 string language\ impress (imPRESS data)
->10 string language\ daisy (daisywheel text)
->10 string language\ diablo (daisywheel text)
->10 string language\ printer (line printer emulation)
->10 string language\ tektronix (Tektronix 4014 emulation)
-# Add any other languages that your Imagen uses - remember
-# to keep the word `text' if the file is human-readable.
-# [GRR 950115: missing "postscript" or "ultrascript" (whatever it was called)]
-#
-# Now magic for IMAGEN font files...
-0 string Rast RST-format raster font data
->45 string >0 face %s
-# From Jukka Ukkonen
-0 string \033[K\002\0\0\017\033(a\001\0\001\033(g Canon Bubble Jet BJC formatted data
-
-# From <mike@flyn.org>
-# These are the /etc/magic entries to decode data sent to an Epson printer.
-0 string \x1B\x40\x1B\x28\x52\x08\x00\x00REMOTE1P Epson Stylus Color 460 data
-
-
-#------------------------------------------------------------------------------
-# zenographics: file(1) magic for Zenographics ZjStream printer data
-# Rick Richardson rickr@mn.rr.com
-0 string JZJZ
->0x12 string ZZ Zenographics ZjStream printer data (big-endian)
-0 string ZJZJ
->0x12 string ZZ Zenographics ZjStream printer data (little-endian)
-
-
-#------------------------------------------------------------------------------
-# Oak Technologies printer stream
-# Rick Richardson <rickr@mn.rr.com>
-0 string OAK
->0x07 byte 0
->0x0b byte 0 Oak Technologies printer stream
-
-# This would otherwise be recognized as PostScript - nick@debian.org
-0 string %!VMF SunClock's Vector Map Format data
-
-#------------------------------------------------------------------------------
-# HP LaserJet 1000 series downloadable firmware file
-0 string \xbe\xefABCDEFGH HP LaserJet 1000 series downloadable firmware
-
-# From: Paolo <oopla@users.sf.net>
-# Epson ESC/Page, ESC/PageColor
-0 string \x1b\x01@EJL Epson ESC/Page language printer data
-
-#------------------------------------------------------------------------------
-# project: file(1) magic for Project management
-#
-# Magic strings for ftnchek project files. Alexander Mai
-0 string FTNCHEK_\ P project file for ftnchek
->10 string 1 version 2.7
->10 string 2 version 2.8 to 2.10
->10 string 3 version 2.11 or later
-
-#------------------------------------------------------------------------------
-# psdbms: file(1) magic for psdatabase
-#
-0 belong&0xff00ffff 0x56000000 ps database
->1 string >\0 version %s
->4 string >\0 from kernel %s
-#------------------------------------------------------------------------------
-# psion: file(1) magic for Psion handhelds data
-# from: Peter Breitenlohner <peb@mppmu.mpg.de>
-#
-0 lelong 0x10000037 Psion Series 5
->4 lelong 0x10000039 font file
->4 lelong 0x1000003A printer driver
->4 lelong 0x1000003B clipboard
->4 lelong 0x10000042 multi-bitmap image
->4 lelong 0x1000006A application information file
->4 lelong 0x1000006D
->>8 lelong 0x1000007D sketch image
-!:mime image/x-psion-sketch
->>8 lelong 0x1000007E voice note
->>8 lelong 0x1000007F word file
->>8 lelong 0x10000085 OPL program
->>8 lelong 0x10000088 sheet file
->>8 lelong 0x100001C4 EasyFax initialisation file
->4 lelong 0x10000073 OPO module
->4 lelong 0x10000074 OPL application
->4 lelong 0x1000008A exported multi-bitmap image
-
-0 lelong 0x10000041 Psion Series 5 ROM multi-bitmap image
-
-0 lelong 0x10000050 Psion Series 5
->4 lelong 0x1000006D database
->4 lelong 0x100000E4 ini file
-
-0 lelong 0x10000079 Psion Series 5 binary:
->4 lelong 0x00000000 DLL
->4 lelong 0x10000049 comms hardware library
->4 lelong 0x1000004A comms protocol library
->4 lelong 0x1000005D OPX
->4 lelong 0x1000006C application
->4 lelong 0x1000008D DLL
->4 lelong 0x100000AC logical device driver
->4 lelong 0x100000AD physical device driver
->4 lelong 0x100000E5 file transfer protocol
->4 lelong 0x100000E5 file transfer protocol
->4 lelong 0x10000140 printer definition
->4 lelong 0x10000141 printer definition
-
-0 lelong 0x1000007A Psion Series 5 executable
-
-#------------------------------------------------------------------------------
-# pulsar: file(1) magic for Pulsar POP3 daemon binary files
-#
-# http://pulsar.sourceforge.net
-# mailto:rok.papez@lugos.si
-#
-
-0 belong 0x1ee7f11e Pulsar POP3 daemon mailbox cache file.
->4 ubelong x Version: %d.
->8 ubelong x \b%d
-
-
-#------------------------------------------------------------------------------
-# pyramid: file(1) magic for Pyramids
-#
-# XXX - byte order?
-#
-0 long 0x50900107 Pyramid 90x family executable
-0 long 0x50900108 Pyramid 90x family pure executable
->16 long >0 not stripped
-0 long 0x5090010b Pyramid 90x family demand paged pure executable
->16 long >0 not stripped
-
-#------------------------------------------------------------------------------
-# python: file(1) magic for python
-#
-# From: David Necas <yeti@physics.muni.cz>
-# often the module starts with a multiline string
-0 string """ a python script text executable
-# MAGIC as specified in Python/import.c (1.5 to 2.3.0a)
-# 20121 ( YEAR - 1995 ) + MONTH + DAY (little endian followed by "\r\n"
-0 belong 0x994e0d0a python 1.5/1.6 byte-compiled
-0 belong 0x87c60d0a python 2.0 byte-compiled
-0 belong 0x2aeb0d0a python 2.1 byte-compiled
-0 belong 0x2ded0d0a python 2.2 byte-compiled
-0 belong 0x3bf20d0a python 2.3 byte-compiled
-0 belong 0x6df20d0a python 2.4 byte-compiled
-0 belong 0xb3f20d0a python 2.5 byte-compiled
-0 belong 0xd1f20d0a python 2.6 byte-compiled
-
-
-0 string/b #!\ /usr/bin/python python script text executable
-
-
-#------------------------------------------------------------------------------
-# file(1) magic for revision control files
-# From Hendrik Scholz <hendrik@scholz.net>
-0 string /1\ :pserver: cvs password text file
-
-# Conary changesets
-# From: Jonathan Smith <smithj@rpath.com>
-0 belong 0xea3f81bb Conary changeset data
-
-# Type: Git bundles (git-bundle)
-# From: Josh Triplett <josh@freedesktop.org>
-0 string #\ v2\ git\ bundle\n Git bundle
-
-# Type: Git pack
-# From: Adam Buchbinder <adam.buchbinder@gmail.com>
-# The actual magic is 'PACK', but that clashes with Doom/Quake packs. However,
-# those have a little-endian offset immediately following the magic 'PACK',
-# the first byte of which is never 0, while the first byte of the Git pack
-# version, since it's a tiny number stored in big-endian format, is always 0.
-0 string PACK\0 Git pack
->4 belong >0 \b, version %d
->>8 belong >0 \b, %d objects
-
-# Type: Git pack index
-# From: Adam Buchbinder <adam.buchbinder@gmail.com>
-0 string \377tOc Git pack index
->4 belong =2 \b, version 2
-
-# Type: Mercurial bundles
-# From: Seo Sanghyeon <tinuviel@sparcs.kaist.ac.kr>
-0 string HG10 Mercurial bundle,
->4 string UN uncompressed
->4 string BZ bzip2 compressed
-
-# Type: Subversion (SVN) dumps
-# From: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
-0 string SVN-fs-dump-format-version: Subversion dumpfile
->28 string >\0 (version: %s)
-
-# Type: Bazaar revision bundles and merge requests
-# URL: http://www.bazaar-vcs.org/
-# From: Jelmer Vernooij <jelmer@samba.org>
-0 string #\ Bazaar\ revision\ bundle\ v Bazaar Bundle
-0 string #\ Bazaar\ merge\ directive\ format Bazaar merge directive
-
-#------------------------------------------------------------------------------
-# riff: file(1) magic for RIFF format
-# See
-#
-# http://www.seanet.com/users/matts/riffmci/riffmci.htm
-#
-# AVI section extended by Patrik Rdman <patrik+file-magic@iki.fi>
-#
-0 string RIFF RIFF (little-endian) data
-# RIFF Palette format
->8 string PAL \b, palette
->>16 leshort x \b, version %d
->>18 leshort x \b, %d entries
-# RIFF Device Independent Bitmap format
->8 string RDIB \b, device-independent bitmap
->>16 string BM
->>>30 leshort 12 \b, OS/2 1.x format
->>>>34 leshort x \b, %d x
->>>>36 leshort x %d
->>>30 leshort 64 \b, OS/2 2.x format
->>>>34 leshort x \b, %d x
->>>>36 leshort x %d
->>>30 leshort 40 \b, Windows 3.x format
->>>>34 lelong x \b, %d x
->>>>38 lelong x %d x
->>>>44 leshort x %d
-# RIFF MIDI format
->8 string RMID \b, MIDI
-# RIFF Multimedia Movie File format
->8 string RMMP \b, multimedia movie
-# RIFF wrapper for MP3
->8 string RMP3 \b, MPEG Layer 3 audio
-# Microsoft WAVE format (*.wav)
->8 string WAVE \b, WAVE audio
-!:mime audio/x-wav
->>20 leshort 1 \b, Microsoft PCM
->>>34 leshort >0 \b, %d bit
->>20 leshort 2 \b, Microsoft ADPCM
->>20 leshort 6 \b, ITU G.711 A-law
->>20 leshort 7 \b, ITU G.711 mu-law
->>20 leshort 8 \b, Microsoft DTS
->>20 leshort 17 \b, IMA ADPCM
->>20 leshort 20 \b, ITU G.723 ADPCM (Yamaha)
->>20 leshort 49 \b, GSM 6.10
->>20 leshort 64 \b, ITU G.721 ADPCM
->>20 leshort 80 \b, MPEG
->>20 leshort 85 \b, MPEG Layer 3
->>20 leshort 0x2001 \b, DTS
->>22 leshort =1 \b, mono
->>22 leshort =2 \b, stereo
->>22 leshort >2 \b, %d channels
->>24 lelong >0 %d Hz
-# Corel Draw Picture
->8 string CDRA \b, Corel Draw Picture
-!:mime image/x-coreldraw
-# AVI == Audio Video Interleave
->8 string AVI\040 \b, AVI
-!:mime video/x-msvideo
->>12 string LIST
->>>20 string hdrlavih
->>>>&36 lelong x \b, %lu x
->>>>&40 lelong x %lu,
->>>>&4 lelong >1000000 <1 fps,
->>>>&4 lelong 1000000 1.00 fps,
->>>>&4 lelong 500000 2.00 fps,
->>>>&4 lelong 333333 3.00 fps,
->>>>&4 lelong 250000 4.00 fps,
->>>>&4 lelong 200000 5.00 fps,
->>>>&4 lelong 166667 6.00 fps,
->>>>&4 lelong 142857 7.00 fps,
->>>>&4 lelong 125000 8.00 fps,
->>>>&4 lelong 111111 9.00 fps,
->>>>&4 lelong 100000 10.00 fps,
-# ]9.9,10.1[
->>>>&4 lelong <101010
->>>>>&-4 lelong >99010
->>>>>>&-4 lelong !100000 ~10 fps,
->>>>&4 lelong 83333 12.00 fps,
-# ]11.9,12.1[
->>>>&4 lelong <84034
->>>>>&-4 lelong >82645
->>>>>>&-4 lelong !83333 ~12 fps,
->>>>&4 lelong 66667 15.00 fps,
-# ]14.9,15.1[
->>>>&4 lelong <67114
->>>>>&-4 lelong >66225
->>>>>>&-4 lelong !66667 ~15 fps,
->>>>&4 lelong 50000 20.00 fps,
->>>>&4 lelong 41708 23.98 fps,
->>>>&4 lelong 41667 24.00 fps,
-# ]23.9,24.1[
->>>>&4 lelong <41841
->>>>>&-4 lelong >41494
->>>>>>&-4 lelong !41708
->>>>>>>&-4 lelong !41667 ~24 fps,
->>>>&4 lelong 40000 25.00 fps,
-# ]24.9,25.1[
->>>>&4 lelong <40161
->>>>>&-4 lelong >39841
->>>>>>&-4 lelong !40000 ~25 fps,
->>>>&4 lelong 33367 29.97 fps,
->>>>&4 lelong 33333 30.00 fps,
-# ]29.9,30.1[
->>>>&4 lelong <33445
->>>>>&-4 lelong >33223
->>>>>>&-4 lelong !33367
->>>>>>>&-4 lelong !33333 ~30 fps,
->>>>&4 lelong <32224 >30 fps,
-##>>>>&4 lelong x (%lu)
-##>>>>&20 lelong x %lu frames,
-# Note: The tests below assume that the AVI has 1 or 2 streams,
-# "vids" optionally followed by "auds".
-# (Should cover 99.9% of all AVIs.)
-# assuming avih length = 56
->>>88 string LIST
->>>>96 string strlstrh
->>>>>108 string vids video:
->>>>>>&0 lelong 0 uncompressed
-# skip past vids strh
->>>>>>(104.l+108) string strf
->>>>>>>(104.l+132) lelong 1 RLE 8bpp
->>>>>>>(104.l+132) string/c cvid Cinepak
->>>>>>>(104.l+132) string/c i263 Intel I.263
->>>>>>>(104.l+132) string/c iv32 Indeo 3.2
->>>>>>>(104.l+132) string/c iv41 Indeo 4.1
->>>>>>>(104.l+132) string/c iv50 Indeo 5.0
->>>>>>>(104.l+132) string/c mp42 Microsoft MPEG-4 v2
->>>>>>>(104.l+132) string/c mp43 Microsoft MPEG-4 v3
->>>>>>>(104.l+132) string/c fmp4 FFMpeg MPEG-4
->>>>>>>(104.l+132) string/c mjpg Motion JPEG
->>>>>>>(104.l+132) string/c div3 DivX 3
->>>>>>>>112 string/c div3 Low-Motion
->>>>>>>>112 string/c div4 Fast-Motion
->>>>>>>(104.l+132) string/c divx DivX 4
->>>>>>>(104.l+132) string/c dx50 DivX 5
->>>>>>>(104.l+132) string/c xvid XviD
->>>>>>>(104.l+132) string/c h264 H.264
->>>>>>>(104.l+132) string/c wmv3 Windows Media Video 9
->>>>>>>(104.l+132) string/c h264 X.264 or H.264
->>>>>>>(104.l+132) lelong 0
-##>>>>>>>(104.l+132) string x (%.4s)
-# skip past first (video) LIST
->>>>(92.l+96) string LIST
->>>>>(92.l+104) string strlstrh
->>>>>>(92.l+116) string auds \b, audio:
-# auds strh length = 56:
->>>>>>>(92.l+172) string strf
->>>>>>>>(92.l+180) leshort 0x0001 uncompressed PCM
->>>>>>>>(92.l+180) leshort 0x0002 ADPCM
->>>>>>>>(92.l+180) leshort 0x0006 aLaw
->>>>>>>>(92.l+180) leshort 0x0007 uLaw
->>>>>>>>(92.l+180) leshort 0x0050 MPEG-1 Layer 1 or 2
->>>>>>>>(92.l+180) leshort 0x0055 MPEG-1 Layer 3
->>>>>>>>(92.l+180) leshort 0x2000 Dolby AC3
->>>>>>>>(92.l+180) leshort 0x0161 DivX
-##>>>>>>>>(92.l+180) leshort x (0x%.4x)
->>>>>>>>(92.l+182) leshort 1 (mono,
->>>>>>>>(92.l+182) leshort 2 (stereo,
->>>>>>>>(92.l+182) leshort >2 (%d channels,
->>>>>>>>(92.l+184) lelong x %d Hz)
-# auds strh length = 64:
->>>>>>>(92.l+180) string strf
->>>>>>>>(92.l+188) leshort 0x0001 uncompressed PCM
->>>>>>>>(92.l+188) leshort 0x0002 ADPCM
->>>>>>>>(92.l+188) leshort 0x0055 MPEG-1 Layer 3
->>>>>>>>(92.l+188) leshort 0x2000 Dolby AC3
->>>>>>>>(92.l+188) leshort 0x0161 DivX
-##>>>>>>>>(92.l+188) leshort x (0x%.4x)
->>>>>>>>(92.l+190) leshort 1 (mono,
->>>>>>>>(92.l+190) leshort 2 (stereo,
->>>>>>>>(92.l+190) leshort >2 (%d channels,
->>>>>>>>(92.l+192) lelong x %d Hz)
-# Animated Cursor format
->8 string ACON \b, animated cursor
-# SoundFont 2 <mpruett@sgi.com>
->8 string sfbk SoundFont/Bank
-# MPEG-1 wrapped in a RIFF, apparently
->8 string CDXA \b, wrapped MPEG-1 (CDXA)
->8 string 4XMV \b, 4X Movie file
-
-#
-# XXX - some of the below may only appear in little-endian form.
-#
-# Also "MV93" appears to be for one form of Macromedia Director
-# files, and "GDMF" appears to be another multimedia format.
-#
-0 string RIFX RIFF (big-endian) data
-# RIFF Palette format
->8 string PAL \b, palette
->>16 beshort x \b, version %d
->>18 beshort x \b, %d entries
-# RIFF Device Independent Bitmap format
->8 string RDIB \b, device-independent bitmap
->>16 string BM
->>>30 beshort 12 \b, OS/2 1.x format
->>>>34 beshort x \b, %d x
->>>>36 beshort x %d
->>>30 beshort 64 \b, OS/2 2.x format
->>>>34 beshort x \b, %d x
->>>>36 beshort x %d
->>>30 beshort 40 \b, Windows 3.x format
->>>>34 belong x \b, %d x
->>>>38 belong x %d x
->>>>44 beshort x %d
-# RIFF MIDI format
->8 string RMID \b, MIDI
-# RIFF Multimedia Movie File format
->8 string RMMP \b, multimedia movie
-# Microsoft WAVE format (*.wav)
->8 string WAVE \b, WAVE audio
->>20 leshort 1 \b, Microsoft PCM
->>>34 leshort >0 \b, %d bit
->>22 beshort =1 \b, mono
->>22 beshort =2 \b, stereo
->>22 beshort >2 \b, %d channels
->>24 belong >0 %d Hz
-# Corel Draw Picture
->8 string CDRA \b, Corel Draw Picture
-# AVI == Audio Video Interleave
->8 string AVI\040 \b, AVI
-# Animated Cursor format
->8 string ACON \b, animated cursor
-# Notation Interchange File Format (big-endian only)
->8 string NIFF \b, Notation Interchange File Format
-# SoundFont 2 <mpruett@sgi.com>
->8 string sfbk SoundFont/Bank
-#------------------------------------------------------------------------------
-#
-# RPM: file(1) magic for Red Hat Packages Erik Troan (ewt@redhat.com)
-#
-0 beshort 0xedab
->2 beshort 0xeedb RPM
-!:mime application/x-rpm
->>4 byte x v%d
->>6 beshort 0 bin
->>6 beshort 1 src
->>8 beshort 1 i386
->>8 beshort 2 Alpha
->>8 beshort 3 Sparc
->>8 beshort 4 MIPS
->>8 beshort 5 PowerPC
->>8 beshort 6 68000
->>8 beshort 7 SGI
->>8 beshort 8 RS6000
->>8 beshort 9 IA64
->>8 beshort 10 Sparc64
->>8 beshort 11 MIPSel
->>8 beshort 12 ARM
->>10 string x %s
-
-#------------------------------------------------------------------------------
-# rtf: file(1) magic for Rich Text Format (RTF)
-#
-# Duncan P. Simpson, D.P.Simpson@dcs.warwick.ac.uk
-#
-0 string {\\rtf Rich Text Format data,
-!:mime text/rtf
->5 string 1 version 1,
->>6 string \\ansi ANSI
->>6 string \\mac Apple Macintosh
->>6 string \\pc IBM PC, code page 437
->>6 string \\pca IBM PS/2, code page 850
->>6 default x unknown character set
->5 default x unknown version
-#------------------------------------------------------------------------------
-# ruby: file(1) magic for Lua scripting language
-# URL: http://www.ruby-lang.org/
-# From: Reuben Thomas <rrt@sc3d.org>
-
-# Ruby scripts
-0 search/1/b #!\ /usr/bin/ruby Ruby script text executable
-!:mime application/x-ruby
-0 search/1/b #!\ /usr/local/bin/ruby Ruby script text executable
-!:mime application/x-ruby
-0 search/1 #!/usr/bin/env\ ruby Ruby script text executable
-!:mime application/x-ruby
-0 search/1 #!\ /usr/bin/env\ ruby Ruby script text executable
-!:mime application/x-ruby
-
-#------------------------------------------------------------------------------
-# sc: file(1) magic for "sc" spreadsheet
-#
-38 string Spreadsheet sc spreadsheet file
-!:mime application/x-sc
-
-#------------------------------------------------------------------------------
-# sccs: file(1) magic for SCCS archives
-#
-# SCCS archive structure:
-# \001h01207
-# \001s 00276/00000/00000
-# \001d D 1.1 87/09/23 08:09:20 ian 1 0
-# \001c date and time created 87/09/23 08:09:20 by ian
-# \001e
-# \001u
-# \001U
-# ... etc.
-# Now '\001h' happens to be the same as the 3B20's a.out magic number (0550).
-# *Sigh*. And these both came from various parts of the USG.
-# Maybe we should just switch everybody from SCCS to RCS!
-# Further, you can't just say '\001h0', because the five-digit number
-# is a checksum that could (presumably) have any leading digit,
-# and we don't have regular expression matching yet.
-# Hence the following official kludge:
-8 string \001s\ SCCS archive data
-#------------------------------------------------------------------------------
-# scientific: file(1) magic for scientific formats
-#
-# From: Joe Krahn <krahn@niehs.nih.gov>
-
-########################################################
-# CCP4 data and plot files:
-0 string MTZ\040 MTZ reflection file
-
-92 string PLOT%%84 Plot84 plotting file
->52 byte 1 , Little-endian
->55 byte 1 , Big-endian
-
-########################################################
-# Electron density MAP/MASK formats
-
-0 string EZD_MAP NEWEZD Electron Density Map
-109 string MAP\040( Old EZD Electron Density Map
-
-0 string/c :-)\040Origin BRIX Electron Density Map
->170 string >0 , Sigma:%.12s
-#>4 string >0 %.178s
-#>4 addr x %.178s
-
-7 string 18\040!NTITLE XPLOR ASCII Electron Density Map
-9 string \040!NTITLE\012\040REMARK CNS ASCII electron density map
-
-208 string MAP\040 CCP4 Electron Density Map
-# Assumes same stamp for float and double (normal case)
->212 byte 17 \b, Big-endian
->212 byte 34 \b, VAX format
->212 byte 68 \b, Little-endian
->212 byte 85 \b, Convex native
-
-############################################################
-# X-Ray Area Detector images
-0 string R-AXIS4\ \ \ R-Axis Area Detector Image:
->796 lelong <20 Little-endian, IP #%d,
->>768 lelong >0 Size=%dx
->>772 lelong >0 \b%d
->796 belong <20 Big-endian, IP #%d,
->>768 belong >0 Size=%dx
->>772 belong >0 \b%d
-
-0 string RAXIS\ \ \ \ \ R-Axis Area Detector Image, Win32:
->796 lelong <20 Little-endian, IP #%d,
->>768 lelong >0 Size=%dx
->>772 lelong >0 \b%d
->796 belong <20 Big-endian, IP #%d,
->>768 belong >0 Size=%dx
->>772 belong >0 \b%d
-
-
-1028 string MMX\000\000\000\000\000\000\000\000\000\000\000\000\000 MAR Area Detector Image,
->1072 ulong >1 Compressed(%d),
->1100 ulong >1 %d headers,
->1104 ulong >0 %d x
->1108 ulong >0 %d,
->1120 ulong >0 %d bits/pixel
-
-# Type: GEDCOM genealogical (family history) data
-# From: Giuseppe Bilotta
-0 search/1/c 0\ HEAD GEDCOM genealogy text
->&0 search 1\ GEDC
->>&0 search 2\ VERS version
->>>&1 search/1 >\0 %s
-# From: Phil Endecott <phil05@chezphil.org>
-0 string \000\060\000\040\000\110\000\105\000\101\000\104 GEDCOM data
-0 string \060\000\040\000\110\000\105\000\101\000\104\000 GEDCOM data
-0 string \376\377\000\060\000\040\000\110\000\105\000\101\000\104 GEDCOM data
-0 string \377\376\060\000\040\000\110\000\105\000\101\000\104\000 GEDCOM data
-0 search/1 -----BEGIN\ CERTIFICATE------ RFC1421 Security Certificate text
-0 search/1 -----BEGIN\ NEW\ CERTIFICATE RFC1421 Security Certificate Signing Request text
-0 belong 0xedfeedfe Sun 'jks' Java Keystore File data
-# Type: SE Linux policy modules *.pp reference policy
-# for Fedora 5 to 9, RHEL5, and Debian Etch and Lenny.
-# URL: http://doc.coker.com.au/computers/selinux-magic
-# From: Russell Coker <russell@coker.com.au>
-
-0 lelong 0xf97cff8f SE Linux modular policy
->4 lelong x version %d,
->8 lelong x %d sections,
->>(12.l) lelong 0xf97cff8d
->>>(12.l+27) lelong x mod version %d,
->>>(12.l+31) lelong 0 Not MLS,
->>>(12.l+31) lelong 1 MLS,
->>>(12.l+23) lelong 2
->>>>(12.l+47) string >\0 module name %s
->>>(12.l+23) lelong 1 base
-
-1 string policy_module( SE Linux policy module source
-2 string policy_module( SE Linux policy module source
-
-0 string ##\ <summary> SE Linux policy interface source
-
-#0 search gen_context( SE Linux policy file contexts
-
-#0 search gen_sens( SE Linux policy MLS constraints source
-
-#------------------------------------------------------------------------------
-# sendmail: file(1) magic for sendmail config files
-#
-# XXX - byte order?
-#
-0 byte 046 Sendmail frozen configuration
->16 string >\0 - version %s
-0 short 0x271c Sendmail frozen configuration
->16 string >\0 - version %s
-
-#------------------------------------------------------------------------------
-# sendmail: file(1) magic for sendmail m4(1) files
-#
-# From Hendrik Scholz <hendrik@scholz.net>
-# i.e. files in /usr/share/sendmail/cf/
-#
-0 string divert(-1)\n sendmail m4 text file
-
-
-#------------------------------------------------------------------------------
-# sequent: file(1) magic for Sequent machines
-#
-# Sequent information updated by Don Dwiggins <atsun!dwiggins>.
-# For Sequent's multiprocessor systems (incomplete).
-0 lelong 0x00ea BALANCE NS32000 .o
->16 lelong >0 not stripped
->124 lelong >0 version %ld
-0 lelong 0x10ea BALANCE NS32000 executable (0 @ 0)
->16 lelong >0 not stripped
->124 lelong >0 version %ld
-0 lelong 0x20ea BALANCE NS32000 executable (invalid @ 0)
->16 lelong >0 not stripped
->124 lelong >0 version %ld
-0 lelong 0x30ea BALANCE NS32000 standalone executable
->16 lelong >0 not stripped
->124 lelong >0 version %ld
-#
-# Symmetry information added by Jason Merrill <jason@jarthur.claremont.edu>.
-# Symmetry magic nums will not be reached if DOS COM comes before them;
-# byte 0xeb is matched before these get a chance.
-0 leshort 0x12eb SYMMETRY i386 .o
->16 lelong >0 not stripped
->124 lelong >0 version %ld
-0 leshort 0x22eb SYMMETRY i386 executable (0 @ 0)
->16 lelong >0 not stripped
->124 lelong >0 version %ld
-0 leshort 0x32eb SYMMETRY i386 executable (invalid @ 0)
->16 lelong >0 not stripped
->124 lelong >0 version %ld
-0 leshort 0x42eb SYMMETRY i386 standalone executable
->16 lelong >0 not stripped
->124 lelong >0 version %ld
-
-#------------------------------------------------------------------------------
-# sgi: file(1) magic for Silicon Graphics applications
-
-#
-#
-# Performance Co-Pilot file types
-0 string PmNs PCP compiled namespace (V.0)
-0 string PmN PCP compiled namespace
->3 string >\0 (V.%1.1s)
-#3 lelong 0x84500526 PCP archive
-3 belong 0x84500526 PCP archive
->7 byte x (V.%d)
-#>20 lelong -2 temporal index
-#>20 lelong -1 metadata
-#>20 lelong 0 log volume #0
-#>20 lelong >0 log volume #%ld
->20 belong -2 temporal index
->20 belong -1 metadata
->20 belong 0 log volume #0
->20 belong >0 log volume #%ld
->24 string >\0 host: %s
-0 string PCPFolio PCP
->9 string Version: Archive Folio
->18 string >\0 (V.%s)
-0 string #pmchart PCP pmchart view
->9 string Version
->17 string >\0 (V%-3.3s)
-0 string #kmchart PCP kmchart view
->9 string Version
->17 string >\0 (V.%s)
-0 string pmview PCP pmview config
->7 string Version
->15 string >\0 (V%-3.3s)
-0 string #pmlogger PCP pmlogger config
->10 string Version
->18 string >\0 (V%1.1s)
-0 string #pmdahotproc PCP pmdahotproc config
->13 string Version
->21 string >\0 (V%-3.3s)
-0 string PcPh PCP Help
->4 string 1 Index
->4 string 2 Text
->5 string >\0 (V.%1.1s)
-0 string #pmieconf-rules PCP pmieconf rules
->16 string >\0 (V.%1.1s)
-3 string pmieconf-pmie PCP pmie config
->17 string >\0 (V.%1.1s)
-
-# SpeedShop data files
-0 lelong 0x13130303 SpeedShop data file
-
-# mdbm files
-0 lelong 0x01023962 mdbm file, version 0 (obsolete)
-0 string mdbm mdbm file,
->5 byte x version %d,
->6 byte x 2^%d pages,
->7 byte x pagesize 2^%d,
->17 byte x hash %d,
->11 byte x dataformat %d
-
-# Alias Maya files
-0 string //Maya ASCII Alias Maya Ascii File,
->13 string >\0 version %s
-8 string MAYAFOR4 Alias Maya Binary File,
->32 string >\0 version %s scene
-8 string MayaFOR4 Alias Maya Binary File,
->32 string >\0 version %s scene
-8 string CIMG Alias Maya Image File
-8 string DEEP Alias Maya Image File
-#------------------------------------------------------------------------------
-# Type: SVG Vectorial Graphics
-# From: Noel Torres <tecnico@ejerciciosresueltos.com>
-0 string \<?xml\ version="
->15 string >\0
->>23 search/400 \<svg SVG Scalable Vector Graphics image
-!:mime image/svg+xml
->>23 search/400 \<gnc-v2 GnuCash file
-!:mime application/x-gnucash
-
-# Sitemap file
-0 string \<?xml\ version="
->15 string >\0
->>23 search/400 \<urlset XML Sitemap document text
-!:mime application/xml-sitemap
-
-#------------------------------------------------------------------------------
-# sgml: file(1) magic for Standard Generalized Markup Language
-# HyperText Markup Language (HTML) is an SGML document type,
-# from Daniel Quinlan (quinlan@yggdrasil.com)
-# adapted to string extenstions by Anthon van der Neut <anthon@mnt.org)
-0 search/1/cB \<!doctype\ html HTML document text
-!:mime text/html
-0 search/1/cb \<head HTML document text
-!:mime text/html
-0 search/1/cb \<title HTML document text
-!:mime text/html
-0 search/1/cb \<html HTML document text
-!:mime text/html
-
-# Extensible markup language (XML), a subset of SGML
-# from Marc Prud'hommeaux (marc@apocalypse.org)
-0 search/1/cb \<?xml XML document text
-!:mime application/xml
-0 string \<?xml\ version\ " XML
-!:mime application/xml
-0 string \<?xml\ version=" XML
-!:mime application/xml
->15 search/1 >\0 %.3s document text
->>23 search/1 \<xsl:stylesheet (XSL stylesheet)
->>24 search/1 \<xsl:stylesheet (XSL stylesheet)
-0 string \<?xml\ version=' XML
-!:mime application/xml
->15 search/1 >\0 %.3s document text
->>23 search/1 \<xsl:stylesheet (XSL stylesheet)
->>24 search/1 \<xsl:stylesheet (XSL stylesheet)
-0 search/1/b \<?xml XML document text
-!:mime application/xml
-0 search/1/b \<?XML broken XML document text
-!:mime application/xml
-
-
-# SGML, mostly from rph@sq
-0 search/1/cb \<!doctype exported SGML document text
-0 search/1/cb \<!subdoc exported SGML subdocument text
-0 search/1/cb \<!-- exported SGML document text
-
-# Web browser cookie files
-# (Mozilla, Galeon, Netscape 4, Konqueror..)
-# Ulf Harnhammar <ulfh@update.uu.se>
-0 search/1 #\ HTTP\ Cookie\ File Web browser cookie text
-0 search/1 #\ Netscape\ HTTP\ Cookie\ File Netscape cookie text
-0 search/1 #\ KDE\ Cookie\ File Konqueror cookie text
-
-#------------------------------------------------------------------------
-# file(1) magic for sharc files
-#
-# SHARC DSP, MIDI SysEx and RiscOS filetype definitions added by
-# FutureGroove Music (dsp@futuregroove.de)
-
-#------------------------------------------------------------------------
-#0 string Draw RiscOS Drawfile
-#0 string PACK RiscOS PackdDir archive
-
-#------------------------------------------------------------------------
-# SHARC DSP stuff (based on the FGM SHARC DSP SDK)
-
-#0 string =! Assembler source
-#0 string Analog ADi asm listing file
-0 string .SYSTEM SHARC architecture file
-0 string .system SHARC architecture file
-
-0 leshort 0x521C SHARC COFF binary
->2 leshort >1 , %hd sections
->>12 lelong >0 , not stripped
-
-#------------------------------------------------------------------------------
-# sinclair: file(1) sinclair QL
-
-# additions to /etc/magic by Thomas M. Ott (ThMO)
-
-# Sinclair QL floppy disk formats (ThMO)
-0 string =QL5 QL disk dump data,
->3 string =A 720 KB,
->3 string =B 1.44 MB,
->3 string =C 3.2 MB,
->4 string >\0 label:%.10s
-
-# Sinclair QL OS dump (ThMO)
-# (NOTE: if `file' would be able to use indirect references in a endian format
-# differing from the natural host format, this could be written more
-# reliably and faster...)
-#
-# we *can't* lookup QL OS code dumps, because `file' is UNABLE to read more
-# than the first 8K of a file... #-(
-#
-#0 belong =0x30000
-#>49124 belong <47104
-#>>49128 belong <47104
-#>>>49132 belong <47104
-#>>>>49136 belong <47104 QL OS dump data,
-#>>>>>49148 string >\0 type %.3s,
-#>>>>>49142 string >\0 version %.4s
-
-# Sinclair QL firmware executables (ThMO)
-0 string NqNqNq`\004 QL firmware executable (BCPL)
-
-# Sinclair QL libraries (was ThMO)
-0 beshort 0xFB01 QDOS object
->2 pstring x '%s'
-
-# Sinclair QL executables (was ThMO)
-4 belong 0x4AFB QDOS executable
->9 pstring x '%s'
-
-# Sinclair QL ROM (ThMO)
-0 belong =0x4AFB0001 QL plugin-ROM data,
->9 pstring =\0 un-named
->9 pstring >\0 named: %s
-# Type: SiSU Markup Language
-# URL: http://www.sisudoc.org/
-# From: Ralph Amissah <ralph.amissah@gmail.com>
-
-0 regex \^%?[\ \t]*SiSU[\ \t]+insert SiSU text insert
->5 regex [0-9.]+ %s
-
-0 regex \^%[\ \t]+SiSU[\ \t]+master SiSU text master
->5 regex [0-9.]+ %s
-
-0 regex \^%?[\ \t]*SiSU[\ \t]+text SiSU text
->5 regex [0-9.]+ %s
-
-0 regex \^%?[\ \t]*SiSU[\ \t][0-9.]+ SiSU text
->5 regex [0-9.]+ %s
-
-0 regex \^%*[\ \t]*sisu-[0-9.]+ SiSU text
->5 regex [0-9.]+ %s
-#------------------------------------------------------------------------------
-# Sketch Drawings: http://sketch.sourceforge.net/
-# From: Edwin Mons <e@ik.nu>
-0 search/1 ##Sketch Sketch document text
-
-#-----------------------------------------------
-# GNU Smalltalk image, starting at version 1.6.2
-# From: catull_us@yahoo.com
-#
-0 string GSTIm\0\0 GNU SmallTalk
-# little-endian
->7 byte&1 =0 LE image version
->>10 byte x %d.
->>9 byte x \b%d.
->>8 byte x \b%d
-#>>12 lelong x , data: %ld
-#>>16 lelong x , table: %ld
-#>>20 lelong x , memory: %ld
-# big-endian
->7 byte&1 =1 BE image version
->>8 byte x %d.
->>9 byte x \b%d.
->>10 byte x \b%d
-#>>12 belong x , data: %ld
-#>>16 belong x , table: %ld
-#>>20 belong x , memory: %ld
-
-
-
-#------------------------------------------------------------------------------
-# sniffer: file(1) magic for packet capture files
-#
-# From: guy@alum.mit.edu (Guy Harris)
-#
-
-#
-# Microsoft Network Monitor 1.x capture files.
-#
-0 string RTSS NetMon capture file
->5 byte x - version %d
->4 byte x \b.%d
->6 leshort 0 (Unknown)
->6 leshort 1 (Ethernet)
->6 leshort 2 (Token Ring)
->6 leshort 3 (FDDI)
->6 leshort 4 (ATM)
-
-#
-# Microsoft Network Monitor 2.x capture files.
-#
-0 string GMBU NetMon capture file
->5 byte x - version %d
->4 byte x \b.%d
->6 leshort 0 (Unknown)
->6 leshort 1 (Ethernet)
->6 leshort 2 (Token Ring)
->6 leshort 3 (FDDI)
->6 leshort 4 (ATM)
-
-#
-# Network General Sniffer capture files.
-# Sorry, make that "Network Associates Sniffer capture files."
-# Sorry, make that "Network General old DOS Sniffer capture files."
-#
-0 string TRSNIFF\ data\ \ \ \ \032 Sniffer capture file
->33 byte 2 (compressed)
->23 leshort x - version %d
->25 leshort x \b.%d
->32 byte 0 (Token Ring)
->32 byte 1 (Ethernet)
->32 byte 2 (ARCNET)
->32 byte 3 (StarLAN)
->32 byte 4 (PC Network broadband)
->32 byte 5 (LocalTalk)
->32 byte 6 (Znet)
->32 byte 7 (Internetwork Analyzer)
->32 byte 9 (FDDI)
->32 byte 10 (ATM)
-
-#
-# Cinco Networks NetXRay capture files.
-# Sorry, make that "Network General Sniffer Basic capture files."
-# Sorry, make that "Network Associates Sniffer Basic capture files."
-# Sorry, make that "Network Associates Sniffer Basic, and Windows
-# Sniffer Pro", capture files."
-# Sorry, make that "Network General Sniffer capture files."
-#
-0 string XCP\0 NetXRay capture file
->4 string >\0 - version %s
->44 leshort 0 (Ethernet)
->44 leshort 1 (Token Ring)
->44 leshort 2 (FDDI)
->44 leshort 3 (WAN)
->44 leshort 8 (ATM)
->44 leshort 9 (802.11)
-
-#
-# "libpcap" capture files.
-# (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
-# the main program that uses that format, but there are other programs
-# that use "libpcap", or that use the same capture file format.)
-#
-0 ubelong 0xa1b2c3d4 tcpdump capture file (big-endian)
->4 beshort x - version %d
->6 beshort x \b.%d
->20 belong 0 (No link-layer encapsulation
->20 belong 1 (Ethernet
->20 belong 2 (3Mb Ethernet
->20 belong 3 (AX.25
->20 belong 4 (ProNET
->20 belong 5 (CHAOS
->20 belong 6 (Token Ring
->20 belong 7 (BSD ARCNET
->20 belong 8 (SLIP
->20 belong 9 (PPP
->20 belong 10 (FDDI
->20 belong 11 (RFC 1483 ATM
->20 belong 12 (raw IP
->20 belong 13 (BSD/OS SLIP
->20 belong 14 (BSD/OS PPP
->20 belong 19 (Linux ATM Classical IP
->20 belong 50 (PPP or Cisco HDLC
->20 belong 51 (PPP-over-Ethernet
->20 belong 99 (Symantec Enterprise Firewall
->20 belong 100 (RFC 1483 ATM
->20 belong 101 (raw IP
->20 belong 102 (BSD/OS SLIP
->20 belong 103 (BSD/OS PPP
->20 belong 104 (BSD/OS Cisco HDLC
->20 belong 105 (802.11
->20 belong 106 (Linux Classical IP over ATM
->20 belong 107 (Frame Relay
->20 belong 108 (OpenBSD loopback
->20 belong 109 (OpenBSD IPsec encrypted
->20 belong 112 (Cisco HDLC
->20 belong 113 (Linux "cooked"
->20 belong 114 (LocalTalk
->20 belong 117 (OpenBSD PFLOG
->20 belong 119 (802.11 with Prism header
->20 belong 122 (RFC 2625 IP over Fibre Channel
->20 belong 123 (SunATM
->20 belong 127 (802.11 with radiotap header
->20 belong 129 (Linux ARCNET
->20 belong 138 (Apple IP over IEEE 1394
->20 belong 140 (MTP2
->20 belong 141 (MTP3
->20 belong 143 (DOCSIS
->20 belong 144 (IrDA
->20 belong 147 (Private use 0
->20 belong 148 (Private use 1
->20 belong 149 (Private use 2
->20 belong 150 (Private use 3
->20 belong 151 (Private use 4
->20 belong 152 (Private use 5
->20 belong 153 (Private use 6
->20 belong 154 (Private use 7
->20 belong 155 (Private use 8
->20 belong 156 (Private use 9
->20 belong 157 (Private use 10
->20 belong 158 (Private use 11
->20 belong 159 (Private use 12
->20 belong 160 (Private use 13
->20 belong 161 (Private use 14
->20 belong 162 (Private use 15
->20 belong 163 (802.11 with AVS header
->16 belong x \b, capture length %d)
-0 ulelong 0xa1b2c3d4 tcpdump capture file (little-endian)
->4 leshort x - version %d
->6 leshort x \b.%d
->20 lelong 0 (No link-layer encapsulation
->20 lelong 1 (Ethernet
->20 lelong 2 (3Mb Ethernet
->20 lelong 3 (AX.25
->20 lelong 4 (ProNET
->20 lelong 5 (CHAOS
->20 lelong 6 (Token Ring
->20 lelong 7 (ARCNET
->20 lelong 8 (SLIP
->20 lelong 9 (PPP
->20 lelong 10 (FDDI
->20 lelong 11 (RFC 1483 ATM
->20 lelong 12 (raw IP
->20 lelong 13 (BSD/OS SLIP
->20 lelong 14 (BSD/OS PPP
->20 lelong 19 (Linux ATM Classical IP
->20 lelong 50 (PPP or Cisco HDLC
->20 lelong 51 (PPP-over-Ethernet
->20 lelong 99 (Symantec Enterprise Firewall
->20 lelong 100 (RFC 1483 ATM
->20 lelong 101 (raw IP
->20 lelong 102 (BSD/OS SLIP
->20 lelong 103 (BSD/OS PPP
->20 lelong 104 (BSD/OS Cisco HDLC
->20 lelong 105 (802.11
->20 lelong 106 (Linux Classical IP over ATM
->20 lelong 107 (Frame Relay
->20 lelong 108 (OpenBSD loopback
->20 lelong 109 (OpenBSD IPsec encrypted
->20 lelong 112 (Cisco HDLC
->20 lelong 113 (Linux "cooked"
->20 lelong 114 (LocalTalk
->20 lelong 117 (OpenBSD PFLOG
->20 lelong 119 (802.11 with Prism header
->20 lelong 122 (RFC 2625 IP over Fibre Channel
->20 lelong 123 (SunATM
->20 lelong 127 (802.11 with radiotap header
->20 lelong 129 (Linux ARCNET
->20 lelong 138 (Apple IP over IEEE 1394
->20 lelong 140 (MTP2
->20 lelong 141 (MTP3
->20 lelong 143 (DOCSIS
->20 lelong 144 (IrDA
->20 lelong 147 (Private use 0
->20 lelong 148 (Private use 1
->20 lelong 149 (Private use 2
->20 lelong 150 (Private use 3
->20 lelong 151 (Private use 4
->20 lelong 152 (Private use 5
->20 lelong 153 (Private use 6
->20 lelong 154 (Private use 7
->20 lelong 155 (Private use 8
->20 lelong 156 (Private use 9
->20 lelong 157 (Private use 10
->20 lelong 158 (Private use 11
->20 lelong 159 (Private use 12
->20 lelong 160 (Private use 13
->20 lelong 161 (Private use 14
->20 lelong 162 (Private use 15
->20 lelong 163 (802.11 with AVS header
->16 lelong x \b, capture length %d)
-
-#
-# "libpcap"-with-Alexey-Kuznetsov's-patches capture files.
-# (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
-# the main program that uses that format, but there are other programs
-# that use "libpcap", or that use the same capture file format.)
-#
-0 ubelong 0xa1b2cd34 extended tcpdump capture file (big-endian)
->4 beshort x - version %d
->6 beshort x \b.%d
->20 belong 0 (No link-layer encapsulation
->20 belong 1 (Ethernet
->20 belong 2 (3Mb Ethernet
->20 belong 3 (AX.25
->20 belong 4 (ProNET
->20 belong 5 (CHAOS
->20 belong 6 (Token Ring
->20 belong 7 (ARCNET
->20 belong 8 (SLIP
->20 belong 9 (PPP
->20 belong 10 (FDDI
->20 belong 11 (RFC 1483 ATM
->20 belong 12 (raw IP
->20 belong 13 (BSD/OS SLIP
->20 belong 14 (BSD/OS PPP
->16 belong x \b, capture length %d)
-0 ulelong 0xa1b2cd34 extended tcpdump capture file (little-endian)
->4 leshort x - version %d
->6 leshort x \b.%d
->20 lelong 0 (No link-layer encapsulation
->20 lelong 1 (Ethernet
->20 lelong 2 (3Mb Ethernet
->20 lelong 3 (AX.25
->20 lelong 4 (ProNET
->20 lelong 5 (CHAOS
->20 lelong 6 (Token Ring
->20 lelong 7 (ARCNET
->20 lelong 8 (SLIP
->20 lelong 9 (PPP
->20 lelong 10 (FDDI
->20 lelong 11 (RFC 1483 ATM
->20 lelong 12 (raw IP
->20 lelong 13 (BSD/OS SLIP
->20 lelong 14 (BSD/OS PPP
->16 lelong x \b, capture length %d)
-
-#
-# AIX "iptrace" capture files.
-#
-0 string iptrace\ 1.0 "iptrace" capture file
-0 string iptrace\ 2.0 "iptrace" capture file
-
-#
-# Novell LANalyzer capture files.
-#
-0 leshort 0x1001 LANalyzer capture file
-0 leshort 0x1007 LANalyzer capture file
-
-#
-# HP-UX "nettl" capture files.
-#
-0 string \x54\x52\x00\x64\x00 "nettl" capture file
-
-#
-# RADCOM WAN/LAN Analyzer capture files.
-#
-0 string \x42\xd2\x00\x34\x12\x66\x22\x88 RADCOM WAN/LAN Analyzer capture file
-
-#
-# NetStumbler log files. Not really packets, per se, but about as
-# close as you can get. These are log files from NetStumbler, a
-# Windows program, that scans for 802.11b networks.
-#
-0 string NetS NetStumbler log file
->8 lelong x \b, %d stations found
-
-#
-# EtherPeek/AiroPeek "version 9" capture files.
-#
-0 string \177ver EtherPeek/AiroPeek capture file
-
-#
-# Visual Networks traffic capture files.
-#
-0 string \x05VNF Visual Networks traffic capture file
-
-#
-# Network Instruments Observer capture files.
-#
-0 string ObserverPktBuffe Network Instruments Observer capture file
-
-#
-# Files from Accellent Group's 5View products.
-#
-0 string \xaa\xaa\xaa\xaa 5View capture file
-#------------------------------------------------------------------------------
-# softquad: file(1) magic for SoftQuad Publishing Software
-#
-# Author/Editor and RulesBuilder
-#
-# XXX - byte order?
-#
-0 string \<!SQ\ DTD> Compiled SGML rules file
->9 string >\0 Type %s
-0 string \<!SQ\ A/E> A/E SGML Document binary
->9 string >\0 Type %s
-0 string \<!SQ\ STS> A/E SGML binary styles file
->9 string >\0 Type %s
-0 short 0xc0de Compiled PSI (v1) data
-0 short 0xc0da Compiled PSI (v2) data
->3 string >\0 (%s)
-# Binary sqtroff font/desc files...
-0 short 0125252 SoftQuad DESC or font file binary
->2 short >0 - version %d
-# Bitmaps...
-0 search/1 SQ\ BITMAP1 SoftQuad Raster Format text
-#0 string SQ\ BITMAP2 SoftQuad Raster Format data
-# sqtroff intermediate language (replacement for ditroff int. lang.)
-0 string X\ SoftQuad troff Context intermediate
->2 string 495 for AT&T 495 laser printer
->2 string hp for Hewlett-Packard LaserJet
->2 string impr for IMAGEN imPRESS
->2 string ps for PostScript
-
-# From: Michael Piefel <piefel@debian.org>
-# sqtroff intermediate language (replacement for ditroff int. lang.)
-0 string X\ 495 SoftQuad troff Context intermediate for AT&T 495 laser printer
-0 string X\ hp SoftQuad troff Context intermediate for HP LaserJet
-0 string X\ impr SoftQuad troff Context intermediate for IMAGEN imPRESS
-0 string X\ ps SoftQuad troff Context intermediate for PostScript
-
-#------------------------------------------------------------------------------
-# spec: file(1) magic for SPEC raw results (*.raw, *.rsf)
-#
-# Cloyce D. Spradling <cloyce@headgear.org>
-
-0 string spec SPEC
->4 string .cpu CPU
->>8 string <: \b%.4s
->>12 string . raw result text
-
-17 string version=SPECjbb SPECjbb
->32 string <: \b%.4s
->>37 string <: v%.4s raw result text
-
-0 string BEGIN\040SPECWEB SPECweb
->13 string <: \b%.2s
->>15 string _SSL \b_SSL
->>>20 string <: v%.4s raw result text
->>16 string <: v%.4s raw result text
-
-#------------------------------------------------------------------------------
-# spectrum: file(1) magic for Spectrum emulator files.
-#
-# John Elliott <jce@seasip.demon.co.uk>
-
-#
-# Spectrum +3DOS header
-#
-0 string PLUS3DOS\032 Spectrum +3 data
->15 byte 0 - BASIC program
->15 byte 1 - number array
->15 byte 2 - character array
->15 byte 3 - memory block
->>16 belong 0x001B0040 (screen)
->15 byte 4 - Tasword document
->15 string TAPEFILE - ZXT tapefile
-#
-# Tape file. This assumes the .TAP starts with a Spectrum-format header,
-# which nearly all will.
-#
-# Update: Sanity-check string contents to be printable.
-# -Adam Buchbinder <adam.buchbinder@gmail.com>
-#
-0 string \023\000\000
->4 string >\0
->>4 string <\177 Spectrum .TAP data "%-10.10s"
->>>3 byte 0 - BASIC program
->>>3 byte 1 - number array
->>>3 byte 2 - character array
->>>3 byte 3 - memory block
->>>>14 belong 0x001B0040 (screen)
-
-# The following three blocks are from pak21-spectrum@srcf.ucam.org
-# TZX tape images
-0 string ZXTape!\x1a Spectrum .TZX data
->8 byte x version %d
->9 byte x \b.%d
-
-# RZX input recording files
-0 string RZX! Spectrum .RZX data
->4 byte x version %d
->5 byte x \b.%d
-
-# Floppy disk images
-0 string MV\ -\ CPCEMU\ Disk-Fil Amstrad/Spectrum .DSK data
-0 string MV\ -\ CPC\ format\ Dis Amstrad/Spectrum DU54 .DSK data
-0 string EXTENDED\ CPC\ DSK\ Fil Amstrad/Spectrum Extended .DSK data
-0 string SINCLAIR Spectrum .SCL Betadisk image
-
-# Hard disk images
-0 string RS-IDE\x1a Spectrum .HDF hard disk image
->7 byte x \b, version 0x%02x
-
-#------------------------------------------------------------------------------
-# sql: file(1) magic for SQL files
-#
-# From: "Marty Leisner" <mleisner@eng.mc.xerox.com>
-# Recognize some MySQL files.
-#
-0 beshort 0xfe01 MySQL table definition file
->2 byte x Version %d
-0 belong&0xffffff00 0xfefe0300 MySQL MISAM index file
->3 byte x Version %d
-0 belong&0xffffff00 0xfefe0700 MySQL MISAM compressed data file
->3 byte x Version %d
-0 belong&0xffffff00 0xfefe0500 MySQL ISAM index file
->3 byte x Version %d
-0 belong&0xffffff00 0xfefe0600 MySQL ISAM compressed data file
->3 byte x Version %d
-0 string \376bin MySQL replication log
-
-#------------------------------------------------------------------------------
-# iRiver H Series database file
-# From Ken Guest <ken@linux.ie>
-# As observed from iRivNavi.iDB and unencoded firmware
-#
-0 string iRivDB iRiver Database file
->11 string >\0 Version %s
->39 string iHP-100 [H Series]
-
-#------------------------------------------------------------------------------
-# SQLite database files
-# Ken Guest <ken@linux.ie>, Ty Sarna, Zack Weinberg
-#
-# Version 1 used GDBM internally; its files cannot be distinguished
-# from other GDBM files.
-#
-# Version 2 used this format:
-0 string **\ This\ file\ contains\ an\ SQLite SQLite 2.x database
-
-# Version 3 of SQLite allows applications to embed their own "user version"
-# number in the database. Detect this and distinguish those files.
-
-0 string SQLite\ format\ 3
->60 string _MTN Monotone source repository
->60 belong !0 SQLite 3.x database, user version %u
->60 belong 0 SQLite 3.x database
-# Type: OpenSSH key files
-# From: Nicolas Collignon <tsointsoin@gmail.com>
-
-0 string SSH\ PRIVATE\ KEY OpenSSH RSA1 private key,
->28 string >\0 version %s
-
-0 string ssh-dss\ OpenSSH DSA public key
-0 string ssh-rsa\ OpenSSH RSA public key
-# Type: OpenSSL certificates/key files
-# From: Nicolas Collignon <tsointsoin@gmail.com>
-
-0 string -----BEGIN\ CERTIFICATE----- PEM certificate
-0 string -----BEGIN\ CERTIFICATE\ REQ PEM certificate request
-0 string -----BEGIN\ RSA\ PRIVATE PEM RSA private key
-0 string -----BEGIN\ DSA\ PRIVATE PEM DSA private key
-
-#------------------------------------------------------------------------------
-# sun: file(1) magic for Sun machines
-#
-# Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x
-# releases. (5.x uses ELF.)
-#
-0 belong&077777777 0600413 sparc demand paged
->0 byte &0x80
->>20 belong <4096 shared library
->>20 belong =4096 dynamically linked executable
->>20 belong >4096 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-
-0 belong&077777777 0600410 sparc pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-
-0 belong&077777777 0600407 sparc
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-
-0 belong&077777777 0400413 mc68020 demand paged
->0 byte &0x80
->>20 belong <4096 shared library
->>20 belong =4096 dynamically linked executable
->>20 belong >4096 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-
-0 belong&077777777 0400410 mc68020 pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-
-0 belong&077777777 0400407 mc68020
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-
-0 belong&077777777 0200413 mc68010 demand paged
->0 byte &0x80
->>20 belong <4096 shared library
->>20 belong =4096 dynamically linked executable
->>20 belong >4096 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-
-0 belong&077777777 0200410 mc68010 pure
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-
-0 belong&077777777 0200407 mc68010
->0 byte &0x80 dynamically linked executable
->0 byte ^0x80 executable
->16 belong >0 not stripped
-
-# reworked these to avoid anything beginning with zero becoming "old sun-2"
-0 belong 0407 old sun-2 executable
->16 belong >0 not stripped
-0 belong 0410 old sun-2 pure executable
->16 belong >0 not stripped
-0 belong 0413 old sun-2 demand paged executable
->16 belong >0 not stripped
-
-#
-# Core files. "SPARC 4.x BCP" means "core file from a SunOS 4.x SPARC
-# binary executed in compatibility mode under SunOS 5.x".
-#
-0 belong 0x080456 SunOS core file
->4 belong 432 (SPARC)
->>132 string >\0 from '%s'
->>116 belong =3 (quit)
->>116 belong =4 (illegal instruction)
->>116 belong =5 (trace trap)
->>116 belong =6 (abort)
->>116 belong =7 (emulator trap)
->>116 belong =8 (arithmetic exception)
->>116 belong =9 (kill)
->>116 belong =10 (bus error)
->>116 belong =11 (segmentation violation)
->>116 belong =12 (bad argument to system call)
->>116 belong =29 (resource lost)
->>120 belong x (T=%dK,
->>124 belong x D=%dK,
->>128 belong x S=%dK)
->4 belong 826 (68K)
->>128 string >\0 from '%s'
->4 belong 456 (SPARC 4.x BCP)
->>152 string >\0 from '%s'
-# Sun SunPC
-0 long 0xfa33c08e SunPC 4.0 Hard Disk
-0 string #SUNPC_CONFIG SunPC 4.0 Properties Values
-# Sun snoop (see RFC 1761, which describes the capture file format).
-#
-0 string snoop Snoop capture file
->8 belong >0 - version %ld
->12 belong 0 (IEEE 802.3)
->12 belong 1 (IEEE 802.4)
->12 belong 2 (IEEE 802.5)
->12 belong 3 (IEEE 802.6)
->12 belong 4 (Ethernet)
->12 belong 5 (HDLC)
->12 belong 6 (Character synchronous)
->12 belong 7 (IBM channel-to-channel adapter)
->12 belong 8 (FDDI)
->12 belong 9 (Unknown)
-
-# Microsoft ICM color profile
-36 string acspMSFT Microsoft ICM Color Profile
-# Sun KCMS
-36 string acsp Kodak Color Management System, ICC Profile
-
-#---------------------------------------------------------------------------
-# The following entries have been tested by Duncan Laurie <duncan@sun.com> (a
-# lead Sun/Cobalt developer) who agrees that they are good and worthy of
-# inclusion.
-
-# Boot ROM images for Sun/Cobalt Linux server appliances
-0 string Cobalt\ Networks\ Inc.\nFirmware\ v Paged COBALT boot rom
->38 string x V%.4s
-
-# New format for Sun/Cobalt boot ROMs is annoying, it stores the version code
-# at the very end where file(1) can't get it.
-0 string CRfs COBALT boot rom data (Flat boot rom or file system)
-
-
-#------------------------------------------------------------------------
-# sysex: file(1) magic for MIDI sysex files
-#
-#
-0 byte 0xF0 SysEx File -
-
-# North American Group
->1 byte 0x01 Sequential
->1 byte 0x02 IDP
->1 byte 0x03 OctavePlateau
->1 byte 0x04 Moog
->1 byte 0x05 Passport
->1 byte 0x06 Lexicon
->1 byte 0x07 Kurzweil/Future Retro
->>3 byte 0x77 777
->>4 byte 0x00 Bank
->>4 byte 0x01 Song
->>5 byte 0x0f 16
->>5 byte 0x0e 15
->>5 byte 0x0d 14
->>5 byte 0x0c 13
->>5 byte 0x0b 12
->>5 byte 0x0a 11
->>5 byte 0x09 10
->>5 byte 0x08 9
->>5 byte 0x07 8
->>5 byte 0x06 7
->>5 byte 0x05 6
->>5 byte 0x04 5
->>5 byte 0x03 4
->>5 byte 0x02 3
->>5 byte 0x01 2
->>5 byte 0x00 1
->>5 byte 0x10 (ALL)
->>2 byte x \b, Channel %d
->1 byte 0x08 Fender
->1 byte 0x09 Gulbransen
->1 byte 0x0a AKG
->1 byte 0x0b Voyce
->1 byte 0x0c Waveframe
->1 byte 0x0d ADA
->1 byte 0x0e Garfield
->1 byte 0x0f Ensoniq
->1 byte 0x10 Oberheim
->>2 byte 0x06 Matrix 6 series
->>3 byte 0x0A Dump (All)
->>3 byte 0x01 Dump (Bank)
->>4 belong 0x0002040E Matrix 1000
->>>11 byte <2 User bank %d
->>>11 byte >1 Preset bank %d
->1 byte 0x11 Apple
->1 byte 0x12 GreyMatter
->1 byte 0x14 PalmTree
->1 byte 0x15 JLCooper
->1 byte 0x16 Lowrey
->1 byte 0x17 AdamsSmith
->1 byte 0x18 E-mu
->1 byte 0x19 Harmony
->1 byte 0x1a ART
->1 byte 0x1b Baldwin
->1 byte 0x1c Eventide
->1 byte 0x1d Inventronics
->1 byte 0x1f Clarity
-
-# European Group
->1 byte 0x21 SIEL
->1 byte 0x22 Synthaxe
->1 byte 0x24 Hohner
->1 byte 0x25 Twister
->1 byte 0x26 Solton
->1 byte 0x27 Jellinghaus
->1 byte 0x28 Southworth
->1 byte 0x29 PPG
->1 byte 0x2a JEN
->1 byte 0x2b SSL
->1 byte 0x2c AudioVertrieb
-
->1 byte 0x2f ELKA
->>3 byte 0x09 EK-44
-
->1 byte 0x30 Dynacord
->1 byte 0x31 Jomox
->1 byte 0x33 Clavia
->1 byte 0x39 Soundcraft
-# Some Waldorf info from http://Stromeko.Synth.net/Downloads#WaldorfDocs
->1 byte 0x3e Waldorf
->>2 byte 0x00 microWave
->>2 byte 0x0E microwave2 / XT
->>2 byte 0x0F Q / Q+
->>3 byte =0 (default id)
->>3 byte >0 (
->>>3 byte <0x7F \bdevice %d)
->>>3 byte =0x7F \bbroadcast id)
->>3 byte 0x7f Microwave I
->>>4 byte 0x00 SNDR (Sound Request)
->>>4 byte 0x10 SNDD (Sound Dump)
->>>4 byte 0x20 SNDP (Sound Parameter Change)
->>>4 byte 0x30 SNDQ (Sound Parameter Inquiry)
->>>4 byte 0x70 BOOT (Sound Reserved)
->>>4 byte 0x01 MULR (Multi Request)
->>>4 byte 0x11 MULD (Multi Dump)
->>>4 byte 0x21 MULP (Multi Parameter Change)
->>>4 byte 0x31 MULQ (Multi Parameter Inquiry)
->>>4 byte 0x71 OS (Multi Reserved)
->>>4 byte 0x02 DRMR (Drum Map Request)
->>>4 byte 0x12 DRMD (Drum Map Dump)
->>>4 byte 0x22 DRMP (Drum Map Parameter Change)
->>>4 byte 0x32 DRMQ (Drum Map Parameter Inquiry)
->>>4 byte 0x72 BIN (Drum Map Reserved)
->>>4 byte 0x03 PATR (Sequencer Pattern Request)
->>>4 byte 0x13 PATD (Sequencer Pattern Dump)
->>>4 byte 0x23 PATP (Sequencer Pattern Parameter Change)
->>>4 byte 0x33 PATQ (Sequencer Pattern Parameter Inquiry)
->>>4 byte 0x73 AFM (Sequencer Pattern Reserved)
->>>4 byte 0x04 GLBR (Global Parameter Request)
->>>4 byte 0x14 GLBD (Global Parameter Dump)
->>>4 byte 0x24 GLBP (Global Parameter Parameter Change)
->>>4 byte 0x34 GLBQ (Global Parameter Parameter Inquiry)
->>>4 byte 0x07 MODR (Mode Parameter Request)
->>>4 byte 0x17 MODD (Mode Parameter Dump)
->>>4 byte 0x27 MODP (Mode Parameter Parameter Change)
->>>4 byte 0x37 MODQ (Mode Parameter Parameter Inquiry)
->>2 byte 0x10 microQ
->>>4 byte 0x00 SNDR (Sound Request)
->>>4 byte 0x10 SNDD (Sound Dump)
->>>4 byte 0x20 SNDP (Sound Parameter Change)
->>>4 byte 0x30 SNDQ (Sound Parameter Inquiry)
->>>4 byte 0x70 (Sound Reserved)
->>>4 byte 0x01 MULR (Multi Request)
->>>4 byte 0x11 MULD (Multi Dump)
->>>4 byte 0x21 MULP (Multi Parameter Change)
->>>4 byte 0x31 MULQ (Multi Parameter Inquiry)
->>>4 byte 0x71 OS (Multi Reserved)
->>>4 byte 0x02 DRMR (Drum Map Request)
->>>4 byte 0x12 DRMD (Drum Map Dump)
->>>4 byte 0x22 DRMP (Drum Map Parameter Change)
->>>4 byte 0x32 DRMQ (Drum Map Parameter Inquiry)
->>>4 byte 0x72 BIN (Drum Map Reserved)
->>>4 byte 0x04 GLBR (Global Parameter Request)
->>>4 byte 0x14 GLBD (Global Parameter Dump)
->>>4 byte 0x24 GLBP (Global Parameter Parameter Change)
->>>4 byte 0x34 GLBQ (Global Parameter Parameter Inquiry)
->>2 byte 0x11 rackAttack
->>>4 byte 0x00 SNDR (Sound Parameter Request)
->>>4 byte 0x10 SNDD (Sound Parameter Dump)
->>>4 byte 0x20 SNDP (Sound Parameter Parameter Change)
->>>4 byte 0x30 SNDQ (Sound Parameter Parameter Inquiry)
->>>4 byte 0x01 PRGR (Program Parameter Request)
->>>4 byte 0x11 PRGD (Program Parameter Dump)
->>>4 byte 0x21 PRGP (Program Parameter Parameter Change)
->>>4 byte 0x31 PRGQ (Program Parameter Parameter Inquiry)
->>>4 byte 0x71 OS (Program Parameter Reserved)
->>>4 byte 0x03 PATR (Pattern Parameter Request)
->>>4 byte 0x13 PATD (Pattern Parameter Dump)
->>>4 byte 0x23 PATP (Pattern Parameter Parameter Change)
->>>4 byte 0x33 PATQ (Pattern Parameter Parameter Inquiry)
->>>4 byte 0x04 GLBR (Global Parameter Request)
->>>4 byte 0x14 GLBD (Global Parameter Dump)
->>>4 byte 0x24 GLBP (Global Parameter Parameter Change)
->>>4 byte 0x34 GLBQ (Global Parameter Parameter Inquiry)
->>>4 byte 0x05 EFXR (FX Parameter Request)
->>>4 byte 0x15 EFXD (FX Parameter Dump)
->>>4 byte 0x25 EFXP (FX Parameter Parameter Change)
->>>4 byte 0x35 EFXQ (FX Parameter Parameter Inquiry)
->>>4 byte 0x07 MODR (Mode Command Request)
->>>4 byte 0x17 MODD (Mode Command Dump)
->>>4 byte 0x27 MODP (Mode Command Parameter Change)
->>>4 byte 0x37 MODQ (Mode Command Parameter Inquiry)
->>2 byte 0x03 Wave
->>>4 byte 0x00 SBPR (Soundprogram)
->>>4 byte 0x01 SAPR (Performance)
->>>4 byte 0x02 SWAVE (Wave)
->>>4 byte 0x03 SWTBL (Wave control table)
->>>4 byte 0x04 SVT (Velocity Curve)
->>>4 byte 0x05 STT (Tuning Table)
->>>4 byte 0x06 SGLB (Global Parameters)
->>>4 byte 0x07 SARRMAP (Performance Program Change Map)
->>>4 byte 0x08 SBPRMAP (Sound Program Change Map)
->>>4 byte 0x09 SBPRPAR (Sound Parameter)
->>>4 byte 0x0A SARRPAR (Performance Parameter)
->>>4 byte 0x0B SINSPAR (Instrument/External Parameter)
->>>4 byte 0x0F SBULK (Bulk Switch on/off)
-
-# Japanese Group
->1 byte 0x40 Kawai
->>3 byte 0x20 K1
->>3 byte 0x22 K4
-
->1 byte 0x41 Roland
->>3 byte 0x14 D-50
->>3 byte 0x2b U-220
->>3 byte 0x02 TR-707
-
->1 byte 0x42 Korg
->>3 byte 0x19 M1
-
->1 byte 0x43 Yamaha
->1 byte 0x44 Casio
->1 byte 0x46 Kamiya
->1 byte 0x47 Akai
->1 byte 0x48 Victor
->1 byte 0x49 Mesosha
->1 byte 0x4b Fujitsu
->1 byte 0x4c Sony
->1 byte 0x4e Teac
->1 byte 0x50 Matsushita
->1 byte 0x51 Fostex
->1 byte 0x52 Zoom
->1 byte 0x54 Matsushita
->1 byte 0x57 Acoustic tech. lab.
-
->1 belong&0xffffff00 0x00007400 Ta Horng
->1 belong&0xffffff00 0x00007500 e-Tek
->1 belong&0xffffff00 0x00007600 E-Voice
->1 belong&0xffffff00 0x00007700 Midisoft
->1 belong&0xffffff00 0x00007800 Q-Sound
->1 belong&0xffffff00 0x00007900 Westrex
->1 belong&0xffffff00 0x00007a00 Nvidia*
->1 belong&0xffffff00 0x00007b00 ESS
->1 belong&0xffffff00 0x00007c00 Mediatrix
->1 belong&0xffffff00 0x00007d00 Brooktree
->1 belong&0xffffff00 0x00007e00 Otari
->1 belong&0xffffff00 0x00007f00 Key Electronics
->1 belong&0xffffff00 0x00010000 Shure
->1 belong&0xffffff00 0x00010100 AuraSound
->1 belong&0xffffff00 0x00010200 Crystal
->1 belong&0xffffff00 0x00010300 Rockwell
->1 belong&0xffffff00 0x00010400 Silicon Graphics
->1 belong&0xffffff00 0x00010500 Midiman
->1 belong&0xffffff00 0x00010600 PreSonus
->1 belong&0xffffff00 0x00010800 Topaz
->1 belong&0xffffff00 0x00010900 Cast Lightning
->1 belong&0xffffff00 0x00010a00 Microsoft
->1 belong&0xffffff00 0x00010b00 Sonic Foundry
->1 belong&0xffffff00 0x00010c00 Line 6
->1 belong&0xffffff00 0x00010d00 Beatnik Inc.
->1 belong&0xffffff00 0x00010e00 Van Koerving
->1 belong&0xffffff00 0x00010f00 Altech Systems
->1 belong&0xffffff00 0x00011000 S & S Research
->1 belong&0xffffff00 0x00011100 VLSI Technology
->1 belong&0xffffff00 0x00011200 Chromatic
->1 belong&0xffffff00 0x00011300 Sapphire
->1 belong&0xffffff00 0x00011400 IDRC
->1 belong&0xffffff00 0x00011500 Justonic Tuning
->1 belong&0xffffff00 0x00011600 TorComp
->1 belong&0xffffff00 0x00011700 Newtek Inc.
->1 belong&0xffffff00 0x00011800 Sound Sculpture
->1 belong&0xffffff00 0x00011900 Walker Technical
->1 belong&0xffffff00 0x00011a00 Digital Harmony
->1 belong&0xffffff00 0x00011b00 InVision
->1 belong&0xffffff00 0x00011c00 T-Square
->1 belong&0xffffff00 0x00011d00 Nemesys
->1 belong&0xffffff00 0x00011e00 DBX
->1 belong&0xffffff00 0x00011f00 Syndyne
->1 belong&0xffffff00 0x00012000 Bitheadz
->1 belong&0xffffff00 0x00012100 Cakewalk
->1 belong&0xffffff00 0x00012200 Staccato
->1 belong&0xffffff00 0x00012300 National Semicon.
->1 belong&0xffffff00 0x00012400 Boom Theory
->1 belong&0xffffff00 0x00012500 Virtual DSP Corp
->1 belong&0xffffff00 0x00012600 Antares
->1 belong&0xffffff00 0x00012700 Angel Software
->1 belong&0xffffff00 0x00012800 St Louis Music
->1 belong&0xffffff00 0x00012900 Lyrrus dba G-VOX
->1 belong&0xffffff00 0x00012a00 Ashley Audio
->1 belong&0xffffff00 0x00012b00 Vari-Lite
->1 belong&0xffffff00 0x00012c00 Summit Audio
->1 belong&0xffffff00 0x00012d00 Aureal Semicon.
->1 belong&0xffffff00 0x00012e00 SeaSound
->1 belong&0xffffff00 0x00012f00 U.S. Robotics
->1 belong&0xffffff00 0x00013000 Aurisis
->1 belong&0xffffff00 0x00013100 Nearfield Multimedia
->1 belong&0xffffff00 0x00013200 FM7 Inc.
->1 belong&0xffffff00 0x00013300 Swivel Systems
->1 belong&0xffffff00 0x00013400 Hyperactive
->1 belong&0xffffff00 0x00013500 MidiLite
->1 belong&0xffffff00 0x00013600 Radical
->1 belong&0xffffff00 0x00013700 Roger Linn
->1 belong&0xffffff00 0x00013800 Helicon
->1 belong&0xffffff00 0x00013900 Event
->1 belong&0xffffff00 0x00013a00 Sonic Network
->1 belong&0xffffff00 0x00013b00 Realtime Music
->1 belong&0xffffff00 0x00013c00 Apogee Digital
-
->1 belong&0xffffff00 0x00202b00 Medeli Electronics
->1 belong&0xffffff00 0x00202c00 Charlie Lab
->1 belong&0xffffff00 0x00202d00 Blue Chip Music
->1 belong&0xffffff00 0x00202e00 BEE OH Corp
->1 belong&0xffffff00 0x00202f00 LG Semicon America
->1 belong&0xffffff00 0x00203000 TESI
->1 belong&0xffffff00 0x00203100 EMAGIC
->1 belong&0xffffff00 0x00203200 Behringer
->1 belong&0xffffff00 0x00203300 Access Music
->1 belong&0xffffff00 0x00203400 Synoptic
->1 belong&0xffffff00 0x00203500 Hanmesoft Corp
->1 belong&0xffffff00 0x00203600 Terratec
->1 belong&0xffffff00 0x00203700 Proel SpA
->1 belong&0xffffff00 0x00203800 IBK MIDI
->1 belong&0xffffff00 0x00203900 IRCAM
->1 belong&0xffffff00 0x00203a00 Propellerhead Software
->1 belong&0xffffff00 0x00203b00 Red Sound Systems
->1 belong&0xffffff00 0x00203c00 Electron ESI AB
->1 belong&0xffffff00 0x00203d00 Sintefex Audio
->1 belong&0xffffff00 0x00203e00 Music and More
->1 belong&0xffffff00 0x00203f00 Amsaro
->1 belong&0xffffff00 0x00204000 CDS Advanced Technology
->1 belong&0xffffff00 0x00204100 Touched by Sound
->1 belong&0xffffff00 0x00204200 DSP Arts
->1 belong&0xffffff00 0x00204300 Phil Rees Music
->1 belong&0xffffff00 0x00204400 Stamer Musikanlagen GmbH
->1 belong&0xffffff00 0x00204500 Soundart
->1 belong&0xffffff00 0x00204600 C-Mexx Software
->1 belong&0xffffff00 0x00204700 Klavis Tech.
->1 belong&0xffffff00 0x00204800 Noteheads AB
-
-0 string T707 Roland TR-707 Data
-#------------------------------------------------------------------------------
-# teapot: file(1) magic for "teapot" spreadsheet
-#
-0 string #!teapot\012xdr teapot work sheet (XDR format)
-
-#------------------------------------------------------------------------------
-# terminfo: file(1) magic for terminfo
-#
-# XXX - byte order for screen images?
-#
-0 string \032\001 Compiled terminfo entry
-0 short 0433 Curses screen image
-0 short 0434 Curses screen image
-#------------------------------------------------------------------------------
-# tex: file(1) magic for TeX files
-#
-# XXX - needs byte-endian stuff (big-endian and little-endian DVI?)
-#
-# From <conklin@talisman.kaleida.com>
-
-# Although we may know the offset of certain text fields in TeX DVI
-# and font files, we can't use them reliably because they are not
-# zero terminated. [but we do anyway, christos]
-0 string \367\002 TeX DVI file
-!:mime application/x-dvi
->16 string >\0 (%s)
-0 string \367\203 TeX generic font data
-0 string \367\131 TeX packed font data
->3 string >\0 (%s)
-0 string \367\312 TeX virtual font data
-0 search/1 This\ is\ TeX, TeX transcript text
-0 search/1 This\ is\ METAFONT, METAFONT transcript text
-
-# There is no way to detect TeX Font Metric (*.tfm) files without
-# breaking them apart and reading the data. The following patterns
-# match most *.tfm files generated by METAFONT or afm2tfm.
-2 string \000\021 TeX font metric data
-!:mime application/x-tex-tfm
->33 string >\0 (%s)
-2 string \000\022 TeX font metric data
-!:mime application/x-tex-tfm
->33 string >\0 (%s)
-
-# Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
-0 search/1 \\input\ texinfo Texinfo source text
-!:mime text/x-texinfo
-0 search/1 This\ is\ Info\ file GNU Info text
-!:mime text/x-info
-
-# TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com)
-0 search/400 \\input TeX document text
-!:mime text/x-tex
-0 search/400 \\section LaTeX document text
-!:mime text/x-tex
-0 search/400 \\setlength LaTeX document text
-!:mime text/x-tex
-0 search/400 \\documentstyle LaTeX document text
-!:mime text/x-tex
-0 search/400 \\chapter LaTeX document text
-!:mime text/x-tex
-0 search/400 \\documentclass LaTeX 2e document text
-!:mime text/x-tex
-0 search/400 \\relax LaTeX auxiliary file
-!:mime text/x-tex
-0 search/400 \\contentsline LaTeX table of contents
-!:mime text/x-tex
-0 search/400 %\ -*-latex-*- LaTeX document text
-!:mime text/x-tex
-
-# Tex document, from Hendrik Scholz <hendrik@scholz.net>
-0 search/1 \\ifx TeX document text
-
-# Index and glossary files
-0 search/400 \\indexentry LaTeX raw index file
-0 search/400 \\begin{theindex} LaTeX sorted index
-0 search/400 \\glossaryentry LaTeX raw glossary
-0 search/400 \\begin{theglossary} LaTeX sorted glossary
-0 search/400 This\ is\ makeindex Makeindex log file
-
-# End of TeX
-
-#------------------------------------------------------------------------------
-# file(1) magic for BibTex text files
-# From Hendrik Scholz <hendrik@scholz.net>
-
-0 search/1/c @article{ BibTeX text file
-0 search/1/c @book{ BibTeX text file
-0 search/1/c @inbook{ BibTeX text file
-0 search/1/c @incollection{ BibTeX text file
-0 search/1/c @inproceedings{ BibTeX text file
-0 search/1/c @manual{ BibTeX text file
-0 search/1/c @misc{ BibTeX text file
-0 search/1/c @preamble{ BibTeX text file
-0 search/1/c @phdthesis{ BibTeX text file
-0 search/1/c @techreport{ BibTeX text file
-0 search/1/c @unpublished{ BibTeX text file
-
-73 search/1 %%%\ \ BibTeX-file{ BibTex text file (with full header)
-
-73 search/1 %%%\ \ @BibTeX-style-file{ BibTeX style text file (with full header)
-
-0 search/1 %\ BibTeX\ standard\ bibliography\ BibTeX standard bibliography style text file
-
-0 search/1 %\ BibTeX\ ` BibTeX custom bibliography style text file
-
-0 search/1 @c\ @mapfile{ TeX font aliases text file
-#------------------------------------------------------------------------------
-# file(1) magic for tgif(1) files
-# From Hendrik Scholz <hendrik@scholz.net>
-
-0 string %TGIF\ x Tgif file version %s
-
-# ------------------------------------------------------------------------
-# ti-8x: file(1) magic for the TI-8x and TI-9x Graphing Calculators.
-#
-# From: Ryan McGuire (rmcguire@freenet.columbus.oh.us).
-#
-# Update: Romain Lievin (roms@lpg.ticalc.org).
-#
-# NOTE: This list is not complete.
-# Files for the TI-80 and TI-81 are pretty rare. I'm not going to put the
-# program/group magic numbers in here because I cannot find any.
-0 string **TI80** TI-80 Graphing Calculator File.
-0 string **TI81** TI-81 Graphing Calculator File.
-#
-# Magic Numbers for the TI-73
-#
-0 string **TI73** TI-73 Graphing Calculator
->0x00003B byte 0x00 (real number)
->0x00003B byte 0x01 (list)
->0x00003B byte 0x02 (matrix)
->0x00003B byte 0x03 (equation)
->0x00003B byte 0x04 (string)
->0x00003B byte 0x05 (program)
->0x00003B byte 0x06 (assembly program)
->0x00003B byte 0x07 (picture)
->0x00003B byte 0x08 (gdb)
->0x00003B byte 0x0C (complex number)
->0x00003B byte 0x0F (window settings)
->0x00003B byte 0x10 (zoom)
->0x00003B byte 0x11 (table setup)
->0x00003B byte 0x13 (backup)
-
-# Magic Numbers for the TI-82
-#
-0 string **TI82** TI-82 Graphing Calculator
->0x00003B byte 0x00 (real)
->0x00003B byte 0x01 (list)
->0x00003B byte 0x02 (matrix)
->0x00003B byte 0x03 (Y-variable)
->0x00003B byte 0x05 (program)
->0x00003B byte 0x06 (protected prgm)
->0x00003B byte 0x07 (picture)
->0x00003B byte 0x08 (gdb)
->0x00003B byte 0x0B (window settings)
->0x00003B byte 0x0C (window settings)
->0x00003B byte 0x0D (table setup)
->0x00003B byte 0x0E (screenshot)
->0x00003B byte 0x0F (backup)
-#
-# Magic Numbers for the TI-83
-#
-0 string **TI83** TI-83 Graphing Calculator
->0x00003B byte 0x00 (real)
->0x00003B byte 0x01 (list)
->0x00003B byte 0x02 (matrix)
->0x00003B byte 0x03 (Y-variable)
->0x00003B byte 0x04 (string)
->0x00003B byte 0x05 (program)
->0x00003B byte 0x06 (protected prgm)
->0x00003B byte 0x07 (picture)
->0x00003B byte 0x08 (gdb)
->0x00003B byte 0x0B (window settings)
->0x00003B byte 0x0C (window settings)
->0x00003B byte 0x0D (table setup)
->0x00003B byte 0x0E (screenshot)
->0x00003B byte 0x13 (backup)
-#
-# Magic Numbers for the TI-83+
-#
-0 string **TI83F* TI-83+ Graphing Calculator
->0x00003B byte 0x00 (real number)
->0x00003B byte 0x01 (list)
->0x00003B byte 0x02 (matrix)
->0x00003B byte 0x03 (equation)
->0x00003B byte 0x04 (string)
->0x00003B byte 0x05 (program)
->0x00003B byte 0x06 (assembly program)
->0x00003B byte 0x07 (picture)
->0x00003B byte 0x08 (gdb)
->0x00003B byte 0x0C (complex number)
->0x00003B byte 0x0F (window settings)
->0x00003B byte 0x10 (zoom)
->0x00003B byte 0x11 (table setup)
->0x00003B byte 0x13 (backup)
->0x00003B byte 0x15 (application variable)
->0x00003B byte 0x17 (group of variable)
-
-#
-# Magic Numbers for the TI-85
-#
-0 string **TI85** TI-85 Graphing Calculator
->0x00003B byte 0x00 (real number)
->0x00003B byte 0x01 (complex number)
->0x00003B byte 0x02 (real vector)
->0x00003B byte 0x03 (complex vector)
->0x00003B byte 0x04 (real list)
->0x00003B byte 0x05 (complex list)
->0x00003B byte 0x06 (real matrix)
->0x00003B byte 0x07 (complex matrix)
->0x00003B byte 0x08 (real constant)
->0x00003B byte 0x09 (complex constant)
->0x00003B byte 0x0A (equation)
->0x00003B byte 0x0C (string)
->0x00003B byte 0x0D (function GDB)
->0x00003B byte 0x0E (polar GDB)
->0x00003B byte 0x0F (parametric GDB)
->0x00003B byte 0x10 (diffeq GDB)
->0x00003B byte 0x11 (picture)
->0x00003B byte 0x12 (program)
->0x00003B byte 0x13 (range)
->0x00003B byte 0x17 (window settings)
->0x00003B byte 0x18 (window settings)
->0x00003B byte 0x19 (window settings)
->0x00003B byte 0x1A (window settings)
->0x00003B byte 0x1B (zoom)
->0x00003B byte 0x1D (backup)
->0x00003B byte 0x1E (unknown)
->0x00003B byte 0x2A (equation)
->0x000032 string ZS4 - ZShell Version 4 File.
->0x000032 string ZS3 - ZShell Version 3 File.
-#
-# Magic Numbers for the TI-86
-#
-0 string **TI86** TI-86 Graphing Calculator
->0x00003B byte 0x00 (real number)
->0x00003B byte 0x01 (complex number)
->0x00003B byte 0x02 (real vector)
->0x00003B byte 0x03 (complex vector)
->0x00003B byte 0x04 (real list)
->0x00003B byte 0x05 (complex list)
->0x00003B byte 0x06 (real matrix)
->0x00003B byte 0x07 (complex matrix)
->0x00003B byte 0x08 (real constant)
->0x00003B byte 0x09 (complex constant)
->0x00003B byte 0x0A (equation)
->0x00003B byte 0x0C (string)
->0x00003B byte 0x0D (function GDB)
->0x00003B byte 0x0E (polar GDB)
->0x00003B byte 0x0F (parametric GDB)
->0x00003B byte 0x10 (diffeq GDB)
->0x00003B byte 0x11 (picture)
->0x00003B byte 0x12 (program)
->0x00003B byte 0x13 (range)
->0x00003B byte 0x17 (window settings)
->0x00003B byte 0x18 (window settings)
->0x00003B byte 0x19 (window settings)
->0x00003B byte 0x1A (window settings)
->0x00003B byte 0x1B (zoom)
->0x00003B byte 0x1D (backup)
->0x00003B byte 0x1E (unknown)
->0x00003B byte 0x2A (equation)
-#
-# Magic Numbers for the TI-89
-#
-0 string **TI89** TI-89 Graphing Calculator
->0x000048 byte 0x00 (expression)
->0x000048 byte 0x04 (list)
->0x000048 byte 0x06 (matrix)
->0x000048 byte 0x0A (data)
->0x000048 byte 0x0B (text)
->0x000048 byte 0x0C (string)
->0x000048 byte 0x0D (graphic data base)
->0x000048 byte 0x0E (figure)
->0x000048 byte 0x10 (picture)
->0x000048 byte 0x12 (program)
->0x000048 byte 0x13 (function)
->0x000048 byte 0x14 (macro)
->0x000048 byte 0x1C (zipped)
->0x000048 byte 0x21 (assembler)
-#
-# Magic Numbers for the TI-92
-#
-0 string **TI92** TI-92 Graphing Calculator
->0x000048 byte 0x00 (expression)
->0x000048 byte 0x04 (list)
->0x000048 byte 0x06 (matrix)
->0x000048 byte 0x0A (data)
->0x000048 byte 0x0B (text)
->0x000048 byte 0x0C (string)
->0x000048 byte 0x0D (graphic data base)
->0x000048 byte 0x0E (figure)
->0x000048 byte 0x10 (picture)
->0x000048 byte 0x12 (program)
->0x000048 byte 0x13 (function)
->0x000048 byte 0x14 (macro)
->0x000048 byte 0x1D (backup)
-#
-# Magic Numbers for the TI-92+/V200
-#
-0 string **TI92P* TI-92+/V200 Graphing Calculator
->0x000048 byte 0x00 (expression)
->0x000048 byte 0x04 (list)
->0x000048 byte 0x06 (matrix)
->0x000048 byte 0x0A (data)
->0x000048 byte 0x0B (text)
->0x000048 byte 0x0C (string)
->0x000048 byte 0x0D (graphic data base)
->0x000048 byte 0x0E (figure)
->0x000048 byte 0x10 (picture)
->0x000048 byte 0x12 (program)
->0x000048 byte 0x13 (function)
->0x000048 byte 0x14 (macro)
->0x000048 byte 0x1C (zipped)
->0x000048 byte 0x21 (assembler)
-#
-# Magic Numbers for the TI-73/83+/89/92+/V200 FLASH upgrades
-#
-0x0000016 string Advanced TI-XX Graphing Calculator (FLASH)
-0 string **TIFL** TI-XX Graphing Calculator (FLASH)
->8 byte >0 - Revision %d
->>9 byte x \b.%d,
->12 byte >0 Revision date %02x
->>13 byte x \b/%02x
->>14 beshort x \b/%04x,
->17 string >/0 name: '%s',
->48 byte 0x74 device: TI-73,
->48 byte 0x73 device: TI-83+,
->48 byte 0x98 device: TI-89,
->48 byte 0x88 device: TI-92+,
->49 byte 0x23 type: OS upgrade,
->49 byte 0x24 type: application,
->49 byte 0x25 type: certificate,
->49 byte 0x3e type: license,
->74 lelong >0 size: %ld bytes
-
-# VTi & TiEmu skins (TI Graphing Calculators).
-# From: Romain Lievin (roms@lpg.ticalc.org).
-# Magic Numbers for the VTi skins
-0 string VTI Virtual TI skin
->3 string v - Version
->>4 byte >0 \b %c
->>6 byte x \b.%c
-# Magic Numbers for the TiEmu skins
-0 string TiEmu TiEmu skin
->6 string v - Version
->>7 byte >0 \b %c
->>9 byte x \b.%c
->>10 byte x \b%c
-
-#------------------------------------------------------------------------------
-# timezone: file(1) magic for timezone data
-#
-# from Daniel Quinlan (quinlan@yggdrasil.com)
-# this should work on Linux, SunOS, and maybe others
-# Added new official magic number for recent versions of the Olson code
-0 string TZif timezone data
->4 byte 0 \b, old version
->4 byte >0 \b, version %c
->20 belong 0 \b, no gmt time flags
->20 belong 1 \b, 1 gmt time flag
->20 belong >1 \b, %d gmt time flags
->24 belong 0 \b, no std time flags
->20 belong 1 \b, 1 std time flag
->24 belong >1 \b, %d std time flags
->28 belong 0 \b, no leap seconds
->28 belong 1 \b, 1 leap second
->28 belong >1 \b, %d leap seconds
->32 belong 0 \b, no transition times
->32 belong 1 \b, 1 transition time
->32 belong >1 \b, %d transition times
->36 belong 0 \b, no abbreviation chars
->36 belong 1 \b, 1 abbreviation char
->36 belong >1 \b, %d abbreviation chars
-0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0 old timezone data
-0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0 old timezone data
-0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0 old timezone data
-0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0 old timezone data
-0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0 old timezone data
-0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0 old timezone data
-#------------------------------------------------------------------------------
-# troff: file(1) magic for *roff
-#
-# updated by Daniel Quinlan (quinlan@yggdrasil.com)
-
-# troff input
-0 search/1 .\\" troff or preprocessor input text
-!:mime text/troff
-0 search/1 '\\" troff or preprocessor input text
-!:mime text/troff
-0 search/1 '.\\" troff or preprocessor input text
-!:mime text/troff
-0 search/1 \\" troff or preprocessor input text
-!:mime text/troff
-0 search/1 ''' troff or preprocessor input text
-!:mime text/troff
-0 regex/20 \^\\.[A-Za-z0-9][A-Za-z0-9][\ \t] troff or preprocessor input text
-!:mime text/troff
-0 regex/20 \^\\.[A-Za-z0-9][A-Za-z0-9]$ troff or preprocessor input text
-!:mime text/troff
-
-# ditroff intermediate output text
-0 search/1 x\ T ditroff output text
->4 search/1 cat for the C/A/T phototypesetter
->4 search/1 ps for PostScript
->4 search/1 dvi for DVI
->4 search/1 ascii for ASCII
->4 search/1 lj4 for LaserJet 4
->4 search/1 latin1 for ISO 8859-1 (Latin 1)
->4 search/1 X75 for xditview at 75dpi
->>7 search/1 -12 (12pt)
->4 search/1 X100 for xditview at 100dpi
->>8 search/1 -12 (12pt)
-
-# output data formats
-0 string \100\357 very old (C/A/T) troff output data
-#
-#------------------------------------------------------------------------------
-# tuxedo: file(1) magic for BEA TUXEDO data files
-#
-# from Ian Springer <ispringer@hotmail.com>
-#
-0 string \0\0\1\236\0\0\0\0\0\0\0\0\0\0\0\0 BEA TUXEDO DES mask data
-
-#------------------------------------------------------------------------------
-# typeset: file(1) magic for other typesetting
-#
-0 string Interpress/Xerox Xerox InterPress data
->16 string / (version
->>17 string >\0 %s)
-#---------------------------------------------------------------------------
-# Unicode: BOM prefixed text files - Adrian Havill <havill@turbolinux.co.jp>
-# GRR: These types should be recognised in file_ascmagic so these
-# encodings can be treated by text patterns.
-# Missing types are already dealt with internally.
-#
-0 string +/v8 Unicode text, UTF-7
-0 string +/v9 Unicode text, UTF-7
-0 string +/v+ Unicode text, UTF-7
-0 string +/v/ Unicode text, UTF-7
-0 string \335\163\146\163 Unicode text, UTF-8-EBCDIC
-0 string \000\000\376\377 Unicode text, UTF-32, big-endian
-0 string \377\376\000\000 Unicode text, UTF-32, little-endian
-0 string \016\376\377 Unicode text, SCSU (Standard Compression Scheme for Unicode)
-
-#------------------------------------------------------------------------------
-# unknown: file(1) magic for unknown machines
-#
-# XXX - this probably should be pruned, as it'll match PDP-11 and
-# VAX image formats.
-#
-# 0x107 is 0407; 0x108 is 0410; both are PDP-11 (executable and pure,
-# respectively).
-#
-# 0x109 is 0411; that's PDP-11 split I&D, but the PDP-11 version doesn't
-# have the "version %ld", which may be a bogus COFFism (I don't think
-# there ever was COFF for the PDP-11).
-#
-# 0x10B is 0413; that's VAX demand-paged, but this is a short, not a
-# long, as it would be on a VAX.
-#
-# 0x10C is 0414 and 0x10E is 416; those *are* unknown.
-#
-0 short 0x107 unknown machine executable
->8 short >0 not stripped
->15 byte >0 - version %ld
-0 short 0x108 unknown pure executable
->8 short >0 not stripped
->15 byte >0 - version %ld
-0 short 0x109 PDP-11 separate I&D
->8 short >0 not stripped
->15 byte >0 - version %ld
-0 short 0x10b unknown pure executable
->8 short >0 not stripped
->15 byte >0 - version %ld
-0 long 0x10c unknown demand paged pure executable
->16 long >0 not stripped
-0 long 0x10e unknown readable demand paged pure executable
-#------------------------------------------------------------------------------
-# uuencode: file(1) magic for ASCII-encoded files
-#
-
-# GRR: the first line of xxencoded files is identical to that in uuencoded
-# files, but the first character in most subsequent lines is 'h' instead of
-# 'M'. (xxencoding uses lowercase letters in place of most of uuencode's
-# punctuation and survives BITNET gateways better.) If regular expressions
-# were supported, this entry could possibly be split into two with
-# "begin\040\.\*\012M" or "begin\040\.\*\012h" (where \. and \* are REs).
-0 search/1 begin\ uuencoded or xxencoded text
-
-# btoa(1) is an alternative to uuencode that requires less space.
-0 search/1 xbtoa\ Begin btoa'd text
-
-# ship(1) is another, much cooler alternative to uuencode.
-# Greg Roelofs, newt@uchicago.edu
-0 search/1 $\012ship ship'd binary text
-
-# bencode(8) is used to encode compressed news batches (Bnews/Cnews only?)
-# Greg Roelofs, newt@uchicago.edu
-0 search/1 Decode\ the\ following\ with\ bdeco bencoded News text
-
-# BinHex is the Macintosh ASCII-encoded file format (see also "apple")
-# Daniel Quinlan, quinlan@yggdrasil.com
-11 search/1 must\ be\ converted\ with\ BinHex BinHex binary text
->41 search/1 x \b, version %.3s
-
-# GRR: handle BASE64
-
-#------------------------------------------------------------------------------
-# varied.out: file(1) magic for various USG systems
-#
-# Herewith many of the object file formats used by USG systems.
-# Most have been moved to files for a particular processor,
-# and deleted if they duplicate other entries.
-#
-0 short 0610 Perkin-Elmer executable
-# AMD 29K
-0 beshort 0572 amd 29k coff noprebar executable
-0 beshort 01572 amd 29k coff prebar executable
-0 beshort 0160007 amd 29k coff archive
-# Cray
-6 beshort 0407 unicos (cray) executable
-# Ultrix 4.3
-596 string \130\337\377\377 Ultrix core file
->600 string >\0 from '%s'
-# BeOS and MAcOS PEF executables
-# From: hplus@zilker.net (Jon Watte)
-0 string Joy!peffpwpc header for PowerPC PEF executable
-#
-# ava assembler/linker Uros Platise <uros.platise@ijs.si>
-0 string avaobj AVR assembler object code
->7 string >\0 version '%s'
-# gnu gmon magic From: Eugen Dedu <dedu@ese-metz.fr>
-0 string gmon GNU prof performance data
->4 long x - version %ld
-# From: Dave Pearson <davep@davep.org>
-# Harbour <URL:http://www.harbour-project.org/> HRB files.
-0 string \xc0HRB Harbour HRB file
->4 short x version %d
-
-# From: Alex Beregszaszi <alex@fsn.hu>
-# 0 string exec BugOS executable
-# 0 string pack BugOS archive
-
-# From: Jason Spence <jspence@lightconsulting.com>
-# Generated by the "examples" in STM's ST40 devkit, and derived code.
-0 lelong 0x13a9f17e ST40 component image format
->4 string >\0 \b, name '%s'
-
-#------------------------------------------------------------------------------
-# varied.script: file(1) magic for various interpreter scripts
-
-0 string #!\ / a
->3 string >\0 %s script text executable
-0 string #!\t/ a
->3 string >\0 %s script text executable
-0 string #!/ a
->2 string >\0 %s script text executable
-0 string #!\ script text executable
->3 string >\0 for %s
-
-# From: arno <arenevier@fdn.fr>
-# mozilla xpconnect typelib
-# see http://www.mozilla.org/scriptable/typelib_file.html
-0 string XPCOM\nTypeLib\r\n\032 XPConnect Typelib
->0x10 byte x version %d
->>0x11 byte x \b.%d
-
-#------------------------------------------------------------------------------
-# vax: file(1) magic for VAX executable/object and APL workspace
-#
-0 lelong 0101557 VAX single precision APL workspace
-0 lelong 0101556 VAX double precision APL workspace
-
-#
-# VAX a.out (32V, BSD)
-#
-0 lelong 0407 VAX executable
->16 lelong >0 not stripped
-
-0 lelong 0410 VAX pure executable
->16 lelong >0 not stripped
-
-0 lelong 0413 VAX demand paged pure executable
->16 lelong >0 not stripped
-
-0 lelong 0420 VAX demand paged (first page unmapped) pure executable
->16 lelong >0 not stripped
-
-#
-# VAX COFF
-#
-# The `versions' should be un-commented if they work for you.
-# (Was the problem just one of endianness?)
-#
-0 leshort 0570 VAX COFF executable
->12 lelong >0 not stripped
->22 leshort >0 - version %ld
-0 leshort 0575 VAX COFF pure executable
->12 lelong >0 not stripped
->22 leshort >0 - version %ld
-
-#------------------------------------------------------------------------------
-# vicar: file(1) magic for VICAR files.
-#
-# From: Ossama Othman <othman@astrosun.tn.cornell.edu
-# VICAR is JPL's in-house spacecraft image processing program
-# VICAR image
-0 string LBLSIZE= VICAR image data
->32 string BYTE \b, 8 bits = VAX byte
->32 string HALF \b, 16 bits = VAX word = Fortran INTEGER*2
->32 string FULL \b, 32 bits = VAX longword = Fortran INTEGER*4
->32 string REAL \b, 32 bits = VAX longword = Fortran REAL*4
->32 string DOUB \b, 64 bits = VAX quadword = Fortran REAL*8
->32 string COMPLEX \b, 64 bits = VAX quadword = Fortran COMPLEX*8
-# VICAR label file
-43 string SFDU_LABEL VICAR label file
-#------------------------------------------------------------------------------
-# Virtutech Compressed Random Access File Format
-#
-# From <gustav@virtutech.com>
-0 string \211\277\036\203 Virtutech CRAFF
->4 belong x v%d
->20 belong 0 uncompressed
->20 belong 1 bzipp2ed
->20 belong 2 gzipped
->24 belong 0 not clean
-
-#------------------------------------------------------------------------------
-# visx: file(1) magic for Visx format files
-#
-0 short 0x5555 VISX image file
->2 byte 0 (zero)
->2 byte 1 (unsigned char)
->2 byte 2 (short integer)
->2 byte 3 (float 32)
->2 byte 4 (float 64)
->2 byte 5 (signed char)
->2 byte 6 (bit-plane)
->2 byte 7 (classes)
->2 byte 8 (statistics)
->2 byte 10 (ascii text)
->2 byte 15 (image segments)
->2 byte 100 (image set)
->2 byte 101 (unsigned char vector)
->2 byte 102 (short integer vector)
->2 byte 103 (float 32 vector)
->2 byte 104 (float 64 vector)
->2 byte 105 (signed char vector)
->2 byte 106 (bit plane vector)
->2 byte 121 (feature vector)
->2 byte 122 (feature vector library)
->2 byte 124 (chain code)
->2 byte 126 (bit vector)
->2 byte 130 (graph)
->2 byte 131 (adjacency graph)
->2 byte 132 (adjacency graph library)
->2 string .VISIX (ascii text)
-
-#------------------------------------------------------------------------------
-# vms: file(1) magic for VMS executables (experimental)
-#
-# VMS .exe formats, both VAX and AXP (Greg Roelofs, newt@uchicago.edu)
-
-# GRR 950122: I'm just guessing on these, based on inspection of the headers
-# of three executables each for Alpha and VAX architectures. The VAX files
-# all had headers similar to this:
-#
-# 00000 b0 00 30 00 44 00 60 00 00 00 00 00 30 32 30 35 ..0.D.`.....0205
-# 00010 01 01 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 ................
-#
-0 string \xb0\0\x30\0 VMS VAX executable
->44032 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption
-#
-# The AXP files all looked like this, except that the byte at offset 0x22
-# was 06 in some of them and 07 in others:
-#
-# 00000 03 00 00 00 00 00 00 00 ec 02 00 00 10 01 00 00 ................
-# 00010 68 00 00 00 98 00 00 00 b8 00 00 00 00 00 00 00 h...............
-# 00020 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-# 00030 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................
-# 00040 00 00 00 00 ff ff ff ff ff ff ff ff 02 00 00 00 ................
-#
-0 belong 0x03000000 VMS Alpha executable
->75264 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption
-
-# -----------------------------------------------------------
-# VMware specific files (deducted from version 1.1 and log file entries)
-# Anthon van der Neut (anthon@mnt.org)
-0 belong 0x4d52564e VMware nvram
-
-#------------------------------------------------------------------------------
-# vorbis: file(1) magic for Ogg/Vorbis files
-#
-# From Felix von Leitner <leitner@fefe.de>
-# Extended by Beni Cherniavsky <cben@crosswinds.net>
-# Further extended by Greg Wooledge <greg@wooledge.org>
-#
-# Most (everything but the number of channels and bitrate) is commented
-# out with `##' as it's not interesting to the average user. The most
-# probable things advanced users would want to uncomment are probably
-# the number of comments and the encoder version.
-#
-# FIXME: The first match has been made a search, so that it can skip
-# over prepended ID3 tags. This will work for MIME type detection, but
-# won't work for detecting other properties of the file (they all need
-# to be made relative to the search). In any case, if the file has ID3
-# tags, the ID3 information will be printed, not the Ogg information,
-# so until that's fixed, this doesn't matter.
-# FIXME[2]: Disable the above for now, since search assumes text mode.
-#
-# --- Ogg Framing ---
-#0 search/1000 OggS Ogg data
-0 string OggS Ogg data
-!:mime application/ogg
->4 byte !0 UNKNOWN REVISION %u
-##>4 byte 0 revision 0
->4 byte 0
-##>>14 lelong x (Serial %lX)
-# non-Vorbis content: FLAC (Free Lossless Audio Codec, http://flac.sourceforge.net)
->>28 string \x7fFLAC \b, FLAC audio
-# non-Vorbis content: Theora
->>28 string \x80theora \b, Theora video
-# non-Vorbis content: Kate
->>28 string \x80kate\0\0\0\0 \b, Kate
->>>37 ubyte x v%u
->>>38 ubyte x \b.%u,
->>>40 byte 0 utf8 encoding,
->>>40 byte !0 unknown character encoding,
->>>60 string >\0 language %s,
->>>60 string \0 no language set,
->>>76 string >\0 category %s
->>>76 string \0 no category set
-# non-Vorbis content: Skeleton
->>28 string fishead\0 \b, Skeleton
->>>36 short x v%u
->>>40 short x \b.%u
-# non-Vorbis content: Speex
->>28 string Speex\ \ \ \b, Speex audio
-# non-Vorbis content: OGM
->>28 string \x01video\0\0\0 \b, OGM video
->>>37 string/c div3 (DivX 3)
->>>37 string/c divx (DivX 4)
->>>37 string/c dx50 (DivX 5)
->>>37 string/c xvid (XviD)
-# --- First vorbis packet - general header ---
->>28 string \x01vorbis \b, Vorbis audio,
->>>35 lelong !0 UNKNOWN VERSION %lu,
-##>>>35 lelong 0 version 0,
->>>35 lelong 0
->>>>39 ubyte 1 mono,
->>>>39 ubyte 2 stereo,
->>>>39 ubyte >2 %u channels,
->>>>40 lelong x %lu Hz
-# Minimal, nominal and maximal bitrates specified when encoding
->>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff \b,
-# The above tests if at least one of these is specified:
->>>>>52 lelong !-1
-# Vorbis RC2 has a bug which puts -1000 in the min/max bitrate fields
-# instead of -1.
-# Vorbis 1.0 uses 0 instead of -1.
->>>>>>52 lelong !0
->>>>>>>52 lelong !-1000
->>>>>>>>52 lelong x <%lu
->>>>>48 lelong !-1
->>>>>>48 lelong x ~%lu
->>>>>44 lelong !-1
->>>>>>44 lelong !-1000
->>>>>>>44 lelong !0
->>>>>>>>44 lelong x >%lu
->>>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff bps
-# -- Second vorbis header packet - the comments
-# A kludge to read the vendor string. It's a counted string, not a
-# zero-terminated one, so file(1) can't read it in a generic way.
-# libVorbis is the only one existing currently, so I detect specifically
-# it. The interesting value is the cvs date (8 digits decimal).
-# Post-RC1 Ogg files have the second header packet (and thus the version)
-# in a different place, so we must use an indirect offset.
->>>(84.b+85) string \x03vorbis
->>>>(84.b+96) string/c Xiphophorus\ libVorbis\ I \b, created by: Xiphophorus libVorbis I
->>>>>(84.b+120) string >00000000
-# Map to beta version numbers:
->>>>>>(84.b+120) string <20000508 (<beta1, prepublic)
->>>>>>(84.b+120) string 20000508 (1.0 beta 1 or beta 2)
->>>>>>(84.b+120) string >20000508
->>>>>>>(84.b+120) string <20001031 (beta2-3)
->>>>>>(84.b+120) string 20001031 (1.0 beta 3)
->>>>>>(84.b+120) string >20001031
->>>>>>>(84.b+120) string <20010225 (beta3-4)
->>>>>>(84.b+120) string 20010225 (1.0 beta 4)
->>>>>>(84.b+120) string >20010225
->>>>>>>(84.b+120) string <20010615 (beta4-RC1)
->>>>>>(84.b+120) string 20010615 (1.0 RC1)
->>>>>>(84.b+120) string 20010813 (1.0 RC2)
->>>>>>(84.b+120) string 20010816 (RC2 - Garf tuned v1)
->>>>>>(84.b+120) string 20011014 (RC2 - Garf tuned v2)
->>>>>>(84.b+120) string 20011217 (1.0 RC3)
->>>>>>(84.b+120) string 20011231 (1.0 RC3)
-# Some pre-1.0 CVS snapshots still had "Xiphphorus"...
->>>>>>(84.b+120) string >20011231 (pre-1.0 CVS)
-# For the 1.0 release, Xiphophorus is replaced by Xiph.Org
->>>>(84.b+96) string/c Xiph.Org\ libVorbis\ I \b, created by: Xiph.Org libVorbis I
->>>>>(84.b+117) string >00000000
->>>>>>(84.b+117) string <20020717 (pre-1.0 CVS)
->>>>>>(84.b+117) string 20020717 (1.0)
->>>>>>(84.b+117) string 20030909 (1.0.1)
->>>>>>(84.b+117) string 20040629 (1.1.0 RC1)
-
-#------------------------------------------------------------------------------
-# VXL: file(1) magic for VXL binary IO data files
-#
-# from Ian Scott <scottim@sf.net>
-#
-# VXL is a collection of C++ libraries for Computer Vision.
-# See the vsl chapter in the VXL Book for more info
-# http://www.isbe.man.ac.uk/public_vxl_doc/books/vxl/book.html
-# http:/vxl.sf.net
-
-2 lelong 0x472b2c4e VXL data file,
->0 leshort >0 schema version no %d
-
-#------------------------------------------------------------------------------
-# warc: file(1) magic for WARC files
-
-0 string WARC/ WARC Archive
->5 string x version %.4s
-#------------------------------------------------------------------------------
-# weak: file(1) magic for very weak magic entries, disabled by default
-#
-# These entries are so weak that they might interfere identification of
-# other formats. Example include:
-# - Only identify for 1 or 2 bytes
-# - Match against very wide range of values
-# - Match against generic word in some spoken languages (e.g. English)
-
-# Summary: Computer Graphics Metafile
-# Extension: .cgm
-#0 beshort&0xffe0 0x0020 binary Computer Graphics Metafile
-#0 beshort 0x3020 character Computer Graphics Metafile
-
-#0 string =!! Bennet Yee's "face" format
-
-#------------------------------------------------------------------------------
-# windows: file(1) magic for Microsoft Windows
-#
-# This file is mainly reserved for files where programs
-# using them are run almost always on MS Windows 3.x or
-# above, or files only used exclusively in Windows OS,
-# where there is no better category to allocate for.
-# For example, even though WinZIP almost run on Windows
-# only, it is better to treat them as "archive" instead.
-# For format usable in DOS, such as generic executable
-# format, please specify under "msdos" file.
-#
-
-
-# Summary: Outlook Express DBX file
-# Extension: .dbx
-# Created by: Christophe Monniez
-0 string \xCF\xAD\x12\xFE MS Outlook Express DBX file
->4 byte =0xC5 \b, message database
->4 byte =0xC6 \b, folder database
->4 byte =0xC7 \b, account information
->4 byte =0x30 \b, offline database
-
-
-# Summary: Windows crash dump
-# Extension: .dmp
-# Created by: Andreas Schuster (http://computer.forensikblog.de/)
-# Reference (1): http://computer.forensikblog.de/en/2008/02/64bit_magic.html
-# Modified by (1): Abel Cheung (Avoid match with first 4 bytes only)
-0 string PAGE
->4 string DUMP MS Windows 32bit crash dump
->>0x05c byte 0 \b, no PAE
->>0x05c byte 1 \b, PAE
->>0xf88 lelong 1 \b, full dump
->>0xf88 lelong 2 \b, kernel dump
->>0xf88 lelong 3 \b, small dump
->>0x068 lelong x \b, %ld pages
->4 string DU64 MS Windows 64bit crash dump
->>0xf98 lelong 1 \b, full dump
->>0xf98 lelong 2 \b, kernel dump
->>0xf98 lelong 3 \b, small dump
->>0x090 lequad x \b, %lld pages
-
-
-# Summary: Vista Event Log
-# Extension: .evtx
-# Created by: Andreas Schuster (http://computer.forensikblog.de/)
-# Reference (1): http://computer.forensikblog.de/en/2007/05/some_magic.html
-0 string ElfFile\0 MS Windows Vista Event Log
->0x2a leshort x \b, %d chunks
->>0x10 lelong x \b (no. %d in use)
->0x18 lelong >1 \b, next record no. %d
->0x18 lelong =1 \b, empty
->0x78 lelong &1 \b, DIRTY
->0x78 lelong &2 \b, FULL
-
-
-# Summary: Windows 3.1 group files
-# Extension: .grp
-# Created by: unknown
-0 string \120\115\103\103 MS Windows 3.1 group files
-
-
-# Summary: Old format help files
-# Extension: .hlp
-# Created by: Dirk Jagdmann <doj@cubic.org>
-0 lelong 0x00035f3f MS Windows 3.x help file
-
-
-# Summary: Hyper terminal
-# Extension: .ht
-# Created by: unknown
-0 string HyperTerminal\
->15 string 1.0\ --\ HyperTerminal\ data\ file MS Windows HyperTerminal profile
-
-
-# Summary: Windows shortcut
-# Extension: .lnk
-# Created by: unknown
-0 string \114\0\0\0\001\024\002\0\0\0\0\0\300\0\0\0\0\0\0\106 MS Windows shortcut
-
-
-# Summary: Outlook Personal Folders
-# Created by: unknown
-0 lelong 0x4E444221 Microsoft Outlook email folder
->10 leshort 0x0e (<=2002)
->10 leshort 0x17 (>=2003)
-
-
-# Summary: Windows help cache
-# Created by: unknown
-0 string \164\146\115\122\012\000\000\000\001\000\000\000 MS Windows help cache
-
-
-# Summary: IE cache file
-# Created by: Christophe Monniez
-0 string Client\ UrlCache\ MMF Internet Explorer cache file
->20 string >\0 version %s
-
-
-# Summary: Registry files
-# Created by: unknown
-# Modified by (1): Joerg Jenderek
-0 string regf MS Windows registry file, NT/2000 or above
-0 string CREG MS Windows 95/98/ME registry file
-0 string SHCC3 MS Windows 3.1 registry file
-
-
-# Summary: Windows Registry text
-# Extension: .reg
-# Submitted by: Abel Cheung <abelcheung@gmail.com>
-0 string REGEDIT4\r\n\r\n Windows Registry text (Win95 or above)
-0 string Windows\ Registry\ Editor\
->&0 string Version\ 5.00\r\n\r\n Windows Registry text (Win2K or above)
-
-
-# From: Pal Tamas <folti@balabit.hu>
-# Autorun File
-0 string/c [autorun]\r\n Microsoft Windows Autorun file.
-!:mime application/x-setupscript.
-#------------------------------------------------------------------------------
-# wireless-regdb: file(1) magic for CRDA wireless-regdb file format
-#
-0 string RGDB CRDA wireless regulatory database file
->4 belong 19 (Version 1)
-#------------------------------------------------------------------------------
-# wordprocessors: file(1) magic fo word processors.
-#
-####### PWP file format used on Smith Corona Personal Word Processors:
-2 string \040\040\040\040\040\040\040\040\040\040\040ML4D\040'92 Smith Corona PWP
->24 byte 2 \b, single spaced
->24 byte 3 \b, 1.5 spaced
->24 byte 4 \b, double spaced
->25 byte 0x42 \b, letter
->25 byte 0x54 \b, legal
->26 byte 0x46 \b, A4
-
-#WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
-0 string \377WPC\020\000\000\000\022\012\001\001\000\000\000\000 (WP) loadable file
->15 byte 0 Optimized for Intel
->15 byte 1 Optimized for Non-Intel
-1 string WPC (Corel/WP)
->8 short 257 WordPerfect macro
->8 short 258 WordPerfect help file
->8 short 259 WordPerfect keyboard file
->8 short 266 WordPerfect document
->8 short 267 WordPerfect dictionary
->8 short 268 WordPerfect thesaurus
->8 short 269 WordPerfect block
->8 short 270 WordPerfect rectangular block
->8 short 271 WordPerfect column block
->8 short 272 WordPerfect printer data
->8 short 275 WordPerfect printer data
->8 short 276 WordPerfect driver resource data
->8 short 279 WordPerfect hyphenation code
->8 short 280 WordPerfect hyphenation data
->8 short 281 WordPerfect macro resource data
->8 short 283 WordPerfect hyphenation lex
->8 short 285 WordPerfect wordlist
->8 short 286 WordPerfect equation resource data
->8 short 289 WordPerfect spell rules
->8 short 290 WordPerfect dictionary rules
->8 short 295 WordPerfect spell rules (Microlytics)
->8 short 299 WordPerfect settings file
->8 short 301 WordPerfect 4.2 document
->8 short 325 WordPerfect dialog file
->8 short 332 WordPerfect button bar
->8 short 513 Shell macro
->8 short 522 Shell definition
->8 short 769 Notebook macro
->8 short 770 Notebook help file
->8 short 771 Notebook keyboard file
->8 short 778 Notebook definition
->8 short 1026 Calculator help file
->8 short 1538 Calendar help file
->8 short 1546 Calendar data file
->8 short 1793 Editor macro
->8 short 1794 Editor help file
->8 short 1795 Editor keyboard file
->8 short 1817 Editor macro resource file
->8 short 2049 Macro editor macro
->8 short 2050 Macro editor help file
->8 short 2051 Macro editor keyboard file
->8 short 2305 PlanPerfect macro
->8 short 2306 PlanPerfect help file
->8 short 2307 PlanPerfect keyboard file
->8 short 2314 PlanPerfect worksheet
->8 short 2319 PlanPerfect printer definition
->8 short 2322 PlanPerfect graphic definition
->8 short 2323 PlanPerfect data
->8 short 2324 PlanPerfect temporary printer
->8 short 2329 PlanPerfect macro resource data
->8 byte 11 Mail
->8 short 2818 help file
->8 short 2821 distribution list
->8 short 2826 out box
->8 short 2827 in box
->8 short 2836 users archived mailbox
->8 short 2837 archived message database
->8 short 2838 archived attachments
->8 short 3083 Printer temporary file
->8 short 3330 Scheduler help file
->8 short 3338 Scheduler in file
->8 short 3339 Scheduler out file
->8 short 3594 GroupWise settings file
->8 short 3601 GroupWise directory services
->8 short 3627 GroupWise settings file
->8 short 4362 Terminal resource data
->8 short 4363 Terminal resource data
->8 short 4395 Terminal resource data
->8 short 4619 GUI loadable text
->8 short 4620 graphics resource data
->8 short 4621 printer settings file
->8 short 4622 port definition file
->8 short 4623 print queue parameters
->8 short 4624 compressed file
->8 short 5130 Network service msg file
->8 short 5131 Network service msg file
->8 short 5132 Async gateway login msg
->8 short 5134 GroupWise message file
->8 short 7956 GroupWise admin domain database
->8 short 7957 GroupWise admin host database
->8 short 7959 GroupWise admin remote host database
->8 short 7960 GroupWise admin ADS deferment data file
->8 short 8458 IntelliTAG (SGML) compiled DTD
->8 long 18219264 WordPerfect graphic image (1.0)
->8 long 18219520 WordPerfect graphic image (2.0)
-#end of WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
-
-# Hangul (Korean) Word Processor File
-0 string HWP\ Document\ File Hangul (Korean) Word Processor File 3.0
-# From: Won-Kyu Park <wkpark@kldp.org>
-512 string R\0o\0o\0t\0 Hangul (Korean) Word Processor File 2000
-!:mime application/x-hwp
-
-# CosmicBook, from Benot Rouits
-0 string CSBK Ted Neslson's CosmicBook hypertext file
-
-2 string EYWR AmigaWriter file
-
-# chi: file(1) magic for ChiWriter files
-0 string \\1cw\ ChiWriter file
->5 string >\0 version %s
-0 string \\1cw ChiWriter file
-
-# Quark Express from http://www.garykessler.net/library/file_sigs.html
-2 string IIXPR3 Intel Quark Express Document (English)
-2 string IIXPRa Intel Quark Express Document (Korean)
-2 string MMXPR3 Motorola Quark Express Document (English)
-!:mime application/x-quark-xpress-3
-2 string MMXPRa Motorola Quark Express Document (Korean)
-
-# adobe indesign (document, whatever...) from querkan
-0 belong 0x0606edf5 Adobe InDesign
->16 string DOCUMENT Document
-
-#------------------------------------------------------------------------------
-# ichitaro456: file(1) magic for Just System Word Processor Ichitaro
-#
-# Contributor kenzo-:
-# Reversed-engineered JS Ichitaro magic numbers
-#
-
-0 string DOC
->43 byte 0x14 Just System Word Processor Ichitaro v4
-!:mime application/x-ichitaro4
->144 string JDASH application/x-ichitaro4
-
-0 string DOC
->43 byte 0x15 Just System Word Processor Ichitaro v5
-!:mime application/x-ichitaro5
-
-0 string DOC
->43 byte 0x16 Just System Word Processor Ichitaro v6
-!:mime application/x-ichitaro6
-
-# Type: Freemind mindmap documents
-# From: Jamie Thompson <debian-bugs@jamie-thompson.co.uk>
-0 string/cB \<map\ version Freemind document
-!:mime application/x-freemind
-
-# Type: Scribus
-# From: Werner Fink <werner@suse.de>
-0 string \<SCRIBUSUTF8\ Version Scribus Document
-0 string \<SCRIBUSUTF8NEW\ Version Scribus Document
-!:mime application/x-scribus
-
-#------------------------------------------------------------------------------
-# file(1) magic(5) data for xdelta Josh MacDonald <jmacd@CS.Berkeley.EDU>
-#
-0 string %XDELTA% XDelta binary patch file 0.14
-0 string %XDZ000% XDelta binary patch file 0.18
-0 string %XDZ001% XDelta binary patch file 0.20
-0 string %XDZ002% XDelta binary patch file 1.0
-0 string %XDZ003% XDelta binary patch file 1.0.4
-0 string %XDZ004% XDelta binary patch file 1.1
-
-#------------------------------------------------------------------------------
-# xenix: file(1) magic for Microsoft Xenix
-#
-# "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small
-# model" lifted from "magic.xenix", with comment "derived empirically;
-# treat as folklore until proven"
-#
-# "small model", "large model", "huge model" stuff lifted from XXX
-#
-# XXX - "x.out" collides with PDP-11 archives
-#
-0 string core core file (Xenix)
-0 byte 0x80 8086 relocatable (Microsoft)
-0 leshort 0xff65 x.out
->2 string __.SYMDEF randomized
->0 byte x archive
-0 leshort 0x206 Microsoft a.out
->8 leshort 1 Middle model
->0x1e leshort &0x10 overlay
->0x1e leshort &0x2 separate
->0x1e leshort &0x4 pure
->0x1e leshort &0x800 segmented
->0x1e leshort &0x400 standalone
->0x1e leshort &0x8 fixed-stack
->0x1c byte &0x80 byte-swapped
->0x1c byte &0x40 word-swapped
->0x10 lelong >0 not-stripped
->0x1e leshort ^0xc000 pre-SysV
->0x1e leshort &0x4000 V2.3
->0x1e leshort &0x8000 V3.0
->0x1c byte &0x4 86
->0x1c byte &0xb 186
->0x1c byte &0x9 286
->0x1c byte &0xa 386
->0x1f byte <0x040 small model
->0x1f byte =0x048 large model
->0x1f byte =0x049 huge model
->0x1e leshort &0x1 executable
->0x1e leshort ^0x1 object file
->0x1e leshort &0x40 Large Text
->0x1e leshort &0x20 Large Data
->0x1e leshort &0x120 Huge Objects Enabled
->0x10 lelong >0 not stripped
-
-0 leshort 0x140 old Microsoft 8086 x.out
->0x3 byte &0x4 separate
->0x3 byte &0x2 pure
->0 byte &0x1 executable
->0 byte ^0x1 relocatable
->0x14 lelong >0 not stripped
-
-0 lelong 0x206 b.out
->0x1e leshort &0x10 overlay
->0x1e leshort &0x2 separate
->0x1e leshort &0x4 pure
->0x1e leshort &0x800 segmented
->0x1e leshort &0x400 standalone
->0x1e leshort &0x1 executable
->0x1e leshort ^0x1 object file
->0x1e leshort &0x4000 V2.3
->0x1e leshort &0x8000 V3.0
->0x1c byte &0x4 86
->0x1c byte &0xb 186
->0x1c byte &0x9 286
->0x1c byte &0x29 286
->0x1c byte &0xa 386
->0x1e leshort &0x4 Large Text
->0x1e leshort &0x2 Large Data
->0x1e leshort &0x102 Huge Objects Enabled
-
-0 leshort 0x580 XENIX 8086 relocatable or 80286 small model
-
-#------------------------------------------------------------------------------
-# This is Aaron's attempt at a MAGIC file for Xilinx .bit files.
-# Xilinx-Magic@RevRagnarok.com
-# Got the info from FPGA-FAQ 0026
-#
-# First there is the sync header and its length
-0 beshort 0x0009
->2 belong =0x0ff00ff0
->>&0 belong =0x0ff00ff0
->>>&0 beshort =0x0000
->>>>&0 pstring a Xilinx BIT data
-# Next is a Pascal-style string with the NCD name. We want to capture that.
->>>>0x0F pstring x - from %s
-# It is followed by a NUL
->>>>>&1 byte 0x00
-# And then 'b'
->>>>>&2 string b
-# With the part number:
-#>>>>>&5 string 4v (Virtex4)
-#>>>>>&5 string 2v (Virtex II
-#>>>>>>&0 string !p \b)
-#>>>>>>&0 string p Pro)
->>>>>&4 pstring x - for %s
-# And then NUL / 'c' / Build Data / NUL / 'd' / Date / NUL / 'e' / Data Length
->>>>>>&1 byte 0x00
->>>>>>&2 string c
->>>>>>&4 pstring x - built %s
->>>>>>>&1 byte 0x00
->>>>>>>&2 string d
->>>>>>>&4 pstring x \b(%s)
->>>>>>>>&1 byte 0x00
->>>>>>>>&2 string e
->>>>>>>>&4 belong x - data length 0x%lx
-
-#------------------------------------------------------------------------------
-# xo65 object files
-# From: "Ullrich von Bassewitz" <uz@cc65.org>
-#
-0 string \x55\x7A\x6E\x61 xo65 object,
->4 leshort x version %d,
->6 leshort&0x0001 =0x0001 with debug info
->6 leshort&0x0001 =0x0000 no debug info
-
-# xo65 library files
-0 string \x6E\x61\x55\x7A xo65 library,
->4 leshort x version %d
-
-# o65 object files
-0 string \x01\x00\x6F\x36\x35 o65
->6 leshort&0x1000 =0x0000 executable,
->6 leshort&0x1000 =0x1000 object,
->5 byte x version %d,
->6 leshort&0x8000 =0x8000 65816,
->6 leshort&0x8000 =0x0000 6502,
->6 leshort&0x2000 =0x2000 32 bit,
->6 leshort&0x2000 =0x0000 16 bit,
->6 leshort&0x4000 =0x4000 page reloc,
->6 leshort&0x4000 =0x0000 byte reloc,
->6 leshort&0x0003 =0x0000 alignment 1
->6 leshort&0x0003 =0x0001 alignment 2
->6 leshort&0x0003 =0x0002 alignment 4
->6 leshort&0x0003 =0x0003 alignment 256
-
-#------------------------------------------------------------------------------
-# xwindows: file(1) magic for various X/Window system file formats.
-
-# Compiled X Keymap
-# XKM (compiled X keymap) files (including version and byte ordering)
-1 string mkx Compiled XKB Keymap: lsb,
->0 byte >0 version %d
->0 byte =0 obsolete
-0 string xkm Compiled XKB Keymap: msb,
->3 byte >0 version %d
->0 byte =0 obsolete
-
-# xfsdump archive
-0 string xFSdump0 xfsdump archive
->8 belong x (version %d)
-
-# Jaleo XFS files
-0 long 395726 Jaleo XFS file
->4 long x - version %ld
->8 long x - [%ld -
->20 long x %ldx
->24 long x %ldx
->28 long 1008 YUV422]
->28 long 1000 RGB24]
-
-# Xcursor data
-# X11 mouse cursor format defined in libXcursor, see
-# http://www.x.org/archive/X11R6.8.1/doc/Xcursor.3.html
-# http://cgit.freedesktop.org/xorg/lib/libXcursor/tree/include/X11/Xcursor/Xcursor.h
-0 string Xcur Xcursor data
-!:mime image/x-xcursor
->10 leshort x version %hd
->>8 leshort x \b.%hd
-
-#------------------------------------------------------------------------------
-# zilog: file(1) magic for Zilog Z8000.
-#
-# Was it big-endian or little-endian? My Product Specification doesn't
-# say.
-#
-0 long 0xe807 object file (z8000 a.out)
-0 long 0xe808 pure object file (z8000 a.out)
-0 long 0xe809 separate object file (z8000 a.out)
-0 long 0xe805 overlay object file (z8000 a.out)
-
-#------------------------------------------------------------------------------
-# zyxel: file(1) magic for ZyXEL modems
-#
-# From <rob@pe1chl.ampr.org>
-# These are the /etc/magic entries to decode datafiles as used for the
-# ZyXEL U-1496E DATA/FAX/VOICE modems. (This header conforms to a
-# ZyXEL-defined standard)
-
-0 string ZyXEL\002 ZyXEL voice data
->10 byte 0 - CELP encoding
->10 byte&0x0B 1 - ADPCM2 encoding
->10 byte&0x0B 2 - ADPCM3 encoding
->10 byte&0x0B 3 - ADPCM4 encoding
->10 byte&0x0B 8 - New ADPCM3 encoding
->10 byte&0x04 4 with resync
diff --git a/client/nfsexport/bin/testing/magic.mgc b/client/nfsexport/bin/testing/magic.mgc
deleted file mode 100644
index 634b6349..00000000
--- a/client/nfsexport/bin/testing/magic.mgc
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/magic.mime b/client/nfsexport/bin/testing/magic.mime
deleted file mode 100644
index acfede24..00000000
--- a/client/nfsexport/bin/testing/magic.mime
+++ /dev/null
@@ -1,1027 +0,0 @@
-# Magic data for KMimeMagic (originally for file(1) command)
-#
-# Note on adding additional MIME types:
-#
-# [RFC2045,RFC2046] specifies that Content Types, Content Subtypes, Character
-# Sets, Access Types, and conversion values for MIME mail will be assigned and
-# listed by the IANA.
-# http://www.iana.org/assignments/media-types/
-#
-# Any unregistered file type should be listed with a preceding x-, as in
-# application/x-foo (RFC2045 5.1), or a x., as in application/x.foo (RFC4288
-# 4.3). Any non x-prefixed type should be registered with IANA and listed at
-# the above address. Any other behavior is a MIME standards violation!
-#
-# It is preferred that when a registered MIME type exists, that
-# the registered Content-Type and Subtype be used to refer to a file of
-# that type, so don't use application/x-zip when application/zip is
-# registered.
-#
-# If an active RFC suggests that a MIME registration for a new type is in
-# progress, make a note of it pointing to that RFC.
-#
-# The format is 4-5 columns:
-# Column #1: byte number to begin checking from, ">" indicates continuation
-# Column #2: type of data to match
-# Column #3: contents of data to match
-# Column #4: MIME type of result
-# Column #5: MIME encoding of result (optional)
-
-#------------------------------------------------------------------------------
-# Localstuff: file(1) magic for locally observed files
-# Add any locally observed files here.
-
-# Real Audio (Magic .ra\0375)
-0 belong 0x2e7261fd audio/x-pn-realaudio
-0 string .RMF application/vnd.rn-realmedia
-
-#video/x-pn-realvideo
-#video/vnd.rn-realvideo
-#application/vnd.rn-realmedia
-# sigh, there are many mimes for that but the above are the most common.
-
-# Taken from magic, converted to magic.mime
-# mime types according to http://www.geocities.com/nevilo/mod.htm:
-# audio/it .it
-# audio/x-zipped-it .itz
-# audio/xm fasttracker modules
-# audio/x-s3m screamtracker modules
-# audio/s3m screamtracker modules
-# audio/x-zipped-mod mdz
-# audio/mod mod
-# audio/x-mod All modules (mod, s3m, 669, mtm, med, xm, it, mdz, stm, itz, xmz, s3z)
-
-# Taken from loader code from mikmod version 2.14
-# by Steve McIntyre (stevem@chiark.greenend.org.uk)
-# <doj@cubic.org> added title printing on 2003-06-24
-0 string MAS_UTrack_V00
->14 string >/0 audio/x-mod
-#audio/x-tracker-module
-
-#0 string UN05 MikMod UNI format module sound data
-
-0 string Extended\ Module: audio/x-mod
-#audio/x-tracker-module
-##>17 string >\0 Title: "%s"
-
-21 string/c \!SCREAM! audio/x-mod
-#audio/x-screamtracker-module
-21 string BMOD2STM audio/x-mod
-#audio/x-screamtracker-module
-1080 string M.K. audio/x-mod
-#audio/x-protracker-module
-#>0 string >\0 Title: "%s"
-1080 string M!K! audio/x-mod
-#audio/x-protracker-module
-#>0 string >\0 Title: "%s"
-1080 string FLT4 audio/x-mod
-#audio/x-startracker-module
-#>0 string >\0 Title: "%s"
-1080 string FLT8 audio/x-mod
-#audio/x-startracker-module
-#>0 string >\0 Title: "%s"
-1080 string 4CHN audio/x-mod
-#audio/x-fasttracker-module
-#>0 string >\0 Title: "%s"
-1080 string 6CHN audio/x-mod
-#audio/x-fasttracker-module
-#>0 string >\0 Title: "%s"
-1080 string 8CHN audio/x-mod
-#audio/x-fasttracker-module
-#>0 string >\0 Title: "%s"
-1080 string CD81 audio/x-mod
-#audio/x-oktalyzer-tracker-module
-#>0 string >\0 Title: "%s"
-1080 string OKTA audio/x-mod
-#audio/x-oktalyzer-tracker-module
-#>0 string >\0 Title: "%s"
-# Not good enough.
-#1082 string CH
-#>1080 string >/0 %.2s-channel Fasttracker "oktalyzer" module sound data
-1080 string 16CN audio/x-mod
-#audio/x-taketracker-module
-#>0 string >\0 Title: "%s"
-1080 string 32CN audio/x-mod
-#audio/x-taketracker-module
-#>0 string >\0 Title: "%s"
-
-# Impuse tracker module (it)
-0 string IMPM audio/x-mod
-#>4 string >\0 "%s"
-#>40 leshort !0 compatible w/ITv%x
-#>42 leshort !0 created w/ITv%x
-
-#------------------------------------------------------------------------------
-# end local stuff
-#------------------------------------------------------------------------------
-
-# xml based formats!
-
-# svg
-
-38 string \<\!DOCTYPE\040svg image/svg+xml
-
-0 belong 0xfeedfeed application/x-java-keystore
-
-0 belong 0xcececece application/x-java-jce-keystore
-
-
-# xml
-0 string \<?xml text/xml
-
-
-#------------------------------------------------------------------------------
-# Java
-
-0 beshort 0xcafe
->2 beshort 0xbabe application/x-java-applet
->2 beshort 0xd00d application/x-java-pack200
-
-#------------------------------------------------------------------------------
-# audio: file(1) magic for sound formats
-#
-# from Jan Nicolai Langfeldt <janl@ifi.uio.no>,
-#
-
-# Sun/NeXT audio data
-0 string .snd
->12 belong 1 audio/basic
->12 belong 2 audio/basic
->12 belong 3 audio/basic
->12 belong 4 audio/basic
->12 belong 5 audio/basic
->12 belong 6 audio/basic
->12 belong 7 audio/basic
-
->12 belong 23 audio/x-adpcm
-
-# DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
-# that uses little-endian encoding and has a different magic number
-# (0x0064732E in little-endian encoding).
-0 lelong 0x0064732E
->12 lelong 1 audio/x-dec-basic
->12 lelong 2 audio/x-dec-basic
->12 lelong 3 audio/x-dec-basic
->12 lelong 4 audio/x-dec-basic
->12 lelong 5 audio/x-dec-basic
->12 lelong 6 audio/x-dec-basic
->12 lelong 7 audio/x-dec-basic
-# compressed (G.721 ADPCM)
->12 lelong 23 audio/x-dec-adpcm
-
-# Bytes 0-3 of AIFF, AIFF-C, & 8SVX audio files are "FORM"
-# AIFF audio data
-8 string AIFF audio/x-aiff
-# AIFF-C audio data
-8 string AIFC audio/x-aiff
-# IFF/8SVX audio data
-8 string 8SVX audio/x-aiff
-
-
-
-# Creative Labs AUDIO stuff
-# Standard MIDI data
-0 string MThd audio/x-midi
-#>9 byte >0 (format %d)
-#>11 byte >1 using %d channels
-0 string MThd audio/midi
-# Creative Music (CMF) data
-0 string CTMF audio/x-unknown
-# SoundBlaster instrument data
-0 string SBI audio/x-unknown
-# Creative Labs voice data
-0 string Creative\ Voice\ File audio/x-unknown
-## is this next line right? it came this way...
-#>19 byte 0x1A
-#>23 byte >0 - version %d
-#>22 byte >0 \b.%d
-
-# [GRR 950115: is this also Creative Labs? Guessing that first line
-# should be string instead of unknown-endian long...]
-#0 long 0x4e54524b MultiTrack sound data
-#0 string NTRK MultiTrack sound data
-#>4 long x - version %ld
-
-# Microsoft WAVE format (*.wav)
-# [GRR 950115: probably all of the shorts and longs should be leshort/lelong]
-# Microsoft RIFF
-0 string RIFF
-# - WAVE format
->8 string WAVE audio/x-wav
->8 string/B AVI video/x-msvideo
-#
->8 string CDRA image/x-coreldraw
-
-# AAC (aka MPEG-2 NBC)
-0 beshort&0xfff6 0xfff0 audio/X-HX-AAC-ADTS
-0 string ADIF audio/X-HX-AAC-ADIF
-0 beshort&0xffe0 0x56e0 audio/MP4A-LATM
-0 beshort 0x4De1 audio/MP4A-LATM
-
-# MPEG Layer 3 sound files
-# modified by Joerg Jenderek
-# GRR the original test are too common for many DOS files
-# so test 1 <= kbits nibble <= E
-0 beshort &0xffe0
->2 ubyte&0xF0 >0x0F
->>2 ubyte&0xF0 <0xE1 audio/mpeg
-#MP3 with ID3 tag
-0 string ID3 audio/mpeg
-# Ogg/Vorbis
-0 string OggS application/ogg
-
-#------------------------------------------------------------------------------
-# c-lang: file(1) magic for C programs or various scripts
-#
-
-# XPM icons (Greg Roelofs, newt@uchicago.edu)
-# ideally should go into "images", but entries below would tag XPM as C source
-0 string /*\ XPM image/x-xpmi
-
-# 3DS (3d Studio files) Conflicts with diff output 0x3d '='
-#16 beshort 0x3d3d image/x-3ds
-
-# this first will upset you if you're a PL/1 shop... (are there any left?)
-# in which case rm it; ascmagic will catch real C programs
-# C or REXX program text
-#0 string /* text/x-c
-# C++ program text
-#0 string // text/x-c++
-
-#------------------------------------------------------------------------------
-# commands: file(1) magic for various shells and interpreters
-#
-#0 string :\ shell archive or commands for antique kernel text
-0 string #!/bin/sh application/x-shellscript
-0 string #!\ /bin/sh application/x-shellscript
-0 string #!/bin/csh application/x-shellscript
-0 string #!\ /bin/csh application/x-shellscript
-# korn shell magic, sent by George Wu, gwu@clyde.att.com
-0 string #!/bin/ksh application/x-shellscript
-0 string #!\ /bin/ksh application/x-shellscript
-0 string #!/bin/tcsh application/x-shellscript
-0 string #!\ /bin/tcsh application/x-shellscript
-0 string #!/usr/local/tcsh application/x-shellscript
-0 string #!\ /usr/local/tcsh application/x-shellscript
-0 string #!/usr/local/bin/tcsh application/x-shellscript
-0 string #!\ /usr/local/bin/tcsh application/x-shellscript
-# bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
-0 string #!/bin/bash application/x-shellscript
-0 string #!\ /bin/bash application/x-shellscript
-0 string #!/usr/local/bin/bash application/x-shellscript
-0 string #!\ /usr/local/bin/bash application/x-shellscript
-
-#
-# zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
-0 string #!/bin/zsh application/x-shellscript
-0 string #!/usr/bin/zsh application/x-shellscript
-0 string #!/usr/local/bin/zsh application/x-shellscript
-0 string #!\ /usr/local/bin/zsh application/x-shellscript
-0 string #!/usr/local/bin/ash application/x-shellscript
-0 string #!\ /usr/local/bin/ash application/x-shellscript
-#0 string #!/usr/local/bin/ae Neil Brown's ae
-#0 string #!\ /usr/local/bin/ae Neil Brown's ae
-0 string #!/bin/nawk application/x-nawk
-0 string #!\ /bin/nawk application/x-nawk
-0 string #!/usr/bin/nawk application/x-nawk
-0 string #!\ /usr/bin/nawk application/x-nawk
-0 string #!/usr/local/bin/nawk application/x-nawk
-0 string #!\ /usr/local/bin/nawk application/x-nawk
-0 string #!/bin/gawk application/x-gawk
-0 string #!\ /bin/gawk application/x-gawk
-0 string #!/usr/bin/gawk application/x-gawk
-0 string #!\ /usr/bin/gawk application/x-gawk
-0 string #!/usr/local/bin/gawk application/x-gawk
-0 string #!\ /usr/local/bin/gawk application/x-gawk
-#
-0 string #!/bin/awk application/x-awk
-0 string #!\ /bin/awk application/x-awk
-0 string #!/usr/bin/awk application/x-awk
-0 string #!\ /usr/bin/awk application/x-awk
-# update to distinguish from *.vcf files by Joerg Jenderek: joerg dot jenderek at web dot de
-# Too general, \EBEGIN matches in postscript
-#0 regex BEGIN[[:space:]]*[{] application/x-awk
-
-# For Larry Wall's perl language. The ``eval'' line recognizes an
-# outrageously clever hack for USG systems.
-# Keith Waclena <keith@cerberus.uchicago.edu>
-0 string #!/bin/perl application/x-perl
-0 string #!\ /bin/perl application/x-perl
-0 string eval\ "exec\ /bin/perl application/x-perl
-0 string #!/usr/bin/perl application/x-perl
-0 string #!\ /usr/bin/perl application/x-perl
-0 string eval\ "exec\ /usr/bin/perl application/x-perl
-0 string #!/usr/local/bin/perl application/x-perl
-0 string #!\ /usr/local/bin/perl application/x-perl
-0 string eval\ "exec\ /usr/local/bin/perl application/x-perl
-
-# Type: Lua scripting language
-# URL: http://www.lua.org/
-# From: Reuben Thomas <rrt@sc3d.org>
-0 string/B #!\ /usr/bin/lua application/x-lua
-0 string/B #!\ /usr/local/bin/lua application/x-lua
-0 string #!/usr/bin/env\ lua application/x-lua
-0 string #!\ /usr/bin/env\ lua application/x-lua
-
-#------------------------------------------------------------------------------
-# compress: file(1) magic for pure-compression formats (no archives)
-#
-# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, whap, etc.
-#
-# Formats for various forms of compressed data
-# Formats for "compress" proper have been moved into "compress.c",
-# because it tries to uncompress it to figure out what's inside.
-
-# standard unix compress
-#0 string \037\235 application/x-compress
-
-# gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver)
-0 string \037\213 application/x-gzip
-
-0 string PK\003\004 application/zip
-
-# RAR archiver (Greg Roelofs, newt@uchicago.edu)
-0 string Rar! application/x-rar
-
-# According to gzip.h, this is the correct byte order for packed data.
-0 string \037\036 application/octet-stream
-#
-# This magic number is byte-order-independent.
-#
-0 short 017437 application/octet-stream
-
-# XXX - why *two* entries for "compacted data", one of which is
-# byte-order independent, and one of which is byte-order dependent?
-#
-# compacted data
-0 short 0x1fff application/octet-stream
-0 string \377\037 application/octet-stream
-# huf output
-0 short 0145405 application/octet-stream
-
-# Squeeze and Crunch...
-# These numbers were gleaned from the Unix versions of the programs to
-# handle these formats. Note that I can only uncrunch, not crunch, and
-# I didn't have a crunched file handy, so the crunch number is untested.
-# Keith Waclena <keith@cerberus.uchicago.edu>
-#0 leshort 0x76FF squeezed data (CP/M, DOS)
-#0 leshort 0x76FE crunched data (CP/M, DOS)
-
-# Freeze
-#0 string \037\237 Frozen file 2.1
-#0 string \037\236 Frozen file 1.0 (or gzip 0.5)
-
-# lzh?
-#0 string \037\240 LZH compressed data
-
-257 string ustar\0 application/x-tar posix
-257 string ustar\040\040\0 application/x-tar gnu
-
-0 short 070707 application/x-cpio
-0 short 0143561 application/x-cpio swapped
-
-0 string =<ar> application/x-archive
-0 string \!<arch> application/x-archive
->8 string debian application/x-debian-package
-
-#------------------------------------------------------------------------------
-#
-# RPM: file(1) magic for Red Hat Packages Erik Troan (ewt@redhat.com)
-#
-0 beshort 0xedab
->2 beshort 0xeedb application/x-rpm
-
-0 lelong&0x8080ffff 0x0000081a application/x-arc lzw
-0 lelong&0x8080ffff 0x0000091a application/x-arc squashed
-0 lelong&0x8080ffff 0x0000021a application/x-arc uncompressed
-0 lelong&0x8080ffff 0x0000031a application/x-arc packed
-0 lelong&0x8080ffff 0x0000041a application/x-arc squeezed
-0 lelong&0x8080ffff 0x0000061a application/x-arc crunched
-
-0 leshort 0xea60 application/x-arj
-
-# LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
-2 string -lh0- application/x-lharc lh0
-2 string -lh1- application/x-lharc lh1
-2 string -lz4- application/x-lharc lz4
-2 string -lz5- application/x-lharc lz5
-# [never seen any but the last; -lh4- reported in comp.compression:]
-2 string -lzs- application/x-lha lzs
-2 string -lh\ - application/x-lha lh
-2 string -lhd- application/x-lha lhd
-2 string -lh2- application/x-lha lh2
-2 string -lh3- application/x-lha lh3
-2 string -lh4- application/x-lha lh4
-2 string -lh5- application/x-lha lh5
-2 string -lh6- application/x-lha lh6
-2 string -lh7- application/x-lha lh7
-# Shell archives
-10 string #\ This\ is\ a\ shell\ archive application/octet-stream x-shell
-
-#------------------------------------------------------------------------------
-# frame: file(1) magic for FrameMaker files
-#
-# This stuff came on a FrameMaker demo tape, most of which is
-# copyright, but this file is "published" as witness the following:
-#
-# Note that this is the Framemaker Maker Interchange Format, not the
-# Normal format which would be application/vnd.framemaker.
-#
-0 string \<MakerFile application/x-mif
-0 string \<MIFFile application/x-mif
-0 string \<MakerDictionary application/x-mif
-0 string \<MakerScreenFon application/x-mif
-0 string \<MML application/x-mif
-0 string \<Book application/x-mif
-0 string \<Maker application/x-mif
-
-#------------------------------------------------------------------------------
-# html: file(1) magic for HTML (HyperText Markup Language) docs
-#
-# from Michael Piefel <piefel@debian.org>
-#
-0 string/cB \<!DOCTYPE\ html text/html
-0 string/cb \<head text/html
-0 string/cb \<title text/html
-0 string/bc \<html text/html
-0 string \<!-- text/html
-0 string/c \<h1 text/html
-
-#------------------------------------------------------------------------------
-# images: file(1) magic for image formats (see also "c-lang" for XPM bitmaps)
-#
-# originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
-# additions by janl@ifi.uio.no as well as others. Jan also suggested
-# merging several one- and two-line files into here.
-#
-# XXX - byte order for GIF and TIFF fields?
-# [GRR: TIFF allows both byte orders; GIF is probably little-endian]
-#
-
-# [GRR: what the hell is this doing in here?]
-#0 string xbtoa btoa'd file
-
-# PBMPLUS
-# PBM file
-0 string P1 image/x-portable-bitmap
-# PGM file
-0 string P2 image/x-portable-greymap
-# PPM file
-0 string P3 image/x-portable-pixmap
-# PBM "rawbits" file
-0 string P4 image/x-portable-bitmap
-# PGM "rawbits" file
-0 string P5 image/x-portable-greymap
-# PPM "rawbits" file
-0 string P6 image/x-portable-pixmap
-
-# NIFF (Navy Interchange File Format, a modification of TIFF)
-# [GRR: this *must* go before TIFF]
-0 string IIN1 image/x-niff
-
-# TIFF and friends
-# TIFF file, big-endian
-0 string MM image/tiff
-# TIFF file, little-endian
-0 string II image/tiff
-
-# possible GIF replacements; none yet released!
-# (Greg Roelofs, newt@uchicago.edu)
-#
-# GRR 950115: this was mine ("Zip GIF"):
-# ZIF image (GIF+deflate alpha)
-0 string GIF94z image/x-unknown
-#
-# GRR 950115: this is Jeremy Wohl's Free Graphics Format (better):
-# FGF image (GIF+deflate beta)
-0 string FGF95a image/x-unknown
-#
-# GRR 950115: this is Thomas Boutell's Portable Bitmap Format proposal
-# (best; not yet implemented):
-# PBF image (deflate compression)
-0 string PBF image/x-unknown
-
-# GIF
-0 string GIF image/gif
-
-# JPEG images
-0 beshort 0xffd8 image/jpeg
-
-# PC bitmaps (OS/2, Windoze BMP files) (Greg Roelofs, newt@uchicago.edu)
-0 string BM image/x-ms-bmp
-#>14 byte 12 (OS/2 1.x format)
-#>14 byte 64 (OS/2 2.x format)
-#>14 byte 40 (Windows 3.x format)
-#0 string IC icon
-#0 string PI pointer
-#0 string CI color icon
-#0 string CP color pointer
-#0 string BA bitmap array
-
-# CDROM Filesystems
-32769 string CD001 application/x-iso9660-image
-
-# Newer StuffIt archives (grant@netbsd.org)
-0 string StuffIt application/x-stuffit
-#>162 string >0 : %s
-
-# BinHex is the Macintosh ASCII-encoded file format (see also "apple")
-# Daniel Quinlan, quinlan@yggdrasil.com
-11 string must\ be\ converted\ with\ BinHex\ 4 application/mac-binhex40
-##>41 string x \b, version %.3s
-
-
-#------------------------------------------------------------------------------
-# lisp: file(1) magic for lisp programs
-#
-# various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
-0 string ;; text/plain
-# Emacs 18 - this is always correct, but not very magical.
-0 string \012( application/x-elc
-# Emacs 19
-0 string ;ELC\023\000\000\000 application/x-elc
-
-#------------------------------------------------------------------------------
-# mail.news: file(1) magic for mail and news
-#
-# There are tests to ascmagic.c to cope with mail and news.
-0 string Relay-Version: message/rfc822
-0 string #!\ rnews message/rfc822
-0 string N#!\ rnews message/rfc822
-0 string Forward\ to message/rfc822
-0 string Pipe\ to message/rfc822
-0 string Return-Path: message/rfc822
-0 string Received: message/rfc822
-0 string Path: message/news
-0 string Xref: message/news
-0 string From: message/rfc822
-0 string Article message/news
-#------------------------------------------------------------------------------
-# msword: file(1) magic for MS Word files
-#
-# Contributor claims:
-# Reversed-engineered MS Word magic numbers
-#
-
-0 string \376\067\0\043 application/msword
-# disable this one because it applies also to other
-# Office/OLE documents for which msword is not correct. See PR#2608.
-# from magic file of the apache
-#0 string \320\317\021\340\241\261 application/msword
-512 string \354\245\301 application/msword
-0 string \333\245-\0\0\0 application/msword
-
-
-
-#------------------------------------------------------------------------------
-# printer: file(1) magic for printer-formatted files
-#
-
-# PostScript
-0 string %! application/postscript
-0 string \004%! application/postscript
-
-# Acrobat
-# (due to clamen@cs.cmu.edu)
-0 string %PDF- application/pdf
-
-#------------------------------------------------------------------------------
-# sc: file(1) magic for "sc" spreadsheet
-#
-38 string Spreadsheet application/x-sc
-
-#------------------------------------------------------------------------------
-# tex: file(1) magic for TeX files
-#
-# XXX - needs byte-endian stuff (big-endian and little-endian DVI?)
-#
-# From <conklin@talisman.kaleida.com>
-
-# Although we may know the offset of certain text fields in TeX DVI
-# and font files, we can't use them reliably because they are not
-# zero terminated. [but we do anyway, christos]
-0 string \367\002 application/x-dvi
-#0 string \367\203 TeX generic font data
-#0 string \367\131 TeX packed font data
-#0 string \367\312 TeX virtual font data
-#0 string This\ is\ TeX, TeX transcript text
-#0 string This\ is\ METAFONT, METAFONT transcript text
-
-# There is no way to detect TeX Font Metric (*.tfm) files without
-# breaking them apart and reading the data. The following patterns
-# match most *.tfm files generated by METAFONT or afm2tfm.
-2 string \000\021 application/x-tex-tfm
-2 string \000\022 application/x-tex-tfm
-#>34 string >\0 (%s)
-
-# Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
-0 string \\input\ texinfo text/x-texinfo
-0 string This\ is\ Info\ file text/x-info
-
-# correct TeX magic for Linux (and maybe more)
-# from Peter Tobias (tobias@server.et-inf.fho-emden.de)
-#
-0 leshort 0x02f7 application/x-dvi
-
-# RTF - Rich Text Format
-0 string {\\rtf text/rtf
-
-# TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com)
-0 search/400 \\input text/x-tex
-0 search/400 \\section text/x-tex
-0 search/400 \\setlength text/x-tex
-0 search/400 \\documentstyle text/x-tex
-0 search/400 \\chapter text/x-tex
-0 search/400 \\documentclass text/x-tex
-
-# Type: Inform interactive fiction language
-# URL: http://www.inform-fiction.org/
-# From: Reuben Thomas <rrt@sc3d.org>
-0 regex [Cc]onstant[[:space:]]+[Ss]tory text/x-inform
-
-#------------------------------------------------------------------------------
-# animation: file(1) magic for animation/movie formats
-#
-# animation formats, originally from vax@ccwf.cc.utexas.edu (VaX#n8)
-# MPEG file
-# MPEG sequences
-0 belong 0x000001BA
->4 byte &0x40 video/mp2p
->4 byte ^0x40 video/mpeg
-0 belong 0x000001BB video/mpeg
-0 belong 0x000001B0 video/mp4v-es
-0 belong 0x000001B5 video/mp4v-es
-0 belong 0x000001B3 video/mpv
-0 belong&0xFF5FFF1F 0x47400010 video/mp2t
-0 belong 0x00000001
->4 byte&0x1F 0x07 video/h264
-
-# FLI animation format
-0 leshort 0xAF11 video/x-fli
-# FLC animation format
-0 leshort 0xAF12 video/x-flc
-#
-# SGI and Apple formats
-# Added ISO mimes
-0 string MOVI video/x-sgi-movie
-4 string moov video/quicktime
-4 string mdat video/quicktime
-4 string wide video/quicktime
-4 string skip video/quicktime
-4 string free video/quicktime
-4 string idsc image/x-quicktime
-4 string idat image/x-quicktime
-4 string pckg application/x-quicktime-player
-4 string/B jP image/jp2
-4 string ftyp
->8 string isom video/mp4
->8 string mp41 video/mp4
->8 string mp42 video/mp4
->8 string/B jp2 image/jp2
->8 string 3gp video/3gpp
->8 string avc1 video/3gpp
->8 string mmp4 video/mp4
->8 string/B M4A audio/mp4
->8 string/B M4V video/mp4
->8 string/B qt video/quicktime
-# The contributor claims:
-# I couldn't find a real magic number for these, however, this
-# -appears- to work. Note that it might catch other files, too,
-# so BE CAREFUL!
-#
-# Note that title and author appear in the two 20-byte chunks
-# at decimal offsets 2 and 22, respectively, but they are XOR'ed with
-# 255 (hex FF)! DL format SUCKS BIG ROCKS.
-#
-# DL file version 1 , medium format (160x100, 4 images/screen)
-0 byte 1 video/x-unknown
-0 byte 2 video/x-unknown
-#
-# Databases
-#
-# GDBM magic numbers
-# Will be maintained as part of the GDBM distribution in the future.
-# <downsj@teeny.org>
-0 belong 0x13579ace application/x-gdbm
-0 lelong 0x13579ace application/x-gdbm
-0 string GDBM application/x-gdbm
-#
-0 belong 0x061561 application/x-dbm
-#
-# Executables
-#
-0 string \177ELF
->16 leshort 0 application/octet-stream
->16 leshort 1 application/x-object
->16 leshort 2 application/x-executable
->16 leshort 3 application/x-sharedlib
->16 leshort 4 application/x-coredump
->16 beshort 0 application/octet-stream
->16 beshort 1 application/x-object
->16 beshort 2 application/x-executable
->16 beshort 3 application/x-sharedlib
->16 beshort 4 application/x-coredump
-#
-# DOS
-0 string MZ application/x-dosexec
-#
-# KDE
-0 string [KDE\ Desktop\ Entry] application/x-kdelnk
-0 string #\ KDE\ Config\ File application/x-kdelnk
-# xmcd database file for kscd
-0 string #\ xmcd text/x-xmcd
-
-#------------------------------------------------------------------------------
-# pkgadd: file(1) magic for SysV R4 PKG Datastreams
-#
-0 string #\ PaCkAgE\ DaTaStReAm application/x-svr4-package
-
-#PNG Image Format
-0 string \x89PNG image/png
-
-# MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
-0 string \x8aMNG video/x-mng
-0 string \x8aJNG video/x-jng
-
-#------------------------------------------------------------------------------
-# Hierarchical Data Format, used to facilitate scientific data exchange
-# specifications at http://hdf.ncsa.uiuc.edu/
-#Hierarchical Data Format (version 4) data
-0 belong 0x0e031301 application/x-hdf
-#Hierarchical Data Format (version 5) data
-0 string \211HDF\r\n\032 application/x-hdf
-
-# Adobe Photoshop
-0 string 8BPS image/vnd.adobe.photoshop
-
-# Felix von Leitner <felix-file@fefe.de>
-0 string d8:announce application/x-bittorrent
-
-
-# lotus 1-2-3 document
-0 belong 0x00001a00 application/x-123
-0 belong 0x00000200 application/x-123
-
-# MS Access database
-4 string Standard\ Jet\ DB application/x-msaccess
-
-## magic for XBase files
-#0 byte 0x02
-#>8 leshort >0
-#>>12 leshort 0 application/x-dbf
-#
-#0 byte 0x03
-#>8 leshort >0
-#>>12 leshort 0 application/x-dbf
-#
-#0 byte 0x04
-#>8 leshort >0
-#>>12 leshort 0 application/x-dbf
-#
-#0 byte 0x05
-#>8 leshort >0
-#>>12 leshort 0 application/x-dbf
-#
-#0 byte 0x30
-#>8 leshort >0
-#>>12 leshort 0 application/x-dbf
-#
-#0 byte 0x43
-#>8 leshort >0
-#>>12 leshort 0 application/x-dbf
-#
-#0 byte 0x7b
-#>8 leshort >0
-#>>12 leshort 0 application/x-dbf
-#
-#0 byte 0x83
-#>8 leshort >0
-#>>12 leshort 0 application/x-dbf
-#
-#0 byte 0x8b
-#>8 leshort >0
-#>>12 leshort 0 application/x-dbf
-#
-#0 byte 0x8e
-#>8 leshort >0
-#>>12 leshort 0 application/x-dbf
-#
-#0 byte 0xb3
-#>8 leshort >0
-#>>12 leshort 0 application/x-dbf
-#
-#0 byte 0xf5
-#>8 leshort >0
-#>>12 leshort 0 application/x-dbf
-#
-#0 leshort 0x0006 application/x-dbt
-
-# Debian has entries for the old PGP formats:
-# pgp: file(1) magic for Pretty Good Privacy
-# see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
-#0 beshort 0x9900 application/x-pgp-keyring
-#0 beshort 0x9501 application/x-pgp-keyring
-#0 beshort 0x9500 application/x-pgp-keyring
-#0 beshort 0xa600 application/pgp-encrypted
-#0 string -----BEGIN\040PGP text/PGP armored data
-#>15 string PUBLIC\040KEY\040BLOCK- public key block
-#>15 string MESSAGE- message
-#>15 string SIGNED\040MESSAGE- signed message
-#>15 string PGP\040SIGNATURE- signature
-#0 beshort 0x8501 data
-#text/PGP key public ring
-0 beshort 0x9900 application/pgp
-#text/PGP key security ring
-0 beshort 0x9501 application/pgp
-#text/PGP key security ring
-0 beshort 0x9500 application/pgp
-#text/PGP encrypted data
-0 beshort 0xa600 application/pgp-encrypted
-#text/PGP armored data
-##public key block
-2 string ---BEGIN\ PGP\ PUBLIC\ KEY\ BLOCK- application/pgp-keys
-0 string -----BEGIN\040PGP\40MESSAGE- application/pgp
-0 string -----BEGIN\040PGP\40SIGNATURE- application/pgp-signature
-
-#
-# GnuPG Magic:
-#
-#0 beshort 0x9901 application/x-gnupg-keyring
-#0 beshort 0x8501 text/OpenPGP data
-#text/GnuPG key public ring
-0 beshort 0x9901 application/pgp
-#text/OpenPGP data
-0 beshort 0x8501 application/pgp-encrypted
-
-# flash: file(1) magic for Macromedia Flash file format
-#
-# See
-#
-# http://www.macromedia.com/software/flash/open/
-#
-0 string FWS
->3 byte x application/x-shockwave-flash
-# Flash Video
-0 string FLV video/x-flv
-
-
-# The following paramaters are created for Namazu.
-# <http://www.namazu.org/>
-#
-# 1999/08/13
-#0 string \<!--\ MHonArc text/html; x-type=mhonarc
-0 string BZh application/x-bzip2
-
-# 1999/09/09
-# VRML (suggested by Masao Takaku)
-0 string #VRML\ V1.0\ ascii model/vrml
-0 string #VRML\ V2.0\ utf8 model/vrml
-
-#------------------------------------------------------------------------------
-# ichitaro456: file(1) magic for Just System Word Processor Ichitaro
-#
-# Contributor kenzo-:
-# Reversed-engineered JS Ichitaro magic numbers
-#
-
-0 string DOC
->43 byte 0x14 application/x-ichitaro4
->144 string JDASH application/x-ichitaro4
-
-0 string DOC
->43 byte 0x15 application/x-ichitaro5
-
-0 string DOC
->43 byte 0x16 application/x-ichitaro6
-
-#------------------------------------------------------------------------------
-# office97: file(1) magic for MicroSoft Office files
-#
-# Contributor kenzo-:
-# Reversed-engineered MS Office magic numbers
-#
-
-#0 string \320\317\021\340\241\261\032\341
-#>48 byte 0x1B application/excel
-
-2080 string Microsoft\ Excel\ 5.0\ Worksheet application/vnd.ms-excel
-2114 string Biff5 application/vnd.ms-excel
-
-0 string \224\246\056 application/msword
-
-0 belong 0x31be0000 application/msword
-
-0 string PO^Q` application/msword
-
-0 string \320\317\021\340\241\261\032\341
->546 string bjbj application/msword
->546 string jbjb application/msword
-
-512 string R\0o\0o\0t\0\ \0E\0n\0t\0r\0y application/msword
-
-2080 string Microsoft\ Word\ 6.0\ Document application/msword
-2080 string Documento\ Microsoft\ Word\ 6 application/msword
-2112 string MSWordDoc application/msword
-
-#0 string \320\317\021\340\241\261\032\341 application/powerpoint
-0 string \320\317\021\340\241\261\032\341 application/msword
-
-0 string #\ PaCkAgE\ DaTaStReAm application/x-svr4-package
-
-
-# WinNT/WinCE PE files (Warner Losh, imp@village.org)
-#
-128 string PE\000\000 application/octet-stream
-0 string PE\000\000 application/octet-stream
-
-# miscellaneous formats
-0 string LZ application/octet-stream
-
-# DOS device drivers by Joerg Jenderek
-0 belong 0xffffffff application/octet-stream
-
-# .EXE formats (Greg Roelofs, newt@uchicago.edu)
-#
-0 string MZ
->24 string @ application/octet-stream
-
-0 string MZ
->30 string Copyright\ 1989-1990\ PKWARE\ Inc. application/zip
-
-0 string MZ
->30 string PKLITE\ Copr. application/zip
-
-0 string MZ
->36 string LHa's\ SFX application/x-lha
-
-0 string MZ application/octet-stream
-
-# LHA archiver
-2 string -lh
->6 string - application/x-lha
-
-
-# Zoo archiver
-20 lelong 0xfdc4a7dc application/x-zoo
-
-# ARC archiver
-0 lelong&0x8080ffff 0x0000081a application/x-arc
-0 lelong&0x8080ffff 0x0000091a application/x-arc
-0 lelong&0x8080ffff 0x0000021a application/x-arc
-0 lelong&0x8080ffff 0x0000031a application/x-arc
-0 lelong&0x8080ffff 0x0000041a application/x-arc
-0 lelong&0x8080ffff 0x0000061a application/x-arc
-
-# Microsoft Outlook's Transport Neutral Encapsulation Format (TNEF)
-0 lelong 0x223e9f78 application/vnd.ms-tnef
-
-# From: stephane.loeuillet@tiscali.f
-# http://www.djvuzone.org/
-0 string AT&TFORM image/vnd.djvu
-
-# Danny Milosavljevic <danny.milo@gmx.net>
-# this are adrift (adventure game standard) game files, extension .taf
-# depending on version magic continues with 0x93453E6139FA (V 4.0)
-# 0x9445376139FA (V 3.90)
-# 0x9445366139FA (V 3.80)
-# this is from source (http://www.adrift.org.uk/) and I have some taf
-# files, and checked them.
-#0 belong 0x3C423FC9
-#>4 belong 0x6A87C2CF application/x-adrift
-#0 string \000\000\001\000 image/x-ico
-
-# Quark Xpress 3 Files:
-# (made the mimetype up)
-0 string \0\0MMXPR3\0 application/x-quark-xpress-3
-
-# EET archive
-# From: Tilman Sauerbeck <tilman@code-monkey.de>
-0 belong 0x1ee7ff00 application/x-eet
-
-# From: Denis Knauf, via gentoo.
-0 string fLaC audio/x-flac
-0 string CWS application/x-shockwave-flash
-
-# Hangul Document Files:
-# Reversed-engineered HWP magic numbers
-# From: Won-Kyu Park <wkpark@kldp.org>
-512 string R\0o\0o\0t\0 application/x-hwp
-
-0 string/c BEGIN:VCARD text/x-vcard
-0 string WordPro\0 application/vnd.lotus-wordpro
-0 string WordPro\r\373 application/vnd.lotus-wordpro
-0 string CPC\262 image/x-cpi
-
-#
-128 string DICM application/dicom
-
-# Symbian installation files
-8 lelong 0x10000419 application/vnd.symbian.install
-0 lelong 0x10201A7A x-epoc/x-sisx-app
-# FORTRAN source
-0 string/c c\ text/x-fortran
-
-# Gnumeric spreadsheet
-# This entry is only semi-helpful, as Gnumeric compresses its files, so
-# they will ordinarily reported as "compressed", but at least -z helps
-39 string =<gmr:Workbook application/x-gnumeric
diff --git a/client/nfsexport/bin/testing/mbuffer b/client/nfsexport/bin/testing/mbuffer
deleted file mode 100755
index 698bba92..00000000
--- a/client/nfsexport/bin/testing/mbuffer
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/partimage b/client/nfsexport/bin/testing/partimage
deleted file mode 100755
index fdd2a9f4..00000000
--- a/client/nfsexport/bin/testing/partimage
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/pv b/client/nfsexport/bin/testing/pv
deleted file mode 100755
index 3700569b..00000000
--- a/client/nfsexport/bin/testing/pv
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/udp-receiver b/client/nfsexport/bin/testing/udp-receiver
deleted file mode 100755
index 6b230aaa..00000000
--- a/client/nfsexport/bin/testing/udp-receiver
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/udp-sender b/client/nfsexport/bin/testing/udp-sender
deleted file mode 100755
index 87789a05..00000000
--- a/client/nfsexport/bin/testing/udp-sender
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/testing/whereis b/client/nfsexport/bin/testing/whereis
deleted file mode 100755
index fdaea94a..00000000
--- a/client/nfsexport/bin/testing/whereis
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/gzip b/client/nfsexport/bin/x86_64/gzip
deleted file mode 100755
index d9f73093..00000000
--- a/client/nfsexport/bin/x86_64/gzip
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/mbuffer b/client/nfsexport/bin/x86_64/mbuffer
deleted file mode 100755
index 3c44dce8..00000000
--- a/client/nfsexport/bin/x86_64/mbuffer
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/mkntfs b/client/nfsexport/bin/x86_64/mkntfs
deleted file mode 100755
index 0ede0c4f..00000000
--- a/client/nfsexport/bin/x86_64/mkntfs
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/ntfsresize b/client/nfsexport/bin/x86_64/ntfsresize
deleted file mode 100755
index 9f571121..00000000
--- a/client/nfsexport/bin/x86_64/ntfsresize
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/partclone.btrfs b/client/nfsexport/bin/x86_64/partclone.btrfs
deleted file mode 100755
index fdc8d42c..00000000
--- a/client/nfsexport/bin/x86_64/partclone.btrfs
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/partclone.chkimg b/client/nfsexport/bin/x86_64/partclone.chkimg
deleted file mode 100755
index e30d50cd..00000000
--- a/client/nfsexport/bin/x86_64/partclone.chkimg
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/partclone.dd b/client/nfsexport/bin/x86_64/partclone.dd
deleted file mode 100755
index d252c8ce..00000000
--- a/client/nfsexport/bin/x86_64/partclone.dd
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/partclone.extfs b/client/nfsexport/bin/x86_64/partclone.extfs
deleted file mode 100755
index 64e4c96b..00000000
--- a/client/nfsexport/bin/x86_64/partclone.extfs
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/partclone.fat b/client/nfsexport/bin/x86_64/partclone.fat
deleted file mode 100755
index 75103e08..00000000
--- a/client/nfsexport/bin/x86_64/partclone.fat
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/partclone.hfsp b/client/nfsexport/bin/x86_64/partclone.hfsp
deleted file mode 100755
index d82d2f8a..00000000
--- a/client/nfsexport/bin/x86_64/partclone.hfsp
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/partclone.info b/client/nfsexport/bin/x86_64/partclone.info
deleted file mode 100755
index 578b7966..00000000
--- a/client/nfsexport/bin/x86_64/partclone.info
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/partclone.ntfs b/client/nfsexport/bin/x86_64/partclone.ntfs
deleted file mode 100755
index 1dd9ed32..00000000
--- a/client/nfsexport/bin/x86_64/partclone.ntfs
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/partclone.ntfsfixboot b/client/nfsexport/bin/x86_64/partclone.ntfsfixboot
deleted file mode 100755
index 6b6ae345..00000000
--- a/client/nfsexport/bin/x86_64/partclone.ntfsfixboot
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/partclone.restore b/client/nfsexport/bin/x86_64/partclone.restore
deleted file mode 100755
index 8f337e07..00000000
--- a/client/nfsexport/bin/x86_64/partclone.restore
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/partprobe b/client/nfsexport/bin/x86_64/partprobe
deleted file mode 100755
index 4721b33c..00000000
--- a/client/nfsexport/bin/x86_64/partprobe
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/udp-receiver b/client/nfsexport/bin/x86_64/udp-receiver
deleted file mode 100755
index 11291de0..00000000
--- a/client/nfsexport/bin/x86_64/udp-receiver
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/bin/x86_64/udp-sender b/client/nfsexport/bin/x86_64/udp-sender
deleted file mode 100755
index d63c67fd..00000000
--- a/client/nfsexport/bin/x86_64/udp-sender
+++ /dev/null
Binary files differ
diff --git a/client/nfsexport/etc/preinit/fileslinks.sh b/client/nfsexport/etc/preinit/fileslinks.sh
deleted file mode 100755
index 07b87399..00000000
--- a/client/nfsexport/etc/preinit/fileslinks.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-#/**
-#@file fileslinks.sh
-#@brief Script de inicio para copiar ficheros y deinir enlaces simbólicos.
-#@note Desglose del script "loadenviron.sh".
-#@warning License: GNU GPLv3+
-#@version 0.9
-#@author Ramon Gomez, ETSII Universidad de Sevilla
-#@date 2009-10-10
-#*/
-
-
-# Si está configurado OpenGNSys ...
-if [ -n "$OPENGNSYS" ]; then
- echo "$MSG_MAKELINKS"
- # Para tener /bin/bash y no haya problemas
- ln -fs $OGBIN/bash /bin/bash
-
- # Crear directorio de bloqueos
- mkdir -p /var/lock
-
- # Directorio de tipos de letras para el browser.
- #QTLIBS=$(grep qt_libspath $OGBIN/browser 2>/dev/null | cut -f2 -d=)
- QTVERS="/usr/local/QtEmbedded-4.6.3"
- QTDIR="${QTVERS%-*}"
- mkdir -p $QTDIR
- ln -fs $QTDIR $QTVERS
- mkdir -p $QTDIR/lib
- ln -fs $OGLIB/fonts $QTDIR/lib
-
- # Datos de dispositivos PCI en /etc
- ln -fs $OGLIB/pci.ids /etc
-else
- # FIXME Error: entorno de OpenGNSys no configurado.
- echo "Error: OpenGnSys environment is not configured." # FIXME: definir mensaje.
- exit 1
-fi
-
diff --git a/client/nfsexport/scripts/admBootOs b/client/nfsexport/scripts/admBootOs
deleted file mode 100755
index c94ffae1..00000000
--- a/client/nfsexport/scripts/admBootOs
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-RETORNO=$(bootOs $* 2>/dev/null) || exit $?
-exit 0
diff --git a/client/nfsexport/scripts/admCreateImage b/client/nfsexport/scripts/admCreateImage
deleted file mode 100755
index 338d46bd..00000000
--- a/client/nfsexport/scripts/admCreateImage
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-RETORNO=$(createImage $* 2>/dev/null) || exit $?
-exit 0
diff --git a/client/nfsexport/scripts/admCreateLogicalPartitions b/client/nfsexport/scripts/admCreateLogicalPartitions
deleted file mode 100755
index 7a693aac..00000000
--- a/client/nfsexport/scripts/admCreateLogicalPartitions
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-
diff --git a/client/nfsexport/scripts/admCreatePrimaryPartitions b/client/nfsexport/scripts/admCreatePrimaryPartitions
deleted file mode 100755
index 2296d7f7..00000000
--- a/client/nfsexport/scripts/admCreatePrimaryPartitions
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-RETORNO=$(createPrimaryPartitions $* 2>/dev/null) || exit $?
-exit 0
-
-
diff --git a/client/nfsexport/scripts/admFormatFs b/client/nfsexport/scripts/admFormatFs
deleted file mode 100755
index 96c9b1c6..00000000
--- a/client/nfsexport/scripts/admFormatFs
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-RETORNO=$(formatFs $* 2>/dev/null) || exit $?
-exit 0
-
diff --git a/client/nfsexport/scripts/admGetFsType b/client/nfsexport/scripts/admGetFsType
deleted file mode 100755
index 29e9ce1d..00000000
--- a/client/nfsexport/scripts/admGetFsType
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-RETORNO=$(getFsType $* 2>/dev/null) || exit $?
-# Fichero tempotal de salida para intercambio de datos con el servicio
-OTPUTFILE="/tmp/retorno"
-echo $RETORNO>$OTPUTFILE || exit $?
-exit 0
diff --git a/client/nfsexport/scripts/admGetIpAddress b/client/nfsexport/scripts/admGetIpAddress
deleted file mode 100755
index 36fc834a..00000000
--- a/client/nfsexport/scripts/admGetIpAddress
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-RETORNO=$(getIpAddress $* 2>/dev/null) || exit $?
-# Fichero tempotal de salida para intercambio de datos con el servicio
-OTPUTFILE="/tmp/retorno"
-echo $RETORNO>$OTPUTFILE || exit $?
-exit 0
diff --git a/client/nfsexport/scripts/admGetOsVersion b/client/nfsexport/scripts/admGetOsVersion
deleted file mode 100755
index 47a3991a..00000000
--- a/client/nfsexport/scripts/admGetOsVersion
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-RETORNO=$(getOsVersion $* 2>/dev/null) || exit $?
-# Fichero tempotal de salida para intercambio de datos con el servicio
-OTPUTFILE="/tmp/retorno"
-echo $RETORNO>$OTPUTFILE || exit $?
-exit 0
diff --git a/client/nfsexport/scripts/admListHardwareInfo b/client/nfsexport/scripts/admListHardwareInfo
deleted file mode 100755
index 429f1d07..00000000
--- a/client/nfsexport/scripts/admListHardwareInfo
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-RETORNO=$(listHardwareInfo $* 2>/dev/null) || exit $?
-# Fichero tempotal de salida para intercambio de datos con el servicio
-OTPUTFILE="/tmp/retorno"
-echo $RETORNO>$OTPUTFILE || exit $?
-exit 0
diff --git a/client/nfsexport/scripts/admListPrimaryPartitions b/client/nfsexport/scripts/admListPrimaryPartitions
deleted file mode 100755
index 1d8ce077..00000000
--- a/client/nfsexport/scripts/admListPrimaryPartitions
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-RETORNO=$(listPrimaryPartitions $* 2>/dev/null) || exit $?
-# Fichero tempotal de salida para intercambio de datos con el servicio
-OTPUTFILE="/tmp/retorno"
-echo $RETORNO>$OTPUTFILE || exit $?
-exit 0
-
diff --git a/client/nfsexport/scripts/admListSoftwareInfo b/client/nfsexport/scripts/admListSoftwareInfo
deleted file mode 100755
index e41bbb93..00000000
--- a/client/nfsexport/scripts/admListSoftwareInfo
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-RETORNO=$(listSoftwareInfo $* 2>/dev/null) || exit $?
-# Fichero tempotal de salida para intercambio de datos con el servicio
-OTPUTFILE="/tmp/retorno"
-echo $RETORNO>$OTPUTFILE || exit $?
-exit 0
diff --git a/client/nfsexport/scripts/admMenuBrowser b/client/nfsexport/scripts/admMenuBrowser
deleted file mode 100755
index 2214920f..00000000
--- a/client/nfsexport/scripts/admMenuBrowser
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-RETORNO=$(menuBrowser $* 2>/dev/null) || exit $?
-exit 0
diff --git a/client/nfsexport/scripts/admRestoreImage b/client/nfsexport/scripts/admRestoreImage
deleted file mode 100755
index 642cd298..00000000
--- a/client/nfsexport/scripts/admRestoreImage
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-RETORNO=$(restoreImage $* 2>/dev/null) || exit $?
-exit 0
-
diff --git a/client/nfsexport/README.es.txt b/client/shared/README.es.txt
index 4ad361cb..4ad361cb 100644
--- a/client/nfsexport/README.es.txt
+++ b/client/shared/README.es.txt
diff --git a/client/nfsexport/bin/i386/EACInterfaces b/client/shared/bin/EACInterfaces
index b63b1db1..b63b1db1 100755
--- a/client/nfsexport/bin/i386/EACInterfaces
+++ b/client/shared/bin/EACInterfaces
Binary files differ
diff --git a/client/nfsexport/bin/browser b/client/shared/bin/browser
index 08b77dbd..def911e7 100755
--- a/client/nfsexport/bin/browser
+++ b/client/shared/bin/browser
Binary files differ
diff --git a/client/shared/bin/ogAdmClient b/client/shared/bin/ogAdmClient
new file mode 100755
index 00000000..2690d974
--- /dev/null
+++ b/client/shared/bin/ogAdmClient
Binary files differ
diff --git a/client/shared/bin/runtest b/client/shared/bin/runtest
new file mode 100755
index 00000000..b18778cd
--- /dev/null
+++ b/client/shared/bin/runtest
@@ -0,0 +1,246 @@
+#!/usr/bin/env python
+from __future__ import print_function
+
+import os
+import subprocess
+import doctest
+import re
+
+FIRST_SCRIPT = 'prepare'
+LAST_SCRIPT = 'cleanup'
+
+PRE_EXTENSION = '.pre'
+POST_EXTENSION = '.post'
+
+PYTHON_TEST_EXTENSION = '.pytest'
+BASH_TEST_EXTENSION = '.shtest'
+
+
+class RunTest:
+ '''Runs the tests'''
+
+ def __init__(self):
+ self.path = os.path.abspath('.')
+
+ # Only no-hide files
+ self.all_files = [filename for filename in os.listdir(self.path)
+ if filename[0] != '.' and os.path.isfile(filename)]
+
+ self.all_files = sorted(self.all_files)
+
+ self.python_tests = []
+ self.bash_tests = []
+ self.script_tests = []
+ self.first_script = ''
+ self.last_script = ''
+ self.pre_scripts = []
+ self.post_scripts = []
+
+ for filename in self.all_files:
+ if filename.endswith(PYTHON_TEST_EXTENSION):
+ self.python_tests.append(filename)
+
+ elif filename.endswith(BASH_TEST_EXTENSION):
+ self.bash_tests.append(filename)
+
+ elif os.access(filename, os.X_OK):
+ basename, extension = os.path.splitext(filename)
+ if basename == FIRST_SCRIPT:
+ if self.first_script:
+ raise MoreThanOneFirstScript()
+ self.first_script = filename
+ elif basename == LAST_SCRIPT:
+ if self.last_script:
+ raise MoreThanOneLastScript()
+ self.last_script = filename
+ elif extension == PRE_EXTENSION:
+ self.pre_scripts.append(filename)
+ elif extension == POST_EXTENSION:
+ self.post_scripts.append(filename)
+ else:
+ self.script_tests.append(filename)
+
+ self.fails = 0
+
+ def run_script(self, script):
+ '''Run a script test'''
+ path_script = os.path.join(self.path, script)
+ proc = subprocess.Popen((path_script), shell=True, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ return_value = proc.wait()
+ if return_value != 0:
+ self.fails += 1
+ stdout, stderr = proc.communicate()
+ print("*******************************************************")
+ print("Error %d in %s:" % (return_value, script))
+ print(stdout.decode(), end='')
+ print(stderr.decode(), end='')
+
+ return return_value
+
+ def run_bash_test(self, script):
+ '''Run bash test'''
+ #import pdb; pdb.set_trace()
+ path_script = os.path.join(self.path, script)
+ errors = 0
+ test_no = 0
+
+ for command, result, line in read_bash_tests(path_script):
+ test_no += 1
+ try:
+ proc = subprocess.Popen(('/bin/bash', '-c', command),
+ stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ stdout = proc.communicate()[0]
+ except OSError as exc:
+ print('File "%s" line %d:' % (script, line))
+ print('Failed example:')
+ print(' ' + command)
+ print("Exception was raised:")
+ print(" ", end="")
+ print(exc)
+ print("*******************************************************")
+ errors += 1
+
+ else:
+ if result != stdout.decode():
+ print('File "%s" line %d:' % (script, line))
+ print('Failed example:')
+ print(' ' + command)
+ print("Expected:")
+ for l in result.split('\n')[:-1]:
+ print(' ' + l)
+ print("Got:")
+ for l in stdout.decode().split('\n')[:-1]:
+ print(' ' + l)
+ errors += 1
+ print("*******************************************************")
+
+ if errors != 0:
+ print("%d items had failures:" % errors)
+ print(" %d of %d in %s" % (errors, test_no, script))
+ print("***Test failed***")
+ else:
+ print("%3d tests PASSED in %s" % (test_no, script))
+
+ return errors
+
+
+ def run_pre_test(self, test):
+ '''Run the pre-test of a test'''
+ pre_test = test + PRE_EXTENSION
+ return_value = 0
+ if pre_test in self.pre_scripts:
+ return_value = self.run_script(pre_test)
+ if return_value:
+ print("No running: %s %s" % (test, test + POST_EXTENSION))
+
+ return return_value
+
+ def run_post_test(self, test):
+ '''Run the post-test of a test'''
+ post_test = test + POST_EXTENSION
+ if post_test in self.post_scripts:
+ return self.run_script(post_test)
+
+ def run_tests(self):
+ '''Run the tests in the correct order'''
+ if self.first_script:
+ if self.run_script(self.first_script) != 0:
+ print('*Error in prepare script. Aborting.*')
+ return self.show_errors()
+
+ all_tests = sorted(self.script_tests + self.python_tests + self.bash_tests)
+ for test in all_tests:
+ if self.run_pre_test(test) != 0:
+ continue
+
+ if test in self.script_tests:
+ self.run_script(test)
+ elif test in self.bash_tests:
+ fails = self.run_bash_test(test)
+ self.fails += fails
+ elif test in self.python_tests:
+ fails, n_tests = doctest.testfile(test, module_relative=False)
+ self.fails += fails
+
+ self.run_post_test(test)
+
+ if self.last_script:
+ self.run_script(self.last_script)
+
+ return self.show_errors()
+
+ def show_errors(self):
+ '''Show the total errors'''
+ if self.fails:
+ print("*******************************************************")
+ print("Total errors: %d" % self.fails)
+
+ return self.fails
+
+class MoreThanOneFirstScript(Exception):
+ def __init__(self):
+ super(MoreThanOneFirstScript, self).__init__(
+ "More than one %s script" % FIRST_SCRIPT)
+
+class MoreThanOneLastScript(Exception):
+ def __init__(self):
+ super(MoreThanOneLastScript, self).__init__(
+ "More than one %s script" % LAST_SCRIPT)
+
+
+def read_bash_tests(file_name):
+ '''Iterator that yields the found tests'''
+ fd = open(file_name)
+ command = ''
+ result = ''
+ tests = []
+ line_no = 0
+ command_line = 0
+ command_re = re.compile("^\$ (.*)\n")
+
+ for line in fd.readlines():
+ line_no += 1
+
+ match = command_re.match(line)
+ if match:
+ # Is it a command?
+ if command:
+ # If it is a command but we have a previous command to send
+ yield (command, result, command_line)
+ result = ''
+
+ command = match.group(1)
+ command_line = line_no
+
+ elif command:
+ # If not a command but we have a previous command
+ if line != "\n":
+ # It's a part of the result
+ if line == "<BLANKLINE>\n":
+ result += '\n'
+ else:
+ result += line
+
+ else:
+ # Or it's the end of the result, yielding
+
+ yield (command, result, command_line)
+ command = ''
+ result = ''
+
+
+ else:
+ # This line is a comment
+ pass
+
+ if command:
+ # Cheking if the last command was sent
+ yield (command, result, command_line)
+
+ fd.close()
+
+
+if __name__ == "__main__":
+ r = RunTest()
+ r.run_tests()
diff --git a/client/nfsexport/etc/init/default.sh b/client/shared/etc/init/default.sh
index b6752fad..e5e1a34f 100755
--- a/client/nfsexport/etc/init/default.sh
+++ b/client/shared/etc/init/default.sh
@@ -1,4 +1,11 @@
-#!/opt/opengnsys/bin/bash
+#!/bin/bash
+
+# TODO Separar esta sección en otro script
+# Lanzar servicios complementarios del cliente.
+echo -ne "og\nog\n" | passwd root
+/etc/init.d/ssh restart
+#setterm -blank 0 -powersave off -powerdown 0 < /dev/console > /dev/console 2>&1
+ethtool -s $DEVICE wol g 2>/dev/null
# Fichero de registro de incidencias (en el servidor; si no, en local).
OPENGNSYS=${OPENGNSYS:-/opt/opengnsys}
@@ -6,11 +13,13 @@ OGLOGFILE=${OGLOGFILE:-$OPENGNSYS/log/${ogGetIpAdderss},log}
if ! touch $OGLOGFILE 2>/dev/null; then
OGLOGFILE=/var/log/opengnsys.log
fi
+LOGLEVEL=5
# Arranque de OpenGnSys Client.
if [ -x "$OPENGNSYS/bin/ogAdmClient" ]; then
echo "$MSG_LAUNCHCLIENT"
- $OPENGNSYS/bin/ogAdmClient -f $OPENGNSYS/etc/ogAdmClient.cfg -l $OGLOGFILE
+ [ $ogactiveadmin == "true" ] && boot=admin
+ $OPENGNSYS/bin/ogAdmClient -f $OPENGNSYS/etc/ogAdmClient.cfg -l $OGLOGFILE -d $LOGLEVEL
fi
# Si fallo en cliente y modo "admin", cargar shell; si no, salir.
diff --git a/client/shared/etc/init/defaultTESTING.sh b/client/shared/etc/init/defaultTESTING.sh
new file mode 100755
index 00000000..7a258588
--- /dev/null
+++ b/client/shared/etc/init/defaultTESTING.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+/etc/init.d/ssh restart
+#setterm -blank 0 -powersave off -powerdown 0 < /dev/console > /dev/console 2>&1
+
+ethtool -s eth0 wol g
+
+
+# Fichero de registro de incidencias (en el servidor; si no, en local).
+OPENGNSYS=${OPENGNSYS:-/opt/opengnsys}
+OGLOGFILE=${OGLOGFILE:-$OPENGNSYS/log/${ogGetIpAdderss},log}
+if ! touch $OGLOGFILE 2>/dev/null; then
+ OGLOGFILE=/var/log/opengnsys.log
+fi
+
+echo -ne "og\nog\n" | passwd root
+
+#TODO => activacion de modo escritura en REPO
+
+if [ $ogactiveadmin == "true" ]
+then
+ export boot=admin
+ umount /opt/opengnsys/images
+
+ if [ "$ogprotocol" == "nfs" ]
+ then
+ mount.nfs ${ROOTSERVER}:/opt/opengnsys/images /opt/opengnsys/images -o nolock
+ fi
+
+ if [ "$ogprotocol" == "smb" ]
+ then
+ echo "montando smb"
+ mount.cifs //${ROOTSERVER}/ogimages /opt/opengnsys/images -o user=opengnsys,pass=og
+ echo mount.cifs //${ROOTSERVER}/ogimages /opt/opengnsys/images -o user=opengnsys,pass=og
+
+ fi
+fi
+# Arranque de OpenGnSys Client.
+if [ -x "$OPENGNSYS/bin/ogAdmClient" ]; then
+
+
+ echo "$MSG_LAUNCHCLIENT modo cliente full"
+ $OPENGNSYS/bin/ogAdmClient -f $OPENGNSYS/etc/ogAdmClient.cfg -l $OGLOGFILE -d 5
+fi
+
+# Si fallo en cliente y modo "admin", cargar shell; si no, salir.
+#if [ "$boot" == "admin" ]; then
+ bash
+#fi
diff --git a/client/nfsexport/etc/lang.es_ES.UTF-8.conf b/client/shared/etc/lang.es_ES.UTF-8.conf
index 330cec2b..330cec2b 120000
--- a/client/nfsexport/etc/lang.es_ES.UTF-8.conf
+++ b/client/shared/etc/lang.es_ES.UTF-8.conf
diff --git a/client/nfsexport/etc/lang.es_ES.conf b/client/shared/etc/lang.es_ES.conf
index 929c1288..a63da81a 100644
--- a/client/nfsexport/etc/lang.es_ES.conf
+++ b/client/shared/etc/lang.es_ES.conf
@@ -42,7 +42,7 @@ MSG_LOADAPI="Cargar funciones del motor de clonación."
MSG_LOADMODULES="Cargar módulos del kernel."
MSG_LOADUDEBS="Cargar paquetes udeb."
MSG_MAKELINKS="Crear enlaces simbólicos."
-MSG_MOUNTREPO="Montar repositorio en modo %s."
+MSG_MOUNTREPO="Montar repositorio por %s en modo %s."
MSG_OFFLINEMODE="Modo de arranque sin conexión."
MSG_HELP_ogBoot="Arranca un sistema operativo instalado."
diff --git a/client/nfsexport/etc/preinit/default.sh b/client/shared/etc/preinit/default.sh
index d16da52a..539c12fe 100755
--- a/client/nfsexport/etc/preinit/default.sh
+++ b/client/shared/etc/preinit/default.sh
@@ -1,14 +1,14 @@
-#!/opt/opengnsys/bin/bash
-
-# Para que no haya problemas con el interprete
-ln -fs /opt/opengnsys/bin/bash /bin/bash
+#!/bin/bash
+# Cargar entorno de OpenGnSys
set -a
-
source /opt/opengnsys/etc/preinit/loadenviron.sh
-for f in fileslinks.sh loadudeb.sh loadmodules.sh metadevs.sh; do
- $OGETC/preinit/$f
+
+# Scripts de inicio.
+for f in fileslinks loadmodules mountrepo; do
+ $OGETC/preinit/$f.sh
done
+
unset f
if [ -f $OGETC/init/$OG_IP.sh ]; then
diff --git a/client/shared/etc/preinit/fileslinks.sh b/client/shared/etc/preinit/fileslinks.sh
new file mode 100755
index 00000000..b1a6aeb2
--- /dev/null
+++ b/client/shared/etc/preinit/fileslinks.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+#/**
+#@file fileslinks.sh
+#@brief Script de inicio para copiar ficheros y deinir enlaces simbólicos.
+#@warning License: GNU GPLv3+
+#@version 0.9
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2009-10-10
+#@version 1.0
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2011-03-21
+#*/
+
+
+# Si está configurado OpenGnSys ...
+if [ -n "$OPENGNSYS" ]; then
+ echo "$MSG_MAKELINKS"
+
+ # Shell BASH por defecto (para usar "runtest")
+ ln -fs /bin/bash /bin/sh
+
+ # Crear directorio de bloqueos
+ mkdir -p /var/lock
+
+# # Directorio de tipos de letras para el browser.
+ QTDIR="/usr/local"
+ # mkdir -p $QTDIR/lib
+ # ln -fs $OGLIB/fonts $QTDIR/lib
+
+else
+ # FIXME Error: entorno de OpenGNSys no configurado.
+ echo "Error: OpenGnSys environment is not configured." # FIXME: definir mensaje.
+ exit 1
+fi
+
diff --git a/client/nfsexport/etc/preinit/loadenviron.sh b/client/shared/etc/preinit/loadenviron.sh
index e0a687c6..c3dae813 100755
--- a/client/nfsexport/etc/preinit/loadenviron.sh
+++ b/client/shared/etc/preinit/loadenviron.sh
@@ -23,11 +23,16 @@ if [ -d $OPENGNSYS ]; then
export OGCAC=$OPENGNSYS/cache
export OGLOG=$OPENGNSYS/log
- export PATH=$OGBIN:$OGAPI:$OGSCRIPTS:$PATH
- export LD_LIBRARY_PATH=$OGLIB:$LD_LIBRARY_PATH
-
+ export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:/opt/og2fs/2ndfs/opt/drbl/sbin
+ export PATH=$OGSCRIPTS:$PATH:$OGAPI:$OGBIN
+
+ # Exportar parámetros del kernel.
+ for i in $(cat /proc/cmdline); do
+ echo $i | grep -q "=" && export $i
+ done
+
# Cargar fichero de idioma.
- LANGFILE=$OGETC/lang.$LANG.conf
+ LANGFILE=$OGETC/lang.${LANG%@*}.conf
if [ -f $LANGFILE ]; then
source $LANGFILE
for i in $(awk -F= '{if (NF==2) print $1}' $LANGFILE); do
@@ -35,30 +40,30 @@ if [ -d $OPENGNSYS ]; then
done
fi
echo "$MSG_LOADAPI"
+
# Cargar mapa de teclado.
loadkeys ${LANG%_*} >/dev/null
+
# Cargar API de funciones.
for i in $OGAPI/*.lib; do
source $i
done
+
for i in $(typeset -F | cut -f3 -d" "); do
export -f $i
done
- # Carga de las API testing
- if [ "$engine" = "testing" ]
+
+ # Carga de las API segun engine
+ if [ -n "$ogengine" ]
then
- for i in $OGAPI/*.testing; do
- source $i
+ for i in $OGAPI/*.$ogengine; do
+ [ -f $i ] && source $i
done
fi
- # Añadir dependencia de arquitectura
- ARCH=$(ogGetArch)
- if [ -n "$ARCH" ]; then
- export PATH=$OGBIN/$ARCH:$PATH
- export LD_LIBRARY_PATH=$OGLIB/$ARCH:$LD_LIBRARY_PATH
- fi
+
# Fichero de registros.
export OGLOGFILE="$OGLOG/$(ogGetIpAddress).log"
+
# FIXME Pruebas para grupos de ordenadores
#export OGGROUP=$(ogGetGroup)
export OGGROUP="$group"
@@ -73,4 +78,3 @@ export OG_ERR_IMAGE=5 # Error al crear o restaurar una imagen.
export OG_ERR_NOTOS=6 # Sin sistema operativo.
export OG_ERR_NOTEXEC=7 # Programa o función no ejecutable.
-
diff --git a/client/nfsexport/etc/preinit/loadmodules.sh b/client/shared/etc/preinit/loadmodules.sh
index 974ddded..d72cb6fb 100755
--- a/client/nfsexport/etc/preinit/loadmodules.sh
+++ b/client/shared/etc/preinit/loadmodules.sh
@@ -16,12 +16,6 @@ MODULESDIR=/lib/modules/$(uname -r)/kernel
# Módulo del ratón.
insmod $MODULESDIR/drivers/input/mouse/psmouse.ko 2>/dev/null
-# Módulos de discos.
-for m in $MODULESDIR/drivers/ata/*.ko; do
- insmod $m 2>/dev/null
-done
-# Módulos de sistemas de archivos.
-for f in reiserfs jfs xfs hfs hfsplus; do
- insmod $MODULESDIR/fs/$f/$f.ko 2>/dev/null
-done
+
+
diff --git a/client/nfsexport/etc/preinit/loadudeb.sh b/client/shared/etc/preinit/loadudeb.sh.NoUsed
index 662887c0..662887c0 100755
--- a/client/nfsexport/etc/preinit/loadudeb.sh
+++ b/client/shared/etc/preinit/loadudeb.sh.NoUsed
diff --git a/client/nfsexport/etc/preinit/metadevs.sh b/client/shared/etc/preinit/metadevs.sh.NoUsed
index 0870e552..0870e552 100755
--- a/client/nfsexport/etc/preinit/metadevs.sh
+++ b/client/shared/etc/preinit/metadevs.sh.NoUsed
diff --git a/client/shared/etc/preinit/mountrepo.sh b/client/shared/etc/preinit/mountrepo.sh
new file mode 100755
index 00000000..aa0b9886
--- /dev/null
+++ b/client/shared/etc/preinit/mountrepo.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+#/**
+#@file mountrepo.sh
+#@brief Script para montar el repositorio de datos remoto.
+#@warning License: GNU GPLv3+
+#@version 1.0
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2011-03-17
+#*/
+
+OGIMG=${OGIMG:-/opt/opengnsys/images}
+
+# TODO Revisar proceso de arranque para no montar 2 veces el repositorio.
+if [ $ogactiveadmin == "true" ]; then
+ export boot=admin
+ umount $OGIMG 2>/dev/null
+
+ protocol=${potocol:-"smb"}
+ printf "$MSG_MOUNTREPO\n" "$protocol" "$boot"
+ case "$protocol" in
+ nfs) mount.nfs ${ROOTSERVER}:$OGIMG $OGIMG -o rw,nolock ;;
+ smb) mount.cifs //${ROOTSERVER}/ogimages $OGIMG -o rw,serverino,acl,username=opengnsys,password=og ;;
+ esac
+fi
+
diff --git a/client/shared/lib/engine/tests/Modify/Cache.shtest b/client/shared/lib/engine/tests/Modify/Cache.shtest
new file mode 100644
index 00000000..b449a80c
--- /dev/null
+++ b/client/shared/lib/engine/tests/Modify/Cache.shtest
@@ -0,0 +1,93 @@
+Test de comprobacion de la librería Cache.lib y los script relacionados
+=======================================================================
+Este test destruye la cache
+Necesita que las particiones sean tres como máximo
+=================================================
+
+$ ogUnmountCache 2>/dev/null ; df|grep cache
+
+
+$ ogCreateCache 10000000 1>/dev/null 2>&1
+
+$ AUX=$(ogListPartitions 1) ; echo ${AUX##*CACHE:} | sed s/\ .*\$//g
+10000000
+
+# Comprobamos que no esta formateada
+$ ogCheckFs 1 4
+OpenGnSys error: ogCheckFs: "1, 4, CACHE"
+
+$ ogFormatCache|tail -1
+ReiserFS is successfully created on /dev/sda4.
+
+$ ogMountCache
+/opt/opengnsys/cache
+
+$ echo $OGCAC
+/opt/opengnsys/cache
+
+$ touch $OGCAC$OGIMG/lll
+$ ls $OGCAC$OGIMG
+lll
+
+$ rm $OGCAC$OGIMG/lll
+
+$ ogFindCache
+1 4
+
+$ ogGetCacheSize
+10000000
+
+
+$ ogDeleteCache >/dev/null 2>&1
+$ ogFindCache
+
+$ initCache 2000000 1>/dev/null 2>&1
+$ touch $OGCAC$OGIMG/lll
+$ ls $OGCAC$OGIMG
+lll
+
+$ rm $OGCAC$OGIMG/lll
+
+#################################################33
+# No permite unicast
+#################################################33
+#$ echo ooo > $OGCAC$OGIMG/_test_.img
+#$ echo jjjjjjjjjjjjjjjjjjjjjjjjjjjjjj > $OGIMG/_test_.img
+#$ touch $OGIMG/_test_.torrent
+#$ updateCache REPO _test_ UNICAST
+
+
+Comprobamos los errores de las entradas de datos
+================================================
+$ ogCreateCache
+OpenGnSys error: ogCreateCache: ""
+
+$ ogCreateCache -1
+OpenGnSys error: ogCreateCache: "-1"
+
+$ ogCreateCache 0
+OpenGnSys error: ogCreateCache: "0"
+
+# cuando se está usando la cuarta partitión no debe crearse la cache
+#$ ogCreatePartition 1 NTFS:200000 EXT3:2000000 EXT3:2000000 NTFS:30000000
+#$ ogListPartitions 1
+#NTFS:200000 EXT3:2000000 EXT3:2000000 EXTENDED:20000000 LINUX-SWAP:199999
+#$ ogCreateCache 1000000
+#$ ogFindCache
+
+
+# si hay cache no podemos
+$ ogDeleteCache 1>/dev/null 2>&1
+$ ogCreatePartitions 1 NTFS:200000 EXT3:2000000 EXT3:2000000 1>/dev/null 2>&1
+$ ogCreateCache 1000000 1>/dev/null 2>&1
+$ ogCreatePartitions 1 NTFS:200000 EXT2:2000000 EXT2:2000000 LINUX-SWAP:200000 1>/dev/null 2>&1; echo $?
+1
+
+FALTA
+====
+ogGetCacheSpace
+updateCache
+
+Error
+=====
+Al crear la cache no se comprueba si existe una cuarta particion. La machaca
diff --git a/client/shared/lib/engine/tests/NoModify/File1.shtest b/client/shared/lib/engine/tests/NoModify/File1.shtest
new file mode 100644
index 00000000..c5ed051c
--- /dev/null
+++ b/client/shared/lib/engine/tests/NoModify/File1.shtest
@@ -0,0 +1,80 @@
+Test de compribación de la libreria File No modifica nada
+========================================
+Este test NECESITA LA CACHE
+
+Comprobamos que existe CACHE
+$ ls -d $OGCAC$OGIMG # Este test NECESITA LA CACHE ##############################
+/opt/opengnsys/cache/opt/opengnsys/images
+
+
+$ ogMakeDir CACHE prueba
+$ ls -d $OGCAC$OGIMG/prueba
+/opt/opengnsys/cache/opt/opengnsys/images/prueba
+
+$ touch $OGCAC$OGIMG/fichero_prueba
+$ ogCopyFile CACHE fichero_prueba CACHE prueba
+$ ls $OGCAC$OGIMG/prueba
+fichero_prueba
+
+$ ogGetPath CACHE fichero_prueba
+/opt/opengnsys/cache/opt/opengnsys/images/fichero_prueba
+
+# Si no existe el fichero
+$ ogGetPath CACHE fichero_prueba3; echo $?
+1
+
+$ ogGetParentPath CACHE fichero_prueba
+/opt/opengnsys/cache/opt/opengnsys/images
+
+# si el fichero no existe
+$ ogGetParentPath CACHE prueba/fichero_prueba3q23
+/opt/opengnsys/cache/opt/opengnsys/images/prueba
+
+# Si dir padre no existe
+$ ogGetParentPath CACHE pruebaNO/fichero_prueba3; echo $?
+1
+
+$ AUX=$(ogCalculateChecksum $OGCAC$OGIMG/fichero_prueba); AUX2=$(md5sum $OGCAC$OGIMG/fichero_prueba| cut -f1 -d\ ); if [ "$AUX" == "$AUX2" ]; then echo si; else echo no; fi
+si
+
+$ ogCompareChecksumFiles CACHE fichero_prueba CACHE prueba/fichero_prueba; echo $?
+0
+
+$ echo 333 >> $OGCAC$OGIMG/fichero_prueba2
+$ ogMakeChecksumFile CACHE fichero_prueba2
+$ ls $OGCAC$OGIMG/fichero_prueba2.sum
+/opt/opengnsys/cache/opt/opengnsys/images/fichero_prueba2.sum
+
+$ ogMakeChecksumFile CACHE prueba/fichero_prueba
+$ ogCompareChecksumFiles CACHE fichero_prueba2 CACHE prueba/fichero_prueba; echo $?
+1
+
+$ ogIsNewerFile CACHE fichero_prueba2 CACHE prueba/fichero_prueba; echo $?
+0
+
+$ ogIsNewerFile CACHE prueba/fichero_prueba CACHE fichero_prueba2; echo $?
+1
+
+$ ogIsNewerFile CACHE fichero_prueba CACHE prueba/fichero_prueba; echo $?
+1
+
+$ ogNewPath CACHE prueba2
+/opt/opengnsys/cache//opt/opengnsys/images/prueba2
+$ ls -d $OGCAC$OGIMG/prueba2
+/opt/opengnsys/cache/opt/opengnsys/images/prueba2
+
+$ ogDeleteTree CACHE prueba
+$ ls -d $OGCAC$OGIMG/prueba
+ls: cannot access /opt/opengnsys/cache/opt/opengnsys/images/prueba: No such file or directory
+
+$ ogDeleteFile CACHE fichero_prueba
+$ ls $OGCAC$OGIMG/fichero_prueba
+ls: cannot access /opt/opengnsys/cache/opt/opengnsys/images/fichero_prueba: No such file or directory
+
+# Limpiamos el directorio
+$ rm -rf $OGCAC$OGIMG/fichero_prueba2* $OGCAC$OGIMG/prueba2
+
+
+MEJORAS
+=======
+ogCompareChecksumFiles -> si no existen los ficheros de Checksum da verdadero. Deberia dar falso
diff --git a/client/shared/lib/engine/tests/NoModify/Lock1.shtest b/client/shared/lib/engine/tests/NoModify/Lock1.shtest
new file mode 100644
index 00000000..39bac3eb
--- /dev/null
+++ b/client/shared/lib/engine/tests/NoModify/Lock1.shtest
@@ -0,0 +1,85 @@
+€jemplo de test de funciones de bloqueo de particiones e imagenes
+=================================================================
+# Funciones de bloqueo
+
+$ ogLock 1 1
+$ ls /var/lock/lock-dev-sda1
+/var/lock/lock-dev-sda1
+
+$ if ogIsLocked 1 1; then echo si; else echo no; fi
+si
+
+$ ls /var/lock/lock-dev-sda1
+/var/lock/lock-dev-sda1
+
+$ ogUnlock 1 1
+$ if ogIsLocked 1 1; then echo si; else echo no; fi
+no
+
+$ ogLockPartition 1 1
+$ if ogIsLocked 1 1; then echo si; else echo no; fi
+si
+
+$ ogUnlockPartition 1 1
+$ if ogIsLocked 1 1; then echo si; else echo no; fi
+no
+
+
+
+
+# Es necesario desmontar para probar ogCheck
+$ ogUnmount 1 1 >/dev/null 2>&1
+
+$ ogLock 1 1
+
+$ ogCheckFs 1 1
+OpenGnSys error: ogCheckFs: "1 1"
+
+$ ogUnlock 1 1
+
+$ ogCheckFs 1 1 >/dev/null 2>&1; echo $?
+0
+
+
+# Bloqueo del repositorio
+
+$ ogIsRepoLocked; echo $?
+1
+
+# FALTA: test bloqueo repo cuando esta bloqueado
+
+# bloqueo de imagenes
+
+
+
+# Creo una imagen ficticia
+$ touch $OGIMG/_test_.img
+
+$ ogLockImage REPO _test_
+$ ls $OGIMG/_test_.lock
+/opt/opengnsys/images/_test_.lock
+
+$ if ogIsImageLocked REPO _test_ ; then echo si; else echo no; fi
+si
+
+$ ogUnlockImage REPO _test_
+$ if ogIsImageLocked REPO _test_ ; then echo si; else echo no; fi
+no
+
+$ rm $OGIMG/_test_.*
+
+# Comprobando los errores (FALTA)
+$ ogLock
+OpenGnSys error: ogLockPartition: ""
+
+
+$ ogLock 1 10
+OpenGnSys error: ogDiskToDev: ""
+
+
+$ ogIsLocked
+OpenGnSys error: ogIsLocked: ""
+
+$ ogIsLocked 1 10
+OpenGnSys error: ogDiskToDev: ""
+
diff --git a/client/shared/lib/engine/tests/NoModify/Net1.shtest b/client/shared/lib/engine/tests/NoModify/Net1.shtest
new file mode 100644
index 00000000..977b00d6
--- /dev/null
+++ b/client/shared/lib/engine/tests/NoModify/Net1.shtest
@@ -0,0 +1,21 @@
+Test para la librería Net.lib No modifica
+=========================================
+$ if [ "$(ogGetHostname)" == "$(hostname)" ] ; then echo si; else echo no; fi
+si
+
+$ if [ "$(ogGetNetInterface)" == "$(ifconfig|head -1|cut -d\ -f1 )" ]; then echo si; else echo no; fi
+si
+
+$ AUX=$(ifconfig eth0|grep 'inet addr'|cut -dB -f1|sed s/\ //g); if [ "$(ogGetIpAddress)" == "${AUX#*:}" ]; then echo si; else echo no; fi
+si
+
+$ AUX=$(ifconfig |head -1|sed s/\ //g| tr '[a-z]' '[A-Z]'); if [ "$(ogGetMacAddress)" == "${AUX##*HWADDR}" ]; then echo si; else echo no; fi
+si
+
+$ AUX=$(df|grep $OGIMG); if [ "//$(ogGetRepoIp)" == "${AUX%/ogimages*}" ]; then echo si; else echo no; fi
+si
+
+$ AUX=$(df|grep $OGIMG); if [ "//$(ogGetServerIp)" == "${AUX%/ogimages*}" ]; then echo si; else echo no; fi
+si
+
+
diff --git a/client/shared/lib/engine/tests/README b/client/shared/lib/engine/tests/README
new file mode 100644
index 00000000..f3190973
--- /dev/null
+++ b/client/shared/lib/engine/tests/README
@@ -0,0 +1,6 @@
+Separamos los test que no modifican el cliente y los que sí lo hacen (pueden modificar la partitiones, imagenes, etc) en dos directorios distintos.
+
+Ademas los numeramos diferentes por si los queremos mover de sitio:
+ Los test acabados en 1x no modifican nada
+ Los test acabados en 2x modifican el cliente
+
diff --git a/client/shared/lib/engine/tests/crearTestDisk1 b/client/shared/lib/engine/tests/crearTestDisk1
new file mode 100755
index 00000000..95d51802
--- /dev/null
+++ b/client/shared/lib/engine/tests/crearTestDisk1
@@ -0,0 +1,157 @@
+#!/bin/bash
+# Descripcion: Crea un test no destructivo de la libreria Disk.lib conficurandolo
+# para un cliente concreto.
+# Se ejecuta en el servidor y el test creado se utiliza en el cliente
+# Los datos los toma de la base de administración.
+# Uso: creaTestDisk1 NombreCliente
+#
+# Falta: la bd no tiene información de las particiones lógicas (el script sí esta preparado para ellas)
+# la bd no tiene datos del tamaño del disco
+
+
+# Variables.
+PROG=$(basename $0)
+OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
+SERVERCONF=$OPENGNSYS/etc/ogAdmServer.cfg
+TESTDIR="$OPENGNSYS/client/lib/engine/tests/NoModify"
+TESTFILE="$TESTDIR/Disk1-$1.shtest "
+# Control básico de errores.
+if [ $# -ne 1 ]; then
+ echo "$PROG: Error de ejecución"
+ echo "Formato: $PROG NOMBRE_PC"
+ exit 1
+fi
+
+# Obtener datos de acceso a la Base de datos.
+source $SERVERCONF
+
+# Comprobar si se recibe nombre de aula o de equipo.
+PARTICIONES=$(mysql -u "$USUARIO" -p"$PASSWORD" -D "$CATALOG" -N -e \
+ "SELECT ordenadores_particiones.numpar, tipospar.tipopar, ordenadores_particiones.tamano
+ FROM tipospar INNER JOIN ordenadores_particiones INNER JOIN ordenadores
+ WHERE tipospar.codpar=ordenadores_particiones.codpar
+ AND ordenadores.idordenador=ordenadores_particiones.idordenador
+ AND nombreordenador='$1'
+ ORDER By ordenadores_particiones.numpar;")
+# Si la cadena esta vacia, error
+if [ -z "$PARTICIONES" ]; then
+ echo "El equipo $1 no existe en la base de datos"
+ exit 2
+fi
+
+# Ejemplo para añadir partitiones lógicas
+#PARTICIONES="$PARTICIONES 5 LINUX-SWAP 1999999"
+PRI=$( echo ${PARTICIONES%%\ 5\ *}|awk '{print $2"_"$3" "$5"_"$6" "$8"_"$9" "$11"_"$12}' |sed s/\ _//g |sed s/\ //g)
+
+if $(echo $PARTICIONES |grep " 5 " >/dev/null); then
+ LOG=$( echo ${PARTICIONES##*\ 5\ }|awk '{print $1"_"$2" "$4"_"$5" "$7"_"$8" "$10"_"$11" "}' |sed s/\ _//g |sed s/\ //g)
+else
+ LOG=""
+fi
+AUX=$(echo $PARTICIONES| wc -w)
+let NUMPART=AUX/3
+P1SIZE=$(echo $PARTICIONES|cut -d\ -f3)
+P1TYPE=$(echo $PARTICIONES|cut -d\ -f2)
+case "$P1TYPE" in
+ EMPTY) P1ID=0 ;;
+ FAT12) P1ID=1 ;;
+ EXTENDED) P1ID=5 ;;
+ FAT16) P1ID=6 ;;
+ NTFS|EXFAT) P1ID=7 ;;
+ FAT32) P1ID=b ;;
+ HFAT12) P1ID=11 ;;
+ HFAT16) P1ID=16 ;;
+ HNTFS) P1ID=17 ;;
+ HFAT32) P1ID=1b ;;
+ LINUX-SWAP) P1ID=82 ;;
+ EXT[234]|REISERFS|REISER4|XFS|JFS)
+ P1ID=83 ;;
+ LINUX-LVM) P1ID=8e ;;
+ SOLARIS) P1ID=bf ;;
+ CACHE) P1ID=ca ;;
+ LINUX-RAP1ID) P1ID=fd ;;
+ *) P1ID="" ;;
+esac
+
+cat > $TESTFILE << EOF
+Ejemplo de test funciones de particionado no destrutivo
+=======================================================
+
+# Desmontamos antes de empezar
+$ ogUnmountAll 1 2>/dev/null
+
+$ ogUnmountCache 2>/dev/null
+
+# Cambio de formato
+
+$ ogDevToDisk /dev/sda
+1
+
+$ ogDevToDisk /dev/sda1
+1 1
+
+$ ogDiskToDev
+/dev/sda
+
+$ ogDiskToDev 1
+/dev/sda
+
+$ ogDiskToDev 1 1
+/dev/sda1
+
+$ ogFsToId NTFS
+7
+
+$ ogFsToId EXT4
+83
+
+
+# Tamaño de disco (cuando haya informacion en la base de datos)
+
+#$ ogGetDiskSize 1
+#312571224
+
+# Tamaño de la particion
+
+$ ogGetPartitionSize 1 1
+$P1SIZE
+
+# Información de las particiones
+$ ogListPartitions 1 | tr : _ | sed s/EXT[234]/LINUX/g | sed s/\ //g
+$PRI$LOG
+$ ogListPrimaryPartitions 1 | tr : _ | sed s/EXT[234]/LINUX/g | sed s/\ //g
+$PRI
+
+$ ogListLogicalPartitions 1 | tr : _ | sed s/EXT[234]/LINUX/g
+$LOG
+
+$ ogGetPartitionsNumber
+$NUMPART
+
+# Partición activa
+
+$ ogSetPartitionActive 1 2 >/dev/null
+$ ogGetPartitionActive 1
+2
+
+$ ogSetPartitionActive 1 1 >/dev/null
+$ ogGetPartitionActive 1
+1
+
+
+# Tipo de particiones
+
+$ ogGetPartitionId 1 1
+$P1ID
+
+
+# Montamos la cache al final
+$ ogMountCache >/dev/null 2>&1
+
+
+EOF
+
+
+
+echo "Test creado en $TESTFILE"
+echo "Las particiones logicas hay que incluirlas a mano, porque no hay información de las mismas en la base de datos."
diff --git a/client/shared/lib/engine/tests/crearTestLock2 b/client/shared/lib/engine/tests/crearTestLock2
new file mode 100755
index 00000000..49e3604d
--- /dev/null
+++ b/client/shared/lib/engine/tests/crearTestLock2
@@ -0,0 +1,82 @@
+#!/bin/bash
+# Descripcion: Crea un test DESTRUCTIVO de los bloqueos de particiones y de imagenes
+# Se ejecuta en el servidor y el test creado se utiliza en el cliente
+# La imagen de prueba puede sufrir daños
+# Uso: creaTestLock2 NombreImagen
+
+# Variables.
+PROG=$(basename $0)
+OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
+SERVERCONF=$OPENGNSYS/etc/ogAdmServer.cfg
+TESTDIR="$OPENGNSYS/client/lib/engine/tests/Modify"
+TESTFILE="$TESTDIR/Lock2-img$1.shtest "
+# Control básico de errores.
+if [ $# -ne 1 ]; then
+ echo "$PROG: Error de ejecución"
+ echo "Formato: $PROG NOMBRE_IMAGEN"
+ echo " La imagen de prueba puede sufrir daños"
+ exit 1
+fi
+
+IMG=$1
+
+cat > $TESTFILE << EOF
+Test de bloqueos Destructivos
+=============================================================================
+# Bloqueo de particiones
+$ ogUnmountAll 1 2>/dev/null
+
+$ ogLock 1 1
+
+$ ogExtendFs 1 1
+OpenGnSys error: ogExtendFs: "1 1"
+
+
+$ ogFormatFs 1 1
+OpenGnSys error: ogFormatFs: "1 1"
+
+#############################################################################
+# Los dos comandos siguientes dan error. Los comentamos por ahora
+#############################################################################
+#$ ogMount 1 1
+
+#$ ogUnmount 1 1; df|grep sda1
+
+$ ogUnlock 1 1
+
+$ ogExtendFs 1 1 >/dev/null 2>&1; echo $?
+0
+
+$ ogFormatFs 1 1 >/dev/null 2>&1; echo $?
+0
+
+$ ogMount 1 1
+/mnt/sda1
+
+$ ogUnmount 1 1; df|grep sda1
+
+# Bloqueo de imagenes
+#############################################################################
+# Los tres comandos siguientes dan error. Los comentamos por ahora
+#############################################################################
+#$ ogLockImage REPO $IMG
+
+#$ ogRestoreImage REPO $IMG 1 1 >/dev/null 2>&1; echo $?
+
+#$ ogCreateImage 1 1 REPO $IMG >/dev/null 2>&1; echo $?
+
+
+$ ogUnlockImage REPO $IMG
+
+# Lo mismo con la imagen desbloqueada.
+
+$ ogRestoreImage REPO $IMG 1 1 >/dev/null 2>&1; echo $?
+0
+
+$ ogCreateImage 1 1 REPO $IMG >/dev/null 2>&1; echo $?
+0
+EOF
+
+echo "Test creado en $TESTFILE"
+echo " La imagen de $IMG prueba puede quedar dañada despues de realizar el test"
+echo " Hay cinco comandos comentados porque por ahora dan error"
diff --git a/client/nfsexport/lib/fonts/DejaVuSans-Bold.ttf b/client/shared/lib/fonts/DejaVuSans-Bold.ttf
index 040bb9d3..040bb9d3 100755..100644
--- a/client/nfsexport/lib/fonts/DejaVuSans-Bold.ttf
+++ b/client/shared/lib/fonts/DejaVuSans-Bold.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/DejaVuSans-BoldOblique.ttf b/client/shared/lib/fonts/DejaVuSans-BoldOblique.ttf
index d0fc12f0..d0fc12f0 100755..100644
--- a/client/nfsexport/lib/fonts/DejaVuSans-BoldOblique.ttf
+++ b/client/shared/lib/fonts/DejaVuSans-BoldOblique.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/DejaVuSans-Oblique.ttf b/client/shared/lib/fonts/DejaVuSans-Oblique.ttf
index 19f9f749..19f9f749 100755..100644
--- a/client/nfsexport/lib/fonts/DejaVuSans-Oblique.ttf
+++ b/client/shared/lib/fonts/DejaVuSans-Oblique.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/DejaVuSans.ttf b/client/shared/lib/fonts/DejaVuSans.ttf
index 7e411a71..7e411a71 100755..100644
--- a/client/nfsexport/lib/fonts/DejaVuSans.ttf
+++ b/client/shared/lib/fonts/DejaVuSans.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/DejaVuSansMono-Bold.ttf b/client/shared/lib/fonts/DejaVuSansMono-Bold.ttf
index 86f97226..86f97226 100755..100644
--- a/client/nfsexport/lib/fonts/DejaVuSansMono-Bold.ttf
+++ b/client/shared/lib/fonts/DejaVuSansMono-Bold.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/DejaVuSansMono-BoldOblique.ttf b/client/shared/lib/fonts/DejaVuSansMono-BoldOblique.ttf
index b1439380..b1439380 100755..100644
--- a/client/nfsexport/lib/fonts/DejaVuSansMono-BoldOblique.ttf
+++ b/client/shared/lib/fonts/DejaVuSansMono-BoldOblique.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/DejaVuSansMono-Oblique.ttf b/client/shared/lib/fonts/DejaVuSansMono-Oblique.ttf
index 81208a6c..81208a6c 100755..100644
--- a/client/nfsexport/lib/fonts/DejaVuSansMono-Oblique.ttf
+++ b/client/shared/lib/fonts/DejaVuSansMono-Oblique.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/DejaVuSansMono.ttf b/client/shared/lib/fonts/DejaVuSansMono.ttf
index 029fcac3..029fcac3 100755..100644
--- a/client/nfsexport/lib/fonts/DejaVuSansMono.ttf
+++ b/client/shared/lib/fonts/DejaVuSansMono.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/DejaVuSerif-Bold.ttf b/client/shared/lib/fonts/DejaVuSerif-Bold.ttf
index e7aeb9e8..e7aeb9e8 100755..100644
--- a/client/nfsexport/lib/fonts/DejaVuSerif-Bold.ttf
+++ b/client/shared/lib/fonts/DejaVuSerif-Bold.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/DejaVuSerif-BoldOblique.ttf b/client/shared/lib/fonts/DejaVuSerif-BoldOblique.ttf
index a457fd82..a457fd82 100755..100644
--- a/client/nfsexport/lib/fonts/DejaVuSerif-BoldOblique.ttf
+++ b/client/shared/lib/fonts/DejaVuSerif-BoldOblique.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/DejaVuSerif-Oblique.ttf b/client/shared/lib/fonts/DejaVuSerif-Oblique.ttf
index 887939c0..887939c0 100755..100644
--- a/client/nfsexport/lib/fonts/DejaVuSerif-Oblique.ttf
+++ b/client/shared/lib/fonts/DejaVuSerif-Oblique.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/DejaVuSerif.ttf b/client/shared/lib/fonts/DejaVuSerif.ttf
index 5d096d14..5d096d14 100755..100644
--- a/client/nfsexport/lib/fonts/DejaVuSerif.ttf
+++ b/client/shared/lib/fonts/DejaVuSerif.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/README b/client/shared/lib/fonts/README
index 076fc9c2..076fc9c2 100755..100644
--- a/client/nfsexport/lib/fonts/README
+++ b/client/shared/lib/fonts/README
diff --git a/client/nfsexport/lib/fonts/UTBI____.pfa b/client/shared/lib/fonts/UTBI____.pfa
index a4fda2e9..a4fda2e9 100755..100644
--- a/client/nfsexport/lib/fonts/UTBI____.pfa
+++ b/client/shared/lib/fonts/UTBI____.pfa
diff --git a/client/nfsexport/lib/fonts/UTB_____.pfa b/client/shared/lib/fonts/UTB_____.pfa
index 36ef3395..36ef3395 100755..100644
--- a/client/nfsexport/lib/fonts/UTB_____.pfa
+++ b/client/shared/lib/fonts/UTB_____.pfa
diff --git a/client/nfsexport/lib/fonts/UTI_____.pfa b/client/shared/lib/fonts/UTI_____.pfa
index de07ce5d..de07ce5d 100755..100644
--- a/client/nfsexport/lib/fonts/UTI_____.pfa
+++ b/client/shared/lib/fonts/UTI_____.pfa
diff --git a/client/nfsexport/lib/fonts/UTRG____.pfa b/client/shared/lib/fonts/UTRG____.pfa
index d9fa0e78..d9fa0e78 100755..100644
--- a/client/nfsexport/lib/fonts/UTRG____.pfa
+++ b/client/shared/lib/fonts/UTRG____.pfa
diff --git a/client/nfsexport/lib/fonts/Vera.ttf b/client/shared/lib/fonts/Vera.ttf
index 58cd6b5e..58cd6b5e 100755..100644
--- a/client/nfsexport/lib/fonts/Vera.ttf
+++ b/client/shared/lib/fonts/Vera.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/VeraBI.ttf b/client/shared/lib/fonts/VeraBI.ttf
index b55eee39..b55eee39 100755..100644
--- a/client/nfsexport/lib/fonts/VeraBI.ttf
+++ b/client/shared/lib/fonts/VeraBI.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/VeraBd.ttf b/client/shared/lib/fonts/VeraBd.ttf
index 51d6111d..51d6111d 100755..100644
--- a/client/nfsexport/lib/fonts/VeraBd.ttf
+++ b/client/shared/lib/fonts/VeraBd.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/VeraIt.ttf b/client/shared/lib/fonts/VeraIt.ttf
index cc23c9ef..cc23c9ef 100755..100644
--- a/client/nfsexport/lib/fonts/VeraIt.ttf
+++ b/client/shared/lib/fonts/VeraIt.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/VeraMoBI.ttf b/client/shared/lib/fonts/VeraMoBI.ttf
index 8624542e..8624542e 100755..100644
--- a/client/nfsexport/lib/fonts/VeraMoBI.ttf
+++ b/client/shared/lib/fonts/VeraMoBI.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/VeraMoBd.ttf b/client/shared/lib/fonts/VeraMoBd.ttf
index 9be6547e..9be6547e 100755..100644
--- a/client/nfsexport/lib/fonts/VeraMoBd.ttf
+++ b/client/shared/lib/fonts/VeraMoBd.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/VeraMoIt.ttf b/client/shared/lib/fonts/VeraMoIt.ttf
index 24049248..24049248 100755..100644
--- a/client/nfsexport/lib/fonts/VeraMoIt.ttf
+++ b/client/shared/lib/fonts/VeraMoIt.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/VeraMono.ttf b/client/shared/lib/fonts/VeraMono.ttf
index 139f0b43..139f0b43 100755..100644
--- a/client/nfsexport/lib/fonts/VeraMono.ttf
+++ b/client/shared/lib/fonts/VeraMono.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/VeraSe.ttf b/client/shared/lib/fonts/VeraSe.ttf
index 4b4ecc66..4b4ecc66 100755..100644
--- a/client/nfsexport/lib/fonts/VeraSe.ttf
+++ b/client/shared/lib/fonts/VeraSe.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/VeraSeBd.ttf b/client/shared/lib/fonts/VeraSeBd.ttf
index 672bf761..672bf761 100755..100644
--- a/client/nfsexport/lib/fonts/VeraSeBd.ttf
+++ b/client/shared/lib/fonts/VeraSeBd.ttf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/c0419bt_.pfb b/client/shared/lib/fonts/c0419bt_.pfb
index 4a49dd59..4a49dd59 100755..100644
--- a/client/nfsexport/lib/fonts/c0419bt_.pfb
+++ b/client/shared/lib/fonts/c0419bt_.pfb
Binary files differ
diff --git a/client/nfsexport/lib/fonts/c0582bt_.pfb b/client/shared/lib/fonts/c0582bt_.pfb
index 9baa1da2..9baa1da2 100755..100644
--- a/client/nfsexport/lib/fonts/c0582bt_.pfb
+++ b/client/shared/lib/fonts/c0582bt_.pfb
Binary files differ
diff --git a/client/nfsexport/lib/fonts/c0583bt_.pfb b/client/shared/lib/fonts/c0583bt_.pfb
index 08f6871c..08f6871c 100755..100644
--- a/client/nfsexport/lib/fonts/c0583bt_.pfb
+++ b/client/shared/lib/fonts/c0583bt_.pfb
Binary files differ
diff --git a/client/nfsexport/lib/fonts/c0611bt_.pfb b/client/shared/lib/fonts/c0611bt_.pfb
index ec6ed060..ec6ed060 100755..100644
--- a/client/nfsexport/lib/fonts/c0611bt_.pfb
+++ b/client/shared/lib/fonts/c0611bt_.pfb
Binary files differ
diff --git a/client/nfsexport/lib/fonts/c0632bt_.pfb b/client/shared/lib/fonts/c0632bt_.pfb
index 07011728..07011728 100755..100644
--- a/client/nfsexport/lib/fonts/c0632bt_.pfb
+++ b/client/shared/lib/fonts/c0632bt_.pfb
Binary files differ
diff --git a/client/nfsexport/lib/fonts/c0633bt_.pfb b/client/shared/lib/fonts/c0633bt_.pfb
index d68f639b..d68f639b 100755..100644
--- a/client/nfsexport/lib/fonts/c0633bt_.pfb
+++ b/client/shared/lib/fonts/c0633bt_.pfb
Binary files differ
diff --git a/client/nfsexport/lib/fonts/c0648bt_.pfb b/client/shared/lib/fonts/c0648bt_.pfb
index 72a1606b..72a1606b 100755..100644
--- a/client/nfsexport/lib/fonts/c0648bt_.pfb
+++ b/client/shared/lib/fonts/c0648bt_.pfb
Binary files differ
diff --git a/client/nfsexport/lib/fonts/c0649bt_.pfb b/client/shared/lib/fonts/c0649bt_.pfb
index b5d4ded6..b5d4ded6 100755..100644
--- a/client/nfsexport/lib/fonts/c0649bt_.pfb
+++ b/client/shared/lib/fonts/c0649bt_.pfb
Binary files differ
diff --git a/client/nfsexport/lib/fonts/cour.pfa b/client/shared/lib/fonts/cour.pfa
index b8c097b0..b8c097b0 100755..100644
--- a/client/nfsexport/lib/fonts/cour.pfa
+++ b/client/shared/lib/fonts/cour.pfa
diff --git a/client/nfsexport/lib/fonts/courb.pfa b/client/shared/lib/fonts/courb.pfa
index 795ec5ce..795ec5ce 100755..100644
--- a/client/nfsexport/lib/fonts/courb.pfa
+++ b/client/shared/lib/fonts/courb.pfa
diff --git a/client/nfsexport/lib/fonts/courbi.pfa b/client/shared/lib/fonts/courbi.pfa
index 5162aa6d..5162aa6d 100755..100644
--- a/client/nfsexport/lib/fonts/courbi.pfa
+++ b/client/shared/lib/fonts/courbi.pfa
diff --git a/client/nfsexport/lib/fonts/couri.pfa b/client/shared/lib/fonts/couri.pfa
index 2822ec2a..2822ec2a 100755..100644
--- a/client/nfsexport/lib/fonts/couri.pfa
+++ b/client/shared/lib/fonts/couri.pfa
diff --git a/client/nfsexport/lib/fonts/cursor.pfa b/client/shared/lib/fonts/cursor.pfa
index ef1724ca..ef1724ca 100755..100644
--- a/client/nfsexport/lib/fonts/cursor.pfa
+++ b/client/shared/lib/fonts/cursor.pfa
diff --git a/client/nfsexport/lib/fonts/fixed_120_50.qpf b/client/shared/lib/fonts/fixed_120_50.qpf
index 95b60804..95b60804 100755..100644
--- a/client/nfsexport/lib/fonts/fixed_120_50.qpf
+++ b/client/shared/lib/fonts/fixed_120_50.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/fixed_70_50.qpf b/client/shared/lib/fonts/fixed_70_50.qpf
index 76e5919d..76e5919d 100755..100644
--- a/client/nfsexport/lib/fonts/fixed_70_50.qpf
+++ b/client/shared/lib/fonts/fixed_70_50.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_100_50.qpf b/client/shared/lib/fonts/helvetica_100_50.qpf
index 5b407e6a..5b407e6a 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_100_50.qpf
+++ b/client/shared/lib/fonts/helvetica_100_50.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_100_50i.qpf b/client/shared/lib/fonts/helvetica_100_50i.qpf
index ac7c6963..ac7c6963 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_100_50i.qpf
+++ b/client/shared/lib/fonts/helvetica_100_50i.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_100_75.qpf b/client/shared/lib/fonts/helvetica_100_75.qpf
index a1ddae00..a1ddae00 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_100_75.qpf
+++ b/client/shared/lib/fonts/helvetica_100_75.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_100_75i.qpf b/client/shared/lib/fonts/helvetica_100_75i.qpf
index 8bd9d1a3..8bd9d1a3 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_100_75i.qpf
+++ b/client/shared/lib/fonts/helvetica_100_75i.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_120_50.qpf b/client/shared/lib/fonts/helvetica_120_50.qpf
index f7b8484a..f7b8484a 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_120_50.qpf
+++ b/client/shared/lib/fonts/helvetica_120_50.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_120_50i.qpf b/client/shared/lib/fonts/helvetica_120_50i.qpf
index c7968286..c7968286 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_120_50i.qpf
+++ b/client/shared/lib/fonts/helvetica_120_50i.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_120_75.qpf b/client/shared/lib/fonts/helvetica_120_75.qpf
index 14c1904c..14c1904c 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_120_75.qpf
+++ b/client/shared/lib/fonts/helvetica_120_75.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_120_75i.qpf b/client/shared/lib/fonts/helvetica_120_75i.qpf
index 2078f49c..2078f49c 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_120_75i.qpf
+++ b/client/shared/lib/fonts/helvetica_120_75i.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_140_50.qpf b/client/shared/lib/fonts/helvetica_140_50.qpf
index daf1e0f9..daf1e0f9 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_140_50.qpf
+++ b/client/shared/lib/fonts/helvetica_140_50.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_140_50i.qpf b/client/shared/lib/fonts/helvetica_140_50i.qpf
index 002ac3ff..002ac3ff 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_140_50i.qpf
+++ b/client/shared/lib/fonts/helvetica_140_50i.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_140_75.qpf b/client/shared/lib/fonts/helvetica_140_75.qpf
index c75d848b..c75d848b 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_140_75.qpf
+++ b/client/shared/lib/fonts/helvetica_140_75.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_140_75i.qpf b/client/shared/lib/fonts/helvetica_140_75i.qpf
index 81ef8ec9..81ef8ec9 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_140_75i.qpf
+++ b/client/shared/lib/fonts/helvetica_140_75i.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_180_50.qpf b/client/shared/lib/fonts/helvetica_180_50.qpf
index 23900221..23900221 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_180_50.qpf
+++ b/client/shared/lib/fonts/helvetica_180_50.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_180_50i.qpf b/client/shared/lib/fonts/helvetica_180_50i.qpf
index b2d32da5..b2d32da5 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_180_50i.qpf
+++ b/client/shared/lib/fonts/helvetica_180_50i.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_180_75.qpf b/client/shared/lib/fonts/helvetica_180_75.qpf
index b3a5f204..b3a5f204 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_180_75.qpf
+++ b/client/shared/lib/fonts/helvetica_180_75.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_180_75i.qpf b/client/shared/lib/fonts/helvetica_180_75i.qpf
index 4beaf00d..4beaf00d 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_180_75i.qpf
+++ b/client/shared/lib/fonts/helvetica_180_75i.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_240_50.qpf b/client/shared/lib/fonts/helvetica_240_50.qpf
index a703e96f..a703e96f 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_240_50.qpf
+++ b/client/shared/lib/fonts/helvetica_240_50.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_240_50i.qpf b/client/shared/lib/fonts/helvetica_240_50i.qpf
index 75ec4eca..75ec4eca 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_240_50i.qpf
+++ b/client/shared/lib/fonts/helvetica_240_50i.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_240_75.qpf b/client/shared/lib/fonts/helvetica_240_75.qpf
index ca900141..ca900141 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_240_75.qpf
+++ b/client/shared/lib/fonts/helvetica_240_75.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_240_75i.qpf b/client/shared/lib/fonts/helvetica_240_75i.qpf
index 9584de84..9584de84 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_240_75i.qpf
+++ b/client/shared/lib/fonts/helvetica_240_75i.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_80_50.qpf b/client/shared/lib/fonts/helvetica_80_50.qpf
index 149db404..149db404 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_80_50.qpf
+++ b/client/shared/lib/fonts/helvetica_80_50.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_80_50i.qpf b/client/shared/lib/fonts/helvetica_80_50i.qpf
index 007d1d83..007d1d83 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_80_50i.qpf
+++ b/client/shared/lib/fonts/helvetica_80_50i.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_80_75.qpf b/client/shared/lib/fonts/helvetica_80_75.qpf
index 42930660..42930660 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_80_75.qpf
+++ b/client/shared/lib/fonts/helvetica_80_75.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/helvetica_80_75i.qpf b/client/shared/lib/fonts/helvetica_80_75i.qpf
index e1929258..e1929258 100755..100644
--- a/client/nfsexport/lib/fonts/helvetica_80_75i.qpf
+++ b/client/shared/lib/fonts/helvetica_80_75i.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/japanese_230_50.qpf b/client/shared/lib/fonts/japanese_230_50.qpf
index 5bf076f7..5bf076f7 100755..100644
--- a/client/nfsexport/lib/fonts/japanese_230_50.qpf
+++ b/client/shared/lib/fonts/japanese_230_50.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/l047013t.pfa b/client/shared/lib/fonts/l047013t.pfa
index 475bdeb0..475bdeb0 100755..100644
--- a/client/nfsexport/lib/fonts/l047013t.pfa
+++ b/client/shared/lib/fonts/l047013t.pfa
diff --git a/client/nfsexport/lib/fonts/l047016t.pfa b/client/shared/lib/fonts/l047016t.pfa
index 48094088..48094088 100755..100644
--- a/client/nfsexport/lib/fonts/l047016t.pfa
+++ b/client/shared/lib/fonts/l047016t.pfa
diff --git a/client/nfsexport/lib/fonts/l047033t.pfa b/client/shared/lib/fonts/l047033t.pfa
index 11e8dcd3..11e8dcd3 100755..100644
--- a/client/nfsexport/lib/fonts/l047033t.pfa
+++ b/client/shared/lib/fonts/l047033t.pfa
diff --git a/client/nfsexport/lib/fonts/l047036t.pfa b/client/shared/lib/fonts/l047036t.pfa
index fb500c6e..fb500c6e 100755..100644
--- a/client/nfsexport/lib/fonts/l047036t.pfa
+++ b/client/shared/lib/fonts/l047036t.pfa
diff --git a/client/nfsexport/lib/fonts/l048013t.pfa b/client/shared/lib/fonts/l048013t.pfa
index 4c9d0c16..4c9d0c16 100755..100644
--- a/client/nfsexport/lib/fonts/l048013t.pfa
+++ b/client/shared/lib/fonts/l048013t.pfa
diff --git a/client/nfsexport/lib/fonts/l048016t.pfa b/client/shared/lib/fonts/l048016t.pfa
index a14e7249..a14e7249 100755..100644
--- a/client/nfsexport/lib/fonts/l048016t.pfa
+++ b/client/shared/lib/fonts/l048016t.pfa
diff --git a/client/nfsexport/lib/fonts/l048033t.pfa b/client/shared/lib/fonts/l048033t.pfa
index a56b5894..a56b5894 100755..100644
--- a/client/nfsexport/lib/fonts/l048033t.pfa
+++ b/client/shared/lib/fonts/l048033t.pfa
diff --git a/client/nfsexport/lib/fonts/l048036t.pfa b/client/shared/lib/fonts/l048036t.pfa
index 4ec846a8..4ec846a8 100755..100644
--- a/client/nfsexport/lib/fonts/l048036t.pfa
+++ b/client/shared/lib/fonts/l048036t.pfa
diff --git a/client/nfsexport/lib/fonts/l049013t.pfa b/client/shared/lib/fonts/l049013t.pfa
index 947a31c5..947a31c5 100755..100644
--- a/client/nfsexport/lib/fonts/l049013t.pfa
+++ b/client/shared/lib/fonts/l049013t.pfa
diff --git a/client/nfsexport/lib/fonts/l049016t.pfa b/client/shared/lib/fonts/l049016t.pfa
index e47d5bb9..e47d5bb9 100755..100644
--- a/client/nfsexport/lib/fonts/l049016t.pfa
+++ b/client/shared/lib/fonts/l049016t.pfa
diff --git a/client/nfsexport/lib/fonts/l049033t.pfa b/client/shared/lib/fonts/l049033t.pfa
index 1c7e2051..1c7e2051 100755..100644
--- a/client/nfsexport/lib/fonts/l049033t.pfa
+++ b/client/shared/lib/fonts/l049033t.pfa
diff --git a/client/nfsexport/lib/fonts/l049036t.pfa b/client/shared/lib/fonts/l049036t.pfa
index df2250f9..df2250f9 100755..100644
--- a/client/nfsexport/lib/fonts/l049036t.pfa
+++ b/client/shared/lib/fonts/l049036t.pfa
diff --git a/client/nfsexport/lib/fonts/micro_40_50.qpf b/client/shared/lib/fonts/micro_40_50.qpf
index eae4a5bc..eae4a5bc 100755..100644
--- a/client/nfsexport/lib/fonts/micro_40_50.qpf
+++ b/client/shared/lib/fonts/micro_40_50.qpf
Binary files differ
diff --git a/client/nfsexport/lib/fonts/unifont_160_50.qpf b/client/shared/lib/fonts/unifont_160_50.qpf
index 2288575d..2288575d 100755..100644
--- a/client/nfsexport/lib/fonts/unifont_160_50.qpf
+++ b/client/shared/lib/fonts/unifont_160_50.qpf
Binary files differ
diff --git a/client/nfsexport/lib/grub4dos/badgrub.exe b/client/shared/lib/grub4dos/badgrub.exe
index 3cd26a61..3cd26a61 100644
--- a/client/nfsexport/lib/grub4dos/badgrub.exe
+++ b/client/shared/lib/grub4dos/badgrub.exe
Binary files differ
diff --git a/client/nfsexport/lib/grub4dos/bootlace.com b/client/shared/lib/grub4dos/bootlace.com
index 199831f6..199831f6 100755
--- a/client/nfsexport/lib/grub4dos/bootlace.com
+++ b/client/shared/lib/grub4dos/bootlace.com
Binary files differ
diff --git a/client/nfsexport/lib/grub4dos/config.sys b/client/shared/lib/grub4dos/config.sys
index 9aa253ef..9aa253ef 100644
--- a/client/nfsexport/lib/grub4dos/config.sys
+++ b/client/shared/lib/grub4dos/config.sys
diff --git a/client/nfsexport/lib/grub4dos/default b/client/shared/lib/grub4dos/default
index 689c3c8b..689c3c8b 100644
--- a/client/nfsexport/lib/grub4dos/default
+++ b/client/shared/lib/grub4dos/default
diff --git a/client/nfsexport/lib/grub4dos/grldr b/client/shared/lib/grub4dos/grldr
index a31e27bd..a31e27bd 100644
--- a/client/nfsexport/lib/grub4dos/grldr
+++ b/client/shared/lib/grub4dos/grldr
Binary files differ
diff --git a/client/nfsexport/lib/grub4dos/grldr.mbr b/client/shared/lib/grub4dos/grldr.mbr
index 6130129d..6130129d 100644
--- a/client/nfsexport/lib/grub4dos/grldr.mbr
+++ b/client/shared/lib/grub4dos/grldr.mbr
Binary files differ
diff --git a/client/nfsexport/lib/grub4dos/grub.exe b/client/shared/lib/grub4dos/grub.exe
index 8df2433f..8df2433f 100644
--- a/client/nfsexport/lib/grub4dos/grub.exe
+++ b/client/shared/lib/grub4dos/grub.exe
Binary files differ
diff --git a/client/nfsexport/lib/grub4dos/grub.pif b/client/shared/lib/grub4dos/grub.pif
index 28b43805..28b43805 100644
--- a/client/nfsexport/lib/grub4dos/grub.pif
+++ b/client/shared/lib/grub4dos/grub.pif
Binary files differ
diff --git a/client/nfsexport/lib/grub4dos/hmload.com b/client/shared/lib/grub4dos/hmload.com
index 04c794c3..04c794c3 100644
--- a/client/nfsexport/lib/grub4dos/hmload.com
+++ b/client/shared/lib/grub4dos/hmload.com
Binary files differ
diff --git a/client/nfsexport/lib/grub4dos/menu.lst b/client/shared/lib/grub4dos/menu.lst
index e7641534..e7641534 100644
--- a/client/nfsexport/lib/grub4dos/menu.lst
+++ b/client/shared/lib/grub4dos/menu.lst
diff --git a/client/nfsexport/lib/modules/psmouse.ko b/client/shared/lib/modules/psmouse.ko
index f305164d..f305164d 100644
--- a/client/nfsexport/lib/modules/psmouse.ko
+++ b/client/shared/lib/modules/psmouse.ko
Binary files differ
diff --git a/client/nfsexport/lib/pci.ids b/client/shared/lib/pci.ids
index 3fa895a6..3fa895a6 100644
--- a/client/nfsexport/lib/pci.ids
+++ b/client/shared/lib/pci.ids
diff --git a/client/nfsexport/scripts/README.es.txt b/client/shared/scripts/README.es.txt
index 7bfb31ba..7bfb31ba 100644
--- a/client/nfsexport/scripts/README.es.txt
+++ b/client/shared/scripts/README.es.txt
diff --git a/client/nfsexport/scripts/bootLinux b/client/shared/scripts/bootLinux
index e20b9489..e20b9489 100755
--- a/client/nfsexport/scripts/bootLinux
+++ b/client/shared/scripts/bootLinux
diff --git a/client/nfsexport/scripts/bootOs b/client/shared/scripts/bootOs
index 71a9fe73..71a9fe73 100755
--- a/client/nfsexport/scripts/bootOs
+++ b/client/shared/scripts/bootOs
diff --git a/client/nfsexport/scripts/bootWindows b/client/shared/scripts/bootWindows
index e92e484a..e92e484a 100755
--- a/client/nfsexport/scripts/bootWindows
+++ b/client/shared/scripts/bootWindows
diff --git a/client/shared/scripts/cloneRemoteFromMaster b/client/shared/scripts/cloneRemoteFromMaster
new file mode 100755
index 00000000..1a3fd070
--- /dev/null
+++ b/client/shared/scripts/cloneRemoteFromMaster
@@ -0,0 +1,246 @@
+#!/bin/bash
+# Script para la clonacion de particiones remotas.
+# (puede usarse como base para el programa de restauración de imágenes usado por OpenGnSys Admin).
+# Versión: 0.9.1, 2009/03/17, - Antonio J. Doblas Viso. Universidad de Malaga.
+# Versión: 0.9.2, 2010/07/27, - Antonio J. Doblas Viso. Universidad de Malaga.
+# Version: 0.1.0 2011/01/26, - Antonio J. Doblas Viso. Universidad de Malaga.
+
+TIME1=$SECONDS
+PROG="$(basename $0)"
+#if [ $# -ne 5 ]; then
+ # ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG tamaño"
+# exit $?
+#fi
+
+
+#/** @function cloneremoteFromMaster: @brief Restaura una particion o imagen sobre las particiones de equipos cliente remotos
+#@param $1 str_origen admite dirección IP del equipo Master.
+#@param $2 str_origen admite int_disk str_REPO|str_CACHE
+#@param $3 str_origen admite int partorigen stre_imagen
+#@param $4 str_sesion multicast
+#@param $5 int_disco_destino
+#@param $6 init_particion_destino
+#@param ejemplo: cloneRemoteFromMaster 172.17.36.11 1 1 9000:full-duplex:239.194.17.36:70M:50:100 1 1 partclone lzop
+#@param ejemplo: cloneRemoteFromMaster 172.17.36.11 REPO /imagen1 9000:full-duplex:239.194.17.36:70M:50:100 1 1 partclone lzop
+#@param ejemplo: cloneRemoteFromMaster 172.17.36.11 CACHE /imagen1 9000:full-duplex:239.194.17.36:70M:50:100 1 1 partclone lzop
+#@return la propia de la herramienta de clonacion partimage o ntfsclone
+#
+
+
+
+FOUNDSOURCE=false
+HOSTIP=`ogGetIpAddress`
+
+SESSIONMCASTSERVER=$4
+SESSIONMCASTCLIENT=`echo $4 | awk -F: '{print $1}'`
+DISKTARGET=$5
+PARTTARGET=$6
+TOOLCLONE=$7
+COMPRESOR=$8
+
+TIME1=$SECONDS
+PROG="$(basename $0)"
+if [ $# -lt 1 ]; then
+ echo "cloneRemoteFromMaster ipmaster disk init [MULTICAST|UNICAST] session disk part tool comp"
+ exit 1
+fi
+
+if [ $# -lt 6 ]; then
+ ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG ipMaster SOURCE_disco SOURCE_particion [MULTICAT|UNICAST] SESSION TARGER_disck TARGET_partition"
+ exit $?
+fi
+
+#Chequeamos variables-constantes
+
+# check HOSTIP
+if [ -z "$HOSTIP" ]
+then
+ source /tmp/net-eth0.conf
+ HOSTIP=`ogGetIpAddress`
+fi
+MODEMASTER=false
+
+
+#Chequeamos parametros.
+
+# is $1 a valid IP
+MASTERIP=$1
+
+# contendor origen (disco particion o file)
+
+PROTOCOL=$4
+# Controlamos si multicast o unicast.
+case $PROTOCOL in
+ MULTICAST|multicast)
+ SESSIONMCASTSERVER=$5
+ SESSIONMCASTCLIENT=`echo $5 | awk -F: '{print $1}'`
+ ;;
+ UNICAST|unicast)
+ SESSIONUCASTSERVER=$5
+ SESSIONUCASTCLIENT=`echo $5 | awk -F: '{print $1}'`:$MASTERIP
+ ;;
+esac
+
+
+# contenedor destino (disco particion)
+DISKTARGET=$6
+PARTTARGET=$7
+
+#herramienta de compresión.
+TOOLCLONE=$8
+COMPRESOR=$9
+
+
+###IMG=$(ogGetPath $2 $3.img)
+###echo $IMG
+
+# Check command in Master (sendFile or sendPartition)
+
+case $MASTERIP in
+ $HOSTIP)
+ ogGetPath $2 $3.img
+ RC=`echo $?`
+ echo "$RC comenzando control del valor del origen $2 $3"
+ if [ $RC == "0" ]
+ then
+ echo "mode senfile"
+ IMG=$(ogGetPath $2 $3.img)
+ MODEMASTER=SENDFILE
+ else
+ if [ $(ogDiskToDev $2 $3) ]
+ then
+ echo "mode sendpartitons"
+ DISKSOURCE=$2
+ PARTSOURCE=$3
+ MODEMASTER=SENDPARTITION
+ fi
+ fi
+
+ echo "modo " $MODEMASTER
+
+ if [ "$MODEMASTER" == "false" ]
+ then
+ echo "cloneRemote: origen no encontrado"
+ exit 1
+ else
+ echo "cloneRemote: sistema preparando para un $MODEMASTER"
+ fi
+
+ case "$MODEMASTER" in
+ SENDPARTITION)
+ echo "[5]: cloneRemoteFromMaster: sistema preparando como MASTER modo $MODEMASTER"
+ echo "[10]: Desmontando DISK:$DISKSOURCE PARTITION:$PARTSOURCE"
+ ogUnmount $2 $3 || exit
+ #Obtener tamaño de la partición.
+ SIZE=$(ogGetPartitionSize $2 $3)
+ # Reducir el sistema de archvios.
+ echo "[15]: Calculando la reduccion del sistema de archivos DISK:$DISKSOURCE PARTITION:$PARTSOURCE SIZE:$SIZE"
+ ogReduceFs $2 $3 || exit 1
+
+ #echo "salida de ogReduceFS" $?
+ #if [ $? == 1 ]
+ #then
+ # echo "no se ha podido reducir FS"
+# exit 1
+#
+ REDSIZE=$(ogGetFsSize $2 $3)
+ echo "[20]: Reducido el sistema de archivos a $REDSIZE $DISKSOURCE $PARTSOURCE"
+ if [ $REDSIZE -lt $SIZE ]; then
+ echo "[24] Redimensionar partición a $REDSIZE KB."
+ ogSetPartitionSize $2 $3 $REDSIZE
+ fi
+ echo "[25] ofreciendo informacion a los clientes-slaves"
+ faucet 4000 --out echo "$TOOLCLONE $COMPRESOR $REDSIZE" &
+
+ echo "[30] Enviando $PROTOCOL "
+ case $PROTOCOL in
+ MULTICAST|multicast)
+ echo ogMcastSendPartition $DISKSOURCE $PARTSOURCE $SESSIONMCASTSERVER $TOOLCLONE $COMPRESOR
+ ogMcastSendPartition $DISKSOURCE $PARTSOURCE $SESSIONMCASTSERVER $TOOLCLONE $COMPRESOR
+ ;;
+ UNICAST|unicast)
+ sleep 60
+ echo "ogUcastSendPartition $DISKSOURCE $PARTSOURCE $SESSIONUCASTSERVER $TOOLCLONE $COMPRESOR"
+ ogUcastSendPartition $DISKSOURCE $PARTSOURCE $SESSIONUCASTSERVER $TOOLCLONE $COMPRESOR
+ ;;
+ esac
+
+ if [ $REDSIZE -lt $SIZE ]; then
+ echo "[85] Redimensionar partición a $SIZE KB."
+ ogSetPartitionSize $2 $3 $SIZE
+ echo "[90] Extender sistema de archivos."
+ ogExtendFs $2 $3
+ fi
+ pkill faucet
+ ;;
+ SENDFILE)
+ echo "[5]: cloneRemoteFromMaster: sistema preparando como MASTER modo $MODEMASTER"
+ echo "[10]: Preparando Imagen: $IMG"
+ TOOLCLONE=$(ogGetImageProgram $2 $3)
+ COMPRESOR=$(ogGetImageCompressor $2 $3)
+ REDSIZE=$(ogGetImageSize $2 $3)
+ echo "[25] ofreciendo informacion a los clientes-slaves: $TOOLCLONE $COMPRESOR $REDSIZE"
+ faucet 4000 --out echo "$TOOLCLONE $COMPRESOR $REDSIZE" &
+
+ echo "[30] Enviando $PROTOCOL:"
+ echo "ogMcastSendFile $2 $3.img $SESSIONMCASTSERVER "
+ ogMcastSendFile $2 $3.img $SESSIONMCASTSERVER
+
+ pkill faucet
+ ;;
+ esac
+ pkill faucet
+ ;;
+ *)
+ echo "[5]: cloneRemoteFromMaster: sistema preparando como CLIENTE modo $MODEMASTER"
+ ogUnmount $DISKTARGET $PARTTARGET
+ echo "[24] Cliente intentando conectar con el master $MASTERIP"
+ echo -n "[25] Buscando informacion extra sobre la clonacion: "
+ # While para esperar al servidor
+ while [ -z "$INFOEXTRA" ]
+ do
+ INFOEXTRA=`hose $MASTERIP 4000 --in cat 2>/dev/null`
+ sleep 10
+ echo -n "."
+ done
+ TOOLCLONE=$(echo $INFOEXTRA | awk '{print $1}')
+ COMPRESOR=$(echo $INFOEXTRA | awk '{print $2}')
+ SIZEIMAGE=$(echo $INFOEXTRA | awk '{print $3}')
+ echo -n "[25] $INFOEXTRA = herramienta= $TOOLCLONE compresor= $COMPRESOR size= $SIZEIMAGE "
+ # comprobamos que el tamaño de a imagen es menor que la del cliente.
+ SIZEPARTTARGET=$(ogGetPartitionSize $DISKTARGET $PARTTARGET)
+ if [ "$SIZEIMAGE" -lt "$SIZEPARTTARGET" ]
+ then
+ echo "[30] Iniciando Cliente $PROTOCOL "
+ case $PROTOCOL in
+ MULTICAST|multicast)
+ echo ogMcastReceiverPartition $DISKTARGET $PARTTARGET $SESSIONMCASTCLIENT $TOOLCLONE $COMPRESOR
+ ogMcastReceiverPartition "$DISKTARGET" "$PARTTARGET" "$SESSIONMCASTCLIENT" "$TOOLCLONE" "$COMPRESOR"
+ ;;
+ UNICAST|unicast)
+ echo ogUcastReceiverPartition $DISKTARGET $PARTTARGET $SESSIONUCASTCLIENT $TOOLCLONE $COMPRESOR
+ ogUcastReceiverPartition $DISKTARGET $PARTTARGET $SESSIONUCASTCLIENT $TOOLCLONE $COMPRESOR
+ ;;
+ esac
+
+
+ echo "[90] Extender sistema de archivos"
+ ogExtendFs $DISKTARGET $PARTTARGET
+ # Cambiar nombre en sistemas Windows.
+ if [ "$(ogGetOsType $DISKTARGET $PARTTARGET)" = "Windows" ]; then
+ HOST=$(ogGetHostname)
+ HOST=${HOST:-"UNKNOWN"}
+ echo "[90] Cambiar nombre Windows a \"$HOST\"."
+ ogSetWindowsName $DISKTARGET $PARTTARGET "$HOST"
+ fi
+ else
+ echo -n "[25] $INFOEXTRA = herramienta= $TOOLCLONE compresor= $COMPRESOR size= $SIZEIMAGE "
+ echo -n "[26] ERROR tamanio particion= $SIZEPARTTARGET tamanio de la imagen= $SIZEIMAGE"
+ exit 1
+ fi
+ ;;
+esac
+TIME=$[SECONDS-TIME1]
+echo "[100] Duración de la operación $[TIME/60]m $[TIME%60]s"
+
+
diff --git a/client/nfsexport/scripts/createImage b/client/shared/scripts/createImage
index 11f6eb21..8e98113a 100755
--- a/client/nfsexport/scripts/createImage
+++ b/client/shared/scripts/createImage
@@ -1,6 +1,6 @@
#!/bin/bash
-# create-image.sh - Scirpt de ejemplo para crear una imagen de un sistema de archivos.
-# (puede usarse como base para el programa de creación de imágenes usado por OpenGNSys Admin).
+# createImage - Scirpt de ejemplo para crear una imagen de un sistema de archivos.
+# (puede usarse como base para el programa de creación de imágenes usado por OpenGnSys Admin).
TIME1=$SECONDS
PROG="$(basename $0)"
@@ -9,6 +9,11 @@ if [ $# -ne 4 ]; then
exit $?
fi
+# Valores por defecto
+IMGPROG="partclone"
+IMGCOMP="lzop"
+IMGEXT="img"
+
# Si el repositorio es CACHE comprobamos que exista
if [ "$3" == "CACHE" -o "$3" == "cache" ]; then
if ! $(ogFindCache >/dev/null); then
@@ -26,7 +31,7 @@ if [ $? != 0 ]; then
ogMakeDir "$3" $(dirname "/$4")
IMGDIR=$(ogGetParentPath "$3" "/$4") || exit $?
fi
-IMGFILE=$IMGDIR/$(basename "/$4").pgz
+IMGFILE=$IMGDIR/$(basename "/$4").$IMGEXT
# Renombrar el fichero de imagen si ya existe.
if [ -f "$IMGFILE" ]; then
echo "[10] Renombrar \"$IMGFILE\" por \"$IMGFILE.ant\"."
@@ -36,33 +41,22 @@ fi
# Mostrar información.
echo "[15] $PROG: Origen=$PART, Destino=$IMGFILE"
-# Reducir el sistema de archvios.
-echo "[20]: Reducir sistema de archivos."
-SIZE=$(ogGetPartitionSize "$1" "$2")
-REDSIZE=$(ogReduceFs $1 $2) || REDSIZE=$[SIZE+1]
-if [ $REDSIZE -lt $SIZE ]; then
- echo "[25] Redimensionar particion a $REDSIZE KB."
- ogSetPartitionSize $1 $2 $REDSIZE
-fi
# Comprobar consistencia del sistema de archivos.
-echo "[30] Comprobar sistema de archivos."
+echo "[20] Comprobar sistema de archivos."
+ogUnmount $1 $2
ogCheckFs $1 $2
+echo "[30]: Reducir sistema de archivos."
+ogReduceFs $1 $2 || exit 1
+
# Crear la imagen.
echo "[40] Crear imagen."
-ogCreateImage "$@"
-EXITCODE=$?
+ogCreateImage $1 "$2" $3 $4 "$IMGPROG" "$IMGCOMP" || exit $?
+#ogCreateImage $1 "$2" $3 $4 || exit $?
-# Restaurar tamaño.
-if [ $REDSIZE -lt $SIZE ]; then
- echo "[85] Redimensionar particion a $SIZE KB."
- ogSetPartitionSize $1 $2 $SIZE
- echo "[90] Extender sistema de archivos."
- ogExtendFs $1 $2
-fi
+echo "[90] Extender sistema de archivos."
+ogExtendFs $1 $2
TIME=$[SECONDS-TIME1]
echo "[100] Duracion de la operacion $[TIME/60]m $[TIME%60]s"
-# Código de salida.
-exit $EXITCODE
diff --git a/client/nfsexport/scripts/createLogicalPartitions b/client/shared/scripts/createLogicalPartitions
index 7a693aac..7a693aac 100755
--- a/client/nfsexport/scripts/createLogicalPartitions
+++ b/client/shared/scripts/createLogicalPartitions
diff --git a/client/nfsexport/scripts/createPrimaryPartitions b/client/shared/scripts/createPrimaryPartitions
index f69f354d..f69f354d 100755
--- a/client/nfsexport/scripts/createPrimaryPartitions
+++ b/client/shared/scripts/createPrimaryPartitions
diff --git a/client/shared/scripts/deployImage b/client/shared/scripts/deployImage
new file mode 100755
index 00000000..15392ec7
--- /dev/null
+++ b/client/shared/scripts/deployImage
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+TIME1=$SECONDS
+PROG="$(basename $0)"
+if [ $# -lt 4 ]; then
+ ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO imagen ndisco nparticion [ UNICAST|MULTICAST|TORRENT ] [opciones protocolo]"
+ exit $?
+fi
+
+#controlar param1 REPO
+
+updateCache REPO $2.img $5 $6
+if [ $? != "0" ]
+then
+ echo "fin del updateCache REPO $2.img $5 $6 con errores"
+ exit 1
+else
+ echo "comenzamos con restoreImage CACHE $2 $3 $4"
+ restoreImage CACHE $2 $3 $4
+fi \ No newline at end of file
diff --git a/client/nfsexport/scripts/formatFs b/client/shared/scripts/formatFs
index 832592fb..832592fb 100755
--- a/client/nfsexport/scripts/formatFs
+++ b/client/shared/scripts/formatFs
diff --git a/client/nfsexport/scripts/getFsType b/client/shared/scripts/getFsType
index b3516a4f..b3516a4f 100755
--- a/client/nfsexport/scripts/getFsType
+++ b/client/shared/scripts/getFsType
diff --git a/client/nfsexport/scripts/getIpAddress b/client/shared/scripts/getIpAddress
index e428ebfc..e428ebfc 100755
--- a/client/nfsexport/scripts/getIpAddress
+++ b/client/shared/scripts/getIpAddress
diff --git a/client/nfsexport/scripts/getOsVersion b/client/shared/scripts/getOsVersion
index 6e6d91d5..6e6d91d5 100755
--- a/client/nfsexport/scripts/getOsVersion
+++ b/client/shared/scripts/getOsVersion
diff --git a/client/nfsexport/scripts/initCache b/client/shared/scripts/initCache
index 69cdc535..69cdc535 100755
--- a/client/nfsexport/scripts/initCache
+++ b/client/shared/scripts/initCache
diff --git a/client/nfsexport/scripts/listHardwareInfo b/client/shared/scripts/listHardwareInfo
index c38f35f9..c38f35f9 100755
--- a/client/nfsexport/scripts/listHardwareInfo
+++ b/client/shared/scripts/listHardwareInfo
diff --git a/client/nfsexport/scripts/listPrimaryPartitions b/client/shared/scripts/listPrimaryPartitions
index d20dd76f..d20dd76f 100755
--- a/client/nfsexport/scripts/listPrimaryPartitions
+++ b/client/shared/scripts/listPrimaryPartitions
diff --git a/client/nfsexport/scripts/listSoftwareInfo b/client/shared/scripts/listSoftwareInfo
index e5b0da1c..e5b0da1c 100755
--- a/client/nfsexport/scripts/listSoftwareInfo
+++ b/client/shared/scripts/listSoftwareInfo
diff --git a/client/nfsexport/scripts/menuBrowser b/client/shared/scripts/menuBrowser
index 164d5314..164d5314 100755
--- a/client/nfsexport/scripts/menuBrowser
+++ b/client/shared/scripts/menuBrowser
diff --git a/client/nfsexport/scripts/poweroff b/client/shared/scripts/poweroff
index 573e5956..bf867467 100755
--- a/client/nfsexport/scripts/poweroff
+++ b/client/shared/scripts/poweroff
@@ -11,6 +11,8 @@ for (( i=1; i <= $(ogDiskToDev | wc -w); i++ )); do
done
echo "[50] Desmontar cache local."
ogUnmountCache
-echo "[70] Reiniciar el equipo."
-/sbin/poweroff
+echo "[70] Apagando el equipo."
+ethtool -s $DEVICE wol g
+(sleep 5 && busybox poweroff) &
+
diff --git a/client/nfsexport/scripts/reboot b/client/shared/scripts/reboot
index 88b4532b..7b7f3c94 100755
--- a/client/nfsexport/scripts/reboot
+++ b/client/shared/scripts/reboot
@@ -12,5 +12,6 @@ done
echo "[50] Desmontar cache local."
ogUnmountCache
echo "[90] Reiniciar el equipo."
-/sbin/reboot
+ethtool -s $DEVICE wol g
+(sleep 5 && busybox reboot) &
diff --git a/client/nfsexport/scripts/remoteConsole b/client/shared/scripts/remoteConsole
index dc0fc4bb..dc0fc4bb 100755
--- a/client/nfsexport/scripts/remoteConsole
+++ b/client/shared/scripts/remoteConsole
diff --git a/client/nfsexport/scripts/restoreImage b/client/shared/scripts/restoreImage
index 8fb46fa5..a01f1a49 100755
--- a/client/nfsexport/scripts/restoreImage
+++ b/client/shared/scripts/restoreImage
@@ -10,7 +10,7 @@ if [ $# -lt 4 ]; then
fi
# Procesar parámetros de entrada
-IMGTYPE=$(ogGetImageType "$1" "$2")
+IMGTYPE="img"
IMGFILE=$(ogGetPath "$1" "$2.$IMGTYPE")
PROTO=${5:-"UNICAST"}
if [ "$1" == "CACHE" -o "$1" == "cache" ]; then
@@ -25,7 +25,7 @@ if [ "$1" == "CACHE" -o "$1" == "cache" ]; then
case "$PROTO" in
UNICAST|unicast)
# Copiar fichero del repositorio al caché local.
- IMGTYPE=$(ogGetImageType "repo" "$2")
+ #IMGTYPE=$(ogGetImageType "repo" "$2")
IMGFILE=$(ogGetPath "cache" "$2.$IMGTYPE")
if [ -z "$IMGFILE" ] || [ $(ogIsNewerFile "repo" "$2.$IMGTYPE" "$IMGFILE") ]; then
echo "[10] Copiando imagen \"$2\" del repositorio a caché local"
@@ -33,7 +33,7 @@ if [ "$1" == "CACHE" -o "$1" == "cache" ]; then
fi
# Comprobar si existe el fichero en caché y no en el repositorio.
if [ -z "$IMGFILE" ]; then
- IMGTYPE=$(ogGetImageType "cache" "$2")
+ #IMGTYPE=$(ogGetImageType "cache" "$2")
IMGFILE=$(ogGetPath "cache" "$2.$IMGTYPE")
if [ -z "$IMGFILE" ]; then
ogRaiseError $OG_ERR_NOTFOUND "cache, $2.$IMGTYPE"
@@ -44,7 +44,7 @@ if [ "$1" == "CACHE" -o "$1" == "cache" ]; then
MULTICAST|multicast)
if [ -z "$IMGFILE" ]; then
echo "[10] Copiando imagen multicast \"$2\" del repositorio a caché local"
- IMGTYPE=$(ogGetImageType "repo" "$2")
+ #IMGTYPE=$(ogGetImageType "repo" "$2")
PORTBASE=`echo $6 | cut -f1 -d:`
echo "ogMcastReceiverFile SOURCE:$PORTBASE TARGET:CACHE $2.$IMGTYPE"
ogMcastReceiverFile "$PORTBASE" "CACHE" "$2.$IMGTYPE" || exit $?
@@ -53,7 +53,7 @@ if [ "$1" == "CACHE" -o "$1" == "cache" ]; then
;;
TORRENT|torrent)
echo "[9] copiando el fichero torrent Unicast \"$2\" del repositorio a caché local"
- IMGTYPE=$(ogGetImageType "repo" "$2")
+ #IMGTYPE=$(ogGetImageType "repo" "$2")
ogCopyFile "repo" "$2.$IMGTYPE.torrent" "$IMGDIR" || exit $?
echo "[10] descargando imagen torrent($6) \"$2\" del repositorio a caché local"
ogTorrentStart "CACHE" "$2.$IMGTYPE.torrent" "peer:60" || exit $?
diff --git a/client/nfsexport/scripts/sendFileMcast b/client/shared/scripts/sendFileMcast
index 54e82ac3..54e82ac3 100755
--- a/client/nfsexport/scripts/sendFileMcast
+++ b/client/shared/scripts/sendFileMcast
diff --git a/client/shared/scripts/updateCache b/client/shared/scripts/updateCache
new file mode 100755
index 00000000..f6f61e34
--- /dev/null
+++ b/client/shared/scripts/updateCache
@@ -0,0 +1,113 @@
+#!/bin/bash
+
+# Scirpt para la actualizacion de datos en la cache.
+# Versión: 0.9.1, 2008/03/17, - integracion eac
+# Versión: 0.9.2, 2010/07/27, - integracion opengnsys
+
+
+
+#1 REPO
+#2 nombre del fichero con su extension, tipo /imagen1.img o /ubuntu.iso
+#3 Protocolo TORRENT | MULTICAST | UNICAST
+#4 opciones protocolo
+#5 opciones de update cache
+
+
+PROG="$(basename $0)"
+if [ $# -lt 4 ]; then
+ ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG str_REPO _str_Relative_Path_OGIMG_with_/ PROTOCOLO OPCIONES_PROTOCOLO OPCIONES_UPDATECACHE"
+ exit $?
+fi
+
+REPOSITORIO=$1
+PROTOCOLO=$3
+OPTPROTOCOLO=$4
+REPOIP=$(ogGetRepoIp)
+echo $REPOSITORIO $REPOIP $PROTOCOLO $OPTPROTOCOLO
+# Si el repositorio local CACHE no existe salimos.
+if ! $(ogFindCache >/dev/null); then
+ ogRaiseError $OG_ERR_NOTFOUND "CACHE"
+ exit $?
+fi
+
+#Comprobamos si Actualizacion - existe una imagen con igual nombre pero distinto sum-
+#TODO: ogUpdateCacheIsNecesary debe borrar la imagen que tenga igual nombre pero distinto sum-
+ogUpdateCacheIsNecesary $1 $2 || exit 0
+
+CACHESIZEFREE=$(ogGetFreeSize `ogFindCache`)
+FILESIZE=$(ls -sk $(ogGetPath $1 $2) | cut -f1 -d" ")
+
+if [ "$FILESIZE" -ge "$CACHESIZEFREE" ]
+then
+ echo "el tamanio del fichero $2 = $FILESIZE es mayor que el espacio dispinible en la cache = $CACHESIZEFREE"
+ exit 1
+fi
+
+ogUpdateCacheIsNecesary $1 $2 || exit 0
+
+ogMountCache
+
+## Si no existe, crear subdirectorio para el fichero en la cache.
+IMGDIR=$(ogGetParentPath "$1" "/$2")
+if [ $? != 0 ]; then
+ echo "[5] Crear subdirectorio del fichero \"$2 $(dirname "$2")."
+ ogMakeDir "CACHE" $(dirname "/$2")
+ IMGDIR=$(ogGetParentPath "$1" "/$2") || exit $?
+fi
+
+
+
+
+case "$PROTOCOLO" in
+ torrent | TORRENT )
+ echo "ogCopyFile $1 $2.torrent absolute $OGCAC$OGIMG"
+ ogCopyFile $1 $2.torrent $OGCAC$OGIMG
+ #TODO: comprobar que el tracker definido en el fichero es correcto.
+ #TODO comprobar que el fichero torrent está en cache
+ echo "ogTorrentStart CACHE $2.torrent $4"
+ ogTorrentStart CACHE $2.torrent $4
+ ;;
+ multicast | MULTICAST )
+ echo "determinando puerto principal y auxiliar."
+ PORT=$(echo $OPTPROTOCOLO | cut -f1 -d":")
+ let PORTAUX=$PORT+1
+ #TODO: ticket 379
+ NUMBER=$[ ( $RANDOM % 30 ) + 1 ]
+ sleep $NUMBER
+ #FIN TODO
+ echo "comprobando puerto $PORTAUX en $REPOIP (sesion multicast en puerto $PORT) "
+ if (nmap -n -sU -p $PORTAUX $REPOIP | grep open)
+ then
+ ogMcastReceiverFile $PORT CACHE $2
+ else
+ # TODO ticket 379 Realizar la petición basada en identificador de operacion
+ echo "solicita la apertura: hose $REPOIP 2009 --out sh -c "echo -ne START_MULTICAST $2 $OPTPROTOCOLO""
+ hose $REPOIP 2009 --out sh -c "echo -ne START_MULTICAST $2 $OPTPROTOCOLO"
+ #echo "espero y llamo a: ogMcastReceiverFile $PORT CACHE $2"
+ sleep 10
+ if (nmap -n -sU -p $PORTAUX $REPOIP | grep open)
+ then
+ ogMcastReceiverFile $PORT CACHE $2
+ else
+ echo "la peticion ha fallado: hose $REPOIP 2009 --out sh -c echo -ne START_MULTICAST $2 $OPTPROTOCOLO"
+ exit 1
+ fi
+ fi
+ ;;
+ unicast | UNICAST )
+ echo "unicast"
+ ;;
+esac
+
+if ogUpdateCacheIsNecesary $1 $2
+then
+ echo "algo ha fallado"
+ exit 1
+else
+ echo "updateCache ok"
+ exit 0
+fi
+
+
+
+# \ No newline at end of file
diff --git a/doc/CHANGELOG.es.txt b/doc/CHANGELOG.es.txt
index a6ad970a..4d0b7889 100644
--- a/doc/CHANGELOG.es.txt
+++ b/doc/CHANGELOG.es.txt
@@ -2,11 +2,133 @@ LISTA DE CAMBIOS CHANGELOG.es.ext
========================================
-Lista de cambios que serán incluidos en OpenGnSys 0.10
-------------------------------------------------------
+Lista de cambios incluidos en OpenGnSys 1.0
+-------------------------------------------
+
+Tickets resueltos en módulo OpenGnSys Cloning Engine:
+#64 Selección de aplicaciones de clonación
+#264 Error al crear la caché
+#286 Parámetro debug para el engine
+#291 Creación de imagenes desde el modo user
+#298 Tratamientos de bloqueos de imágenes para solucionar problemas de concurrencia (mejora)
+#305 Integración engine version 1.0
+#309 Integración create/restoreImage Trunk y Testing: extensión .img
+#337 Scripts cliente: reboot|poweroff sleep antes de llamar a Busybox (no se resolverá)
+#342 ogGetImageInfo() Partclone size MB GB
+#353 Bloqueos: fallos en la detección en ogCreateImage, ogRestoreImage, etc
+#354 Bloqueos mejoras: funciones repetidas (no se resolverá)
+#355 Error al cambiar partición de NTFS a EXT[234]
+#358 ogCreateCache e initCache: No comprueba si se está usando la cuarta partición (no se resolverá)
+#369 Reducir posibles errores en transferencia multicast
+
+Tickets resueltos en módulo OpenGnSys Client:
+#93 Gestionar una estructura de directorios Linux debootstrap para enlazarlo al Initrd
+#131 Generar paquetes deb para el cliente (no se resolverá)
+#162 Optimizar el uso del fichero-disco con particiones para su uso en entorno virtualizado (mejora)
+#163 Incluir en el cliente la clave autorizada rsa ssh del servidor
+#189 Añadir las variables de entorno y Engine en las consolas tty2-tty7 y remotas
+#243 Browser incluye terminal con letra monospace y barra de estado en UTF-8 (mejora)
+#288 Integración modulo netboot
+#294 Integración activacion wol del cliente
+#303 Integración proceso arranque cliente versión 1.0
+#304 Integración interface adm versión 1.0
+#314 SMB punto acceso 2nd FileSystem del cliente [tftpboot] [ogboot]
+#345 Importar "runtest" para la versión 1.0 (mejora)
+#334 OgClient en modo admin: problemas al escribir en el repo
+#336 Regenerar el cliente ogclient-1.0-lucid-32bit.tar.gz
+#360 Importar herramientas de generación del cliente desde la rama ogClient (mejora)
+#368 Generar nuevo cliente como boot-tools
+
+Tickets resueltos en módulo OpenGnSys Server:
+#350 ogAdmAgent no se inicia
+
+Tickets resueltos en módulo OpenGnSys Repository Server:
+#188 Al restaurar por torrent el BitFile no se crea siempre
+#300 Integración binarios del repo
+
+Tickets resueltos en módulo OpenGnSys Web Admin Console:
+#126 Integración de consola Web con bittorent (mejora)
+#138 Configurar parámetros de red en cliente
+#185 Aproximación a la gestión log de los clientes (mejora)
+#248 La consola web no muestra datos del repositorio hasta que no se asigna
+#258 Error al eliminar un perfil de software
+#266 Información unidades en tamaño de la caché
+#268 Erratas en texto de formularios
+#301 Integración modulos web versión 1.0
+#302 Integración base de datos version 1.0
+#306 Asistente Clonacion Particiones Remotas no genera código
+#307 Asistente Deploy de Imagenes no muestra nombres de imágenes
+#310 Instalar: no genera las propiedades del repositorio por defecto en la consola (duplicado de #248)
+#338 Validación de formularios de la consola web
+#339 Añadir opción de apagado en cliente sin menú asociado (mejora)
+#349 Botón de confirmación en gestor de arranque
+#359 Ocultar los comandos inacabados en la consola web
+#363 Asistente particionado no permite valores personalizados para la caché
+#364 Asistente particionado no recupera valores iniciales si se pulsa en personalizar
+
+Tickets resueltos en módulo OpenGnSys Installer:
+#299 Instalador para la versión 1.0
+#312 instalador: torrent-tracker no se se instala
+#313 Instalador: no genera la estrucutra para el cliente
+#316 Error en opengnsys_update.sh al copiar archivos de servicios
+#335 Error en opengnsys_update.sh al descomprimir cliente
+#361 Actualizador debe aplicar cambios en la estructura de base de datos
+#365 Comprobar conectividad http y svn en el instalador
+
+Tickets genéricos resueltos:
+#362 Convertir versión 1.0 en rama principal de desarrollo
+
+
+Lista de cambios incluidos en OpenGnSys 0.10
+--------------------------------------------
+
+Tickets resueltos en módulo OpenGnSys Cloning Engine:
+#182 Clonación remota partición a partición
+#257 ogCreatePartitions: Al crear o modificar las particiones desaparece la cache
+#261 restoreImage de un XP cambia usuario inicio sesión a HOSTNAME
+#269 No crea correctamente la imagen con Partclone en Pentium IV
+#271 Multicast ttl enrutadores Cisco
+#276 Error de CRC al restaurar imágenes con Partclone
+#292 Error de CRC al restaurar o crear imagen (duplicado de #276)
+#290 ogReduceFs en Ext[234]
+#293 createImageTesting incluye el redimensionado de la particion origen pero luego no la expande
+#297 Error al detectar tipo de partición Linux marcada como activa
+
+Tickets resueltos en módulo OpenGnSys Client:
+#112 Problema al arrancar Windows en discos SATA2
+#237 Sustituir Partimage
+#250 En ocasiones el cliente no arranca el browser gráfico
+#255 ogClient: Si falla alguna comprobación inicial, se para el ogClient
+#267 Cliente no arranca con CD en la primera unidad óptica (no se resolverá)
+#275 Generador de cliente Initrd no detecta versión de Ubuntu
+
+Tickets resueltos en módulo OpenGnSys Server:
+#260 Gestionar plantillas PXE mediante scripts
+
+Tickets resueltos en módulo OpenGnSys Repository Server:
+#184 tracker no gestiona el enjambre
+
+Tickets resueltos en módulo OpenGnSys Web Admin Console:
+#91 Incorporar equipos desde fichero dhcp.conf
+#177 Consola web: No se pueden borrar usuarios
+#190 Error en incorporarordenadores.php
+#241 El cliente no responde en local con la nueva consola web
+#247 La consola web muestra la cadena SERVERIP en el repositorio por defecto
+#251 El cliente no carga su menú personalizado definido en la consola web
+#254 Consola Web: particionar y formatear
+#259 Consola Web: información de un repositorio
+#282 Gestión web de log
+#283 Gestor de activacion/desactivacion modulos web
+#284 Modulo web: propiedades aula/equipos combo box para elementos netboot
+#285 Modulo web: propiedades aula/equipos combo box para elementos netboot
Tickets resueltos en módulo OpenGnSys Installer:
#240 Error instalación limpia rev. 1326
+#242 Completar instalación por defecto basada en Ubuntu 10.04 Lucid
+#246 El instalador debe proteger ficheros de configuración
+#249 Desinstalador borra contenido repositorio por defecto
+#253 El instalador debe parchear los ficheros de configuración para configurar acceso a base datos
+#262 Error de ejecución del instalador en 2ª instalación consecutiva mediante Subversion
Lista de cambios incluidos en OpenGnSys 0.9.2
diff --git a/doc/INSTALL.es.txt b/doc/INSTALL.es.txt
index 8c211a12..97501061 100644
--- a/doc/INSTALL.es.txt
+++ b/doc/INSTALL.es.txt
@@ -3,7 +3,7 @@ Instalación de OpenGnSys Server v 0.9
Notas iniciales
-Se presupone que el servidor de OpenGnSys va a ser instalado en un sistema operativo Ubuntu 9.04 Server de 32 bits.
+Se presupone que el servidor de OpenGnSys va a ser instalado en una distribución del sistema operativo Ubuntu Linux a partir de la versión 9.04.
La instalación de OpenGnSys se realiza ejecutando el script de instalación opengnsys_installer.sh, el cual puede descargarse directamente de la dirección: http://www.opengnsys.es/browser/trunk/installer/opengnsys_installer.sh?format=txt
@@ -25,14 +25,13 @@ Se realizan los siguientes procesos:
* Crear la estructura básica de directorios de OpenGnSys.
* Descargar el repositorio de código en un directorio temporal (/tmp/opengnsys_installer). Nota: en versiones futuras este proceso no será necesario.
* Compilar e instalar los servicios de OpenGnSys.
- * Configuración básica de los serviciios de red DHCP, PXE y NFS a partir de los parámetros de conexión.
+ * Configuración básica de los serviciios de red DHCP, PXE y NFS/Samba a partir de las plantillas de configuración
* Copiar ficheros complementarios de gestión del servidor.
* Crear la base de datos y configurar el servidor web de OpenGnSys Web Admin Console.
- * Copiar los ficheros de las páginas web de Web Console.
+ * Copiar los ficheros de las páginas de Web Admin Console.
* Copiar la estructura de directorios de OpenGnSys Client.
- * Descargar y generar la imagen inicial Initrd y el Kernel de OpenGnSys Client (llamada al script initrd-generator).
- * Descargar los paquetes Udeb de herramientas complementarias para OpenGnSys Client (llamada al script upgrade-clients-udeb.sh).
- * Configuración básica de los serviciios de OpenGNsys a partir de los parámetros de red.
+ * Descargar la imagen inicial de OpenGnSys Client.
+ * Configuración básica de los serviciios de OpenGnSys a partir de los parámetros de red.
Una vez finalizada la ejecución del instalador, puede empezarse a trabajar con el sistema:
* Configurar DHCP.
diff --git a/doc/VERSION.txt b/doc/VERSION.txt
index cec11621..79c512fa 100644
--- a/doc/VERSION.txt
+++ b/doc/VERSION.txt
@@ -1 +1 @@
-OpenGnSys 0.10
+OpenGnSys 1.0
diff --git a/doc/filetree.es.txt b/doc/filetree.es.txt
index a714e5a5..037ae19a 100644
--- a/doc/filetree.es.txt
+++ b/doc/filetree.es.txt
@@ -1,63 +1,63 @@
-Estructura de Ficheros de OpenGNSys
-===================================
+Estructura de Ficheros de OpenGnSys 1.0
+=======================================
-Estructura de directorios de OpenGNSys Client
+Estructura de directorios de OpenGnSys Client
---------------------------------------------
/opt/opengnsys
bin (ro) - utilidades asociadas.
- cache (rw) - directorio donde esta montado la particion de cache
+ cache (rw) - directorio donde se monta el sistema de archivos de caché.
etc (ro) - configuración.
preinit (ro) - scripts de carga del sistema.
init (ro) - scripts de arranque.
- startpages (ro) - paginas webs de inicio
- images (normal=ro, admin=rw) - imágenes de arranque.
+ images (user=ro, admin=rw) - repositorio de imágenes.
lib (ro) - librerías de las utilidades.
engine/bin (ro) - librerías de funciones del motor de clonación.
modules (ro) - módulos extra del kernel.
- log (rw) - registros de incidencias (enlazado en /var/log/opengnsys).
+ log (rw) - ficheros de registro de incidencias.
-Servicios de OpenGNSys Server:
+Servicios de OpenGnSys Server:
------------------------------
- Syslog - gestión de logs de servidores y clientes.
-- NFS
- DHCP
- PXE
- TFTP
+- Samba
- Base de datos
- Servidor de órdenes
-Estructura de directorios de OpenGNSys Server:
+Estructura de directorios de OpenGnSys Server:
----------------------------------------------
/opt/opengnsys
bin - binarios del servidor.
- client - exporta por NFS la estructura de directorios del cliente.
- etc - configuración (enlazado en /etc/opengnsys).
+ client - exporta en remoto la estructura de directorios del cliente.
+ etc - ficheros de configuración.
lib - librerías de las utilidades.
- log - registros de incidencias (enlazado en /var/log/opengnsys).
- tftpboot - enlace simbólico a /var/lib/tftpboot (o donde corresponda).
+ log - ficheros de registro de incidencias.
+ tftpboot - arranque remoto de clientes (enlace a /var/lib/tftpboot).
NOTA: páginas de manuales y documentación se copian a los directorios estándares del sistema operativo.
-Estructura de directorios de OpenGNSys Repository Manager
+Estructura de directorios de OpenGnSys Repository Manager
---------------------------------------------------------
/opt/opengnsys
bin - binarios del servidor.
- etc - configuración (enlazado en /etc/opengnsys).
+ etc - ficheros de configuración.
images - imágenes de sistemas de archivos.
- log - registros de incidencias (enlazado en /var/log/opengnsys).
+ log - ficheros de registro de incidencias.
-Relación NFS
-------------
+Relación de sistemas de ficheros en red
+---------------------------------------
+
Server: exporta /opt/opengnsys/client -> Client: importa /opt/opengnsys
Server: exporta /opt/opengnsys/log/client -> Client: importa /opt/opengnsys/log
RepoMan: exporta /opt/opengnsys/images -> Client: importa /opt/opengnsys/images
diff --git a/doc/udeb.list b/doc/udeb.list
deleted file mode 100644
index 606881a5..00000000
--- a/doc/udeb.list
+++ /dev/null
@@ -1,120 +0,0 @@
-apt-setup-udeb - Configure apt
-beep-udeb - advanced pc-speaker beeper - minimal package
-binutils-static-udeb - statically linked binutils tools for for the Debian installer
-bogl-bterm-udeb - Ben's Own Graphics Library - graphical terminal
-brltty-udeb - Access software for a blind person using a braille display
-busybox-udeb - Tiny utilities for the debian-installer
-cdebconf-gtk-udeb - Gtk+ frontend for Debian Configuration Management System
-cdebconf-newt-udeb - Newt frontend for Debian Configuration Management System
-cdebconf-priority - Change debconf priority
-cdebconf-text-udeb - Plain text frontend for Debian Configuration Management System
-cdebconf-udeb - Debian Configuration Management System (C-implementation)
-console-setup-fonts-udeb - console fonts for Debian Installer
-console-setup-udeb - Configure the keyboard
-cryptsetup-udeb - configures encrypted block devices
-debootstrap-udeb - Bootstrap the Debian system
-devio-udeb - correctly read (or write) a region of a block device
-dhcp3-client-udeb - DHCP Client for debian-installer
-dmraid-udeb - Device-Mapper Software RAID support tool (udeb)
-dmsetup-udeb - The Linux Kernel Device Mapper userspace library
-e2fsprogs-udeb - stripped-down versions of e2fsprogs, for debian-installer
-eject-udeb - ejects CDs from d-i menu
-eucalyptus-udeb - Elastic Utility Computing Architecture - installer integration
-fbset-udeb - framebuffer device maintenance program
-fdisk-udeb - Manually partition a hard drive (fdisk)
-fontconfig-udeb - generic font configuration library - minimal runtime
-fuse-utils-udeb - Filesystem in USErspace (utilities)
-gpgv-udeb - minimal signature verification tool
-gptsync-udeb - GPT and MBR partition tables synchronisation tool
-gtk2-engines-udeb - theme engines for GTK+ 2.x in the Debian installer
-hdparm-udeb - tune hard disk parameters for high performance
-iso-scan - Scan hard drives for an installer ISO image
-jfsutils-udeb - A stripped-down version of jfsutils, for debian-installer
-kbd-udeb - Linux console keyboard setup utilities
-klibc-utils-floppy-udeb - small utilities built with klibc for the boot floppy
-libatk1.0-udeb - The ATK accessibility toolkit
-libavahi-common3-udeb - Avahi common library (debian-installer)
-libavahi-core6-udeb - Avahi's embeddable mDNS/DNS-SD library (debian-installer)
-libblkid1-udeb - block device id library
-libc6-udeb - GNU C Library: Shared libraries - udeb
-libcairo-directfb2-udeb - The Cairo 2D vector graphics library DirectFB build
-libcrypto0.9.8-udeb - crypto shared library - udeb
-libdebconfclient0-udeb - Debian Configuration Management System (C-implementation)
-libdebian-installer4-udeb - Library of common debian-installer functions
-libdevmapper1.02.1-udeb - The Linux Kernel Device Mapper userspace library
-libdirectfb-1.2-0-udeb - direct frame buffer graphics - shared libraries
-libdmraid1.0.0.rc15-udeb - Device-Mapper Software RAID support tool - shared library (udeb)
-libexpat1-udeb - XML parsing C library - runtime library
-libfreetype6-udeb - FreeType 2 font engine for the debian-installer
-libfribidi0-udeb - Free Implementation of the Unicode BiDi algorithm
-libfuse2-udeb - Filesystem in USErspace library
-libgcrypt11-udeb - LGPL Crypto library - runtime library
-libglib2.0-udeb - The GLib library of C routines - minimal runtime
-libgpg-error0-udeb - library for common error values and messages in GnuPG components
-libgtk-directfb-2.0-0-udeb - The GTK+ graphical user interface library - minimal runtime
-libiw29-udeb - Tools for manipulating Linux Wireless Extensions
-libklibc-udeb - minimal libc subset for use with initramfs
-libnss-dns-udeb - GNU C Library: NSS helper for DNS - udeb
-libnss-files-udeb - GNU C Library: NSS helper for files - udeb
-libntfs-3g54-udeb - ntfs-3g filesystem in userspace (FUSE) library
-libpango1.0-udeb - Layout and rendering of internationalized text - minimal runtime
-libparted1.8-udeb - The GNU Parted disk partitioning shared library
-libpcre3-udeb - Perl 5 Compatible Regular Expression Library - runtime files (udeb)
-libpixman-1-0-udeb - pixel-manipulation library for X and cairo
-libpng12-0-udeb - PNG library - minimal runtime library
-libpopt0-udeb - lib for parsing cmdline parameters
-libslang2-udeb - S-Lang library for Debian Installer
-libsysfs2-udeb - interface library to sysfs
-libtextwrap1-udeb - text-wrapping library with i18n - runtime udeb
-libusb-0.1-udeb - userspace USB programming library
-libuuid1-udeb - stripped down universally unique id library, for debian-installer
-libvte9-udeb - Terminal emulator widget for GTK+ 2.0 - minimal runtime
-libxml2-udeb - GNOME XML library
-lsb-release-udeb - LSB release information
-ltsp-client-builder - Build an LTSP environment in the installer target
-lvm2-udeb - The Linux Logical Volume Manager
-mdadm-udeb - tool to administer Linux MD arrays (software RAID)
-mii-diag-udeb - A little tool to manipulate network cards
-mkreiserfs-udeb - User-level tools for ReiserFS filesystems
-module-init-tools-udeb - tools for managing Linux kernel modules
-nano-udeb - free curses-based text editor, inspired by Pico - udeb
-ntfs-3g-udeb - read-write NTFS driver for FUSE
-ntfsprogs-udeb - Tools for doing neat things in NTFS partitions from Linux - udeb
-oem-config-udeb - Prepare for OEM configuration
-oldsys-preseed - Preseed debian-installer from an existing device
-open-iscsi-udeb - Configure iSCSI
-openssh-client-udeb - secure shell client for the Debian installer
-openssh-server-udeb - secure shell server for the Debian installer
-os-prober-udeb - utility to detect other OSes on a set of drives
-parted-udeb - Manually partition a hard drive (parted)
-partman-partitioning - Partitioning operations for partman
-partman-target - Provides partman with ability to prepare /target
-pciutils-udeb - Linux PCI Utilities (udeb)
-pcmciautils-udeb - PCMCIA utilities for Linux 2.6
-ppp-udeb - Point-to-Point Protocol (PPP) - package for Debian Installer
-rdate-udeb - sets the system's date from a remote host
-redboot-tools-udeb - Collection of utilities to manipulate RedBoot data (udeb)
-reiserfsprogs-udeb - User-level tools for ReiserFS filesystems
-strace-udeb - A system call tracer
-ttf-cjk-compact-udeb - Shrinked CJK TrueType fonts for GUI d-i.
-ttf-dejavu-mono-udeb - Monospace Vera font family derivate with additional characters
-ttf-dejavu-udeb - Vera font family derivate with additional characters
-ttf-farsiweb-udeb - Farsiweb TrueType fonts for the graphical installer
-ttf-freefont-udeb - Freefont Sans fonts for the graphical installer
-ttf-khmeros-udeb - Debian-Installer font for the Khmer language of Cambodia
-ttf-malayalam-fonts-udeb - Free TrueType fonts for the Malayalam language
-ttf-sil-abyssinica-udeb - Debian-Installer font for the Ethiopic script (Amharic)
-ttf-tamil-fonts-udeb - Free TrueType fonts for the Tamil language
-ttf-thai-tlwg-udeb - Thai fonts in TrueType format for D-I use
-ttf-tmuni-udeb - font for Tibetan, Dzongkha and Ladakhi (OpenType Unicode)
-tzsetup-udeb - choose time zone
-ubuntu-keyring-udeb - GnuPG keys of the Ubuntu archive
-udev-udeb - rule-based device node and kernel event manager
-usbutils-udeb - Linux USB utilities
-user-setup-udeb - Set up users and passwords
-util-linux-udeb - Miscellaneous system utilities
-wireless-tools-udeb - Tools for manipulating Linux Wireless Extensions
-xfsprogs-udeb - A stripped-down version of xfsprogs, for debian-installer
-zlib1g-udeb - compression library - runtime for Debian installer
-kernel-wedge - constructor del paquete udeb para el instalador de Debian
-reprepro - Debian package repository producer
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh
index 73873e87..24b8c403 100755
--- a/installer/opengnsys_installer.sh
+++ b/installer/opengnsys_installer.sh
@@ -7,12 +7,18 @@
-#### AVISO: Editar configuración de acceso por defecto
+#### AVISO: Editar configuración de acceso por defecto a la Base de Datos.
MYSQL_ROOT_PASSWORD="passwordroot" # Clave root de MySQL
OPENGNSYS_DATABASE="ogAdmBD" # Nombre de la base datos
OPENGNSYS_DB_USER="usuog" # Usuario de acceso
OPENGNSYS_DB_PASSWD="passusuog" # Clave del usuario
+#### AVISO: NO EDITAR.
+#### configuración de acceso smb para clientes OG.
+OPENGNSYS_CLIENT_USER="opengnsys" # Nombre del usuario
+OPENGNSYS_CLIENT_PASSWD="og" # Clave del usuario opengnsys
+
+
# Sólo ejecutable por usuario root
if [ "$(whoami)" != 'root' ]
@@ -21,13 +27,24 @@ then
exit 1
fi
+# Detectar sistema operativo del servidor (debe soportar LSB).
+OSDISTRIB=$(lsb_release -is 2>/dev/null)
+# Array con las dependencias que deben estar instaladas, según de la distribución detectada.
+case "$OSDISTRIB" in
+ Ubuntu) DEPENDENCIES=( subversion apache2 php5 libapache2-mod-php5 mysql-server php5-mysql nfs-kernel-server dhcp3-server bittorrent tftp-hpa tftpd-hpa syslinux openbsd-inetd update-inetd build-essential g++-multilib libmysqlclient15-dev wget doxygen graphviz bittornado ctorrent samba unzip netpipes debootstrap schroot squashfs-tools )
+ ;;
+ *) echo "ERROR: Distribution not supported by OpenGnSys."
+ exit 1 ;;
+esac
+
# Comprobar si se ha descargado el paquete comprimido (USESVN=0) o sólo el instalador (USESVN=1).
PROGRAMDIR=$(readlink -e $(dirname "$0"))
+OPENGNSYS_SERVER="www.opengnsys.es"
if [ -d "$PROGRAMDIR/../installer" ]; then
USESVN=0
else
USESVN=1
- SVN_URL=http://www.opengnsys.es/svn/trunk
+ SVN_URL="http://$OPENGNSYS_SERVER/svn/trunk/"
fi
WORKDIR=/tmp/opengnsys_installer
@@ -36,9 +53,6 @@ mkdir -p $WORKDIR
INSTALL_TARGET=/opt/opengnsys
LOG_FILE=/tmp/opengnsys_installation.log
-# Array con las dependencias
-DEPENDENCIES=( subversion apache2 php5 libapache2-mod-php5 mysql-server php5-mysql nfs-kernel-server dhcp3-server udpcast bittorrent tftp-hpa tftpd-hpa syslinux openbsd-inetd update-inetd build-essential g++-multilib libmysqlclient15-dev wget doxygen graphviz bittornado ctorrent )
-
# Base de datos
OPENGNSYS_DB_CREATION_FILE=opengnsys/admin/Database/ogAdmBD.sql
@@ -48,13 +62,13 @@ OPENGNSYS_DB_CREATION_FILE=opengnsys/admin/Database/ogAdmBD.sql
#####################################################################
function getDateTime()
{
- echo `date +%Y%m%d-%H%M%S`
+ date "+%Y%m%d-%H%M%S"
}
# Escribe a fichero y muestra por pantalla
function echoAndLog()
{
- echo $1
+ echo "$1"
FECHAHORA=`getDateTime`
echo "$FECHAHORA;$SSH_CLIENT;$1" >> $LOG_FILE
}
@@ -162,10 +176,10 @@ function checkDependencies()
function installDependencies()
{
if [ $# -ne 1 ]; then
- errorAndLog "installDependencies(): invalid number of parameters"
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
exit 1
fi
- echoAndLog "installDependencies(): installing uncompleted dependencies"
+ echoAndLog "${FUNCNAME}(): installing uncompleted dependencies"
# copia local del array del parametro 1
local deps
@@ -178,22 +192,22 @@ function installDependencies()
done
if [ -z "${string_deps}" ]; then
- errorAndLog "installDependencies(): array of dependeces is empty"
+ errorAndLog "${FUNCNAME}(): array of dependeces is empty"
exit 1
fi
OLD_DEBIAN_FRONTEND=$DEBIAN_FRONTEND
export DEBIAN_FRONTEND=noninteractive
- echoAndLog "installDependencies(): now ${string_deps} will be installed"
+ echoAndLog "${FUNCNAME}(): now ${string_deps} will be installed"
apt-get -y install --force-yes ${string_deps}
if [ $? -ne 0 ]; then
- errorAndLog "installDependencies(): error installing dependencies"
+ errorAndLog "${FUNCNAME}(): error installing dependencies"
return 1
fi
DEBIAN_FRONTEND=$OLD_DEBIAN_FRONTEND
- echoAndLog "installDependencies(): dependencies installed"
+ echoAndLog "${FUNCNAME}(): dependencies installed"
}
# Hace un backup del fichero pasado por parámetro
@@ -234,23 +248,24 @@ function backupFile()
function mysqlSetRootPassword()
{
if [ $# -ne 1 ]; then
- errorAndLog "mysqlSetRootPassword(): invalid number of parameters"
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
exit 1
fi
- local root_mysql=$1
- echoAndLog "mysqlSetRootPassword(): setting root password in MySQL server"
- /usr/bin/mysqladmin -u root password ${root_mysql}
+ local root_mysql="$1"
+ echoAndLog "${FUNCNAME}(): setting root password in MySQL server"
+ mysqladmin -u root password "$root_mysql"
if [ $? -ne 0 ]; then
- errorAndLog "mysqlSetRootPassword(): error while setting root password in MySQL server"
+ errorAndLog "${FUNCNAME}(): error while setting root password in MySQL server"
return 1
fi
- echoAndLog "mysqlSetRootPassword(): root password saved!"
+ echoAndLog "${FUNCNAME}(): root password saved!"
return 0
}
# Si el servicio mysql esta ya instalado cambia la variable de la clave del root por la ya existente
-function mysqlGetRootPassword(){
+function mysqlGetRootPassword()
+{
local pass_mysql
local pass_mysql2
# Comprobar si MySQL está instalado con la clave de root por defecto.
@@ -258,19 +273,18 @@ function mysqlGetRootPassword(){
echoAndLog "${FUNCNAME}(): Using default mysql root password."
else
stty -echo
- echo "Existe un servicio mysql ya instalado"
- read -p "Insertar clave de root de Mysql: " pass_mysql
+ echo "There is a MySQL service already installed."
+ read -p "Enter MySQL root password: " pass_mysql
echo ""
- read -p "Confirmar clave:" pass_mysql2
+ read -p "Confrim password:" pass_mysql2
echo ""
stty echo
if [ "$pass_mysql" == "$pass_mysql2" ] ;then
- MYSQL_ROOT_PASSWORD=$pass_mysql
- echo "La clave es: ${MYSQL_ROOT_PASSWORD}"
+ MYSQL_ROOT_PASSWORD="$pass_mysql"
return 0
else
- echo "Las claves no coinciden no se configura la clave del servidor de base de datos."
- echo "las operaciones con la base de datos daran error"
+ echo "The keys don't match. Do not configure the server's key,"
+ echo "transactions in the database will give error."
return 1
fi
fi
@@ -280,18 +294,18 @@ function mysqlGetRootPassword(){
function mysqlTestConnection()
{
if [ $# -ne 1 ]; then
- errorAndLog "mysqlTestConnection(): invalid number of parameters"
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
exit 1
fi
local root_password="${1}"
- echoAndLog "mysqlTestConnection(): checking connection to mysql..."
+ echoAndLog "${FUNCNAME}(): checking connection to mysql..."
echo "" | mysql -uroot -p"${root_password}"
if [ $? -ne 0 ]; then
- errorAndLog "mysqlTestConnection(): connection to mysql failed, check root password and if daemon is running!"
+ errorAndLog "${FUNCNAME}(): connection to mysql failed, check root password and if daemon is running!"
return 1
else
- echoAndLog "mysqlTestConnection(): connection success"
+ echoAndLog "${FUNCNAME}(): connection success"
return 0
fi
}
@@ -300,19 +314,19 @@ function mysqlTestConnection()
function mysqlDbExists()
{
if [ $# -ne 2 ]; then
- errorAndLog "mysqlDbExists(): invalid number of parameters"
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
exit 1
fi
local root_password="${1}"
local database=$2
- echoAndLog "mysqlDbExists(): checking if $database exists..."
+ echoAndLog "${FUNCNAME}(): checking if $database exists..."
echo "show databases" | mysql -uroot -p"${root_password}" | grep "^${database}$"
if [ $? -ne 0 ]; then
- echoAndLog "mysqlDbExists():database $database doesn't exists"
+ echoAndLog "${FUNCNAME}():database $database doesn't exists"
return 1
else
- echoAndLog "mysqlDbExists():database $database exists"
+ echoAndLog "${FUNCNAME}():database $database exists"
return 0
fi
}
@@ -320,24 +334,24 @@ function mysqlDbExists()
function mysqlCheckDbIsEmpty()
{
if [ $# -ne 2 ]; then
- errorAndLog "mysqlCheckDbIsEmpty(): invalid number of parameters"
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
exit 1
fi
local root_password="${1}"
local database=$2
- echoAndLog "mysqlCheckDbIsEmpty(): checking if $database is empty..."
+ echoAndLog "${FUNCNAME}(): checking if $database is empty..."
num_tablas=`echo "show tables" | mysql -uroot -p"${root_password}" "${database}" | wc -l`
if [ $? -ne 0 ]; then
- errorAndLog "mysqlCheckDbIsEmpty(): error executing query, check database and root password"
+ errorAndLog "${FUNCNAME}(): error executing query, check database and root password"
exit 1
fi
if [ $num_tablas -eq 0 ]; then
- echoAndLog "mysqlCheckDbIsEmpty():database $database is empty"
+ echoAndLog "${FUNCNAME}():database $database is empty"
return 0
else
- echoAndLog "mysqlCheckDbIsEmpty():database $database has tables"
+ echoAndLog "${FUNCNAME}():database $database has tables"
return 1
fi
@@ -402,20 +416,20 @@ function mysqlCreateDb()
function mysqlCheckUserExists()
{
if [ $# -ne 2 ]; then
- errorAndLog "mysqlCheckUserExists(): invalid number of parameters"
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
exit 1
fi
local root_password="${1}"
local userdb=$2
- echoAndLog "mysqlCheckUserExists(): checking if $userdb exists..."
+ echoAndLog "${FUNCNAME}(): checking if $userdb exists..."
echo "select user from user where user='${userdb}'\\G" |mysql -uroot -p"${root_password}" mysql | grep user
if [ $? -ne 0 ]; then
- echoAndLog "mysqlCheckUserExists(): user doesn't exists"
+ echoAndLog "${FUNCNAME}(): user doesn't exists"
return 1
else
- echoAndLog "mysqlCheckUserExists(): user already exists"
+ echoAndLog "${FUNCNAME}(): user already exists"
return 0
fi
@@ -425,7 +439,7 @@ function mysqlCheckUserExists()
function mysqlCreateAdminUserToDb()
{
if [ $# -ne 4 ]; then
- errorAndLog "mysqlCreateAdminUserToDb(): invalid number of parameters"
+ errorAndLog "${FUNCNAME}(): invalid number of parameters"
exit 1
fi
@@ -434,7 +448,7 @@ function mysqlCreateAdminUserToDb()
local userdb=$3
local passdb=$4
- echoAndLog "mysqlCreateAdminUserToDb(): creating admin user ${userdb} to database ${database}"
+ echoAndLog "${FUNCNAME}(): creating admin user ${userdb} to database ${database}"
cat > $WORKDIR/create_${database}.sql <<EOF
GRANT USAGE ON *.* TO '${userdb}'@'localhost' IDENTIFIED BY '${passdb}' ;
@@ -443,11 +457,11 @@ FLUSH PRIVILEGES ;
EOF
mysql -u root --password=${root_password} < $WORKDIR/create_${database}.sql
if [ $? -ne 0 ]; then
- errorAndLog "mysqlCreateAdminUserToDb(): error while creating user in mysql"
+ errorAndLog "${FUNCNAME}(): error while creating user in mysql"
rm -f $WORKDIR/create_${database}.sql
return 1
else
- echoAndLog "mysqlCreateAdminUserToDb(): user created ok"
+ echoAndLog "${FUNCNAME}(): user created ok"
rm -f $WORKDIR/create_${database}.sql
return 0
fi
@@ -483,6 +497,14 @@ function svnExportCode()
### Detectar red
############################################################
+# Comprobar si existe conexión.
+function checkNetworkConnection()
+{
+ OPENGNSYS_SERVER=${OPENGNSYS_SERVER:-"www.opengnsys.es"}
+ wget --spider -q $OPENGNSYS_SERVER
+}
+
+# Obtener los parámetros de red de la interfaz por defecto.
function getNetworkSettings()
{
# Variables globales definidas:
@@ -527,8 +549,9 @@ function getNetworkSettings()
### Esqueleto para el Servicio pxe y contenedor tftpboot ###
############################################################
-function tftpConfigure() {
- echo "Configurando el servicio tftp"
+function tftpConfigure()
+{
+ echoAndLog "${FUNCNAME}(): Configuring TFTP service."
basetftp=/var/lib/tftpboot
# reiniciamos demonio internet ????? porque ????
@@ -540,11 +563,16 @@ function tftpConfigure() {
# prepamos el directorio de la configuracion de pxe
mkdir -p ${basetftp}/pxelinux.cfg
cat > ${basetftp}/pxelinux.cfg/default <<EOF
-DEFAULT pxe
-
-LABEL pxe
-KERNEL linux
-APPEND initrd=initrd.gz ip=dhcp ro vga=788 irqpoll acpi=on
+DEFAULT syslinux/vesamenu.c32
+MENU TITLE Aplicacion GNSYS
+
+LABEL 1
+MENU LABEL 1
+KERNEL syslinux/chain.c32
+APPEND hd0
+
+PROMPT 0
+TIMEOUT 10
EOF
# comprobamos el servicio tftp
sleep 1
@@ -553,13 +581,15 @@ EOF
chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP ${basetftp}
}
-function testPxe () {
+function testPxe ()
+{
+ echoAndLog "${FUNCNAME}(): Checking TFTP service... please wait."
cd /tmp
- echo "comprobando servicio pxe ..... Espere"
- tftp -v localhost -c get pxelinux.0 /tmp/pxelinux.0 && echo "servidor tftp OK" || echo "servidor tftp KO"
+ tftp -v localhost -c get pxelinux.0 /tmp/pxelinux.0 && echoAndLog "TFTP service is OK." || errorAndLog "TFTP service is down."
cd /
}
+
########################################################################
## Configuracion servicio NFS
########################################################################
@@ -589,6 +619,12 @@ function nfsConfigure()
return 1
fi
+ nfsAddExport /var/lib/tftpboot ${NETIP}/${NETMASK}:ro,no_subtree_check,no_root_squash,sync
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while adding second filesystem for the pxe ogclient"
+ return 1
+ fi
+
/etc/init.d/nfs-kernel-server restart
exportfs -va
@@ -655,6 +691,37 @@ function nfsAddExport()
return 0
}
+
+########################################################################
+## Configuracion servicio Samba
+########################################################################
+function smbConfigure()
+{
+ echoAndLog "${FUNCNAME}(): Configuring Samba service."
+
+ backupFile /etc/samba/smb.conf
+
+ # Copiar plantailla de recursos para OpenGnSys
+ sed -e "s/OPENGNSYSDIR/${INSTALL_TARGET//\//\\/}/g" \
+ $WORKDIR/opengnsys/server/etc/smb-og.conf.tmpl > /etc/samba/smb-og.conf
+ # Configurar y recargar Samba"
+ perl -pi -e "s/WORKGROUP/OPENGNSYS/; s/server string \=.*/server string \= OpenGnSys Samba Server/; s/^\; *include \=.*$/ include \= \/etc\/samba\/smb-og.conf/" /etc/samba/smb.conf
+ /etc/init.d/smbd restart
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while configure Samba"
+ return 1
+ fi
+ # Crear usuario de acceso a los recursos y establecer permisos.
+ useradd $OPENGNSYS_CLIENT_USER 2>/dev/null
+ echo -ne "$OPENGNSYS_CLIENT_PASSWD\n$OPENGNSYS_CLIENT_PASSWD\n" | smbpasswd -a -s $OPENGNSYS_CLIENT_USER
+ chmod -R 775 $INSTALL_TARGET/{log/clients,images,tftpboot/pxelinux.cfg}
+ chown -R :$OPENGNSYS_CLIENT_USER $INSTALL_TARGET/{log/clients,images,tftpboot/pxelinux.cfg}
+
+ echoAndLog "${FUNCNAME}(): Added Samba configuration."
+ return 0
+}
+
+
########################################################################
## Configuracion servicio DHCP
########################################################################
@@ -671,7 +738,7 @@ function dhcpConfigure()
-e "s/NETBROAD/$NETBROAD/g" \
-e "s/ROUTERIP/$ROUTERIP/g" \
-e "s/DNSIP/$DNSIP/g" \
- $WORKDIR/opengnsys/server/DHCP/dhcpd.conf > /etc/dhcp3/dhcpd.conf
+ $WORKDIR/opengnsys/server/etc/dhcpd.conf.tmpl > /etc/dhcp3/dhcpd.conf
if [ $? -ne 0 ]; then
errorAndLog "${FUNCNAME}(): error while configuring dhcp server"
return 1
@@ -697,6 +764,8 @@ function installWebFiles()
exit 1
fi
find $INSTALL_TARGET/www -name .svn -type d -exec rm -fr {} \; 2>/dev/null
+ # Descomprimir XAJAX.
+ unzip $WORKDIR/opengnsys/admin/xajax_0.5_standard.zip -d $INSTALL_TARGET/www/xajax
# Cambiar permisos para ficheros especiales.
chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/www/images/iconos
echoAndLog "${FUNCNAME}(): Web files installed successfully."
@@ -748,6 +817,7 @@ EOF
fi
}
+
# Crear documentación Doxygen para la consola web.
function makeDoxygenFiles()
{
@@ -799,7 +869,8 @@ function openGnsysInstallCreateDirs()
}
# Copia ficheros de configuración y ejecutables genéricos del servidor.
-function openGnsysCopyServerFiles () {
+function openGnsysCopyServerFiles ()
+{
if [ $# -ne 1 ]; then
errorAndLog "${FUNCNAME}(): invalid number of parameters"
exit 1
@@ -807,25 +878,15 @@ function openGnsysCopyServerFiles () {
local path_opengnsys_base=$1
- local SOURCES=( client/boot/initrd-generator \
- client/boot/upgrade-clients-udeb.sh \
- client/boot/udeblist.conf \
- client/boot/udeblist-jaunty.conf \
- client/boot/udeblist-karmic.conf \
- client/boot/udeblist-lucid.conf \
- client/boot/udeblist-maverick.conf \
- server/PXE/pxelinux.cfg \
+ # No se copian los ficheros del cliente antiguo:
+ # - client/boot/initrd-generator ==> /opt/opengnsys/bin
+ # - client/boot/upgrade-clients-udeb.sh ==> /opt/opengnsys/bin
+ # - client/boot/udeblist*.conf ==> /opt/opengnsys/etc
+ local SOURCES=( server/tftpboot/pxelinux.cfg \
server/bin \
repoman/bin \
doc )
- local TARGETS=( bin/initrd-generator \
- bin/upgrade-clients-udeb.sh \
- etc/udeblist.conf \
- etc/udeblist-jaunty.conf \
- etc/udeblist-karmic.conf \
- etc/udeblist-lucid.conf \
- etc/udeblist-maverick.conf \
- tftpboot/pxelinux.cfg \
+ local TARGETS=( tftpboot/pxelinux.cfg \
bin \
bin \
doc )
@@ -892,7 +953,7 @@ function servicesCompilation ()
# Compilar OpenGnSys Client
echoAndLog "${FUNCNAME}(): Compiling OpenGnSys Admin Client"
pushd $WORKDIR/opengnsys/admin/Sources/Clients/ogAdmClient
- make && mv ogAdmClient ../../../../client/nfsexport/bin
+ make && mv ogAdmClient ../../../../client/shared/bin
if [ $? -ne 0 ]; then
echoAndLog "${FUNCNAME}(): error while compiling OpenGnSys Admin Client"
hayErrores=1
@@ -907,7 +968,7 @@ function servicesCompilation ()
####################################################################
# Copiar carpeta de Interface
-function InterfaceAdm ()
+function copyInterfaceAdm ()
{
local hayErrores=0
@@ -918,6 +979,8 @@ function InterfaceAdm ()
echoAndLog "${FUNCNAME}(): error while copying Administration Interface Folder"
hayErrores=1
fi
+ chown $OPENGNSYS_CLIENT_USER:$OPENGNSYS_CLIENT_USER $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
+ chmod 700 $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
return $hayErrores
}
@@ -926,25 +989,46 @@ function InterfaceAdm ()
### Funciones instalacion cliente opengnsys
####################################################################
-function openGnsysClientCreate()
+function openGnsysCopyClientFiles()
{
- local OSDISTRIB OSCODENAME
-
local hayErrores=0
echoAndLog "${FUNCNAME}(): Copying OpenGnSys Client files."
- cp -ar $WORKDIR/opengnsys/client/nfsexport/* $INSTALL_TARGET/client
- find $INSTALL_TARGET/client -name .svn -type d -exec rm -fr {} \; 2>/dev/null
+ cp -ar $WORKDIR/opengnsys/client/shared/* $INSTALL_TARGET/client
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while copying client estructure"
+ hayErrores=1
+ fi
+ find $INSTALL_TARGET/client -name .svn -type d -exec rm -fr {} \; 2>/dev/null
+
echoAndLog "${FUNCNAME}(): Copying OpenGnSys Cloning Engine files."
- mkdir -p $INSTALL_TARGET/client/lib/engine/bin
- cp -ar $WORKDIR/opengnsys/client/engine/*.lib $INSTALL_TARGET/client/lib/engine/bin
+ mkdir -p $INSTALL_TARGET/client/lib/engine/bin
+ cp -ar $WORKDIR/opengnsys/client/engine/*.lib $INSTALL_TARGET/client/lib/engine/bin
if [ $? -ne 0 ]; then
errorAndLog "${FUNCNAME}(): error while copying engine files"
hayErrores=1
fi
+
+ if [ $hayErrores -eq 0 ]; then
+ echoAndLog "${FUNCNAME}(): client copy files success."
+ else
+ errorAndLog "${FUNCNAME}(): client copy files with errors"
+ fi
+
+ return $hayErrores
+}
+
+
+
+
+# Crear antiguo cliente initrd para OpenGnSys 0.10
+function openGnsysOldClientCreate()
+{
+ local OSCODENAME
+
+ local hayErrores=0
# Cargar Kernel, Initrd y paquetes udeb para la distribución del servidor (o por defecto).
- OSDISTRIB=$(lsb_release -is 2>/dev/null)
OSCODENAME=$(lsb_release -cs 2>/dev/null)
if [ "$OSDISTRIB" = "Ubuntu" -a -n "$OSCODENAME" ]; then
echoAndLog "${FUNCNAME}(): Loading Kernel and Initrd files for $OSDISTRIB $OSCODENAME."
@@ -975,24 +1059,53 @@ function openGnsysClientCreate()
fi
if [ $hayErrores -eq 0 ]; then
- echoAndLog "${FUNCNAME}(): Client generation success."
+ echoAndLog "${FUNCNAME}(): Old client generation success."
else
- errorAndLog "${FUNCNAME}(): Client generation with errors"
+ errorAndLog "${FUNCNAME}(): Old client generation with errors"
fi
return $hayErrores
}
+# Crear nuevo cliente OpenGnSys 1.0
+function openGnsysClientCreate()
+{
+ local DOWNLOADURL=http://www.opengnsys.es/downloads
+ local FILENAME=ogclient-1.0.1-lucid-32bit.tar.gz
+ local TMPFILE=/tmp/$FILENAME
+
+ echoAndLog "${FUNCNAME}(): Loading Client"
+ # Descargar y descomprimir cliente ogclient
+ wget $DOWNLOADURL/$FILENAME -O $TMPFILE
+ if [ ! -s $TMPFILE ]; then
+ errorAndLog "${FUNCNAME}(): Error loading OpenGnSys Client"
+ return 1
+ fi
+ echoAndLog "${FUNCNAME}(): Extranting Client files"
+ tar xzvf $TMPFILE -C $INSTALL_TARGET/tftpboot
+ rm -f $TMPFILE
+ # Usar la versión más reciente del Kernel y del Initrd para el cliente.
+ ln -f $(ls $INSTALL_TARGET/tftpboot/ogclient/vmlinuz-*|tail -1) $INSTALL_TARGET/tftpboot/ogclient/ogvmlinuz
+ ln -f $(ls $INSTALL_TARGET/tftpboot/ogclient/initrd.img-*|tail -1) $INSTALL_TARGET/tftpboot/ogclient/oginitrd.img
+ # Establecer los permisos.
+ chmod -R 755 $INSTALL_TARGET/tftpboot/ogclient
+ chown -R :$OPENGNSYS_CLIENT_USER $INSTALL_TARGET/tftpboot/ogclient
+ echoAndLog "${FUNCNAME}(): Client generation success"
+}
+
+
# Configuración básica de servicios de OpenGnSys
function openGnsysConfigure()
{
echoAndLog "${FUNCNAME}(): Copying init files."
cp -p $WORKDIR/opengnsys/admin/Sources/Services/opengnsys.init /etc/init.d/opengnsys
cp -p $WORKDIR/opengnsys/admin/Sources/Services/opengnsys.default /etc/default/opengnsys
+ cp -p $WORKDIR/opengnsys/admin/Sources/Services/ogAdmRepoAux /opt/opengnsys/sbin/
update-rc.d opengnsys defaults
echoAndLog "${FUNCNAME}(): Creating cron files."
echo "* * * * * root [ -x $INSTALL_TARGET/bin/torrent-creator ] && $INSTALL_TARGET/bin/torrent-creator" > /etc/cron.d/torrentcreator
+ echo "5 * * * * root [ -x $INSTALL_TARGET/bin/torrent-tracker ] && $INSTALL_TARGET/bin/torrent-tracker" > /etc/cron.d/torrenttracker
echoAndLog "${FUNCNAME}(): Creating OpenGnSys config file in \"$INSTALL_TARGET/etc\"."
perl -pi -e "s/SERVERIP/$SERVERIP/g; s/DBUSER/$OPENGNSYS_DB_USER/g; s/DBPASSWORD/$OPENGNSYS_DB_PASSWD/g; s/DATABASE/$OPENGNSYS_DATABASE/g" $INSTALL_TARGET/etc/ogAdmServer.cfg
perl -pi -e "s/SERVERIP/$SERVERIP/g" $INSTALL_TARGET/etc/ogAdmRepo.cfg
@@ -1014,16 +1127,17 @@ function openGnsysConfigure()
####### Función de resumen informativo de la instalación
#####################################################################
-function installationSummary(){
+function installationSummary()
+{
echo
echoAndLog "OpenGnSys Installation Summary"
echo "=============================="
echoAndLog "Project version: $(cat $INSTALL_TARGET/doc/VERSION.txt 2>/dev/null)"
echoAndLog "Installation directory: $INSTALL_TARGET"
echoAndLog "Repository directory: $INSTALL_TARGET/images"
- echoAndLog "TFTP configuracion directory: /var/lib/tftpboot"
- echoAndLog "DHCP configuracion file: /etc/dhcp3/dhcpd.conf"
- echoAndLog "NFS configuracion file: /etc/exports"
+ echoAndLog "DHCP configuration file: /etc/dhcp3/dhcpd.conf"
+ echoAndLog "TFTP configuration directory: /var/lib/tftpboot"
+ echoAndLog "Samba configuration directory: /etc/samba"
echoAndLog "Web Console URL: $OPENGNSYS_CONSOLEURL"
echoAndLog "Web Console admin user: $OPENGNSYS_DB_USER"
echoAndLog "Web Console admin password: $OPENGNSYS_DB_PASSWD"
@@ -1048,16 +1162,24 @@ echo
echoAndLog "OpenGnSys installation begins at $(date)"
pushd $WORKDIR
-# Detener servicios de OpenGnSys, si están activos previamente.
-[ -f /etc/init.d/opengnsys ] && /etc/init.d/opengnsys stop
-
-# Detectar parámetros de red por defecto
+# Comprobar si hay conexión y detectar parámetros de red por defecto.
+checkNetworkConnection
+if [ $? -ne 0 ]; then
+ errorAndLog "Error connecting to server. Causes:"
+ errorAndLog " - Network is unreachable, review devices parameters."
+ errorAndLog " - You are inside a private network, configure the proxy service."
+ errorAndLog " - Server is temporally down, try agian later."
+ exit 1
+fi
getNetworkSettings
if [ $? -ne 0 ]; then
errorAndLog "Error reading default network settings."
exit 1
fi
+# Detener servicios de OpenGnSys, si están activos previamente.
+[ -f /etc/init.d/opengnsys ] && /etc/init.d/opengnsys stop
+
# Actualizar repositorios
apt-get update
@@ -1098,9 +1220,9 @@ if [ $? -ne 0 ]; then
fi
# Copiar carpeta Interface entre administración y motor de clonación.
-InterfaceAdm
+copyInterfaceAdm
if [ $? -ne 0 ]; then
- errorAndLog "Error while copying Interface Administration"
+ errorAndLog "Error while copying Administration Interface"
exit 1
fi
@@ -1108,9 +1230,17 @@ fi
tftpConfigure
# Configuración NFS
-nfsConfigure
+#### (descomentar las siguientes líneas para exportar servicios por NFS)
+#nfsConfigure
+#if [ $? -ne 0 ]; then
+# errorAndLog "Error while configuring nfs server!"
+# exit 1
+#fi
+
+# Configuración Samba
+smbConfigure
if [ $? -ne 0 ]; then
- errorAndLog "Error while configuring nfs server!"
+ errorAndLog "Error while configuring Samba server!"
exit 1
fi
@@ -1177,10 +1307,10 @@ else
# Si existe fichero ogBDAdmin-VersLocal-VersRepo.sql; aplicar cambios.
INSTVERSION=$(awk '{print $2}' $INSTALL_TARGET/doc/VERSION.txt)
REPOVERSION=$(awk '{print $2}' $WORKDIR/opengnsys/doc/VERSION.txt)
- OPENGNSYS_DB_UPDADE_FILE="opengnsys/admin/Database/$OPENGNSYS_DATABASE-$INSTVERSION-$REPOVERSION.sql"
- if [ -f $WORKDIR/$OPENGNSYS_DB_UPDADE_FILE ]; then
+ OPENGNSYS_DB_UPDATE_FILE="opengnsys/admin/Database/$OPENGNSYS_DATABASE-$INSTVERSION-$REPOVERSION.sql"
+ if [ -f $WORKDIR/$OPENGNSYS_DB_UPDATE_FILE ]; then
echoAndLog "Updating tables from version $INSTVERSION to $REPOVERSION"
- mysqlImportSqlFileToDb ${MYSQL_ROOT_PASSWORD} ${OPENGNSYS_DATABASE} $WORKDIR/$OPENGNSYS_DB_UPDADE_FILE
+ mysqlImportSqlFileToDb ${MYSQL_ROOT_PASSWORD} ${OPENGNSYS_DATABASE} $WORKDIR/$OPENGNSYS_DB_UPDATE_FILE
else
echoAndLog "Database unchanged."
fi
@@ -1200,10 +1330,24 @@ fi
popd
-# Creando la estructura del cliente
+
+# Crear la estructura de los accesos al servidor desde el cliente (shared)
+openGnsysCopyClientFiles
+if [ $? -ne 0 ]; then
+ errorAndLog "Error creating client structure"
+fi
+
+# Crear la estructura del antiguo cliente initrd de OpenGnSys 0.10
+#### (descomentar las siguientes líneas para generar cliente initrd)
+#openGnsysOldClientCreate
+#if [ $? -ne 0 ]; then
+# errorAndLog "Warning: cannot create old initrd client"
+#fi
+
+# Crear la estructura del cliente de OpenGnSys 1.0
openGnsysClientCreate
if [ $? -ne 0 ]; then
- errorAndLog "Error creating clients"
+ errorAndLog "Error creating client"
exit 1
fi
diff --git a/installer/opengnsys_uninstall.sh b/installer/opengnsys_uninstall.sh
index 74b3c8f5..d9d2d98d 100755
--- a/installer/opengnsys_uninstall.sh
+++ b/installer/opengnsys_uninstall.sh
@@ -45,9 +45,12 @@ for dir in $OPENGNSYS/*; do
fi
done
rm -f /etc/init.d/opengnsys /etc/default/opengnsys
+# Comentar recursos de OpenGnSys en Samba.
+perl -pi -e "s/^ *include \= \/etc\/samba\/smb-og.conf/\; include \= \/etc\/samba\/smb-og.conf/" /etc/samba/smb.conf
+/etc/init.d/smbd restart
# Tareas manuales a realizar después de desinstalar.
echo "Manual tasks:"
echo "- You may stop or uninstall manually all other services"
-echo " (DHCP, PXE, TFTP, NFS, Apache, MySQL)."
+echo " (DHCP, PXE, TFTP, NFS/Samba, Apache, MySQL)."
echo "- Delete repository directory \"$OPENGNSYS/$OGIMG\""
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh
index 2f5bdcd1..d4dc54cb 100755
--- a/installer/opengnsys_update.sh
+++ b/installer/opengnsys_update.sh
@@ -6,9 +6,21 @@
#@version 0.9 - basado en opengnsys_installer.sh
#@author Ramón Gómez - ETSII Univ. Sevilla
#@date 2010/01/27
+#@version 1.0 - adaptación a OpenGnSys 1.0
+#@author Ramón Gómez - ETSII Univ. Sevilla
+#@date 2011/03/02
#*/
+#### AVISO: Editar configuración de acceso por defecto a la Base de Datos.
+OPENGNSYS_DATABASE="ogAdmBD" # Nombre de la base datos
+OPENGNSYS_DBUSER="usuog" # Usuario de acceso
+OPENGNSYS_DBPASSWORD="passusuog" # Clave del usuario
+
+#### AVISO: NO Editar variables de acceso desde el cliente
+OPENGNSYS_CLIENTUSER="opengnsys" # Usuario Samba
+
+
# Sólo ejecutable por usuario root
if [ "$(whoami)" != 'root' ]
then
@@ -18,12 +30,13 @@ fi
# Comprobar si se ha descargado el paquete comprimido (USESVN=0) o sólo el instalador (USESVN=1).
PROGRAMDIR=$(readlink -e $(dirname "$0"))
-DEPS="rsync gcc ctorrent"
+DEPS="build-essential g++-multilib rsync ctorrent samba unzip netpipes debootstrap schroot squashfs-tools"
+OPENGNSYS_SERVER="www.opengnsys.es"
if [ -d "$PROGRAMDIR/../installer" ]; then
USESVN=0
else
USESVN=1
- SVN_URL=http://www.opengnsys.es/svn/trunk
+ SVN_URL="/http://$OPENGNSYS_SERVER/svn/trunk/"
DEPS="$DEPS subversion"
fi
@@ -38,9 +51,10 @@ LOG_FILE=/tmp/opengnsys_update.log
#####################################################################
####### Algunas funciones útiles de propósito general:
#####################################################################
+
function getDateTime()
{
- echo `date +%Y%m%d-%H%M%S`
+ date "+%Y%m%d-%H%M%S"
}
# Escribe a fichero y muestra por pantalla
@@ -80,7 +94,7 @@ function backupFile()
return 1
fi
- echoAndLog "${FUNCNAME}(): Making $fichero back-up"
+ echoAndLog "${FUNCNAME}(): Making $fichero back-up"
# realiza una copia de la última configuración como last
cp -p $fichero "${fichero}-LAST"
@@ -109,6 +123,46 @@ function restoreFile()
#####################################################################
+####### Funciones de acceso a base de datos
+#####################################################################
+
+# Actualizar la base datos
+function importSqlFile()
+{
+ if [ $# -ne 4 ]; then
+ errorAndLog "${FNCNAME}(): invalid number of parameters"
+ exit 1
+ fi
+
+ local dbuser="$1"
+ local dbpassword="$2"
+ local database="$3"
+ local sqlfile="$4"
+ local tmpfile=$(mktemp)
+ local status
+
+ if [ ! -r $sqlfile ]; then
+ errorAndLog "${FUNCNAME}(): Unable to read $sqlfile!!"
+ return 1
+ fi
+
+ echoAndLog "${FUNCNAME}(): importing SQL file to ${database}..."
+ chmod 600 $tmpfile
+ sed -e "s/SERVERIP/$SERVERIP/g" -e "s/DBUSER/$OPENGNSYS_DB_USER/g" \
+ -e "s/DBPASSWORD/$OPENGNSYS_DB_PASSWD/g" $sqlfile > $tmpfile
+ mysql -u$dbuser -p"$dbpassword" --default-character-set=utf8 "$database" < $tmpfile
+ status=$?
+ rm -f $tmpfile
+ if [ $status -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error importing $sqlfile in database $database"
+ return 1
+ fi
+ echoAndLog "${FUNCNAME}(): file imported to database $database"
+ return 0
+}
+
+
+#####################################################################
####### Funciones de instalación de paquetes
#####################################################################
@@ -129,7 +183,7 @@ function installDependencies ()
apt-get update && apt-get -y install --force-yes $INSTALLDEPS
if [ $? -ne 0 ]; then
errorAndLog "${FUNCNAME}(): cannot install some dependencies: $INSTALLDEPS."
- return 1
+ return 1
fi
fi
fi
@@ -165,11 +219,19 @@ function svnExportCode()
### Detectar red
############################################################
+# Comprobar si existe conexión.
+function checkNetworkConnection()
+{
+ OPENGNSYS_SERVER=${OPENGNSYS_SERVER:-"www.opengnsys.es"}
+ wget --spider -q $OPENGNSYS_SERVER
+}
+
+# Obtener los parámetros de red de la interfaz por defecto.
function getNetworkSettings()
{
local MAINDEV
- echoAndLog "getNetworkSettings(): Detecting default network parameters."
+ echoAndLog "$FUNCNAME(): Detecting default network parameters."
MAINDEV=$(ip -o link show up | awk '!/loopback/ {d=d$2} END {sub(/:.*/,"",d); print d}')
if [ -z "$MAINDEV" ]; then
errorAndLog "${FUNCNAME}(): Network device not detected."
@@ -195,7 +257,7 @@ function getNetworkSettings()
function updateServicesStart(){
echoAndLog "${FUNCNAME}(): Updating /etc/init.d/opengnsys ..."
- cp -p $WORKDIR/opengnsys/admin/Services/opengnsys.init /etc/init.d/opengnsys
+ cp -p $WORKDIR/opengnsys/admin/Sources/Services/opengnsys.init /etc/init.d/opengnsys
if [ $? != 0 ]; then
errorAndLog "${FUNCNAME}(): Error updating /etc/init.d/opengnsys"
exit 1
@@ -203,6 +265,34 @@ function updateServicesStart(){
echoAndLog "${FUNCNAME}(): /etc/init.d/opengnsys updated successfully."
}
+# Actualizar cliente OpenGnSys
+function updateClientFiles()
+{
+ local hayErrores=0
+
+ echoAndLog "${FUNCNAME}(): Updating OpenGnSys Client files."
+ rsync --exclude .svn -irplt $WORKDIR/opengnsys/client/shared/* $INSTALL_TARGET/client
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while updating client structure"
+ hayErrores=1
+ fi
+ find $INSTALL_TARGET/client -name .svn -type d -exec rm -fr {} \; 2>/dev/null
+
+ echoAndLog "${FUNCNAME}(): Updating OpenGnSys Cloning Engine files."
+ rsync --exclude .svn -irplt $WORKDIR/opengnsys/client/engine/*.lib $INSTALL_TARGET/client/lib/engine/bin
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): error while updating engine files"
+ hayErrores=1
+ fi
+
+ if [ $hayErrores -eq 0 ]; then
+ echoAndLog "${FUNCNAME}(): client files update success."
+ else
+ errorAndLog "${FUNCNAME}(): client files update with errors"
+ fi
+
+ return $hayErrores
+}
# Copiar ficheros del OpenGnSys Web Console.
function updateWebFiles()
{
@@ -213,17 +303,16 @@ function updateWebFiles()
rsync --exclude .svn -irplt $WORKDIR/opengnsys/admin/WebConsole $INSTALL_TARGET
ERRCODE=$?
mv $INSTALL_TARGET/WebConsole $INSTALL_TARGET/www
+ unzip -o $WORKDIR/opengnsys/admin/xajax_0.5_standard.zip -d $INSTALL_TARGET/www/xajax
if [ $ERRCODE != 0 ]; then
errorAndLog "${FUNCNAME}(): Error updating web files."
exit 1
fi
restoreFile $INSTALL_TARGET/www/controlacceso.php
# Cambiar permisos para ficheros especiales.
- chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP \
- $INSTALL_TARGET/www/includes \
- $INSTALL_TARGET/www/comandos/gestores/filescripts \
- $INSTALL_TARGET/www/images/iconos
+ chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/www/includes $INSTALL_TARGET/www/images/iconos
echoAndLog "${FUNCNAME}(): Web files updated successfully."
+
}
# Copiar carpeta de Interface
@@ -242,6 +331,8 @@ function updateInterfaceAdm ()
exit 1
fi
chmod -R +x $INSTALL_TARGET/client/interfaceAdm
+ chown $OPENGNSYS_CLIENTUSER:$OPENGNSYS_CLIENTUSER $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
+ chmod 700 $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
echoAndLog "${FUNCNAME}(): Admin interface updated successfully."
}
@@ -255,8 +346,9 @@ function makeDoxygenFiles()
errorAndLog "${FUNCNAME}(): unable to create Doxygen web files."
return 1
fi
+ rm -fr "$INSTALL_TARGET/www/api"
mv "$INSTALL_TARGET/www/html" "$INSTALL_TARGET/www/api"
- rm -fr $INSTALL_TARGET/www/{man,perlmod,rtf}
+ rm -fr $INSTALL_TARGET/www/{man,perlmod,rtf}
chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/www/api
echoAndLog "${FUNCNAME}(): Doxygen web files created successfully."
}
@@ -292,22 +384,11 @@ function createDirs()
# Copia ficheros de configuración y ejecutables genéricos del servidor.
function updateServerFiles () {
- local SOURCES=( client/boot/initrd-generator \
- client/boot/upgrade-clients-udeb.sh \
- client/boot/udeblist.conf \
- client/boot/udeblist-jaunty.conf \
- client/boot/udeblist-karmic.conf \
- client/boot/udeblist-lucid.conf \
- client/boot/udeblist-maverick.conf \
- repoman/bin \
+ # No copiar ficheros del antiguo cliente Initrd
+ local SOURCES=( repoman/bin \
+ server/bin \
doc )
- local TARGETS=( bin/initrd-generator \
- bin/upgrade-clients-udeb.sh \
- etc/udeblist.conf \
- etc/udeblist-jaunty.conf \
- etc/udeblist-karmic.conf \
- etc/udeblist-lucid.conf \
- etc/udeblist-maverick.conf \
+ local TARGETS=( bin \
bin \
doc )
@@ -320,7 +401,7 @@ function updateServerFiles () {
pushd $WORKDIR/opengnsys >/dev/null
local i
for (( i = 0; i < ${#SOURCES[@]}; i++ )); do
- rsync --exclude .svn -irplt "${SOURCES[$i]}" "${INSTALL_TARGET}/${TARGETS[$i]}"
+ rsync --exclude .svn -irplt "${SOURCES[$i]}" $(dirname "${INSTALL_TARGET}/${TARGETS[$i]}")
done
popd >/dev/null
echoAndLog "${FUNCNAME}(): updating cron files"
@@ -338,7 +419,7 @@ function recompileClient ()
# Compilar OpenGnSys Client
echoAndLog "${FUNCNAME}(): recompiling OpenGnSys Client"
pushd $WORKDIR/opengnsys/admin/Sources/Clients/ogAdmClient
- make && mv ogAdmClient ../../../client/nfsexport/bin
+ make && mv ogAdmClient $INSTALL_TARGET/client/bin
if [ $? -ne 0 ]; then
echoAndLog "${FUNCNAME}(): error while compiling OpenGnSys Client"
hayErrores=1
@@ -353,7 +434,8 @@ function recompileClient ()
### Funciones instalacion cliente opengnsys
####################################################################
-function updateClient()
+# Actualizar antiguo cliente Initrd.
+function updateOldClient()
{
local OSDISTRIB OSCODENAME
@@ -409,6 +491,31 @@ function updateClient()
return $hayErrores
}
+# Actualizar nuevo cliente para OpenGnSys 1.0
+function updateClient()
+{
+ local DOWNLOADURL=http://www.opengnsys.es/downloads
+ local FILENAME=ogclient-1.0.1-lucid-32bit.tar.gz
+ local TMPFILE=/tmp/$FILENAME
+
+ echoAndLog "${FUNCNAME}(): Loading Client"
+ # Descargar y descomprimir cliente ogclient
+ wget $DOWNLOADURL/$FILENAME -O $TMPFILE
+ if [ ! -s $TMPFILE ]; then
+ errorAndLog "${FUNCNAME}(): Error loading OpenGnSys Client"
+ return 1
+ fi
+ echoAndLog "${FUNCNAME}(): Extracting Client files"
+ tar xzvf $TMPFILE -C $INSTALL_TARGET/tftpboot
+ rm -f $TMPFILE
+ # Usar la versión más reciente del Kernel y del Initrd para el cliente.
+ ln -f $(ls $INSTALL_TARGET/tftpboot/ogclient/vmlinuz-*|tail -1) $INSTALL_TARGET/tftpboot/ogclient/ogvmlinuz
+ ln -f $(ls $INSTALL_TARGET/tftpboot/ogclient/initrd.img-*|tail -1) $INSTALL_TARGET/tftpboot/ogclient/oginitrd.img
+ # Establecer los permisos.
+ chmod -R 755 $INSTALL_TARGET/tftpboot/ogclient
+ chown -R :$OPENGNSYS_CLIENTUSER $INSTALL_TARGET/tftpboot/ogclient
+ echoAndLog "${FUNCNAME}(): Client update successfully"
+}
#####################################################################
@@ -427,7 +534,15 @@ fi
pushd $WORKDIR
-# Detectar parámetros de red por defecto
+# Comprobar si hay conexión y detectar parámetros de red por defecto.
+checkNetworkConnection
+if [ $? -ne 0 ]; then
+ errorAndLog "Error connecting to server. Causes:"
+ errorAndLog " - Network is unreachable, review devices parameters."
+ errorAndLog " - You are inside a private network, configure the proxy service."
+ errorAndLog " - Server is temporally down, try agian later."
+ exit 1
+fi
getNetworkSettings
if [ $? -ne 0 ]; then
errorAndLog "Error reading default network settings."
@@ -452,14 +567,29 @@ else
ln -fs "$(dirname $PROGRAMDIR)" opengnsys
fi
-# Copiando ficheros complementarios del servidor
+# Si existe fichero de actualización de la base de datos; aplicar cambios.
+INSTVERSION=$(awk '{print $2}' $INSTALL_TARGET/doc/VERSION.txt)
+REPOVERSION=$(awk '{print $2}' $WORKDIR/opengnsys/doc/VERSION.txt)
+OPENGNSYS_DBUPDATEFILE="$WORKDIR/opengnsys/admin/Database/$OPENGNSYS_DATABASE-$INSTVERSION-$REPOVERSION.sql"
+if [ -f $OPENGNSYS_DBUPDATEFILE ]; then
+ echoAndLog "Updating tables from version $INSTVERSION to $REPOVERSION"
+ importSqlFile $OPENGNSYS_DBUSER $OPENGNSYS_DBPASSWORD $OPENGNSYS_DATABASE $OPENGNSYS_DBUPDATEFILE
+else
+ echoAndLog "Database unchanged."
+fi
+
+# Actualizar ficheros complementarios del servidor
updateServerFiles
if [ $? -ne 0 ]; then
errorAndLog "Error updating OpenGnSys Server files"
exit 1
fi
-# Copiando paqinas web
+# Actualizar ficheros del cliente
+updateClientFiles
+updateInterfaceAdm
+
+# Actualizar páqinas web
updateWebFiles
if [ $? -ne 0 ]; then
errorAndLog "Error updating OpenGnSys Web Admin files"
@@ -470,20 +600,20 @@ makeDoxygenFiles
# Creando la estructura del cliente
recompileClient
+# NO se actualiza el antiguo cliente Initrd
+#updateOldClient
updateClient
if [ $? -ne 0 ]; then
errorAndLog "Error updating clients"
exit 1
fi
-updateInterfaceAdm
# Actualizamos el fichero que arranca los servicios de OpenGnSys
updateServicesStart
# Eliminamos el fichero de estado del tracker porque es incompatible entre los distintos paquetes
-if [ -r /tmp/dstate ]
-then
- rm /tmp/dstate
+if [ -f /tmp/dstate ]; then
+ rm -f /tmp/dstate
fi
#rm -rf $WORKDIR
diff --git a/repoman/bin/sendFileMcast b/repoman/bin/sendFileMcast
index ee934503..b1c124f1 100755
--- a/repoman/bin/sendFileMcast
+++ b/repoman/bin/sendFileMcast
@@ -19,7 +19,7 @@ if [ "$*" == "help" ]; then
fi
# Error si no se reciben 2 parámetros.
if [ $# -ne 2 ]; then
- echo "$PROG Error: Formato: $PROG fichero|nombreImagen datosMulticast" >&2
+ echo "$PROG Error: Formato: $PROG fichero|nombreImagen datosMulticast"
exit 1
fi
@@ -34,7 +34,7 @@ else
FICHIMG="$FICH"
fi
if [ ! -f "$FICHIMG" ]; then
- echo "$PROG Error: Fichero \"$FICH\" no accesible" >&2
+ echo "$PROG Error: Fichero \"$FICH\" no accesible"
exit 2
fi
@@ -50,8 +50,8 @@ PARAMS=$(echo $2 | \
')
read -e PORTBASE METHOD ADDRESS BITRATE NCLIENTS MAXTIME <<< $PARAMS
if [ -z "$MAXTIME" ]; then
- echo "$PROG Error: Datos de sesión incorrectos: \"$2\"" >&2
- exit 1
+ echo "$PROG Error: Datos de sesión incorrectos: \"$2\""
+ exit 3
fi
# Valores estandar no configurables.
@@ -59,5 +59,9 @@ CERROR="8x8/128"
# Envío de fichero por Multicast.
which mbuffer &> /dev/null && MBUFFER="--pipe 'mbuffer -m 20M'"
-udp-sender $MBUFFER --portbase $PORTBASE --$METHOD --mcast-data-address $ADDRESS --fec $CERROR --max-bitrate $BITRATE --ttl 1 --min-clients $NCLIENTS --max-wait $MAXTIME --file "$FICHIMG"
+##### ADV v. 1.0 23/02/2011
+#version 0.10 # udp-sender $MBUFFER --portbase $PORTBASE --$METHOD --mcast-data-address $ADDRESS --fec $CERROR --max-bitrate $BITRATE --ttl 1 --min-clients $NCLIENTS --max-wait $MAXTIME --file "$FICHIMG"
+#/opt/opengnsys/bin/udp-sender $MBUFFER --nokbd --retries-until-drop 65 --portbase $PORTBASE --$METHOD --mcast-data-address $ADDRESS --fec $CERROR --max-bitrate $BITRATE --ttl 1 --min-clients $NCLIENTS --max-wait $MAXTIME --file "$FICHIMG" --log /opt/opengnsys/log/ogAdmRepoMcast.log
+/opt/opengnsys/bin/udp-sender $MBUFFER --nokbd --retries-until-drop 65 --portbase $PORTBASE --$METHOD --mcast-data-address $ADDRESS --fec $CERROR --max-bitrate $BITRATE --ttl 1 --min-clients $NCLIENTS --max-wait $MAXTIME --file "$FICHIMG"
+##### ADV v. 1.0 23/02/2011
diff --git a/repoman/bin/torrent-creator b/repoman/bin/torrent-creator
index 8a14e3c6..21d58581 100755
--- a/repoman/bin/torrent-creator
+++ b/repoman/bin/torrent-creator
@@ -3,6 +3,7 @@
#Version 0.3 Ejecución desde cron cada minuto,
## echo "* * * * * root /opt/opengnsys/bin/torrent-creator" > /etc/cron.d/torrentcreator
+## ver moficifcacione en linea 41 - 46
# Comprobar si el proceso ya está en ejecución.
PROG=$(basename $0)
@@ -26,20 +27,27 @@ pushd $OGIMG >/dev/null
trap 'echo "`date` : Proceso interrumpido" >> $LOGFILE; exit ' 1 2 3 6 9 15
for IMG in *.{img,pgz}; do
# Saltar al siguiente si la imagen está bloqueada o si no existe el fichero.
- if [ -f "$IMG.lock" -o ! -f "$IMG" ]; then
+ LOCKFILE="$IMG.lock"
+ if [ -f "$LOCKFILE" -o ! -f "$IMG" ]; then
continue
fi
# Comprobar si ya existe el fichero Torrent para esa imagen.
TORRENT="$IMG.torrent"
- if [ -f "$TORRENT" ]; then
+ SUMFILE="$IMG.sum"
+ if [ -f "$TORRENT" ]; then
FILESIZE="$(ls -l $IMG | awk '{print $5}')"
read -e TORRFILE TORRSIZE <<<"$(ctorrent -x $TORRENT | awk '$1~/<1>/ {print $2,$3}')"
[ "$(basename $IMG)" = "$TORRFILE" -a "[$FILESIZE]" = "$TORRSIZE" ] && continue
fi
- # Crear fichero Torrent.
+ # Bloquear imagen, crear ficheros Torrent y Checksum y desbloquear imagen.
echo "`date` : Inicio creación de fichero $TORRENT" >> $LOGFILE
- rm -f "$TORRENT"
- nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT"
+ touch "$LOCKFILE"
+ trap "rm -f $LOCKFILE" 1 2 3 6 9
+ rm -f "$TORRENT" "$SUMFILE"
+ DATASUM=`md5sum "$IMG" | cut -f1 -d" "`
+ echo $DATASUM > "$SUMFILE"
+ nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" -c $DATASUM
+ rm -f "$LOCKFILE"
if [ -f "$TORRENT" ]; then
echo "`date` : Fin creación de fichero $TORRENT" >> $LOGFILE
else
diff --git a/repoman/bin/torrent-tracker b/repoman/bin/torrent-tracker
new file mode 100755
index 00000000..f355b81a
--- /dev/null
+++ b/repoman/bin/torrent-tracker
@@ -0,0 +1,22 @@
+#!/bin/bash
+BTTRACK=/usr/bin/bttrack.bittorrent
+BTSEEDER=/usr/bin/btlaunchmany.bittornado
+BTTRACKPORT=6969
+BTTRACKDFILE=/tmp/dstate
+BTTRACKLOG=/opt/opengnsys/log/bttrack.log
+BTINTERVAL=10
+BTTORRENTSDIR=/opt/opengnsys/images
+BTALLOW_GET=1
+#BTTRACK_OPTIONS=" --port $BTTRACKPORT --dfile $BTTRACKDFILE --reannounce_interval $BTINTERVAL --logfile $BTTRACKLOG --allowed_dir $BTTORRENTSDIR --allow_get $BTALLOW_GET --parse_allowed_interval 1"
+# nuevos parametros basados en EAC 05-04-2009 antonio doblas viso.
+BTTRACK_OPTIONS=" --save_dfile_interval $BTINTERVAL --timeout_downloaders_interval $BTINTERVAL --port $BTTRACKPORT --dfile $BTTRACKDFILE --reannounce_interval $BTINTERVAL --logfile $BTTRACKLOG --allowed_dir $BTTORRENTSDIR --allow_get $BTALLOW_GET "
+BTTRACKPID="/var/run/bttrack.pid"
+BTSEEDERPID="/var/run/btseeder.pid"
+
+################### #######################################
+
+pkill bttrack
+rm $BTTRACKDFILE
+sleep 2
+bttrack $BTTRACK_OPTIONS &>> $BTTRACKLOG &
+ps aux | grep bttrack | grep -v grep | awk -F: '{print $3}'
diff --git a/server/PXE/pxelinux.cfg/adminmode b/server/PXE/pxelinux.cfg/adminmode
deleted file mode 100644
index 2ade1682..00000000
--- a/server/PXE/pxelinux.cfg/adminmode
+++ /dev/null
@@ -1,5 +0,0 @@
-DEFAULT pxe
-
-LABEL pxe
-KERNEL linux
-APPEND initrd=initrd.gz ip=dhcp ro vga=788 irqpoll acpi=on boot=admin
diff --git a/server/PXE/pxelinux.cfg/default b/server/PXE/pxelinux.cfg/default
deleted file mode 100644
index 9ee7d8c5..00000000
--- a/server/PXE/pxelinux.cfg/default
+++ /dev/null
@@ -1,5 +0,0 @@
-DEFAULT pxe
-
-LABEL pxe
-KERNEL linux
-APPEND initrd=initrd.gz ip=dhcp ro vga=788 irqpoll acpi=on boot=user
diff --git a/server/DHCP/dhcpd.conf b/server/etc/dhcpd.conf.tmpl
index 687bbf0f..687bbf0f 100644
--- a/server/DHCP/dhcpd.conf
+++ b/server/etc/dhcpd.conf.tmpl
diff --git a/server/NFS/exports b/server/etc/exports.tmpl
index 5b30216b..5b30216b 100644
--- a/server/NFS/exports
+++ b/server/etc/exports.tmpl
diff --git a/server/etc/smb-og.conf.tmpl b/server/etc/smb-og.conf.tmpl
new file mode 100644
index 00000000..1ee7024c
--- /dev/null
+++ b/server/etc/smb-og.conf.tmpl
@@ -0,0 +1,37 @@
+[tftpboot]
+ comment = el directorio fisico ogclient debe estar como escritura
+ writeable = no
+ read only = yes
+ #locking = no
+ path = /var/lib/tftpboot
+ guest ok = no
+
+#[ogboot]
+# comment = OpenGnSys Boot
+# writeable = no
+# read only = yes
+# #locking = no
+# path = /var/lib/tftpboot
+# guest ok = no
+
+[ogclient]
+ comment = OpenGnSys Client
+ read only = yes
+ locking = no
+ path = OPENGNSYSDIR/client
+ guest ok = no
+
+[oglog]
+ comment = OpenGnSys Log
+ read only = no
+ writeable = yes
+ path = OPENGNSYSDIR/log/clients
+ guest ok = no
+
+[ogimages]
+ comment = OpenGnSys Repository
+ read only = no
+ writeable = yes
+ locking = no
+ path = OPENGNSYSDIR/images
+ guest ok = no
diff --git a/server/lib/DBprocess.php b/server/lib/DBprocess.php
deleted file mode 100644
index 7303ee5a..00000000
--- a/server/lib/DBprocess.php
+++ /dev/null
@@ -1,319 +0,0 @@
-<?php
-
-#no integrado parcialmente. Pendiente de ser llamado desde el EACserver
-function RegistryHost ($mac,$ip)
-{
- echo $mac . $ip;
- $conexion=mysql_connect($_SERVER['SQL_HOST'], $_SERVER['SQL_USER'], $_SERVER['SQL_PASS']) or die ('no se ha podido conectar con mysql');
- mysql_select_db($_SERVER['DATABASE'], $conexion);
- $insert="insert into infonetequipos (hostname, macaddress, ipaddress, startpage, aula, vga, acpi, pci) values ('" . $_SERVER['HOSTNAME'] . "', '" . $mac . "', '" . $ip . "' , 'default.sh' , '1', '788', '" . $_SERVER['acpi'] . "', '" . $_SERVER['pci'] . "')";
- $resultado=mysql_query($insert);
- #ethtool -s eth0 wol g autoneg off speed 100 duplex full
- #}
- mysql_close($conexion);
-}
-
-
-
-
-
-
-function BootServer ($boot,$ip)
-{
-#/** @function BootServer: @brief Configura el fichero de arranque remoto para el equipo, y actualiza la base de datos.
-#@param $1 str_LabelBootMenu
-#@param $2 str_IPHost
-#@return Mensaje informativo sobre dicho proceso
-#@warning Salidas de errores no determinada
-#@attention
-#@note Notas sin especificar
-#@version 1.0 Date: 27/10/2008 Author Antonio J. Doblas Viso. Universidad de Malaga
-#*/
-
-
-
- #actualizamos el menu de arranque para ese equipo
- $query3="update infonetequipos set arranque='" . $boot ."' where ipaddress='" .$ip . "'";
- $resultado = mysql_query($query3) or die (mysql_error());
-############# Consultas SQL para obtener la informacion del ciente. varinfoaula, varinfoequipo, varinfoparameters
-## varinfohost= toda la informacion de este equipo almacenado en el array infohost
- $peticion="select * from infonetequipos where ipaddress='".$ip . "'";
- $rsinfohost = mysql_query($peticion);
- $infohost = mysql_fetch_array($rsinfohost);
- $aula= $infohost['aula'];
- #obtenemos los campos del host y los metemos dentro de la variable varinfohost
- $varinfohost=" ";
- $lastparameters=mysql_num_fields($rsinfohost);
- #for ($i=3; $i<$lastparameters; $i++)
- for ($i=0; $i<$lastparameters; $i++)
- {
- if ( mysql_field_name($rsinfohost, $i) == 'startpage' )
- {
- $varinfohost = $varinfohost . " " . mysql_field_name($rsinfohost, $i) . "=A_id" . $aula . "_" . $infohost[$i] ;
- }
- else
- {
- $varinfohost = $varinfohost . " " . mysql_field_name($rsinfohost, $i) . "=" . $infohost[$i] ;
- #echo $infohost[$i] . "\n";
- }
- }
- #echo $parameters . "\n" ;
- mysql_free_result($rsinfohost);
-
-## obtenemos el nombre del fichero pxe para este equipo
- $mac=$infohost['macaddress'];
- $macfile="01-" . str_replace(":","-",strtolower($mac));
- $nombre_archivo="/tftpboot/pxelinux.cfg/" . $macfile;
-
-
-### varinfoaula= toda la informacion del aula al que pertenece el equipo infoaula.
- $peticion="select * from infonetaulas where id_aula='".$aula . "'";
- $rsinfoaula = mysql_query($peticion);
- #$infoaula = mysql_fetch_assoc($rsinfoaula);
- $infoaula = mysql_fetch_array($rsinfoaula);
- $varinfoaula=" ";
- $lastparameters=mysql_num_fields($rsinfoaula);
- #for ($i=3; $i<$lastparameters; $i++)
- for ($i=0; $i<$lastparameters; $i++)
- {
- $varinfoaula = $varinfoaula . " " . mysql_field_name($rsinfoaula, $i) . "=" . $infoaula[$i] ;
- }
- mysql_free_result($rsinfoaula);
-
-$gateway=$infoaula['gateway'];
- $netmask=$infoaula['netmask'];
- $repo_client=$infoaula['repo_client'];
- $menu=$infohost['arranque'];
-
-### varinfoparameters= toda la informacion generica de los clientes.
- $peticion="select variable, value from infoparametersclients";
- $rsinfoparameters = mysql_query($peticion);
- #$infoparameters = mysql_fetch_assoc($rsinfoparameters);
-# $infoparameters = mysql_fetch_array($rsinfoparameters);
- $varinfoparameters=" ";
-# $lastparameters=mysql_num_fields($rsinfoparameters);
-# #for ($i=3; $i<$lastparameters; $i++)
-# for ($i=0; $i<$lastparameters; $i++)
-# {
-# $varinfoparameters = $varinfoparameters . " " . mysql_field_name($rsinfoparameters, $i) . "=" . $infoparameters[$i] ;
-# }
- while ($fila = mysql_fetch_row($rsinfoparameters))
- {
-#foreach ($fila as $elemento)
-# {
-# $varinfoparameters = $varinfoparameters . "" . $elemento . "=";
-# }
- $varinfoparameters = $varinfoparameters . " " . $fila[0] . "=" . $fila[1];
- }
-
- mysql_free_result($rsinfoparameters);
-################################################ Fin de consustar SQL
-
- if (!$gestion= fopen($nombre_archivo, 'w+'))
- {
- echo "No se puede abrir el archivo ($nombre_archivo)";
- return;
- }
- # cuales son los parametros del menu
- fwrite($gestion, "DEFAULT syslinux/vesamenu.c32 \n");
- fwrite($gestion, "MENU TITLE Aplicacion GNSYS \n");
- # cuales son los elemtos del menu
- $peticion="select itemboot.label, itemboot.kernel, itemboot.append, menuboot.timeout, menuboot.prompt, menuboot.description, menuboot_itemboot.default from itemboot,menuboot_itemboot,menuboot where menuboot_itemboot.labelmenu=menuboot.label and menuboot_itemboot.labelitem=itemboot.label and menuboot.label='" . $menu . "'";
- # echo $peticion;
- $rsbootoption = mysql_query($peticion);
- while($row = mysql_fetch_assoc($rsbootoption))
- {
- fwrite($gestion, " \n");
- fwrite($gestion, "LABEL " . $row['label'] . " \n");
- fwrite($gestion, "MENU LABEL " . $row['label'] . " \n");
- if ( $row['default'] == true)
- {
- fwrite($gestion, "MENU DEFAULT \n");
- }
-
-
- $iseac=substr_count($row['append'] , "ogclients");
- echo $iseaci . " \n";
- if ($iseac > 0)
- {
- fwrite($gestion, $row['kernel'] . " EACregistred=YES " . $varinfoaula . "\n");
- $append=str_replace("repo_client", $repo_client, $row['append']);
-## echo $append . "\n";
- fwrite($gestion, $append . " ip=" . $infohost['ipaddress'] .":" . $repo_client . ":" . $gateway . ":" . $netmask . ":" . $infohost['hostname'] . ":eth0 ro " . " " . $varinfohost . " ". $varinfoparameters . " \n");
- }
- else
- {
- fwrite($gestion, $row['kernel'] . " \n");
- fwrite($gestion, $row['append'] . " \n");
- }
- $prompt=$row['prompt'];
- $timeout=$row['timeout'];
- }
-
- fwrite($gestion, " \n");
- fwrite($gestion, "PROMPT " . $prompt ." \n");
- fwrite($gestion, "TIMEOUT " . $timeout . " \n");
- mysql_free_result($rsbootoption);
- fwrite($gestion, " \n");
- fclose($gestion);
- exec("chown www-data:www-data /tftpboot/pxelinux.cfg/". $macfile);
- exec("chmod 777 /tftpboot/pxelinux.cfg/". $macfile);
- #return("ok");
- # actualizando el boot del cliente
- #system(REPO . "admin/procedimientos/Log " . SQL_HOST . " ' 00:00 ' ' " . $ip . " solicita un SetDefaultBoot ' ' " . $boot . " " . $ip . " con resultado " . $bootstatus ."'");
-}
-
-# no integrado
-function Logger ()
-{
- #include("/var/EAC/admin/config/EAC.conf");
- # formato de entrada
- # 1IP ; 2tiempo proceso; 3comando; 4parametros
- #$hora=date("H:i:s");
- #$dia=date("Y-m-d");
- #formato del log
- # IPsolicitante ; dia ; hora ; tiempo proceso ; comando; parametros
- #formato del log
- #mensaje en ventana del solicitante.
- #echo($_SERVER['argv'][1] . " ; " . $dia . " ; " . $hora . " ; " . $_SERVER['argv'][2] . " ; " . $_SERVER['argv'][3] . " ; " . $_SERVER['argv'][4]);
- #$info=$_SERVER['argv'][1] . " ; " . $dia . " ; " . $hora . " ; " . $_SERVER['argv'][2] . " ; " . $_SERVER['argv'][3] . " ; " . $_SERVER['argv'][4] . "\n";
- #echo($info);
- ## escritura en el ficheor /var/EAC/hosts/$IP-Log
- #$fp = fopen(REPO . "hosts/" . $_SERVER['argv'][1] ."-Log", "ab");
- #fwrite($fp, $info);
- #fclose($fp);
- ## insertar la informacion en la base de datos
- #$conexion=mysql_connect(SQL_HOST, SQL_USER, SQL_PASS) or die ('no se ha podido conectar con mysql');
- #mysql_select_db(DATABASE, $conexion);
- #$insert="insert into log (ip, dia, hora, tiempo_proceso, comando, parametros) values ('".$_SERVER['argv'][1] . "','" . $dia . "','" .$hora . "','" .$_SERVER['argv'][2]."','".$_SERVER['argv'][3]."','".$_SERVER['argv'][4]."')";
- #echo $insert . "\n";
- #$resultado = mysql_query($insert) or die (mysql_error());
- #mysql_close($conexion);
-}
-
-
-#primera integracion
-function InsertClassrom ($descripcion,$subred,$netmask,$broadcast,$gateway,$repo_image,$repo_client)
-{
-
- $query="select * from infonetaulas where descripcion='" . $descripcion ."'";
- echo $query;
- $rs=mysql_query($query);
- $num_rows = mysql_num_rows($rs);
- $row = mysql_fetch_assoc($rs);
-
- if ($num_rows == 0 )
- {
- $insert="insert into infonetaulas (descripcion, subred, netmask, broadcast, gateway, repo_image, repo_client) values ('$descripcion', '$subred', '$netmask', '$broadcast', '$gateway', '$repo_image', '$repo_client')";
- #echo $row['id_aula'];
- echo $insert;
- $resultado = mysql_query($insert) or die (mysql_error());
- mysql_free_result($rs);
- $query="select * from infonetaulas where descripcion='" . $descripcion ."'";
- #echo $query;
- $rs=mysql_query($query);
- $num_rows = mysql_num_rows($rs);
- $row = mysql_fetch_assoc($rs);
- if ($num_rows > 0 )
- {
- echo "creando directorios";
- $dir = REPOSTATIC . "client/etc/startpage/models";
- $dh = opendir($dir);
- while (false !== ($nombre_archivo = readdir($dh)))
- {
- $archivos[] = $nombre_archivo;
- }
- foreach ($archivos as $directorio)
- {
- if ((strlen($directorio) >= 3) and ($directorio <> '.svn'))
- {
- #echo "creando " . $directorio;
- exec("touch /opt/opengnsys/client/etc/startpage/A_id". $row['id_aula'] ."_". $directorio);
- }
- }
-
- }
-
-
-
- }
- #mysql_close($conexion);
-}
-# no integrado
-function InsertDefaultClassrom ($descripcion,$subred,$netmask,$broadcast,$gateway,$repo_image,$repo_client)
-{
- #include ("/var/EAC/admin/config/EAC.conf");
- $conexion=mysql_connect(SQL_HOST_LOCAL, SQL_USER, SQL_PASS) or die ('no se ha podido conectar con mysql');
- mysql_select_db(DATABASE, $conexion);
- $query="select * from aulas";
- $rs=mysql_query($query);
- $num_rows = mysql_num_rows($rs);
- echo $num_rows;
- if ($num_rows == 0 )
- {
- $insert="insert into aulas (descripcion, subred, netmask, broadcast, gateway, repo_image, repo_client) values ('$descripcion', '$subred', '$netmask', '$broadcast', '$gateway', '$repo_image', '$repo_client')";
- }
- else
- {
- $insert="update aulas SET descripcion='" . $descripcion . "', subred='". $subred . "', netmask='" . $netmask ."', broadcast='". $broadcast ."', gateway='" . $gateway . "', repo_image='" . $repo_image ."', repo_client='" . $repo_client ."' WHERE id_aula=1";
- }
- echo $insert;
- $resultado = mysql_query($insert) or die (mysql_error());
- mysql_free_result($rs);
- $query="select * from aulas where descripcion='" . $descripcion ."'";
- echo $query;
- $rs=mysql_query($query);
- $num_rows = mysql_num_rows($rs);
- $row = mysql_fetch_assoc($rs);
-
- if ($num_rows > 0 )
- {
- echo $row['id_aula'];
- echo "creando directorios";
- $dir = REPO . "admin/startpage/models";
- $dh = opendir($dir);
- while (false !== ($nombre_archivo = readdir($dh)))
- {
- $archivos[] = $nombre_archivo;
- }
-
- foreach ($archivos as $directorio)
- {
- if ((strlen($directorio) >= 3) and ($directorio <> '.svn'))
- {
- #echo "creando " . $directorio;
- exec("touch /var/EAC/admin/startpage/A_id". $row['id_aula'] ."_". $directorio);
- }
- }
-
- }
- mysql_free_result($rs);
-
- mysql_close($conexion);
-}
-
-
-# no integrado
-function InsertItemtoMenu ($menu,$item)
-{
- #include ("/var/EAC/admin/config/EAC.conf");
-#echo $menu . $item . "\n";
-# $conexion=mysql_connect(SQL_HOST_LOCAL, SQL_USER, SQL_PASS) or die ('no se ha podido conectar con mysql');
-# mysql_select_db(DATABASE, $conexion);
- $query="select * from menuboot_itemboot where labelmenu='$menu' and labelitem='$item'";
- echo " " . $query . " \n";
- $rs=mysql_query($query);
- $num_rows = mysql_num_rows($rs);
- echo $num_rows;
- if ($num_rows < 1 )
- {
- $insert="insert into menuboot_itemboot values ('$menu', '$item', 0)";
- echo " ".$insert . " \n";
- $resultado = mysql_query($insert) or die (mysql_error());
- mysql_free_result($rs);
- mysql_close($conexion);
- }
-
-}
-
- ?>
diff --git a/server/PXE/pxelinux.0 b/server/tftpboot/pxelinux.0
index 08270f1a..08270f1a 100644
--- a/server/PXE/pxelinux.0
+++ b/server/tftpboot/pxelinux.0
Binary files differ
diff --git a/server/tftpboot/pxelinux.cfg/default b/server/tftpboot/pxelinux.cfg/default
new file mode 100644
index 00000000..2b92712a
--- /dev/null
+++ b/server/tftpboot/pxelinux.cfg/default
@@ -0,0 +1,16 @@
+DEFAULT syslinux/vesamenu.c32
+MENU TITLE Aplicacion OpenGnsys
+
+PROMPT 0
+TIMEOUT 100
+
+LABEL Local_Boot
+MENU LABEL Local_Boot
+KERNEL syslinux/chain.c32
+APPEND hd0
+
+
+LABEL OpenGnsys_Client
+MENU LABEL OpenGnsys_Client
+KERNEL ogclient/ogvmlinuz
+APPEND initrd=ogclient/oginitrd.img ro boot=oginit vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=false ip=dhcp \ No newline at end of file