Skip to Content

安装一步到位中文包V4.1.0.11,不能正确挂载硬盘分区

aggov 的头像
#3260
.pup_event有哪里生成?还机子又重新生成,报错,插新U盘,又重新生成,报错。


按照制作自己的Puppy Linux Live-CD发行版的三种方法,的第二种方法,打了个包,不错啊,这么就不怕折腾损坏个人文件了。
#3261
labrador 的头像
.pup_event目录中的内容是根据/usr/local/bin/drive_all生成的。

有报错最好贴一下提示信息,也好帮你分析。
#3262
Failed to execute child process "/root/.pup_event/drive_sdc1/AppRun" (Permission denied)
#3263
新的AppRun
#!/bin/sh
#(c) Copyright 2008 Barry Kauler, puppylinux.com
#2008 Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html)
#/sbin/pup_eventd creates a desktop icon and copy of this script for each drive, ex:
# for drive sda: cp -a /usr/local/bin/drive_all /root/.pup_event/drive_sda/AppRun
#this script is launched by pup_eventd when the icon is first created. also,
#this script is launched when user clicks on deskop icon (former is configurable,
# see /usr/sbin/eventmanager.
#passed param is category of drive: card, floppy, optical, usbdrv, drive.
#v4.0.2 jun08: first write of this script, expanding 'pup_eventd' management.
#v403 icon menu, can call with 'unmount', 'eventmanager' and 'pmount_<DRV_CATEGORY>' params.
. /usr/bin/localization
FSTYPE=""
[ $2 ] && FSTYPE="$2" #see pup_eventd

#extract drive name from end of the script name...
#note, when click on desktop icon, /root/.pup_event/drive_<ONEDRVNAME> is executed,
#however a script may run /root/.pup_event/drive_<ONEDRVNAME>/AppRun ...
ONEDRVNAME="`echo "${0}" | sed -e 's%/AppRun%%' | rev | cut -f 1 -d '_' | rev`"

if [ "`echo "${1}" | grep 'pmount_'`" != "" ];then #v403 chose pmount from drive icon menu.
DRV_CATEGORY="`echo -n "${1}" | cut -f 2 -d '_'`"
if [ "`pidof gtkdialog_pmount`" != "" ];then #if pmount running, kill it.
killall gtkdialog_pmount 2>/dev/null
sleep 0.1
fi
exec pmount ${DRV_CATEGORY}
fi

if [ "$1" = "eventmanager" ];then #v403 chosen from drive icon menu.
#v405 'desktop' param, cutdown tabs for desktop drive icons only...
exec eventmanager desktop
fi

if [ "$1" = "unmount" ];then #v403 chose unmount from drive icon menu.
mPATTERN='^/dev/'"$ONEDRVNAME"' '
#MNTPT="`mount | grep "$mPATTERN" | cut -f 3 -d ' '`"
MNTPT="`df | grep "$mPATTERN" | tr -s ' ' | cut -f 6 -d ' '`"
[ "$MNTPT" = "" ] && exit #precaution.
if [ "$MNTPT" = "/" -o "`echo "$MNTPT" | grep '/initrd/'`" != "" ];then
xmessage -bg "#ff8080" -title "$(eval_gettext "Puppy drive manager")" -center "$(eval_gettext "/dev/\${ONEDRVNAME} mounted on \${MNTPT}
is in use by Puppy. You cannot unmount it.")"
exit
fi
rox -D $MNTPT
sync
while [ 1 ];do
umount $MNTPT ; umVAL=$?
#fix zombie process prevents partition unmount, invisible to fuser...
if [ $umVAL -ne 0 ];then
ZOMBIES="`ps -H -A | grep '<defunct>' | sed -e 's/ /|/g' | grep -v '|||' | cut -f 1 -d ' ' | tr '\n' ' '`"
for ONEZOMBIE in $ZOMBIES
do
echo "$(eval_gettext "Killing parentless zombie process \$ONEZOMBIE")"
kill $ONEZOMBIE
done
umount $MNTPT ; umVAL=$?
fi
#rare ocassion, partition got unmounted before umount runs above...
umPATTERN="${MNTPT} "
[ "`busybox mount | grep "$umPATTERN"`" = "" ] && umVAL=0
if [ $umVAL -ne 0 ];then
EXTRAMSG0="`fuser -v -m $MNTPT`"
if [ "$EXTRAMSG0" = "" ];then
xmessage -bg "#ff8080" -title "$(eval_gettext "Puppy drive manager: ERROR")" -center "$(eval_gettext "FAILURE! In the case of removable media, the most
common reason is the media is not currently inserted.
If so, please remedy.")"
else
xmessage -bg "#ff00ff" -title "KILL, KILL..." -center -buttons KILL:10,EXIT:20 "$(eval_gettext "FAILURE! One or more processes (programs) are currently
using /dev/\${ONEDRVNAME}. Here they are:
\$EXTRAMSG0

