[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how can I obtain the old fglrx_drv.so?



2011-08-20 07:43, lina skrev:
I found the fglrx_drv.so from version 11-6-3 and substitute the
present 11-7- one.

There is a script I downloaded which could help to get rid of the
watermark which showed "AMD unsupported hardware".

The script is as followed, it's targeted on the old fglrx_drv.so,

#!/bin/sh
DRIVER=/usr/lib/xorg/modules/drivers/fglrx_drv.so
for x in $(objdump -d $DRIVER|awk '/call/&&/EnableLogo/{print
"\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
  sed -i "s/$x/\x90\x90\x90\x90\x90/g" $DRIVER
done

while for the version after 11-7-* when I used it, it showed:

$ ./ATI_driver_fglrx.sh
sed: -e expression #1, char 45: Unmatched [ or [^

is it possible to compare the two fglrx_drv.so, and modify this script
to fit for the new one, so can remove the water mark.



Certainly. The script looks at the .so file as a text file, locates a certain character pattern (using awk), and replaces every occurence of that pattern (using sed) by a pattern spacified by "\x90\x90\x90\x90\x90". I do not know enough about awk nor about the structure of .so files to say how to change it though.

Simplified working of the script:

The line "for x in $(objdump -d $DRIVER|awk '/call/&&/EnableLogo/{print
"\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}');" says for every item in the result of running the awk command, name the item x and then go on.

The line "sed -i "s/$x/\x90\x90\x90\x90\x90/g" $DRIVER" says replace the contents of x (refered to as $x) by \x90\x90\x90\x90\x90 everywhere in the file $DRIVER (defined in the script to be the .so file).

I guess the error message says that sed has a problem finding $x in the file $DRIVER.

You could either study the effect of the script in the case it works and, try to manually make the same changes to the case where the script fails, or read some basics of awk and sed, and understand what is done, and then do it yourself.

/ johan


Reply to: