Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ 1 [2] >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: setting hostname with liveCD?< Next Oldest | Next Newest >
educ Offline





Group: Members
Posts: 3
Joined: Nov. 2004
Posted: April 18 2005,18:08 QUOTE

Quote (henk.1955 @ Mar. 22 2005,04:20)
*.tar.gz, *.dsl and *.uci are loaded at boottime with the /etc/rcS.d/S01dsl-config. this is a link to /KNOPPIX/etc/init.d/dsl-config.
So if you want a script to run at boottime: you can put it in in /etc/init.d and have links in /etc/rc2.d/,
/etc/rc3.d/,/etc/rc4.d/,/etc/rc5.d/ to the script.
then tar.gz the script and the links. ( does not have to be a *.dsl, /etc is writeable as it in minirt24 which is the root).
put the script where mydsl= finds it.

example:
/etc/init.d/echo_hostname
Code Sample
#!/bin/bash

. /etc/init.d/dsl-functions

CMDLINE="$(cat /proc/cmdline)"

# get hostname from bootparams

HOSTNAME="$(getbootparam hostname 2>/dev/null)"

echo "hostname=$HOSTNAME."

ln -sf /etc/init.d/echo_hostname /etc/rc2.d/S01echo_hostname
ln -sf /etc/init.d/echo_hostname /etc/rc3.d/S01echo_hostname
ln -sf /etc/init.d/echo_hostname /etc/rc4.d/S01echo_hostname
ln -sf /etc/init.d/echo_hostname /etc/rc5.d/S01echo_hostname

The links in the /etc/rc2.d .. /etc/rc5.d make sure the script is run no matter what runlevel you choise.
the S01 in the linkname defines the order in which the scripts are run S01 first S99 last

Now if you look in /etc/rc2.d to etc/rc5.d you see they have:
S49dsl-restore ( this untars the backup.tar.gz)
S99bootlocal   ( this runs the /opt/bootlocal.sh)

i think it is much easier add:
Code Sample
. /etc/init.d/dsl-functions

CMDLINE="$(cat /proc/cmdline)"

# Set hostname
HOSTNAME="$(getbootparam hostname 2>/dev/null)"

echo "hostname=$HOSTNAME."

[ -n "$HOSTNAME" ] || HOSTNAME="box"
rm -f /etc/hostname
echo $HOSTNAME >/etc/hostname
/etc/init.d/hostname.sh
rm -f /etc/hosts
cat >/etc/hosts <<EOT
127.0.0.1 $HOSTNAME localhost

# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

EOT

echo "hostname set"

to /opt/bootlocal.sh
or put this code in a script, call the script from bootlocal.sh
then add them to filetool.lst to have them backedup

henk.1955 henk.1955 henk.1955

:p  may i kiss you?
i mean deep throat DAAAAAMMMMNNN
this man and all the DSL team rules!!!

i learn so much about Linux with you men!!!


i was tweaking and searching the forum to know how you set this "hostname" boot time option...

and here i am ( after 2 month trying!!!!)
still a newbie error


but now i can choose the name of my DSL box!!


if it can help newbie like me
better put the script at the start of bootlocal.sh
and issue your others command AFTER

. /etc/init.d/dsl-functions this part is needed to call the function getbootparam


then you just have to add this boot time option:
"hostname=henk55rocks" in your root syslinux.cfg

and your done...

now you can network all your computers with USB-key DSL charged!!!!!
Back to top
Profile PM 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: April 18 2005,21:45 QUOTE

henk's mod is going into the next release, this should make it easier for everyone with multiple DSL boxes.
Back to top
Profile PM WEB 
clivesay Offline





Group: Guests
Posts: 935
Joined: Dec. 2003
Posted: April 18 2005,21:52 QUOTE

Thanks, Robert.

DSL is so good that more and more of us have multiple DSL boxes running.   :cool:
Back to top
Profile PM MSN YIM 
educ Offline





Group: Members
Posts: 3
Joined: Nov. 2004
Posted: April 19 2005,11:07 QUOTE

one word to say:
DAMN!!!

every time i show up this usb-key power :same reaction..

they will soon change my computer with one without:CDROM,USBport,SCSI,FLOPPY,NETwork...I/O  access

this help you learning linux, cause i really dont know what you cant do with this distro....
just ask it might be someone already got your solution.

Forum Search is your friend!!!

it may be a bit Techhie,*NIX GuRu .. sometimes but  after each step you really feel you ve learn something...





next step replace my main computer OS(yes you know it)
still got problem to solve (USB printing) and then i will invent others :)



did i mention that i love you all in here????
Back to top
Profile PM 
8 replies since Mar. 21 2005,03:38 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ 1 [2] >/
reply to topic new topic new poll
Quick Reply: setting hostname with liveCD?

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code