WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Please help a beginner  (Read 14561 times)

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Please help a beginner
« on: December 29, 2012, 05:41:55 AM »
Hi
I have been trying to use TCE 4.7.2 on my Raspberry (256 RAM).

It boots fine (and very quickly), but my problem starts when I try to install packages, I'm sure that I have done something wrong when preparing the SD-card - eventhough I tried to follw the instructions.

1. I copied the image to the card.
2. Next I used Gparted to fill up the rest of the card with a "data" partition - so I marked the unused part and made a new primary partition as ext2 file format called data. Gparted finished the job without any problems.
3. I started my Raspberry with the new image, and it started fine.
4. I tried to setup my tce directory, so used: tce-setdrive
5. Here I could onle see               1.   /mnt/mmcblk0p1
                                                  2.  /mnt/mmcblk0p2
So I was unable to see my newly created "data" partition.

I tried to use either 1 or 2 (that is /mnt/mmcblk0p1 or /mnt/mmcblk0p2) but then the packages that I dowloaded couldn't be touched, probably because that the directories are read-only.

So in short I think my problem is in point no 2 - where I should make the directory where the packages are stored. Any help is appreciated.

Thanks
Steen

PS: I'm very interested in the ALSA package, but the info on this package states that they are not RPI compatible - so do they not work at the moment?   

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Please help a beginner
« Reply #1 on: December 29, 2012, 07:02:27 AM »
Hi

First, do not use all of the unused part of the SD for data, create a SWAP partition with 256MB size and only the rest for data. Forget ext2, use journaling file system, ext4 is perfect.

This is not enough to mark partition type but you must format it, both data and swap partion. Best is to do it with piCore itself using fdisk, mkfs.ext4 and mkswap commands as root.

When ready, either reboot or use rebuildfstab command as root.

New data partition is not mounted automatically as base system do not need it. Mount, create a directory /tce and reboot.

Now if everything is OK, downloaded extensions will be stored in /tce on the data partition and kept for next reboot.

Béla
Ham Radio callsign: HA5DI

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

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Please help a beginner
« Reply #2 on: December 29, 2012, 07:09:44 AM »
Regarding ALSA, at the moment only the sound kernel moduls are available, ALSA tools itself will come in 1-2 weeks.

'Not PPI compatible' doesn't mean it doesnt work, it indicates only it is not within /usr/local. Everything is repo expected to work. If not, it's a bug.

Béla
Ham Radio callsign: HA5DI

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

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Please help a beginner
« Reply #3 on: December 29, 2012, 08:34:26 AM »
Hi bmarkus

Thank you very much for your help. I now have everything running very smoothly - and I can even install packages that will be present after a reboot.

So once again thank you.

EDIT::: Skip this part - I forgot to install libasound!!!!!!!
I have been trying the alsa package, but unfortunately the program that I want to use is complaining about a specific file it is missing:
"error while loading shared libraries: libasound.so.2: cannot open shared object file; No such file or directory"


The error after installing Libasound is ALSA lib conf.c:3705(snd_config_update_r) Cannot access file /usr/local/share/alsa/alsa.conf
Output devices

So I will have to wait some weeks before you hopefully will have build the rest.

Steen
« Last Edit: December 29, 2012, 08:44:17 AM by sbp »

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Please help a beginner
« Reply #4 on: January 13, 2013, 12:10:57 PM »
Hi, I'm seeking advise on two issues .

1. I'm using the piCore 4.7.3, but as far as can see the raspberry part of this image is not the newest, so I was wondering if it would be possible for me to update this part? Especially there seems to have been some development in the Gpu driver, which have improved the sound from the raspberry.

2. Does anybody know which USB  wifi dongle would be easiest to use in the piCore image?

Thanks


Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Please help a beginner
« Reply #5 on: January 13, 2013, 02:25:40 PM »

2. Does anybody know which USB  wifi dongle would be easiest to use in the piCore image?


Good starting point:

http://elinux.org/RPi_VerifiedPeripherals#USB_Wi-Fi_Adapters
Béla
Ham Radio callsign: HA5DI

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

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Please help a beginner
« Reply #6 on: January 14, 2013, 02:15:21 PM »

2. Does anybody know which USB  wifi dongle would be easiest to use in the piCore image?


Good starting point:

http://elinux.org/RPi_VerifiedPeripherals#USB_Wi-Fi_Adapters

Thanks I will find one from the list.


Two new questions/problems:

