Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
create-iso
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
le6
create-iso
Commits
f5d0d451
Commit
f5d0d451
authored
Jul 03, 2018
by
Daniel Bissani Furlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extracting initrd when is an ASCII file
parent
b9f48326
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
create-iso.sh
create-iso.sh
+2
-0
scripts-available/make-initrd.sh
scripts-available/make-initrd.sh
+9
-1
No files found.
create-iso.sh
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
...
...
scripts-available/make-initrd.sh
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
...
...
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