Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: Hometheatre on June 28, 2024, 03:16:22 AM

Title: Raspberry Pi persistence
Post by: Hometheatre on June 28, 2024, 03:16:22 AM
I'm trying to get my installation of PiCore64 14.1 to save anything, but nothing seems to work. I'm familiar with the workings on x86, but this is different. My install is on a USB drive, with the SD card being just to get the USB to boot. It boots up fine.

I've tried using the TC interface to set things up, but it doesn't stick. The boot partition is sda1, I've expanded sda2 to take the rest of the drive, and set the TCE folder to sda2. When installing an extension, it goes through acquiring it, but then says it fails at the end. If I look at the TCE location on sda2, the extensions are there, with the onboot.lst. Changing the ip address to be static doesn't persist either. I've used the backup tool to execute a backup before I reboot.

Something that's a bit strange is in the localboot.sh it has an entry to start ssh, but the path it refers to doesn't exist.
Title: Re: Raspberry Pi persistence
Post by: Paul_123 on June 28, 2024, 06:49:50 AM
Your usb stick is likely recognized too late, try setting waitusb=8 on the command line.  Once working, look at dmesg for when the usb is found, and decrease the timr
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on June 28, 2024, 06:14:04 PM
That's not making any difference. I think the issue is TCE isn't set anywhere. In the TC interface I set it with the app browser, but that's not getting written anywhere. I have both sda1 and sda2 mounted with the mount tool. Do I need to set TCE in the cmdline file, since there are no entries relating to it in there? Does it need the device ID or will dev/sda2 work?
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on June 28, 2024, 06:26:25 PM
I just did a fresh install with the SD card, and that behaves as expected. It seems USB doesn't work properly. For instance SSH keys aren't generated on first boot. The second partition isn't mounted with TCE set to it.

So if I want to use a USB drive, do I create the system I want on the SD card then duplicate to the USB drive?
Title: Re: Raspberry Pi persistence
Post by: Paul_123 on June 28, 2024, 08:09:18 PM
I run usb boot all the time, other that waitusb, it’s automatic.  I was guessing at 8 seconds, there are some really slow USB devices,  look at dmesg, to see when the kernel sees it.
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on June 28, 2024, 10:16:35 PM
I tried 20 seconds, and same result. Dmesg seems to see it around 5 seconds. It looks like you can tell if it's a "live" system as to whether the tc@box prompt is coloured or grey. It's always grey with USB for me.
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on June 28, 2024, 10:19:04 PM
Also, the aarch64 versions don't have the TC extension to get to the interface.
Title: Re: Raspberry Pi persistence
Post by: Rich on June 28, 2024, 10:30:40 PM
Hi Hometheatre
TC.tcz  is a meta-extension. It is the equivalent of running:
Code: [Select]
tce-load -wi Xorg flwm_topside wbar aterm
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on June 29, 2024, 01:49:20 AM
I've got a system setup on an SD card which does all the things I need. How to get that running on a USB drive?
Title: Re: Raspberry Pi persistence
Post by: Paul_123 on June 29, 2024, 08:05:43 AM
Whatever drive contains the tce folder is used.  How are you creating the usb stick.
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on June 29, 2024, 04:44:49 PM
I'm just flashing the piCore image to the USB drive, and booting that. I'm guessing I need to set the tce folder in the cmdlist.txt file. Would I also need to set opt and home?
Title: Re: Raspberry Pi persistence
Post by: Paul_123 on June 29, 2024, 04:49:18 PM
No you dont.  Just burn the image, increase the waitusb value.   Then boot your device.
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on June 29, 2024, 05:25:15 PM
That's what I've done. I have a 3B pi, and am using the SD card with the pi bootloader to get the USB to boot. I wonder if piCore sees there's an SD card and is trying to use it.
Title: Re: Raspberry Pi persistence
Post by: Paul_123 on June 29, 2024, 05:33:20 PM
So you burned the same image to both sd and USB.   That will cause problems with auto detection.   Why just not use one or the other?
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on June 29, 2024, 06:09:20 PM
No, I burnt the image to the USB, and have the pi bootloader on the SD. Without the pi bootloader the USB won't boot. If I had a 3B+ or higher I wouldn't need the pi bootloader.
Title: Re: Raspberry Pi persistence
Post by: Paul_123 on June 29, 2024, 07:01:00 PM
If that’s what you want,  burn the piCore image to the sdcard.   Then create a single ext4 partition on the usb, then copy the second partition das FROM The sd to usb disk, then remove the second partition from the sd card.
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on June 30, 2024, 12:03:42 AM
I think you misunderstand what I mean by pi bootloader. I'm referring to a Raspberry pi bootloader binary that's 52K, that is only to get the USB device to boot. That's all that is on the SD card. Without it, there's no USB booting. It's not the piCore bootloader. That's all on the USB.

I did try pulling the SD card with the raspberry pi bootloader out once the multi colour boot screen came up, but still didn't work.

I've gone and set the OTP bit to boot from USB on my pi 3B. With the usual 5 sec waitusb it now works. There's no SD card in the device. Booting without the Raspberry pi bootloader binary on an SD card has less compatibility for USB devices. One of my sticks doesn't work without it. It's now using what's on the system chip, which is old.
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on June 30, 2024, 12:44:47 AM
And it's stopped working.

Maybe I'll try the split system you mentioned. Boot partition on the SD card, second partition on the USB. I'm using this as a media server. I guess the SD card won't get touched once the system has booted.
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on June 30, 2024, 02:52:14 AM
Tried the split setup. Doesn't work. It boots up, but is a dead system, no tce, just like all the other attempts.
Title: Re: Raspberry Pi persistence
Post by: Paul_123 on June 30, 2024, 07:00:39 AM
You need the full boot partition from our image, not just the bootloader.
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on June 30, 2024, 03:15:47 PM
That's what I did. I took the working SD installation, copied the second partition to the USB, then deleted the second partition from the SD, and have it a usbwait of 10.
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on July 01, 2024, 03:58:30 PM
Big dumb mistake by me. I've been putting usbwait not waitusb. Sorry for waste of time.
Title: Re: Raspberry Pi persistence
Post by: Paul_123 on July 01, 2024, 05:39:09 PM
So you are all good now?  I have a bit of time to test this tonight if needed.
Title: Re: Raspberry Pi persistence
Post by: Hometheatre on July 01, 2024, 05:47:15 PM
Yeah, I think I'm good. Did a quick test this morning with the right wording and it's a live system.