WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Bootcodes of Picore6.0  (Read 18363 times)

Offline andriusr

  • Newbie
  • *
  • Posts: 34
Bootcodes of Picore6.0
« on: February 15, 2015, 07:08:25 AM »
Hi all,
have beginner question. There is wide description of bootcodes that picore supports, however, I have difficulty to find what they are for Picore-6.0 how they can be edited. Checked several locations that are mentioned on forum, but it seems that something has changed since then:
1. On SD card (or inside piCore-6.0-SSH.img) file there is cmdline.txt file but codes here seems to be not piCore codes, but probably, general tc codes.
2. In several places there is mentioning that cmdline.txt is located in /mnt/mmcblkp01 . But on my system this location is empty. No files at all.
Any help is welcome...

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Bootcodes of Picore6.0
« Reply #1 on: February 15, 2015, 07:29:00 AM »
/dev/mmcblk0p1 is a boot partition and not used by the system later ther4efore it is not mounted. In the reminal issue

Code: [Select]
sudo mount /dev/mmcblk0p1
to mount and when finished, unmount for safety reasons:

Code: [Select]
sudo umount /dev/mmcblk0p2
There are no specific piCore boot codes. Bootcodes are normal Linux codes, RPi specific same as Raspbian (USB and serial line config) or TC codes.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline andriusr

  • Newbie
  • *
  • Posts: 34
Re: Bootcodes of Picore6.0
« Reply #2 on: February 15, 2015, 07:57:02 AM »
Thanks for reply.
the second command probably should be
Code: [Select]
sudo umount /dev/mmcblk0p1I am seeing cmdline.txt now.
However, where all codes like
NOZSWAP=, WAITUSB= etc. are located? They are not in cmdline.txt... What values are used by default?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Bootcodes of Picore6.0
« Reply #3 on: February 15, 2015, 10:04:28 AM »
Yes, there was a typo in umount, it is mmcblk0p1

waitusb is not needed.   nozswap is not there because zsap enabled by default.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline andriusr

  • Newbie
  • *
  • Posts: 34
Re: Bootcodes of Picore6.0
« Reply #4 on: February 15, 2015, 10:38:10 AM »
Sorry for asking too many questions. 

How about other tinycore boot codes tha tare listed in /usr/share/doc/tc/bootOptions.txt?

Quote
tce={hda1|sda1}            Specify Restore TCE apps directory
restore={hda1|sda1|floppy} Specify saved configuration location
waitusb=X                  Wait X seconds for slow USB devices
swapfile{=hda1}            Scan or Specify swapfile
home={hda1|sda1}           Specify persistent home directory
opt={hda1|sda1}            Specify persistent opt directory
local={hda1|sda1}          Specify PPI directory or loopback file
lst=yyy.lst                Load alternate static yyy.lst on boot
mydata=yyyy                Specify alternate backup file name
base                       Skip TCE load only the base system
norestore                  Turn off the automatic restore
safebackup                 Saves a backup copy (mydatabk.tgz)
showapps                   Display application names when booting
vga=7xx                    7xx from table (See below)
xsetup                     Prompt user for Xvesa setup
lang=en                    C only unless getlocale.tcz is installed
kmap=us                    US only unless kmaps.tcz is installed
text                       Textmode
superuser                  Textmode as user root
noicons                    Do not use icons
noswap                     Do not use swap partition
nodhcp                     Skip the dhcp request at boot
noutc                      BIOS is using localtime
pause                      Pause at completion of boot messages

Are any of these supported? Are these of any use?

One less related to boot code question: I am wondering how do you pack sshd into piCore-6.0-SSH.zip file... I unpacked everything, including 6.0.gz but could not locate it anywhere. But ssh works out of the box... I am trying to build image that woudl contain some other files, so could you provide idea how you doing it with ssh?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Bootcodes of Picore6.0
« Reply #5 on: February 15, 2015, 12:08:38 PM »
openssh is in the openssh.tcz extension, see /tce/optional directory.

Read core concept at http://tinycorelinux.net/concepts.html and the Core Book to learn Tiny Core basics:

http://distro.ibiblio.org/tinycorelinux/corebook.pdf

« Last Edit: February 15, 2015, 12:10:44 PM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline roborob

  • Jr. Member
  • **
  • Posts: 58
Re: Bootcodes of Picore6.0
« Reply #6 on: February 15, 2015, 01:00:07 PM »
Hi,

I highly recommend the book bmarkus mentioned. Into the Core  A loot at Tiny Core Linux by Lauri Kasanen (et al).

Offline andriusr

  • Newbie
  • *
  • Posts: 34
Re: Bootcodes of Picore6.0
« Reply #7 on: February 15, 2015, 03:51:46 PM »
bmarkus,
sure I read all the books and still reading them. The issue that they are about tinycore, while some details of picore are different, like bootcodes.
Once picore image is copied into sd card and booted, i can find openssh, for sure. My question was why it is not visible in piCore-6.0-SSH.zip file (at least I could not find it anywhere when I unpack zip into img, then 6.0.gz and 6.0(without extension) files).
Is there some hidden partition/file inside img file that is not visible on my system (I am using MacOSX)?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Bootcodes of Picore6.0
« Reply #8 on: February 15, 2015, 04:03:41 PM »
bmarkus,
sure I read all the books and still reading them. The issue that they are about tinycore, while some details of picore are different, like bootcodes.

