mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-14 11:02:04 +08:00
优化lib挂载方式
This commit is contained in:
@@ -4,24 +4,81 @@ if [[ ! -d "$CURRENT_DIR/usr" ]]; then
|
||||
zenity --info --text=未安装运行库,无法运行 --no-wrap
|
||||
exit
|
||||
fi
|
||||
systemNeedCommand=""
|
||||
for libr in `ls /usr/lib`
|
||||
do
|
||||
if [[ -f /usr/lib/$libr/libc.so.6 ]]; then
|
||||
if [[ ! -f "$CURRENT_DIR/usr/lib/$libr/libc.so.6" ]]; then
|
||||
echo $libr
|
||||
systemNeedCommand="$systemNeedCommand --ro-bind /usr/lib/$libr/ /usr/lib/$libr/ "
|
||||
mkdir -p "$CURRENT_DIR/usr/lib/$libr"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
for libr in `ls /usr/lib/ld*.so*`
|
||||
do
|
||||
if [[ -f $libr ]]; then
|
||||
if [[ ! -f "$CURRENT_DIR/$libr" ]]; then
|
||||
systemNeedCommand="$systemNeedCommand --ro-bind $libr $libr "
|
||||
touch "$CURRENT_DIR/$libr"
|
||||
else
|
||||
if [[ ! -s "$CURRENT_DIR/$libr" ]]; then
|
||||
systemNeedCommand="$systemNeedCommand --ro-bind $libr $libr "
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [[ -L /usr/lib64 ]] && [[ ! -d "$CURRENT_DIR/usr/lib64" ]]; then
|
||||
mkdir -p "$CURRENT_DIR/usr/lib64"
|
||||
fi
|
||||
for libr in `ls /usr/lib64/ld*.so*`
|
||||
do
|
||||
if [[ -f $libr ]]; then
|
||||
if [[ ! -f "$CURRENT_DIR/$libr" ]]; then
|
||||
systemNeedCommand="$systemNeedCommand --ro-bind $libr $libr "
|
||||
touch "$CURRENT_DIR/$libr"
|
||||
else
|
||||
if [[ ! -s "$CURRENT_DIR/$libr" ]]; then
|
||||
systemNeedCommand="$systemNeedCommand --ro-bind $libr $libr "
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [[ ! -d "$CURRENT_DIR/usr/lib/locale" ]]; then
|
||||
systemNeedCommand="$systemNeedCommand --ro-bind /usr/lib/locale /usr/lib/locale "
|
||||
fi
|
||||
echo $systemNeedCommand
|
||||
if [[ ! -d "$CURRENT_DIR/usr/lib64" ]]; then
|
||||
bwrap --dev-bind / / \
|
||||
--ro-bind "$CURRENT_DIR/usr/lib" /lib \
|
||||
--ro-bind "$CURRENT_DIR/usr" /usr \
|
||||
--bind "$CURRENT_DIR/usr/lib" /lib \
|
||||
--bind "$CURRENT_DIR/usr" /usr \
|
||||
--ro-bind /usr/share /usr/share \
|
||||
--ro-bind /usr/bin /usr/bin \
|
||||
--ro-bind /usr/sbin /usr/sbin \
|
||||
$systemNeedCommand \
|
||||
-- "$@"
|
||||
exit
|
||||
fi
|
||||
if [[ ! -f /lib64 ]] && [[ ! -d /lib64 ]] && [[ ! -L /lib64 ]]; then
|
||||
pkexec mkdir /lib64 -p
|
||||
pkexec ln -s /usr/lib64 /lib64
|
||||
fi
|
||||
if [[ -L /lib64 ]] || [[ -d /lib64 ]] || [[ -f /lib64 ]];then
|
||||
bwrap --dev-bind / / \
|
||||
--bind "$CURRENT_DIR/usr/lib" /lib \
|
||||
--bind "$CURRENT_DIR/usr/lib64" /lib \
|
||||
--bind "$CURRENT_DIR/usr" /usr \
|
||||
--ro-bind /usr/share /usr/share \
|
||||
--ro-bind /usr/bin /usr/bin \
|
||||
--ro-bind /usr/sbin /usr/sbin \
|
||||
$systemNeedCommand \
|
||||
-- "$@"
|
||||
exit
|
||||
fi
|
||||
bwrap --dev-bind / / \
|
||||
--ro-bind "$CURRENT_DIR/usr/lib" /lib \
|
||||
--ro-bind "$CURRENT_DIR/usr/lib64" /lib \
|
||||
--ro-bind "$CURRENT_DIR/usr" /usr \
|
||||
--bind "$CURRENT_DIR/usr/lib" /lib \
|
||||
--bind "$CURRENT_DIR/usr" /usr \
|
||||
--ro-bind /usr/share /usr/share \
|
||||
--ro-bind /usr/bin /usr/bin \
|
||||
--ro-bind /usr/sbin /usr/sbin \
|
||||
$systemNeedCommand \
|
||||
-- "$@"
|
||||
|
||||
Reference in New Issue
Block a user