2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 11:42:05 +00:00

Merge pull request #2621 from bybai/hostname

fix hostname linux in statelite sles12.2
This commit is contained in:
yangsong 2017-03-10 10:17:44 +08:00 committed by GitHub
commit 1dd6255ee4
2 changed files with 5 additions and 1 deletions

View File

@ -76,6 +76,7 @@ This is the minimal list of files needed, you can add additional files to the li
"ALL","/etc/ntp.conf","tmpfs",,
"ALL","/etc/ntp.conf.org","tmpfs",,
"ALL","/etc/resolv.conf","tmpfs",,
"ALL","/etc/hostname","tmpfs",,
"ALL","/etc/ssh/","tmpfs",,
"ALL","/etc/sysconfig/","tmpfs",,
"ALL","/etc/syslog-ng/","tmpfs",,

View File

@ -134,13 +134,16 @@ function getdevfrommac() {
done
}
for lf in /tmp/dhclient.*.lease; do
netif=${lf#*.}
netif=${netif%.*}
cp $lf "$NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
done
if [ -f $NEWROOT/etc/hostname ]; then
echo `hostname -s` > $NEWROOT/etc/hostname
fi
if [ ! -z "$ifname" ]; then
MACX=${ifname#*:}
ETHX=${ifname%:$MACX*}