Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
initramfs-with-mca
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
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
nexedi
initramfs-with-mca
Commits
48c298da
Commit
48c298da
authored
Apr 15, 2022
by
Ophélie Gagnard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
installation/install.sh: Fix a bug: handle automatically initramfs image's name changes.
parent
5161d627
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
installation/install.sh
installation/install.sh
+16
-3
No files found.
installation/install.sh
View file @
48c298da
...
...
@@ -9,6 +9,13 @@ if [ ! -d dracut.module ]; then
fi
PROJECT_DIR
=
`
pwd
`
SOURCE_EFI_DIR
=
/boot/efi/EFI/
TARGET_EFI_DIR
=
/EFI/
SOURCE_EFI_DIR
=
`
realpath
-m
$SOURCE_EFI_DIR
`
TARGET_EFI_DIR
=
`
realpath
-m
$TARGET_EFI_DIR
`
SOURCE_IMAGE_DIR
=
$SOURCE_EFI_DIR
/Linux/
TARGET_IMAGE_DIR
=
$TARGET_EFI_DIR
/Linux/
dracut_output_file
=
dracut-output
# This script assumes to be run by the root user (with /sbin in the path).
...
...
@@ -43,10 +50,16 @@ e2label $TARGET_ROOT_PARTITION ROOT
efibootmgr
-b
0
-B
||
true
# Create an initramfs image
dracut
-c
./dracut.module/dracut.conf
--force
rm
-f
$dracut_output_file
dracut
-c
./dracut.module/dracut.conf
--force
|&
tee
-a
$dracut_output_file
# the next line parses dracut output and extracts the path of the newly generated image
uefi_image_name
=
`
grep
"Creating image file"
$dracut_output_file
|
sed
-E
"s|.*
$SOURCE_IMAGE_DIR
(.*)'.*|
\1
|g"
`
# Why? The boot manager seems to forget the boot option if this is not done.
cp
-r
/boot/efi/EFI /EFI
mkdir
-p
$TARGET_EFI_DIR
cp
-rv
$SOURCE_EFI_DIR
/
*
$TARGET_EFI_DIR
# Set the image as a boot option
efibootmgr
--create
--disk
$TARGET_EFI_PARTITION
--label
"test_deploy"
--loader
/EFI/Linux/linux-5.10.0-11-amd64-7148af38f67e4d3d98495ccf849b82f4.efi
efibootmgr
--create
--disk
$TARGET_EFI_PARTITION
--label
"test_deploy"
--loader
$TARGET_IMAGE_DIR
/
$uefi_image_name
echo
"New initramfs image: "
$TARGET_IMAGE_DIR
/
$uefi_image_name
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