WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: A boot code/way to load "frugal install" as iso9660?  (Read 3878 times)

Offline Santos

  • Full Member
  • ***
  • Posts: 106
A boot code/way to load "frugal install" as iso9660?
« on: July 19, 2018, 09:08:40 PM »
I can't write and speak english properly. Excuse me if you find errors.

Specs:

Code: [Select]
- x32 T42 IBM laptop
- 512 RAM
- No HDD
- 128Mb M2 mass storage device
- 4 ports hub
- 1 adapter m2 slot to usb.

I "installed" Tiny core 9 on a 128Mb M2 Memory. The m2 memory has the following format:

Code: [Select]
GPT - Partition Table

sdb      8:16   1 110.3M  0 disk
├─sdb1   8:17   1    22M  0 part /media/ctiny              -- The "frugal" install of Tc. (ext2)
├─sdb2   8:18   1    24M  0 part /media/Tinycore           -- I use: cat TinyCore.iso > /dev/sdb2
├─sdb3   8:19   1    49M  0 part /media/SliTaz core-4in1   -- The same as above. Slitaz Live
└─sdb4   8:20   1    11M  0 part /media/Core               -- The same as above. Micro Core

Using Gujin bootloader i have the hability to use a partition and the tool 'cat' to do the following: cat Tinycorecurrent.iso > /dev/sdXy. With this procedure Gujin can boot the partition like a iso9660 filesystem ('a real CD-ROM'), gujin allow to store iso files in a fs (ext2,3,4;vfat) too but with limit space doing a partition would take almost 5% of the entire filesystem.

I use this m2 memory card of 128Mb in my 2005 T42 diskless-IBM-laptop. The way i frugal install Tiny Core in this memory:

First i install the bootloader Gujin doing the following steps:

Download the 'install-2.8.7.gz' archive, untar it. (This install the bootloader in the B.E.E.R partition)

Code: [Select]
$ cd install/
$ ./gujin /dev/sdb0 --mbr-device=/dev/sdb

So i have my m2 card beeing able to boot from my computer. Then i use cat to place the iso files in their respective partitions (i use gparted to make the partition table and the partitions itself).

And to frugal install Tiny Core:

