Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: bernie on June 30, 2016, 08:51:04 AM

Title: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on June 30, 2016, 08:51:04 AM
Hello,

After reading allot of similar threads on getting ssh to work i realise that i can't seem to figure out the basics, for instance setting up the drivers from the armv6/releases/RPi/src/kernel/4.4.11-piCore+_modules.tar.xz file etc.

What i have is a cheap (blue) usb-lan adapter, a serial connection via mac terminal-FTDI to piCore 8.0v3.
My serial usb connection works, i can log in and change partition etc.

I dont have a clue where to start with the 4.4.11-piCore file mentioned above. Do i have to move the appropriate files to my sd-card where the picore image is installed and do the rest via command line?

This reply from mikedev seems to answer my questions, but i need some pointers towards the actual command line used.

To support that dirt cheap usb LANadapter+USB2.0 3ports hub, I need to get http://tinycorelinux.net/8.x/armv6/releases/RPi/src/kernel/4.4.11-piCore+_modules.tar.xz and extract the
dm9601.ko
dm9601.ko.gz
into /usr/local/lib/modules/4.4.11-piCore+/kernel/dirvers/net/usb/
and remaster the core.gz

Thanks, and sorry if i missed something i should have read first.




Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: curaga on June 30, 2016, 09:17:21 AM
Just install net-usb-4.4.14-piCore_v7+.tcz. "tce-load -wi net-usb-KERNEL" should do.
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on June 30, 2016, 10:31:15 AM
Thank you, but that would require internet excess already installed?
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: Paul_123 on June 30, 2016, 11:56:44 AM
That is the problem with the zero.....you need another computer to get it running.

Setup the SDcard on a B or B+ then move the card to the Zero

or

Put the SDcard into another working linux system.   Mount the 2nd partition, and Download the file directly with wget.
http://distro.ibiblio.org/tinycorelinux/8.x/armv6/tcz/net-usb-4.4.14-piCore+.tcz
and
http://distro.ibiblio.org/tinycorelinux/8.x/armv6/tcz/net-usb-4.4.14-piCore+.tcz.md5.txt


Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 01, 2016, 04:16:29 AM
Thank you, i tried it in virtualbox and finally got Ubuntu to recognize my sd-card.
Having said that i cant figure out how to mount to the second partition (dev/mmcblk0p2)
I have tried with the fdisk command on both /dev/sdb2 ?? and dev/mmcblk0p2 i also tried from within the sd-card (cd /media/user/PICORE) but without succes. again, i have no experience in this whatsoever.

fdisk -l gives me:
Code: [Select]
Device      Boot Start        End Sectors  Size        Id           Type
/dev/sdb1            8192 69631    61440               30M     c      W95 FAT32 (LBA)
/dev/sdb2          69648 93119    23472               11,5M 83          Linux

and

Code: [Select]
root@user-VirtualBox:/home/user# cd /media/user/PICORE
Code: [Select]
root@user-VirtualBox:/media/user/PICORE# ls
8.0beta3.gz                                  bootcode.bin            fixup_db.dat              RELEASE
8.0beta3v7.gz                              cmdline3.txt             fixup_x.dat                  start_cd.elf
bcm2708-rpi-b.dtb                       cmdline.txt              kernel4414.img          start_db.elf
bcm2708-rpi-b-plus.dtb              config.txt                  kernel4414v7.img     start.elf
bcm2708-rpi-cm.dtb                    COPYING.linux     LICENCE.broadcom  start_x.elf
bcm2709-rpi-2-b.dtb                    fixup_cd.dat           [color=blue]overlays[/color]
bcm2710-rpi-3-b.dtb                    fixup.dat                  README

Thank you
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 01, 2016, 04:27:30 AM
I now see another partition after running df -h, still no clue how to go from here.

