AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 681512
Accepted
Inukaze
Inukaze
Asked: 2021-12-15 20:32:13 +0800 CST2021-12-15 20:32:13 +0800 CST 2021-12-15 20:32:13 +0800 CST

Slackware(64) 14.2 + chroot + xfce4-session + 音频 + (NV-)GLX?

  • 772

只是为了更容易挂载我的 Slackware 14.2 安装,我把它放在另一个分区上(它是 32 位 100% 真正的原生)。

我可以像 root 用户一样启动 xfce4-session(但这不是我需要的):

ch“根”

我需要知道是否有人可以帮助我解决以下问题

1 - 将音频重定向到主机,因为

我没有来自 chroot 的任何声音

2 - 可以在 Nvidia 上使用 3D、DRI 吗?我在Gentoo论坛上看到了一些东西,但我不明白)

英伟达,2D/3D 可能吗?

3 - 从我的脚本中隐藏一些命令和/或输出:这些行是:

local being added to access control list

export DISPLAY=localhost:1 2>/dev/null

exit

当我关闭 Xephyr 窗口时,这会在之后出现:

-su: línea 3: $'\E[01mHP': no se encontró la orden

chroot & xephyr

我的脚本“slack32-chroot”内容:

#!/usr/bin/env bash

echo '
Autor ----------------> Inukaze ( Venezuela )
Sitio ----------------> https://goo.gl/ij6WqW
Correo-E -------------> [email protected]
Licencia -------------> GPL 2
'
#Establecer mediante la variable "$OBJETIVO" 
#La particion con una distribucion a la cual se accedera mediante chroot
export OBJETIVO="/media/Slack32"

#Prevenir que se autoejecuten las funciones que se definiran despues
unset montar
unset desmontar
unset MensajeBase

#Establecer y definir funciones :
function MensajeBase()
{
echo -e "\nLa forma correcta de utilizar este guion es :\n$0 «montar» , «montar_xephyr» ó «desmontar», Por ejemplo : \n"
echo -e "$0 montar"
echo -e "$0 montar_xephyr"
echo -e "$0 desmontar\n"
}

function montar(){
#Preparar acceso para programas de entorno grafico :
export DISPLAY=:0.0 2>/dev/null
xhost + local 2>/dev/null

#Montar todo de una vez para una distro de 32 Bits (En este caso Slackware32 14.2) : 
mount --rbind /proc                         "$OBJETIVO/proc"                        ; \
mount --make-rslave                         "$OBJETIVO/proc"                        ; \
mount --rbind /sys                              "$OBJETIVO/sys"                         ; \
mount --make-rslave                         "$OBJETIVO/sys"                         ; \
mount --rbind /dev                          "$OBJETIVO/dev"                         ; \
mount --make-rslave                         "$OBJETIVO/dev"                         ; \
mount --rbind /run                              "$OBJETIVO/run"                         ; \
mount --make-rslave                         "$OBJETIVO/run"                         ; \
mount --rbind /tmp                          "$OBJETIVO/tmp"                         ; \
mount --make-rslave                         "$OBJETIVO/tmp"                         ; \
mount --bind /etc/fstab                     "$OBJETIVO/etc/fstab"                   ; \
mount --bind /etc/hostname          "$OBJETIVO/etc/hostname"        ; \
mount --bind /etc/hosts                     "$OBJETIVO/etc/hosts"               ; \
mount --bind /etc/resolv.conf           "$OBJETIVO/etc/resolv.conf"     ; \

cat << EOF | linux32 chroot "$OBJETIVO"
export DISPLAY=localhost:1 2>/dev/null
EOF

linux32 chroot                                  "$OBJETIVO" /bin/bash -l                ; \
umount -l                                           "$OBJETIVO"                                 ; \
mount -a 2>/dev/null
}


