mkimage-profiles/features.in/x11-autostart/rootfs/image-scripts.d/40-x11-autostart
Michael Shigorin fc3569a491 x11-autostart: tweak for oem case
The nuance being that:
- alterator-setup package would change default.target
  for systemd providing a symlink of its own and making
  a backup of what was there (rc3 basically);
- 40-x11-autostart would ignore that backup;
- 99-oem-setup would do nothing about it all either;
- alterator-setup removal would restore rc3 symlink.

It's not pretty either, something more robust should be
invented some day.
2013-07-22 23:40:58 +04:00

20 lines
454 B
Bash
Executable File

#!/bin/sh
if [ ! -x /usr/bin/X ]; then
echo "SKIP autostart: X not installed" >&2
exit 0
fi
## setup automated graphical session startup
INITTAB=/etc/inittab
if [ -f "$INITTAB" ]; then
[ -z "$runlevel" ] && runlevel=5
sed -i "s,^\(id:\)\(.*\)\(:initdefault.*\),\\1$runlevel\\3," "$INITTAB"
fi
## ...and systemd, if any
## NB: alterator-setup's backup file can present a nice catch if left around
rm -f /etc/systemd/system/default.target{,.bak}
: