Page 1 of 2
Help with bootup error
Posted: Mon Mar 19, 2018 3:29 am
by bravebluerx
Was modifying some boot options to disable rom scanning options in run.sh, also reviewed the nopornroms.sh file in home/pi/.attract. Not sure if I corrupted something, but upon boot now all I get after the arpicade logo is this-
"-bash: /boot/run.sh: /bin/bash^M: bad interpreter: no such file or directory
pi@raspberrypi:~$_ "
Any clues? On v. 3.71
Thank you
Re: Help with bootup error
Posted: Mon Mar 19, 2018 3:42 am
by mR_CaESaR
Did you take a backup of your run.sh file?
If not, are you able to provide a copy of your current run.sh file?
Re: Help with bootup error
Posted: Mon Mar 19, 2018 4:43 am
by bravebluerx
Yes, I have a backup file that I haven't tried loading yet, but its the same file contents except for being hashed at
bash /home/pi/.attract/sortRoms.sh instead of the nopornroms.
Here is my current run.sh file content:
#! /bin/bash
# Setup dispmanx for clean advmame & daphne video output this version of SDL is modified to output for
# correct scanline output at 240p
export SDL_DISPMANX_IGNORE_RATIO=1
clear
# Load leanstick to control long hold p1start as hotkey
~/leanstick-master/leanstick.pl >/dev/null 2>&1 &
clear
# Prints now loading message, you may need to adjust the spacing to center it depending on your resolution
/boot/nowloadn.sh
# If you want to auto load a game put it here
#/boot/launchers/advmame.sh snowbros >/dev/null 2>&1
# Menu options - note advmenu and advmenup use the same config file but their configs are incompatable
# Load AdvanceMenu
#advmenu >/dev/null 2>&1
# Load AdvanceMenu PLUS
#/home/pi/.advance/advmenup >/dev/null 2>&1
# Experimental auto rom sorting for attract-mode
# Hash out to speed up booting when you don't need to scan roms
# sortRoms only works with arcade roms, console roms use sortRomsConsoles, carcons combines the lists
# noPornRoms is the same as sortRoms with an extra no porn games array, only use sortRoms OR noPornRoms
bash /home/pi/.attract/sortRoms.sh
#bash /home/pi/.attract/noPornRoms.sh
bash /home/pi/.attract/sortRomsConsoles.sh
bash /boot/launchers/servMenu.sh carccons
# Load Attact-Mode
attract >/dev/null 2>&1
# Crappy bugfix - launch advmenu to restore console after res switching through A-M
/home/pi/.advance/advmenu >/dev/null 2>&1
Re: Help with bootup error
Posted: Mon Mar 19, 2018 5:01 am
by mR_CaESaR
I'll check with my run.sh file tonight when I get home from work.
All else fails, just do a fresh 3.811 install
Did you do much customisation to the image that would make it a PITA to rebuild?
Re: Help with bootup error
Posted: Mon Mar 19, 2018 5:10 am
by bravebluerx
Thanks! Could you also copy your sortroms.sh in \home\pi\.attract?
Just resistant to change I guess which is why I haven't updated because it was working fine until I tried configuring things, go figure :/
Re: Help with bootup error
Posted: Mon Mar 19, 2018 5:40 am
by mR_CaESaR
Yep.
Will do.
Re: Help with bootup error
Posted: Mon Mar 19, 2018 5:58 am
by bravebluerx
Anytime I hash out the nopornroms.sh or sortroms.sh lines in run.sh and save it, when it loads on the pi it produces the error, its like it doesnt want me to edit it.
When I copy over my by virgin backup run.sh file it works now. ??
Re: Help with bootup error
Posted: Mon Mar 19, 2018 7:40 am
by bravebluerx
Ok after a bit of research, come to find out, that when editing files in windows and then sending over to run in a linux / unix environment there are different line feeds and carriage returns so it can't read the file created in windows, therefore it is seeing ^M as an illegal character. I was using wordpad in windows to edit which was causing the issue.
Solution is to use a free app called "notepad++" in the bottom right of the screen it tells you the document format and has no issues with editing in windows and saving it and then using it in linux/unix
Re: Help with bootup error
Posted: Mon Mar 19, 2018 9:57 am
by wboy
Notepad++ is a brilliant text editor for Windows. Notepadqq (Qt) for Linux not quite as feature rich, but still better than the stock editors IMO.
As you touched on, if you edit a file under Windows it will change the EOL character format. This is easily changed back in Notepad++ with Edit > EOL Conversion > Unix (LF).
You open the file in Notepadd++, it will retain whatever format it detects on open.
If you get your ARpiCADE Wi-Fi going, connect as root via WinSCP, you can even use WinSCP's default editor (very basic - no syntax highlighting) to also retain the correct EOL format when you save your changes.
Re: Help with bootup error
Posted: Mon Mar 19, 2018 11:51 am
by mR_CaESaR
run.sh - I've disabled all scanning on mine
Code: Select all
#! /bin/bash
# Setup dispmanx for clean advmame & daphne video output this version of SDL is modified to output for
# correct scanline output at 240p
export SDL_DISPMANX_IGNORE_RATIO=1
clear
# Prints now loading message, you may need to adjust the spacing to center it depending on your resolution
/boot/nowloadn.sh
# If you want to auto load a game put it here
#/boot/launchers/advmame.sh snowbros >/dev/null 2>&1
# Menu options - note advmenu and advmenup use the same config file but their configs are incompatable
# Load AdvanceMenu
#advmenu >/dev/null 2>&1
# Load AdvanceMenu PLUS
#/home/pi/.advance/advmenup >/dev/null 2>&1
# Experimental auto rom sorting for attract-mode
# Hash out to speed up booting when you don't need to scan roms
# sortRoms only works with arcade roms, console roms use sortRomsConsoles, carcons combines the lists
# noPornRoms is the same as sortRoms with an extra no porn games array, only use sortRoms OR noPornRoms
#bash /home/pi/.attract/sortRoms.sh
#bash /home/pi/.attract/noPornRoms.sh
#bash /home/pi/.attract/sortRomsConsoles.sh
bash /boot/launchers/servMenu.sh carccons
# Load Attact-Mode
attract >/dev/null 2>&1
# Crappy bugfix - launch advmenu to restore console after res switching through A-M
/home/pi/.advance/advmenu >/dev/null 2>&1
bravebluerx wrote: ↑Mon Mar 19, 2018 5:10 am
Thanks! Could you also copy your sortroms.sh in \home\pi\.attract?
Just resistant to change I guess which is why I haven't updated because it was working fine until I tried configuring things, go figure :/
sortroms.sh
Code: Select all
#!/bin/bash
#Script to auto generate Attract-Mode romlists at startup using ARpiCADE software
# Function to check string against array - for checking if rom is bios
function contains() {
local n=$#
local value=${!n}
for ((i=1;i < $#;i++)) {
if [ "${!i}" == "${value}" ]; then
echo "y"
return 0
fi
}
echo "n"
return 1
}
# bios files to skip to avoid menu clutter
bios=("macsbios" "qsound" "isgsm" "neogeo" "pgm" "ar_bios" "atarisy1" "konamigv" "decocass" "maxaflex" "megaplay" "megatech" "nss" "playch10" "acpsx" "alec64" "alg_bios" "atluspsx" "atpsx" "awbios" "bctvidbs" "cd32" "cpzn1" "cpzn2" "crysbios" "diehard" "galgbios" "gq863" "hikaru" "hng64" "konamigx" "kviper" "mac2bios" "maxaflex" "psarc95" "skns" "stvbios" "sys573" "taitofx1" "taitogn" "tps" "vspsx")
# parent roms you need but don't want to display go here
# leave the asterix as it fixes a bug to do with scanning empty rom folders
hide=("*" "retofinv" "fpoint" "armwar" "aafb" "agress" "puckman" "sfiii" "sfiii2" "sfiii3" "jojo" "jojoba" "xmen" "tmnt" "tmnt2" "vendetta" "simpsons")
#hide=("*")
# set rom directory, change if you need to
romdir=/boot/roms
##
clear
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
#echo ""
echo " BUILDING GAMELIST... PLEASE WAIT"
echo " Approx 1 minute per 825 roms"
#start by removing existing Attract-Mode lists so new lists arn't added to old ones
#rm /home/pi/.attract/romlists/*.txt
cd /home/pi/.attract/romlists
rm mame139.txt mame094.txt mame4all.txt advmame.txt fba.txt mame078.txt daphne.txt Arcade.txt mame172.txt mame192.txt
cd ../..
# scan roms
for D in $romdir/*
do
folder=`echo ${D:11}`
ename=$folder
# name fix advmame
if [ $folder == mame-106 ]; then
ename=advmame
fi
# name fix advmame94
if [ $folder == mame-094 ]; then
ename=mame094
fi
# name fix mame2003
if [ $folder == mame-078 ]; then
ename=mame078
fi
# name fix mame2010
if [ $folder == mame-139 ]; then
ename=mame139
fi
# name fix mame172
if [ $folder == mame-172 ]; then
ename=mame172
fi
# name fix mame192
if [ $folder == mame-192 ]; then
ename=mame192
fi
# echo "Emulator = $ename"
# echo "Rompath = $D"
touch /home/pi/.attract/romlists/$ename.txt
# fix for folder structue of daphne
cd $D
if [ $D == /boot/roms/daphne ]; then
cd roms
fi
FILES=*.zip
for f in $FILES
do
rom=`echo ${f::-4}`
## attempt to remove bios files
if [ $(contains "${bios[@]}" "$rom") == "n" ] && [ $(contains "${hide[@]}" "$rom") == "n" ]; then
# echo "Rom $rom processed"
list=/home/pi/.advance/$ename.lst
less $list | while read i
do
# echo $i | grep -q -w "name $rom"
# if [ $? == 0 ]; then
echo | grep -A3 -P -w "name $rom" $list > /var/cache/apt/tmp.txt
rominfo=`echo | grep -A0 -P "description" /var/cache/apt/tmp.txt`
shortname=`echo ${rominfo:14:-1}`
romyear=`echo | grep -A0 -P "year" /var/cache/apt/tmp.txt`
year=`echo ${romyear:6}`
rommake=`echo | grep -A0 -P "manufacturer" /var/cache/apt/tmp.txt`
manufacturer=`echo ${rommake:15:-1}`
#Output in format for Attract-Mode rom lists
#Name;Title;Emulator;CloneOf;Year;Manufacturer;Category;Players;Rotation;Control;Status;DisplayCount;DisplayType;AltRomname;AltTitle;Extra
# echo "$rom;$shortname;$folder;;$year;$manufacturer;;;;;;;;;;"
echo "$rom;$shortname;$ename;;$year;$manufacturer;;;;;;;;;;" >> /home/pi/.attract/romlists/$ename.txt
exit
done
# else
# echo "Bios or hidden $rom skipped"
fi
done
done
#remove errant " --- this is a hacky bugfix
sed -i 's/"//g' /home/pi/.attract/romlists/*.txt
# Joins all emulators into one list - Arcade.txt
cd /home/pi/.attract/romlists
cat mame139.txt mame094.txt mame192.txt mame172.txt mame4all.txt advmame.txt fba.txt mame078.txt daphne.txt | sort -t';' -k2 > Arcade.txt
# Return to normal home directory
cd /home/pi
# RE Prints now loading message, you may need to adjust the spacing to center it depending on your resolution
/boot/nowloadn.sh