Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: patrikg on September 07, 2021, 01:32:52 PM
-
If I don't misunderstand the file: /usr/bin/tce-setup.
In the function: setupExtnDirs
Why should all the files and directories in /mnt/mmcblk0p2/tce/optional/ and all the recursive being changed with the correct rights and ownership every boot time ?
So when you adding more and more files into this directory even if you don't load them in onboot.lst. Slower and slower the boot time becomes.
I can't follow the flow thru the script's to understand if this function need some logic like the lines above, to just make change when the directory exist.
Or even smarter, just only make change with the corresponding files in onboot.lst with the correct rights and ownership(not everybody).
Thanks
//Patrik
-
Or maybe even smarter set the right's and ownership then you install/download them to there corresponding directory.
-
Its much faster to just do a recursive change. Otherwise you would have to do it file by file based on what is on onboot and all the recursive dependencies.
This is for a pi0 with 109 extensions
# time chown -R tc.staff / mnt / mmcblk0p2 / tce
real 0m 0.11s
user 0m 0.01s
sys 0m 0.06s
# time chmod -R g+w / mnt / mmcblk0p2 / tce
real 0m 0.05s
user 0m 0.01s
sys 0m 0.03s
A pi4 with 4 times as many extensions is half the amount of time above.
-
Its much faster to just do a recursive change. Otherwise you would have to do it file by file based on what is on onboot and all the recursive dependencies.
This is for a pi0 with 109 extensions
# time chown -R tc.staff / mnt / mmcblk0p2 / tce
real 0m 0.11s
user 0m 0.01s
sys 0m 0.06s
# time chmod -R g+w / mnt / mmcblk0p2 / tce
real 0m 0.05s
user 0m 0.01s
sys 0m 0.03s
A pi4 with 4 times as many extensions is half the amount of time above.
Yes of course, but do you need to call this function every boot ?
tc@box:~$ time chown -R tc.staff / mnt / mmcblk0p2 / tce
real 0m 35.85s
user 0m 0.00s
sys 0m 1.38s
tc@box:~$ time chmod -R g+w / mnt / mmcblk0p2 / tce
real 0m 35.99s
user 0m 0.03s
sys 0m 0.89s
ls / mnt / mmcblk0p2 / tce / optional / | wc -l
147
On:
Model : Raspberry Pi 3 Model B Plus Rev 1.3
-
Hi patrikg
I think there is something wrong with your setup. It should not take over 0.240 seconds per file to chown.
This is after clearing the system cache:
tc@E310:~$ time sudo busybox chown -R tc:staff /mnt/sda1/tce; time sync
real 0m 0.10s
user 0m 0.00s
sys 0m 0.04s
real 0m 0.16s
user 0m 0.00s
sys 0m 0.00s
tc@E310:~$ ls /mnt/sda1/tce/optional/ | wc -l
1309
tc@E310:~$
Total time to chown 1300 files and syncing the file system is 0.260 secomds.
I ran the same test on an old USB thumb drive with 1000 files and the total time was 0.690 seconds.
-
Thank you for you reply.
I have to investigate little more about this, if this just was an unhappy sd card.
-
Rich, thank you.
I Found my problem. Haven't thought about this.
I use the also tce directory for my source files, trying to compile u-boot for supporting PI 3B+ 32bit, having problem with the getting inbuilt usb network card (lan78xx) working. To my surprise the 64 bit working fine. But for some reason the 32bit don't working.
So there are lots of more files in the tce directory.
Tried first to git clone into my home directory, but for some reason that didn't work.
So i went to the tce directory instead.
Instead of using my home directory that is in ram.
-
Create another folder in the root of /mnt/mmcblk0p2.
-
Hi patrikg
So if you have all of the source packages under one directory like this:
/mnt/mmcblk0p2/tce/SourceFiles/
Then move them like this:
mv /mnt/mmcblk0p2/tce/SourceFiles /mnt/mmcblk0p2
This will be very quick since there is no copying involved, only one entry gets changed in the file system.
If you created separate directories under /mnt/mmcblk0p2/tce then do something like this:
sudo mkdir /mnt/mmcblk0p2/SourceFiles
sudo chown tc:staff /mnt/mmcblk0p2/SourceFiles
mv /mnt/mmcblk0p2/tce/Dir1 /mnt/mmcblk0p2/SourceFiles
mv /mnt/mmcblk0p2/tce/Dir2 /mnt/mmcblk0p2/SourceFiles
...
-
Yes that is a great suggestion, and then i also can make a link from my home directory to my source directory.
Don't know if I have to exclude the link, to not include the backup then using filetool.sh -bv.
It was so easy way to get into the tce directory when using the alias ce.
-
Hi patrikg
You definitely want to exclude the link otherwise you will spend extra time backing up all of the source directories.
Add the link to your /opt/.xfiletool.lst file so it doesn't get backed up.
Create the link in your ~/.profile file someplace before the TERMTYPE= statement.
-
tar does not follow symlinks by default, so if you don't have persistent home, it's fine to back up symlinks in /home.
-
Hi curaga
I did not realize that. I stand corrected. :)
-
Thank you all.
I let you all know if i get u-boot working in 32 bit mode, i have done it before with my first pi.
I have to investigate more what the problem can be.
I have making this before with my first original pi just with 256mb memory.
Booted up picore with u-boot just to boot up kernel and initramfs and root with nfs. Working well.
So all access from/to the sdcard are eliminated.
Even if picore not writing anything to it after the system booted.
-
Now i got my u-boot working with networking.
I having a Raspberry PI 3B+.
But the configs for 32bit in u-boot configs directory just contains for the 3B not plus.
So i just edit the config file to get the device tree file for 3B+.
Then it just starting to work.
This setup is useful for network booting raspberry pi 0-3 without tempering with the OTB.
Like this:
--- a/configs/rpi_3_32b_defconfig
+++ b/configs/rpi_3_32b_defconfig
@@ -6,7 +6,7 @@ CONFIG_TARGET_RPI_3_32B=y
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_NR_DRAM_BANKS=1
CONFIG_ENV_SIZE=0x4000
-CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b"
+CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b-plus"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_USE_PREBOOT=y