What is your issue with boot codes? As I already wrote, there are board specific codes, same as in Raspbian, like USB settings and serial line. These are not used in x86 version, right. Do not touch them. All others are generic TC boot codes. There are no piCore specific codes! Read the book, read FAQ about boot codes.

My question was why it is not visible in piCore-6.0-SSH.zip file (at least I could not find it anywhere when I unpack zip into img, then 6.0.gz and 6.0(without extension) files).

.img is an SD card image. As soon as you boot it, you will see openssh.tcz in /mnt/mmcblk0p2/tce/optional, but was also wrote earlier.

And finally. Please read the book, how TC works.



Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline andriusr

  • Newbie
  • *
  • Posts: 34
Re: Bootcodes of Picore6.0
« Reply #9 on: February 16, 2015, 08:49:38 AM »
Thanks for explanations. I am trying to build small headless web server with FastCGI, controlled trough SSH. The specifics is that I need fast boot time and nearly real time performance (in other words, the web server should produce as little CPU load as possible when not in use). I managed to install apache with mod_fcgid, compiled fcgi-2.4.1 library ( how can I can contribute tcz to repository?), got demo fcgi programs running on server.
So, I am wondering how I can speed up boot time - boot codes might help to disable services that I do not need. For example, I am not sure if I need compressed swap file or if I need swap file at all. Load to web server would never exeed 1 request/s or something like that. If that would help to reduce boot time, I can disable it.
Also, if I specify all persistent locations, how much I can save? Any other thoughs are welcome...

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11667
Re: Bootcodes of Picore6.0
« Reply #10 on: February 16, 2015, 10:58:06 AM »
Hi andriusr
The first you should do is mention how long you currently take to boot and what boot time you are shooting for to see if your goal is
realistic. Then add the boot codes:
Code: [Select]
printk.time=1 syslogThis will add timing information to  dmesg  and  /var/log/messages  allowing you to see how long everything takes to complete. You
might also consider one of the smaller web servers available in Pi, see:
http://forum.tinycorelinux.net/index.php/topic,17183.msg103084.html#msg103084
http://forum.tinycorelinux.net/index.php/topic,16983.msg101835.html#msg101835
http://forum.tinycorelinux.net/index.php/topic,16226.msg96194.html#top
Quote
Also, if I specify all persistent locations, how much I can save?
All? Only /home and /opt can be persistent which can save time during backup and restore, especially if many and or large files are
involved. Things like /etc and /usr are built dynamically at boot time and can not be persistent.

Offline andriusr

  • Newbie
  • *
  • Posts: 34
Re: Bootcodes of Picore6.0
« Reply #11 on: February 16, 2015, 12:48:49 PM »
Hi Rich,
thanks for information, really useful. Mongoose is intersting, it is not available in 6.0 repository yet, but probably I can compile it. It does not support fcgi, but probably cgi support would be enough, since I can use cgi-fcgi bridge from FastCGI that I managed to compile. cgi-fcgi adds some overhead, but maybe that will be acceptable.
Lighhttpd provides FastCGI support, but again is not available in repository. Have to look if I can compile it.
Regarding boot times I would expect something between 5-10 sec. I searched on forum, but there is very little data (maybe no data at all) about typical boot times of headless configuration.
Regarding persistence, I have one question. I know that /opt and /home are persistent, and I can add extra locations to .filetool.lst. But then I need to execute filetool.sh periodically to save data (using cron for example). What if I save my data directly to location on mmcblk0p2 and then add lines to bootlocal.sh to copy required files (also files that are on .filetool.lst). In this case I probably can specify norestore boot code (and hope that it will save some time). Would that work?

Offline andriusr

  • Newbie
  • *
  • Posts: 34
Re: Bootcodes of Picore6.0
« Reply #12 on: February 16, 2015, 01:29:31 PM »
Tested boot time on virgin SSH image (only added nano for text files editing).
Total boot time is ~16sec, including:
~5 sec for basic start up.
~5.5 sec for mounting of file images (hpefully this can be improved by making one big tcz file containing all files?)
~1.5 sec for ini of eth0 interface
~4 sec till start of SSH server listening on port 22.
Swap file creation takes, for exapmple ~1.5 sec.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11667
Re: Bootcodes of Picore6.0
« Reply #13 on: February 16, 2015, 01:35:57 PM »
Hi andriusr
Quote
But then I need to execute filetool.sh periodically to save data (using cron for example). What if I save my data directly to location on mmcblk0p2 and then add lines to bootlocal.sh to copy required files (also files that are on .filetool.lst). In this case I probably can specify norestore boot code (and hope that it will save some time). Would that work?
That depends on what you mean by "data". Configuration files should be handled using  .filetool.lst  since they tend to be static once set up.
For the web server you could set up a working directory under /opt or /home to hold any scripts, web pages, etc.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11667
Re: Bootcodes of Picore6.0
« Reply #14 on: February 16, 2015, 01:41:18 PM »
Hi andriusr
Quote
~5.5 sec for mounting of file images (hpefully this can be improved by making one big tcz file containing all files?)
More than likely it the creation of the links back into the /usr directory thats taking most of that time, not the mounting process. Smaller
extensions such as monkey or mongoose as opposed to apache would probably help more.