Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Meißner
Scripts
Commits
7727d2ce
Commit
7727d2ce
authored
Jul 16, 2023
by
Florian Meißner
Browse files
Options
Downloads
Patches
Plain Diff
now running kernel version is detected and the right package gets selected automatically
parent
40dd04af
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
modprobe_old_kernel.sh
+13
-2
13 additions, 2 deletions
modprobe_old_kernel.sh
with
13 additions
and
2 deletions
modprobe_old_kernel.sh
+
13
−
2
View file @
7727d2ce
#!/usr/bin/env fish
# fancy select kernel version
set
kernel_pkg
(
ls
-1
/var/cache/pacman/pkg/linux
*
|
grep
-E
'(.*)linux[[:digit:]]+-[[:digit:]]+(.*)'
| fzf
)
# fancy select kernel versionx
set
cur_ver
(
uname
-r
| string match
-rg
"(
\d
+
\.\d
+
\.\d
+-
\d
+)"
)
echo
-n
Detected kernel version
' '
;
set_color brgreen
;
echo
$cur_ver
;
set_color normal
set
kernel_pkg
\
(
:
'list all packages in cache'
)
\
(
ls
-1
/var/cache/pacman/pkg/linux
*
\
(
:
'filter by `is-linux-kernel` _and_ `matches-current-kernel`'
)
\
|
grep
-E
'(.*)linux[[:digit:]]+-'
$cur_ver
'(.*)'
\
(
:
'filter out the signature file'
)
\
|
grep
-vE
'.sig'
\
(
:
'and prompt'
)
\
| fzf
)
# even fancier select kernel version
#set kernel_pkg (ls -1 | grep "linux-"(string replace "-MANJARO" "" (uname -r))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment