WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: (中文) How can I automatically load all partitions when tinycore starts?  (Read 337991 times)

Offline liuzhaoyzz

  • Jr. Member
  • **
  • Posts: 75
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #15 on: January 13, 2022, 04:42:18 AM »
天曉得系統內有多少程式會誤判你的配置,請改成tce避免不必要的麻煩。、
OK,I see.thank you.

Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #16 on: January 13, 2022, 04:47:35 AM »
在/opt/bootlocal.sh加入mount指令
在onboot.lst加入了util-linux.tcz跟ntfs-3g.tcz
我试过了,我创建了一个/linux2/tinycore/opt目录,/opt/bootlocal.sh加入mount指令,保存设置,关机重启,但上面的脚本不工作啊?
我在/linux2/tinycore/optional目录中创建了一个bootlocal.sh脚本,加入mount指令,保存设置,关机重启,但上面的脚本也不工作啊?
奇怪的很。

Where the hell does "/linux2/tinycore/opt" come from ?
Why would you make such directory ?

/linux2/tinycore/opt是從哪冒出來的 ?
用意何在 ?

Please fix your tce directory first before we move on to the remaining problems.
問題有點多,我們一個一個來,請先把tce搞定。

I've attached my MountAll script for you to test.
附檔是我改過的你可以試試

Offline liuzhaoyzz

  • Jr. Member
  • **
  • Posts: 75
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #17 on: January 13, 2022, 05:27:53 AM »
oh,/linux2/tinycore/opt is another test.

Offline liuzhaoyzz

  • Jr. Member
  • **
  • Posts: 75
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #18 on: January 13, 2022, 05:50:11 AM »
 MountAll-refactored.sh
 用你的这个脚本可以正常挂载并且正确地显示FAT32/NTFS/EXT4分区里面的汉字了,我是手工在terminal中运行的sudo  MountAll-refactored.sh.
1、但是xfe里面fcitx似乎不能正常工作,不能修改文件名为中文,好奇怪。

打开中文文件文本文件,用geany编辑,fcitx可以正常输入汉字。

2、我的tinycore是解压缩放在/dev/sdd2,这个是FAT32分区,他是tinycore启动的时候自动挂载的,sudo  MountAll-refactored.sh运行的时候会提示/dev/sdd2已经挂载了,我用sudo umount -l /dev/sdd2,也不行,再次sudo  MountAll-refactored.sh的时候,提示权限不允许。因为tinycore在这上面。

如果直接mount FAT32分区,中文文件名字就会是乱码。现在用sudo  MountAll-refactored.sh挂载不了,权限不够。
« Last Edit: January 13, 2022, 05:54:33 AM by liuzhaoyzz »

Offline liuzhaoyzz

  • Jr. Member
  • **
  • Posts: 75
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #19 on: January 13, 2022, 05:50:50 AM »
tc@box:~$ chmod 777 /mnt/sdc3/rebuildfstab-backup/MountAll-refactored.sh
tc@box:~$ sudo umount -l /dev/sdd2
tc@box:~$ sudo /mnt/sdc3/rebuildfstab-backup/MountAll-refactored.sh
chown: /mnt/sdd2: Operation not permitted

Offline liuzhaoyzz

  • Jr. Member
  • **
  • Posts: 75
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #20 on: January 13, 2022, 05:52:27 AM »
对了,文件夹和cheatcode我已经改成了tce了。

Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #21 on: January 13, 2022, 06:13:12 AM »
MountAll-refactored.sh
 用你的这个脚本可以正常挂载并且正确地显示FAT32/NTFS/EXT4分区里面的汉字了,我是手工在terminal中运行的sudo  MountAll-refactored.sh.
1、但是xfe里面fcitx似乎不能正常工作,不能修改文件名为中文,好奇怪。

打开中文文件文本文件,用geany编辑,fcitx可以正常输入汉字。

2、我的tinycore是解压缩放在/dev/sdd2,这个是FAT32分区,他是tinycore启动的时候自动挂载的,sudo  MountAll-refactored.sh运行的时候会提示/dev/sdd2已经挂载了,我用sudo umount -l /dev/sdd2,也不行,再次sudo  MountAll-refactored.sh的时候,提示权限不允许。因为tinycore在这上面。

1. I'm rather unfamiliar with fcitx, probably has something to do with GTK.
There's also environmental variables.
It's troublesome for sure.
我對fcitx不熟,不過有可能跟GTK有關,還可能牽扯到環境變數,總之很麻煩。

2. Like you said, your extensions are there and loaded, so the partition can't be unmounted.
There's no easy way around, is it really necessary to access that particular partition with UTF-8 support ?
就像你說的,套件都放在那,還都掛起來了,這塊磁碟分割自然沒法卸下來。
單就這個分割而言,一定要支援UTF-8嗎?

Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #22 on: January 13, 2022, 06:17:24 AM »
tc@box:~$ chmod 777 /mnt/sdc3/rebuildfstab-backup/MountAll-refactored.sh
tc@box:~$ sudo umount -l /dev/sdd2
tc@box:~$ sudo /mnt/sdc3/rebuildfstab-backup/MountAll-refactored.sh
chown: /mnt/sdd2: Operation not permitted

BTW, the script already calls "sudo" when mounting.
You shouldn't call the script as super user.
It may not run.

另外,MountAll-refactored.sh裡面已經呼叫過sudo了
雙重sudo可能不會有作用

Offline liuzhaoyzz

  • Jr. Member
  • **
  • Posts: 75
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #23 on: January 13, 2022, 06:36:50 AM »
Quote
單就這個分割而言,一定要支援UTF-8嗎?
是的,必须要utf8,如果不用utf8,中文文件名字和文件夹都是乱码。
我为什么要把tinycore放在FAT32分区?因为只有放在FAT32分区上面,tce才能方便地保存。
特别是tinycore第一次启动的时候,默认是没有加载ntfs-3g的,只能保存在原生支持的FAT32/EXT4分区里面。
除了用linux,我还用windows,所以我选择了FAT32分区,而不是ext4分区,似乎tinycore放在ext4分区也可以保存tce吧。

关于cde和tce,我感觉上来说,只是个名字,他不是cheatcode,不进入内核。
« Last Edit: January 13, 2022, 06:47:03 AM by liuzhaoyzz »

Offline liuzhaoyzz

  • Jr. Member
  • **
  • Posts: 75
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #24 on: January 13, 2022, 06:41:49 AM »
关于fcitx设置相关:
安装getlocale.tcz和base-locale.tcz,运行sudo getlocale.sh用空格选择zh_CN.UTF8 en_US.UTF-8
安装了中文字库notocjk-regular-fonts-ttc,这个中文字库比较大,37MB,包括sans、serif、Mono,字体显示效果感觉比较好。
安装base-locale.tcz
打开 /home/tc/.ashrc,在文件最后添加如下内容:
export XIM=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XIM_PROGRAM=fcitx
export XMODIFIERS="@im=fcitx"


 重启的时候保存设置。重启后,点击任务栏中的 fcitx 图标,然后才可以使用 Ctrl+Space 切换输入法。
搭配geany,liboffice,等等,都可以输入中文。
但是xfe文件管理器中,有时候不行,有时候又可以,不太清楚。

可能可以用小小输入法代替。

Offline liuzhaoyzz

  • Jr. Member
  • **
  • Posts: 75
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #25 on: January 13, 2022, 06:57:12 AM »
感觉上来说,还是要折腾/usr/sbin/rebuilderfstab,从底层修改,改完了之后,cpio+gz打包回去,到corepure64.gz里面。
比较麻烦的问题是,tinycore每更新一次就要修改一次,来来回回修改比较麻烦。

OPTIONS="auto,users,exec"
  case "$FSTYPE" in
    ntfs) checkntfs ;;
    vfat|msdos) OPTIONS="${OPTIONS},umask=000,iocharset=utf8" ;;

所以还是建议开发组修改,这样子最方便。
« Last Edit: January 13, 2022, 06:59:08 AM by liuzhaoyzz »

Offline liuzhaoyzz

  • Jr. Member
  • **
  • Posts: 75
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #26 on: January 13, 2022, 07:01:49 AM »
谢谢大家的帮助,我要睡觉了。

Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #27 on: January 13, 2022, 07:03:07 AM »
Quote
單就這個分割而言,一定要支援UTF-8嗎?
是的,必须要utf8,如果不用utf8,中文文件名字和文件夹都是乱码。
我为什么要把tinycore放在FAT32分区?因为只有放在FAT32分区上面,tce才能方便地保存。
除了用linux,我还用windows,所以我选择了FAT32分区,而不是ext4分区,似乎tinycore放在ext4分区也可以保存tce吧。

关于cde和tce,我感觉上来说,只是个名字,他不是cheatcode,不进入内核。

I usually make a dedicated partition and put all the TC-only stuff there.

If you absolutely need that, then the only way I could think of is going copy2fs mode. That is, to copy your extensions into RAM so you can remount your partition.

What are the "cheatcode" you're referring to ?

我通常會設一個TC專用的分割區。

如果你一定要UTF-8,我只能想到用copy2fs模式,他會把你全部/指定的套件全丟進RAM裡。
這樣你就能重新掛載分割區。

所以你一直在說的cheatcode是指啥?

Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #28 on: January 13, 2022, 07:09:43 AM »
感觉上来说,还是要折腾/usr/sbin/rebuilderfstab,从底层修改,改完了之后,cpio+gz打包回去,到corepure64.gz里面。
比较麻烦的问题是,tinycore每更新一次就要修改一次,来来回回修改比较麻烦。

You can make your home-brew rebuilderfstab.tcz package for your own need.

As long as you put it in /usr/local/bin, it should be fine.

And make sure it's in your onboot.lst.

你可以自己包個rebuilderfstab.tcz阿,把改寫過的放/usr/local/bin就好了。
記得要加進onboot.lst

Offline liuzhaoyzz

  • Jr. Member
  • **
  • Posts: 75
Re: (中文) How can I automatically load all partitions when tinycore starts?
« Reply #29 on: January 13, 2022, 11:13:22 PM »
copy2fs 应该也是一个可行的方法。

cheatcode就是那些启动参数。我忘了他来自那个发行版的说法,似乎是porteus

Boot parameters (also known as cheatcodes) are used to affect the
booting process of Porteus. The cheatcodes listed here are only those
that are specific to Porteus (see the final note for information on
cheatcodes that apply to all linux distributions, including Porteus).
You can use these parameters to disable desired kinds of hardware
detection, start Porteus from a specific location, load additional
modules, etc.

对于tinycore,整体启动iso,

比如iso=UUID=xxxx就是cheatcode,或者可以称之为Boot parameters,他传递启动参数到linux kernel,以“欺骗”linux kernel继续从iso启动。
大概是这样子,抱歉,这个名词让您误会了。