Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: vinceASPECT on June 05, 2011, 12:36:13 PM

Title: bootcodes
Post by: vinceASPECT on June 05, 2011, 12:36:13 PM
hello fourm people,

Please can you tell me which config file i use for inserting a bootcode command.
This is so that the machine will execute the bootcodes without any manual typing
required at booting stages.

I am running TCL frm the cd loaded into ram.

Does the above idea mean that i would need to re-master the CD also?


thanks

Vince.
Title: Re: bootcodes
Post by: gerald_clark on June 05, 2011, 01:18:25 PM
You need to edit whatever config file your boot loader uses.
Identify your boot loader and boot device and we maybe able to point you to it.

Title: Re: bootcodes
Post by: vinceASPECT on June 05, 2011, 01:39:56 PM
uh...

the boot device is a CD drive. THe medium is a CD disc containing TCL 3.6

Is the bootloader not standard in TCL 3.6?  (and thus the appropriate config file)
(and do you know what they are......so as to tell me?)

I boot the laptop up from the TCL cd disc....then remove it from the drive.

Is this info any help?


Vince.
Title: Re: bootcodes
Post by: curaga on June 05, 2011, 01:46:02 PM
Sure, that'd be boot/isolinux/isolinux.cfg on the cd. See the remastering page on the wiki for the mkisofs command to pack the cd back up.
Title: Re: bootcodes
Post by: vinceASPECT on June 05, 2011, 01:48:42 PM
Hello

Oh that's great. Thanks a lot.

I will look at the wiki also

Vince.
Title: Re: bootcodes
Post by: gerald_clark on June 05, 2011, 01:51:00 PM
Remastering will probably make the CD less general, and it may not boot on other machines.
If you are trying to taylor to a specific machine, installing to hard disk or flash drive may be a better option.
Title: Re: bootcodes
Post by: vinceASPECT on June 05, 2011, 02:03:28 PM
oh i see.

the custom CD would just be used on this laptop....and nothing else...so

although the machine does have a hard drive

Vince.
Title: Re: bootcodes
Post by: Rich on June 05, 2011, 02:52:43 PM
If all you want to do is edit the isolinux.cfg file, why not just mount the ISO file, edit the cfg file, unmount
and burn the ISO file. I'm pretty sure that's all I did a couple of years ago when I wanted to add some
boot codes. I think the only limitation is that you don't make the file spill over to the next block.
Title: Re: bootcodes
Post by: vinceASPECT on June 05, 2011, 03:50:29 PM
Rich,

that's exactly what i want to do....

so i mount the TLC disc....edit that file....then unmount the TCL disc.

remove the TCL disc from the optical drive

insert a blank CD disc into the optical drive

then burn the iso file from the desktop?

will this idea work correctly then?

vince.
Title: Re: bootcodes
Post by: gerald_clark on June 05, 2011, 04:05:05 PM
No, you need to mount and edit the iso file, not the CD.
Title: Re: bootcodes
Post by: Rich on June 05, 2011, 04:09:11 PM
Hi vinceASPECT
Not mount the disk. Mount the the ISO file you originally downloaded to burn the disk. You may have
to mount it as a loop device, I don't recall that detail. A little google action should turn that up for you.
Title: Re: bootcodes
Post by: vinceASPECT on June 05, 2011, 04:33:29 PM
hello,

uh yes...

i just worked that out......it's the original .ISO file that i need to mount. (not the TCL cd disc)

other than that....this idea sounds like the perfect solution for what i am trying to
achieve.

thanks

Vince.
Title: Re: bootcodes
Post by: tinypoodle on June 05, 2011, 06:29:08 PM
Umm... last time I checked, iso9660 was a read-only filesystem.
Or am I missing something here?   ???
Title: Re: bootcodes
Post by: Rich on June 05, 2011, 06:38:24 PM
Hi tinypoodle
Technically you are correct, however, if you do not change the number of blocks the file occupies you
can get away with editing it. It's been awhile since I've looked at this, but I think what makes it read
only is that you can't change directory entries this way. So you can't just start adding and removing
files.
Title: Re: bootcodes
Post by: Guy on June 05, 2011, 08:39:21 PM
Let's say you downloaded tinycore_3.6.iso to /home/tc/dl

create a directory called tmp in /home/tc/dl

In the terminal type

Quote
sudo su
cd /home/tc/dl
/bin/mount tinycore_3.6.iso tmp

edit boot/isolinux/isolinux.cfg

to make a new iso

