WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: piCore 9.0.1 and RPI Zero W  (Read 18743 times)

Offline matteo

  • Newbie
  • *
  • Posts: 42
Re: piCore 9.0.1 and RPI Zero W
« Reply #30 on: September 22, 2020, 06:19:58 AM »
Probably it is related to RPI Zero W that has not a realtime clock?

You could run getTime.sh before the download and check the time is correct with the date command?

That is nice. Ok, I added
Code: [Select]
ntp.tcz
via tce-ab, then
Code: [Select]
sudo ntpd
getTime.sh
The time and date are now synced. I also will try without doing sudo ntpd and append the getTime.sh command in bootlocal.sh. Thanks!
« Last Edit: September 22, 2020, 06:21:34 AM by matteo »

Offline matteo

  • Newbie
  • *
  • Posts: 42
Re: piCore 9.0.1 and RPI Zero W
« Reply #31 on: September 22, 2020, 07:12:31 AM »
There are many apps that have problems with ncurses(w) - one way to fix things is to search for the appropriate test in the ./configure script and change -lncurses to -lncursesw.

Another possible fix is to use LIBS="-L/usr/local/lib -lncursesw" ./configure --blah-blah

So, the first config file is inside the vim directory
Code: [Select]
#! /bin/sh

# This is just a stub for the Unix configure script, to provide support for
# doing "./configure" in the top Vim directory.

cd "${SRCDIR:-src}" && exec ./configure "$@"

and the consequent one is inside the vim/src directory:
Code: [Select]
#! /bin/sh
# run the automatically generated configure script
CONFIG_STATUS=auto/config.status \
        auto/configure "$@" --srcdir="${srcdir:-.}" --cache-file=auto/config.cache
result=$?

# Stupid autoconf 2.5x causes this file to be left behind.
if test -f configure.lineno; then rm -f configure.lineno; fi

exit $result

and then, in the vim/src/auto directory there is a very long configure file plenty of "test" occurences  :D but no "lncurses". There are some "curses" occurences related to a "tlibs" variable (?).
I have no guess where I should use the part
Code: [Select]
LIBS="-L/usr/local/lib -lncursesw"

« Last Edit: September 22, 2020, 07:25:29 AM by matteo »

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14846
Re: piCore 9.0.1 and RPI Zero W
« Reply #32 on: September 22, 2020, 07:38:42 AM »
This:
Code: [Select]
checking --with-tlib argument... empty: automatic terminal library selection
checking for tgetent in -ltinfo... no
checking for tgetent in -lncurses... no
checking for tgetent in -ltermlib... no
checking for tgetent in -ltermcap... no
checking for tgetent in -lcurses... no
no terminal library found
..means that one of the configure scripts is checking for -lncurses, does "grep -lr lncurses ." find it?

Quote
I have no guess where I should use the part

Instead of:
Code: [Select]
$ ./configure --blah-blah
..use:
Code: [Select]
$ LIBS="-L/usr/local/lib -lncursesw" ./configure --blah-blah

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: piCore 9.0.1 and RPI Zero W
« Reply #33 on: September 22, 2020, 08:42:44 AM »
Hi Juanito
Found some interesting notes. It seems they don't use a standard ./configure, make, make install.
Quote
# config.mk.in -- autoconf template for Vim on Unix      vim:ts=8:sw=8:
#
# DO NOT EDIT config.mk!!  It will be overwritten by configure.
# Edit Makefile and run "make" or run ./configure with other arguments.
#
# Configure does not edit the makefile directly. This method is not the
# standard use of GNU autoconf, but it has two advantages:
#   a) The user can override every choice made by configure.
#   b) Modifications to the makefile are not lost when configure is run.
#
# I hope this is worth being nonstandard. jw.
Found here:
https://github.com/vim/vim/blob/master/src/config.mk.in

Apparently make can call configure.
Quote
2. Unix
=======

Summary:
1. make         run configure, compile and link
2. make install      installation in /usr/local

This will include the GUI and X11 libraries, if you have them.  If you want a
version of Vim that is small and starts up quickly, see the Makefile for how
to disable the GUI and X11.  If you don't have GUI libraries and/or X11, these
features will be disabled automatically.

See the start of Makefile for more detailed instructions about how to compile
Vim.

If you need extra compiler and/or linker arguments, set $CFLAGS and/or $LIBS
before starting configure.  Example:

   env  CFLAGS=-I/usr/local/include  LIBS=-lm  make

This is only needed for things that configure doesn't offer a specific argument
for or figures out by itself.  First try running configure without extra
arguments.

GNU Autoconf and a few other tools have been used to make Vim work on many
different Unix systems.  The advantage of this is that Vim should compile
on most systems without any adjustments.  The disadvantage is that when
adjustments are required, it takes some time to understand what is happening.