function xephyr(){
#Copiar archivo de autorizacion X.Org :
rm -f "$OBJETIVO/home/inukaze/.Xauthority"
rm -f "$OBJETIVO/root/.Xauthority"
cp -f "/home/inukaze/.Xauthority" "$OBJETIVO/root/.Xauthority"
cp -f "/home/inukaze/.Xauthority" "$OBJETIVO/home/inukaze/.Xauthority"
chown inukaze:users "$OBJETIVO/home/inukaze/.Xauthority"

if [ ! -f "$OBJETIVO/etc/X11/Xwrapper.config" ] ; then
# Prevenir el error « /usr/libexec/Xorg.wrap: Only console users are allowed to run the X server »
echo '# Xwrapper.config (Debian X Window System server wrapper configuration file)
#
# This file was generated by the post-installation script of the x11-common
# package using values from the debconf database.
#
# See the Xwrapper.config(5) manual page for more information.
#
# This file is automatically updated on upgrades of the x11-common package
# *only* if it has not been modified since the last upgrade of that package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command as root:
#   dpkg-reconfigure x11-common
#allowed_users=console
allowed_users=anybody' | tee "$OBJETIVO/etc/X11/Xwrapper.config"
fi

#Preparar acceso para programas de entorno grafico :
export DISPLAY=:0.0 2>/dev/null
xhost + local 2>/dev/null

#Montar todo de una vez para una distro de 32 Bits (En este caso Slackware32 14.2) : 
mount --rbind /proc                         "$OBJETIVO/proc"                        ; \
mount --make-rslave                         "$OBJETIVO/proc"                        ; \
mount --rbind /sys                              "$OBJETIVO/sys"                         ; \
mount --make-rslave                         "$OBJETIVO/sys"                         ; \
mount --rbind /dev                          "$OBJETIVO/dev"                         ; \
mount --make-rslave                         "$OBJETIVO/dev"                         ; \
mount --rbind /run                              "$OBJETIVO/run"                         ; \
mount --make-rslave                         "$OBJETIVO/run"                         ; \
mount --rbind /tmp                          "$OBJETIVO/tmp"                         ; \
mount --make-rslave                         "$OBJETIVO/tmp"                         ; \
mount --bind /etc/fstab                     "$OBJETIVO/etc/fstab"                   ; \
mount --bind /etc/hostname          "$OBJETIVO/etc/hostname"        ; \
mount --bind /etc/hosts                     "$OBJETIVO/etc/hosts"               ; \
mount --bind /etc/resolv.conf           "$OBJETIVO/etc/resolv.conf"     ; \

cat << EOF | linux32 chroot "$OBJETIVO"
export DISPLAY=localhost:1 2>/dev/null
EOF

linux32 chroot                                  "$OBJETIVO" /bin/bash -l        <<"EOT"
#Primero Detectar Particiones, Crear Directorios dentro de /media y finalmente montarlas
#Nombre De Particion :
#   NPD1="1SlackIni"    # Esta es la particion /boot de la particion que estoy usando en chroot
    NPD2="72GB"
    NPD3="Compartido"
    NPD4="2SlackIni"
#   NPD5="Slack64"  #Esta es la particion Anfrition, asi que realmente no la necesito para esto.
#   NPD6="Slack32"  #Esta es la que estoy usando en chroot
    NPD7="2Compartir"
#Parte de la Particion
#   PPD1=$(blkid | grep "$NPD1" | cut -c01-09)
    PPD2=$(blkid | grep "$NPD2" | cut -c01-09)
    PPD3=$(blkid | grep "$NPD3" | cut -c01-09)
    PPD4=$(blkid | grep "$NPD4" | cut -c01-09)
#   PPD5=$(blkid | grep "$NPD5" | cut -c01-09)
#   PPD6=$(blkid | grep "$NPD6" | cut -c01-09)
    PPD7=$(blkid | grep "$NPD7" | cut -c01-09)
$(mkdir -p /media/"$NPD2" ; mount "$PPD2" /media/"$NPD2" )
$(mkdir -p /media/"$NPD3" ; mount "$PPD3" /media/"$NPD3" )
$(mkdir -p /media/"$NPD4" ; mount "$PPD4" /media/"$NPD4" )
$(mkdir -p /media/"$NPD7" ; mount "$PPD7" /media/"$NPD7" )
$(su - inukaze)
$(Xephyr -ac -screen 1070x888 -br -reset -terminate :1.0 2>/dev/null &)
$(export DISPLAY=:1.0)
$(DISPLAY=:1 /usr/bin/xfce4-session -- :1 2>/dev/null)
EOT

umount -l                                           "$OBJETIVO"                                 ; \
mount -a 2>/dev/null
}