Quote
sudo su
/home/tc/dl
mkisofs -l -J -V TC-custom -no-emul-boot -boot-load-size 4 -boot-info-table \
-b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -o modified_tinycore_3.6.iso tmp
Title: Re: bootcodes
Post by: gerald_clark on June 05, 2011, 11:55:17 PM
You do not need to make a new iso.  Just burn the one you have.
Title: Re: bootcodes
Post by: glene77is on June 06, 2011, 12:23:15 PM
Along these same lines:

*** Live-CD with an install of core, apps, config, etc on the HD.
(1) I ran the Live-CD,
(2) installed the tinycore /boot onto my HD as /tinycore,
(3) altered the isolinux.conf to name the new /tinycore subdir,
(4) added script to my grub2, and it booted OK.   
(5) Loaded the app Abiword to /optional per your Apps_installer.
(6) rebooted OK from HD.   

*** USB flash drive install.
(1) copied my tinycore HD /tinycore" to a USB flash drive,
(2) copied across the HD /tce with the Abiword app in the /optional subdir.   
(3) No bootup, of course (ha).   
Fresh USB flash drive, with no MBR and no bootloader binary, no grub, no 'menu.lst'.
(4) installed   grub4dos,  added  the script for tinycore, and it booted OK.    :) 
(5) grub4dos located and scripted for (a) sda1/XP, and (b) sda5/Ubuntu.     
No conflict between any of these on the USB flash drive.   
(6) Since grub4dos was running,
Also added to the USB flash drive     ...(a) Puppy 5.25,     ...(b) Parted-Magic.
No conflict between any of these on the USB flash drive.   
USB will boot :
. . . (.a) TinyCore, (.b) Puppy 5.25, (.c) Parted-Magic, (.d) sda1/XP, (.e) sda5/Ubuntu, 
OK.  :)

*** However, to my surprise,     :o
(1) TinyCore would boot from USB,
and locate the HD /tce and load all the configs and apps from the HD. 
(2) TinyCore would not locate the local USB /tce
probably because the HD /tce configs were in control.
I added the boot code "kernal ... pmedia=usbflash", to no avail. (hope I spelled it right).

*** So,
As long as I only have one TinyCore installed & available to run in the system, I am OK.
Else, the USB TinyCore will find the HD /tce and run in a 'frugal' mode off the HD. 
Seems like that would be OK, except I need to have TinyCore running independently on the USB. 

*** I would like to be able to name the core subdir "/tc-core",  which I have done OK.
I would like to be able to name the extensions subdir to be "/tc-e", which I am trying to figure out.
That way, the USB TinyCore would "stay-put" on the USB, and not see any other "/tce" on the HD.

*** Then I would have the ability to introduce my USB TinyCore into a customers PC,
without reading the customers PC HD and auto-finding the customers /tce configs, etc.

*** also,
Running from the USB TinyCore, I am unable to get the filemanager to read the local sda1 & sda2.

*** Goal:
I would appreciate a point in the right direction to some documentation to handle these topics,   :)
--- I realize that these may be "Built-In" features of TinyCore.     ::)   
--- Happens in all systems, including my own developments.   8)
--- Sometimes there is no "fix" for these 'features' 
--- so thanks, for the pointing,    :)
and I don't expect a big answer, just some guided pointing.

glene77is

Title: Re: bootcodes
Post by: roberts on June 06, 2011, 12:53:52 PM
f you are going to run Tiny Core from a pendrive, or any removal device, you should be using UUID or LABEL, to properly identify the device.  The installation program for pendrives included with Tiny Core up to v3.6 provides an automatic setup with such features. You will also need a waitusb for slow removal devices to be detected. This is also provided with the install program.
Title: Re: bootcodes
Post by: maro on June 06, 2011, 09:34:49 PM
@glene77is: To add to Robert's point about using 'tce=LABEL=...' or 'tce=UUID=...' boot codes: There is nothing that stops you from adding a non-standard directory name to the device specification.

I've just done a quick test with installing TC (using a QEMU VM) to a (virtual) hard disk using the 'install.gz' starterpack (with TC 3.7rc3): After
    mount /mnt/hda1 ; mv /mnt/hda1/tce /mnt/hda1/tc-e
I changed in '/mnt/hda1/syslinux.cfg' the entry of
Code: [Select]
APPEND initrd=/boot/tinycore.gz quiet  waitusb=5:UUID="98F6-837D" tce=UUID="98F6-837D"to
Code: [Select]
APPEND initrd=/boot/tinycore.gz quiet  waitusb=5:UUID="98F6-837D" tce=UUID="98F6-837D"/tc-e
And indeed after a reboot I could confirm that the change was properly recognised:
Code: [Select]
tc@box:~$ cat /opt/.tce_dir
/mnt/hda1/tc-e
tc@box:~$