If configure finds all library files and then complains when linking that some
of them can't be found, your linker doesn't return an error code for missing
libraries.  Vim should be linked fine anyway, mostly you can just ignore these
errors.

If you run configure by hand (not using the Makefile), remember that any
changes in the Makefile have no influence on configure.  This may be what you
want, but maybe not!

The advantage of running configure separately, is that you can write a script
to build Vim, without changing the Makefile or feature.h.  Example (using sh):

   CFLAGS=-DCOMPILER_FLAG ./configure --enable-gui=motif

One thing to watch out for: If the configure script itself changes, running
"make" will execute it again, but without your arguments.  Do "make clean" and
run configure again.


----- Snip -----
Found here:
https://github.com/vim/vim/blob/master/src/INSTALL
« Last Edit: September 22, 2020, 08:45:05 AM by Rich »

Offline matteo

  • Newbie
  • *
  • Posts: 42
Re: piCore 9.0.1 and RPI Zero W
« Reply #34 on: September 22, 2020, 10:56:16 AM »
Ok Juanito,
I changed part of the vim.build script
Code: [Select]
./configure --prefix=/usr/local --without-x --enable-gui=no

to:
Code: [Select]
LIB="-L/usr/local/lib -lncursesw" ./configure --prefix=/usr/local --without-x --enable-gui=no --with-tlib=ncursesw

As you see, I also left the "--with-tlib=ncursesw". It seems that the whole process gave no errors: in /tmp/vim there is a vim.tcz package of 10.7 MB and in /tmp/vim-doc there is a vim-doc.tcz of 208 kB. So far, so good? I think I can move the .tcz files to the persistent directory tce/optional and use them again with "tce-load -i", that is right?

The command:
Code: [Select]
tc@box:/tmp/vim$ vim --version

now gives:
Code: [Select]
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 22 2020 14:37:22)
Included patches: 1-1724
Compiled by tc@box
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
-balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
-browse            -gettext           +netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              -perl              +title
-clientserver      +job               +persistent_undo   -toolbar
-clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           -python            +visual
+conceal           +linebreak         -python3           +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
+cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       -lua               -ruby              +wildmenu
+dialog_con        +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       -X11
-dnd               +mouse             -sound             -xfontset
-ebcdic            -mouseshape        +spell             -xim
+emacs_tags        +mouse_dec         +startuptime       -xpm
+eval              -mouse_gpm         +statusline        -xsmp
+ex_extra          -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -pipe -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L/usr/local/lib -Wl,--as-needed -o vim        -lm -lelf  -lncursesw -lacl -lattr -ldl

« Last Edit: September 22, 2020, 10:57:47 AM by matteo »

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14846
Re: piCore 9.0.1 and RPI Zero W
« Reply #35 on: September 22, 2020, 11:06:59 AM »
Yes, you can move the *tcz you created to tce/optional and load them with tce-load - note that you'll need to create a *tcz.dep file containing at least ncurses.tcz

Offline matteo

  • Newbie
  • *
  • Posts: 42
Re: piCore 9.0.1 and RPI Zero W
« Reply #36 on: September 22, 2020, 11:53:48 AM »
Ok, many thanks!

I tried to recompile the foo2xqx driver and, finally, the ex and the vim errors are gone. However, hotplug does not work and the firmware goes not to the printer HP P1005....but I have a vim working ;-)

Offline matteo

  • Newbie
  • *
  • Posts: 42
Re: piCore 9.0.1 and RPI Zero W
« Reply #37 on: September 22, 2020, 01:42:22 PM »
Probably it is related to RPI Zero W that has not a realtime clock?

You could run getTime.sh before the download and check the time is correct with the date command?

That is nice. Ok, I added
Code: [Select]
ntp.tcz
via tce-ab, then
Code: [Select]
sudo ntpd
getTime.sh
The time and date are now synced. I also will try without doing sudo ntpd and append the getTime.sh command in bootlocal.sh. Thanks!

There is not need to add "sudo ntpd" or "getTime.sh" to /opt/bootlocal.sh. It seems that is enough to append ntp.tcz to onboot.lst.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: piCore 9.0.1 and RPI Zero W
« Reply #38 on: September 22, 2020, 02:27:11 PM »
Hi matteo
... note that you'll need to create a *tcz.dep file containing at least ncurses.tcz
The TC7 version also had a dependency on  acl.tcz.  Run this:
Code: [Select]
ldd /usr/local/bin/vimIf  libacl.so  comes up in the list, you need  acl.tcz  in the  .dep  file.

Offline matteo

  • Newbie
  • *
  • Posts: 42
