Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: manit123 on October 25, 2014, 10:43:16 PM

Title: how to have multiple configurations to boot in picore+
Post by: manit123 on October 25, 2014, 10:43:16 PM
what can be grub2 (of desktop pc) like arrangement here ?
example - i want to be asked at boot which entry i want . all entries will have different  kernel  options .
Title: Re: how to have multiple configurations to boot in picore+
Post by: Juanito on October 26, 2014, 12:59:23 AM
see the example in the last post of this thread:

http://forum.tinycorelinux.net/index.php/topic,17298.msg103751.html#msg103751
Title: Re: how to have multiple configurations to boot in picore+
Post by: manit123 on October 26, 2014, 03:35:01 AM
i meant , booting of raspberry pi b+ does not involve grub2 or similar boot loader .
Title: Re: how to have multiple configurations to boot in picore+
Post by: bmarkus on October 26, 2014, 04:03:17 AM
No bootloader like grub, it is an embedded system.

You must change config.txt and cmdline.txt either manually or by script (program) and reboot. You can use multiple TCE directories too. I have multiple versions on a single SD card, it works fine.
Title: Re: how to have multiple configurations to boot in picore+
Post by: mocore on October 26, 2014, 06:23:47 AM
i meant , booting of raspberry pi b+ does not involve grub2 or similar boot loader .

you can use
'uboot.bin - Third stage: U-Boot loader '
**FreeBSD/ARM on Raspberry Pi is using it !

I would be intrested in "multiple configurations" via some kind of menu (if any one know a way that works, do tell )

From what little i know it might be possible with uboot
But i have thus far been to distracted to setup a test..... 

Quote
Anatomy of a Raspberry Pi Boot Image

A FreeBSD bootable image for Raspberry Pi has both FAT and UFS partitions containing the following files:

    FAT Partition
        bootcode.bin - First stage boot
        start.elf - Second stage boot
        config.txt - configuration for start.elf
        rpi.dtb - FDT file loaded via config.txt
        uboot.bin - Third stage: U-Boot loader
        uEnv.txt - configuration file for U-Boot
        ubldr - Fourth stage: FreeBSD bootloader

** https://wiki.freebsd.org/FreeBSD/arm/Raspberry%20Pi

** http://kernelnomicon.org/?p=133#"U-Boot for Raspberry Pi, the last step"
Title: Re: how to have multiple configurations to boot in picore+
Post by: lykkedk on October 26, 2014, 06:39:05 AM
Hi...

I am in for writing a script, which lets you choose kernel versions, at SSH-login prompt.

I got the main part working, but needs to figure out, howto use multible TCE -dir's (TCE-A, TCE-B etc...)
Havent dig into it yet though!

Any hint Bela' ?

Regard;
   Jesper.
Title: Re: how to have multiple configurations to boot in picore+
Post by: bmarkus on October 26, 2014, 06:50:56 AM

I got the main part working, but needs to figure out, howto use multible TCE -dir's (TCE-A, TCE-B etc...)
Havent dig into it yet though!


Use tce= command line parameter to specify it explicitely.
Title: Re: how to have multiple configurations to boot in picore+
Post by: bmarkus on October 26, 2014, 06:55:56 AM
uboot: it would be good to have it working with piCore too as an alternative to the manistream booting. I'm busy with the base system and extensions, no time to work on uboot. Contrybutions are highly appreciated!
Title: Re: how to have multiple configurations to boot in picore+
Post by: lykkedk on October 26, 2014, 07:04:19 AM
 :)

Quote
Use tce= command line parameter to specify it explicitely.

Okay, so i simply use e.g ::

tce=/dev/mmcblk0p2/tce-a smsc95xx.turbo_mode=N dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0x3 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 initrd=0xa00000,3787852 root=/dev/ram0 elevator=deadline rootwait nortc loglevel=3 waitusb=5

or "default" ::

tce=/dev/mmcblk0p2/tce smsc95xx.turbo_mode=N dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0x3 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 initrd=0xa00000,3787852 root=/dev/ram0 elevator=deadline rootwait nortc loglevel=3 waitusb=5

well i try it out !
Title: Re: how to have multiple configurations to boot in picore+
Post by: bmarkus on October 26, 2014, 07:12:44 AM
By default no hardwired tce directory, system is searching mountable fat and ext partions for /tce and uses the first found. Same as on x86
Title: Re: how to have multiple configurations to boot in picore+
Post by: lykkedk on October 26, 2014, 07:25:58 AM
 8)

Quote
By default no hardwired tce directory, system is searching mountable fat and ext partions for /tce and uses the first found. Same as on x86

Multible questions then ::

1/ If i use more than one tce-dir, then i can set in cmdline.txt tce=/dev/mmcblk0p2/tce-a for boot into eg. kernel a - Will it work for default location like tce=/dev/mmcblk0p2/tce ???

