无忧启动论坛
标题:
GEEXBOX 无法加载USB的声卡驱动
[打印本页]
作者:
znlive
时间:
2011-12-5 14:11
标题:
GEEXBOX 无法加载USB的声卡驱动
在XP或WIN7下都是免驱的,要怎么在GEEXBOX下装驱动啊?
怎么办?
求助了。
作者:
znlive
时间:
2011-12-5 21:10
怎么办啊。。。啊。。。
作者:
rockrock99
时间:
2011-12-5 21:36
改输出就OK了,每个设置都测试下,总有一款适合你
作者:
znlive
时间:
2011-12-5 23:18
标题:
回复 #3 rockrock99 的帖子
在哪里设置啊。要怎么弄。有方法 吗?
作者:
我是神仙
时间:
2011-12-5 23:28
自己研究一下启动时的搜索代码,也许能找到方法?
#!/bin/sh
dbg_echo () {
[ "$QUIET" = yes ] || echo $*
return
}
# install busybox symlinks
/bin/busybox --install -s
export PATH=/sbin:/bin
# mount required filesystems
busybox mount -t proc none /proc
busybox mount -t sysfs none /sys
# prepare /dev
mount -t devtmpfs devtmpfs /dev
echo '/bin/mdev' > /proc/sys/kernel/hotplug
mdev -s
# splash
/bin/ply-image /plymouth/splash.png
# parse kernel cmdline
for arg in $(cat /proc/cmdline); do
case $arg in
root=*)
ROOT="${arg#root=}"
;;
data=*)
DATA="${arg#data=}"
;;
init=*)
INIT="${arg#init=}"
;;
quiet)
QUIET=yes
;;
persistent)
PERSISTENT=yes
;;
initshell)
echo "Dropping to shell as requested"
exec sh
;;
esac
done
# try to mount the rootfs specified in cmdline...
if [ -n "$ROOT" ]; then
dbg_echo -n "Trying root=$ROOT as requested..."
if mount -o ro $ROOT /mnt >/dev/null 2>&1; then
if mount -t squashfs /mnt/rootfs /squashfs >/dev/null 2>&1; then
dbg_echo "found."
else
dbg_echo "failed, cannot mount squashfs."
umount /mnt
unset ROOT
fi
else
dbg_echo "failed, cannot mount device."
unset ROOT
fi
fi
# ...otherwise just scan the block devices for rootfs
if [ -z "$ROOT" ]; then
dbg_echo "Scanning for root device:"
cd /sys/block
for i in 0 1 2 3 4 5 6 7 8 9; do
for dev in *; do
echo $dev | grep -q loop && continue
echo $dev | grep -q ram && continue
dbg_echo -n "[$i] Trying $dev..."
if ! mount -o ro /dev/$dev /mnt >/dev/null 2>&1; then
# check for removable devices not built with isohybrid support
if [ $(cat /sys/block/$dev/removable) = 1 ]; then
dbg_echo -n "[$i] Trying ${dev}1..."
if ! mount -o rw /dev/${dev}1 /mnt >/dev/null 2>&1; then
dbg_echo "failed, cannot mount device."
continue
fi
else
dbg_echo "failed, cannot mount device."
continue
fi
fi
if mount -t squashfs /mnt/rootfs /squashfs >/dev/null 2>&1; then
dbg_echo "found."
FOUND_ROOTFS=yes
break
else
dbg_echo "failed, cannot mount squashfs."
umount /mnt
fi
done
[ -n "$FOUND_ROOTFS" ] && break
sleep 1
done
cd /
fi
[ -z "$INIT" ] && INIT=/bin/systemd
if [ ! -x /squashfs/$INIT ]; then
echo "Cannot find a valid root filesystem, dropping to shell"
exec sh
fi
# setup aufs
if [ "$PERSISTENT" = yes ]; then
DATA=/mnt/casper-rw
PERSISTENT_OPT="-o loop -t ext2"
[ ! -f "$DATA" ] && unset DATA && unset PERSISTENT_OPT
fi
if [ -n "$DATA" ]; then
if ! mount $PERSISTENT_OPT -o rw,noatime $DATA /rw; then
echo "Cannot mount data partition, using tmpfs instead"
unset DATA
fi
fi
[ -z "$DATA" ] && mount -t tmpfs none /rw
if ! mount -t aufs -o br=/rw:/squashfs none /newroot; then
echo "Cannot mount aufs, dropping to shell"
exec sh
fi
# move backed filesystems inside newroot otherwise aufs won't work properly
mkdir -p /newroot/run
mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /newroot/run
mkdir -p /newroot/.data /newroot/.squashfs /newroot/.root
mount --move /rw /newroot/.data
mount --move /squashfs /newroot/.squashfs
mount --move /mnt /newroot/.root
mkdir -p /newroot/run/initramfs/bin /newroot/run/initramfs/sbin
cp -P /bin/busybox /bin/sh /newroot/run/initramfs/bin/
cp -P /bin/shutdown /newroot/run/initramfs/
INIT_ARGS=`cat /proc/cmdline`
# Reset kernel hotplugging
echo "" > /proc/sys/kernel/hotplug
umount /sys
umount /dev
umount /proc
# Change to the new root partition and execute /sbin/init
if ! exec /bin/busybox switch_root /newroot $INIT $INIT_ARGS; then
echo "Failed, dropping to shell"
/bin/busybox mount -t proc none /proc
/bin/busybox mount -t sysfs none /sys
exec sh
fi
复制代码
作者:
znlive
时间:
2011-12-6 09:02
标题:
回复 #5 我是神仙 的帖子
看了半天没研究出来什么啊。郁闷。实力不够。
作者:
rockrock99
时间:
2011-12-7 00:31
标题:
回复 #4 znlive 的帖子
系统的设置里面,或在播放的时候也有地方可以更改设置
作者:
my9823
时间:
2011-12-7 08:09
# prepare /dev
mount -t devtmpfs devtmpfs /dev
echo '/bin/mdev' > /proc/sys/kernel/hotplug
mdev -s
这个是创建设备?
作者:
我是神仙
时间:
2011-12-7 22:03
# parse kernel cmdline
for arg in $(cat /proc/cmdline); do
case $arg in
root=*)
ROOT="${arg#root=}"
;;
data=*)
DATA="${arg#data=}"
;;
init=*)
INIT="${arg#init=}"
;;
quiet)
QUIET=yes
;;
persistent)
PERSISTENT=yes
;;
initshell)
echo "Dropping to shell as requested"
exec sh
;;
esac
done
看来在启动时加参数 initshell 就可以直接进命令行模式?
PERSISTENT那个参数好像也检测得很简单,不能改位置。好像后面有个新的可以改casper-rw位置的initrd?
geexbox在initrd启动时没有NTFS驱动,访问不了NTFS的磁盘,所有不能放在ntfs盘。在后面加载了rootfs后才有了NTFS驱动,启动完了后倒是又可以访问NTFS盘上的资源了
那个CDLinux倒是把NTFS驱动也打包进initrd了,大得多。geexbox的initrd才500K,CDLinux的initrd是8M,一堆的驱动。
不知道能不能把CDLinux和GeexBox组合起来,用CDLinux的initrd 加上 GeexBox的 rootfs ? 这个完全搞不懂,只是猜想
作者:
我是神仙
时间:
2011-12-8 19:55
转帖一个修改版的initrd,替换为这个脚本后
GeexBox2.0就支持中文或从NTFS启动,好强大的脚本(其实就是windows中的批处理)
自己能写出这个脚本说明这位大侠已经可以自己做一个GeexBox了
--------------
原创文章,转载请注明:
转载自
下雨天
本文链接地址:
http://rain.orgfree.com/2011/11/23/geexbox2-0硬盘启动支持NTFS和ISO
#!/bin/sh
dbg_echo () {
[ -z "$DEBUG_FLAG" ] || echo "$*" >>/${DEBUG_TXT}
[ "$QUIET" = yes ] || echo $*
return
}
prase_from() {
[ -z "$FROM" ] && return
FROM_TYPE=${FROM%%:*}
FROM=${FROM#*:}
FROM_DEV=${FROM%%:*}
FROM_BASIC=${FROM##*:}
if [ "$FROM_TYPE" != "ISO" -a "$FROM_TYPE" != "DIR" ];then
dbg_echo "FROM_TYPE=$FROM_TYPE is unknown,Dropping to shell"
exec sh
fi
if [ ! -b "${FROM_DEV}" ];then
dbg_echo "dev=${FROM_DEV} no exsit,Dropping to shell"
exec sh
fi
}
#mount block dev
mount_dev() {
device_mnt=$1
dest=$2
shift 2
if [ ! -b "${device_mnt}" ]; then
return 2
fi
#echo "string=mount_cmd -o $* ${device_mnt} ${dest}"
if mount -o $* "${device_mnt}" "${dest}" >/dev/null 2>&1; then
return 0
else
if ntfs-3g -o $* "${device_mnt}" "${dest}" >/dev/null 2>&1; then
return 0
fi
return 1
fi
}
# install busybox symlinks
/bin/busybox --install -s
export PATH=/sbin:/bin
# mount required filesystems
busybox mount -t proc none /proc
busybox mount -t sysfs none /sys
# prepare /dev
mount -t devtmpfs devtmpfs /dev
echo '/bin/mdev' > /proc/sys/kernel/hotplug
mdev -s
# splash
/bin/ply-image /plymouth/splash.png
# parse kernel cmdline
for arg in $(cat /proc/cmdline); do
case $arg in
from=*)
FROM="${arg#from=}"
FROM_FLAG="yes"
;;
root=*)
ROOT="${arg#root=}"
;;
rootfs=*)
ROOTFS="${arg#rootfs=}"
;;
data=*)
DATA="${arg#data=}"
;;
init=*)
INIT="${arg#init=}"
;;
quiet)
QUIET=yes
;;
persistent*)
PERSISTENT="${arg#persistent=}"
[ -z "$PERSISTENT" ] && PERSISTENT=casper-rw
[ "$PERSISTENT" = persistent ] && PERSISTENT="/casper-rw"
;;
nocache)
NOCACHE=yes
;;
ro|rootro)
ROOT_MODE=ro
ROOT_MODE_PART=ro
;;
rw|rootrw)
ROOT_MODE=rw
ROOT_MODE_PART=rw
;;
nfsroot=*)
NFSROOT="${arg#nfsroot=}"
;;
ip=*)
IP="${arg#ip=}"
;;
initshell)
echo "Dropping to shell as requested"
exec sh
;;
debug)
DEBUG_FLAG="yes"
DEBUG_TXT="initrd.log"
;;
esac
done
# prase FROM parameter
prase_from
# if rootro, always mount root as r/o
# if rootrw, always mount root as r/w
# if neither, mount root as r/w only if persistent is enabled and we're
# mounting a partition (not a disk); otherwise, mount root as r/o
if [ -z "$ROOT_MODE" ]; then
ROOT_MODE=ro
if [ -n "$PERSISTENT" ]; then
ROOT_MODE_PART=rw
else
ROOT_MODE_PART=ro
fi
fi
#try to from iso or dir
if [ -n "$FROM_FLAG" ]; then
mkdir -p /.partition
mkdir -p /.cache
# if mount -o ro "$FROM_DEV" /.partition >/dev/null 2>&1; then
if mount_dev "$FROM_DEV" /.partition $ROOT_MODE_PART; then
echo -e "\033[36;1mmount FROM_DEV=$FROM_DEV sucess\033[0m"
dbg_echo "mount FROM_DEV=$FROM_DEV sucess"
case $FROM_TYPE in
ISO)
mkdir -p /.temp
if mount -o loop,ro /.partition/$FROM_BASIC /.temp >/dev/null 2>&1; then
if ! mount -t tmpfs tmpfs /.cache >/dev/null 2>&1; then
dbg_echo "get tmpfs failed"
exec sh
fi
cp /.temp/rootfs /.cache/rootfs
if ! mount --move /.cache /mnt >/dev/null 2>&1; then
dbg_echo "ISO deal failed: mount --move"
exec sh
fi
umount /.temp
umount /.partition
echo -e "\033[36;1mmount FROM_BASIC=$FROM_BASIC sucess\033[0m"
dbg_echo "mount FROM_BASIC=$FROM_BASIC sucess"
if mount -t squashfs /mnt/rootfs /squashfs >/dev/null 2>&1; then
dbg_echo "found."
FOUND_ROOTFS=yes
else
dbg_echo "failed, cannot mount squashfs."
umount /mnt
umount /.partition
fi
else
echo -e "\033[31;1mmount FROM_BASIC=$FROM_BASIC failed\033[0m"
dbg_echo "mount FROM_BASIC=$FROM_BASIC failed"
umount /.partition
exec sh
fi
;;
DIR)
if [ -z "$PERSISTENT" ] ; then
mount -t tmpfs tmpfs /.cache
cp /.partition/${FROM_BASIC}/rootfs /.cache/rootfs
mount --move /.cache /mnt
ROOTFS=/mnt/rootfs
umount /.partition
else
ROOTFS=/.partition/${FROM_BASIC}/rootfs
fi
if mount -t squashfs $ROOTFS /squashfs >/dev/null 2>&1; then
dbg_echo "found."
FOUND_ROOTFS=yes
else
dbg_echo "failed, cannot mount squashfs."
umount /.partition
fi
;;
esac
else
echo -e "\033[31;1mmount FROM_DEV=$FROM_DEV failed\033[0m"
deg_echo "mount FROM_DEV=$FROM_DEV failed"
exec sh
fi
fi
# try to mount the rootfs specified in cmdline ... and wait for slow device
[ -z "$ROOT" -a "$ROOTFS" = flat ] && ROOTFS="/rootfs"
[ -z "$ROOTFS" ] && ROOTFS="/rootfs"
if [ -z "$FROM_FLAG" -a -n "$ROOT" ]; then
COUNT="0 1 2 3 4 5 6 7 8 9"
for i in $COUNT; do
dbg_echo -n "[$i] Trying root=$ROOT as requested..."
# if mount -o $ROOT_MODE $ROOT /mnt >/dev/null 2>&1; then
if mount_dev $ROOT /mnt $ROOT_MODE; then
if [ "$ROOTFS" = flat ]; then
dbg_echo "found."
FOUND_ROOTFS=yes
break
elif mount -t squashfs /mnt/$ROOTFS /squashfs >/dev/null 2>&1; then
dbg_echo "found."
FOUND_ROOTFS=yes
break
else
dbg_echo "failed, cannot mount squashfs."
umount /mnt
fi
else
dbg_echo "failed, cannot mount device."
fi
sleep 1
done
[ -n "$FOUND_ROOTFS" ] || unset ROOT
unset FOUND_ROOTFS
fi
if [ -z "$FROM_FLAG" -a -n "$NFSROOT" ] ; then
dbg_echo -n "Trying nfsroot=$NFSROOT as requested..."
ROOT=/mnt
if [ -z "$IP" ] ; then
ifconfig eth0 up >/dev/null 2>&1
udhcpc -s /bin/assign-ip >/dev/null 2>&1
fi
if mount -o nolock,$ROOT_MODE_PART $NFSROOT /mnt >/dev/null 2>&1; then
if mount -t squashfs /mnt/rootfs /squashfs >/dev/null 2>&1; then
dbg_echo "found."
FOUND_ROOTFS=yes
else
dbg_echo -n "failed, cannot mount squashfs."
umount /mnt
fi
else
dbg_echo -n "failed, cannot mount $NFSROOT."
fi
[ -n "$FOUND_ROOTFS" ] || unset ROOT
unset FOUND_ROOTFS
fi
# ...otherwise just scan the block devices for rootfs
if [ -z "$FROM_FLAG" -a -z "$ROOT" ]; then
dbg_echo "Scanning for root device:"
cd /sys/block
for i in 0 1 2 3 4 5 6 7 8 9; do
for dev in *; do
echo $dev | grep -q loop && continue
echo $dev | grep -q ram && continue
dbg_echo -n "[$i] Trying $dev..."
# if mount -o $ROOT_MODE /dev/$dev /mnt >/dev/null 2>&1; then
if mount_dev /dev/$dev /mnt $ROOT_MODE; then
ROOT_DEV=$dev
if [ `cat /sys/block/$ROOT_DEV/device/type` -eq 5 ]; then
ROOT_TYPE=cdrom
else
ROOT_TYPE=disk
fi
else
########################################
for dev_part in `ls $dev | grep $dev`; do
dbg_echo -n "[$i] Trying ${dev_part}..."
# if ! mount -o $ROOT_MODE_PART /dev/${dev_part} /mnt >/dev/null 2>&1; then
if ! mount_dev /dev/${dev_part} /mnt $ROOT_MODE_PART; then
dbg_echo "failed, cannot mount device."
else
if mount -t squashfs /mnt/$ROOTFS /squashfs >/dev/null 2>&1; then
dbg_echo "found."
FOUND_ROOTFS=yes
ROOT_DEV=${dev_part}
ROOT_TYPE=disk
break 2
else
dbg_echo "failed, cannot mount squashfs."
umount /mnt
fi
fi
done
#####################################
fi
if [ "$ROOT_TYPE" = cdrom -a -z "$NOCACHE" ]; then
mkdir /cache
mount -t tmpfs tmpfs /cache
cp /mnt/$ROOTFS /cache/rootfs
ROOTFS=/rootfs
umount /mnt
eject -s $ROOT_DEV >/dev/null 2>&1 || eject $ROOT_DEV >/dev/null 2>&1
mount --move /cache /mnt
fi
if mount -t squashfs /mnt/$ROOTFS /squashfs >/dev/null 2>&1; then
dbg_echo "found."
FOUND_ROOTFS=yes
break
else
dbg_echo "failed, cannot mount squashfs."
umount /mnt
fi
done
[ -n "$FOUND_ROOTFS" ] && break
sleep 1
done
cd /
fi
[ -z "$INIT" ] && INIT=/bin/systemd
if [ "$ROOTFS" = flat ]; then
if [ ! -x /mnt/$INIT ]; then
echo "Cannot find a valid root filesystem, dropping to shell"
exec sh
fi
mount --move /mnt /newroot
else
if [ ! -x /squashfs/$INIT ]; then
echo "Cannot find a valid root filesystem, dropping to shell"
exec sh
fi
# setup aufs
if [ -n "$PERSISTENT" ]; then
DATA=/mnt/$PERSISTENT
PERSISTENT_OPT="-o loop -t ext2"
if [ -n "$FROM_FLAG" ];then
case $FROM_TYPE in
ISO)
unset DATA
;;
DIR)
DATA=/.partition/$FROM_BASIC/casper-rw
;;
esac
fi
[ ! -f "$DATA" ] && unset DATA && unset PERSISTENT_OPT
fi
if [ -n "$DATA" ]; then
if ! mount $PERSISTENT_OPT -o rw,noatime $DATA /rw; then
dgb_echo "Cannot mount data partition, using tmpfs instead"
unset DATA
exec sh
fi
fi
[ -z "$DATA" ] && mount -t tmpfs none /rw
if ! mount -t aufs -o br=/rw:/squashfs none /newroot; then
dbg_echo "Cannot mount aufs, dropping to shell"
exec sh
fi
# move backed filesystems inside newroot otherwise aufs won't work properly
mkdir -p /newroot/run
mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /newroot/run
mkdir -p /newroot/.data /newroot/.squashfs /newroot/.root
mount --move /rw /newroot/.data
mount --move /squashfs /newroot/.squashfs
mount --move /mnt /newroot/.root
mkdir -p /newroot/run/initramfs/bin /newroot/run/initramfs/sbin
cp -P /bin/busybox /bin/sh /newroot/run/initramfs/bin/
cp -P /bin/shutdown /newroot/run/initramfs/
fi
INIT_ARGS=`cat /proc/cmdline`
# Reset kernel hotplugging
echo "" > /proc/sys/kernel/hotplug
umount /sys
umount /dev
umount /proc
# Change to the new root partition and execute /sbin/init
if ! exec /bin/busybox switch_root /newroot $INIT $INIT_ARGS; then
echo "Failed, dropping to shell"
/bin/busybox mount -t proc none /proc
/bin/busybox mount -t sysfs none /sys
exec sh
fi
复制代码
作者:
my9823
时间:
2011-12-8 20:19
不知道能不能把CDLinux和GeexBox组合起来,用CDLinux的initrd 加上 GeexBox的 rootfs ?
应该不行,给你个链接,介绍initrd机制的,在ibm网站上找到的!
http://www.ibm.com/developerworks/cn/linux/l-k26initrd/
作者:
rockrock99
时间:
2011-12-9 12:48
2.0.1的内测版本已经发布,大家不妨测试一下
欢迎光临 无忧启动论坛 (http://bbs.wuyou.net/)
Powered by Discuz! X3.3