Re: piCore 9.0.1 and RPI Zero W
« Reply #39 on: September 23, 2020, 04:31:58 AM »
Hi Rich,
I saw the acl.tcz dependency in vim.tcz.dep and added to the vim.tcz.dep file. If I give the command ldd, I obtain:
Code: [Select]
tc@box:~$ ldd /usr/local/bin/vim
        libm.so.6 => /lib/libm.so.6 (0xb6e67000)
        libncursesw.so.6 => /usr/local/lib/libncursesw.so.6 (0xb6e0f000)
        libacl.so.1 => /usr/local/lib/libacl.so.1 (0xb6df9000)
        libdl.so.2 => /lib/libdl.so.2 (0xb6de6000)
        libc.so.6 => /lib/libc.so.6 (0xb6ca4000)
        libattr.so.1 => /usr/local/lib/libattr.so.1 (0xb6c91000)
        /lib/ld-linux-armhf.so.3 (0xb6ed4000)

Thanks for the command ldd: it is another useful thing.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: piCore 9.0.1 and RPI Zero W
« Reply #40 on: September 23, 2020, 10:52:31 AM »
Hi matteo
If you like, you can submit the extensions you created to the repository.

Created a work directory and copy your extensions to it:
Code: [Select]
mkdir package
cd package
cp /etc/sysconfig/tcedir/optional/vim*.tcz .
cp /etc/sysconfig/tcedir/optional/vim.tcz.dep .
vim-doc.tcz does not get a  .dep  file.

Fetch the current  .info  files:
Code: [Select]
wget http://tinycorelinux.net/7.x/armv6/tcz/vim.tcz.info
wget http://tinycorelinux.net/7.x/armv6/tcz/vim-doc.tcz.info

In both files, update this field with the new version number:
Code: [Select]
Version:        7.4.935
In both files, update the change log to this:
Code: [Select]
Change-log:     2015/11/22 First version, 7.4.935
Current:        2020/09/23 update 7.4.935 -> VERSION (matteo)
Replace VERSION with the new version number.

Copy your updated  vim.build  script to this directory too. Add something like this in the section titled  # Build script  :
Code: [Select]
# Updated 2020/09/23 matteo
# Fetch source code before running this script:
# git clone https://github.com/vim/vim.git
This may help someone in the future trying to build vim.

Install the script used to check extensions for errors and run it:
Code: [Select]
tce-load submitqc
submitqc --libs 2>&1 > submitqc.txt
This updated the size field in the  .info  files, and created  .list, .md5.txt, and .zsync  files.
Check the  submitqc.txt  file for any reported errors.

Now place all of the files into a  .tar  file:
Code: [Select]
tar -czf vimPiCore9.tar.gz *.tcz* vim.build
Encrypt it:
Code: [Select]
bcrypt vimPiCore9.tar.gzWhen it asks for a key, enter  tinycore

Write a brief email stating the extension name, architecture, and which version of Tinycore this is for. Attach the
vimPiCore9.tar.gz.bfe  file and go here for the address to send it to:
[Link deleted, Wiki is fixed.  Rich]
« Last Edit: December 07, 2023, 09:52:48 PM by CentralWare »

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14846
Re: piCore 9.0.1 and RPI Zero W
« Reply #41 on: September 23, 2020, 01:03:01 PM »
In fact nobody has the password for the piCore submit email, so you’ll need to send it to the main one.

Offline matteo

  • Newbie
  • *
  • Posts: 42
Re: piCore 9.0.1 and RPI Zero W
« Reply #42 on: September 23, 2020, 02:15:36 PM »
Hi Rich,
first, I fetched submitqc.tcz with wget from the TC repository 11.x/x86; I tried to run it several times; it asked several dependencies. Done.

Then, inside the submitqc.txt file, I found
Code: [Select]
submitqc: Unrecognized architecture 'armv6l'. See --help
 :(

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: piCore 9.0.1 and RPI Zero W
« Reply #43 on: September 23, 2020, 03:55:53 PM »
Hi matteo
Quote
... 2016/03/17 bugfix (andyj), begin ARM support, self-pkg; dentonlt ...
I guess that was never fully implemented:
http://tinycorelinux.net/11.x/x86/tcz/submitqc.tcz.info

OK, ignore the submitqc step.
Get the size of the extensions like this:
Code: [Select]
du -h vim.tcz
du -h vim-doc.tcz
and fill in the  Size:  fields of the  .info  files manually.

Make sure you have  squashfs-tools.tcz  loaded, then create the  .list  files:
Code: [Select]
unsquashfs -f -d vim vim.tcz
unsquashfs -f -d vim-doc vim-doc.tcz
cd vim
find . -not -type d | cut -c 2- | sort > ../vim.tcz.list
cd ../vim-doc
find . -not -type d | cut -c 2- | sort > ../vim-doc.tcz.list
rm -rf vim
rm -rf vim-doc

The server will handle generating the .md5.txt and .zsync files when it updates the repo.

Offline matteo

  • Newbie
  • *
  • Posts: 42
Re: piCore 9.0.1 and RPI Zero W
« Reply #44 on: September 24, 2020, 02:56:44 PM »
Done!