Re: misc/149335: shell script runs on Linux but not on freebsd
Paul Lambert wrote: > Oliver Fromme wrote: > > Paul wrote: > > > Thanks Oliver > > > I can just get the i386 vmware version and should install and run. > > > Last question is there a x86_64 bit Linux module? > > > > No, unfortunately x86_64 linux binaries are not supported. > > > > > Is one I'm development? > > > > I'm afraid I don't know. I suggest you try asking in the > > freebsd-emulat...@freebsd.org mailing list. > > I was well on my way of installing VMware-Player for i386 linux on FreeBSD > until I encountered these error messages. > > Aug 8 20:44:09 BRSINC-VM02 kernel: linux: pid 12889 (dd): ioctl fd=0, > cmd=0x6d02 ('m',2) is not implemented > Aug 8 20:44:09 BRSINC-VM02 kernel: linux: pid 12896 (dd): ioctl fd=0, > cmd=0x6d02 ('m',2) is not implemented > > The install script extracted the installer and began installing the rpms. I > have attached the verbose output file. > > At this point should this be considered a linux emulator bug and reported as > such? As I said, I don't use vmware and can't help you with that. But I'm pretty sure that others are using it and might have encountered the same problems. Please take this issue to the freebsd-emulat...@freebsd.org mailing list. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "I learned Java 3 years before Python. It was my language of choice. It took me two weekends with Python before I was more productive with it than with Java." -- Anthony Roberts ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: misc/149335: shell script runs on Linux but not on freebsd
Oliver, I was well on my way of installing VMware-Player for i386 linux on FreeBSD until I encountered these error messages. Aug 8 20:44:09 BRSINC-VM02 kernel: linux: pid 12889 (dd): ioctl fd=0, cmd=0x6d02 ('m',2) is not implemented Aug 8 20:44:09 BRSINC-VM02 kernel: linux: pid 12896 (dd): ioctl fd=0, cmd=0x6d02 ('m',2) is not implemented The install script extracted the installer and began installing the rpms. I have attached the verbose output file. At this point should this be considered a linux emulator bug and reported as such? Paul On Sun, Aug 8, 2010 at 3:50 PM, Oliver Fromme wrote: > Paul wrote: > > Thanks Oliver > > I can just get the i386 vmware version and should install and run. > > Last question is there a x86_64 bit Linux module? > > No, unfortunately x86_64 linux binaries are not supported. > > > Is one I'm development? > > I'm afraid I don't know. I suggest you try asking in the > freebsd-emulat...@freebsd.org mailing list. > > Best regards > Oliver > > -- > Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. > Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: > secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- > chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart > > FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd > > "anyone new to programming should be kept as far from C++ as > possible; actually showing the stuff should be considered a > criminal offence" -- Jacek Generowicz > BRSINC-VM02# /compat/linux/bin/bash -vx VMware-Player-3.1.0-261024.i386.bundle #!/usr/bin/env bash # # VMware Installer Launcher # # This is the executable stub to check if the VMware Installer Service # is installed and if so, launch it. If it is not installed, the # attached payload is extracted, the VMIS is installed, and the VMIS # is launched to install the bundle as normal. # Architecture this bundle was built for (x86 or x64) ARCH=x86 + ARCH=x86 if [ -z "$BASH" ]; then # $- expands to the current options so things like -x get passed through if [ ! -z "$-" ]; then opts="-$-" fi # dash flips out of $opts is quoted, so don't. exec /usr/bin/env bash $opts "$0" "$@" echo "Unable to restart with bash shell" exit 1 fi + '[' -z /compat/linux/bin/bash ']' set -e + set -e ETCDIR=/etc/vmware-installer + ETCDIR=/etc/vmware-installer OLDETCDIR="/etc/vmware" + OLDETCDIR=/etc/vmware ### Offsets ### # These are offsets that are later used relative to EOF. FOOTER_SIZE=52 + FOOTER_SIZE=52 # This won't work with non-GNU stat. FILE_SIZE=`stat --format "%s" "$0"` stat --format "%s" "$0" ++ stat --format %s VMware-Player-3.1.0-261024.i386.bundle + FILE_SIZE=106519865 offset=$(($FILE_SIZE - 4)) + offset=106519861 MAGIC_OFFSET=$offset + MAGIC_OFFSET=106519861 offset=$(($offset - 4)) + offset=106519857 CHECKSUM_OFFSET=$offset + CHECKSUM_OFFSET=106519857 offset=$(($offset - 4)) + offset=106519853 VERSION_OFFSET=$offset + VERSION_OFFSET=106519853 offset=$(($offset - 4)) + offset=106519849 PREPAYLOAD_OFFSET=$offset + PREPAYLOAD_OFFSET=106519849 offset=$(($offset - 4)) + offset=106519845 PREPAYLOAD_SIZE_OFFSET=$offset + PREPAYLOAD_SIZE_OFFSET=106519845 offset=$(($offset - 4)) + offset=106519841 LAUNCHER_SIZE_OFFSET=$offset + LAUNCHER_SIZE_OFFSET=106519841 offset=$(($offset - 4)) + offset=106519837 PAYLOAD_OFFSET=$offset + PAYLOAD_OFFSET=106519837 offset=$(($offset - 4)) + offset=106519833 PAYLOAD_SIZE_OFFSET=$offset + PAYLOAD_SIZE_OFFSET=106519833 offset=$(($offset - 4)) + offset=106519829 # Rest of the offsets ommitted ### End offsets ### # Short name (ie, vmware-workstation). This isn't technically correct # since there could be multiple product components in a bundle. PRODUCT_NAME=vmware-player + PRODUCT_NAME=vmware-player # Called when the script exits # # Arguments: #None # # Side effects: #- VMIS_TEMP and PREPAYLOAD is removed unless VMIS_KEEP_TEMP is set on_exit() { if [ -e "$VMIS_TEMP" -a -z "$VMIS_KEEP_TEMP" ]; then rm -rf "$VMIS_TEMP" fi if [ -e "$PREPAYLOAD" -a -z "$VMIS_KEEP_TEMP" ]; then rm -rf "$PREPAYLOAD" fi } trap on_exit EXIT + trap on_exit EXIT trap "" USR1 + trap '' USR1 # Retrives and sets the various lengths that are extracted from the # footer of the file. # # Arguments: #$1 => bundle to get the lengths from # # Side effects: #- MAGIC_NUMBER, LAUNCHER_SIZE, and PAYLOAD_SIZE are set. # # Returns: #0 if successful, else 1 set_lengths() { local file="$1" if [ ! -s "$file" ]; then echo "$file does not exist" exit 1 fi # XXX: put extraction in its own function MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d ' '` if [ "$MAGIC_NUMBER" != "907380241" ]; then echo "magic number does not match" exit 1 fi LAUNCHER_SIZE=`od -An -t u4 -N 4 -j $LAUNCHER_SIZE_OFFSET "$file" | tr -d ' '` PAYLOAD_SIZE=`od -An -t u4 -N 4 -j $PAYLO
Re: misc/149335: shell script runs on Linux but not on freebsd
Paul wrote: > Thanks Oliver > I can just get the i386 vmware version and should install and run. > Last question is there a x86_64 bit Linux module? No, unfortunately x86_64 linux binaries are not supported. > Is one I'm development? I'm afraid I don't know. I suggest you try asking in the freebsd-emulat...@freebsd.org mailing list. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "anyone new to programming should be kept as far from C++ as possible; actually showing the stuff should be considered a criminal offence" -- Jacek Generowicz ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: misc/149335: shell script runs on Linux but not on freebsd
Thanks Oliver I can just get the i386 vmware version and should install and run. Last question is there a x86_64 bit Linux module? Is one I'm development? Sent from my iPod On Aug 7, 2010, at 4:42 PM, Oliver Fromme wrote: > Sorry for the late reply, I don't have much time currently. > > Maybe someone else from the -questions list can jump in, > because I don't have much experience with vmware (I prefer > qemu or virtual box). > > Paul Lambert wrote: >> Thanks for the reply. I am attaching the bash output from the shell >> script. This script implements RPMs so I am sure that I need the linux >> module. I had previously found a guide on how to install RPMs on FreeBSD. >> I have a printer that has an RPM that allows it to work on Linus. So I >> would think that I will need the Linux module in the future. >> >> I previously had made the "stat" change to the shell script and that part >> works. But, the bash shell is reporting an 'od" error. >> >> Finally, how much performance do you lose with the linux module emulator? > > Not much, probably none at all. Some people even say that > Linux binaries run faster on FreeBSD than they run on Linux, > because they benefit from the better network code and VM > system. > > Anyway, the "linuxulator" isn't really an emulator, it's > rather an ABI-level compatibility layer, very similar to > the i386 (32bit) compatibility layer on FreeBSD/amd64 (64bit). > >> Do you believe I only need the emulator to get VMware installed or will it >> make other linux calls that are not part of FreeBSD? > > I'm afraid you won't be able to install vmware this way. > I suggest you look at the emulator/vmware* ports in the > ports collection. > >> BRSINC-VM02# bash -vx VMware-Player-3.1.0-261024.x86_64.bundle >> [...] >> # XXX: put extraction in its own function >> MAGIC_NUMBER=`od -An -t u4 -N 4 -aj >> $MAGIC_OFFSET "$file" | tr -d ' '` > > There's a bogus line break which is causing this particular > parsing error. Either join the lines, or put a backslash > at the end of the first line (behind -aj). > > But I'm afraid this is the smallest of the problems. > I suspect you won't be able to get this script to run > correctly on FreeBSD, because it seems to do too many > linux-specific things. > > Best regards > Oliver > > -- > Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. > Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: > secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- > chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart > > FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd > > "And believe me, as a C++ programmer, I don't hesitate to question > the decisions of language designers. After a decent amount of C++ > exposure, Python's flaws seem ridiculously small." -- Ville Vainio ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: misc/149335: shell script runs on Linux but not on freebsd
Sorry for the late reply, I don't have much time currently. Maybe someone else from the -questions list can jump in, because I don't have much experience with vmware (I prefer qemu or virtual box). Paul Lambert wrote: > Thanks for the reply. I am attaching the bash output from the shell > script. This script implements RPMs so I am sure that I need the linux > module. I had previously found a guide on how to install RPMs on FreeBSD. > I have a printer that has an RPM that allows it to work on Linus. So I > would think that I will need the Linux module in the future. > > I previously had made the "stat" change to the shell script and that part > works. But, the bash shell is reporting an 'od" error. > > Finally, how much performance do you lose with the linux module emulator? Not much, probably none at all. Some people even say that Linux binaries run faster on FreeBSD than they run on Linux, because they benefit from the better network code and VM system. Anyway, the "linuxulator" isn't really an emulator, it's rather an ABI-level compatibility layer, very similar to the i386 (32bit) compatibility layer on FreeBSD/amd64 (64bit). > Do you believe I only need the emulator to get VMware installed or will it > make other linux calls that are not part of FreeBSD? I'm afraid you won't be able to install vmware this way. I suggest you look at the emulator/vmware* ports in the ports collection. > BRSINC-VM02# bash -vx VMware-Player-3.1.0-261024.x86_64.bundle > [...] ># XXX: put extraction in its own function >MAGIC_NUMBER=`od -An -t u4 -N 4 -aj >$MAGIC_OFFSET "$file" | tr -d ' '` There's a bogus line break which is causing this particular parsing error. Either join the lines, or put a backslash at the end of the first line (behind -aj). But I'm afraid this is the smallest of the problems. I suspect you won't be able to get this script to run correctly on FreeBSD, because it seems to do too many linux-specific things. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "And believe me, as a C++ programmer, I don't hesitate to question the decisions of language designers. After a decent amount of C++ exposure, Python's flaws seem ridiculously small." -- Ville Vainio ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: misc/149335: shell script runs on Linux but not on freebsd
Oliver, One more time. I should have included this in my last Email. Instead of using the exact offset into the file and "dd" is there a way to insert a text "tag" such as codeStartHere_1 in the script then find this location by a search and then extract beginning at this location +1 and extracting to codeStopsHere_1 -1, or by the number of bytes. Maybe the right solution is to develop a smarter install script. Thanks again, again, Paul On Sat, Aug 7, 2010 at 11:45 AM, Paul Lambert wrote: > Oliver, > > One last observation I have made regarding this bundle installer. The > reason for all the size calculations is that the installer and code are > offset a specific bytes within the file. Even if I correct the shell calls > the file size will change and the code will not be extracted correctly. > > However, I can open the file and find exactly where the code is located, > extract it and place it in the location where the shell script would place > and see if it will run from there. This is a longshot but the fact is shell > scripts automate what can be manually performed. But, using vi will be > tedious. Gedit will not open the file. Are there any other very forgiving > editors that will make it easier to edit this file? > > Thanks again. > Paul > > > On Fri, Aug 6, 2010 at 5:27 PM, Paul Lambert wrote: > >> Oliver, >> >> Looks like the Linux emulator is only 32 bit. Here is the error I get >> after installing the emulator and running the /usr/compat/linux/bin/bash >> shell. >> >> This is a x64 bundle and does not match that of the current >> architecture. Please download the x86 bundle. >> >> I would like to see if I can get the x64 to install but if not I think the >> x86 will but it may have reduced performance since I am looking to run >> virtual machines that in effect would be running on an emulator themselves. >> >> May be necessary to move to Virtual Box but I loose considerable >> functionality there especially USB support. >> >> Paul >> >> >> >> On Fri, Aug 6, 2010 at 4:31 PM, Paul Lambert wrote: >> >>> Oliver, >>> >>> Thanks for the reply. I am attaching the bash output from the shell >>> script. This script implements RPMs so I am sure that I need the linux >>> module. I had previously found a guide on how to install RPMs on FreeBSD. >>> I have a printer that has an RPM that allows it to work on Linus. So I >>> would think that I will need the Linux module in the future. >>> >>> I previously had made the "stat" change to the shell script and that part >>> works. But, the bash shell is reporting an 'od" error. >>> >>> Finally, how much performance do you lose with the linux module >>> emulator? Do you believe I only need the emulator to get VMware installed >>> or will it make other linux calls that are not part of FreeBSD? >>> >>> Thanks >>> >>> Paul >>> >>> >>> On Fri, Aug 6, 2010 at 1:35 PM, Oliver Fromme wrote: >>> Redirected to the -questions. Paul wrote: > What about matching the ' marks in this section? I get a command error. > > > > # XXX: put extraction in its own function > > > MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d ' '` That command works fine for me: $ MAGIC_OFFSET=42 $ file=/etc/motd $ MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d ' '` $ echo $MAGIC_NUMBER 540684323 What's the exact error message that you get, and what are the values of the variables involved? By the way, when debugging shell scripts it is very helpful to run the shell with -vx. Then it prints the script as it is being parsed, and additionally each command is printed after expansion. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "I invented Ctrl-Alt-Delete, but Bill Gates made it famous." -- David Bradley, original IBM PC design team >>> >>> >> > ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: misc/149335: shell script runs on Linux but not on freebsd
Oliver, One last observation I have made regarding this bundle installer. The reason for all the size calculations is that the installer and code are offset a specific bytes within the file. Even if I correct the shell calls the file size will change and the code will not be extracted correctly. However, I can open the file and find exactly where the code is located, extract it and place it in the location where the shell script would place and see if it will run from there. This is a longshot but the fact is shell scripts automate what can be manually performed. But, using vi will be tedious. Gedit will not open the file. Are there any other very forgiving editors that will make it easier to edit this file? Thanks again. Paul On Fri, Aug 6, 2010 at 5:27 PM, Paul Lambert wrote: > Oliver, > > Looks like the Linux emulator is only 32 bit. Here is the error I get > after installing the emulator and running the /usr/compat/linux/bin/bash > shell. > > This is a x64 bundle and does not match that of the current > architecture. Please download the x86 bundle. > > I would like to see if I can get the x64 to install but if not I think the > x86 will but it may have reduced performance since I am looking to run > virtual machines that in effect would be running on an emulator themselves. > > May be necessary to move to Virtual Box but I loose considerable > functionality there especially USB support. > > Paul > > > > On Fri, Aug 6, 2010 at 4:31 PM, Paul Lambert wrote: > >> Oliver, >> >> Thanks for the reply. I am attaching the bash output from the shell >> script. This script implements RPMs so I am sure that I need the linux >> module. I had previously found a guide on how to install RPMs on FreeBSD. >> I have a printer that has an RPM that allows it to work on Linus. So I >> would think that I will need the Linux module in the future. >> >> I previously had made the "stat" change to the shell script and that part >> works. But, the bash shell is reporting an 'od" error. >> >> Finally, how much performance do you lose with the linux module emulator? >> Do you believe I only need the emulator to get VMware installed or will it >> make other linux calls that are not part of FreeBSD? >> >> Thanks >> >> Paul >> >> >> On Fri, Aug 6, 2010 at 1:35 PM, Oliver Fromme wrote: >> >>> Redirected to the -questions. >>> >>> Paul wrote: >>> > What about matching the ' marks in this section? I get a command >>> error. >>> > >>> > > > # XXX: put extraction in its own function >>> > > > MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d >>> ' '` >>> >>> That command works fine for me: >>> >>> $ MAGIC_OFFSET=42 >>> $ file=/etc/motd >>> $ MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d ' '` >>> $ echo $MAGIC_NUMBER >>> 540684323 >>> >>> What's the exact error message that you get, and what are >>> the values of the variables involved? >>> >>> By the way, when debugging shell scripts it is very helpful >>> to run the shell with -vx. Then it prints the script as it >>> is being parsed, and additionally each command is printed >>> after expansion. >>> >>> Best regards >>> Oliver >>> >>> -- >>> Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. >>> Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: >>> secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- >>> chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart >>> >>> FreeBSD-Dienstleistungen, -Produkte und mehr: >>> http://www.secnetix.de/bsd >>> >>> "I invented Ctrl-Alt-Delete, but Bill Gates made it famous." >>>-- David Bradley, original IBM PC design team >>> >> >> > ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: misc/149335: shell script runs on Linux but not on freebsd
Oliver, Looks like the Linux emulator is only 32 bit. Here is the error I get after installing the emulator and running the /usr/compat/linux/bin/bash shell. This is a x64 bundle and does not match that of the current architecture. Please download the x86 bundle. I would like to see if I can get the x64 to install but if not I think the x86 will but it may have reduced performance since I am looking to run virtual machines that in effect would be running on an emulator themselves. May be necessary to move to Virtual Box but I loose considerable functionality there especially USB support. Paul On Fri, Aug 6, 2010 at 4:31 PM, Paul Lambert wrote: > Oliver, > > Thanks for the reply. I am attaching the bash output from the shell > script. This script implements RPMs so I am sure that I need the linux > module. I had previously found a guide on how to install RPMs on FreeBSD. > I have a printer that has an RPM that allows it to work on Linus. So I > would think that I will need the Linux module in the future. > > I previously had made the "stat" change to the shell script and that part > works. But, the bash shell is reporting an 'od" error. > > Finally, how much performance do you lose with the linux module emulator? > Do you believe I only need the emulator to get VMware installed or will it > make other linux calls that are not part of FreeBSD? > > Thanks > > Paul > > > On Fri, Aug 6, 2010 at 1:35 PM, Oliver Fromme wrote: > >> Redirected to the -questions. >> >> Paul wrote: >> > What about matching the ' marks in this section? I get a command >> error. >> > >> > > > # XXX: put extraction in its own function >> > > > MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d >> ' '` >> >> That command works fine for me: >> >> $ MAGIC_OFFSET=42 >> $ file=/etc/motd >> $ MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d ' '` >> $ echo $MAGIC_NUMBER >> 540684323 >> >> What's the exact error message that you get, and what are >> the values of the variables involved? >> >> By the way, when debugging shell scripts it is very helpful >> to run the shell with -vx. Then it prints the script as it >> is being parsed, and additionally each command is printed >> after expansion. >> >> Best regards >> Oliver >> >> -- >> Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. >> Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: >> secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- >> chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart >> >> FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd >> >> "I invented Ctrl-Alt-Delete, but Bill Gates made it famous." >>-- David Bradley, original IBM PC design team >> > > ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: misc/149335: shell script runs on Linux but not on freebsd
Oliver, Thanks for the reply. I am attaching the bash output from the shell script. This script implements RPMs so I am sure that I need the linux module. I had previously found a guide on how to install RPMs on FreeBSD. I have a printer that has an RPM that allows it to work on Linus. So I would think that I will need the Linux module in the future. I previously had made the "stat" change to the shell script and that part works. But, the bash shell is reporting an 'od" error. Finally, how much performance do you lose with the linux module emulator? Do you believe I only need the emulator to get VMware installed or will it make other linux calls that are not part of FreeBSD? Thanks Paul On Fri, Aug 6, 2010 at 1:35 PM, Oliver Fromme wrote: > Redirected to the -questions. > > Paul wrote: > > What about matching the ' marks in this section? I get a command error. > > > > > > # XXX: put extraction in its own function > > > > MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d ' > '` > > That command works fine for me: > > $ MAGIC_OFFSET=42 > $ file=/etc/motd > $ MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d ' '` > $ echo $MAGIC_NUMBER > 540684323 > > What's the exact error message that you get, and what are > the values of the variables involved? > > By the way, when debugging shell scripts it is very helpful > to run the shell with -vx. Then it prints the script as it > is being parsed, and additionally each command is printed > after expansion. > > Best regards > Oliver > > -- > Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. > Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: > secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- > chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart > > FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd > > "I invented Ctrl-Alt-Delete, but Bill Gates made it famous." >-- David Bradley, original IBM PC design team > BRSINC-VM02# kldstat Id Refs AddressSize Name 17 0x8010 d6aa98 kernel 21 0x81022000 5ad4aradeon.ko 31 0x8107d000 115dcdrm.ko BRSINC-VM02# bash -vx VMware-Player-3.1.0-261024.x86_64.bundle #!/usr/bin/env bash # # VMware Installer Launcher # # This is the executable stub to check if the VMware Installer Service # is installed and if so, launch it. If it is not installed, the # attached payload is extracted, the VMIS is installed, and the VMIS # is launched to install the bundle as normal. # Architecture this bundle was built for (x86 or x64) ARCH=x64 + ARCH=x64 if [ -z "$BASH" ]; then # $- expands to the current options so things like -x get passed through if [ ! -z "$-" ]; then opts="-$-" fi # dash flips out of $opts is quoted, so don't. exec /usr/bin/env bash $opts "$0" "$@" echo "Unable to restart with bash shell" exit 1 fi + '[' -z /usr/local/bin/bash ']' set -e + set -e ETCDIR=/etc/vmware-installer + ETCDIR=/etc/vmware-installer OLDETCDIR="/etc/vmware" + OLDETCDIR=/etc/vmware ### Offsets ### # These are offsets that are later used relative to EOF. FOOTER_SIZE=52 + FOOTER_SIZE=52 # This won't work with non-GNU stat. FILE_SIZE=`stat -f "%z" "$0"` stat -f "%z" "$0" ++ stat -f %z VMware-Player-3.1.0-261024.x86_64.bundle + FILE_SIZE=102467637 offset=$(($FILE_SIZE - 4)) + offset=102467633 MAGIC_OFFSET=$offset + MAGIC_OFFSET=102467633 offset=$(($offset - 4)) + offset=102467629 CHECKSUM_OFFSET=$offset + CHECKSUM_OFFSET=102467629 offset=$(($offset - 4)) + offset=102467625 VERSION_OFFSET=$offset + VERSION_OFFSET=102467625 offset=$(($offset - 4)) + offset=102467621 PREPAYLOAD_OFFSET=$offset + PREPAYLOAD_OFFSET=102467621 offset=$(($offset - 4)) + offset=102467617 PREPAYLOAD_SIZE_OFFSET=$offset + PREPAYLOAD_SIZE_OFFSET=102467617 offset=$(($offset - 4)) + offset=102467613 LAUNCHER_SIZE_OFFSET=$offset + LAUNCHER_SIZE_OFFSET=102467613 offset=$(($offset - 4)) + offset=102467609 PAYLOAD_OFFSET=$offset + PAYLOAD_OFFSET=102467609 offset=$(($offset - 4)) + offset=102467605 PAYLOAD_SIZE_OFFSET=$offset + PAYLOAD_SIZE_OFFSET=102467605 offset=$(($offset - 4)) + offset=102467601 # Rest of the offsets ommitted ### End offsets ### # Short name (ie, vmware-workstation). This isn't technically correct # since there could be multiple product components in a bundle. PRODUCT_NAME=vmware-player + PRODUCT_NAME=vmware-player # Called when the script exits # # Arguments: #None # # Side effects: #- VMIS_TEMP and PREPAYLOAD is removed unless VMIS_KEEP_TEMP is set on_exit() { if [ -e "$VMIS_TEMP" -a -z "$VMIS_KEEP_TEMP" ]; then rm -rf "$VMIS_TEMP" fi if [ -e "$PREPAYLOAD" -a -z "$VMIS_KEEP_TEMP" ]; then rm -rf "$PREPAYLOAD" fi } trap on_exit EXIT + trap on_exit EXIT trap "" USR1 + trap '' USR1 # Retrives and sets the various lengths that are extracted from the # foot
Re: misc/149335: shell script runs on Linux but not on freebsd
Redirected to the -questions. Paul wrote: > What about matching the ' marks in this section? I get a command error. > > > > # XXX: put extraction in its own function > > > MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d ' '` That command works fine for me: $ MAGIC_OFFSET=42 $ file=/etc/motd $ MAGIC_NUMBER=`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | tr -d ' '` $ echo $MAGIC_NUMBER 540684323 What's the exact error message that you get, and what are the values of the variables involved? By the way, when debugging shell scripts it is very helpful to run the shell with -vx. Then it prints the script as it is being parsed, and additionally each command is printed after expansion. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "I invented Ctrl-Alt-Delete, but Bill Gates made it famous." -- David Bradley, original IBM PC design team ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"