diff --git a/install.sh b/install.sh index 1718ab9..58c140c 100755 --- a/install.sh +++ b/install.sh @@ -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 diff --git a/misc_systemd_units/crashkernel.service b/misc_systemd_units/crashkernel.service new file mode 100644 index 0000000..26695c0 --- /dev/null +++ b/misc_systemd_units/crashkernel.service @@ -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 diff --git a/mxgrub/mxgrub b/mxgrub/mxgrub index b0f81e1..d88b79c 100755 --- a/mxgrub/mxgrub +++ b/mxgrub/mxgrub @@ -239,6 +239,8 @@ 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=''; @@ -246,7 +248,7 @@ sub update_grub_cfg { 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"; @@ -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 @@ -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;