Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TARDIS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osak
TARDIS
Commits
96098c62
Commit
96098c62
authored
6 years ago
by
OSAK Buildhauer
Browse files
Options
Downloads
Patches
Plain Diff
Generate grub config
parent
2d8e0983
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
grub_config.sh
+44
-0
44 additions, 0 deletions
grub_config.sh
grub_template.cfg
+104
-0
104 additions, 0 deletions
grub_template.cfg
with
149 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
96098c62
*.iso
grub_target.cfg
This diff is collapsed.
Click to expand it.
grub_config.sh
0 → 100755
+
44
−
0
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
"
This diff is collapsed.
Click to expand it.
grub_template.cfg
0 → 100644
+
104
−
0
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
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