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
f5d0d451
Commit
f5d0d451
authored
6 years ago
by
Daniel Bissani Furlin
Browse files
Options
Downloads
Patches
Plain Diff
Extracting initrd when is an ASCII file
parent
b9f48326
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
create-iso.sh
+2
-0
2 additions, 0 deletions
create-iso.sh
scripts-available/make-initrd.sh
+9
-1
9 additions, 1 deletion
scripts-available/make-initrd.sh
with
11 additions
and
1 deletion
create-iso.sh
+
2
−
0
View file @
f5d0d451
...
...
@@ -129,6 +129,8 @@ for script in `ls ${SCRIPTSDIR}`; do
if
[[
"
$script
"
=
~
[
0-9]+
\-
chroot
\.
*
]]
;
then
initChroot
"
${
CHROOTDIR
}
"
"
${
LOG_FILE
}
"
execChroot
"
$CHROOTDIR
"
"
${
SCRIPT_NAME
}
"
#echo "PARADO"
#read a
closeChroot
"
${
CHROOTDIR
}
"
"
${
LOG_FILE
}
"
fi
fi
...
...
This diff is collapsed.
Click to expand it.
scripts-available/make-initrd.sh
+
9
−
1
View file @
f5d0d451
...
...
@@ -54,8 +54,16 @@ if ! test -f initrd.lz; then
rm
--recursive
--force
${
PREFIX
}
/initrd/
*
fi
pinfo
"Using '
${
initname
}
'"
initrd_type
=
$(
file
"
${
CHROOTDIR
}
/boot/
${
initname
}
"
)
pushd
${
PREFIX
}
/initrd
gzip
--decompress
--stdout
"
${
CHROOTDIR
}
/boot/
${
initname
}
"
| cpio
--extract
;
$(
genErrHandle
"Unable to decompress initrd"
)
if
echo
${
initrd_type
}
|
grep
--quiet
--ignore-case
"gzip"
;
then
gzip
--decompress
--stdout
"
${
CHROOTDIR
}
/boot/
${
initname
}
"
| cpio
--extract
;
$(
genErrHandle
"Unable to decompress initrd"
)
elif
echo
${
initrd_type
}
|
grep
--quiet
--ignore-case
"ascii"
;
then
block_size
=
$(
binwalk
--include
=
"compressed data"
"
${
CHROOTDIR
}
/boot/
${
initname
}
"
|
cut
--delimiter
=
" "
--fields
=
1 | egrep
"[0-9]+"
)
dd
if
=
"
${
CHROOTDIR
}
/boot/
${
initname
}
"
bs
=
"
${
block_size
}
"
skip
=
1 |
gunzip
| cpio
--extract
--make-directories
else
perror
"
${
BASH_SOURCE
[0]
}
: Invalid initrd format"
;
/bin/bash
fi
find
.
| cpio
--quiet
--create
-H
newc | lzma
-7
>
../initrd.lz
;
$(
genErrHandle
"Unable to compress initrd"
)
popd
rm
--recursive
--force
${
PREFIX
}
/initrd
...
...
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