The same applies to other boot loaders or older TC versions. Mind you I did not go back to find out exactly since when 'tce=DEVICE/DIRECTORY' is supported in it's current form (where DEVICE could be 'UUID=...' and DIRECTORY some non-standard directory). But a quick re-test with TC 2.11.6 showed that it works this way since at least the end of the TC 2.x series.

Furthermore about the apparent failure to read 'sda1' and 'sda2': By default TC (unlike many other Linux distributions) does not auto-mount all devices it finds. Only the device containing the 'tce' directory (e.g. '/mnt/sda1/tc-e') would be mounted, all the others would need to be done either manually by the user (e.g. via the GUI 'mnttool') or via appropriate 'mount' commands that could be included in '/opt/bootlocal.sh' and therefore being repeated at boot time.
Title: Re: bootcodes
Post by: Guy on June 07, 2011, 12:44:53 AM
http://wiki.tinycorelinux.net/wiki:uuid
Title: Re: bootcodes
Post by: Guy on June 07, 2011, 12:46:21 AM
Quote
Running from the USB TinyCore, I am unable to get the filemanager to read the local sda1 & sda2.

Mount them first.

To do this, click on the mount tool in the wbar at the bottom of the screen.
Title: Re: bootcodes
Post by: glene77is on June 08, 2011, 01:15:15 PM
Quote
Running from the USB TinyCore, I am unable to get the filemanager to read the local sda1 & sda2.

Mount them first.


@ GUY,
Thanks.  Sounds obvious, will review my process.
Need to move on to the info on the tce=LABEL, etc.

@ MARO,

Quote/
to
Code:

APPEND initrd=/boot/tinycore.gz quiet  waitusb=5:UUID="98F6-837D" tce=UUID="98F6-837D"/tc-e

And indeed after a reboot I could confirm that the change was properly recognised:
Code:

tc@box:~$ cat /opt/.tce_dir
/mnt/hda1/tc-e
tc@box:~$

/Quote

Thanks for the hints & tips.   
Will work on them.

glene77is
Title: Re: bootcodes
Post by: glene77is on June 08, 2011, 05:48:55 PM
Quote
Running from the USB TinyCore, I am unable to get the filemanager to read the local sda1 & sda2.

Mount them first.


@ GUY,
Think this particular USB pen-drive is different, but the difference is not known.
Four USB pen-drives made by Cruiser (Sans Disc).
On this particular one: Two partitions, both ext2, first has boot flag. 
Parted-Magic (Gparted) shows nothing unusual about this USB pen-drive.
Four USB pen-drives made by Cruiser (Sans Disc), all 8 GigByte, formatted ext2. 
Other three USB pen-drives are mountable and then exposed properly by the Fluff filemanager.
glene77is
Title: Re: bootcodes
Post by: glene77is on June 08, 2011, 11:16:25 PM
Maro,
I tried your code:
        APPEND initrd=/boot/tinycore.gz quiet  waitusb=5:UUID="98F6-837D" tce=UUID="98F6-837D"/tc-e
as
title ==={ T.C }--- TinyCore Linux 3.6 ---}===\n ---{ sda1/tinycore/bzImage }---
       #root  (hd0,0)   ### grub4dos numbering
   find --set-root /tinycore/bzImage
   kernel  /tinycore/bzImage  quiet
   #initrd                /tinycore/tinycore.gz
   APPEND    initrd=/tinycore/tinycore.gz  quiet   waitusb=5:UUID="98F6-837D"   tce=UUID="98F6-837D"/tc-e
        #PPEND    initrd=     /boot/tinycore.gz   quiet   waitusb=5:UUID="98F6-837D"   tce=UUID="98F6-837D"/tc-e

Looks like the same code.
Error was about "No Crossover", then "Kernal Panic".
Need to read up , then return to this procedue later.
Thanks for the help.  Looks interesting.
glene77is
Title: Re: bootcodes
Post by: maro on June 09, 2011, 06:21:07 PM
OK, I admit I made the "colossal" mistake in my reply #18 not to have put in a reference to the relevant part of the FAQ (http://distro.ibiblio.org/tinycorelinux/faq.html#pendrives) (my weak "excuse" might be that I've written this or a similar sentence now probably 30+ times in this forum here and I'm getting a bit "slack").

Therefore: Don't use a UUID (http://en.wikipedia.org/wiki/Uuid) I've used in my little sample. The whole point of a "universally unique identifier" is just that, to be UNIQUE for your device. So find out your UUID (e.g. via blkid /dev/[hs][dr]*) for the file system in question, use it in your boot loader configuration file and the "world might be a better place" ...
Title: Re: bootcodes
Post by: glene77is on June 09, 2011, 09:53:35 PM
Maro,
You are a good man. Thanks for the fix.   :D

Will  read on the     
blkid /dev/[hs][dr]*

glene77is