本帖最后由 nzslszn 于 2019-8-20 01:54 编辑
k3的openwrt 目录都应该一样吧,都是自动加载u盘或者硬盘,为什么要改自己的路径,没有一个公用路径吗? 请问:你的 “根目录/bin,或者 usr/bin, 新建 S99debian 文件,注意调整第 4行、8行、9行,这几个位置是要根据实际情况调整的。”是打开winSCP软件登陆后/bin目录吗?而不是解压后/mnt/sda1/opt/debian/bin这个目录吧? 请问:新建S99debian 文件,是在winSCP软件手动建立S99debian 文件,出现白板粘贴以下内容就好吗? 1. #!/bin/sh 2. PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin 3. # Folder with Debian Jessie 4. CHROOT_DIR=/opt/debian #这是解压出来debian 的文件夹位置,改成自己的文件夹路径 这里是不是/mnt/sda1/opt/debian我的是mnt/sda1加载的U盘 5. # Some folder outside of sandbox, 6. # will be mounted to /mnt folder in Debian 7. # Uncommented next line if you need to mount a folder inside debian 8. EXT_DIR=/opt #这里是要挂载到debian 加载的资源文件夹(也就是你要在debian 系统使用的文件),自己调整,不用可以去掉。是解压后的文件夹,文件/mnt/sda1/opt/debian路径吗?还是什么? 9. CHROOT_SERVICES_LIST=/opt/deb.list #这是debian 启动时自动运行程序列表表单,自己建一个文件,改成自己的文件路径 是不是改成/mnt/sda1/opt路径?还是什么? 10. if [ ! -e "$CHROOT_SERVICES_LIST" ]; then 11. echo "Please, define Debian services to start in 12. $CHROOT_SERVICES_LIST first!" 13. echo "One service per line. Hint: this is a script names from 14. Debian's /etc/init.d/" 15. exit 1 16. fi 17. MountedDirCount="$(mount | grep $CHROOT_DIR | wc -l)" 18. start() { 19. if [ $MountedDirCount -gt 0 ]; then 20. echo "Chroot'ed services seems to be already started, 21. exiting..." 22. exit 1 23. fi 24. echo "Starting chroot'ed Debian services..." 25. for dir in dev proc sys; do 26. mount -o bind /$dir $CHROOT_DIR/$dir 27. done 28. [ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt 29. for item in $(cat $CHROOT_SERVICES_LIST); do 30. chroot $CHROOT_DIR /etc/init.d/$item start 31. done 32. } 33. stop() { 34. if [ $MountedDirCount -eq 0 ]; then 35. echo "Chroot'ed services seems to be already stopped, 36. exiting..." 37. exit 1 38. fi 39. echo "Stopping chroot'ed Debian services..." 40. for item in $(cat $CHROOT_SERVICES_LIST); do 41. chroot $CHROOT_DIR /etc/init.d/$item stop 42. sleep 2 43. done 44. mount | grep $CHROOT_DIR | awk '{print $3}' | xargs umount -l 45. } 46. restart() { 47. if [ $MountedDirCount -eq 0 ]; then 48. echo "Chroot'ed services seems to be already stopped" 49. start 50. else 51. echo "Stopping chroot'ed Debian services..." 52. for item in $(cat $CHROOT_SERVICES_LIST); do 53. chroot $CHROOT_DIR /etc/init.d/$item stop 54. sleep 2 55. done 56. mount | grep $CHROOT_DIR | awk '{print $3}' | xargs umount -l 57. echo "Restarting chroot'ed Debian services..." 58. for dir in dev proc sys; do 59. mount -o bind /$dir $CHROOT_DIR/$dir 60. done 61. [ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt 62. for item in $(cat $CHROOT_SERVICES_LIST); do 63. chroot $CHROOT_DIR /etc/init.d/$item start 64. done 65. fi 66. } 67. enter() { 68. [ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt 69. mount -o bind /dev/ $CHROOT_DIR/dev/ 70. mount -o bind /dev/pts $CHROOT_DIR/dev/pts 71. mount -o bind /proc/ $CHROOT_DIR/proc/ 72. mount -o bind /sys/ $CHROOT_DIR/sys/ 73. chroot $CHROOT_DIR /bin/bash 74. } 75. status() { 76. if [ $MountedDirCount -gt 0 ]; then 77. echo "Chroot'ed services running..." 78. else 79. echo "Chroot'ed services not running!" 80. fi 81. } 82. case "$1" in 83. start) 84. start 85. ;; 86. stop) 87. stop 88. ;; 89. restart) 90. restart 91. ;; 92. enter) 93. enter 94. ;; 95. status) status 96. ;; 97. *) 98. echo "Usage: (start|stop|restart|enter|status)" 99. exit 1 100. ;; 101. esac 102. echo Done. 103. exit 0
这样的话,就是只解压,然后用winSCP手动建立文件就可了吗? 执行/usr/bin/S99debian enter出现 Please, define Debian services to start in /mnt/sda1/opt/deb.list first! One service per line. Hint: this is a script names from Debian's /etc/init.d/
|