WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: update picore release without mastering image  (Read 754 times)

Offline meninblek

  • Newbie
  • *
  • Posts: 4
update picore release without mastering image
« on: July 29, 2024, 10:33:26 AM »
Hi, i want to upgrade my system from 14.x to 15.x release. In the directory of 15.x of picore no .img files appears, but only several files relating kernel and its modules..how should i install it on my raspberry?it,s possible to prevent future crashes with a safe rollback procedure?
Thank you,
bye

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14756
Re: update picore release without mastering image
« Reply #1 on: July 29, 2024, 11:02:08 AM »
The "official" install procedure is to download the zip file, unzip it and use dd to burn the img file to an sd card - this will overwrite everything on the sd card.

It is possible to mount the img file and copy the required files to your existing sd card, but this requires knowing what you are doing and leaves scope for mistakes that might render your existing sd card unbootable, overwrite files you want to keep, etc.

Offline meninblek

  • Newbie
  • *
  • Posts: 4
Re: update picore release without mastering image
« Reply #2 on: July 29, 2024, 12:31:36 PM »
Thank you for answer, i’d like to learn more about second choice. My goal is to create a script to sync first partition of my remote device wireless.. where can I found docs about structure of first partition?

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1229
Re: update picore release without mastering image
« Reply #3 on: July 29, 2024, 01:00:50 PM »
Everything on the first partition needs replaced when changing from 14.x to 15.x, you need to be careful of manual changes made to config.txt and cmdline.txt   Its' just a fat formatted partition.

The second (TCE) partition is where the trick is.  As you need to get new kernel modules from the repo matching the new kernel, as well as updating extensions.  New extensions may have a different dependency tree.

Your best be is to start with a fresh image, and then transfer any settings you had from the 14.x image.


Offline meninblek

  • Newbie
  • *
  • Posts: 4
Re: update picore release without mastering image
« Reply #4 on: July 30, 2024, 02:45:17 AM »
So, if i understand, the best solution could be:
- fresh installation on tester device
- customization of tester device
- when checked, copy first and second partition on remote device and reboot..
correct?

what about mbr? i need to change first 512 byte or no?

Thank's

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11519
Re: update picore release without mastering image
« Reply #5 on: July 30, 2024, 08:31:49 AM »
Hi meninblek
... what about mbr? i need to change first 512 byte or no? ...
The MBR includes start and end location as well as size of each
partition, so it should be copied too.

There is no guarantee partition 1 won't change size from version to version.
You'll want to expand partition 2 so that the size of P1 + P2 is slightly smaller
than what's on your remote device. I think P1 starts on a 1 Megabyte
boundary, so maybe leave 2 Megabytes of un-allocated space at the end of
your remotes storage device so you don't fall off of the end when accessing it.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1229
Re: update picore release without mastering image
« Reply #6 on: July 30, 2024, 01:27:03 PM »
Partition sizes could change.  It would best to read the partition table from the image, then deal with it appropriately.

Offline meninblek

  • Newbie
  • *
  • Posts: 4
Re: update picore release without mastering image
« Reply #7 on: July 30, 2024, 02:26:02 PM »
Sorry, I correct myself: i meant PBR, not MBR.
MBR store partition size and flash ( boot partitone, ecc), I don’t think there’s any reason to change it: my remote device is the same,I want just delete older files and copy newer ones, i don’t want dd-ing whole partition.
The PBR of /dev/mmcblk0p1 store bootloader and my question was about it:bootloader could change? It could be load new kernel and new image?

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1229
Re: update picore release without mastering image
« Reply #8 on: July 30, 2024, 05:32:42 PM »
Raspi updates the bootloader often and it can be kernel specific changes, that's why I said everything on partition 1 needs to be copied.

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 747
Re: update picore release without mastering image
« Reply #9 on: July 30, 2024, 06:16:51 PM »
@Rich already has a partial answer posted at: https://forum.tinycorelinux.net/index.php/topic,24063.msg151721.html#msg151721

Here is what I would do:
  • Mount the primary partition of 15.x (all of the RasPi files)
  • Delete /mnt/mmcblk0p1/(everything) and copy the above mounted content into mmcblk0p1
  • The device is now upgraded to 15.x but the extensions are not

  • Mount the second partition of 15.x (the TCE content)
  • Delete all files found in /etc/sysconfig/tcedir/optional
  • Rename /etc/sysconfig/tcedir/onboot.lst to onboot.old
  • Copy [your 15.x mount]/tce/optional to /etc/sysconfig/tcedir/optional
  • Copy [your 15.x mount]/tce/onboot.lst to /etc/sysconfig/tcedir/optional/onboot.lst
  • Reboot

Your RasPi should now be running 15.x with its default setup and extensions. If you have a backup file from 14.x with custom /opt or similar, you may experience errors if it tries to find extensions which only existed in your 14.x install.  To help correct this you could install at least most of them by using your onboot.old file:
Code: [Select]
while read -r line
do
     echo "${YELLOW}
     tce-load -wi $line
done < /etc/sysconfig/tcedir/onboot.old
Pay attention to any entries which fail as they'll have to be done manually.


@Paul_123: For x86 and x64 there's 15.x/x86/release/distribution_files which contains the boot files for 80x86 releases. What is your opinion of having a similar resource directory for RasPi on the repo?
On our end, this is how we do it:
Code: [Select]
14.x
  \__ armv7
    \__ releases
      \__ distribution_files
        \__ mmcblk0p1.tar.gz
         __ mmcblk0p2.tar.gz
         __ raw
          \__ mmcblk0p1 (all the files from mmcblk0p1.tar.gz)
          \__ mmcblk0p2 (all the files from mmcblk0p2.tar.gz)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11519
Re: update picore release without mastering image
« Reply #10 on: July 30, 2024, 09:09:11 PM »
Hi meninblek
This is a write up I did on resizing the piCore image file:
https://forum.tinycorelinux.net/index.php/topic,24015.msg151428.html#msg151428
I don't have a pi, so I performed all of the operations for the write up using TC10 X86.

Aside from this write up and the one CentralWare mentioned, a couple of additional
write ups are listed here:
https://forum.tinycorelinux.net/index.php/topic,25847.msg165769.html#msg165769

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 747
Re: update picore release without mastering image
« Reply #11 on: July 31, 2024, 12:13:44 AM »
Code: [Select]
while read -r line
do
     tce-load -wi $line
done < /etc/sysconfig/tcedir/onboot.old
Remove the line starting with echo as it didn't paste here correctly and isn't required for operations