Tiny rdesktop Puppy

A home for all kinds of Puppy related projects
Post Reply
Message
Author
idjit
Posts: 7
Joined: Tue 28 Sep 2010, 23:38

Tiny rdesktop Puppy

#1 Post by idjit »

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*.
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.

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#2 Post by jemimah »

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.

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#3 Post by jemimah »

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.

idjit
Posts: 7
Joined: Tue 28 Sep 2010, 23:38

#4 Post by idjit »

Thanks jemimah,

It seemed like I was over-complicating it.

I'll give this pet a shot and let you know how it goes.

idjit
Posts: 7
Joined: Tue 28 Sep 2010, 23:38

One more thing...

#5 Post by idjit »

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...)
Attachments
puppyvm.jpg
(89.98 KiB) Downloaded 1102 times

idjit
Posts: 7
Joined: Tue 28 Sep 2010, 23:38

#6 Post by idjit »

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?

idjit
Posts: 7
Joined: Tue 28 Sep 2010, 23:38

#7 Post by idjit »

More progress!

I borrowed some code from xrandrshell:
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.

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#8 Post by jemimah »

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).

idjit
Posts: 7
Joined: Tue 28 Sep 2010, 23:38

#9 Post by idjit »

jemimah,

That's awesome.


I've replaced the network script with these three lines:
/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...

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#10 Post by jemimah »

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.

idjit
Posts: 7
Joined: Tue 28 Sep 2010, 23:38

#11 Post by idjit »

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.

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#12 Post by jemimah »

Was it plugged in?

Dhcpcd will wait until it detects a carrier.

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#13 Post by jemimah »

I start dhcpcd like this:

Code: Select all

dhcpcd -b -d -f /usr/local/Pwireless2/dhcpcd.conf
With this config file:

Code: Select all

# 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

Post Reply