function desmontar(){
# Desmontar
umount -l           "$OBJETIVO"                         ; \
mount -a 2>/dev/null
}


#Este guión necesita ser ejecutado como SuperUsuario
#o en su defecto con permisos administrativos suficientes
#Para montar / desmontar particiones.
if [ "$(whoami)" != root ]; then

    echo
    echo
    echo 'Por favor ejecuta este guion como SuperUsuario (root)'
    echo
    echo 'Utilize este guión bajo su Propio Riesgro'
    echo 'El Autor , o sea yo , no me hago responsable'
    echo 'de las consecuencias imprevistas que puedan'
    echo 'acontecer en tu sistema operativo'
    echo
else
# Proceder en caso de tener los permisos suficientes para montar/desmontar particiones :

#Si el usuario no pasa ningun parametro indicar como se usa este guion
            if [ -z "$1" ]; then
                    MensajeBase
            fi

#Guion : Aqui se ha definido como se utilizara este guion correctamente para montar o desmontar la particion Objetivo
#Entrada : Cualquier palabra pasada por el parametro $1 sera convertida en minusculas
Entrada=$(echo "$1" | tr -s  '[:upper:]'  '[:lower:]')

            if [ "$Entrada" == "montar" ]; then
                    montar
            fi

            if [ "$Entrada" == "xephyr" ]; then
                    xephyr
            fi

            if [ "$Entrada" == "desmontar" ]; then
                    desmontar
            fi

#Finalizar la condicion globar de requerir usar el SuperUsuario o en su defectos persmisos administrativos
#Para poder (des)montar particiones :
fi

#Finalizar este guion sin problemas :
exit 0 2>/dev/null

这是来自LinuxQuestions.org的副本

bash chroot
  • 1 1 个回答
  • 81 Views

