fix bug 4381 :sles12 rcons could not work on P8LE. This checkin support rcons for ubuntu LE diskfull and diskless
This commit is contained in:
parent
baa3edb3ca
commit
641be270e9
@ -840,8 +840,11 @@ sub mkinstall
|
||||
errorcode => [1]});
|
||||
next;
|
||||
}
|
||||
$kcmdline .= " console=tty0 console=ttyS"
|
||||
. $sent->{serialport} . "," . $sent->{serialspeed};
|
||||
if ( $arch =~ /ppc64/i ) {
|
||||
$kcmdline .= " console=tty0 console=hvc".$sent->{serialport} . "," . $sent->{serialspeed};
|
||||
} else {
|
||||
$kcmdline .= " console=tty0 console=ttyS".$sent->{serialport} . "," . $sent->{serialspeed};
|
||||
}
|
||||
if ($sent->{serialflow} =~ /(hard|cts|ctsrts)/){
|
||||
$kcmdline .= "n8r";
|
||||
}
|
||||
@ -1493,8 +1496,13 @@ sub mknetboot
|
||||
);
|
||||
next;
|
||||
}
|
||||
$kcmdline .=
|
||||
if ( $arch =~ /ppc64/i ) {
|
||||
$kcmdline .=
|
||||
"console=tty0 console=hvc" . $sent->{serialport} . "," . $sent->{serialspeed};
|
||||
} else {
|
||||
$kcmdline .=
|
||||
"console=tty0 console=ttyS" . $sent->{serialport} . "," . $sent->{serialspeed};
|
||||
}
|
||||
if ($sent->{serialflow} =~ /(hard|tcs|ctsrts)/)
|
||||
{
|
||||
$kcmdline .= "n8r";
|
||||
|
@ -185,6 +185,7 @@ echo "$TMP" > /xcatpost/mypostscript
|
||||
export NODE=#TABLE:nodelist:THISNODE:node#
|
||||
export OSVER=#TABLE:nodetype:THISNODE:os#
|
||||
export ARCH=#TABLE:nodetype:THISNODE:arch#
|
||||
export CONSOLEPORT=#TABLE:nodehm:THISNODE:serialport#
|
||||
#addsiteyum
|
||||
if [[ -r /boot/grub/menu.lst ]]; then
|
||||
sed -i 's/^serial/#serial/' /boot/grub/menu.lst
|
||||
@ -192,6 +193,33 @@ sed -i 's/^terminal/#terminal/' /boot/grub/menu.lst
|
||||
elif [[ -r /boot/grub/grub.cfg ]] ; then
|
||||
update-grub
|
||||
fi
|
||||
if echo "$ARCH" | grep -i 'ppc64'; then
|
||||
CONSOLE="hvc$CONSOLEPORT"
|
||||
if [[ -r /etc/default/grub ]] ; then
|
||||
sed -i "s/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"console=$CONSOLE\"/" /etc/default/grub
|
||||
else
|
||||
echo "GRUB_CMDLINE_LINUX_DEFAULT=\"console=$CONSOLE\"" > /etc/default/grub
|
||||
fi
|
||||
update-grub
|
||||
|
||||
cat >/etc/init/$CONSOLE\.conf << 'EOF'
|
||||
start on stopped rc RUNLEVEL=[2345] and (not-container or container container CONTAINER=lxc or container CONTAINER=lxc-libvirt)
|
||||
stop on runlevel [!2345]
|
||||
respawn
|
||||
script
|
||||
for i in `cat /proc/cmdline`; do
|
||||
KEY=`echo $i|cut -d= -f 1`
|
||||
if [ "$KEY" == "console" -a "$i" != "console=tty0" ]; then
|
||||
VALUE=`echo $i | cut -d= -f 2`
|
||||
COTTY=`echo $VALUE|cut -d, -f 1`
|
||||
COSPEED=`echo $VALUE|cut -d, -f 2|cut -dn -f 1`
|
||||
exec /sbin/getty -L $COSPEED $COTTY vt102
|
||||
break
|
||||
fi
|
||||
done
|
||||
end script
|
||||
EOF
|
||||
fi
|
||||
sed -i 's/\(deb.*security.*\)/#\1/' /etc/apt/sources.list
|
||||
#iso does not contains source deb packages
|
||||
sed -i 's/^\(\s*deb-src.*install.*\)$/#\1/g' /etc/apt/sources.list
|
||||
|
@ -41,4 +41,19 @@ END
|
||||
#for ext in pkglist exlist postinstall repolist; do
|
||||
# [ -r $workdir/$profile.$ext ] && cat $workdir/$profile.$ext | grep -E '^[[:space:]]*#.*[[:space:]]\$Id' >> $installroot/etc/IMGVERSION
|
||||
#done
|
||||
|
||||
if echo "$arch" | grep -i 'ppc64'; then
|
||||
CONSOLE="hvc0"
|
||||
for i in `cat /proc/cmdline`; do
|
||||
KEY=`echo $i|cut -d= -f 1`
|
||||
if [ "$KEY" == "console" -a "$i" != "console=tty0" ]; then
|
||||
CONSOLEPARAM=$i
|
||||
CONSOLE=`echo $i | cut -d= -f 2 | cut -d, -f 1`
|
||||
fi
|
||||
done
|
||||
if [[ -r $installroot/etc/default/grub ]]; then
|
||||
sed -i "s/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"console=$CONSOLE\"/" $installroot/etc/default/grub
|
||||
else
|
||||
echo "GRUB_CMDLINE_LINUX_DEFAULT=\"console=$CONSOLE\"" > $installroot/etc/default/grub
|
||||
fi
|
||||
#update-grub
|
||||
fi
|
@ -982,6 +982,14 @@ EOS1
|
||||
print $inifile "mknod /dev/ttyS1 c 4 65\n";
|
||||
print $inifile "mknod /dev/ttyS2 c 4 66\n";
|
||||
print $inifile "mknod /dev/ttyS3 c 4 67\n";
|
||||
print $inifile "mknod /dev/hvc0 c 229 0\n";
|
||||
print $inifile "mknod /dev/hvc1 c 229 1\n";
|
||||
print $inifile "mknod /dev/hvc2 c 229 2\n";
|
||||
print $inifile "mknod /dev/hvc3 c 229 3\n";
|
||||
print $inifile "mknod /dev/hvc4 c 229 4\n";
|
||||
print $inifile "mknod /dev/hvc5 c 229 5\n";
|
||||
print $inifile "mknod /dev/hvc6 c 229 6\n";
|
||||
print $inifile "mknod /dev/hvc7 c 229 7\n";
|
||||
|
||||
foreach (@ndrivers) {
|
||||
print $inifile "insmod /lib/$_\n";
|
||||
|
Loading…
Reference in New Issue
Block a user