From 9baf26ce5668ac266659482c5fccdf3c52d4cf9a Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sat, 1 Sep 2018 23:07:42 +0200 Subject: [PATCH] Make Alpine start with nomodeset and custom tty prompt --- basic.sh | 3 ++- basic/boot/extlinux.conf | 2 +- basic/etc/inittab | 3 +-- basic/sbin/spotty | 8 ++++++++ basic/srv/spotter/appmgr/__init__.py | 12 ------------ 5 files changed, 12 insertions(+), 16 deletions(-) create mode 100755 basic/sbin/spotty diff --git a/basic.sh b/basic.sh index 9b829f1..8b15758 100755 --- a/basic.sh +++ b/basic.sh @@ -18,6 +18,7 @@ cp ${SOURCE_DIR}/boot/extlinux.conf /boot/extlinux.conf cp ${SOURCE_DIR}/boot/spotter.txt /boot/spotter.txt cp ${SOURCE_DIR}/etc/inittab /etc/inittab cp ${SOURCE_DIR}/sbin/extend-disk /sbin/extend-disk +cp ${SOURCE_DIR}/sbin/spotty /sbin/spotty >/etc/motd # Enable support for Czech characters @@ -41,7 +42,7 @@ wget https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh -O /usr/b sed -i 's|$HOME/.$PROJECT_NAME|/etc/acme.sh.d|' /usr/bin/acme.sh chmod +x /usr/bin/acme.sh -# Copy Spotter resources +# Copy Spotter AppMgr resources cp ${SOURCE_DIR}/etc/init.d/spotter-appmgr /etc/init.d/spotter-appmgr rc-update -u cp -r ${SOURCE_DIR}/srv/spotter /srv/spotter diff --git a/basic/boot/extlinux.conf b/basic/boot/extlinux.conf index 5ef5a9e..b5f695b 100644 --- a/basic/boot/extlinux.conf +++ b/basic/boot/extlinux.conf @@ -6,4 +6,4 @@ DISPLAY spotter.txt LABEL vm LINUX vmlinuz-virt INITRD initramfs-virt - APPEND root=/dev/vg0/root modules=sd-mod,usb-storage,ext4 quiet rootfstype=ext4 cryptroot=/dev/sda2 cryptdm=system + APPEND root=/dev/vg0/root modules=sd-mod,usb-storage,ext4 nomodeset quiet rootfstype=ext4 cryptroot=/dev/sda2 cryptdm=system diff --git a/basic/etc/inittab b/basic/etc/inittab index f8432af..493c41b 100644 --- a/basic/etc/inittab +++ b/basic/etc/inittab @@ -6,8 +6,7 @@ ::wait:/sbin/openrc default >/dev/null 2>&1 # Set up getty -::wait:/usr/bin/spotter-appmgr rebuild-issue >/dev/null 2>&1 -tty1::respawn:/sbin/getty -l /sbin/nologin 38400 tty1 +tty1::respawn:/sbin/getty -n -l /sbin/spotty 38400 tty1 # Stuff to do for the 3-finger salute ::ctrlaltdel:/sbin/reboot diff --git a/basic/sbin/spotty b/basic/sbin/spotty new file mode 100755 index 0000000..a289230 --- /dev/null +++ b/basic/sbin/spotty @@ -0,0 +1,8 @@ +#!/bin/sh + +# Rebuild /etc/issue +/usr/bin/spotter-appmgr rebuild-issue +# Remove double-escaping needed for the real /etc/issue +/bin/sed 's|\\\\|\\|g' /etc/issue +# Wait for key press +read a diff --git a/basic/srv/spotter/appmgr/__init__.py b/basic/srv/spotter/appmgr/__init__.py index 8600b7c..04209ca 100644 --- a/basic/srv/spotter/appmgr/__init__.py +++ b/basic/srv/spotter/appmgr/__init__.py @@ -91,31 +91,20 @@ ISSUE_TEMPLATE = ''' | | |_|\x1b[0m - - - \x1b[1;33mUPOZORNĚNÍ:\x1b[0m Neoprávněný přístup k tomuto zařízení je zakázán. Musíte mít výslovné oprávnění k přístupu nebo konfiguraci tohoto zařízení. Neoprávněné pokusy a kroky k přístupu nebo používání tohoto systému mohou mít za následek občanské nebo trestní sankce. - \x1b[1;33mCAUTION:\x1b[0m Unauthozired access to this device is prohibited. You must have explicit, authorized permission to access or configure this device. Unauthorized attempts and actions to access or use this system may result in civil or criminal penalties. - - Pro přístup k aplikacím otevřete URL \x1b[1m{url}\x1b[0m ve Vašem internetovém prohlížeči. - - - - - \x1b[0;30m ''' @@ -238,7 +227,6 @@ class AppMgr: self.port = self.conf['host']['port'] = port self.save_conf() self.rebuild_nginx(restart_nginx) - self.rebuild_issue() self.update_apps_urls() def rebuild_nginx(self, restart_nginx):