If you press the \"KILL\" button, Puppy will attempt to
kill the offending programs for you. Only do this as a
last resort. Firstly you should try to close the programs
manually, so do not press \"KILL\".
PLEASE PRESS THE \"EXIT\" BUTTON!")"
if [ $? -eq 10 ];then
fuser -k -m $MNTPT
continue
fi
fi
else
[ "$ONEDRVAME" = "sr0" -o "$ONEDRVAME" = "sr1" ] && eject /dev/$ONEDRVNAME
fi
break
done
exit
fi

DRV_CATEGORY="${1}"
[ "$DRV_CATEGORY" = "" ] && DRV_CATEGORY="drive" #precaution.
[ "$DRV_CATEGORY" = "all" ] && DRV_CATEGORY="drive" #precaution.

[ -f /etc/eventmanager ] && . /etc/eventmanager #written by /usr/sbin/eventmanager
[ "$ICONDESK" != "true" -a "$ICONDESK" != "false" ] && ICONDESK="true"
[ ! $RAMSAVEINTERVAL ] && RAMSAVEINTERVAL=30
[ "$HOTPLUGNOISY" != "true" -a "$HOTPLUGNOISY" != "false" ] && HOTPLUGNOISY="false"
[ "$AUTOTARGET" != "true" -a "$AUTOTARGET" != "false" ] && AUTOTARGET="true"
[ "$ICONPARTITIONS" != "true" -a "$ICONPARTITIONS" != "false" ] && ICONPARTITIONS="true"

#if ICONDESK=false (see /etc/eventmanager and /sbin/pup_eventd) then there will only
#be one icon on the desktop, labelled 'drives' and handler script is /usr/local/bin/drive_drives
if [ "$ONEDRVNAME" = "drives" ];then
if [ "`pidof gtkdialog_pmount`" != "" ];then #if pmount running, kill it.
killall gtkdialog_pmount 2>/dev/null
sleep 0.1
fi
exec pmount $DRV_CATEGORY
fi

#decision... we can bring up a "handler" window, that explains things, good for beginners.
#or jump direct to most appropriate target application, or do nothing.
#for now only have AUTOTARGET=true go direct to most appropriate target app,
# =false always start Pmount.
if [ "$AUTOTARGET" = "false" ];then
if [ "`pidof gtkdialog_pmount`" != "" ];then #if pmount running, kill it.
killall gtkdialog_pmount 2>/dev/null
sleep 0.1
fi
exec pmount $DRV_CATEGORY
fi

#oh, now have to analyse the media, decide what app to run...
if [ "$ONEDRVNAME" = "sr0" -o "$ONEDRVNAME" = "sr1" ];then
srPATTERN='^/dev/'"$ONEDRVNAME"' '
if [ "`busybox mount | grep "$srPATTERN"`" = "" ];then
cddetect -q -d/dev/${ONEDRVNAME}
RETVAL=$?
case $RETVAL in
3) #iso file: normal data cd.
true
;;
1) #audio
ln -snf /dev/${ONEDRVNAME} /dev/cdrom
exec defaultmediaplayer cdda://
;;
5) #video dvd
ln -snf /dev/${ONEDRVNAME} /dev/dvd
exec defaultmediaplayer dvd://
;;
0) #failed to detect type.
#cddetect does not work properly for dvd's, try something else...
if [ "`dvd+rw-mediainfo /dev/sr0 | grep 'Mounted Media: .* DVD-ROM'`" != "" ];then
ln -snf /dev/${ONEDRVNAME} /dev/dvd
exec defaultmediaplayer dvd://
fi
;;
esac
fi
FSTYPE="iso9660"
fi

#if dropped down here, it is likely to be a data partition...
#if it is a mountable partition then mount and open with rox. If already mntd then open in rox...
#if [ "$ICONPARTITIONS" = "true" ];then
if [ "$FSTYPE" != "" ];then
dPATTERN='^/dev/'"$ONEDRVNAME"' '
if [ "`df | grep "$dPATTERN"`" = "" ];then
#not mounted...

