#106405 - 20/07/2002 22:09
/programs and preinit - the easy way.
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Ok, so I've finally gotten around to playing with preinit and various posts, and decided to hone my shell scripting in the process. Attached is a script that will format /dev/hda2 and set up a mount entry (/programs0) for it. It will also create 'rwp' and 'rop' entries for manipulating it in a similar way to rw and ro. If you have a second drive then it will also create /programs1 on /dev/hdc1. The script also goes on and populates /etc/preinit.d with a few shell scripts for starting apps, although I'm sure there's a few more that will need to be added.
Note: You will still need to install the preinit binary and the apps themselves. I have defaulted telnetd to live in /bin, but everything else under /programs0, but you can modify these to suit your needs.
#!/bin/sh
#This script sets stuff up for preinit and 3rd party apps.
#It formats and sets up /dev/hda2 (and /dev/hdc2 if present) for use, and is
#reasonably intelligent - if it can mount a partition then it wont reformat it
#It also provides a couple of utilities for mounting the partitions.
#It then creates /etc/preinit.d and populates it with some useful start scripts - again, if /etc/preinit.d
#already exists, then it will skip this stage.
#CMA Warning: Do not leave this script with executable permissions on your home linux boxes. chmod it to 600.
# copyright: Ian Danby. 2002.
# GPL Version 2 or later. See www.fsf.org for legalese.
#Put root into rw mode.
rw || exit
#Create mountpoints
mkdir /programs0
mkdir /programs1
chmod 755 /programs0
chmod 755 /programs1
#Format partitions. We'll try mounting the partitions first.
#If we can grep them in /proc/mounts then we alread have a valid fs and should skip.
mount -n -r -t ext2 /dev/hda2 /programs0
[ -e /proc/ide/hdb ] && mount -n -r -t ext2 /dev/hdc2 /programs1
grep /dev/hda2 /proc/mounts > /tmpfile
if [ -s /tmpfile ]; then
echo "/dev/hda2 already formatted. Skipping."
else
mke2fs /dev/hda2
fi
rm /tmpfile
if [ -e /proc/ide/hdb ]; then
grep /dev/hdc2 /proc/mounts > /tmpfile
if [ -s /tmpfile ]; then
echo "/dev/hdc2 already formatted. Skipping."
else
mke2fs /dev/hdc2
fi
rm /tmpfile
fi
#Modify /etc/fstab
grep /dev/hda2 /etc/fstab > /tmpfile
if [ -s /tmpfile ]; then
echo "/etc/fstab already contains an entry for /dev/hda2. Skipping."
else
echo "/dev/hda2 /programs0 ext2 defaults,ro 1 1" >> /etc/fstab
echo "Entry for /dev/hda2 appended to /etc/fstab"
fi
rm /tmpfile
if [ -e /proc/ide/hdb ]; then
grep /dev/hdc2 /etc/fstab > /tmpfile
if [ -s /tmpfile ]; then
echo "/etc/fstab already contains an entry for /dev/hdc2. Skipping."
else
echo "/dev/hdc2 /programs1 ext2 defaults,ro 1 1" >> /etc/fstab
echo "Entry for /dev/hdc2 appended to /etc/fstab"
fi
rm /tmpfile
fi
#Create a couple of useful 'binaries', /bin/rwp and /bin/rop. Guess what they do.
cat <<-END > /bin/rwp
#!/bin/sh
mount -n -o remount,rw /programs0
[ -e /proc/ide/hdb ] && mount -n -o remount,rw /programs1
END
chmod 755 /bin/rwp
cat <<-END > /bin/rop
#!/bin/sh
mount -n -o remount,ro /programs0
[ -e /proc/ide/hdb ] && mount -n -o remount,ro /programs1
END
chmod 755 /bin/rop
#Create /etc/preinit.d and populate it. Skip and exit if it already exists.
if [ -e /etc/preinit.d ]; then
echo "/etc/preinit.d already exists!. Skipping."
ro
exit
else
mkdir /etc/preinit.d
fi
#It shouldn't matter if we try to preinit stuff that doesn't exist. The shell deals with missing binaries
####
#telnetd. Best put in the /bin partition so that we can access it immediately. Lets do this first just in case.
#Note that the 'N' prefix tells preinit to do this before config.ini is read (ie drives aren't mounted yet)
cat <<-END > /etc/preinit.d/N10telnetd
#!/bin/bash
/bin/telnetd
END
chmod 755 /etc/preinit.d/N10telnetd
#mount the new drives. Also done before config.ini is read.
cat <<-END > /etc/preinit.d/N20mount
#!/bin/bash
mount -n /programs0
[ /proc/ide/hdb ] && mount -n /programs1
END
chmod 755 /etc/preinit.d/N20mount
#Everything else that follows should probably live in the new parition(s), so need the 'M' prefix.
#For now, let's stuff everything in /programs0...Edit to suit
#Let me know what I've missed.
####
#empacman. The reason I finally got around to doing this...Great stuff.
cat <<-END > /etc/preinit.d/M10empacman
#!/bin/bash
/programs0/empacman
END
chmod 755 /etc/preinit.d/M10empacman
#emptris
cat <<-END > /etc/preinit.d/M20emptris
#!/bin/bash
/programs0/emptris
END
chmod 755 /etc/preinit.d/M20emptris
#emptriv. Note that this is a subdir.
cat <<-END > /etc/preinit.d/M30emptriv
#!/bin/bash
/programs0/emptriv/emptriv
END
chmod 755 /etc/preinit.d/M30emptriv
#empan. AFAIK, there is is command line only at the moment, hence the commenting out.
#Maybe some nice soul will hijackify it, and give a means of menu-selecting a file from a named directory
#cat <<-END > /etc/preinit.d/M40empan
# #!/bin/bash
# /programs0/empan
#END
#chmod 755 /etc/preinit.d/M40empan
#Lets be paranoid before exiting.
ro
rop
exit
Attachments
104935-mkprgpt (557 downloads)
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106406 - 21/07/2002 08:55
Re: /programs and preinit - the easy way.
[Re: genixia]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
This version has the mke2fs commands run with "-N 50000" so that there are enough inodes for emptriv
Attachments
105015-mkprgpt (453 downloads)
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106407 - 21/07/2002 09:46
Re: /programs and preinit - the easy way.
[Re: genixia]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Ok, so how to use this - you obviously need hijack installed before you start.
Assuming that you don't have telnetd set up yet, you'll need a serial connection.
Download empeg-preinit.v3.tar.gz, emptelnetd.tar etc from riocar.org and save somewhere convenient. Download the second attachment above and save to the same place as mkprgpt
Get your serial connection, and press "q" to get a shell. Type "rw" to make the root drive writeable. Leave the connection open..
On your PC, ftp mkprgpt and emptelnetd.tar, and empeg-preinit (extract it from the tar first) to the empeg:
ftp empeg
put mkprgpt
put emptelnetd.tar
put empeg-preinit
bye
Back on the serial connection:
mv empeg-preinit /bin/hijack
chmod 755 /bin/hijack
tar xf emptelnetd
chmod 755 devs
mv telnetd /bin
chmod 755 /bin/telnetd
./devs
rm ./devs
chmod 755 mkprgpt
./mkprgpt
mkprgpt should have left all the drives read-only, so you should now be able to safely reboot..
After rebooting, you should be able to telnet into the empeg, and you'll find a new partition at /programs0 ready for your apps. (and also /programs1 if you have 2 drives). To make these new paritions writeable, run "rwp". Remember to run "rop" before rebooting to make them read-only again, although at 32MB, they shouldn't take long to fsck if you forget.
If you put the empacman in /programs0 and chmod it to 755, then after a reboot, it will automagically appear in the hijack menu.
Put the emptriv distribution into a subdir /programs0/emptriv, and that should also appear.
I think it's time for an empeg LSB.
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106408 - 21/07/2002 12:15
Re: /programs and preinit - the easy way.
[Re: genixia]
|
enthusiast
Registered: 26/12/2001
Posts: 386
Loc: Miami, FL - Sioux Falls, SD
|
Hrmm.. i cant seem to get emtriv to run, any ideas?. Also, can empgps be ran from here (preferably with the -s- switch on the player so it doesnt get messed up from my gps segnals).
Thanks!,
Greg
|
Top
|
|
|
|
#106409 - 21/07/2002 13:35
Re: /programs and preinit - the easy way.
[Re: mandiola]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Yeah, just found that one myself - I needed to edit the /etc/preinit.d/M30emptriv so that it looked like:
#!/bin/bash
cd /programs0/emptriv
/programs0/emptriv/emptriv
This will start emptriv from it's own directory so that it can find it's font file. I've made the change to my script - attached. If you remove the /etc/preinit.d directory, it'll get recreated correctly when you rerun the script.
Attachments
105057-mkprgpt (447 downloads)
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106410 - 21/07/2002 13:40
Re: /programs and preinit - the easy way.
[Re: mandiola]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
I haven't looked at empgps yet. Does it bind to the hijack menu? It it does, then you should be able to. Let me look into it.
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106411 - 21/07/2002 13:58
Re: /programs and preinit - the easy way.
[Re: genixia]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Now with empgps support. And yes, it appears to work
Attachments
105060-empgps (504 downloads)
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106412 - 21/07/2002 14:41
Re: /programs and preinit - the easy way.
[Re: genixia]
|
enthusiast
Registered: 26/12/2001
Posts: 386
Loc: Miami, FL - Sioux Falls, SD
|
AHHHHH.. still cant get it to work... even if i cd to the dir in telnet and try to run it with ./emptriv i get the same error.
by the way... how did you get empgps to run.. you just posted empgps file not the script ; ) (edit: i got it to run.. just want to make sure i did it correctly)
-Greg
Edited by mandiola (21/07/2002 14:54)
|
Top
|
|
|
|
#106413 - 21/07/2002 19:10
Re: /programs and preinit - the easy way.
[Re: mandiola]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Oops. My mistake, I was rushing out to see MIB2... ([censored] hilarious BTW)..
What error are you getting with emptriv? Check the permissions on all the files in emptriv. In fact, just blast them all to 755 to be sure... chmod 755 *
Here's the latest version of my script. This time I promise that it's not empgps!
Attachments
105087-mkprgpt (418 downloads)
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106414 - 21/07/2002 23:24
Re: /programs and preinit - the easy way.
[Re: genixia]
|
enthusiast
Registered: 26/12/2001
Posts: 386
Loc: Miami, FL - Sioux Falls, SD
|
Thanks.. i got it to work... now the only problem is that emptriv and empgps dont play well together... when i try to use emptriv, empgps popsup in front of it... if i move the knob i can see emptriv popup but then go immediatly to the background. ; /
-Greg
|
Top
|
|
|
|
#106415 - 21/07/2002 23:35
Re: /programs and preinit - the easy way.
[Re: mandiola]
|
enthusiast
Registered: 26/12/2001
Posts: 386
Loc: Miami, FL - Sioux Falls, SD
|
Hrmm.. now that i try empgps it doesnt run very well at all... it start up about a minute after the player and once you run it you cant get back to the player.. and now it doesnt even read my gp... heh.. this is odd.
-Greg
|
Top
|
|
|
|
#106416 - 21/07/2002 23:39
Re: /programs and preinit - removed menu entry:
[Re: mandiola]
|
member
Registered: 11/01/2002
Posts: 171
Loc: South Bay, CA: USA
|
this rocks.. a well spent 2 hours!
but when i invoke emptriv, i see--
hijack: removed menu entry: "empacman".
empacman then disappears from hijack. if i invoke empacman, i see the same message, but the menu does not disappear!
hmmmm...?
-ted
|
Top
|
|
|
|
#106417 - 22/07/2002 05:08
Re: /programs and preinit - removed menu entry:
[Re: TedP]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Yeah, some of the apps still don't play nicely together - these are either application or hijack problems - I suspect application problems as it isn't consistent, and should be addressed in a thread specific to the app. The emptriv/empacman menu thing has been noted before, and hopefully should be addressed soon.
The empgps/emptriv thing I haven't heard of before.. Can you mention it in a relevant thread?
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106418 - 24/07/2002 09:39
Re: /programs and preinit - the easy way.
[Re: genixia]
|
enthusiast
Registered: 26/12/2001
Posts: 386
Loc: Miami, FL - Sioux Falls, SD
|
Ok i think I figured out why empgps gets all weird... the guy who wrote it said to load the player using the -s- switch... right now you have empgps loaded with the -s- switch..... i think it has to be the player part wich is loaded with it. Is there any way to do this?
-Greg
|
Top
|
|
|
|
#106419 - 24/07/2002 10:05
Re: /programs and preinit - the easy way.
[Re: mandiola]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
/me goes scurrying to check this out.
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106420 - 24/07/2002 10:10
Re: /programs and preinit - the easy way.
[Re: genixia]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Yep you're right. I'll find a fix.
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106421 - 24/07/2002 10:18
Re: /programs and preinit - the easy way.
[Re: genixia]
|
enthusiast
Registered: 26/12/2001
Posts: 386
Loc: Miami, FL - Sioux Falls, SD
|
Cool.. Thanks for all the help.
-Greg
|
Top
|
|
|
|
#106422 - 24/07/2002 10:51
Re: /programs and preinit - the easy way.
[Re: genixia]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Ahh, not so easy to do - the command line that starts the player is embedded into the /bin/init binary that we don't have the source to. It may be that turning serial off can be achieved through a config.ini parameter - I'll ask you to check that out (and report back!).
If not, the only real solution that I see is to move the player binary to /empeg/bin/player.bin and create a shell script that calls it with the -s- option. But that would have ramifications for things like upgrades and stuff Certainly not something I really want to put on *everyone's* empeg. Let me look at that.
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106423 - 24/07/2002 11:33
Re: /programs and preinit - the easy way.
[Re: genixia]
|
journeyman
Registered: 05/01/2002
Posts: 71
Loc: New England
|
Great stuff!
Boy, you don't follow this BBS for a couple weeks and look what happens!
I got dnetc to work this way, keeping /programs0 always in rw mode so dnetc can store it's files there. Any concerns about doing this?
Also, while I was toying around in the shell, something kept spitting numbers at me that looked like this:
F404a
F404c
F404e
F4050
F4052
F4054
F4056
F4058
what gives?
Armin
|
Top
|
|
|
|
#106424 - 24/07/2002 11:37
Re: /programs and preinit - the easy way.
[Re: Armin]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
|
Those numbers are the FIDs it's playing. That's what you get when you enable the "notify=1" flag in the config.ini.
|
Top
|
|
|
|
#106425 - 24/07/2002 11:38
Re: /programs and preinit - the easy way.
[Re: tfabris]
|
journeyman
Registered: 05/01/2002
Posts: 71
Loc: New England
|
Oh, and I thought that should only happen while the player is running...
Armin
|
Top
|
|
|
|
#106426 - 24/07/2002 12:11
Re: /programs and preinit - the easy way.
[Re: Armin]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
I got dnetc to work this way, keeping /programs0 always in rw mode so dnetc can store it's files there. Any concerns about doing this?
No major concerns - the worst you could do is trash that one 32MB partition, but in practice ext2fs and fsck are pretty resilient. Worst case scenario is having to rebuild that one parition - but at least your music paritions would be fine. In the long run I'm hoping that the excellent ext3 work being done can be included into hijack, and this issue disappears.
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106427 - 24/07/2002 14:05
Re: /programs and preinit - the easy way.
[Re: genixia]
|
carpal tunnel
Registered: 17/01/2002
Posts: 3996
Loc: Manchester UK
|
I've been asking about this for a while as I'm writing my own GPS display, complete with compass and pointer! I'll try and post a piccy.
I've tried the renaming of player and putting a script in it's place, this causes Hijack to have a fit and stop reading it's config file. If someone could help, that would be great.
_________________________
Cheers,
Andy M
|
Top
|
|
|
|
#106428 - 24/07/2002 16:45
Re: /programs and preinit - the easy way.
[Re: genixia]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
The way I did that was to make the last N script that preinit executes run the player with the -s- option. Since it won't return, it will never get around to running the real init.
It will return, though, if you exit the player (does this happen when syncing?), so you might want to put it in a loop emulating the stock init, if you care.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#106429 - 24/07/2002 17:43
Re: /programs and preinit - the easy way.
[Re: wfaulk]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Yeah, this is the only solution that I can see at the moment. Just another observation - running the player with the -s- option also means that you wont be able to get to a serial prompt. So either install telnetd (but not if you use your empeg on a public/work network - or remember that you can use ftp to obliterate that preinit script should you ever need to get to the shell prompt.
There is another option - *Don't* put the command in a loop, and ensure that you have quit=1 in your config.ini (can't remember which section - check the FAQ). That way you can use the Quit menu item when it's necessary to get a shell prompt. This will cause the -s-'d incarnation of the player to exit and then the real init will then run, starting the player in stock form, hence making the serial port available for shell access.
I don't really think that losing your empgps-capable player when syncing is really an issue - I'm guessing that you only sync at home, and only use empgps in the car...
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106430 - 24/07/2002 17:53
Re: /programs and preinit - the easy way.
[Re: genixia]
|
carpal tunnel
Registered: 24/12/2001
Posts: 5528
|
Do people want a proper login for the telnet daemon? I never bothered with it since by default the HTTP, FTP and emplode interfaces were wide open. But I guess some people disable those when at work.
- Trevor
|
Top
|
|
|
|
#106431 - 24/07/2002 18:43
Re: /programs and preinit - the easy way.
[Re: Armin]
|
carpal tunnel
Registered: 08/06/1999
Posts: 7868
|
I got dnetc to work this way, keeping /programs0 always in rw mode so dnetc can store it's files there
If you want to reduce the risk, run the buffers out of a ramdrive. I did this with no problem back on my Mark 1, so there should be plenty of room for a RAM drive capable of holding a few thousand blocks. I ran a script that copied the buffers back to disk from time to time, remounting the drive each time. Only issue I had whas when it played with the mounts in the middle of an emplode session, but using the 32meg partition should resolve that as well.
|
Top
|
|
|
|
#106432 - 24/07/2002 19:58
Re: /programs and preinit - the easy way.
[Re: tman]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Yes!
The ftp has a password mechanism for those who choose to use it, and httpd is fairly limited in the damage it could cause, but telnet is just too powerful to run without a password. Ok, so telnet in general should be banned because of the inherent sniffibility of the protocol, but at least a password would mean that someone would have to sniff or guess it first before wreaking havoc on your empeg - at the moment they just have to be curious enough to try connecting.
I'm trying to cross-compile sshd at the moment. I have no idea how feasible that is...but I'm trying
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106433 - 24/07/2002 20:02
Re: /programs and preinit - the easy way.
[Re: genixia]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
I was trying to do it, too, but I was too lazy to actually get started. One thing that occurred to me is that utilizing only RSA/DSA keys for authentication would be a good idea.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#106434 - 25/07/2002 02:01
Re: /programs and preinit - the easy way.
[Re: wfaulk]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
In reply to:
The way I did that was to make the last N script that preinit executes run the player with the -s- option. Since it won't return, it will never get around to running the real init.
It will return, though, if you exit the player (does this happen when syncing?), so you might want to put it in a loop emulating the stock init, if you care.
Perhaps preinit should come with a file to run the player (N99player, I guess), rather than having it compiled-in. Then people could easily play with the script, remove it, or override it (using their own N90player that doesn't return, for instance).
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#106435 - 25/07/2002 02:07
Re: /programs and preinit - the easy way.
[Re: wfaulk]
|
enthusiast
Registered: 26/12/2001
Posts: 386
Loc: Miami, FL - Sioux Falls, SD
|
Cool. I used the -s- switch in N20Mount right at the end to load the player... now all the programs seem to play nice. I am testing it more now... im sure something will come up.. hehe
[edit]: Now the only problems seem to be that the programs unbind themselves from hijack after they are run and another program is run after them.. hrmmm....
Thanks,
Greg
Edited by mandiola (25/07/2002 02:13)
|
Top
|
|
|
|
#106436 - 25/07/2002 10:45
Re: /programs and preinit - the easy way.
[Re: tms13]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
It actually runs /sbin/init as its last function.
I don't know that that default init only starts the player. In fact, I'm pretty sure that it also mounts filesystems. It might do other things, as well. I don't want to bypass it by default. That doesn't make it any more difficult to create a script that does, though. Maybe I should just point that out in some docs somewhere.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#106437 - 25/07/2002 11:49
Re: /programs and preinit - the easy way.
[Re: wfaulk]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
I always thought Frank van Gestel's modified init was pretty cool. It's the one I use. It calls a shell script (/sbin/userinit I believe) to do init type stuff. You manually call the player when you want to in that script rather than being at the mercy of how init handles it. It lets you get pretty fancy with how you set things up, and if it can't find /sbin/userinit, it just calls the stock init, or if something fails, it drops to a shell so you can fix things.
Too bad it's not on the Empeg distribution. That'd be nice.
|
Top
|
|
|
|
#106438 - 26/07/2002 15:54
Re: /programs and preinit - the easy way.
[Re: genixia]
|
new poster
Registered: 21/07/2002
Posts: 9
Loc: Oak Harbor, WA
|
I am having trouble with this program. I have it loaded and running on the serial port. At home it runs fine from the Hijack menu but in my car it gets all funky. It switches from Aux to Player back and forth making it impossible to play. I tried switching to Aux mode then playing from hijack menu but same results. Any ideas?
|
Top
|
|
|
|
#106439 - 26/07/2002 16:24
Re: /programs and preinit - the easy way.
[Re: Mitsu7374]
|
old hand
Registered: 16/02/2002
Posts: 867
Loc: Oxford, UK
|
I configured empeg-preinit v3 etc. manually and also had this problem in-car so it's probably not a problem with genixia's shell script as such. FWIW, at the time I would have been running 2.0b11, pre-init v3 & Hijack 276.
It only occured during one 'sitting'. Pulling the player from the sled didn't make any difference and (AFAICR) I had to select Player as the music source to get rid of it.
That was earlier this week and was the first (and last) time it happened.
|
Top
|
|
|
|
#106440 - 26/07/2002 16:51
Re: /programs and preinit - the easy way.
[Re: AndrewT]
|
new poster
Registered: 21/07/2002
Posts: 9
Loc: Oak Harbor, WA
|
I pulled mine from the car. Deleted empacan. Put it back on player and it is working fine now. Must have been an freaky thing. Oh well, all is good now.
|
Top
|
|
|
|
#106441 - 26/07/2002 17:32
Re: /programs and preinit - the easy way.
[Re: genixia]
|
carpal tunnel
Registered: 24/12/2001
Posts: 5528
|
Okay. I'll give it a go tommorow when I've got some spare time
- Trevor
|
Top
|
|
|
|
#106442 - 27/07/2002 03:02
Re: /programs and preinit - the easy way.
[Re: Mitsu7374]
|
carpal tunnel
Registered: 17/01/2002
Posts: 3996
Loc: Manchester UK
|
I got exactly the same thing with my GPS code, it runs fine when plugged in at home but when it's in the car, it just goes apesh*t and the only way to stop it is by pulling the player out of the dash and popping it back in. I've so far not been able to fix this problem.
_________________________
Cheers,
Andy M
|
Top
|
|
|
|
#106443 - 28/07/2002 15:42
Re: /programs and preinit - the easy way.
[Re: wfaulk]
|
journeyman
Registered: 16/02/2000
Posts: 94
Loc: UK - NE Wales
|
I've been trying out running the player from a preinit script but I can't seem to get it working! The script I made basically calls /empeg/bin/player -s-
The error I get looks like this (on the serial port):
! empeg_id.cpp : 49:Unable to open /proc/empeg_id
player.cpp : 385:empeg-car 2.00-beta13 2002/07/24.
! player.cpp : 291:MainThread::Init failed!
bin dev drive0 drive1 empeg etc lib lost+found mnt proc sbin swapfile tmp usr va
r
dunno if that last line is relavent! but it seems to me that /proc isn't mounted yet. Does this get mounted by the stock init? If so, what's everyone doing to get round this?
Another thing that I can't get my head round is if it doesn't return, doesn't pre-init time out, quit and carry on anyway, running the stock init?
Cheers.
|
Top
|
|
|
|
#106444 - 28/07/2002 19:20
Re: /programs and preinit - the easy way.
[Re: FlibblE]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Another thing that I can't get my head round is if it doesn't return, doesn't pre-init time out, quit and carry on anyway, running the stock init? Ummm. Yeah. I forgot I put that in there. In v5, I plan to put in the facility for there to be a single `B' script that will prevent that from happening.
And I imagine that the stock init mounts pretty much everything except the root filesystem (already mounted) and the /drive0 and /drive1 filesystems (as it remounts them during syncs, so I figure it just retains control over them altogether). Just place a ``mount /proc'' in your script somewhere before it blocks. Of course, you'll need to wait for v5 before it'll be useful, huh?
_________________________
Bitt Faulk
|
Top
|
|
|
|
#106445 - 29/07/2002 01:39
Re: /programs and preinit - the easy way.
[Re: wfaulk]
|
journeyman
Registered: 16/02/2000
Posts: 94
Loc: UK - NE Wales
|
Ah, that's ok then! Roll on v5!
Does the stock init just mount /proc before running the player? or is there more to it than that? Just a thought: perhaps there could be a sample 'B' script that includes stuff that the stock init does - if it's more than just mounting /proc!
I'll give it a try later, mounting /proc first and see if it complains any more. Just gotta knock together a power supply - i'll see what I can rob around work!
Cheers.
|
Top
|
|
|
|
#106446 - 29/07/2002 01:57
Re: /programs and preinit - the easy way.
[Re: FlibblE]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
I don't honestly know. I'm just making assumptions.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#106447 - 29/07/2002 02:38
Re: /programs and preinit - the easy way.
[Re: genixia]
|
member
Registered: 10/07/2000
Posts: 117
Loc: BaWue, Germany, Europe
|
I have sshd running for quite a while now (~01/2001),
but the disk with the toolchain on it died.
Since the crosscompile was super simple (just follow the manual) I never bothered with writing a howto.
One drawback:
If you log in via pub/priv-key while playing a tune, it can take a while to have that key calculated
_________________________
--------------------
MKII 08000073 40GB BLUE
|
Top
|
|
|
|
#106448 - 29/07/2002 07:41
Re: /programs and preinit - the easy way.
[Re: anti]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Since the crosscompile was super simple (just follow the manual) I never bothered with writing a howto.
Hmm, Looks like I missed that manual somehow. zlib and openssl have compiled easily, but openssh is being a PITA.
/me goes off a hunting.
Did you compile statically? Do you still have the binaries? That is all we really need
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106449 - 29/07/2002 13:19
Re: /programs and preinit - the easy way.
[Re: genixia]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Maybe he compiled up the non-open ssh.... It is more monolithic, at least....
_________________________
Bitt Faulk
|
Top
|
|
|
|
#106450 - 29/07/2002 17:20
Re: /programs and preinit - the easy way.
[Re: wfaulk]
|
carpal tunnel
Registered: 24/12/2001
Posts: 5528
|
I've got OpenSSH 3.4p1 working on the empeg but the install instructions are a little long so I need to write a nice simple install script for it. I'll do it tommorow because I'm really sleepy at the moment.
Oh yeah. Key generation on the empeg takes AGES...
- Trevor
Edited by tman (29/07/2002 17:21)
|
Top
|
|
|
|
#106451 - 30/07/2002 02:21
Re: /programs and preinit - the easy way.
[Re: genixia]
|
member
Registered: 10/07/2000
Posts: 117
Loc: BaWue, Germany, Europe
|
hmmm ... looks my self compiled ssh is gone,
but:
# dpkg -l|grep ssh
ii ssh 3.4p1-1 Secure rlogin/rsh/rcp replacement (OpenSSH)
I guess installing debian might solve your problem ... as usual.
I'll skim through my old backups anyway, maybe I find the static binary somewhere.
_________________________
--------------------
MKII 08000073 40GB BLUE
|
Top
|
|
|
|
#106453 - 30/07/2002 08:15
Re: /programs and preinit - the easy way.
[Re: FlibblE]
|
pooh-bah
Registered: 09/08/2000
Posts: 2091
Loc: Edinburgh, Scotland
|
>>! mp3_decoder.cpp :1049:Failed to find valid sync after seeking to offset 3471
990, error=0xc0044000
I can't remember which thread it was discussed in, but isn't that error merely caused by the player starting mid song?? And as such, pretty much a non-error.
_________________________
Rory MkIIa, blue lit buttons, memory upgrade, 1Tb in Subaru Forester STi MkII, 240Gb in Mark Lord dock MkII, 80Gb SSD in dock
|
Top
|
|
|
|
#106454 - 30/07/2002 11:57
Re: /programs and preinit - the easy way.
[Re: frog51]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Yeah. It definitely happens occasionally to very often, with or without any additional software. IIRC, it has something to do with the player not quite jumping to the right spot in VBR files, but I could easily not be RC.
Sigh. I guess I'll spend the ten minutes and hack up a blocking version. Gimme a few.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#106455 - 30/07/2002 12:35
empeg-preinit.v5-beta
[Re: wfaulk]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Okay, for those of you that want to block the normal init sequence, I've put out an empeg-preinit.v5-beta. It's just the binary. It's not been tested. But you should be able to create scripts that start with a `B' and expect them to be run in order after the `N' scripts, but the timeout has been defeated while they run. The idea is to just have one `B' script, but you can have multiple ones if you want, for some reason.
Make absolutely sure that your `B' script works properly. Otherwise you'll have to reflash the whole system to get it back to a working state. I'd suggest not putting it in a loop to begin with, so that if it fails it can exit and go back to the normal init.
Lemme know how it turns out.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#106456 - 30/07/2002 18:31
Re: /programs and preinit - the easy way.
[Re: tman]
|
carpal tunnel
Registered: 24/12/2001
Posts: 5528
|
Still messing about trying to get this to run with reasonable speed. It's excruciatingly slow at the moment...
- Trevor
|
Top
|
|
|
|
#106457 - 30/07/2002 20:48
Re: empeg-preinit.v5-beta
[Re: wfaulk]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Make absolutely sure that your `B' script works properly. Otherwise you'll have to reflash the whole system to get it back to a working state.
Couldn't you nuke a bad B script via ftp?
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106458 - 30/07/2002 22:38
Re: empeg-preinit.v5-beta
[Re: genixia]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
IIRC, Hijack's FTP server is not running at that point in the startup process.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#106459 - 30/07/2002 22:57
Re: empeg-preinit.v5-beta
[Re: wfaulk]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
Hmm, Hadn't thought about that - you might be right though. It's a good idea to install telnetd to /bin then
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106460 - 30/07/2002 23:18
Re: empeg-preinit.v5-beta
[Re: genixia]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Now that's a good idea.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#106461 - 31/07/2002 04:15
Re: empeg-preinit.v5-beta
[Re: wfaulk]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
In reply to:
Make absolutely sure that your `B' script works properly. Otherwise you'll have to reflash the whole system to get it back to a working state.
Is kftpd not active by then? I thought it was possible to (re)move your B scripts by FTP, then reboot.
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#106462 - 31/07/2002 14:21
Re: empeg-preinit.v5-beta
[Re: tms13]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
See above.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#106463 - 05/08/2002 22:57
Re: /programs and preinit - the easy way.
[Re: genixia]
|
journeyman
Registered: 18/07/2002
Posts: 75
Loc: Texas
|
Thanks for the script and the instructions, worked great for getting me set up with telnetd and getting empacman bound to the hijack menu. One question though.... And I think this was mentioned somewhere (maybe in another thread) dealing with empacman and emptriv I think..
I had empacman working great, it would bind everytime I started up and be in the hijack menu and work fine. I decided to add empsoko, but found out that it would not bind automatically (just by putting it in the /programs0 directory, I figured that out, you just dont have an empsoko entry in the preinit.d directory ).. Well I *thought* I had it figured out, I would just need to add it as something like M70empsoko and put the necessery lines in the file..
Sure enough, after I made that file and rebooted, they were both in the Hijack menu. I started up empsoko, and it worked great. But unfortunately, now the empacman menu entry *also* loads empsoko.. So.. where do I go from here?
_________________________
- durden -
|
Top
|
|
|
|
#106464 - 06/08/2002 08:48
Re: /programs and preinit - the easy way.
[Re: durden]
|
carpal tunnel
Registered: 24/12/2001
Posts: 5528
|
There is a bug in Hijack which for some reason prevents you from having two user apps. I'll have a look at the kernel code later on but I can't guarantee anything because I'm quite busy. So if anybody else wants to fix it in the mean time...
- Trevor
|
Top
|
|
|
|
#106465 - 08/08/2002 16:59
Re: /programs and preinit - the easy way.
[Re: tman]
|
journeyman
Registered: 18/07/2002
Posts: 75
Loc: Texas
|
Nothing against your script.. but..
How do I undo the changes that were made to my empeg by it? I'm somewhere past a linux newbie and way from being an expert, but I get lost in all the bash programming.. I'd like to keep the /programs0 etc, but remove most of the other changes that were made by it..
Thanks..
_________________________
- durden -
|
Top
|
|
|
|
#106466 - 08/08/2002 17:14
Re: /programs and preinit - the easy way.
[Re: durden]
|
carpal tunnel
Registered: 24/12/2001
Posts: 5528
|
I'm assuming you mean the script in the telnetd package???
That's the only one I can think of that I wrote...
All it does it create some extra device files in /dev/ which are used for the telnet daemon. They're harmless and won't affect anything else.
The files it creates are ttyp0 to ttypf and ptyp0 to ptyf. You can get rid of them if you don't want the telnet daemon.
If you're talking about the big script at the top of this thread to setup preinit then that's nothing to do with me Ask genixia
- Trevor
|
Top
|
|
|
|
#106467 - 08/08/2002 19:10
Re: /programs and preinit - the easy way.
[Re: tman]
|
journeyman
Registered: 18/07/2002
Posts: 75
Loc: Texas
|
haha.. my bad
_________________________
- durden -
|
Top
|
|
|
|
#106468 - 08/08/2002 19:14
Re: /programs and preinit - the easy way.
[Re: genixia]
|
journeyman
Registered: 18/07/2002
Posts: 75
Loc: Texas
|
So... yes, I was referring to genixia's script.. How do I undo the changes to my empeg that were added from your script? I mean, I know it created that /programs0 directory, and added some preinit files for empacman etc, but what other things did it do? (I tried looking through the script myself to figure out what to undo, but I just got really confused..
Thanks!
_________________________
- durden -
|
Top
|
|
|
|
#106469 - 09/08/2002 05:12
Re: /programs and preinit - the easy way.
[Re: durden]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
1) Formatted paritions. I doubt you want to undo this.
2) Created mount points. Ditto.
3) Update /etc/fstab so that you can 'mount -n -r /programs0' etc. Again, it sounds like to need to keep this.
4) Created 2 utilities 'rop' and 'rwp' so that you can easily re-mount the new partitions read-only or read-write. These are in /bin. You can remove them if you want, but then you will need to manually remount partitions for writing, and back to read-only. cat /bin/rop and cat /bin/rwp to see how.
5) Created /etc/preinit.d and populated it with scripts. If you removed the entire directory, then the new partition wont be mounted at boot, so you may want to keep the N20mount script. But you can cd /etc/preinit.d and remove the others if you so desire.
That's all.
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#106470 - 10/09/2002 14:07
Re: /programs and preinit - the easy way.
[Re: genixia]
|
enthusiast
Registered: 08/07/2002
Posts: 237
Loc: Toronto, Canada
|
Get your serial connection, and press "q" to get a shell. Type "rw" to make the root drive writeable. Leave the connection open..
can someone explain how to do this please?
_________________________
It seemed like a good idea at the time.
|
Top
|
|
|
|
#106471 - 10/09/2002 14:21
Re: /programs and preinit - the easy way.
[Re: jets]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
|
Why don't you start here which is the FAQ entry for "How do I send and receive files from the player?"
Note that if you've got Hijack installed, a serial connection is not necessary, you can use FTP. You'll still need the serial connection to launch the applet, and links to that are included in the document I just linked.
|
Top
|
|
|
|
#106472 - 06/10/2002 10:08
Re: /programs and preinit - the easy way.
[Re: genixia]
|
old hand
Registered: 28/04/2002
Posts: 770
Loc: Los Angeles, CA
|
i was just thinking.....
how about just make /etc/preinit.d a symbolic link to a directory in /program0/. that will allow people to keep their custom preinit scripts from being deleted on a player reflash.
|
Top
|
|
|
|
#106473 - 06/10/2002 10:20
Re: /programs and preinit - the easy way.
[Re: image]
|
old hand
Registered: 28/04/2002
Posts: 770
Loc: Los Angeles, CA
|
crap, i tried it, and just did a chicken or the egg deal.
how can i store preinit.d on a partition that needs to use preinit.d to mount itself.
duh.
|
Top
|
|
|
|
#106474 - 06/10/2002 10:33
Re: /programs and preinit - the easy way.
[Re: image]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
That gives me an idea. I could have preinit attempt to mount /programs0 and if it's successful and /programs0/preinit.d exists, use that directory, otherwise fall back to /etc/preinit.d.
I'll see if I can't incorporate those bugfixes from another post and do this later on today.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#106475 - 08/10/2002 06:49
Re: /programs and preinit - the easy way.
[Re: wfaulk]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
That sounds like a plan to me
I wonder if it's worthwhile attempting to mount /programs1 at the same time so that we can remove the N10mount script totally? (..but only use /programs0 for your conditional...)
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
|
|