1
I have been trying to make a small script - let us call it test, which I want to be able to run when I write test in a terminal.
Therefore I used:
sudo vi test

In the test file I added these lines:
#!/bin/bash
clear
echo "Good morning, world."

Saved the file test
Then:
sudo chmod -R 755 test

BUT I cant make it run. Trying with:
./test     results in
sh: ./test not found

But the command: 
ls           returns
sbp       (in green)

So it seems I lack some fundamental understanding here.


2.
Another question is (when I manage to make a working script). where should I put this script, so that I can run it via putty in a terminal? Should I put it in init.d directory, or where is the best place?

Steen     

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Please help a beginner
« Reply #7 on: January 14, 2013, 02:24:19 PM »
Steen

1) By default piCore shipped with ash shell implemented as a BusyBox applet. It is similar to bash, but smaller and a bit different operation. Replace first line of the script with

#!/bin/sh

In most cases you do not need bash. If you write your own script, avoid using bash specific features. If you (or an application) really need it, install from the repo.

2) Put it to /usr/local/bin or /usr/local/sbin These locations are in the path so they will be executed. Don't forget to make them executable. If you want to make them persistent, add them to the backup or make your own .tcz extension.


« Last Edit: January 14, 2013, 02:27:09 PM by bmarkus »
Béla
Ham Radio callsign: HA5DI

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

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Please help a beginner
« Reply #8 on: January 15, 2013, 01:59:33 PM »
Hi bmarcus.

Thanks for the help.
Now I can run a script. I have been trying to make a script which will allow the user to put in the correct start up sentence for the Squeezetite player (it will depend on the kind of USB DAC used)

This is the script:

#!/bin/sh
clear
# here the user input the string
echo -e "Hi, please write the squeezelite commands you would like to use for starting Squeezelite"
read START_STRING
echo "$START_STRING - Will be written to /opt/bootlocal.sh."
read -p "Is it correct (y/n)?"
[ "$REPLY" = "y" ] || sudo echo "START_STRING" >> /opt/bootlocal.sh


# here the changes are made persistent
echo -e "Now these changes will be saved"
filetool.sh -b
echo -e " "
echo -e "If you will use an external USB DAC please insert now"


# here it ask for a reboot
read -p "To use the new settings you should reboot now (Y/N)?"
[ "$REPLY" = "y" ] || sudo reboot



My problems are:
1. START_STRING is added to the bootlocal.sh instead of the actual string given by the user.

2. the y/n option in the script seems to not discriminate between a "y" or a "n" press.

3. what I really would like the script to do is to find this line in bootlocal.sh:
sudo /mnt/mmcblk0p2/tce/squeezelite-armv6hf -n piCoPlayer -m 00:11:95:00:54:01 -
and exchange it with the string given by the user from the first part of my script
so that it does not simply add a new line to the bootlocal.sh file
Will that be possible?

4. After I have made the script file /usr/local/sbin/setup-audio  and used:     filetool.sh -b   this script file is not present after a reboot

After running the script the resulting bootlocal.sh file:

# put other system startup commands here
usr/local/etc/init.d/dropbear start
sudo /mnt/mmcblk0p2/tce/squeezelite-armv6hf -n piCoPlayer -m 00:11:95:00:54:01 -
amixer set PCM 400 unmute
START_STRING

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: Please help a beginner
« Reply #9 on: January 15, 2013, 02:23:03 PM »
Hi sbp
Quote
1. START_STRING is added to the bootlocal.sh instead of the actual string given by the user.
Try    $START_STRING
Code: [Select]
echo "$START_STRING" >> /opt/bootlocal.sh

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Please help a beginner
« Reply #10 on: January 15, 2013, 02:28:54 PM »
Omit use of sudo in bootlocal.sh which is run as root.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: Please help a beginner
« Reply #11 on: January 15, 2013, 03:05:01 PM »
Hi sbp
You might also want to take a look at some of the scripts that come with Tinycore for examples of proper syntax.
I Found this:
Code: [Select]
        echo "Existing config detected. Overwrite? [y/n]"; read OVERWRITE

        case $OVERWRITE in
                y*) true ;;
                *) servers; exit ;;
        esac
in  /usr/bin/tc-terminal-server, you should be able to adapt it to your needs. You can find scripts you could study in
/etc/init.d. Also, anything beginning with   tce-   under  /usr/bin

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Please help a beginner
« Reply #12 on: February 15, 2013, 04:23:42 AM »
Hi

I'm now trying to make my piCorePlayer in one partition, so that the TCE will be on the same partition as the rest.

What I did is to use:
tce-setdrive
and then choose the only available like  /mnt/mmcblk0p1

Then I installed all the packages I needed (Flac, libvorbis, wifi dropbear etc).
Then I added these three lines to /opt/.filetool.lst
opt
home
etc/passwd
etc/shadow
usr/local/etc/dropbear/dropbear_dss_host_key
usr/local/etc/dropbear/dropbear_rsa_host_key

and edited /opt/bootlocal.sh to add this line:
usr/local/etc/init.d/dropbear start

Everything is working fine up to here.

The problem I have is the script I made, I can't seem to make it persistent. I did the following:

To make the new script:
Code: [Select]
sudo vi /usr/local/sbin/picoreplayerand then writing the script

Next make it exutable:
Code: [Select]
sudo chmod 755 /usr/local/sbin/picoreplayer
And if I check it now I can start he script fine.

In order to make it persistent I add this line to opt/.filetool.lst:
Code: [Select]
usr/local/sbin/picoreplayer
Then:

Code: [Select]
filetool.sh -b
BUT after a reboot there is no picoreplayer in usr/local/sbin.


Can you spot what I am missing, or doing wrong?

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Please help a beginner
« Reply #13 on: February 15, 2013, 04:40:22 AM »
I don't know if this is important but doing a "dry run" backup - I can't see that my /usr/local/sbin/picoreplayer is included in the backup:
Code: [Select]
 
tc@box:~$ filetool.sh -d
Performing dry run backup (backup will not actually take place).   Please wait.

  0.00 MB  /usr/local/etc/dropbear/dropbear_rsa_host_key
  0.00 MB  /usr/local/etc/dropbear/dropbear_dss_host_key
  0.00 MB  /etc/shadow
  0.00 MB  /etc/passwd
  0.00 MB  /home/tc/.ashrc
  0.00 MB  /home/tc/.ash_history
  0.00 MB  /home/tc/.profile
  0.00 MB  /home/tc/wifi.db
  0.00 MB  /opt/.filetool.lst
  0.00 MB  /opt/bootsync.sh
  0.00 MB  /opt/tcemirror
  0.00 MB  /opt/.xfiletool.lst
  0.00 MB  /opt/shutdown.sh
  0.00 MB  /opt/bootlocal.sh


This is the content of my /opt/.filetool.lst:
Code: [Select]
tc@box:~$ cat /opt/.filetool.lst
opt
home
etc/passwd
etc/shadow
usr/local/etc/dropbear/dropbear_dss_host_key
usr/local/etc/dropbear/dropbear_rsa_host_key
usr/local/sbin/picoreplayer


This is the content of /usr/local/sbin before a reboot - so it seems like the picoreplayer is present before I reboot. But after a reboot it is gone.
Code: [Select]
tc@box:/usr/local/sbin$ ls
alsaconf           iwgetid            nl-classid-lookup  nl-qdisc-delete
alsactl            iwlist             nl-cls-add         nl-qdisc-list
dropbearmulti      iwpriv             nl-cls-delete      picoreplayer
genl-ctrl-list     iwspy              nl-cls-list        wpa_cli
ifrename           nl-class-add       nl-link-list       wpa_passphrase
iwconfig           nl-class-delete    nl-pktloc-lookup   wpa_supplicant
iwevent            nl-class-list      nl-qdisc-add

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Please help a beginner
« Reply #14 on: February 15, 2013, 05:44:57 AM »
Check /opt/.xfiletools.lst Is the exclusion list. Did you add /usr/local/picoreplayer by accident?

Anyhow, in this case backup is not the right solution. Make a picoreplayer.tcz extension instead up backup/restore.

This will create a picoreplayer.tcz extension with an md5 file:

Code: [Select]
cd /tmp
mkdir -p picoreplayer/usr/local/sbin
cp -r /usr/local/sbin/picoreplayer picoreplayer/usr/local/sbin
mksquashfs picoreplayer picoreplayer.tcz
md5sum picoreplayer.tcz > picoreplayer.tcz.md5.txt

Copy these file to your tce/optional directory and add picoreplayer.tcz to the onboot.lst file manually ot with apps.

You need squashfs-tools-4.x.tcz installed.


« Last Edit: February 15, 2013, 05:48:45 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

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