DODEV=/dev/$ONEDRVNAME
DEVNAME=$ONEDRVNAME
MNTPT="`cat /etc/fstab | awk -v "DEV=$DODEV" '$1==DEV {print $2; exit}'`"
if [ -z "$MNTPT" ]; then
UUID="`blkid | grep "^$DODEV:" | grep -o 'UUID=\"[^\"]*' | sed 's/\"//g'`"
MNTPT="`cat /etc/fstab | awk -v "DEV=$UUID" 'toupper($1)==toupper(DEV) {print $2; exit}'`"
fi
if [ -z "$MNTPT" ]; then
MNTPT=/mnt/$DEVNAME
else
MNTPT="`echo -n "$MNTPT" | sed 's/\\\\040/ /g'`"
# It seems that mount in PUP4 doesn't work if the mountpoint contains space character,
# so we fall back to old mountpoint in this case. If PUP4 fixes this problem in future,
# remove the following line, and this comment, of course.
echo -n "$MNTPT" | grep " " && MNTPT=/mnt/$DEVNAME
fi

mkdir -p "$MNTPT"
case $FSTYPE in
ntfs)
#'mount' is a script that takes care of mounting ntfs...
mount -t ntfs -o nls=utf8 $DODEV "$MNTPT"
RETVAL1=$?
;;
vfat)
mount -t vfat -o shortname=mixed,quiet,utf8 $DODEV "$MNTPT"
RETVAL1=$?
;;
iso9660)
mount -t iso9660 -o utf8 $DODEV "$MNTPT"
RETVAL1=$?
;;
*)
mount -t $DOFS $DODEV "$MNTPT"
RETVAL1=$?
;;
esac
[ $RETVAL1 -eq 0 ] && exec rox -x "$MNTPT" -d "$MNTPT"
else
#mounted...
MNTPT="`df | grep "$dPATTERN" | tr -s ' ' | cut -f 6 -d ' '`"
if [ -h /mnt/home ];then
[ "`readlink /mnt/home`" = "$MNTPT" ] && MNTPT="/mnt/home"
fi
#exec rox -x /mnt/$ONEDRVNAME -d /mnt/$ONEDRVNAME
exec rox -x $MNTPT -d $MNTPT
fi
fi


#NOTE: if pmount already running, don't really want to kill then restart,
# just want to bring the window up if it's minimised ...how?

if [ "`pidof gtkdialog_pmount`" != "" ];then #if pmount running, kill it.
killall gtkdialog_pmount 2>/dev/null
sleep 0.1
fi

exec pmount ${DRV_CATEGORY}

###END###
#3264
英文原版
#!/bin/sh
#(c) Copyright 2008 Barry Kauler, puppylinux.com
#2008 Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html)
#/sbin/pup_eventd creates a desktop icon and copy of this script for each drive, ex:
# for drive sda: cp -a /usr/local/bin/drive_all /root/.pup_event/drive_sda/AppRun
#this script is launched by pup_eventd when the icon is first created. also,
#this script is launched when user clicks on deskop icon (former is configurable,
# see /usr/sbin/eventmanager.
#passed param is category of drive: card, floppy, optical, usbdrv, drive.
#v4.0.2 jun08: first write of this script, expanding 'pup_eventd' management.
#v403 icon menu, can call with 'unmount', 'eventmanager' and 'pmount_<DRV_CATEGORY>' params.
#v411 added 'quiet' option for vfat, suppresses error msg when file attribs not preserved on copy.

FSTYPE=""
[ $2 ] && FSTYPE="$2" #see pup_eventd

#extract drive name from end of the script name...
#note, when click on desktop icon, /root/.pup_event/drive_<ONEDRVNAME> is executed,
#however a script may run /root/.pup_event/drive_<ONEDRVNAME>/AppRun ...
ONEDRVNAME="`echo "${0}" | sed -e 's%/AppRun%%' | rev | cut -f 1 -d '_' | rev`"

if [ "`echo "${1}" | grep 'pmount_'`" != "" ];then #v403 chose pmount from drive icon menu.
DRV_CATEGORY="`echo -n "${1}" | cut -f 2 -d '_'`"
if [ "`pidof gtkdialog_pmount`" != "" ];then #if pmount running, kill it.
killall gtkdialog_pmount 2>/dev/null
sleep 0.1
fi
exec pmount ${DRV_CATEGORY}
fi

