WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: remastering picore  (Read 5112 times)

Offline duelistjp

  • Newbie
  • *
  • Posts: 8
remastering picore
« on: August 20, 2018, 03:02:16 PM »
trying to remaster picore to get fbv showing an image during boot.  i am really hopeless with this i know.  when i try to modify 9.0.3v7.gz  the system boots to prompt instead of opening my python script when fully booted. replacing the original gz file fixes this.  some of my reading leads me to believe that i need to modify the size of the initrd in cmdline3.txt but there is nothing about initrd in there.  what am i missing?  also if anyone has experience  with this where in tc-config would i put a call to tc-config after i put the extensions in the correct place?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: remastering picore
« Reply #1 on: August 20, 2018, 06:00:06 PM »
some of my reading leads me to believe that i need to modify the size of the initrd in cmdline3.txt

There are no any size parameter in cmdline :(
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline duelistjp

  • Newbie
  • *
  • Posts: 8
Re: remastering picore
« Reply #2 on: August 20, 2018, 09:17:31 PM »
then i know less than i thought.  do you know why it would go in something like cloud mode when i extract the gz modify then repack?  it goes to console rather than gui and the extensions don't seem to work but it says it is already installed when i try to use tce-load to install them. any wisdom?

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: remastering picore
« Reply #3 on: August 21, 2018, 11:22:18 AM »
When I first remastered the initrd I messed up the file permissions. Especially for  /tmp  which has the Sticky-Bit set and the Sticky-Bit was a new thing to me.
Make sure to use  sudo  when issuing the  cpio  command for extracting/packing.

Quote
[...] where in tc-config would i put a call to tc-config [...]
I don't get this.
Download a copy and keep it handy: Core book ;)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11657
Re: remastering picore
« Reply #4 on: August 21, 2018, 11:32:52 AM »
Hi Misalf
...
Quote
[...] where in tc-config would i put a call to tc-config [...]
I don't get this.
That's because there is nothing to get. You can't call  tc-config  from within itself. It would keep loading new instances of itself
until you ran out of RAM and crashed. I think duelistjp may have mis-worded that part of his question.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: remastering picore
« Reply #5 on: August 21, 2018, 01:54:41 PM »
Assuming the line was meant to read
Quote
[...] where in tc-config would i put a call to fbv [...]

I have currently no easy access to my Pi but I did add a boot animation using  fbv  which I think, apart from the fbv binary,  is the exact same as on the laptop I'm typing on right now.
Here goes:
I edited  /etc/init.d/rcS  after the  clear  command to look like this
Code: [Select]
#!/bin/sh
# RC Script for Tiny Core Linux
# (c) Robert Shingledecker 2004-2012

# Mount /proc.
[ -f /proc/cmdline ] || /bin/mount /proc

# Remount rootfs rw.
/bin/mount -o remount,rw /

# Mount system devices from /etc/fstab.
/bin/mount -a

#clear
/etc/init.d/boot-anim.sh &

/etc/init.d/tc-config

/usr/bin/yes y | /bin/rm -rf /tmp/boot-anim

It's calling a script that I added (/etc/init.d/boot-anim.sh) before  tc-config  is called.

The scripts looks like this
Code: [Select]
#!/bin/sh
### Copyleft 2016 Misalf
ANIM_DIR="/tmp/boot-anim"
[ -d "$ANIM_DIR" ] || exit 0
cd "$ANIM_DIR"
OPTIONS=" -a -c -u -i -s -1 "
/usr/local/bin/fbv ${OPTIONS} "$(/bin/ls -1 | /usr/bin/head -1)" 2>/dev/null
ANIM_1="$(for i in *.png ; do [ ${i%*.png} -le 50 ] && echo "$i " ; done)"
ANIM_2="$(for i in *.png ; do [ ${i%*.png} -gt 50 ] && echo "$i " ; done)"
cd - >/dev/null 2>&1
sleep 0.6
for i in $ANIM_1 ; do [ -d "$ANIM_DIR" ] || break ; /usr/local/bin/fbv ${OPTIONS} "$ANIM_DIR"/$i 2>/dev/null ; sleep 0.04 ; done
while [ -d "$ANIM_DIR" ] ; do
for i in $ANIM_2 ; do [ -d "$ANIM_DIR" ] || break ; /usr/local/bin/fbv ${OPTIONS} "$ANIM_DIR"/$i 2>/dev/null ; sleep 0.05 ; done
done


/tmp/boot-anim  is a directory containing a bunch of pictures that differ slightly to create an animation effect. It's already in the initrd but gets removed to free up RAM after  tc-config  has finished.

Also, at the very bottom of  tc-config  I added this line
Code: [Select]
[ -e /usr/local/bin/fbv ] && /usr/bin/killall -q fbv &
Download a copy and keep it handy: Core book ;)

