Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: AlejandroPadrino on February 17, 2012, 04:38:08 AM

Title: Source /tce cdrom folder in TinyCore 4.1
Post by: AlejandroPadrino on February 17, 2012, 04:38:08 AM
Hello, is there any way to identify the cdrom unit from where TinyCore Linux 4.1 is loaded?  I want to load some .tcz packages automatically from TinyCore cdrom.

Thank you.
Title: Re: Source /tce cdrom folder in TinyCore 4.1
Post by: curaga on February 17, 2012, 05:19:50 AM
Loop all cd drives, or perhaps check the cd label.
Title: Re: Source /tce cdrom folder in TinyCore 4.1
Post by: gerald_clark on February 17, 2012, 11:39:32 AM
If you want to change what the cd loads automatically, you will have to remaster the cd, or create a persistent store on your hard drive.
Title: Re: Source /tce cdrom folder in TinyCore 4.1
Post by: roberts on February 17, 2012, 12:08:36 PM
Hello, is there any way to identify the cdrom unit from where TinyCore Linux 4.1 is loaded?  I want to load some .tcz packages automatically from TinyCore cdrom.

Thank you.
Use the cde directory as that is what it is designed to perform. See release notes for Core 4.2
The tce directory needs to be on a writable store. Having it on a cdrom effectively breaks Core.
Title: Re: Source /tce cdrom folder in TinyCore 4.1
Post by: AlejandroPadrino on February 17, 2012, 07:37:01 PM
Curaga, how to loop all cd drives?

Roberts, I was try TinyCore 4.2.1.  It haves a boot error and only goes to console.

Thank you for all replies.
Title: Re: Source /tce cdrom folder in TinyCore 4.1
Post by: curaga on February 18, 2012, 02:57:03 AM
That's a bash scripting question, really.

for i in /mnt/sr*; do
#something
done
Title: Re: Source /tce cdrom folder in TinyCore 4.1
Post by: AlejandroPadrino on February 18, 2012, 07:34:22 PM
Thank you, Curaga.  But, to identify cdrom drive can be next ...?

set cddrive=/mnt/sr$i

How to do?
Title: Re: Source /tce cdrom folder in TinyCore 4.1
Post by: curaga on February 19, 2012, 04:12:43 AM
for i in /mnt/sr*; do
echo $i
done
Title: Re: Source /tce cdrom folder in TinyCore 4.1
Post by: Rich on February 19, 2012, 04:32:16 PM
Hi AlejandroPadrino
This should give you a baseline to get you started:
Code: [Select]
#!/bin/sh
LABEL="MultiCore"
CDROM=""

for i in `cat /etc/sysconfig/cdroms`      # Loop through all the CD drives on the machine
do
CDROM=`blkid $i | grep $LABEL`    # Search for the CDs label
if [ -n "$CDROM" ]                # was the label found?
then                      # Yes
i=`echo $i | cut -c5-`    # Remove /dev from string
CDROM=/mnt$i              # Prefix the string with /mnt
break
else                              # CD label was not found
CDROM="Not found."
fi
done
echo $CDROM
Since I am not proficient at scripting, this should not be taken as the best way to do this, it does work though.