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
bec7d795
Commit
bec7d795
authored
Sep 28, 2022
by
Ophélie Gagnard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generation: Clean up the code.
parent
40651b56
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
30 deletions
+7
-30
generation/00env.sh
generation/00env.sh
+0
-21
generation/20generate-image.sh
generation/20generate-image.sh
+7
-9
No files found.
generation/00env.sh
View file @
bec7d795
...
...
@@ -18,29 +18,8 @@ SIGNING_KEY_NAME=db.key
MCA_NAME_AND_VERSION
=
${
MCA_PACKAGE_NAME
}
_
${
MCA_VERSION
}
FLB_NAME_AND_VERSION
=
${
FLB_PACKAGE_NAME
}
_
${
FLB_VERSION
}
# used mainly in installation/dependencies.sh and installation/remove-dependencies.sh
APT_UTILITY_PACKAGES
=
"sudo wget tree"
APT_SPECIFIC_PACKAGES
=
"dracut-core dracut dracut-network"
MCA_PACKAGE_FILE
=
${
MCA_NAME_AND_VERSION
}
_amd64.deb
FLB_PACKAGE_FILE
=
${
FLB_NAME_AND_VERSION
}
_amd64.deb
URL_PATTERN
=
"https://download.opensuse.org/repositories/home:VIFIBnexedi/Debian_11/amd64/"
MCA_PACKAGE_URL
=
${
URL_PATTERN
}
/
${
MCA_PACKAGE_FILE
}
FLB_PACKAGE_URL
=
${
URL_PATTERN
}
/
${
FLB_PACKAGE_FILE
}
# used mainly in installation/install.sh and installation/uninstall.sh
EFI_PARTITION_MOUNT_POINT
=
/boot/efi/
RELATIVE_EFI_IMAGE_DIR
=
/EFI/Linux/
EFI_IMAGE_DIR
=
${
EFI_PARTITION_MOUNT_POINT
}
/
${
RELATIVE_EFI_IMAGE_DIR
}
EFI_PARITITON_MOUNT_POINT
=
$(
realpath
-m
"
$EFI_PARTITION_MOUNT_POINT
"
)
RELATIVE_EFI_IMAGE_DIR
=
$(
realpath
-m
"
$RELATIVE_EFI_IMAGE_DIR
"
)
EFI_IMAGE_DIR
=
$(
realpath
-m
"
$EFI_IMAGE_DIR
"
)
dracut_output_file
=
dracut-output
# used mainly in uefi-keys/make_keys.sh
CERT_DIR
=
uefi-keys/public-certificates
KEYS_DIR
=
uefi-keys/private-keys
PUBLIC_CERT_DIR
=
${
PROJECT_DIR
}
/
${
CERT_DIR
}
/
${
SERVER_GROUP
}
PRIVATE_KEYS_DIR
=
${
PROJECT_DIR
}
/
${
KEYS_DIR
}
/
${
SERVER_GROUP
}
PUBLIC_CERT_DIR
=
$(
realpath
-m
"
$PUBLIC_CERT_DIR
"
)
PRIVATE_KEYS_DIR
=
$(
realpath
-m
"
$PRIVATE_KEYS_DIR
"
)
generation/20generate-image.sh
View file @
bec7d795
...
...
@@ -105,11 +105,9 @@ get_default_netmask () {
int_to_generic_netmask
()
{
# get the mask size: the number right after the "/" (ex: <ipv4>/24 -> 24)
#mask_length=$(get_default_netmask | awk -F / '{print $2}')
mask_length
=
$1
mask
=
""
for
i
in
{
0..3
}
;
do
#while [ $mask_length -gt 0 ]; do
if
[
${
mask_length
}
-ge
8
]
;
then
mask
=
${
mask
}
255
elif
[
${
mask_length
}
-eq
0
]
;
then
...
...
@@ -125,6 +123,12 @@ int_to_generic_netmask () {
echo
-e
"
${
mask
}
"
}
CERT_DIR
=
uefi-keys/public-certificates
KEYS_DIR
=
uefi-keys/private-keys
PUBLIC_CERT_DIR
=
${
PROJECT_DIR
}
/
${
CERT_DIR
}
/
${
SERVER_GROUP
}
PRIVATE_KEYS_DIR
=
${
PROJECT_DIR
}
/
${
KEYS_DIR
}
/
${
SERVER_GROUP
}
uefi_image_name
=
"
$(
uname
-s
|
tr
'[:upper:]'
'[:lower:]'
)
-
$(
uname
-r
)
_
${
MCA_NAME_AND_VERSION
}
_
${
FLB_NAME_AND_VERSION
}
_
${
SERVER_GROUP
}
_
${
TARGET_HOSTNAME
}
"
.efi
dracut_output_file
=
dracut-output
# Install the module
cd
dracut.module
...
...
@@ -139,13 +143,7 @@ cd dracut.module
sed
"
${
dracut_conf_regex
}
"
dracut.conf.in
>
dracut.conf
cd
-
uefi_image_name
=
echo
"
$(
tr
'[:upper:]'
'[:lower:]'
$(
uname
-s
))
-
$(
uname
-r
)
_
${
MCA_NAME_AND_VERSION
}
_
${
FLB_NAME_AND_VERSION
}
"
# Create an initramfs image
rm
-f
"
$dracut_output_file
"
dracut
-c
./dracut.module/dracut.conf
"
$uefi_image_name
"
--force
|&
tee
-a
"
$dracut_output_file
"
# Set the image as a boot option
efibootmgr
-b
"
$default_bootnum
"
--create
--disk
"
$EFI_PARTITION_MOUNT_POINT
"
--label
"test_deploy"
--loader
"
${
RELATIVE_EFI_IMAGE_DIR
}
/
$uefi_image_name
"
echo
New initramfs image:
"
${
EFI_IMAGE_DIR
}
/
$uefi_image_name
"
echo
New initramfs image:
$(
pwd
)
/
"
$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