Tiny Core Base > TCB Talk

Boot CD detection by label

(1/2) > >>

grisxa:
Hello!

I've found a bug (you may call it mis-feature :) ).
When I boot from CD after TCL has been installed on HDD, system mounts tce folder from that HDD ignoring the same folder on CD.

So I've decided to specify it with boot option 'tce=LABEL=TinyCore/tce'. This volume label ('TinyCore') is created with mkisofs option -V while remastering image.

But such trick doesn't work! As I can see, /sbin/blkid is responsible for disk detection and it checks /etc/blkid.tab cache file which, in turn, doesn't contain records for my CD yet. I don't know why it was not found on cache creation, but if I rebuild it later in find_mountpoint() function, all goes well.

Test case (QEMU with tinycore_3.0.iso as CDROM):
$ /sbin/blkid -lt LABEL=TinyCore -o device
[empty]

$ sudo /sbin/blkid -w /etc/blkid.tab /dev/hd? /dev/sd?
$ /sbin/blkid -lt LABEL=TinyCore -o device
/dev/hdc

Maybe it's a good idea to insert somewhere this blkid -w command? (See my patch).

curaga:
I wouldn't add a call like that, probing a cd drive can take up several seconds. It's especially bad that the patch would add it to find_mountpoint, which can be called many times.

However, if it's the only cd drive, /dev/cdrom should point to it. Try the attached patch, with it you should be able to use "tce=cdrom" or "tce=cdrom/dir".

roberts:
I would not advise to point tce directory to a read only device as many other parts of Tiny Core will be  disabled. There are already published means to store and load extensions from cdroms whilst maintaing the availability of a useful tce directory.

grisxa:

--- Quote from: roberts on September 21, 2010, 09:35:57 AM ---I would not advise to point tce directory to a read only device as many other parts of Tiny Core will be  disabled. There are already published means to store and load extensions from cdroms whilst maintaing the availability of a useful tce directory.

--- End quote ---
My goal is to load extensions from CD only, because system on HDD sometimes can get broken.
So I would like to avoid mounting tce folder from HDD.
(It's for remastered image of course.)

grisxa:

--- Quote from: curaga on September 21, 2010, 08:23:46 AM ---However, if it's the only cd drive, /dev/cdrom should point to it. Try the attached patch, with it you should be able to use "tce=cdrom" or "tce=cdrom/dir".

--- End quote ---
Thanks, but actually I make a hybrid ISO, which also could be saved on the USB flash.


--- Quote from: grisxa on September 21, 2010, 07:22:18 AM ---As I can see, /sbin/blkid is responsible for disk detection and it checks /etc/blkid.tab cache file which, in turn, doesn't contain records for my CD yet. I don't know why it was not found on cache creation, but if I rebuild it later in find_mountpoint() function, all goes well.

--- End quote ---
After some debugging I've found that initial blkid cache is created (and later is updated) by /usr/sbin/fstype call from /usr/sbin/rebuildfstab with command 'blkid $1'. But fstype is not called for CDROM devices! So my new suggession is to call blkid "$DEVROOT/$DEVNAME" in rebuildfstab just to fill blkid cache with CDROM entry (see patch).

Navigation

[0] Message Index

[#] Next page

Go to full version