diff --git a/common/qubes_eventd_serial b/common/qubes_eventd_serial deleted file mode 100644 index dba1f32..0000000 --- a/common/qubes_eventd_serial +++ /dev/null @@ -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 ' 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 diff --git a/common/serial.conf b/common/serial.conf new file mode 100644 index 0000000..48930a4 --- /dev/null +++ b/common/serial.conf @@ -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 ' 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 diff --git a/rpm_spec/core-appvm.spec b/rpm_spec/core-appvm.spec index f2f8be4..c446fc3 100644 --- a/rpm_spec/core-appvm.spec +++ b/rpm_spec/core-appvm.spec @@ -72,10 +72,10 @@ cp ../appvm/qubes.repo $RPM_BUILD_ROOT/etc/yum.repos.d mkdir -p $RPM_BUILD_ROOT/sbin cp ../common/qubes_serial_login $RPM_BUILD_ROOT/sbin 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 -cp /etc/qubes_eventd_serial /etc/event.d/serial +cp /var/lib/qubes/serial.conf /etc/init/serial.conf %post @@ -88,7 +88,7 @@ fi usermod -L root usermod -L user 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 echo "--> Disabling SELinux..." @@ -157,7 +157,7 @@ if [ "$1" = 0 ] ; then chkconfig qubes_core off mv /var/lib/qubes/fstab.orig /etc/fstab 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 %clean @@ -174,10 +174,9 @@ rm -rf $RPM_BUILD_ROOT /usr/bin/qubes_add_pendrive_script /etc/udev/rules.d/qubes.rules /etc/sysconfig/iptables -%dir /var/lib/qubes +/var/lib/qubes %dir /mnt/incoming %dir /mnt/outgoing %dir /mnt/removable /etc/yum.repos.d/qubes.repo /sbin/qubes_serial_login -/etc/qubes_eventd_serial diff --git a/rpm_spec/core-netvm.spec b/rpm_spec/core-netvm.spec index 4435857..7d96f01 100644 --- a/rpm_spec/core-netvm.spec +++ b/rpm_spec/core-netvm.spec @@ -66,10 +66,10 @@ cp ../netvm/qubes.repo $RPM_BUILD_ROOT/etc/yum.repos.d mkdir -p $RPM_BUILD_ROOT/sbin cp ../common/qubes_serial_login $RPM_BUILD_ROOT/sbin 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 -cp /etc/qubes_eventd_serial /etc/event.d/serial +cp /var/lib/qubes/serial.conf /etc/init/serial.conf %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 user 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 echo "--> Disabling SELinux..." @@ -151,7 +151,7 @@ if [ "$1" = 0 ] ; then chkconfig qubes_core off mv /var/lib/qubes/fstab.orig /etc/fstab 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 %clean @@ -162,10 +162,9 @@ rm -rf $RPM_BUILD_ROOT /etc/fstab /etc/sysconfig/iptables /etc/init.d/qubes_core -%dir /var/lib/qubes +/var/lib/qubes /usr/bin/qubes_setup_dnat_to_ns /etc/dhclient.d/qubes_setup_dnat_to_ns.sh /etc/NetworkManager/dispatcher.d/qubes_nmhook /etc/yum.repos.d/qubes.repo /sbin/qubes_serial_login -/etc/qubes_eventd_serial