if [ "$1" = "eventmanager" ];then #v403 chosen from drive icon menu.
#v405 'desktop' param, cutdown tabs for desktop drive icons only...
exec eventmanager desktop
fi

if [ "$1" = "unmount" ];then #v403 chose unmount from drive icon menu.
mPATTERN='^/dev/'"$ONEDRVNAME"' '
#MNTPT="`mount | grep "$mPATTERN" | cut -f 3 -d ' '`"
MNTPT="`df | grep "$mPATTERN" | tr -s ' ' | cut -f 6 -d ' '`"
[ "$MNTPT" = "" ] && exit #precaution.
if [ "$MNTPT" = "/" -o "`echo "$MNTPT" | grep '/initrd/'`" != "" ];then
xmessage -bg "#ff8080" -title "Puppy drive manager" -center "/dev/${ONEDRVNAME} mounted on ${MNTPT}
is in use by Puppy. You cannot unmount it."
exit
fi
rox -D $MNTPT
sync
while [ 1 ];do
umount $MNTPT ; umVAL=$?
#fix zombie process prevents partition unmount, invisible to fuser...
if [ $umVAL -ne 0 ];then
ZOMBIES="`ps -H -A | grep '<defunct>' | sed -e 's/ /|/g' | grep -v '|||' | cut -f 1 -d ' ' | tr '\n' ' '`"
for ONEZOMBIE in $ZOMBIES
do
echo "Killing parentless zombie process $ONEZOMBIE"
kill $ONEZOMBIE
done
umount $MNTPT ; umVAL=$?
fi
#rare ocassion, partition got unmounted before umount runs above...
umPATTERN="${MNTPT} "
[ "`busybox mount | grep "$umPATTERN"`" = "" ] && umVAL=0
if [ $umVAL -ne 0 ];then
EXTRAMSG0="`fuser -v -m $MNTPT`"
if [ "$EXTRAMSG0" = "" ];then
xmessage -bg "#ff8080" -title "Puppy drive manager: ERROR" -center "FAILURE! In the case of removable media, the most
common reason is the media is not currently inserted.
If so, please remedy."
else
xmessage -bg "#ff00ff" -title "KILL, KILL..." -center -buttons KILL:10,EXIT:20 "FAILURE! One or more processes (programs) are currently
using /dev/${ONEDRVNAME}. Here they are:
$EXTRAMSG0

If you press the \"KILL\" button, Puppy will attempt to
kill the offending programs for you. Only do this as a
last resort. Firstly you should try to close the programs
manually, so do not press \"KILL\".
PLEASE PRESS THE \"EXIT\" BUTTON!"
if [ $? -eq 10 ];then
fuser -k -m $MNTPT
continue
fi
fi
else
[ "$ONEDRVAME" = "sr0" -o "$ONEDRVAME" = "sr1" ] && eject /dev/$ONEDRVNAME
fi
break
done
exit
fi

DRV_CATEGORY="${1}"
[ "$DRV_CATEGORY" = "" ] && DRV_CATEGORY="drive" #precaution.
[ "$DRV_CATEGORY" = "all" ] && DRV_CATEGORY="drive" #precaution.

[ -f /etc/eventmanager ] && . /etc/eventmanager #written by /usr/sbin/eventmanager
[ "$ICONDESK" != "true" -a "$ICONDESK" != "false" ] && ICONDESK="true"
[ ! $RAMSAVEINTERVAL ] && RAMSAVEINTERVAL=30
[ "$HOTPLUGNOISY" != "true" -a "$HOTPLUGNOISY" != "false" ] && HOTPLUGNOISY="false"
[ "$AUTOTARGET" != "true" -a "$AUTOTARGET" != "false" ] && AUTOTARGET="true"
[ "$ICONPARTITIONS" != "true" -a "$ICONPARTITIONS" != "false" ] && ICONPARTITIONS="true"

#if ICONDESK=false (see /etc/eventmanager and /sbin/pup_eventd) then there will only
#be one icon on the desktop, labelled 'drives' and handler script is /usr/local/bin/drive_drives
if [ "$ONEDRVNAME" = "drives" ];then
if [ "`pidof gtkdialog_pmount`" != "" ];then #if pmount running, kill it.
killall gtkdialog_pmount 2>/dev/null
sleep 0.1
fi
exec pmount $DRV_CATEGORY
fi

#decision... we can bring up a "handler" window, that explains things, good for beginners.
#or jump direct to most appropriate target application, or do nothing.
#for now only have AUTOTARGET=true go direct to most appropriate target app,
# =false always start Pmount.
if [ "$AUTOTARGET" = "false" ];then
if [ "`pidof gtkdialog_pmount`" != "" ];then #if pmount running, kill it.
killall gtkdialog_pmount 2>/dev/null
sleep 0.1
fi
exec pmount $DRV_CATEGORY
fi

#oh, now have to analyse the media, decide what app to run...
if [ "$ONEDRVNAME" = "sr0" -o "$ONEDRVNAME" = "sr1" ];then
srPATTERN='^/dev/'"$ONEDRVNAME"' '
if [ "`busybox mount | grep "$srPATTERN"`" = "" ];then
cddetect -q -d/dev/${ONEDRVNAME}
RETVAL=$?
case $RETVAL in
3) #iso file: normal data cd.
true
;;
1) #audio
ln -snf /dev/${ONEDRVNAME} /dev/cdrom
exec defaultmediaplayer cdda://
;;
5) #video dvd
ln -snf /dev/${ONEDRVNAME} /dev/dvd
exec defaultmediaplayer dvd://
;;
0) #failed to detect type.
#cddetect does not work properly for dvd's, try something else...
if [ "`dvd+rw-mediainfo /dev/sr0 | grep 'Mounted Media: .* DVD-ROM'`" != "" ];then
ln -snf /dev/${ONEDRVNAME} /dev/dvd
exec defaultmediaplayer dvd://
fi
;;
esac
fi
FSTYPE="iso9660"
fi

#if dropped down here, it is likely to be a data partition...
#if it is a mountable partition then mount and open with rox. If already mntd then open in rox...
#if [ "$ICONPARTITIONS" = "true" ];then
if [ "$FSTYPE" != "" ];then
dPATTERN='^/dev/'"$ONEDRVNAME"' '
if [ "`df | grep "$dPATTERN"`" = "" ];then
#not mounted...
mkdir -p /mnt/$ONEDRVNAME
case $FSTYPE in
ntfs)
#'mount' is a script that takes care of mounting ntfs...
mount -t ntfs /dev/$ONEDRVNAME /mnt/$ONEDRVNAME
RETVAL1=$?
;;
vfat)
mount -t vfat -o shortname=mixed,quiet /dev/$ONEDRVNAME /mnt/$ONEDRVNAME #v411
RETVAL1=$?
;;
*)
mount -t $FSTYPE /dev/$ONEDRVNAME /mnt/$ONEDRVNAME
RETVAL1=$?
;;
esac
[ $RETVAL1 -eq 0 ] && exec rox -x /mnt/$ONEDRVNAME -d /mnt/$ONEDRVNAME
else
#mounted...
MNTPT="`df | grep "$dPATTERN" | tr -s ' ' | cut -f 6 -d ' '`"
if [ -h /mnt/home ];then
[ "`readlink /mnt/home`" = "$MNTPT" ] && MNTPT="/mnt/home"
fi
#exec rox -x /mnt/$ONEDRVNAME -d /mnt/$ONEDRVNAME
exec rox -x $MNTPT -d $MNTPT
fi
fi


#NOTE: if pmount already running, don't really want to kill then restart,
# just want to bring the window up if it's minimised ...how?

if [ "`pidof gtkdialog_pmount`" != "" ];then #if pmount running, kill it.
killall gtkdialog_pmount 2>/dev/null
sleep 0.1
fi

exec pmount ${DRV_CATEGORY}

###END###
#3265
谢老大,在
/usr/local/bin/drive_all
用原版drive_all替换就好
#3266
labrador 的头像
在虚拟终端下运行
chmod +x /usr/local/bin/drive_all
rm -rf /root/.pup_event/*
然后重启X应该就可以了。中文包打包的时候没有给drive_all加上可执行的属性。
#3267
刚打好包,一会再从新打

发表新评论

  • 你可以在文本中使用BBCode标记语言。 URL会自动被转为链接。

更多关於格式化选项的信息

CAPTCHA
请验证您是否是机器人。
Image CAPTCHA
Enter the characters shown in the image.