I'd like to make my boot scripts guess from which media (either getting the UUID or LABEL) the kernel and "tinycore.gz" was residing on and was copied from. Is there a way (command) that helps to know this?
Unfortunately, as far as I know, there is no method that could give you the media with 100% probability.
The reason is that the kernel (and tinycore.gz) are loaded by the boot loader and the boot loader has its own perception of devices, so even it could pass the information along to the kernel, the kernel would not know what to do with it.
But if guessing is good enough here are some alternatives:
Most boot loaders automatically passes the variable BOOT_IMAGE to the kernel. The value of BOOT_IMAGE is the
path to the kernel image, e.g. /boot/bzImage. Some boot loaders do not automatically provide this variable, e.g. legacy
grub (grub2 provides it) so then you have to specify it on your boot command line, but then you could as well insert
your own variable with UUID or LABEL.
When you know the name of the kernel image you could search thru your partitions and see which one has the file.
The risk is that you have a file with this path in more than one partition and then you do not know which the correct
one is.
There are some other tricks that could be used to find the right one among many.
/Lars