WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Proposal: enhancements tc-config and filetool.sh  (Read 1915 times)

Offline alphons

  • Newbie
  • *
  • Posts: 42
    • building vmtux.net as of feb 14, 2023
Proposal: enhancements tc-config and filetool.sh
« on: January 10, 2023, 08:20:48 AM »
When booting tinycore the process executes tc-config at the end of the script, it clears screen and shows the text logo and prompt of tinycore. You can use the boot option 'pause' where human interaction is needed to continue. If we add something like sleep 5 to the script, the result of all the actions in the script can be read, which after the boot process continues automatically.

/etc/init.d/tc-config
Code: [Select]
....
sleep 5

if [ -n "$PAUSE" ]; then
        echo -n "${BLUE}Boot time configuration completed. Press <Enter> to continue.${NORMAL}"
        read junk
fi
....

Another enhancement can be made by adding some color codes to the filetool restore option.

/usr/bin/filetool.sh
Code: [Select]
....
echo -n "${BLUE}Restoring backup files from${MAGENTA} $MOUNTPOINT/$FULLPATH/${MYDATA}.tgz${BLUE} "
sudo /bin/tar -C / -zxf $MOUNTPOINT/"$FULLPATH"/${MYDATA}.tgz 2>/dev/null &
rotdash $!
echo "${GREEN}Done.${NORMAL}"
....

The result can be seen in he attached image.

« Last Edit: January 10, 2023, 08:28:59 AM by alphons »
VMTux 1.0 - kernel 6.2.11 - glib 37 - alpha release March 2023 - https://vmtux.net/

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Proposal: enhancements tc-config and filetool.sh
« Reply #1 on: January 10, 2023, 01:23:18 PM »
Adding a sleep would be a no-no, boot's supposed to be fast, and as you know, the pause bootcode is for the cases when you need to read the contents in depth.

Coloring the backup text would be fine. Want to upload a patch?
The only barriers that can stop you are the ones you create yourself.

Offline alphons

  • Newbie
  • *
  • Posts: 42
    • building vmtux.net as of feb 14, 2023
Re: Proposal: enhancements tc-config and filetool.sh
« Reply #2 on: January 10, 2023, 02:14:10 PM »
Sure, i know the pause can be used to STOP the process, but when NOT used, some error messages can not be read, because of the clear screen following.
Maybe some error checking in the script can be used to make a sleep (or read junk) to halt the process for diagnostics, but in 99.99% this is not needed.
So you may be right  8)

Attached the patch file for /usr/bin/filetool.sh

VMTux 1.0 - kernel 6.2.11 - glib 37 - alpha release March 2023 - https://vmtux.net/

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: Proposal: enhancements tc-config and filetool.sh
« Reply #3 on: January 10, 2023, 03:40:54 PM »
Hi, alphons. I'd like to suggest that if filetool.sh's restore text (-r option) will be colorized, backup text (-b option) should also be colorized. To colorize one but not the other would seem haphazard.

You can submit a pull request on github here:
https://github.com/tinycorelinux/Core-scripts/blob/master/usr/bin/filetool.sh
« Last Edit: January 10, 2023, 03:42:26 PM by GNUser »

Offline alphons

  • Newbie
  • *
  • Posts: 42
    • building vmtux.net as of feb 14, 2023
Re: Proposal: enhancements tc-config and filetool.sh
« Reply #4 on: January 11, 2023, 03:22:24 AM »
Ow yes, forking as we speak ...
VMTux 1.0 - kernel 6.2.11 - glib 37 - alpha release March 2023 - https://vmtux.net/

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Proposal: enhancements tc-config and filetool.sh
« Reply #5 on: February 15, 2023, 06:01:23 PM »
Maybe some error checking in the script can be used to make a sleep (or read junk) to halt the process for diagnostics, but in 99.99% this is not needed.

too clever for my taste. especially for an edge-case.

but i'll repeat my former request to just not clear the screen instead. (which has been denied before)

maybe the pause bootcode will be a good default for me, i'll try it out, but i'm sure i'll forget before long :D

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Proposal: enhancements tc-config and filetool.sh
« Reply #6 on: February 15, 2023, 06:02:46 PM »
I generally don't like coloring, but I liked the "Done." being on a newline (got used to it, sorry).