2/ Do i then have to make persist in /opt/.filetool.lst eg. dev/mmcblk0p2/tce-a ?

Okay... enough for a start!

Regards;
   Jesper.
Title: Re: how to have multiple configurations to boot in picore+
Post by: bmarkus on October 26, 2014, 07:40:04 AM
1) Yes

2) No, /mnt/mmcblk0p2 is the 2nd partition of your SD card which is persistent
Title: Re: how to have multiple configurations to boot in picore+
Post by: manit123 on October 26, 2014, 08:42:13 AM
bmarkus ,
please ,  can you show your config.txt & cmdline.txt ?
Title: Re: how to have multiple configurations to boot in picore+
Post by: bmarkus on October 26, 2014, 09:11:03 AM
bmarkus ,
please ,  can you show your config.txt & cmdline.txt ?

Just the default with tce boot code, nothing special.
Title: Re: how to have multiple configurations to boot in picore+
Post by: lykkedk on October 26, 2014, 01:40:21 PM
Hi...

I have been trying, without luck, to paste the tce=/dev/mmcblk0p2/tce, RPI boots, but no ethernet ???

Whats the right syntax ???

Code: [Select]
tce=/dev/mmcblk0p2/tce smsc95xx.turbo_mode=N dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0x3 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 initrd=0xa00000,3787852 root=/dev/ram0 elevator=deadline rootwait nortc loglevel=3 waitusb=5
Regards;
   Jesper.
Title: Re: how to have multiple configurations to boot in picore+
Post by: bmarkus on October 26, 2014, 01:42:52 PM
Try /mnt/mmcblk0p2/tce

Just for curiosity, you can try to with /tc1 /tce2 ... /tcen and symlink one to /tce on the same partition.
Title: Re: how to have multiple configurations to boot in picore+
Post by: lykkedk on October 26, 2014, 01:56:57 PM
Okay...

I am busy rest of evening, but will report back.

I am writing a script, which shall make user choose between 2-3 diff. Setups on same SD card..

Jesper
Title: Re: how to have multiple configurations to boot in picore+
Post by: manit123 on October 27, 2014, 02:52:15 AM
i think
(1)no editing required in config.txt if your hdmi connected device displays OK .(you can uncomment #hdmi_drive=2 if you do not get audio in OS)
(2)currently my cmdline.txt reads
Quote
dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0x3 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 initrd=0xa00000,3638903 root=/dev/ram0 elevator=deadline rootwait nortc loglevel=3 waitusb=5
Say , I want lst=server.lst & lst=local.lst in first & second entry respectively . There should be timeout of 30 seconds . Then , what should I do ?
Title: Re: how to have multiple configurations to boot in picore+
Post by: bmarkus on October 27, 2014, 07:07:49 AM
Problem is that before booting video and USB terminal doesn't work, you don't have a peripherial device to see and select what to boot, practically it doesn't work. UBOOT is different, it has its own small "OS" running on the hardware in a limited way to perform such operations. It requires a kernel with device tree support also. It is not a simple staff to get it working on the Pi, you need a lot to do not only scripting. You may read http://elinux.org/RPi_U-Boot
Title: Re: how to have multiple configurations to boot in picore+
Post by: lykkedk on October 27, 2014, 01:37:20 PM
Hi. -I figured it out now.

Quote
Try /mnt/mmcblk0p2/tce

Just for curiosity, you can try to with /tc1 /tce2 ... /tcen and symlink one to /tce on the same partition.

Syntax for choose tce -dir is ::

tce=mmcblk0p2/tce (or whatever e.g. tce=mmcblk0p2/tce/tce-a)

Regards;
   Jesper.
Title: Re: how to have multiple configurations to boot in picore+
Post by: manit123 on October 29, 2014, 07:37:35 AM
from what I have read , it is difficult to give user option to choose boot entry as usb driver for keyboard are not loaded .
I think , bmarkus said that one way is to create a script that modifies cmdline.txt for next reboot .
Personally , I would prefix lst=something.lst in cmdline.txt  for different configurations & let all tcz,dep remain in tce/optional of second partition of micro sd card.

I came across berryboot which helps.
I tried to follow http://www.berryterminal.com/doku.php/berryboot/adding_custom_distributions for picore images .
But expected results were not obtained .
Will give full details ASAP .
Title: Re: how to have multiple configurations to boot in picore+
Post by: manit123 on October 31, 2014, 09:19:42 AM
while following http://www.berryterminal.com/doku.php/berryboot/adding_custom_distributions , I get stuck here
Code: [Select]
$ sudo kpartx -av piCore-5.3-SSH.img
add map loop1p1 (252:1): 0 43008 linear /dev/loop1 2048
device-mapper: resume ioctl on loop1p2 failed: Invalid argument
create/reload failed on loop1p2
add map loop1p2 (0:0): 0 19584 linear /dev/loop1 45056