Code: [Select]
Mount /dev/sdb1
$ sudo chmod -R 777 /media/ctiny/
Downloaded the current iso at the time (Tc version 9)
$ mkdir iso ; sudo mount -t iso9660 Tinycorecurrent.iso iso/
$ cp -a iso/* /media/ctiny/

At this point i have the rootfs for '/' but i have to struggle with Tiny Core bacause it doesn't follow the "conventions", first the initrd.gz has the name 'core.gz', which the bootloader doesn't take as valid. And it's seems it can't take the kernel parameter: root=

This matters because i need a file to chainload the frugal installation. This file is gujin.cmd.

The configuration of gujin.cmd:

Code: [Select]
I've tried root=UUID and root=PARTUUID, neither of them work.

#TinyCore9 Persistent session.
:ctiny:vmlinuz*:initrd*::cTiny Persistent:kernel=/boot/vmlinuz loglevel=3 --fs-uuid --set=root e8bfc820-2731-48cf-9060-0bbb2e0c6db7 initrd=/boot/initrdtc.gz tce tce=UUID=e8bfc820-2731-48cf-9060-0bbb2e0c6db7 home=UUID=e8bfc820-2731-48cf-9060-0bbb2e0c6db7 waitusb=5 lst=xbase.lst norestore showapps multivt kmap=es tz=GMT-6 noembed pause


I don't know if this is a valid kernel line, the file parse the name of the kernel (vmlinuz*) and the initrd (core.gz renamed to initrdtc.gz) with some kernel parameters, as well.

I've read that linux by default loads the initrd.gz, then the init has the task to load the entire system. So first it's only loaded a temp rootfs and this basic root fs only know about Partiton UUID. But every time i use root=UUID and root=PARTUUID, Tiny core can't load the system, so it's only loaded the micro core enviroment (console mode) because Tc can't find the minimal desktop extensions.

But if i use the previous line in gujin.cmd:

Code: [Select]
tce=UUID=e8bfc820-2731-48cf-9060-0bbb2e0c6db7
Then tiny core can find the rootfs and procede to mount it and load the extensions. Which is bad, every write it's done in the actual m2 device, not the ram, if i try to download a program it gets full because only has a few Kb free, instead of using the 512Mb RAM. But if i unmount the filesystem (sdb1) i can't use the system, instead of using the RAM when downloading and installing using tce-load -wil nano.tcz, it simply don't show anything.

It looks like this, when i hit enter, it does nothing, it's just print another line:

Code: [Select]
$ tce-load -wil nano.tcz
$

I want to have this m2 memory to last as long as possible this means less writes in the flash memory, and i want more space to the frugal install, so i need to delete 'sdb2' to take that space.

The text was to explain how my installation was setup.

Questions:

1)The ISO 'version' of Tiny Core can boot from the usb partition using the iso9660 fs, chainloaded as "El Torito", and i can umount the partition when i see the Tiny Core desktop (this means the extensions are loaded to ram) using umount command or the 'Mount Tool' from wbar.

It's possible to tell the frugal install to load itself as iso9660 system and running entirely in RAM or it's the bootloader the one who take the ultimate decision?

Because in: cat Tc.iso > /dev/sXy is isolinux in charge in conjunction with Gujin bootloader so they map the way to the iso partition and in the frugal install only loads as another system?

2)Why using 'root=' kernel code doesn't seems to work with Tiny Core (even with Tc Plus) and with dCore it does in boot versions (dcore, dcoreplus)?

This often happens when i have in the same usb two partitions like this:

Code: [Select]
├─sdb2 /media/Tinycore           -- I use: cat TinyCore.iso > /dev/sdb2
├─sdb3 /media/Tinycoreplus       -- The same as above. Tiny Core Plus

So if i choose the sdb3 option (TinyCore Plus) i get the Tiny Core console, it doesn't load the extensions, and whe i run the mount command i see the sdb2 partition is mounted, even if a use the 'root=UUID or root=PARTUUID' kernel parameter.

With dcore both version coexist without problem, but if i choose the dcore Plus it loads the dcore console-version, only if i use the root=PARTUUID="" kernel parameter the dcore Plus desktop show in screen.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: A boot code/way to load "frugal install" as iso9660?
« Reply #1 on: July 20, 2018, 05:48:02 AM »
So I gather you want to boot like a CD. If gujin can chainload your cat'ed iso on sdb2, use that. If it can't, the easiest way is to store the iso, kernel and initrd on sdb1, and use the "iso=sdb1" boot param.
The only barriers that can stop you are the ones you create yourself.

Offline polikuo

  • Hero Member
  • *****
  • Posts: 725
Re: A boot code/way to load "frugal install" as iso9660?
« Reply #2 on: July 23, 2018, 01:57:01 AM »
But if i use the previous line in gujin.cmd:

Code: [Select]
tce=UUID=e8bfc820-2731-48cf-9060-0bbb2e0c6db7
Then tiny core can find the rootfs and procede to mount it and load the extensions. Which is bad, every write it's done in the actual m2 device, not the ram, if i try to download a program it gets full because only has a few Kb free, instead of using the 512Mb RAM. But if i unmount the filesystem (sdb1) i can't use the system, instead of using the RAM when downloading and installing using tce-load -wil nano.tcz, it simply don't show anything.

It looks like this, when i hit enter, it does nothing, it's just print another line:

Code: [Select]
$ tce-load -wil nano.tcz
$

That's because TC couldn't find the location to tcedir
If I were you, I'd stay with frugal install.
Load the extensions to RAM onboot.
Change the link of tcedir to RAM (/tmp/tce).

Code: [Select]
$ touch /etc/sysconfig/tcedir/copy2fs.flg # to RAM
$ editor /opt/bootlocal.sh                # relink
umount /dev/sdb1
unlink /etc/sysconfig/tcedir
ln -s /tmp/tce /etc/sysconfig/tcedir
$ filetool.sh -b                           # save changes

Offline Santos

  • Full Member
  • ***
  • Posts: 106
Re: A boot code/way to load "frugal install" as iso9660?
« Reply #3 on: July 29, 2018, 03:38:38 PM »
So I gather you want to boot like a CD. If gujin can chainload your cat'ed iso on sdb2, use that. If it can't, the easiest way is to store the iso, kernel and initrd on sdb1, and use the "iso=sdb1" boot param.

Ok, i'll try that.

What I will try too it's to use mkisofs to remove the /boot directory and only store the /cde directory. Because i can't use much space in the flash, so every MB is gold to me.

If this is the easy way (store kernel,initrd and iso), what it's the hard way?


--Strip--

That's because TC couldn't find the location to tcedir
If I were you, I'd stay with frugal install.
Load the extensions to RAM onboot.
Change the link of tcedir to RAM (/tmp/tce).

Code: [Select]
$ touch /etc/sysconfig/tcedir/copy2fs.flg # to RAM
$ editor /opt/bootlocal.sh                # relink
umount /dev/sdb1
unlink /etc/sysconfig/tcedir
ln -s /tmp/tce /etc/sysconfig/tcedir
$ filetool.sh -b                           # save changes

This is a great advice.

In the bootloader menu i choose to load the kernel and initrd, so i only was able to get the minimal shell (microcore?) because the bootloader just load the kernel and initrd in memory, without a single parameter (except those embedded in the kernel, tz= and other one i don't remember). Then i mount the partition of TinyCore copy the /mnt/sdb2/* (cat .iso > /dev/sdb2) to /home/tc/. And do this:

Code: [Select]
tc@box:~$ tce-load -il ~/sdb2/cde/optional/*
tc@box:~$ startx

But this gives me weird behavior. Every time i open a new aterm instance, i see this:

Code: [Select]
tc@box:~$ (unknown)
tc@box:~$ pwd
(unknown)
tc@box:~$ (unknown) cd
tc@box:~$
tc@box:~$ pwd
/home/tc/
tc@box:~$

Btw, how to use the kernel parameter root= in TinyCore?

2)Why using 'root=' kernel code doesn't seems to work with Tiny Core (even with Tc Plus) and with dCore it does in boot versions (dcore, dcoreplus)?

This often happens when i have in the same usb two partitions like this:

Code: [Select]
├─sdb2 /media/Tinycore           -- I use: cat TinyCore.iso > /dev/sdb2
├─sdb3 /media/Tinycoreplus       -- The same as above. Tiny Core Plus

So if i choose the sdb3 option (TinyCore Plus) i get the Tiny Core console, it doesn't load the extensions, and whe i run the mount command i see the sdb2 partition is mounted, even if a use the 'root=UUID or root=PARTUUID' kernel parameter.

With dcore both version coexist without problem, but if i choose the dcore Plus it loads the dcore console-version, only if i use the root=PARTUUID="" kernel parameter the dcore Plus desktop show in screen.

Thank you.


EDIT:

How to use fromISOfile?
i try extracting the iso from the partition with dd.

Code: [Select]
$ dd if=/dev/sdb2 of=Tiny.iso

And later ...

Code: [Select]
$ sudo fromISOfile Tiny.iso
Invalid device specified: Tiny.iso
$ sudo fromISOfile /dev/sdb2 (cat isofile.iso > /dev/sdb2)
Multiple isos found, please use full path.

This is wrong?
« Last Edit: July 29, 2018, 03:46:22 PM by Santos »

Offline polikuo

  • Hero Member
  • *****
  • Posts: 725
Re: A boot code/way to load "frugal install" as iso9660?
« Reply #4 on: July 31, 2018, 12:07:41 PM »
In the bootloader menu i choose to load the kernel and initrd, so i only was able to get the minimal shell (microcore?) because the bootloader just load the kernel and initrd in memory, without a single parameter (except those embedded in the kernel, tz= and other one i don't remember). Then i mount the partition of TinyCore copy the /mnt/sdb2/* (cat .iso > /dev/sdb2) to /home/tc/. And do this:

Code: [Select]
tc@box:~$ tce-load -il ~/sdb2/cde/optional/*
tc@box:~$ startx

But this gives me weird behavior. Every time i open a new aterm instance, i see this:

Code: [Select]
tc@box:~$ (unknown)
tc@box:~$ pwd
(unknown)
tc@box:~$ (unknown) cd
tc@box:~$
tc@box:~$ pwd
/home/tc/
tc@box:~$

That's not how you load extensions.
I guess you didn't copied the .dep and .md5.txt files along with the extensions.
The loading order matters and it's checked by the tce-load script.

Quote
Btw, how to use the kernel parameter root= in TinyCore?
We use tce=UUID=bla-bla-bla or tce=LABEL=bla-bla-bla instead of root
If you're refering to the set root='(/dev/sda,msdos1)'
That's instructions for grub not TC.

Offline Santos

  • Full Member
  • ***
  • Posts: 106
Re: A boot code/way to load "frugal install" as iso9660?
« Reply #5 on: July 31, 2018, 11:36:21 PM »

--strip--

That's not how you load extensions.
I guess you didn't copied the .dep and .md5.txt files along with the extensions.
The loading order matters and it's checked by the tce-load script.



Quote
Btw, how to use the kernel parameter root= in TinyCore?

We use tce=UUID=bla-bla-bla or tce=LABEL=bla-bla-bla instead of root
If you're refering to the set root='(/dev/sda,msdos1)'
That's instructions for grub not TC.


1)Ok, context matters, in this case it is the order of extensions. What is the correct order to load them?

2)The root= parameter is a kernel boot parameter (it works on dCore port, but not in TinyCore):

http://redsymbol.net/linux-kernel-boot-parameters//

 root= [KNL] Root filesystem
 See name_to_dev_t comment in init/do_mount.c.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: A boot code/way to load "frugal install" as iso9660?
« Reply #6 on: August 01, 2018, 08:53:08 AM »

1)Ok, context matters, in this case it is the order of extensions. What is the correct order to load them?
Extensions listed in .../tce/OnBoot.lst are loaded automatically on boot
When an extension is loaded tce-load references the extension's dependency list file and loads the items listed within it first (extension_Name.dep), if it exists.
Quote
tce-load -il ~/sdb2/cde/optional/*
Not sure how this would work... 
However, to load each extension sequentially, I would use a command similar to
Code: [Select]
for e in /pathToExtensionStore/optional/*.tcz; do tce-load -i $e; done

Remember that to load extensions automatically on boot for a frugal install, the system expects to find extensions at ".../tce/optional/ 
and .../cde/optional for an ISO

To better understand how TC works, please download and read the TC Book;  http://tinycorelinux.net/book.html


Quote
2)The root= parameter is a kernel boot parameter (it works on dCore port, but not in TinyCore):
Honestly, I've never found a need to use this boot parameter.  Keep it simple...    Initially use only the bootcodes as listed within the original ISO boot config file, unless it's confirmed other boot codes are necessary.
Note:  As mentioned above, when installing to a drive, partition or other media as in a frugal install you'll only need to change or remove the cde bootcode.

good luck



Offline Santos

  • Full Member
  • ***
  • Posts: 106
Re: A boot code/way to load "frugal install" as iso9660?
« Reply #7 on: August 04, 2018, 12:21:16 PM »

Extensions listed in .../tce/OnBoot.lst are loaded automatically on boot
When an extension is loaded tce-load references the extension's dependency list file and loads the items listed within it first (extension_Name.dep), if it exists.
Quote
tce-load -il ~/sdb2/cde/optional/*
Not sure how this would work... 
However, to load each extension sequentially, I would use a command similar to
Code: [Select]
for e in /pathToExtensionStore/optional/*.tcz; do tce-load -i $e; done

Remember that to load extensions automatically on boot for a frugal install, the system expects to find extensions at ".../tce/optional/ 
and .../cde/optional for an ISO

To better understand how TC works, please download and read the TC Book;  http://tinycorelinux.net/book.html


I'm reading the book, thank you. Actually i need to follow the order in onboot.lst, if i load each extension in that order, the system works as expected.

In previous attempts i even tried to make a symlink of cde pointing to tce folder with no luck.


Quote
2)The root= parameter is a kernel boot parameter (it works on dCore port, but not in TinyCore):
Honestly, I've never found a need to use this boot parameter.  Keep it simple...    Initially use only the bootcodes as listed within the original ISO boot config file, unless it's confirmed other boot codes are necessary.
Note:  As mentioned above, when installing to a drive, partition or other media as in a frugal install you'll only need to change or remove the cde bootcode.

good luck

As i mention before i put each iso file into a separate partition using 'cat'. The issue comes when i put TinyCore (16Mb) and TinyCorePlus (106Mb) in the same usb but in different partitions. If i select to boot into CorePlus from the bootloader menu i get the TinyCore (16Mb) desktop. This happens with dCore port too (dCore and dCorePlus), but if i use the kernel boot code 'root=partuuid='  from the syslinux command line i can boot into the dCorePlus desktop. I want to do the same with TinyCore, but i can't, the 'original' (tce=, home=) boot codes available in TinyCore doesn't work when telling the init where to find it's extensions.