Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
create-iso
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
le6
create-iso
Commits
27d1be49
Commit
27d1be49
authored
6 years ago
by
Lucas
Browse files
Options
Downloads
Patches
Plain Diff
SCRUM#585
: Remove unused code
parent
e1478fea
No related branches found
No related tags found
1 merge request
!15
SCRUM#585: Remove unused code
Pipeline
#17179
passed
6 years ago
Stage: lint
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts-available/make-initrd.sh
+14
-20
14 additions, 20 deletions
scripts-available/make-initrd.sh
with
14 additions
and
20 deletions
scripts-available/make-initrd.sh
+
14
−
20
View file @
27d1be49
...
...
@@ -51,27 +51,21 @@ version="$(basename "${initrd_path}" | cut --delimiter='-' --fields=2,3)"
cp
"
${
CHROOTDIR
}
/boot/vmlinuz-
${
version
}
-generic"
"
${
TMP
}
/image/casper/vmlinuz"
||
createIsoLogger
--message
"Unable to copy kernel to image"
--tag
"cp"
# The initrd is converted from gzip to lzma
if
!
test
-f
initrd.lz
;
then
if
[
!
-d
"
${
PREFIX
}
/initrd"
]
;
then
mkdir
"
${
PREFIX
}
/initrd"
else
rm
--recursive
--force
"
${
PREFIX
:?
}
"
/initrd/
*
fi
createIsoLogger
--message
"Using '
$(
basename
"
${
initrd_path
}
"
)
'"
--type
info
initrd_type
=
"
$(
file
"
${
initrd_path
}
"
)
"
pushd
"
${
PREFIX
}
/initrd"
||
createIsoLogger
--message
"Unable to change directory"
--tag
"pushd"
if
grep
--quiet
--ignore-case
"gzip"
<<<
"
${
initrd_type
}
"
;
then
gzip
--decompress
--stdout
"
${
initrd_path
}
"
| cpio
--extract
||
createIsoLogger
--message
"Unable to decompress initrd"
--tag
"gzip"
elif
grep
--quiet
--ignore-case
"ascii"
<<<
"
${
initrd_type
}
"
;
then
block_size
=
"
$(
binwalk
--include
=
"compressed data"
"
${
initrd_path
}
"
|
cut
--delimiter
=
" "
--fields
=
1 |
grep
-E
"[0-9]+"
)
"
dd
if
=
"
${
initrd_path
}
"
bs
=
"
${
block_size
}
"
skip
=
1 |
gunzip
| cpio
--extract
--make-directories
else
createIsoLogger
--message
"Invalid initrd format"
fi
find
.
| cpio
--quiet
--create
-H
newc | lzma
-7
>
../initrd.lz
||
createIsoLogger
--message
"Unable to compress initrd"
--tag
"lzma"
popd
||
createIsoLogger
--message
"Unable to change directory"
--tag
"popd"
rm
--recursive
--force
"
${
PREFIX
:?
}
/initrd"
createIsoLogger
--message
"Using '
$(
basename
"
${
initrd_path
}
"
)
'"
--type
info
initrd_type
=
"
$(
file
"
${
initrd_path
}
"
)
"
mkdir
"
${
PREFIX
}
/initrd"
pushd
"
${
PREFIX
}
/initrd"
||
createIsoLogger
--message
"Unable to change directory"
--tag
"pushd"
if
grep
--quiet
--ignore-case
"gzip"
<<<
"
${
initrd_type
}
"
;
then
gzip
--decompress
--stdout
"
${
initrd_path
}
"
| cpio
--extract
||
createIsoLogger
--message
"Unable to decompress initrd"
--tag
"gzip"
elif
grep
--quiet
--ignore-case
"ascii"
<<<
"
${
initrd_type
}
"
;
then
block_size
=
"
$(
binwalk
--include
=
"compressed data"
"
${
initrd_path
}
"
|
cut
--delimiter
=
" "
--fields
=
1 |
grep
-E
"[0-9]+"
)
"
dd
if
=
"
${
initrd_path
}
"
bs
=
"
${
block_size
}
"
skip
=
1 |
gunzip
| cpio
--extract
--make-directories
else
createIsoLogger
--message
"Invalid initrd format"
fi
find
.
| cpio
--quiet
--create
-H
newc | lzma
-7
>
../initrd.lz
||
createIsoLogger
--message
"Unable to compress initrd"
--tag
"lzma"
popd
||
createIsoLogger
--message
"Unable to change directory"
--tag
"popd"
rm
--recursive
--force
"
${
PREFIX
:?
}
/initrd"
||
createIsoLogger
--message
"Unable to remove dir
\"
${
PREFIX
}
/initrd
\"
"
--tag
"rm"
mv
initrd.lz
"
${
TMP
}
/image/casper/initrd.lz"
||
createIsoLogger
--message
"Unable to move initrd to image"
--tag
"mv"
...
...
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