Tiny Core Base > Micro Core

[Solved] proposal to clean up the tc-config script (maybe speed it up a little)

(1/2) > >>

nick65go:
proposal to clean up the tc-config script (maybe speed it up a little)

inside functions spreaded to be grouped (possible outside) and renamed with prefix "_"?
addUser()    -> _adduser()
wait4Server()    -> _wait4Server()
get_app()    -> _get_app()

obsoleted options in case, because modules build into kernel:

--- Code: ---tc@box:~$ modinfo zram
modinfo: module '/lib/modules/5.4.3-tinycore64/zram' not found
tc@box:~$ modinfo zcache
modinfo: module '/lib/modules/5.4.3-tinycore64/zcache' not found
tc@box:~$
--- End code ---
so option  [ -n "$NOZSWAP" ] is useless


--- Code: ---tc@box:~$ figrep MemFree /proc/meminfo | awk '{print $2/4 "K"}'
sh: figrep: not found
tc@box:~$
--- End code ---

pre-populate /etc/sysconfig/ (small size in ram); but will simplify default if/else statements:
default value for variable, pre-populates files:
LANG=C         -> /etc/sysconfig/language
TZ=""        -> /etc/sysconfig/timezone
USER="tc"    -> /etc/sysconfig/tcuser
null        -> /etc/sysconfig/superuser
null        -> /var/tmp/k5_skip
null        -> /etc/sysconfig/text
null        -> /etc/sysconfig/xonly
KEYMAP="us"    -> /etc/sysconfig/keymap
null        -> /etc/sysconfig/desktop
mydata        -> /etc/sysconfig/mydata

sample of bloat /fat code:

--- Code: ---USER="tc"
...
if [ -n "$USER" ]; then
    if ! grep "$USER" /etc/passwd >/dev/null; then addUser; fi
else
    USER="tc"
fi
--- End code ---

many action grouped together and in the back ground + in paralel?
/sbin/loadcpufreq 2>/dev/null &
/sbin/ifconfig lo 127.0.0.1 up && /sbin/route add 127.0.0.1 lo &
chmod u+s /bin/busybox.suid /usr/bin/sudo
modprobe -q squashfs 2>/dev/null

or similar:
[ -n "$XSETUP" ] && touch /tmp/xsetup_requested
[ -n "$XVESA" ]  && sed -i 's/1024x768x32/'"$XVESA"'/' /home/"$USER"/.xsession 2>/dev/null

I am not criticize, i just try to help for better auto-documenting the script.
Maybe will not be much speed gain (few seconds). I think other users had/have similar proposals.

andyj:
Sounds like this http://forum.tinycorelinux.net/index.php/topic,23835.0.html again. Good luck.

PDP-8:
I'm speaking carefully here - with all due respect.

If the proposed changes aren't adopted how about this:

Create a "remix" , which you guys obviously know how to do, and host it on github or somewhere else - announce it in the remaster-remix area.

So yeah, it's not a fork, but a working example of system improvements which may have a more demonstrable impact.

I'd fire up your stuff to check it out for sure.

.... skulking away ... :)


Paul_123:
I guess my take on this is to measure the improvements you are asking to make. Make a simple change to tc-config so it tracks boot time.....and in what stages.  Boot your system and note the times.  Now make your changes, the boot again and compare the "real" boot times.

And be aware that Core-Scripts are used across other platforms other than x86/x86_64.  Although we did just create a branch for piCore.

As for nozswap comment.  The boot code still does function, its just the zram module is compiled into x86_64 kernel,  but it will keep the swap space from being used or not.

curaga:
I don't see a "figrep" call anywhere...

Navigation

[0] Message Index

[#] Next page

Go to full version