Skip to content

Commit

Permalink
Merge pull request #95 from mariux64/log-to-ttys0
Browse files Browse the repository at this point in the history
Log to ttys0
  • Loading branch information
donald authored Aug 7, 2019
2 parents 50556e5 + 13bf77c commit 837e755
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,5 @@ install_data misc_systemd_units/mxvlan.service "$DESTDIR$systemdunitd
mkdir -p "$DESTDIR$usr_prefix/share/applications"
install_data applications-defaults/defaults.list "$DESTDIR$usr_prefix/share/applications/defaults.list"
install_data misc_etc_files/modprobe.d/nfs_slotlimit.conf "$DESTDIR$sysconfdir/modprobe.d/nfs_slotlimit.conf"
install_data misc_systemd_units/crashkernel.service "$DESTDIR$systemdunitdir/crashkernel.service"
exit
14 changes: 14 additions & 0 deletions misc_systemd_units/crashkernel.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=load crashkernel
ConditionPathExists=/boot/bzImage.crash

[Service]
StandardOutput=kmsg
StandardError=kmsg
Type=oneshot
ExecStart=/usr/sbin/kexec -p /boot/bzImage.crash --initrd=/boot/grub/initramfs.igz --command-line="root=LABEL=root ro console=ttyS0,115200n8 console=ttyS1,115200n8 console=tty0 irqpoll maxcpus=1 reset_devices CRASH"
ExecStop=/usr/sbin/kexec -p -u
RemainAfterExit=yes

[Install]
WantedBy=basic.target
10 changes: 6 additions & 4 deletions mxgrub/mxgrub
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,16 @@ sub scan_mariux {
}
}

our $KERNEL_PARAMETER="ro crashkernel=256M console=ttyS0,115200n8 console=ttyS1,115200n8 console=tty0 init=/bin/systemd audit=0";

sub update_grub_cfg {
my $kernellist='';

@MARIUX or die "internal error: scan_mariux() not called\n";

for my $label (@MARIUX) {
my $image=label_to_image($label);
$kernellist.="\tmenuentry \"$label\" --unrestricted { save_env chosen ; linux /boot/$image crashkernel=256M root=LABEL=root ro console=ttyS1,115200n8 console=tty0 init=/bin/systemd audit=0 ; initrd /boot/grub/initramfs.igz }\n";
$kernellist.="\tmenuentry \"$label\" --unrestricted { save_env chosen ; linux /boot/$image crashkernel=256M root=LABEL=root ro console=ttyS0,115200n8 console=ttyS1,115200n8 console=tty0 init=/bin/systemd audit=0 ; initrd /boot/grub/initramfs.igz }\n";
}

my $GRUB_CFG_NEW=<<"EOF";
Expand All @@ -263,10 +265,10 @@ insmod all_video
if [ -e /etc/local/USB.usb ]; then
set default="mariuxUSB"
menuentry "mariuxUSB" --unrestricted { save_env chosen ; linux /boot/bzImage.x86_64 crashkernel=256M root=LABEL=rootusb ro init=/bin/systemd audit=0 ; initrd /boot/grub/initramfs.igz }
menuentry "mariuxUSB" --unrestricted { save_env chosen ; linux /boot/bzImage.x86_64 root=LABEL=rootusb $KERNEL_PARAMETER ; initrd /boot/grub/initramfs.igz }
else
menuentry "$MARIUX_DEFAULT" --unrestricted { set chosen="$submenu>$MARIUX_DEFAULT" ; save_env chosen ; linux /boot/bzImage.x86_64 crashkernel=256M root=LABEL=root ro console=ttyS1,115200n8 console=tty0 init=/bin/systemd audit=0 ; initrd /boot/grub/initramfs.igz }
menuentry "$MARIUX_DEFAULT" --unrestricted { set chosen="$submenu>$MARIUX_DEFAULT" ; save_env chosen ; linux /boot/bzImage.x86_64 root=LABEL=root $KERNEL_PARAMETER ; initrd /boot/grub/initramfs.igz }
submenu "$submenu" --unrestricted {
$kernellist
Expand Down Expand Up @@ -358,7 +360,7 @@ sub cmd_reboot {
my $image=label_to_image($chosen);
-e "/boot/$image" or die "/boot/$image: no such file\n";
sys('sync');
sys('kexec',"/boot/$image",'--reuse-cmdline','--initrd=/boot/grub/initramfs.igz');
sys('kexec',"/boot/$image",'--initrd=/boot/grub/initramfs.igz',"--command-line=root=LABEL=root $KERNEL_PARAMETER");
}

umask 022;
Expand Down

0 comments on commit 837e755

Please sign in to comment.