Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
T
TARDIS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
osak
TARDIS
Commits
96098c62
Commit
96098c62
authored
Feb 19, 2019
by
OSAK Buildhauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate grub config
parent
2d8e0983
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
149 additions
and
0 deletions
+149
-0
.gitignore
.gitignore
+1
-0
grub_config.sh
grub_config.sh
+44
-0
grub_template.cfg
grub_template.cfg
+104
-0
No files found.
.gitignore
View file @
96098c62
*.iso
grub_target.cfg
grub_config.sh
0 → 100755
View file @
96098c62
#!/bin/bash
function
extract_kernel
()
{
iso_file
=
"
$1
"
loopback
=
"
$(
mktemp
)
"
7z e
-so
"
$iso_file
"
boot/grub/loopback.cfg
>
"
$loopback
"
grep
-m
1
-o
"linux.*vmlinuz"
"
$loopback
"
|
awk
'{ print $2 }'
rm
"
$loopback
"
}
function
extract_initrd
()
{
iso_file
=
"
$1
"
loopback
=
"
$(
mktemp
)
"
7z e
-so
"
$iso_file
"
boot/grub/loopback.cfg
>
"
$loopback
"
grep
-m
1
-o
"initrd.*initrd
\S
*"
"
$loopback
"
|
awk
'{ print $2 }'
rm
"
$loopback
"
}
function
extract_release
()
{
iso_file
=
"
$1
"
flavor
=
"
$(
echo
"
$iso_file
"
|
cut
-d
"-"
-f
1
)
"
number
=
"
$(
echo
"
$iso_file
"
|
cut
-d
"-"
-f
2
)
"
echo
"
${
flavor
^
}
$number
"
# ^ capitalizes 1st letter
}
function
sed_grub_template
()
{
iso_file
=
"
$1
"
distribution_grep
=
"
$2
"
# KDE / XFCE
sed_target
=
"
$3
"
sed
"s|__
${
distribution_grep
}
_KERNEL__|
$(
extract_kernel
"
$iso_file
"
)
|g"
-i
"
$sed_target
"
sed
"s|__
${
distribution_grep
}
_INITRD__|
$(
extract_initrd
"
$iso_file
"
)
|g"
-i
"
$sed_target
"
sed
"s|__
${
distribution_grep
}
_RELEASE__|
$(
extract_release
"
$iso_file
"
)
|g"
-i
"
$sed_target
"
sed
"s|__
${
distribution_grep
}
_ISONAME__|
$iso_file
|g"
-i
"
$sed_target
"
}
kubuntu
=
kubuntu-18.04.1-desktop-amd64.iso
xubuntu
=
xubuntu-18.04.1-desktop-amd64.iso
grub_template
=
"grub_template.cfg"
grub_target
=
"grub_target.cfg"
cp
"
$grub_template
"
"
$grub_target
"
sed_grub_template
"
$kubuntu
"
"KDE"
"
$grub_target
"
sed_grub_template
"
$xubuntu
"
"XFCE"
"
$grub_target
"
grub_template.cfg
0 → 100644
View file @
96098c62
if loadfont /boot/grub/font.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
color yellow/black white/red
set pager=1
set gfxpayload=keep
function kde_LoadCasper {
loopback loop ($root)/${kde_isoname}
echo "Loading kernel"
linux (loop)__KDE_KERNEL__ boot=casper file=/isodevice/preseed/lip.seed ${cmdline} iso-scan/filename=/kubuntu.iso sysrq_always_enabled pstore.pstore_disable nosplash verbose --
echo "Loading initrd"
initrd (loop)__KDE_INITRD__
echo "Starting kernel"
}
function kde_menu {
menuentry "Empfohlen: ${kde_release} (deutsch)" {
set cmdline="debian-installer/language=de keyboard-configuration/layoutcode?=de"
kde_LoadCasper
}
menuentry "Recommended: ${kde_release} (english)" {
set cmdline=""
kde_LoadCasper
}
menuentry "${kde_release} (deutsch, failsafe)" {
set cmdline="debian-installer/locale=de_DE console-setup/layoutcode=de nomodeset noplymouth nosplash verbose text noacpi"
kde_LoadCasper
}
menuentry "${kde_release} (english, failsafe)" {
set cmdline="nomodeset noplymouth nosplash verbose text noacpi"
kde_LoadCasper
}
menuentry "${kde_release} (deutsch, ohne LIPNSA)" {
set cmdline="debian-installer/locale=de_DE console-setup/layoutcode=de fnord"
kde_LoadCasper
}
menuentry "${kde_release} (english, without LIPNSA)" {
set cmdline="fnord"
kde_LoadCasper
}
}
function xfce_LoadCasper {
loopback loop ($root)/${xfce_isoname}
echo "Loading kernel"
linux (loop)__XFCE_KERNEL__ boot=casper file=/isodevice/preseed/lip.seed ${cmdline} iso-scan/filename=/kubuntu.iso sysrq_always_enabled pstore.pstore_disable nosplash verbose --
echo "Loading initrd"
initrd (loop)__XFCE_INITRD__
echo "Starting kernel"
}
function xfce_menu {
menuentry "Empfohlen: ${xfce_release} (deutsch)" {
set cmdline="debian-installer/language=de keyboard-configuration/layoutcode?=de"
xfce_LoadCasper
}
menuentry "Recommended: ${xfce_release} (english)" {
set cmdline=""
xfce_LoadCasper
}
menuentry "${xfce_release} (deutsch, failsafe)" {
set cmdline="debian-installer/locale=de_DE console-setup/layoutcode=de nomodeset noplymouth nosplash verbose text noacpi"
xfce_LoadCasper
}
menuentry "${xfce_release} (english, failsafe)" {
set cmdline="nomodeset noplymouth nosplash verbose text noacpi"
xfce_LoadCasper
}
menuentry "${xfce_release} (deutsch, ohne LIPNSA)" {
set cmdline="debian-installer/locale=de_DE console-setup/layoutcode=de fnord"
xfce_LoadCasper
}
menuentry "${xfce_release} (english, without LIPNSA)" {
set cmdline="fnord"
xfce_LoadCasper
}
}
set kde_release="__KDE_RELEASE__"
set kde_isoname="__KDE_ISONAME__"
kde_menu
set xfce_release="__XFCE_RELEASE__"
set xfce_isoname="__XFCE_ISONAME__"
xfce_menu
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment