--- mcore-src/trunk/mcore-tools/daemon/client/include/graphic.client.class 2011/11/09 13:35:31 1920 +++ mcore-src/trunk/mcore-tools/daemon/client/include/graphic.client.class 2012/08/13 11:08:28 2018 @@ -25,39 +25,39 @@ # rebuild 25-gfxcard.conf # always clear the config - CONFIG="/etc/X11/xorg.conf.d/25-device.conf" + CONFIG="${MROOT}/etc/X11/xorg.conf.d/25-device.conf" clearconfig # but only add lines if some values are found in config.d dir - if path_not_empty ${MCORE_CONFIG_PATH}/xorg/device + if path_not_empty ${MROOT}/${MCORE_CONFIG_PATH}/xorg/device then addconfig 'Section "Device"' - helper_graphic_add_configs ${MCORE_CONFIG_PATH}/xorg/device + helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/device addconfig 'EndSection' fi # rebuild 25-module.conf # always clear the config - CONFIG="/etc/X11/xorg.conf.d/25-module.conf" + CONFIG="${MROOT}/etc/X11/xorg.conf.d/25-module.conf" clearconfig # but only add lines if some values are found in config.d dir - if path_not_empty ${MCORE_CONFIG_PATH}/xorg/module + if path_not_empty ${MROOT}/${MCORE_CONFIG_PATH}/xorg/module then addconfig 'Section "Module"' - helper_graphic_add_configs ${MCORE_CONFIG_PATH}/xorg/module + helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/module addconfig 'EndSection' fi # rebuild 25-screen.conf # always clear the config - CONFIG="/etc/X11/xorg.conf.d/25-screen.conf" + CONFIG="${MROOT}/etc/X11/xorg.conf.d/25-screen.conf" clearconfig # but only add lines if some values are found in config.d dir - if path_not_empty ${MCORE_CONFIG_PATH}/xorg/screen + if path_not_empty ${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen then addconfig 'Section "Screen"' addconfig ' Identifier "Screen0"' addconfig ' Monitor "Monitor0"' - helper_graphic_add_configs ${MCORE_CONFIG_PATH}/xorg/screen + helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen addconfig 'EndSection' fi } @@ -100,7 +100,7 @@ local depth [[ -z ${resolution} ]] && help_graphic_resolution && return 1 - CONFIG="${MCORE_CONFIG_PATH}/xorg/screen/20-resolution.conf" + CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/20-resolution.conf" clearconfig # do it for all supported color depth for depth in 1 4 8 15 16 24 @@ -112,7 +112,10 @@ addconfig ' EndSubSection' done - x11runas "xrandr --size ${resolution}" + if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] + then + x11runas "xrandr --size ${resolution}" + fi helper_graphic_rebuild_xorg_conf_d } @@ -127,7 +130,7 @@ # do it only for supported color depths case "${depth}" in 1|4|8|15|16|24) - CONFIG="${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf" + CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf" clearconfig addconfig " DefaultDepth ${depth}" ;; @@ -135,7 +138,10 @@ esac helper_graphic_rebuild_xorg_conf_d - mecho "X11 restart required!" + if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] + then + mecho "X11 restart required!" + fi } # set_graphic_refresh ${value} @@ -144,9 +150,12 @@ local value="$1" [[ -z ${value} ]] && help_graphic_refresh && return 1 - #echo "${value}" > ${SETTINGSPATH}/xorg/refresh + #echo "${value}" > ${MROOT}/${MCORE_CONFIG_PATH}/xorg/refresh - x11runas "xrandr --refresh ${value}" + if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] + then + x11runas "xrandr --refresh ${value}" + fi helper_graphic_rebuild_xorg_conf_d } @@ -158,15 +167,18 @@ local CONFIG [[ -z ${driver} ]] && help_graphic_driver && return 1 - if [[ -f ${driverdir}/${driver}_drv.so ]] + if [[ -f ${MROOT}/${driverdir}/${driver}_drv.so ]] then - CONFIG="${MCORE_CONFIG_PATH}/xorg/device/25-device.conf" + CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/device/25-device.conf" clearconfig addconfig " Identifier \"Card0\"" addconfig " Driver \"${driver}\"" helper_graphic_rebuild_xorg_conf_d - mecho "X11 restart required!" + if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] + then + mecho "X11 restart required!" + fi else eecho "Driver '${driver}' does not exist on this system. Aborted!" fi @@ -182,16 +194,16 @@ case "${action}" in current) - if [[ -f ${config} ]] + if [[ -f ${MROOT}/${config} ]] then - driver=$(grep Driver "${config}" | sed 's:.*Driver.*\"\(.*\)\":\1:') + driver=$(grep Driver "${MROOT}/${config}" | sed 's:.*Driver.*\"\(.*\)\":\1:') rvecho "${driver}" else rvecho "none" fi ;; system) - for i in $(find ${driverdir} -mindepth 1 -maxdepth 1 -type f | sort) + for i in $(find ${MROOT}/${driverdir} -mindepth 1 -maxdepth 1 -type f | sort) do driver="${driver} $(basename ${i} _drv.so)" done