Code: [Select]
/dev/sdb1        30M   29M  1,2M  97% /media/user/PICORE
/dev/sdb2        11M  6,5M  2,8M  70% /media/user/a02d2d78-3372-4a56-ad8a-4365dc452d37

Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: Paul_123 on July 01, 2016, 04:31:29 AM
Thank you, i tried it in virtualbox and finally got Ubuntu to recognize my sd-card.
Having said that i cant figure out how to mount to the second partition (dev/mmcblk0p2)
I have tried with the fdisk command on both /dev/sdb2 ?? and dev/mmcblk0p2 i also tried from within the sd-card (cd /media/user/PICORE) but without succes. again, i have no experience in this whatsoever.

fdisk -l gives me:
Code: [Select]
Device      Boot Start        End Sectors  Size        Id           Type
/dev/sdb1            8192 69631    61440               30M     c      W95 FAT32 (LBA)
/dev/sdb2          69648 93119    23472               11,5M 83          Linux

and

Code: [Select]
root@user-VirtualBox:/home/user# cd /media/user/PICORE
Code: [Select]
root@user-VirtualBox:/media/user/PICORE# ls
8.0beta3.gz                                  bootcode.bin            fixup_db.dat              RELEASE
8.0beta3v7.gz                              cmdline3.txt             fixup_x.dat                  start_cd.elf
bcm2708-rpi-b.dtb                       cmdline.txt              kernel4414.img          start_db.elf
bcm2708-rpi-b-plus.dtb              config.txt                  kernel4414v7.img     start.elf
bcm2708-rpi-cm.dtb                    COPYING.linux     LICENCE.broadcom  start_x.elf
bcm2709-rpi-2-b.dtb                    fixup_cd.dat           [color=blue]overlays[/color]
bcm2710-rpi-3-b.dtb                    fixup.dat                  README

Thank you

Are you sure it didn't automount.   The second partition should be listed in /media/user/.   Look for a long string of characters.....which is the uuid of the partition.

Also, make sure you expand the second partition
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 01, 2016, 05:13:54 AM
thank you, I did wget  ...picore+.tcz in root@user-VirtualBox:/media/user# , and it saved to: ‘net-usb-4.4.14-piCore+.tcz’ . i hope this was what you meant by  /media/user/.

ls gives me:
Code: [Select]
root@user-VirtualBox:/media/user# ls
a02d2d78-3372-4a56-ad8a-4365dc452d37  net-usb-4.4.14-piCore+.tcz.md5.txt
net-usb-4.4.14-piCore+.tcz            PICORE


sorry i didnt get:  Look for a long string of characters.....which is the uuid of the partition.

I will expand the size of the second partition via usb serial with: sudo fdisk /def/mmcblk0 , delete and recreate p2.

If i did it correctly i still need to know how to extract the
dm9601.ko
dm9601.ko.gz
into /usr/local/lib/modules/4.4.11-piCore+/kernel/dirvers/net/usb/
and remaster the core.gz

Should i do this over serial, or is it more convenient to do this in Ubuntu?

Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 01, 2016, 06:12:44 AM
Alright i did
Code: [Select]
mkdir /tmp/image
sudo mount -o loop net-usb-4.4.14-piCore+.tcz /tmp/image

then

Code: [Select]
cd /tmp/image/usr/local/lib/modules/4.4.14-piCore+/kernel/drivers/net/usb/

Code: [Select]
ls
asix.ko          gl620a.ko          kaweth.ko    plusb.ko       sierra_net.ko
ax88179_178a.ko  huawei_cdc_ncm.ko  lg-vl600.ko  qmi_wwan.ko    smsc75xx.ko
catc.ko          int51x1.ko         mcs7830.ko   r8152.ko       sr9700.ko
cx82310_eth.ko   ipheth.ko          net1080.ko   rndis_host.ko  sr9800.ko
dm9601.ko        kalmia.ko          pegasus.ko   rtl8150.ko     zaurus.ko

now i have to figure out how to move dm9601.ko to the appropriate directory and where it is located in /media/user# .

