Tiny Core Base > piCore Test Releases

piCore-7.0rc2

<< < (3/6) > >>

Paul_123:

--- Quote from: jgrulich on December 30, 2015, 08:58:44 AM ---It's enough to execute the hostname set before the udhcp, not need to run whole bootsync.sh. Otherwise the bootsync.sh need to be run separately from bootlocal.sh to be sure that bootlocal.sh is run after udhcp is executed when whole boot process is finished. In my case i make a lot of different operations with the network in the bootlocal.sh.

--- End quote ---

Definitely a race track.   The question is where you edit and save the host name, right now we edit bootsync.sh. 

bmarkus:
Set host name in cmdline

Paul_123:

--- Quote from: bmarkus on December 30, 2015, 09:25:19 AM ---Set host name in cmdline

--- End quote ---

I suppose, it's just much easier to use the setting in bootsync.sh

Setting the hostname in bootsync makes upgrading multiple pi's easier.    The boot partition is the same on all of my pi's, all of the data is in the backup.


Rich:
Hi Paul_123
This is from the X86 version under TC4 so I don't know if it's valid under PI. In tc-config:

--- Code: ---# Here we check all the boot parameters using the fastest way known to men, case & loop
echo -n "${BLUE}Checking boot options...${NORMAL}"
for i in `cat /proc/cmdline`; do
case $i in
*=*)
case $i in
waitusb*) WAITUSB=${i#*=} ;;
lang*) LANGUAGE=${i#*=} ;;
kmap*) KEYMAP=${i#*=} ;;
tz*) TZ=${i#*=} ;;
desktop*) DESKTOP=${i#*=} ;;
icons*) ICONS=${i#*=} ;;
user*) USER=${i#*=} ;;
home*) MYHOME=${i#*=} ;;
tcvd*) TCVD=${i#*=} ;;
opt*) MYOPT=${i#*=} ;;
swapfile*) SWAPFILE=${i#*=} ;;
resume*) RESUME=${i#*=} ;;
host*) HOST=1 ;;
---------------- Snip ------------------
--- End code ---
It appears to check if the  host  boot code exists. Then further down:

--- Code: ---if [ -n "$HOST" ]; then
sethostname
else
/bin/hostname -F /etc/hostname
fi
--- End code ---
It looks like if you set the hostname in  /etc/hostname  and back it up, it will be used if the  host  boot code exists.

Greg Erskine:

--- Quote from: Paul_123 on December 30, 2015, 08:07:03 AM ---The hostname is set in bootsync.sh,  the hostname is not getting set before udhcpc runs on the eth0 interface.  So the device is just showing up on my router as "box" instead of its proper name./quote]

Hi Paul_123,

I can confirm this behaviour but it's been around for quite a while. The solution was to add hostname to cmdline.txt.

I don't like the way $HOST was also used in get_app routine.

regard
Greg




--- End quote ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version