WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: remaster the core of PiCore  (Read 3727 times)

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
remaster the core of PiCore
« on: July 28, 2021, 05:41:04 AM »
Hi There,

i need to remaster the Core of PiCore v13.x armv7

i already did that on CorePure64 v10.x with the Help from Rich http://forum.tinycorelinux.net/index.php/topic,24622.15.html

i want to do the same thing with fbv on PiCore, where do i start ?

Thx

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: remaster the core of PiCore
« Reply #1 on: July 28, 2021, 11:44:36 AM »
Hi Rabie
... i want to do the same thing with fbv on PiCore, where do i start ?
ARM is different from x86, but I think I can get you part of the way there. Since you said v7, I will try to include that
reference wherever it is relevant.

VERSION  is the version number of the zip file name. The latest as of this writing is  piCore-13.0.3.zip
1. Unzip the  piCore-VERSION.zip  file.
2. Mount the  .img  file:
    http://forum.tinycorelinux.net/index.php/topic,24063.msg151721.html#msg151721
3. Unpack the  core.gz (initrd)  file:
    http://forum.tinycorelinux.net/index.php/topic,24622.msg156235.html#msg156235
    /path/to/existing/core.gz  will be  P1/VERSIONv7.gz
4. Make your changes and repack your new  initrd  file, same link as item #3:
    http://forum.tinycorelinux.net/index.php/topic,24622.msg156235.html#msg156235

That ends what I know. What follows is what I think I know.
I don't have Pi hardware, but I did perform some commands under x86 on piCore-9.0.3.zip and its contents.

Based on the following 2 commands:
Code: [Select]
tc@E310:~/PiCore/TC9$ df -h P1
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop284p1   34M   30M  3.7M  90% /home/tc/PiCore/TC9/P1
tc@E310:~/PiCore/TC9$
tc@E310:~/PiCore/TC9$ lsblk /dev/loop284p1
NAME      MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop284p1 259:0    0  34M  0 loop /home/tc/PiCore/TC9/P1
tc@E310:~/PiCore/TC9$
The  df  command shows the partition is 34M in size, and has 3.7M of free space.

The  lsblk  command shows the  Read Only  flag is not set, suggesting this partition is writable.
I confirmed this by first copying a small file (150K) to P1/ and then deleting it.
I then copied a larger file (4.4M) to P1/ which gave a  No space left on device  error. The file copied to P1/ was only 3.7M in size.

When you repack your initrd, you should rename it (i.e. Splash-VERSIONv7.gz) to indicate it is not original.
Delete  P1/VERSIONv7.gz  before copying  Splash-VERSIONv7.gz  to P1/. You won't have room for both.

You will also need to edit  P1/config.txt. Replace  VERSIONv7.gz  with  Splash-VERSIONv7.gz  for  [PI2]  and  [PI3].

Unmount P1 and P2.
Rename the  piCore-VERSION.img (i.e. piCore-Splash-VERSION.img)  file to indicate it is not original.

Hopefully I got everything right.
« Last Edit: July 29, 2021, 02:12:09 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: remaster the core of PiCore
« Reply #2 on: July 28, 2021, 12:01:36 PM »
Hi Rabie
Left out one thing. After  Unmount P1 and P2:
Code: [Select]
losetup -d /dev/loop284Replace  284  with the loop number you were assigned initially.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1239
Re: remaster the core of PiCore
« Reply #3 on: July 29, 2021, 12:07:09 PM »
Just be aware that piCore 12 and 13 use 2 initrd's

1 for the OS
1 for the kernel modules.

The RPi bootloader loads them back to back.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: remaster the core of PiCore
« Reply #4 on: July 29, 2021, 01:36:02 PM »
Hi Paul_123
Thanks for the heads up. I was referencing a copy of piCore 9 that was on my machine, unaware of that change.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: remaster the core of PiCore
« Reply #5 on: July 29, 2021, 02:10:41 PM »
Hi Rabie
... i want to do the same thing with fbv on PiCore, where do i start ?
The previous writeup was for piCore-9. This one is for piCore-13

VERSION  is the version number of the zip file name. The latest as of this writing is  piCore-13.0.3.zip
1. Unzip the  piCore-VERSION.zip  file.
2. Mount the  .img  file:
    http://forum.tinycorelinux.net/index.php/topic,24063.msg151721.html#msg151721
3. Unpack the  rootfs (initrd)  file:
    http://forum.tinycorelinux.net/index.php/topic,24622.msg156235.html#msg156235
    /path/to/existing/core.gz  will be  P1/rootfs-piCore-VERSION.gz
4. Make your changes and repack your new  rootfs  file, same link as item #3:
    http://forum.tinycorelinux.net/index.php/topic,24622.msg156235.html#msg156235

That ends what I know. What follows is what I think I know.
I don't have Pi hardware, but I did perform some commands under x86 on piCore-13.0.3.zip and its contents.

Based on the following 2 commands:
Code: [Select]
tc@E310:~/PiCore/TC13$ df -h P1
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop284p1   63M   49M   15M  77% /home/tc/PiCore/TC13/P1
tc@E310:~/PiCore/TC13$
tc@E310:~/PiCore/TC13$ sudo lsblk /dev/loop284p1
NAME      MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop284p1 259:0    0  64M  0 loop /home/tc/PiCore/TC13/P1
tc@E310:~/PiCore/TC13$
The  df  command shows the partition is 63M in size, and has 15M of free space.


When you repack your rootfs, you should rename it (i.e. Splash-rootfs-piCore-VERSION.gz) to indicate it is not original.
Copy  Splash-rootfs-piCore-VERSION.gz  to P1/.

You will also need to edit  P1/config.txt. Replace  rootfs-piCore-VERSION.gz  with  Splash-rootfs-piCore-VERSION.gz  in
the  [PI2]  and  [PI3]  (armv7) entries.

Unmount P1 and P2.
Free the loop device:
Code: [Select]
losetup -d /dev/loop284Replace  284  with the loop number you were assigned initially.

Rename the  piCore-VERSION.img (i.e. piCore-Splash-VERSION.img)  file to indicate it is not original.

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: remaster the core of PiCore
« Reply #6 on: July 30, 2021, 11:26:45 AM »
Hi Rich,

Quote
The previous writeup was for piCore-9. This one is for piCore-13

VERSION  is the version number of the zip file name. The latest as of this writing is  piCore-13.0.3.zip
1. Unzip the  piCore-VERSION.zip  file.
2. Mount the  .img  file:
    http://forum.tinycorelinux.net/index.php/topic,24063.msg151721.html#msg151721
3. Unpack the  rootfs (initrd)  file:
    http://forum.tinycorelinux.net/index.php/topic,24622.msg156235.html#msg156235
    /path/to/existing/core.gz  will be  P1/rootfs-piCore-VERSION.gz
4. Make your changes and repack your new  rootfs  file, same link as item #3:
    http://forum.tinycorelinux.net/index.php/topic,24622.msg156235.html#msg156235

That ends what I know. What follows is what I think I know.
I don't have Pi hardware, but I did perform some commands under x86 on piCore-13.0.3.zip and its contents.

it works thank you very much.

i have only one more thing its not necessary but its nice to have

so i tried to put the fbv command in a bash script in rcS like:

Code: [Select]
/ usr/ bin/ bash / path/ to /myscript.sh   "the spaces between so the forum does not flag an error"  ;D

but it gave me this error:
Code: [Select]
while loading shared libraries: libncursesw.so.6: cannot open shared object file: No such file or directory
so i copied the libncursesw.so.6 also in / usr/ bin/ lib

but it still the same

what i am doing wrong ?
« Last Edit: July 30, 2021, 11:29:41 AM by Rabie »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: remaster the core of PiCore
« Reply #7 on: July 30, 2021, 12:22:12 PM »
Hi Rabie
...
Code: [Select]
while loading shared libraries: libncursesw.so.6: cannot open shared object file: No such file or directory
so i copied the libncursesw.so.6 also in / usr/ bin/ lib ...
Try copying it to  /usr/lib

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: remaster the core of PiCore
« Reply #8 on: July 30, 2021, 06:51:52 PM »
Hi Rich,
Quote
Try copying it to  /usr/lib

so i did but the same error

i copied after that to all the "lib" directories but also the same error:
Code: [Select]
/lib/libncursesw.so.6.2
/lib/libncursesw.so.6
/lib/libncursesw.so
/lib/libncurses++w.so.6.2
/lib/libncurses++w.so.6
/lib/libncurses++w.so
/usr/local/lib/libncursesw.so.6.2
/usr/local/lib/libncursesw.so.6
/usr/local/lib/libncursesw.so
/usr/local/lib/libncurses++w.so.6.2
/usr/local/lib/libncurses++w.so.6
/usr/local/lib/libncurses++w.so
/usr/lib/libncursesw.so.6.2
/usr/lib/libncursesw.so.6
/usr/lib/libncursesw.so
/usr/lib/libncurses++w.so.6.2
/usr/lib/libncurses++w.so.6
/usr/lib/libncurses++w.so

i don't know what is the problem  :-\

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: remaster the core of PiCore
« Reply #9 on: July 30, 2021, 09:36:31 PM »
Hi Rabie
... i copied after that to all the "lib" directories but also the same error: ...
Don't do that.

This may not be 100% accurate, but I think it's close:
/lib           = Base libraries required by the kernel, /bin, and /sbin.
/usr/lib       = Libraries for distros base, libraries from extensions that insist on placing them here.
/usr/local/lib = Libraries from extensions.


Try the instructions in the attached file. Pay close attention to punctuation.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1239
Re: remaster the core of PiCore
« Reply #10 on: July 31, 2021, 07:49:50 AM »
ldconfig -r <path to root>

Did you see the “.” At the end.
« Last Edit: July 31, 2021, 08:01:57 AM by Paul_123 »

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: remaster the core of PiCore
« Reply #11 on: July 31, 2021, 08:41:50 AM »
Hi Rich and Paul,

i just needed to copy it with considering the rights "rwx" for the user an it wored.

thank you very much.