Teach usermode emulation how to lie about uname -r.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1920 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
		
							parent
							
								
									00a9bf191b
								
							
						
					
					
						commit
						c59372208a
					
				|  | @ -95,6 +95,7 @@ check_gcc="yes" | ||||||
| softmmu="yes" | softmmu="yes" | ||||||
| user="no" | user="no" | ||||||
| build_docs="no" | build_docs="no" | ||||||
|  | uname_release="" | ||||||
| 
 | 
 | ||||||
| # OS specific | # OS specific | ||||||
| targetos=`uname -s` | targetos=`uname -s` | ||||||
|  | @ -237,6 +238,8 @@ for opt do | ||||||
|   ;; |   ;; | ||||||
|   --enable-user) user="yes" |   --enable-user) user="yes" | ||||||
|   ;; |   ;; | ||||||
|  |   --enable-uname-release=*) uname_release="$optarg" | ||||||
|  |   ;; | ||||||
|   esac |   esac | ||||||
| done | done | ||||||
| 
 | 
 | ||||||
|  | @ -284,6 +287,7 @@ echo "  --enable-user            enable all linux usermode emulation targets" | ||||||
| echo "  --disable-user           disable all linux usermode emulation targets" | echo "  --disable-user           disable all linux usermode emulation targets" | ||||||
| echo "  --fmod-lib               path to FMOD library" | echo "  --fmod-lib               path to FMOD library" | ||||||
| echo "  --fmod-inc               path to FMOD includes" | echo "  --fmod-inc               path to FMOD includes" | ||||||
|  | echo "  --enable-uname-release=R Return R for uname -r in usermode emulation" | ||||||
| echo "" | echo "" | ||||||
| echo "NOTE: The object files are build at the place where configure is launched" | echo "NOTE: The object files are build at the place where configure is launched" | ||||||
| exit 1 | exit 1 | ||||||
|  | @ -553,6 +557,8 @@ fi | ||||||
| echo "FMOD support      $fmod $fmod_support" | echo "FMOD support      $fmod $fmod_support" | ||||||
| echo "kqemu support     $kqemu" | echo "kqemu support     $kqemu" | ||||||
| echo "Documentation     $build_docs" | echo "Documentation     $build_docs" | ||||||
|  | [ ! -z "$uname_release" ] && \ | ||||||
|  | echo "uname -r          $uname_release" | ||||||
| 
 | 
 | ||||||
| if test $sdl_too_old = "yes"; then | if test $sdl_too_old = "yes"; then | ||||||
| echo "-> Your SDL version is too old - please upgrade to have SDL support" | echo "-> Your SDL version is too old - please upgrade to have SDL support" | ||||||
|  | @ -711,6 +717,8 @@ if [ "$bsd" = "yes" ] ; then | ||||||
|   echo "#define _BSD 1" >> $config_h |   echo "#define _BSD 1" >> $config_h | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  | echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h | ||||||
|  | 
 | ||||||
| for target in $target_list; do | for target in $target_list; do | ||||||
| target_dir="$target" | target_dir="$target" | ||||||
| config_mak=$target_dir/config.mak | config_mak=$target_dir/config.mak | ||||||
|  |  | ||||||
|  | @ -34,6 +34,7 @@ | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| static const char *interp_prefix = CONFIG_QEMU_PREFIX; | static const char *interp_prefix = CONFIG_QEMU_PREFIX; | ||||||
|  | const char *qemu_uname_release = CONFIG_UNAME_RELEASE; | ||||||
| 
 | 
 | ||||||
| #if defined(__i386__) && !defined(CONFIG_STATIC) | #if defined(__i386__) && !defined(CONFIG_STATIC) | ||||||
| /* Force usage of an ELF interpreter even if it is an ELF shared
 | /* Force usage of an ELF interpreter even if it is an ELF shared
 | ||||||
|  | @ -1514,6 +1515,8 @@ int main(int argc, char **argv) | ||||||
|             } |             } | ||||||
|         } else if (!strcmp(r, "g")) { |         } else if (!strcmp(r, "g")) { | ||||||
|             gdbstub_port = atoi(argv[optind++]); |             gdbstub_port = atoi(argv[optind++]); | ||||||
|  | 	} else if (!strcmp(r, "r")) { | ||||||
|  | 	    qemu_uname_release = argv[optind++]; | ||||||
|         } else  |         } else  | ||||||
| #ifdef USE_CODE_COPY | #ifdef USE_CODE_COPY | ||||||
|         if (!strcmp(r, "no-code-copy")) { |         if (!strcmp(r, "no-code-copy")) { | ||||||
|  |  | ||||||
|  | @ -80,6 +80,7 @@ typedef struct TaskState { | ||||||
| } __attribute__((aligned(16))) TaskState; | } __attribute__((aligned(16))) TaskState; | ||||||
| 
 | 
 | ||||||
| extern TaskState *first_task_state; | extern TaskState *first_task_state; | ||||||
|  | extern const char *qemu_uname_release; | ||||||
| 
 | 
 | ||||||
| int elf_exec(const char * filename, char ** argv, char ** envp,  | int elf_exec(const char * filename, char ** argv, char ** envp,  | ||||||
|              struct target_pt_regs * regs, struct image_info *infop); |              struct target_pt_regs * regs, struct image_info *infop); | ||||||
|  |  | ||||||
|  | @ -2861,6 +2861,9 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||||||
|                 /* Overrite the native machine name with whatever is being
 |                 /* Overrite the native machine name with whatever is being
 | ||||||
|                    emulated. */ |                    emulated. */ | ||||||
|                 strcpy (buf->machine, UNAME_MACHINE); |                 strcpy (buf->machine, UNAME_MACHINE); | ||||||
|  |                 /* Allow the user to override the reported release.  */ | ||||||
|  |                 if (qemu_uname_release && *qemu_uname_release) | ||||||
|  |                   strcpy (buf->release, qemu_uname_release); | ||||||
|             } |             } | ||||||
|             unlock_user_struct(buf, arg1, 1); |             unlock_user_struct(buf, arg1, 1); | ||||||
|         } |         } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 pbrook
						pbrook