1 个回答

  • Voted
  1. Best Answer
    Inukaze
    2021-12-18T04:21:29+08:002021-12-18T04:21:29+08:00
    1. 因为我不在 chroot 中使用 pulseaudio,所以音频解决方案修复只是删除文件/etc/asound.conf

      rm -rf /usr/asound.conf
      
    2. 访问 3D/DRI 需要两件事,第一是编辑文件/etc/X11/xorg.conf并添加

      Section "Files"
      #    ModulePath "/usr/lib64/nvidia-304.137/xorg"
           ModulePath "/usr/lib/xorg/modules"
      EndSection
      

      您必须首先检查 X.Org 的“模块和扩展”文件的路径,在添加一些扩展和+iglx启用对 glx 的访问的参数之后,xephyr 命令现在是:

      $(Xephyr -ac -screen 1070x888 -br -reset -terminate -render :1.0 \
      +extension Composite \
      +extension DAMAGE \
      +extension DOUBLE-BUFFER \
      +extension DPMS \
      +extension GLX \
      +extension NV-GLX \
      +extension RANDR \
      +extension RENDER \
      +extension X-Resource \
      +extension XFIXES \
      +xinerama \
      +iglx \
      2>/dev/null &)
      

    这就是我从实际安装的 Slackware64 14.2 到在另一个带有音频和 3D/DRI 的分区上实际安装的 Slackware32 14.2 访问所需的全部内容。

    我的整个脚本现在是:

    #!/usr/bin/env bash
    
    echo '
    Autor ----------------> Inukaze ( Venezuela )
    Sitio ----------------> https://goo.gl/ij6WqW
    Correo-E -------------> [email protected]
    Licencia -------------> GPL 2
    '
    #Establecer mediante la variable "$OBJETIVO" 
    #La particion con una distribucion a la cual se accedera mediante chroot
    export OBJETIVO="/media/Slack32"
    
    #Prevenir que se autoejecuten las funciones que se definiran despues
    unset montar
    unset desmontar
    unset MensajeBase
    
    #Establecer y definir funciones :
    function MensajeBase()
    {
    echo -e "\nLa forma correcta de utilizar este guion es :\n$0 «montar» , «montar_xephyr» ó «desmontar», Por ejemplo : \n"
    echo -e "$0 montar"
    echo -e "$0 montar_xephyr"
    echo -e "$0 desmontar\n"
    }
    
    function montar(){
    #Preparar acceso para programas de entorno grafico :
    export DISPLAY=:0.0 2>/dev/null
    xhost + local 2>/dev/null
    
    #Montar todo de una vez para una distro de 32 Bits (En este caso Slackware32 14.2) : 
    mount --rbind /proc                         "$OBJETIVO/proc"                        ; \
    mount --make-rslave                         "$OBJETIVO/proc"                        ; \
    mount --rbind /sys                              "$OBJETIVO/sys"                         ; \
    mount --make-rslave                         "$OBJETIVO/sys"                         ; \
    mount --rbind /dev                          "$OBJETIVO/dev"                         ; \
    mount --make-rslave                         "$OBJETIVO/dev"                         ; \
    mount --rbind /run                              "$OBJETIVO/run"                         ; \
    mount --make-rslave                         "$OBJETIVO/run"                         ; \
    mount --rbind /tmp                          "$OBJETIVO/tmp"                         ; \
    mount --make-rslave                         "$OBJETIVO/tmp"                         ; \
    mount --bind /etc/fstab                     "$OBJETIVO/etc/fstab"                   ; \
    mount --bind /etc/hostname          "$OBJETIVO/etc/hostname"        ; \
    mount --bind /etc/hosts                     "$OBJETIVO/etc/hosts"               ; \
    mount --bind /etc/resolv.conf           "$OBJETIVO/etc/resolv.conf"     ; \
    
    cat << EOF | linux32 chroot "$OBJETIVO"
    export DISPLAY=localhost:1 2>/dev/null
    EOF
    
    linux32 chroot                                  "$OBJETIVO" /bin/bash -l                ; \
    umount -l                                           "$OBJETIVO"                                 ; \
    mount -a 2>/dev/null
    }
    
    
    function xephyr(){
    #Copiar archivo de autorizacion X.Org :
    rm -f "$OBJETIVO/home/inukaze/.Xauthority"
    rm -f "$OBJETIVO/root/.Xauthority"
    cp -f "/home/inukaze/.Xauthority" "$OBJETIVO/root/.Xauthority"
    cp -f "/home/inukaze/.Xauthority" "$OBJETIVO/home/inukaze/.Xauthority"
    
    #Audio :
    #rm -rf                                                 "$OBJETIVO/etc/asound.conf"
    #cp -f "/etc/asound.state"                      "$OBJETIVO/etc/asound.state"
    
    #Video :
    #cp -f /usr/lib/libGL.so.304.137-nvidia "$OBJETIVO/usr/lib/libGL.so.304.137-nvidia"
    #cp -f /usr/lib/libGL.so.304.137-nvidia "$OBJETIVO/usr/lib/libGL.so.304.137"
    #cp -f /usr/lib/libGL.so.1.2.0                  "$OBJETIVO/usr/lib/libGL.so.1.2.0"
    #cp -f /usr/lib/libGL.so                                "$OBJETIVO/usr/lib/libGL.so"
    #cp -f /usr/lib/libGL.la-nvidia                 "$OBJETIVO/usr/lib/libGL.la-nvidia"
    
    chown inukaze:users "$OBJETIVO/home/inukaze/.Xauthority"
    
    if [ ! -f "$OBJETIVO/etc/X11/Xwrapper.config" ] ; then
    # Prevenir el error « /usr/libexec/Xorg.wrap: Only console users are allowed to run the X server »
    echo '# Xwrapper.config (Debian X Window System server wrapper configuration file)
    #
    # This file was generated by the post-installation script of the x11-common
    # package using values from the debconf database.
    #
    # See the Xwrapper.config(5) manual page for more information.
    #
    # This file is automatically updated on upgrades of the x11-common package
    # *only* if it has not been modified since the last upgrade of that package.
    #
    # If you have edited this file but would like it to be automatically updated
    # again, run the following command as root:
    #   dpkg-reconfigure x11-common
    #allowed_users=console
    allowed_users=anybody' | tee "$OBJETIVO/etc/X11/Xwrapper.config"
    fi
    
    #Preparar acceso para programas de entorno grafico :
    $(export DISPLAY=:1.0)
    $(xhost + local 2>/dev/null)
    
    #Montar todo de una vez para una distro de 32 Bits (En este caso Slackware32 14.2) : 
    mount --rbind /proc                                                 "$OBJETIVO/proc"                                                    ; \
    mount --make-rslave                                                 "$OBJETIVO/proc"                                                    ; \
    mount --rbind /sys                                                      "$OBJETIVO/sys"                                                     ; \
    mount --make-rslave                                                 "$OBJETIVO/sys"                                                     ; \
    mount --rbind /dev                                                  "$OBJETIVO/dev"                                                     ; \
    mount --make-rslave                                                 "$OBJETIVO/dev"                                                     ; \
    mount --rbind /run                                                      "$OBJETIVO/run"                                                     ; \
    mount --make-rslave                                                 "$OBJETIVO/run"                                                     ; \
    mount --rbind /tmp                                                  "$OBJETIVO/tmp"                                                     ; \
    mount --make-rslave                                                 "$OBJETIVO/tmp"                                                     ; \
    mount --rbind /var/run/dbus                                     "$OBJETIVO/var/run/dbus"                                        ; \
    mount --make-rslave                                                 "$OBJETIVO/var/run/dbus"                                        ; \
    mount --rbind /var/lib/dbus                                     "$OBJETIVO/var/lib/dbus"                                        ; \
    mount --make-rslave                                                 "$OBJETIVO/var/lib/dbus"                                        ; \
    mount --rbind /etc/X11                                              "$OBJETIVO/etc/X11"                                             ; \
    mount --make-rslave                                                 "$OBJETIVO/etc/X11"                                             ; \
    mount --rbind /usr/X11R6                                        "$OBJETIVO/usr/X11R6"                                           ; \
    mount --make-rslave                                                 "$OBJETIVO/usr/X11R6"                                           ; \
    mount --rbind /lib/modules                                      "$OBJETIVO/lib/modules"                                     ; \
    mount --make-rslave                                                 "$OBJETIVO/lib/modules"                                     ; \
    mount --bind /etc/fstab                                             "$OBJETIVO/etc/fstab"                                               ; \
    mount --bind /etc/hostname                                  "$OBJETIVO/etc/hostname"                                    ; \
    mount --bind /etc/hosts                                             "$OBJETIVO/etc/hosts"                                           ; \
    mount --bind /etc/resolv.conf                                   "$OBJETIVO/etc/resolv.conf"                                 ; \
    #NV_GLX#mount --bind /usr/lib/libnvidia-glcore.so.304.137   "$OBJETIVO/usr/lib/libnvidia-glcore.so.304.137" ; \
    #NV_GLX#mount --bind /usr/lib/tls/libnvidia-tls.so.304.137  "$OBJETIVO/usr/lib/tls/libnvidia-tls.so.304.137"    ; \
    #NV_GLX#mount --bind /usr/lib/libGLEW.so.1.13.0                 "$OBJETIVO/usr/lib/libGLEW.so.1.13.0"                   ; \
    #NV_GLX#mount --bind /usr/lib/libGLEW.so.1.13                       "$OBJETIVO/usr/lib/libGLEW.so.1.13"                     ; \
    #NV_GLX#mount --bind /usr/lib/libGLEW.so                                "$OBJETIVO/usr/lib/libGLEW.so"                              ; \
    #NV_GLX#mount --bind /usr/lib/libGLU.so.1.3.1                       "$OBJETIVO/usr/lib/libGLU.so.1.3.1"                     ; \
    #NV_GLX#mount --bind /usr/lib/libGLU.so.1                               "$OBJETIVO/usr/lib/libGLU.so.1"                             ; \
    #NV_GLX#mount --bind /usr/lib/libGLU.so                                 "$OBJETIVO/usr/lib/libGLU.so"                               ; \
    #NV_GLX#mount --bind /usr/lib/libGLU.la                                 "$OBJETIVO/usr/lib/libGLU.la"                                   ; \
    #NV_GLX#mount --bind /usr/lib/libGL.so.304.137-nvidia           "$OBJETIVO/usr/lib/libGL.so.304.137-nvidia"     ; \
    #NV_GLX#mount --bind /usr/lib/libGL.so.1.2.0                            "$OBJETIVO/usr/lib/libGL.so.1.2.0"                          ; \
    #NV_GLX#mount --bind /usr/lib/libGL.so.1                                "$OBJETIVO/usr/lib/libGL.so.1"                              ; \
    #NV_GLX#mount --bind /usr/lib/libGL.so                                  "$OBJETIVO/usr/lib/libGL.so"                                    ; \
    #NV_GLX#mount --bind /usr/lib/libGL.la-nvidia                       "$OBJETIVO/usr/lib/libGL.la-nvidia"                     ; \
    #NV_GLX#mount --bind /usr/lib/libGL.la                                  "$OBJETIVO/usr/lib/libGL.la"                                    ; \
    #AUDIO#mount --bind /usr/lib/libasound.so.2.0.0                 "$OBJETIVO/usr/lib/libasound.so.2.0.0"                  ; \
    #AUDIO#mount --bind /usr/lib/libasound.so.2                     "$OBJETIVO/usr/lib/libasound.so.2"                      ; \
    #AUDIO#mount --bind /usr/lib/libasound.so                           "$OBJETIVO/usr/lib/libasound.so"                            ; \
    #AUDIO#mount --bind /usr/lib/libasound.la                           "$OBJETIVO/usr/lib/libasound.la"                            ; \
    
    
    cat << EOF | linux32 chroot "$OBJETIVO"
    $(export DISPLAY=:1.0 2>/dev/null) 
    EOF
    
    linux32 chroot                                  "$OBJETIVO" /bin/bash -l        <<"EOT"
    #Primero Detectar Particiones, Crear Directorios dentro de /media y finalmente montarlas
    #Nombre De Particion :
    #   NPD1="1SlackIni"    # Esta es la particion /boot de la particion que estoy usando en chroot
        NPD2="72GB"
        NPD3="Compartido"
        NPD4="2SlackIni"
    #   NPD5="Slack64"  #Esta es la particion Anfrition, asi que realmente no la necesito para esto.
    #   NPD6="Slack32"  #Esta es la que estoy usando en chroot
        NPD7="2Compartir"
    #Parte de la Particion
    #   PPD1=$(blkid | grep "$NPD1" | cut -c01-09)
        PPD2=$(blkid | grep "$NPD2" | cut -c01-09)
        PPD3=$(blkid | grep "$NPD3" | cut -c01-09)
        PPD4=$(blkid | grep "$NPD4" | cut -c01-09)
    #   PPD5=$(blkid | grep "$NPD5" | cut -c01-09)
    #   PPD6=$(blkid | grep "$NPD6" | cut -c01-09)
        PPD7=$(blkid | grep "$NPD7" | cut -c01-09)
    $(mkdir -p /media/"$NPD2" ; mount "$PPD2" /media/"$NPD2" )
    $(mkdir -p /media/"$NPD3" ; mount "$PPD3" /media/"$NPD3" )
    $(mkdir -p /media/"$NPD4" ; mount "$PPD4" /media/"$NPD4" )
    $(mkdir -p /media/"$NPD7" ; mount "$PPD7" /media/"$NPD7" )
    $(su - inukaze)
    
    $(Xephyr -ac -screen 1070x888 -br -reset -terminate -render :1.0 \
    +extension Composite \
    +extension DAMAGE \
    +extension DOUBLE-BUFFER \
    +extension DPMS \
    +extension GLX \
    +extension NV-GLX \
    +extension RANDR \
    +extension RENDER \
    +extension X-Resource \
    +extension XFIXES \
    +xinerama \
    +iglx \
    2>/dev/null &)
    
    $(export DISPLAY=:1.0)
    $(DISPLAY=:1 /usr/bin/xfce4-session -- :1 2>/dev/null) 
    
    ##DESACTIVADO##$(DISPLAY=:1 /usr/bin/startx -- :1 2>/dev/null)  #Inicia en otra tty con (NV-)GLX a pantalla completa
    EOT
    
    umount -l                                           "$OBJETIVO"                                 ; \
    mount -a 2>/dev/null
    }
    
    function desmontar(){
    
    # Desmontar
    
    umount -l           "$OBJETIVO"                         ; \
    mount -a 2>/dev/null
    
    }
    
    
    #Este guión necesita ser ejecutado como SuperUsuario
    #o en su defecto con permisos administrativos suficientes
    #Para montar / desmontar particiones.
    
    if [ "$(whoami)" != root ]; then
    
        echo
        echo
        echo 'Por favor ejecuta este guion como SuperUsuario (root)'
        echo
        echo 'Utilice este guión bajo su Propio Riesgo'
        echo 'El Autor , o sea yo , no me hago responsable'
        echo 'de las consecuencias imprevistas que puedan'
        echo 'acontecer en tu sistema operativo'
        echo
    else
    
    # Proceder en caso de tener los permisos suficientes para montar/desmontar particiones :
    
    #Si el usuario no pasa ningún parámetro indicar como se usa este guion
    
                if [ -z "$1" ]; then
                        MensajeBase
                fi
    
    #Guion : Aquí se ha definido como se utilizara este guion correctamente para montar o desmontar la partición Objetivo
    #Entrada : Cualquier palabra pasada por el parámetro $1 sera convertida en minúsculas
    
    Entrada=$(echo "$1" | tr -s  '[:upper:]'  '[:lower:]')
    
                if [ "$Entrada" == "montar" ]; then
                        montar
                fi
    
                if [ "$Entrada" == "xephyr" ]; then
                        xephyr
                fi
    
                if [ "$Entrada" == "desmontar" ]; then
                        desmontar
                fi
    
    #Finalizar la condición global de requerir usar el SuperUsuario o en su defectos permisos administrativos
    #Para poder (des)montar particiones :
    
    fi
    
    #Finalizar este guion sin problemas :
    
    $(exit 0)
    

    备注:

    一个。#AUDIO & #NV-GLX 部分是真的不需要它

    湾。因为使用它进行测试,所以我尝试直接在 chroot 上编译 nvidia-legacy304 驱动程序,结果非常糟糕,现在我的 Slackware64 14.2 上没有 3D/DRI,因为我无法编译“nvidia-legacy304-kernel”我只是收到以下错误:

    Creating directory NVIDIA-Linux-x86_64-304.137
    Verifying archive integrity... OK
    Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 
    
    
    304.137................................................................................................................................................................
    If you are using a Linux 2.4 kernel, please make sure
    you either have configured kernel sources matching your
    kernel or the correct set of kernel headers installed
    on your system.
    
    If you are using a Linux 2.6 kernel, please make sure
    you have configured kernel sources matching your kernel
    installed on your system. If you specified a separate
    output directory using either the "KBUILD_OUTPUT" or
    the "O" KBUILD parameter, make sure to specify this
    directory with the SYSOUT environment variable or with
    the equivalent nvidia-installer command line option.
    
    Depending on where and how the kernel sources (or the
    kernel headers) were installed, you may need to specify
    their location with the SYSSRC environment variable or
    the equivalent nvidia-installer command line option.
    
    *** Unable to determine the target kernel version. ***
    
    makefile:53: fallo en las instrucciones para el objetivo 'select_makefile'
    
    • 0

相关问题

  • 通过命令的标准输出以编程方式导出环境变量[重复]

  • 从文本文件传递变量的奇怪问题

  • 虽然行读取保持转义空间?

  • `tee` 和 `bash` 进程替换顺序

  • 运行一个非常慢的脚本直到它成功

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve