WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Source /tce cdrom folder in TinyCore 4.1  (Read 3577 times)

Offline AlejandroPadrino

  • Full Member
  • ***
  • Posts: 143
Source /tce cdrom folder in TinyCore 4.1
« 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.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Source /tce cdrom folder in TinyCore 4.1
« Reply #1 on: February 17, 2012, 05:19:50 AM »
Loop all cd drives, or perhaps check the cd label.
The only barriers that can stop you are the ones you create yourself.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Source /tce cdrom folder in TinyCore 4.1
« Reply #2 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.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Source /tce cdrom folder in TinyCore 4.1
« Reply #3 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.
10+ Years Contributing to Linux Open Source Projects.

Offline AlejandroPadrino

  • Full Member
  • ***
  • Posts: 143
Re: Source /tce cdrom folder in TinyCore 4.1
« Reply #4 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.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Source /tce cdrom folder in TinyCore 4.1
« Reply #5 on: February 18, 2012, 02:57:03 AM »
That's a bash scripting question, really.

for i in /mnt/sr*; do
#something
done
The only barriers that can stop you are the ones you create yourself.

Offline AlejandroPadrino

  • Full Member
  • ***
  • Posts: 143
Re: Source /tce cdrom folder in TinyCore 4.1
« Reply #6 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?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Source /tce cdrom folder in TinyCore 4.1
« Reply #7 on: February 19, 2012, 04:12:43 AM »
for i in /mnt/sr*; do
echo $i
done
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11634
Re: Source /tce cdrom folder in TinyCore 4.1
« Reply #8 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.