Also find out where to find dm9601.ko.gz and find out how to remaster core.gz
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 01, 2016, 06:52:26 AM
i probably should have
Code: [Select]
wget net-usb-4.4.14-piCore+.tcz into
Code: [Select]
/media/user/a02d2d78-3372-4a56-ad8a-4365dc452d37 
and 
Code: [Select]
sudo mount -o loop net-usb-4.4.14-piCore+.tcz into the appropriate directory.   // lost+found maybe?

tce gives me
Code: [Select]
root@user-VirtualBox:/media/user/a02d2d78-3372-4a56-ad8a-4365dc452d37/tce# ls
mydata.tgz  onboot.lst  ondemand  optional

at this point iḿ stuck.
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: Paul_123 on July 01, 2016, 07:26:13 AM
Probably need to go back and read the core book and wiki.

But once the tcz is in the optional directory, just use tce-load -i <nameofextension.tcz>

And for boot purposes, add the extension name to onboot.lst
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 02, 2016, 04:10:28 AM
thank you Paul, I will go back and read the book/wiki.

I got it working, i have a internet connection, i still cant log in via ssh tc@. i probably have to configure something but don't know how, should be something obvious. but at lease i can connect via serial/ftdi and instal stuff.

what i did was, wget net-usb-4.4.14-piCore+.tcz (in VB Ubuntu)

then (over serial)
Code: [Select]
cd /etc/sysconfig/tcedir/optional
mv -v net-usb-4.4.14-piCore+.tcz /etc/sysconfig/tcedir/optional (it was already there but somehow nessesary).
cd /etc/sysconfig/tcedir
echo net-usb-4.4.14-piCore+.tcz >> onboot.lst
tce-load -i net-usb-4.4.14-piCore+.tcz

then, (i have no idee if this was necessary or why i did it?).
Code: [Select]
sudo depmod -a
then sudo reboot to see if it was installed at boot.

This was about it.


For my project i need for instance to tce-load -wi alsa-config.tcz, but i get an error on some of the .tcz i need to download.

Code: [Select]
Downloading: tce-load.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
wget: server returned error: HTTP/1.1 404 Not Found
md5sum: tce-load.tcz.md5.txt: No such file or directory
Error on tce-load.tcz

other .tcz (alsa, nano etc.) download fine, why is this?

Thank you.







Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: sbp on July 02, 2016, 04:14:23 AM
I think in version piCore8 you should install alsa-utils.tcz instead of alsa-config.tcz

Regards
Steen
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 02, 2016, 04:46:05 AM
thank you, Is there a way to find out what .tcz have been changed for 8.x?

these give me the error:

tce-load -wi alsa-config.tcz

compile-essentials.tcz

wiringpi.tcz

i dont see wiringpi.tcz and compile-essentials.tcz in the repo.
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: patrikg on July 02, 2016, 04:49:24 AM
I know that compile-essentials.tcz has new name to compiletc.tcz.
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bmarkus on July 02, 2016, 05:05:05 AM

i dont see wiringpi.tcz and compile-essentials.tcz in the repo.

Install compiletc.tcz instead of compile-essentials.tcz
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 02, 2016, 05:44:07 AM
Thank you, now for wiringpi.tcz, is it still available or has it been updated to a newer version? i have tried wiringpi2.

If its not compatible (yet) for 8.x , but is still in the repo. i might have to move back to 7.

Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 03, 2016, 04:45:40 AM
I'm trying to (compile)built/install wiringPi.

Code: [Select]
cd wiringPi
./build
it gives me an error:
Code: [Select]
wiringPi Build script
=====================

WiringPi Library
sudo: make: command not found

i thought i had installed compiletc.tcz, but when i tried again to check it gave me the following:

Code: [Select]
compiletc.tcz.dep OK
gawk.tcz.dep OK
gcc_libs-dev.tcz.dep OK
glibc_apps.tcz.dep OK
bash.tcz.dep OK
grep.tcz.dep OK
mount: mounting /dev/loop56 on /tmp/tcloop/make failed: Invalid argument

make.tcz / bash.tcz are already installed.

what could be the problem here?


Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 03, 2016, 05:16:26 AM
oke, i removed make.tcz. and reinstalled compiletc.tcz now it looks like all is installed.

this is what i had to do before ./build would work.

Code: [Select]
cd wiringPi
make
sudo make install

cd ../devLib
make
sudo make install

cd ../gpio
make
sudo make install

Do i still have to make wiringPi.tcz or examples?
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: Paul_123 on July 03, 2016, 08:27:08 PM
The install is not persistent.  One reboot and it's gone.   Have to make an extension.
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 04, 2016, 08:19:42 AM
sorry not 100% sure that i get it. do i have to make a wiringPi.tcz extention in order to make it persistent?

(for what it's worth). this is what i have in /lib/
Code: [Select]
libwiringPi.so
libwiringPi.so.2.32
libwiringPiDev.so
libwiringPiDev.so.2.32

I added libwiringPi.so to filetool.lst and ran filetool.sh -b before reboot, but after reboot all is gone.

I have tried following the instructions or executing the commands in this wiringPi built script, but i got stuck.

http://tinycorelinux.net/7.x/armv6/tcz/src/wiringpi/

thank you.





Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: Rich on July 04, 2016, 09:22:17 AM
Hi bernie
Make sure you have  squashfs-tools.tcz  installed and try the following from your home directory:
Code: [Select]
mkdir -p package/usr/local/lib
cp /lib/libwiringPi* package/usr/local/lib
mkdir -p package/usr/local/tce.installed
touch package/usr/local/tce.installed/libwiringPi.installed
mksquashfs package libwiringPi.tcz
busybox rm -rf package
Copy  libwiringPi.tcz  to your tce directory and add  libwiringPi.tcz  to your  onboot.lst  file. Then reboot.
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 04, 2016, 09:41:46 AM
Hi Rich,

Thank you, i get the following at cp ,

Code: [Select]
tc@box:/home$ cp /lib/libwiringPi* package/usr/local/lib
cp: can't stat '/lib/libwiringPi*': No such file or directory


Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: Rich on July 04, 2016, 10:09:08 AM
Hi bernie
You said:
(for what it's worth). this is what i have in /lib/
Code: [Select]
libwiringPi.so
libwiringPi.so.2.32
libwiringPiDev.so
libwiringPiDev.so.2.32
You want to copy those files to  package/usr/local/lib/
Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: patrikg on July 04, 2016, 10:32:14 AM
I think you need to take a look at Creating an Extension.

http://wiki.tinycorelinux.net/wiki:creating_extensions

Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: bernie on July 04, 2016, 01:00:27 PM
alright it worked! thank you. now after reboot all libwiringPi* files are in /usr/local/lib/ again.
Sorry i'm new to all this, so after doing
Code: [Select]
cp /usr/local/lib/libwiringPi* package/usr/local/libI could reboot and do a pure-data test-run without error.

Is libwiringPi.tcz now a boot script?

thanks again for the help!




Title: Re: setup usb - lan adapter on pi zero running piCore 8.0
Post by: Rich on July 04, 2016, 05:43:08 PM
Hi bernie
Quote
Is libwiringPi.tcz now a boot script?
No, it's an extension. Since you added a  libwiringPi.tcz  entry to your  onboot.lst  file it will be present every time you boot.
A  .tcz  file is a compressed file system with a directory structure in it that gets mounted under  /tmp/tcloop. From there
it gets linked into the main file system. If you enter:
Code: [Select]
ls -l /usr/local/lib/libwiringPi.soyou should see something like this:
Code: [Select]
lrwxrwxrwx 1 root root 52 May 10 15:49 /usr/local/lib/libwiringPi.so -> /tmp/tcloop/libwiringPi/usr/local/lib/libwiringPi.sowhich shows that  /usr/local/lib/libwiringPi.so  is really just a link back to your  libwiringPi.tcz  extension mounted under  /tmp/tcloop.