-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: seamless boot splash, daemon for disabling keyboard and touchpad, and remove gzip compression on initramfs #215
base: master
Are you sure you want to change the base?
Changes from all commits
8e846f2
4f79bda
82e7e72
ce66348
0653186
471da0d
6787f40
03d84a2
28b2c85
77de970
af1792f
009d681
96b72a2
37c4200
05904a4
03df7d2
40bd269
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
tmp.* | ||
PrawnOS-Shiba-* | ||
PrawnOS-initramfs.cpio.gz | ||
PrawnOS-initramfs.cpio | ||
build | ||
kernel/sources/linux-*.tar.gz | ||
*.dsc |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[?25h[?0c |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# This file is part of systemd. | ||
# | ||
# systemd is free software; you can redistribute it and/or modify it | ||
# under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation; either version 2.1 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Entries in this file show the compile time defaults. | ||
# You can change settings by editing this file. | ||
# Defaults can be restored by simply deleting this file. | ||
# | ||
# See systemd-system.conf(5) for details. | ||
|
||
[Manager] | ||
#LogLevel=info | ||
#LogTarget=journal-or-kmsg | ||
#LogColor=yes | ||
#LogLocation=no | ||
#LogTime=no | ||
#DumpCore=yes | ||
ShowStatus=no | ||
#CrashChangeVT=no | ||
#CrashShell=no | ||
#CrashReboot=no | ||
#CtrlAltDelBurstAction=reboot-force | ||
#CPUAffinity=1 2 | ||
#NUMAPolicy=default | ||
#NUMAMask= | ||
#RuntimeWatchdogSec=0 | ||
#RebootWatchdogSec=10min | ||
#ShutdownWatchdogSec=10min | ||
#KExecWatchdogSec=0 | ||
#WatchdogDevice= | ||
#CapabilityBoundingSet= | ||
#NoNewPrivileges=no | ||
#SystemCallArchitectures= | ||
#TimerSlackNSec= | ||
#StatusUnitFormat=description | ||
#DefaultTimerAccuracySec=1min | ||
#DefaultStandardOutput=journal | ||
#DefaultStandardError=inherit | ||
#DefaultTimeoutStartSec=90s | ||
#DefaultTimeoutStopSec=90s | ||
#DefaultTimeoutAbortSec= | ||
#DefaultRestartSec=100ms | ||
#DefaultStartLimitIntervalSec=10s | ||
#DefaultStartLimitBurst=5 | ||
#DefaultEnvironment= | ||
#DefaultCPUAccounting=no | ||
#DefaultIOAccounting=no | ||
#DefaultIPAccounting=no | ||
#DefaultBlockIOAccounting=no | ||
#DefaultMemoryAccounting=yes | ||
#DefaultTasksAccounting=yes | ||
#DefaultTasksMax= | ||
#DefaultLimitCPU= | ||
#DefaultLimitFSIZE= | ||
#DefaultLimitDATA= | ||
#DefaultLimitSTACK= | ||
#DefaultLimitCORE= | ||
#DefaultLimitRSS= | ||
#DefaultLimitNOFILE=1024:524288 | ||
#DefaultLimitAS= | ||
#DefaultLimitNPROC= | ||
#DefaultLimitMEMLOCK= | ||
#DefaultLimitLOCKS= | ||
#DefaultLimitSIGPENDING= | ||
#DefaultLimitMSGQUEUE= | ||
#DefaultLimitNICE= | ||
#DefaultLimitRTPRIO= | ||
#DefaultLimitRTTIME= |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,12 +17,11 @@ | |
# You should have received a copy of the GNU General Public License | ||
# along with PrawnOS. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
echo In PrawnOS Init | ||
|
||
#add this to start shell at desired point | ||
rescue_shell() { | ||
[ "{$1}" != "debug" ] && echo "Something went wrong. Dropping to a shell." > /dev/tty1 | ||
[ "{$1}" == "debug" ] && echo "Debug flag detected, entering debug shell" > /dev/tty1 | ||
dmesg -n 4 | ||
echo "Something went wrong. Dropping to a shell." > /dev/tty1 | ||
exec setsid /bin/sh -c 'exec /bin/sh </dev/tty1 >/dev/tty1 2>&1' | ||
} | ||
|
@@ -66,14 +65,26 @@ mount -n -t devtmpfs devtmpfs /dev | |
# get the root device, so we can find the boot partiton | ||
UNPARSED=$(cmdline root) | ||
ROOT_PARTUUID=$(rootpartuuid $UNPARSED) | ||
echo ${ROOT_PARTUUID} > /dev/tty1 | ||
BLKID=$(/sbin/blkid | grep $ROOT_PARTUUID ) | ||
echo ${BLKID} > /dev/tty1 | ||
#If its an mmcblk device, the kernel partiton will p1. If it is a usb device, the partiton will just be 1 | ||
#Just want everything before the 1 | ||
ROOT_DEV="${BLKID%1:*}" | ||
|
||
echo ${ROOT_DEV} > /dev/tty1 | ||
|
||
# happens when kernel takes its time looking for devices | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have done many boot tests on veyron-speedy and gru-kevin and have never seen this happen. I'm not convinced it could happen, as we are already booting from the device we are looking for. What situations did you see this happen? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was testing images on my microSD card and it has happened a few times |
||
if [ -z ${ROOT_DEV} ] | ||
then | ||
sleep 1 | ||
# get the root device, so we can find the boot partiton | ||
UNPARSED=$(cmdline root) | ||
ROOT_PARTUUID=$(rootpartuuid $UNPARSED) | ||
BLKID=$(/sbin/blkid | grep $ROOT_PARTUUID ) | ||
#If its an mmcblk device, the kernel partiton will p1. If it is a usb device, the partiton will just be 1 | ||
ROOT_DEV="${BLKID%1:*}" | ||
# if device is still not seen, bail out | ||
[ -z ${ROOT_DEV} ] && rescue_shell | ||
fi | ||
|
||
|
||
# label any partition on the system with RESCUESHELL to enter the initramfs rescue shell before mount and root_switch. | ||
# you can do this with "cgpt add -i 1 -l RESCUESHELL /dev/sda" for example to label the first partiton of a usb drive. | ||
|
@@ -89,14 +100,17 @@ then | |
dmesg -n 2 | ||
echo "Opening encrypted root partition, this will take 30s..." | ||
cryptsetup --tries 5 luksOpen ${ROOT_DEV}2 luksroot || rescue_shell | ||
dmesg -n 7 | ||
mount /dev/mapper/luksroot /newroot | ||
else | ||
# mount the unencrypted root filesystem | ||
[ -d "/newroot" ] || mkdir -p /newroot | ||
mount ${ROOT_DEV}2 /newroot | ||
fi | ||
|
||
dmesg -n 1 | ||
echo -e '\033[?17;0;0c' > /dev/tty1 # magically make cursor disappear | ||
dd status=none if=/newroot/PrawnOS-$(cat /sys/class/graphics/fb0/virtual_size | tr ',' 'x') of=/dev/fb0 # write splash to framebuffer | ||
|
||
umount /sys | ||
umount /proc | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,16 +158,16 @@ CONFIG_NET_NS=y | |
# CONFIG_SYSFS_DEPRECATED is not set | ||
CONFIG_RELAY=y | ||
CONFIG_BLK_DEV_INITRD=y | ||
CONFIG_INITRAMFS_SOURCE="PrawnOS-initramfs.cpio.gz" | ||
CONFIG_INITRAMFS_SOURCE="PrawnOS-initramfs.cpio" | ||
CONFIG_INITRAMFS_ROOT_UID=0 | ||
CONFIG_INITRAMFS_ROOT_GID=0 | ||
CONFIG_RD_GZIP=y | ||
# CONFIG_RD_BZIP2 is not set | ||
# CONFIG_RD_LZMA is not set | ||
CONFIG_RD_XZ=y | ||
# CONFIG_RD_XZ is not set | ||
# CONFIG_RD_LZO is not set | ||
# CONFIG_RD_LZ4 is not set | ||
CONFIG_INITRAMFS_COMPRESSION=".gz" | ||
CONFIG_INITRAMFS_COMPRESSION="" | ||
# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set | ||
CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
CONFIG_SYSCTL=y | ||
|
@@ -5275,7 +5275,6 @@ CONFIG_SECURITYFS=y | |
CONFIG_SECURITY_NETWORK=y | ||
# CONFIG_SECURITY_NETWORK_XFRM is not set | ||
CONFIG_SECURITY_PATH=y | ||
CONFIG_LSM_MMAP_MIN_ADDR=32768 | ||
CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y | ||
CONFIG_HARDENED_USERCOPY=y | ||
CONFIG_HARDENED_USERCOPY_FALLBACK=y | ||
|
@@ -5302,8 +5301,7 @@ CONFIG_INTEGRITY=y | |
CONFIG_INTEGRITY_AUDIT=y | ||
# CONFIG_IMA is not set | ||
# CONFIG_EVM is not set | ||
CONFIG_DEFAULT_SECURITY_SELINUX=y | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't actually disable selinux, just changes when it is loaded. Instead of loading selinux then U DAC, it loads U DAC first. If this fixes the issue you are seeing, great, its a win-win. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see, you reverted the change that disabled SElinux and this config change stayed? |
||
# CONFIG_DEFAULT_SECURITY_DAC is not set | ||
CONFIG_DEFAULT_SECURITY_DAC=y | ||
CONFIG_LSM="yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor" | ||
|
||
# | ||
|
@@ -5589,7 +5587,7 @@ CONFIG_SBITMAP=y | |
# | ||
CONFIG_PRINTK_TIME=y | ||
# CONFIG_PRINTK_CALLER is not set | ||
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 | ||
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=1 | ||
CONFIG_CONSOLE_LOGLEVEL_QUIET=4 | ||
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 | ||
# CONFIG_BOOT_PRINTK_DELAY is not set | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -246,6 +246,13 @@ cp $build_resources_apt/deb.prawnos.com.gpg.key $outmnt/InstallResources/ | |
chroot $outmnt apt-key add /InstallResources/deb.prawnos.com.gpg.key | ||
chroot $outmnt apt update | ||
|
||
#Copy splash screen | ||
cp $build_resources/PrawnOS-* $outmnt/ | ||
|
||
#Copy /etc/issue | ||
mkdir -p $outmnt/etc/issue.d/ | ||
cp $build_resources/splash-recover-cursor.issue $outmnt/etc/issue.d/splash-recover-cursor.issue | ||
|
||
#Setup the locale | ||
cp $build_resources/locale.gen $outmnt/etc/locale.gen | ||
chroot $outmnt locale-gen | ||
|
@@ -314,6 +321,24 @@ echo -n "127.0.0.1 PrawnOS" > $outmnt/etc/hosts | |
#Cleanup apt retry | ||
chroot $outmnt rm -f /etc/apt/apt.conf.d/80-retries | ||
|
||
#Copy systemd config. This is on the end to make sure that no package overrides this | ||
cp $build_resources/system.conf $outmnt/etc/systemd/ | ||
|
||
#install hwdb file for iio-sensor-proxy to work | ||
printf 'sensor:modalias:platform:*\n ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1\n' > $outmnt/etc/udev/hwdb.d/61-sensor-local.hwdb | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see parts of this repeated in the buildFilesystem and the InstallPackages scripts, are both necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When i was testing, when it was only on buildFilesystem or InstallPackages it was either not working on system before installing, or after installing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh and it needs to be tested on kevin and bob |
||
chroot $outmnt systemd-hwdb update | ||
|
||
#make bootsplash not disappear again | ||
chroot $outmnt systemctl mask plymouth-start | ||
chroot $outmnt dpkg-reconfigure -f noninteractive console-setup | ||
grep -v setfont $outmnt/etc/console-setup/cached_setup_font.sh > /tmp/cached_setup_font.sh | ||
cp /tmp/cached_setup_font.sh $outmnt/etc/console-setup/cached_setup_font.sh | ||
|
||
mkdir -p $outmnt/opt/git/ | ||
cd $outmnt/opt/git/ | ||
rm -rf $outmnt/opt/git/c100pa-daemon | ||
git clone https://github.com/Maccraft123/c100pa-daemon.git $outmnt/opt/git/c100pa-daemon | ||
|
||
# do a non-error cleanup | ||
umount -l $outmnt > /dev/null 2>&1 | ||
rmdir $outmnt > /dev/null 2>&1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see some potential issues for debugging with how the splash is implemented, which would be fixed by the following:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Splash can be removed with just simple 'clear' shell command
And inserting device with RESCUESHELL label should be enough, it jumps to shell before splash screen