Skip to content
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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

Maccraft123
Copy link

This needs to be tested on arm64 hardware and dumps of 1280x800, 1366x768 and 2400x1600 of splash have to be taken

@gregordinary
Copy link
Contributor

Note: I don't have an arm64 chromebook to test with. I do have a NanoPi m4-v2 (RK3399-based) SBC, but I don't think that board is supported here. Still, wanted to try compiling for ARM-64 just to see the process as last time I compiled PrawnOS, this wasn't an option.

Anyway, tried compiling for arm64, first with @Maccraft123 's branch directly and got the following error:

+ mkdir brcm
+ cp /home/USERNAME/Development/git/ShrimpOS/kernel/resources/arm64/brcmfmac4354-sdio.bin brcm/
cp: cannot stat '/home/USERNAME/Development/git/ShrimpOS/kernel/resources/arm64/brcmfmac4354-sdio.bin': No such file or directory
make[1]: *** [/home/USERNAME/Development/git/ShrimpOS/kernel/makefile:68: /home/USERNAME/Development/git/ShrimpOS/build/arm64/linux/vmlinux.kpart] Error 1
make[1]: Leaving directory '/home/USERNAME/Development/git/ShrimpOS'
make: *** [makefile:89: image] Error 2

Tried again using the main repo from @SolidHal creating a local branch from this Pull Request (probably the right way to do this, I'm learning) and received the following:

1+0 records in
1+0 records out
512 bytes copied, 0.000100901 s, 5.1 MB/s
+ vbutil_kernel --pack vmlinux.kpart --version 1 --vmlinuz vmlinux.uimg --arch aarch64 --keyblock /usr/share/vboot/devkeys/kernel.keyblock --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk --config /home/USERNAME/Development/git/PrawnOS/kernel/resources/arm64/cmdline --bootloader bootloader.bin
+ RESULT=0
+ '[' '!' 0 -eq 0 ']'
++ stat -c %s vmlinux.kpart
+ KERNEL_SIZE=35241984
+ '[' 35241984 -gt 33554432 ']'
+ mv vmlinux.kpart oversized_vmlinux.kpart
+ echo 'kernel larger than max kernel size!'
kernel larger than max kernel size!
+ exit 1
make[1]: *** [/home/USERNAME/Development/git/PrawnOS/kernel/makefile:117: /home/USERNAME/Development/git/PrawnOS/build/arm64/linux-5.7.10/vmlinux.kpart] Error 1
make[1]: Leaving directory '/home/USERNAME/Development/git/PrawnOS'
make: *** [makefile:89: image] Error 2

Might the issue be from removing gzip compression?

@Maccraft123
Copy link
Author

Oh it barely doesn't fit.
PrawnOS works only on devices that boot with depthcharge, so it won't work on any SBC that doesn't run coreboot.

@Maccraft123
Copy link
Author

I think that to fix this someone with arm64 chromebooks should remove some kernel config options to decrease space requirements and test if it still works fine

@Maccraft123
Copy link
Author

Update: blocked until #216 is merged

@SolidHal
Copy link
Owner

I'm not surprised we went over, I made the config quite sparse and it just barely fit.

@Maccraft123
Copy link
Author

I guess it's time to do kernel module support

@SolidHal
Copy link
Owner

kernel size bump is merged, pulling this to test

@SolidHal
Copy link
Owner

on an armhf build I get prompted for the following:

scripts/kconfig/conf  --syncconfig Kconfig
*
* Restart config...
*
*
* printk and dmesg options
*
Show timing information on printks (PRINTK_TIME) [Y/n/?] y
Show caller information on printks (PRINTK_CALLER) [N/y/?] n
Default console loglevel (1-15) (CONSOLE_LOGLEVEL_DEFAULT) [7] (NEW)

looks like this PR sets it to 0, which is not a valid value

that said, it looks like we manage the console log level in the initramfs, so is this needed?

@SolidHal
Copy link
Owner

Could I get some insight into why we want these systemd settings? We might need to implement these settings in a different way, as the file will get overwritten anytime the systemd package is updated.

@Maccraft123
Copy link
Author

Maccraft123 commented Sep 17, 2020

Those settings are needed to silence systemd because any write to tty overwrites splash
And initramfs loglevel sometimes doesn't work

@gdallasdye
Copy link
Contributor

Quick questions:

Is disabling selinux necessary? I do have some selinux troubleshooting experience, have seen plymouth boot screens on selinux, and have a preference for keeping selinux enabled as it's mandatory access controls help maintain security when the old fashioned discretionary aces controls fail. I could go on for hours about selinx btw...

And is this some kind of workaround to implement plymouth boot screens in the PrawnOS initrd system? Since as we know, Debian's initrd generator doesn't support depthcharge targets. If so, this could help me use the plymouth-spinner-theme while booting, which has been a goal :)

Taking a look here it would seem like the system.conf file should be place in /etc/systemd/system.conf.d/system.conf You'll want to tell the script to mkdir -p that directory, then change the folder it gets copied to.

Would you also mind creating another branch and post screenshots and camera pictures to visually documenting the changes? A few weeks ago I made a branch called readme-minor-changes, which implies a future branch with bigger changes. But that's another topic for another day.

@Maccraft123
Copy link
Author

Selinux displays some error message about some file not found, that overwrites part of splash.
And this is NOT plymouth. I made a youttube video displaying how it looks with gdm, https://youtu.be/Ha1-sOUqaDY
With other display managers it will work same way. I can make some pictures after it gets merged.

@Maccraft123
Copy link
Author

About selinux concerns: I've reverted commit that disables it.

#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
Copy link
Owner

Choose a reason for hiding this comment

The 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?

Copy link
Author

Choose a reason for hiding this comment

The 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
It may be due to its old age, or bad quality, either way, it won't hurt i think

@@ -17,11 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.

Copy link
Owner

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:

  1. some way to disable the splash and instead get all of the console output/debug echos. Doing this without rebuilding the kernel and initramfs would be nice. I'm not sure if this is possible though...
  2. keep the debug logging if we are not presenting the splash screen
  3. the fix for (2) needs to ensure that if we do enter the rescue_shell, we print out the debug messages

Copy link
Author

@Maccraft123 Maccraft123 Sep 22, 2020

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

filesystem/resources/issue Outdated Show resolved Hide resolved
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
Copy link
Owner

Choose a reason for hiding this comment

The 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?

Copy link
Author

Choose a reason for hiding this comment

The 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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh and it needs to be tested on kevin and bob

@@ -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
Copy link
Owner

Choose a reason for hiding this comment

The 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.

Copy link
Owner

Choose a reason for hiding this comment

The 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?

@SolidHal
Copy link
Owner

hm, I got prompted to set LSM_MMAP_MIN_ADDR on the armhf build

@SolidHal
Copy link
Owner

tested this on my c201 and got dropped right into the initramfs errr shell

@Maccraft123
Copy link
Author

oops

@SolidHal
Copy link
Owner

tested the image built here by the PR automation, definitely doesn't work. something goes wrong int the initramfs. @Maccraft123 if you leave this long enough, I will get around to debugging it for you hahaha.

@ghost
Copy link

ghost commented Sep 30, 2020

Sorry if im on the wrong track here, but i don't think all those suppressed log levels are needed. For FB-Coding you can tell the bootsplash program (whatever is used) to claim the framebuffer as a graphical console and thus silence all console messages like this:

	int tty_fd = open("/dev/tty0", O_RDWR);
	ioctl(tty_fd,KDSETMODE,KD_GRAPHICS);

	//At exit:
	ioctl(tty_fd,KDSETMODE,KD_TEXT);

in ubuntu the splashscreen can be disabled with a simple press on ESC.

I like this solution more because we can handle decrypting the root partition in a similiar nice manner and will give it a try.

@SolidHal
Copy link
Owner

Seems stock plymouth works just fine with depthcharge. Seems reasonable to attempt to implement the logo in plymouth if work picks back up on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants