Date: Sat, 7 Aug 2010 12:05:43 -0400 From: Paul Lambert <eb30750@gmail.com> To: freebsd-questions@freebsd.org Subject: Re: misc/149335: shell script runs on Linux but not on freebsd Message-ID: <AANLkTi=%2BHnKAOkXYQ6_Fy_osLT=ZtY5aA4%2BLxAhzfk9K@mail.gmail.com> In-Reply-To: <AANLkTimA-xaZNzeUcPGj=G2%2ByCs%2Bz_4yuQYXYzYqx1Uy@mail.gmail.com> References: <B8BD4CE1-01CB-4C03-8D3E-2A8E29750A1D@gmail.com> <201008061735.o76HZEal051334@lurza.secnetix.de> <AANLkTimRjxG6NC3PLxybkGnHfFXe5CW=oKGcqRROOUZu@mail.gmail.com> <AANLkTik=a4PAqfVgQniBwo78es6KXVs08N7Em663_fJ2@mail.gmail.com> <AANLkTimA-xaZNzeUcPGj=G2%2ByCs%2Bz_4yuQYXYzYqx1Uy@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <eb30750@gmail.com> 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 cal= ls > 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 plac= e > and see if it will run from there. This is a longshot but the fact is sh= ell > scripts automate what can be manually performed. But, using vi will be > tedious. Gedit will not open the file. Are there any other very forgivi= ng > editors that will make it easier to edit this file? > > Thanks again. > Paul > > > On Fri, Aug 6, 2010 at 5:27 PM, Paul Lambert <eb30750@gmail.com> 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 t= he >> 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 themselv= es. >> >> 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 <eb30750@gmail.com> 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 FreeB= SD. >>> 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 pa= rt >>> 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 instal= led >>> 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 <olli@lurza.secnetix.de>w= rote: >>> >>>> Redirected to the -questions. >>>> >>>> Paul <eb30750@gmail.com> wrote: >>>> > What about matching the ' marks in this section? I get a command >>>> error. >>>> > >>>> > > > # XXX: put extraction in its own function >>>> > > > MAGIC_NUMBER=3D`od -An -t u4 -N 4 -j $MAGIC_OFFSET "$file" | = tr >>>> -d ' '` >>>> >>>> That command works fine for me: >>>> >>>> $ MAGIC_OFFSET=3D42 >>>> $ file=3D/etc/motd >>>> $ MAGIC_NUMBER=3D`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=E4ftsfuehrung: >>>> secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht >>>> M=FCn- >>>> chen, HRB 125758, Gesch=E4ftsf=FChrer: 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 >>>> >>> >>> >> >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=%2BHnKAOkXYQ6_Fy_osLT=ZtY5aA4%2BLxAhzfk9K>