Fix serial console on VM to work on F13 (REQUIRES F13)
This commit is contained in:
parent
775e01a8e4
commit
4fdcedbb40
@ -1,42 +0,0 @@
|
|||||||
# Automatically start a configured serial console
|
|
||||||
#
|
|
||||||
# How this works:
|
|
||||||
#
|
|
||||||
# On boot, a udev helper examines /dev/console. If a serial console is the
|
|
||||||
# primary console (last console on the commandline in grub), the event
|
|
||||||
# 'fedora.serial-console-available <port name> <speed>' is emitted, which
|
|
||||||
# triggers this script. It waits for the runlevel to finish, ensures
|
|
||||||
# the proper port is in /etc/securetty, and starts the getty.
|
|
||||||
#
|
|
||||||
# If your serial console is not the primary console, or you want a getty
|
|
||||||
# on serial even if it's not the console, create your own event by copying
|
|
||||||
# /etc/event.d/tty[2-6], and changing the getty line in that file.
|
|
||||||
|
|
||||||
start on fedora.serial-console-available *
|
|
||||||
stop on runlevel [016]
|
|
||||||
|
|
||||||
instance
|
|
||||||
pre-start script
|
|
||||||
while /bin/true ; do
|
|
||||||
LANG=C /sbin/initctl status rcS | grep -wq "rcS (stop) waiting" && break
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
while /bin/true ; do
|
|
||||||
runlevel=$(/sbin/runlevel | /bin/awk '{ print $2 }')
|
|
||||||
case "$runlevel" in
|
|
||||||
2|3|4|5)
|
|
||||||
LANG=C /sbin/initctl status rc$runlevel | grep -wq "rc$runlevel (stop) waiting" && break
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
/sbin/securetty $1
|
|
||||||
end script
|
|
||||||
exec /sbin/agetty -l /sbin/qubes_serial_login /dev/$1 $2 vt100-nav
|
|
||||||
post-stop script
|
|
||||||
if [ "$UPSTART_EVENT" != "${UPSTART_EVENT##fedora.serial-console-available}" ]; then
|
|
||||||
initctl emit --no-wait fedora.serial-console-available $1 $2
|
|
||||||
fi
|
|
||||||
end script
|
|
21
common/serial.conf
Normal file
21
common/serial.conf
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Automatically start a configured serial console
|
||||||
|
#
|
||||||
|
# How this works:
|
||||||
|
#
|
||||||
|
# On boot, a udev helper examines /dev/console. If a serial console is the
|
||||||
|
# primary console (last console on the commandline in grub), the event
|
||||||
|
# 'fedora.serial-console-available <port name> <speed>' is emitted, which
|
||||||
|
# triggers this script. It waits for the runlevel to finish, ensures
|
||||||
|
# the proper port is in /etc/securetty, and starts the getty.
|
||||||
|
#
|
||||||
|
# If your serial console is not the primary console, or you want a getty
|
||||||
|
# on serial even if it's not the console, create your own event by copying
|
||||||
|
# /etc/init/tty.conf, and changing the getty line in that file.
|
||||||
|
|
||||||
|
start on fedora.serial-console-available DEV=* and stopped rc RUNLEVEL=[2345]
|
||||||
|
stop on runlevel [016]
|
||||||
|
|
||||||
|
instance $DEV
|
||||||
|
respawn
|
||||||
|
pre-start exec /sbin/securetty $DEV
|
||||||
|
exec /sbin/agetty -l /sbin/qubes_serial_login /dev/$DEV $SPEED vt100-nav
|
@ -72,10 +72,10 @@ cp ../appvm/qubes.repo $RPM_BUILD_ROOT/etc/yum.repos.d
|
|||||||
mkdir -p $RPM_BUILD_ROOT/sbin
|
mkdir -p $RPM_BUILD_ROOT/sbin
|
||||||
cp ../common/qubes_serial_login $RPM_BUILD_ROOT/sbin
|
cp ../common/qubes_serial_login $RPM_BUILD_ROOT/sbin
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc
|
mkdir -p $RPM_BUILD_ROOT/etc
|
||||||
cp ../common/qubes_eventd_serial $RPM_BUILD_ROOT/etc/
|
cp ../common/serial.conf $RPM_BUILD_ROOT/var/lib/qubes/
|
||||||
|
|
||||||
%triggerin -- initscripts
|
%triggerin -- initscripts
|
||||||
cp /etc/qubes_eventd_serial /etc/event.d/serial
|
cp /var/lib/qubes/serial.conf /etc/init/serial.conf
|
||||||
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
@ -88,7 +88,7 @@ fi
|
|||||||
usermod -L root
|
usermod -L root
|
||||||
usermod -L user
|
usermod -L user
|
||||||
if ! [ -f /var/lib/qubes/serial.orig ] ; then
|
if ! [ -f /var/lib/qubes/serial.orig ] ; then
|
||||||
cp /etc/event.d/serial /var/lib/qubes/serial.orig
|
cp /etc/init/serial.conf /var/lib/qubes/serial.orig
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "--> Disabling SELinux..."
|
echo "--> Disabling SELinux..."
|
||||||
@ -157,7 +157,7 @@ if [ "$1" = 0 ] ; then
|
|||||||
chkconfig qubes_core off
|
chkconfig qubes_core off
|
||||||
mv /var/lib/qubes/fstab.orig /etc/fstab
|
mv /var/lib/qubes/fstab.orig /etc/fstab
|
||||||
mv /var/lib/qubes/removed-udev-scripts/* /etc/udev/rules.d/
|
mv /var/lib/qubes/removed-udev-scripts/* /etc/udev/rules.d/
|
||||||
mv /var/lib/qubes/serial.orig /etc/event.d
|
mv /var/lib/qubes/serial.orig /etc/init/serial.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
@ -174,10 +174,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
/usr/bin/qubes_add_pendrive_script
|
/usr/bin/qubes_add_pendrive_script
|
||||||
/etc/udev/rules.d/qubes.rules
|
/etc/udev/rules.d/qubes.rules
|
||||||
/etc/sysconfig/iptables
|
/etc/sysconfig/iptables
|
||||||
%dir /var/lib/qubes
|
/var/lib/qubes
|
||||||
%dir /mnt/incoming
|
%dir /mnt/incoming
|
||||||
%dir /mnt/outgoing
|
%dir /mnt/outgoing
|
||||||
%dir /mnt/removable
|
%dir /mnt/removable
|
||||||
/etc/yum.repos.d/qubes.repo
|
/etc/yum.repos.d/qubes.repo
|
||||||
/sbin/qubes_serial_login
|
/sbin/qubes_serial_login
|
||||||
/etc/qubes_eventd_serial
|
|
||||||
|
@ -66,10 +66,10 @@ cp ../netvm/qubes.repo $RPM_BUILD_ROOT/etc/yum.repos.d
|
|||||||
mkdir -p $RPM_BUILD_ROOT/sbin
|
mkdir -p $RPM_BUILD_ROOT/sbin
|
||||||
cp ../common/qubes_serial_login $RPM_BUILD_ROOT/sbin
|
cp ../common/qubes_serial_login $RPM_BUILD_ROOT/sbin
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc
|
mkdir -p $RPM_BUILD_ROOT/etc
|
||||||
cp ../common/qubes_eventd_serial $RPM_BUILD_ROOT/etc/
|
cp ../common/serial.conf $RPM_BUILD_ROOT/var/lib/qubes/
|
||||||
|
|
||||||
%triggerin -- initscripts
|
%triggerin -- initscripts
|
||||||
cp /etc/qubes_eventd_serial /etc/event.d/serial
|
cp /var/lib/qubes/serial.conf /etc/init/serial.conf
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ sed 's/^net.ipv4.ip_forward.*/net.ipv4.ip_forward = 1/' -i /etc/sysctl.conf
|
|||||||
usermod -L root
|
usermod -L root
|
||||||
usermod -L user
|
usermod -L user
|
||||||
if ! [ -f /var/lib/qubes/serial.orig ] ; then
|
if ! [ -f /var/lib/qubes/serial.orig ] ; then
|
||||||
cp /etc/event.d/serial /var/lib/qubes/serial.orig
|
cp /etc/init/serial.conf /var/lib/qubes/serial.orig
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "--> Disabling SELinux..."
|
echo "--> Disabling SELinux..."
|
||||||
@ -151,7 +151,7 @@ if [ "$1" = 0 ] ; then
|
|||||||
chkconfig qubes_core off
|
chkconfig qubes_core off
|
||||||
mv /var/lib/qubes/fstab.orig /etc/fstab
|
mv /var/lib/qubes/fstab.orig /etc/fstab
|
||||||
mv /var/lib/qubes/removed-udev-scripts/* /etc/udev/rules.d/
|
mv /var/lib/qubes/removed-udev-scripts/* /etc/udev/rules.d/
|
||||||
mv /var/lib/qubes/serial.orig /etc/event.d
|
mv /var/lib/qubes/serial.orig /etc/init/serial.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
@ -162,10 +162,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
/etc/fstab
|
/etc/fstab
|
||||||
/etc/sysconfig/iptables
|
/etc/sysconfig/iptables
|
||||||
/etc/init.d/qubes_core
|
/etc/init.d/qubes_core
|
||||||
%dir /var/lib/qubes
|
/var/lib/qubes
|
||||||
/usr/bin/qubes_setup_dnat_to_ns
|
/usr/bin/qubes_setup_dnat_to_ns
|
||||||
/etc/dhclient.d/qubes_setup_dnat_to_ns.sh
|
/etc/dhclient.d/qubes_setup_dnat_to_ns.sh
|
||||||
/etc/NetworkManager/dispatcher.d/qubes_nmhook
|
/etc/NetworkManager/dispatcher.d/qubes_nmhook
|
||||||
/etc/yum.repos.d/qubes.repo
|
/etc/yum.repos.d/qubes.repo
|
||||||
/sbin/qubes_serial_login
|
/sbin/qubes_serial_login
|
||||||
/etc/qubes_eventd_serial
|
|
||||||
|
Loading…
Reference in New Issue
Block a user