forked from calculate/calculate-overlay
parent
03bb48440c
commit
a7feddfbf2
@ -1 +1 @@
|
||||
# Calculate append=skip merge(media-gfx/splash-themes-calculate)!= merge=media-gfx/splashutils
|
||||
# Calculate append=skip merge(media-gfx/splash-themes-calculate)!= merge=media-gfx/splashutils,sys-boot/grub
|
||||
|
@ -0,0 +1 @@
|
||||
# Calculate append=skip cl_ver>=3.3.1&&pkg(media-gfx/splash-themes-calculate)<14.16
|
@ -0,0 +1 @@
|
||||
# Calculate append=skip cl_ver>=3.3.1&&pkg(media-gfx/splash-themes-calculate)>=14.16
|
@ -0,0 +1,76 @@
|
||||
# Calculate exec=/bin/bash ac_install_disk==off&&ac_install_unmerge==off&&pkg(sys-kernel/dracut)!=&&os_install_root_type!=livecd
|
||||
#!/bin/bash
|
||||
|
||||
source /usr/share/grub/grub-mkconfig_lib
|
||||
|
||||
get_latest_kernel() {
|
||||
version_find_latest /boot/vmlinuz-*
|
||||
}
|
||||
|
||||
get_safemode_name() {
|
||||
local kernel=$1
|
||||
#echo ${kernel/-calculate/-SafeMode}
|
||||
[[ $kernel =~ ^([^-]+-[^-]+)-(.+)$ ]] && echo "${BASH_REMATCH[1]}-SafeMode-${BASH_REMATCH[2]}" || echo ${kernel}
|
||||
}
|
||||
|
||||
get_kernel_version() {
|
||||
local kernel=$1
|
||||
file -L $kernel | sed -r 's/.*version (\S+)\s+.*/\1/'
|
||||
}
|
||||
|
||||
get_kernel_initramfs() {
|
||||
local kernel=$1
|
||||
echo ${kernel/vmlinuz-/initramfs-}.img
|
||||
}
|
||||
|
||||
is_calculate_kernel() {
|
||||
local kernel=$1
|
||||
local kernel_version=$(get_kernel_version $kernel)
|
||||
[[ -f /usr/src/linux-${kernel_version}/.calculate ]]
|
||||
}
|
||||
|
||||
die() {
|
||||
echo $@ 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
create_hostonly_initramfs() {
|
||||
local kernel_safemode=$(get_safemode_name $kernel)
|
||||
local initrd=$(get_kernel_initramfs $kernel)
|
||||
local initrd_tmp=$(get_kernel_initramfs $kernel).tmp
|
||||
local initrd_safemode=$(get_safemode_name $initrd)
|
||||
|
||||
[[ -e $kernel_safemode ]] || (rm -f $kernel_safemode;ln -s $kernel $kernel_safemode &>/dev/null) ||
|
||||
die "Failed to create kernel for safemode"
|
||||
|
||||
if ! [[ -e $initrd_safemode ]]
|
||||
then
|
||||
cp $initrd $initrd_safemode &>/dev/null || die "Failed to create initramfs safemode backup"
|
||||
fi
|
||||
if [[ -e $initrd_safemode ]]
|
||||
then
|
||||
local kernel_version=$(get_kernel_version $kernel)
|
||||
[[ -n $kernel_version ]] || die "Failed to detect version"
|
||||
echo "Creating Host-Only initramfs ..."
|
||||
#?os_install_x11_video_drv==#-os_x11_video_drv-##
|
||||
dracut -H -f --kver $kernel_version $initrd_tmp &>/dev/null ||
|
||||
die "Failed to create Host-Only initramfs"
|
||||
#os_install_x11_video_drv#
|
||||
#?os_install_x11_video_drv!=#-os_x11_video_drv-##
|
||||
dracut -H -f --add-drivers="i915 uvesafb radeon nouveau" --kver $kernel_version $initrd_tmp &>/dev/null ||
|
||||
die "Failed to create Host-Only initramfs"
|
||||
#os_install_x11_video_drv#
|
||||
mv $initrd_tmp $initrd &>/dev/null || die "Failed to rename initramfs"
|
||||
echo "Host-Only initramfs has been created"
|
||||
fi
|
||||
}
|
||||
|
||||
kernel=$(get_latest_kernel)
|
||||
|
||||
if [[ -e $kernel ]] && [[ -e $(get_kernel_initramfs $kernel) ]]
|
||||
then
|
||||
is_calculate_kernel $kernel && create_hostonly_initramfs $kernel
|
||||
else
|
||||
echo "Creating Host-Only initramfs was skipped"
|
||||
fi
|
||||
exit 0
|
@ -0,0 +1,28 @@
|
||||
# Calculate format=openrc path=/etc/default name=grub os_install_root_type!=usb-hdd&&in(os_install_x11_video_drv,other,default)==
|
||||
#?os_install_linux_system==desktop&&kernel(zswap)==y#
|
||||
GRUB_CMDLINE_LINUX="zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=30 video=#-os_install_fb_resolution-# #-os_install_kernel_resume-# elevator=#-os_install_kernel_scheduler-# #-os_install_kernel_attr-# calculate=video:#-os_install_x11_video_drv-# splash=silent,theme:calculate console=tty1 quiet"
|
||||
#os_install_linux_system#
|
||||
#?os_install_linux_system!=desktop||kernel(zswap)!=y#
|
||||
GRUB_CMDLINE_LINUX="video=#-os_install_fb_resolution-# #-os_install_kernel_resume-# elevator=#-os_install_kernel_scheduler-# #-os_install_kernel_attr-# calculate=video:#-os_install_x11_video_drv-# splash=silent,theme:calculate console=tty1 quiet"
|
||||
#os_install_linux_system#
|
||||
GRUB_GFXMODE="#-os_install_fb_resolution-#"
|
||||
|
||||
#?os_install_linux_subname==&&os_install_scratch==off#
|
||||
GRUB_DISTRIBUTOR="#-os_install_linux_name-#"
|
||||
#os_install_linux_subname#
|
||||
#?os_install_linux_subname!=&&os_install_scratch==off#
|
||||
GRUB_DISTRIBUTOR="#-os_install_linux_name-# #-os_install_linux_subname-#"
|
||||
#os_install_linux_subname#
|
||||
#?os_install_linux_subname==&&os_install_scratch==on#
|
||||
GRUB_DISTRIBUTOR="#-os_install_linux_name-# Builder"
|
||||
#os_install_linux_subname#
|
||||
#?os_install_linux_subname!=&&os_install_scratch==on#
|
||||
GRUB_DISTRIBUTOR="#-os_install_linux_name-# #-os_install_linux_subname-# Builder"
|
||||
#os_install_linux_subname#
|
||||
|
||||
#?os_install_grub_terminal==console#
|
||||
GRUB_TERMINAL=console
|
||||
#os_install_grub_terminal#
|
||||
#?os_install_grub_terminal==gfxterm#
|
||||
!GRUB_TERMINAL=
|
||||
#os_install_grub_terminal#
|
@ -0,0 +1,28 @@
|
||||
# Calculate format=openrc path=/etc/default name=grub os_install_root_type!=usb-hdd&&in(os_install_x11_video_drv,other,default)!=
|
||||
#?os_install_linux_system==desktop&&kernel(zswap)==y#
|
||||
GRUB_CMDLINE_LINUX="zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=30 video=#-os_install_fb_resolution-# #-os_install_kernel_resume-# elevator=#-os_install_kernel_scheduler-# #-os_install_kernel_attr-# splash=silent,theme:calculate console=tty1 quiet"
|
||||
#os_install_linux_system#
|
||||
#?os_install_linux_system!=desktop||kernel(zswap)!=y#
|
||||
GRUB_CMDLINE_LINUX="video=#-os_install_fb_resolution-# #-os_install_kernel_resume-# elevator=#-os_install_kernel_scheduler-# #-os_install_kernel_attr-# splash=silent,theme:calculate console=tty1 quiet"
|
||||
#os_install_linux_system#
|
||||
GRUB_GFXMODE="#-os_install_fb_resolution-#"
|
||||
|
||||
#?os_install_linux_subname==&&os_install_scratch==off#
|
||||
GRUB_DISTRIBUTOR="#-os_install_linux_name-#"
|
||||
#os_install_linux_subname#
|
||||
#?os_install_linux_subname!=&&os_install_scratch==off#
|
||||
GRUB_DISTRIBUTOR="#-os_install_linux_name-# #-os_install_linux_subname-#"
|
||||
#os_install_linux_subname#
|
||||
#?os_install_linux_subname==&&os_install_scratch==on#
|
||||
GRUB_DISTRIBUTOR="#-os_install_linux_name-# Builder"
|
||||
#os_install_linux_subname#
|
||||
#?os_install_linux_subname!=&&os_install_scratch==on#
|
||||
GRUB_DISTRIBUTOR="#-os_install_linux_name-# #-os_install_linux_subname-# Builder"
|
||||
#os_install_linux_subname#
|
||||
#
|
||||
#?os_install_grub_terminal==console#
|
||||
GRUB_TERMINAL=console
|
||||
#os_install_grub_terminal#
|
||||
#?os_install_grub_terminal==gfxterm#
|
||||
!GRUB_TERMINAL=
|
||||
#os_install_grub_terminal#
|
@ -0,0 +1,29 @@
|
||||
# Calculate format=openrc path=/etc/default name=grub os_install_root_type==usb-hdd
|
||||
#?os_install_linux_system==desktop&&kernel(zswap)==y#
|
||||
GRUB_CMDLINE_LINUX="zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=30 video=#-os_install_fb_resolution-# #-os_install_kernel_resume-# elevator=#-os_install_kernel_scheduler-# #-os_install_kernel_attr-# calculate=video:#-os_install_x11_video_drv-# splash=silent,theme:calculate console=tty1 quiet"
|
||||
#os_install_linux_system#
|
||||
#?os_install_linux_system!=desktop||kernel(zswap)!=y#
|
||||
GRUB_CMDLINE_LINUX="video=#-os_install_fb_resolution-# #-os_install_kernel_resume-# elevator=#-os_install_kernel_scheduler-# #-os_install_kernel_attr-# calculate=video:#-os_install_x11_video_drv-# splash=silent,theme:calculate console=tty1 quiet"
|
||||
#os_install_linux_system#
|
||||
GRUB_GFXMODE="#-os_install_fb_resolution-#"
|
||||
|
||||
#?os_install_linux_subname==&&os_install_scratch==off#
|
||||
GRUB_DISTRIBUTOR="#-os_install_linux_name-#"
|
||||
#os_install_linux_subname#
|
||||
#?os_install_linux_subname!=&&os_install_scratch==off#
|
||||
GRUB_DISTRIBUTOR="#-os_install_linux_name-# #-os_install_linux_subname-#"
|
||||
#os_install_linux_subname#
|
||||
#?os_install_linux_subname==&&os_install_scratch==on#
|
||||
GRUB_DISTRIBUTOR="#-os_install_linux_name-# Builder"
|
||||
#os_install_linux_subname#
|
||||
#?os_install_linux_subname!=&&os_install_scratch==on#
|
||||
GRUB_DISTRIBUTOR="#-os_install_linux_name-# #-os_install_linux_subname-# Builder"
|
||||
#os_install_linux_subname#
|
||||
GRUB_DISABLE_OS_PROBER=true
|
||||
#
|
||||
#?os_install_grub_terminal==console#
|
||||
GRUB_TERMINAL=console
|
||||
#os_install_grub_terminal#
|
||||
#?os_install_grub_terminal==gfxterm#
|
||||
!GRUB_TERMINAL=
|
||||
#os_install_grub_terminal#
|
@ -1 +0,0 @@
|
||||
# Calculate append=skip cl_ver>=3.3.1
|
Loading…
Reference in new issue