Offline duelistjp

  • Newbie
  • *
  • Posts: 8
Re: remastering picore
« Reply #6 on: August 21, 2018, 10:38:03 PM »
rich yeah i meant to say call fbv. and misalf thank you for that i think it will be very useful. both the sudo and stickybit info and the fbv info.  one person that did something similar on the forum suggested putting both in tc-config but your way sounds even better.  will be working on this tomorrow again and i am so much more confident in getting this working with this info.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: remastering picore
« Reply #7 on: August 22, 2018, 05:38:10 AM »
Just make sure you follow this guide
http://wiki.tinycorelinux.net/wiki:remastering

If I recall correctly  tc-config  was split into  rcS  and  tc-config  to make  Plymouth  work, a program for boot animation (or to be able to run it as soon as possible).
Using  fbv , you can still just add it to  tc-config  though. Probably as close to the top of the file as possible.

If you go the  rcS  route, you may be able to silence the output of  tc-config  completely, if desired, by changing
Code: [Select]
/etc/init.d/tc-config
to
Code: [Select]
/etc/init.d/tc-config >/dev/null 2>&1
This would make debugging tough though.
Download a copy and keep it handy: Core book ;)

Offline duelistjp

  • Newbie
  • *
  • Posts: 8
Re: remastering picore
« Reply #8 on: August 22, 2018, 01:43:47 PM »
this was very helpful to me i've been able to edit 9.0.3v7.gz and repack it successfully i've written a script that when ran from terminal after boot works to display the logo using fbv based on the script you gave but nothing shows up on screen during boot. i just get the same plain black as always till the desktop comes up.  just trying to get my logo shown while pi is booting.  are there possibly settings in the cmdline3 or config that could prevent it from showing?.  i put fbv and its dependencies in their and put the call to my script where you did but still just plain black screen till it gets to desktop.  any ideas on what i'm missing

here is the script i wrote i could probably modify it more as i only need a still image but it works when ran from terminal
Code: [Select]
#!/bin/sh
ANIM_DIR="/logo"
[ -d "$ANIM_DIR" ] || exit 0
cd "$ANIM_DIR"
OPTIONS=" -a -c -u -i -s -l "
/usr/local/bin/fbv ${OPTIONS} "$(/bin/ls -l | /usr/bin/head -1)" 2>/dev/null
ANIM_1="$(for i in *.png ; do [ ${i%*.png} -le 50 ] && echo "$i " ; done)"
ANIM_2="$(for i in *.png ; do [ ${i%*.png} -gt 50 ] && echo "$i " ; done)"
cd - >/dev/null 2>&1
sleep 0.6
for i in $ANIM_1 ; do [ -d "$ANIM_DIR" ] || break ; /usr/local/bin/fbv ${OPTIONS} "$ANIM_DIR"/$i 2>/dev/null ; sleep 0.04 ; done
while [ -d "ANIM_DIR" ] ; do
for i in $ANIM_2 ; do [ -d "$ANIM_DIR" ] || break ; /usr/local/bin/fbv ${OPTIONS} "$ANIM_DIR"/$i 2>/dev/null ; sleep 0.05 ; done
done
this script is stored in /logo as logo.sh with 1.png which is the image i want displayed.  i call it with /logo/logo.sh & right the line before calling tc-config in rcS
« Last Edit: August 22, 2018, 01:54:32 PM by duelistjp »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: remastering picore
« Reply #9 on: August 22, 2018, 05:38:26 PM »
Sorry, I showed you an exact use case. As I did it.. That's not the exact same thing that I want you to do.Note that my image files are numbered (used by the script) and that I didn't add a picture visible just once, but different images in series.Pleas try to read and understand the code so you know what you don't need. If you want to show  just one static image during boot, my code is useless. :)
Download a copy and keep it handy: Core book ;)

Offline duelistjp

  • Newbie
  • *
  • Posts: 8
Re: remastering picore
« Reply #10 on: August 23, 2018, 10:36:52 PM »
had issues but eventually just copied /dev/fb0 to a file while image was loaded and since with the boot messages suppressed it never overwrote it so i could just copy the file back to fb0 in rcS file.  works alright.  now if i can figure out why my pythons scripts open with the top left corner of the program in the center of the window once i start the gui i will be golden

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: remastering picore
« Reply #11 on: August 29, 2018, 07:01:33 AM »
Yeah, directly copying to the framebuffer is the fastest I believe.
But does it still work correctly if a different display resolution iy used?
Download a copy and keep it handy: Core book ;)

Offline duelistjp

  • Newbie
  • *
  • Posts: 8
Re: remastering picore
« Reply #12 on: August 30, 2018, 12:18:02 PM »
having had to replace the screen with a different resolution for my uncle yesterday i can say it gives garbled lines till i make a new fb file