[izpack-users] os.arch

David Ferrero david.ferrero at zion.com
Wed Jun 7 21:45:39 CEST 2006


Hi guys:

take a look at the testWrapper shell script in the bin directory of  
the delta pack distro used by the Java Wrapper Service to detect OS  
and architecture information.

http://wrapper.tanukisoftware.org

here's a snippet from that open source project:

# Resolve the os
DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]`
case "$DIST_OS" in
     'sunos')
         DIST_OS="solaris"
         ;;
     'hp-ux' | 'hp-ux64')
         DIST_OS="hpux"
         ;;
     'darwin')
         DIST_OS="macosx"
         ;;
     'unix_sv')
         DIST_OS="unixware"
         ;;
esac


# Resolve the architecture
DIST_ARCH=`uname -p | tr [:upper:] [:lower:] | tr -d [:blank:]`
if [ "$DIST_ARCH" = "unknown" ]
then
     DIST_ARCH=`uname -m | tr [:upper:] [:lower:] | tr -d [:blank:]`
fi
case "$DIST_ARCH" in
     'amd64' | 'ia32' | 'ia64' | 'i386' | 'i486' | 'i586' | 'i686' |  
'x86_64')
         DIST_ARCH="x86"
         ;;
     'ip27')
         DIST_ARCH="mips"
         ;;
     'power' | 'powerpc' | 'power_pc' | 'ppc64')
         DIST_ARCH="ppc"
         ;;
     'pa_risc' | 'pa-risc')
         DIST_ARCH="parisc"
         ;;
     'sun4u' | 'sparcv9')
         DIST_ARCH="sparc"
         ;;
     '9000/800')
         DIST_ARCH="parisc"
         ;;
esac







On May 4, 2006, at 12:08 PM, Marc Eppelmann wrote:

> Hi Jo,
> This is great. If I have time I will apply this in our code.
>
> I have prepared locally in my sandbox the detection of (K)Ubuntu.  
> That works.
>
> uname -i on our Sun:
>
> -bash-3.00# uname -i
> SUNW,Sun-Blade-1000
>
> That all ;-(
>
> Cheers
> Marc
>
>
>
>
> Am Mittwoch, 3. Mai 2006 15:56 schrieb Jo Vark:
>> Hi Marc,
>> This is the output of 'uname -a'
>> Linux <######> 2.4.21-15.EL #1 SMP Thu Apr 22 00:09:47
>> EDT 2004 x86_64 x86_64 x86_64 GNU/Linux
>> from the above it is quite clear that the arch should
>> be x86_64
>> The output of 'uname -i' usually gives the correct
>> architecture (definitely on linux, not sure about sun
>> etc).
>>
>> for me on a 64 bit machine:
>>> uname -i
>>
>> x86_64
>>
>> on a 32 bit machine:
>>> uname -i
>>
>> i386
>> Thanks.
>> --Jo
>>
>> --- Marc Eppelmann <marc.eppelmann at gmx.de> wrote:
>>> Hi Jo,
>>>
>>> The content /etc/redhat-release is
>>> self-explanationed enough.
>>> If this is really a 64-bit machine and RHEL is
>>> installed und running in 64-Bit
>>> mode, please can you send the console-output of
>>>
>>> :~>uname -a ?
>>>
>>> Or do you (or anybody other from this mailinglist)
>>> know a commandline tools
>>> output that identifies sure a running 64 kernel
>>> resp. 64-bit libraries?
>>>
>>> I will search on our athlon64 machine.
>>>
>>> What is about SunSolaris 64 Bit? Any Idea?
>>>
>>> the output of uname -a on our UltraSparc is:
>>>
>>> SunOS svrsunblade1k-1.localdomain.org 5.10 Generic
>>> sun4u sparc
>>> SUNW,Sun-Blade-1000
>>>
>>> No trace of 64-bit ...
>>>
>>> Am Dienstag, 2. Mai 2006 20:36 schrieb Jo Vark:
>>>> Hi Marc,
>>>> This is the contents of my /etc/redhat-relase
>>>
>>> file:
>>>> Red Hat Enterprise Linux WS release 3 (Taroon
>>>
>>> Update
>>>
>>>> 2)
>>>> I'm not really sure what you mean by "assigned
>>>
>>> OSName"
>>>
>>>> but a <panel> with os="unix" name="Linux" and
>>>> arch="i386" currently works on my machine, though
>>>
>>> in
>>>
>>>> reality the arch should be "x86_64". Let me kow if
>>>
>>> I
>>>
>>>> can provide you with any further info.
>>>> Thanks,.
>>>> --Jo
>>>>
>>>> --- Marc Eppelmann <marc.eppelmann at gmx.de> wrote:
>>>>> Hi Jo,
>>>>>
>>>>> Currently IzPack uses a combination of
>>>>>
>>>>> System.getProperty( "os.name" ) and
>>>
>>> /etc/*-release
>>>
>>>>> "parsing" to detect the OS.
>>>>>
>>>>> If you want to contribute us, you can send us
>>>
>>> the
>>>
>>>>> content of
>>>>> the /etc/*-release - Files plus the assigned
>>>
>>> OSName
>>>
>>>>> etc... , so that we can
>>>>> complete the detection routine.
>>>>>
>>>>> Thanks
>>>>> Marc
>>>>>
>>>>> Am Montag, 1. Mai 2006 18:12 schrieb Jo Vark:
>>>>>> Hi,
>>>>>> I recently discovered this great package that
>>>>>
>>>>> IzPack
>>>>>
>>>>>> is.
>>>>>> I ran into a few problems with the os.arch
>>>>>
>>>>> property,
>>>>>
>>>>>> though. Java is not very smart in detecting
>>>
>>> the
>>>
>>>>>> correct architecture through the
>>>>>> System.getProperty("os.arch") method as it
>>>
>>> returns
>>>
>>>>>> "i386" for both my 64 bit RHEL on a 64 bit
>>>
>>> xeon
>>>
>>>>>> processor and for my 32 bit FC3 installation
>>>
>>> on my
>>>
>>>>> 32
>>>>>
>>>>>> bit laptop. I was wondering if IzPack had any
>>>>>
>>>>> special
>>>>>
>>>>>> way of figuring out the actual architecture or
>>>
>>> if
>>>
>>>>>> instead of using the
>>>
>>> System.getProperty("os.arch")
>>>
>>>>> it
>>>>>
>>>>>> could use the result of the 'uname -i' shell
>>>>>
>>>>> command.
>>>>>
>>>>>> TIA
>>>>>> --Jo
>>>
>>> __________________________________________________
>>>
>>>>>> Do You Yahoo!?
>>>>>> Tired of spam?  Yahoo! Mail has the best spam
>>>>>
>>>>> protection around
>>>>>
>>>>>> http://mail.yahoo.com
>>>
>>> _______________________________________________
>>>
>>>>>> izpack-users mailing list
>>>>>> izpack-users at lists.berlios.de
>>
>> http://lists.berlios.de/mailman/listinfo/izpack-users
>>
>>>>> _______________________________________________
>>>>> izpack-users mailing list
>>>>> izpack-users at lists.berlios.de
>>
>> http://lists.berlios.de/mailman/listinfo/izpack-users
>>
>>>> __________________________________________________
>>>> Do You Yahoo!?
>>>> Tired of spam?  Yahoo! Mail has the best spam
>>>
>>> protection around
>>>
>>>> http://mail.yahoo.com
>>>> _______________________________________________
>>>> izpack-users mailing list
>>>> izpack-users at lists.berlios.de
>>
>> http://lists.berlios.de/mailman/listinfo/izpack-users
>>
>>> _______________________________________________
>>> izpack-users mailing list
>>> izpack-users at lists.berlios.de
>>
>> http://lists.berlios.de/mailman/listinfo/izpack-users
>>
>>
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam?  Yahoo! Mail has the best spam protection around
>> http://mail.yahoo.com
>> _______________________________________________
>> izpack-users mailing list
>> izpack-users at lists.berlios.de
>> http://lists.berlios.de/mailman/listinfo/izpack-users
> _______________________________________________
> izpack-users mailing list
> izpack-users at lists.berlios.de
> http://lists.berlios.de/mailman/listinfo/izpack-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.berlios.de/pipermail/izpack-users/attachments/20060607/534c1f77/attachment.html 


More information about the izpack-users mailing list