Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
manjaro-architect
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
61
Issues
61
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
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
Applications
manjaro-architect
Commits
7ed6e643
Commit
7ed6e643
authored
Feb 09, 2019
by
Matti Hyttinen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run most grub commands inside a script
parent
4a1654bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
19 deletions
+9
-19
lib/util-base.sh
lib/util-base.sh
+9
-19
No files found.
lib/util-base.sh
View file @
7ed6e643
...
...
@@ -388,16 +388,6 @@ install_grub_uefi() {
clear
mkdir
/mnt/hostlvm
mount
--bind
/run/lvm /mnt/hostlvm
manjaro-chroot /mnt
"ln -s /hostlvm /run/lvm"
if
$(
mount |
awk
'$3 == "/mnt" {print $0}'
|
grep
btrfs |
grep
-qv
subvolid
=
5
)
;
then
basestrap
${
MOUNTPOINT
}
grub-btrfs efibootmgr dosfstools 2>
$ERR
check_for_error
"
$FUNCNAME
grub"
$?
||
return
1
else
basestrap
${
MOUNTPOINT
}
grub efibootmgr dosfstools 2>
$ERR
check_for_error
"
$FUNCNAME
grub"
$?
||
return
1
fi
#DIALOG " $_InstGrub " --infobox "\n$_PlsWaitBody\n " 0 0
# if root is encrypted, amend /etc/default/grub
root_name
=
$(
mount |
awk
'/\/mnt / {print $1}'
|
sed
s~/dev/mapper/~~g |
sed
s~/dev/~~g
)
...
...
@@ -418,9 +408,9 @@ install_grub_uefi() {
echo
ZPOOL_VDEV_NAME_PATH
=
YES
>>
${
MOUNTPOINT
}
/etc/environment
export
ZPOOL_VDEV_NAME_PATH
=
YES
# there has to be a better way to do this
echo
-e
"# "
'!'
"/bin/bash
\n
export ZPOOL_VDEV_NAME_PATH=YES
\n
grub-install --target=x86_64-efi --efi-directory=
${
UEFI_MOUNT
}
--bootloader-id=
${
bootid
}
--recheck
"
>
${
MOUNTPOINT
}
/usr/bin/grub_installer.sh
echo
-e
"# "
'!'
"/bin/bash
\n
ln -s /hostlvm /run/lvm
\n
pacman -S --noconfirm --needed grub efibootmgr dosfstools grub-btrfs
\n
export ZPOOL_VDEV_NAME_PATH=YES
\n
grub-install --target=x86_64-efi --efi-directory=
${
UEFI_MOUNT
}
--bootloader-id=
${
bootid
}
--recheck
\n
pacman -S --noconfirm grub-theme-manjaro
"
>
${
MOUNTPOINT
}
/usr/bin/grub_installer.sh
else
echo
-e
"# "
'!'
"/bin/bash
\n
grub-install --target=x86_64-efi --efi-directory=
${
UEFI_MOUNT
}
--bootloader-id=
${
bootid
}
--recheck
"
>
${
MOUNTPOINT
}
/usr/bin/grub_installer.sh
echo
-e
"# "
'!'
"/bin/bash
\n
ln -s /hostlvm /run/lvm
\n
pacman -S --noconfirm --needed grub efibootmgr dosfstools grub-btrfs
\n
grub-install --target=x86_64-efi --efi-directory=
${
UEFI_MOUNT
}
--bootloader-id=
${
bootid
}
--recheck
\n
pacman -S --noconfirm grub-theme-manjaro
"
>
${
MOUNTPOINT
}
/usr/bin/grub_installer.sh
fi
[[
-f
${
MOUNTPOINT
}
/usr/bin/grub_installer.sh
]]
&&
chmod
a+x
${
MOUNTPOINT
}
/usr/bin/grub_installer.sh
...
...
@@ -429,21 +419,20 @@ install_grub_uefi() {
if
[[
"
$(
cat
/sys/block/
${
root_device
}
/removable
)
"
==
1
]]
;
then
sed
-e
'/^grub-install /s/$/ --removable/g'
-i
${
MOUNTPOINT
}
/usr/bin/grub_installer.sh
fi
# If the root is on btrfs-subvolume, amend grub installation
if
!
$(
mount |
awk
'$3 == "/mnt" {print $0}'
|
grep
btrfs |
grep
-qv
subvolid
=
5
)
;
then
sed
-e
's/ grub-btrfs//g'
-i
${
MOUNTPOINT
}
/usr/bin/grub_installer.sh
fi
#install grub
arch_chroot
"grub_installer.sh"
2>
$ERR
check_for_error
"grub-install --target=x86_64-efi"
$?
umount /mnt/hostlvm
# the grub_installer is no longer needed - there still needs to be a better way to do this
[[
-f
${
MOUNTPOINT
}
/usr/bin/grub_installer.sh
]]
&&
rm
${
MOUNTPOINT
}
/usr/bin/grub_installer.sh
# If root is on btrfs volume, amend grub
[[
$(
findmnt
-no
FSTYPE
${
MOUNTPOINT
}
)
==
"btrfs"
]]
&&
\
sed
-e
'/GRUB_SAVEDEFAULT/ s/^#*/#/'
-i
${
MOUNTPOINT
}
/etc/default/grub
# Enble manjaro grub theme
basestrap
${
MOUNTPOINT
}
grub-theme-manjaro 2>
$ERR
check_for_error
"
$FUNCNAME
grub"
$?
[[
$(
findmnt
-no
FSTYPE
${
MOUNTPOINT
}
)
==
"btrfs"
]]
&&
sed
-e
'/GRUB_SAVEDEFAULT/ s/^#*/#/'
-i
${
MOUNTPOINT
}
/etc/default/grub
# Ask if user wishes to set Grub as the default bootloader and act accordingly
DIALOG
"
$_InstUefiBtTitle
"
--yesno
"
\n
$_SetBootDefBody
${
UEFI_MOUNT
}
/EFI/boot
$_SetBootDefBody2
\n
"
0 0
...
...
@@ -457,6 +446,7 @@ install_grub_uefi() {
}
install_refind
()
{
DIALOG
"
$_InstUefiBtTitle
"
--yesno
"
\n
$_InstRefindBody
\n
"
0 0
||
return
0
...
...
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