Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 22 Aug 2014, 13:51
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
Tiny rdesktop Puppy
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
idjit

Joined: 28 Sep 2010
Posts: 7

PostPosted: Tue 28 Sep 2010, 19:49    Post subject:  Tiny rdesktop Puppy
Subject description: rdesktop thin-client using Puppy Linux
 

I'm sure this is actually incredibly simple and I'm doing something wrong, but here's the scenario...

I'd like to end up with a live cd, that will boot on any piece of reasonable x86 hardware without user input, get an IP, default gateway, and DNS from DHCP using whatever NIC it can find, make a best-effort at getting X configured with the best resolution it can manage - falling back to something lousy otherwise, and then launch rdesktop at a pre-configured hostname.


So I downloaded Lucid Puppy, installed rdesktop, commented out the line "exec xwin" from /etc/profile and inserted "xinit rdesktop" instead.

Then I used the included wizard to remaster the CD...

During the remaster process the instructions let you know that it's building a "clean" /etc - no problem, I don't want it customized for the PC I'm building it on, I want it to work on _any_ hardware. But I'll edit the /etc/profile again so it doesn't start X.

I burn the CD, reboot and ... xinit fails. Actually Xserver fails entirely, something about keyboard configuration not working *doh*.

Quote:
Couldn't open rules file /usr/share/X11/xkb/rules/evdev
Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.


So I throw the remastered CD in another computer, boots same error. And on the second computer no ethernet.

I put the original Lucid Puppy disk in the second PC, boots up. Network, graphics, exactly what I was expecting.

So finally on to my question, what am I doing wrong with the remaster? It seems like the automated hardware detection step is getting lost.

I basically want the exact same build that comes on the Lucid Puppy Live CD - but instead of "exec xwin" in the profile, xinit rdesktop (which means the rdesktop binary has to get in there too).

It sounds so easy.
Back to top
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Tue 28 Sep 2010, 20:57    Post subject:  

Don't bother with the remaster script for such a simple change - use this instead and edit the SFS directly.

http://www.murga-linux.com/puppy/viewtopic.php?t=47469

Note: Remmina is nicer and newer than Rdesktop - it might be a better choice.
Back to top
View user's profile Send private message Visit poster's website 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Tue 28 Sep 2010, 21:02    Post subject:  

It's also probably better to let xwin run and make your change to /root/.xinitrc. Just replace the code that starts the window manager with rdesktop.
Back to top
View user's profile Send private message Visit poster's website 
idjit

Joined: 28 Sep 2010
Posts: 7

PostPosted: Tue 28 Sep 2010, 21:23    Post subject:  

Thanks jemimah,

It seemed like I was over-complicating it.

I'll give this pet a shot and let you know how it goes.
Back to top
View user's profile Send private message 
idjit

Joined: 28 Sep 2010
Posts: 7

PostPosted: Wed 29 Sep 2010, 12:02    Post subject: One more thing...  

It worked great ... and I took your advice about using .xinitrc instead, but...

X is starting, then closing again.

At the console, if I type xwin it restarts, with rdesktop full screen.

I'm entirely confused why it fails the first time but works if I manually restart it?

I'm going to try adding "exec xwin" a second time to /etc/profile just in case that works (what a hack, though...)
puppyvm.jpg
 Description   
 Filesize   89.98 KB
 Viewed   810 Time(s)

puppyvm.jpg

Back to top
View user's profile Send private message 
idjit

Joined: 28 Sep 2010
Posts: 7

PostPosted: Wed 29 Sep 2010, 19:37    Post subject:  

So after some detective work I figured out the network hadn't finished loading, that's why X would fail but work on subsequent attempts.

Increase the sleep timer before starting X seems to work well, it'd be nice not to load the network in the background so it waits until that completes.

The next step: Try to find a script that will identify the highest resolution X will run at, *then* start rdesktop.

Any suggestions?
Back to top
View user's profile Send private message 
idjit

Joined: 28 Sep 2010
Posts: 7

PostPosted: Wed 29 Sep 2010, 22:59    Post subject:  

More progress!

I borrowed some code from xrandrshell:

Quote:
XRANDR="`xrandr -q`"
TESTLINE="`echo "$XRANDR" | tr -s " " | grep "^ [0-9]" | grep '\*'`"
TESTX="`echo -n "$TESTLINE" | cut -f 2 -d " " | cut -f 1 -d 'x'`"
TESTY="`echo -n "$TESTLINE" | cut -f 2 -d " " | cut -f 2 -d 'x'`"


That takes care of the resolution.

I also figured out that running /etc/rc.d/rc.network seems to re-initialize the network adapter, but only eth0 - I tracked down the conf files (in the network-wizard folder) and it looks like only one gets generated. I'd like to make sure all the NIC's are listed in there, and all it takes is <mac-addr>.conf in that folder. There's obviously a script creating the first one somewhere. I have to track it down!

The best way of identifying if the NIC is disconnected is probably in the rc.network script already - so I'll have some reading to do.
Back to top
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Wed 29 Sep 2010, 23:11    Post subject:  

If you're only concerned about wired internet with DHCP, you don't need the network wizard at all. Just start up dhcpcd, and it will automatically send dhcp requests on all connected interfaces.

(for wireless, you can do something similar with wpa_supplicant and have it auto connect to open networks).
Back to top
View user's profile Send private message Visit poster's website 
idjit

Joined: 28 Sep 2010
Posts: 7

PostPosted: Wed 29 Sep 2010, 23:26    Post subject:  

jemimah,

That's awesome.


I've replaced the network script with these three lines:

Quote:
/sbin/ifconfig eth0 > /dev/null 2>&1 && /sbin/ifconfig eth0 up
/sbin/ifconfig eth1 > /dev/null 2>&1 && /sbin/ifconfig eth1 up
dhcpcd


One of the computers I was testing on had two network cards, and only the second one was connected - this seems to have fixed that!

I'll figure something out with ifplugstatus, and display an error if there's no cat5 connected.

Getting it to work on wireless would really be something...
Back to top
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Thu 30 Sep 2010, 09:24    Post subject:  

If you configure dhcpcd correctly , you don't even need the first 2 lines. It will work on all interfaces regardless of name.

Documentation:
http://roy.marples.name/cgi-bin/man-cgi?dhcpcd.conf
http://roy.marples.name/cgi-bin/man-cgi?dhcpcd

I've already done the work for wireless for you. Check out Pwireless2. To get auto connection to open wireless networks, you only need a add a few lines to the config file.
Back to top
View user's profile Send private message Visit poster's website 
idjit

Joined: 28 Sep 2010
Posts: 7

PostPosted: Thu 30 Sep 2010, 17:08    Post subject:  

Maybe I need to do some more testing, but it didn't seem to matter what I tried.

Without ifconfig eth1 up I couldn't get dhcpcd to work.
Back to top
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Thu 30 Sep 2010, 17:13    Post subject:  

Was it plugged in?

Dhcpcd will wait until it detects a carrier.
Back to top
View user's profile Send private message Visit poster's website 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Thu 30 Sep 2010, 17:46    Post subject:  

I start dhcpcd like this:

Code:
dhcpcd -b -d -f /usr/local/Pwireless2/dhcpcd.conf


With this config file:

Code:
# Inform the DHCP server of our hostname for DDNS.
hostname
# To share the DHCP lease across OSX and Windows a ClientID is needed.
# Enabling this may get a different lease than the kernel DHCP client.
# Some upstream DHCP servers may also require a ClientID, such as FRITZ!Box.
#clientid

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname
denyinterfaces lo,ppp0,wmaster0,pan0
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0719s ][ Queries: 12 (0.0037s) ][ GZIP on ]