[archiso] Checksum only aitab and *.sfs (per architecture)
We are currently checksuming all files inside $archisobasedir (aitab, *sfs, kernel/initramfs and boot/syslinux related files) this is stored in one file only. Its works good for now, but I think we only need to checksum only aitab and *.sfs if they are needed. Currently if you boot a dual-iso in i686, also checksum is done for *.sfs of x86_64. Not a big issue, this just take a bit more time. The real issue is when booting via PXE with HTTP/FTP methods, since they download only aitab and needed *.sfs files, can not use directly the only one file where checksums are stored. This patch does: (1) Do not checksum syslinux related files, anyway you are already reach initramfs stage. (2) Do not checksum kernel/initramfs files, for the same as (1) (3) Two checksum.${arch}.md5 for each i686 and x86_64 for only aitab and *.sfs. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
This commit is contained in:
parent
0411fc90bb
commit
cd359bc37a
@ -122,7 +122,7 @@ _mnt_dev() {
|
|||||||
_verify_checksum() {
|
_verify_checksum() {
|
||||||
local _status
|
local _status
|
||||||
cd "/run/archiso/bootmnt/${archisobasedir}"
|
cd "/run/archiso/bootmnt/${archisobasedir}"
|
||||||
md5sum -c checksum.md5 > /checksum.log 2>&1
|
md5sum -c checksum.${arch}.md5 > /tmp/checksum.${arch}.log 2>&1
|
||||||
_status=$?
|
_status=$?
|
||||||
cd "${OLDPWD}"
|
cd "${OLDPWD}"
|
||||||
return ${_status}
|
return ${_status}
|
||||||
@ -177,17 +177,17 @@ archiso_mount_handler() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${checksum}" == "y" ]]; then
|
if [[ "${checksum}" == "y" ]]; then
|
||||||
if [[ -f "/run/archiso/bootmnt/${archisobasedir}/checksum.md5" ]]; then
|
if [[ -f "/run/archiso/bootmnt/${archisobasedir}/checksum.${arch}.md5" ]]; then
|
||||||
msg -n ":: Self-test requested, please wait..."
|
msg -n ":: Self-test requested, please wait..."
|
||||||
if _verify_checksum; then
|
if _verify_checksum; then
|
||||||
msg "done. Checksum is OK, continue booting."
|
msg "done. Checksum is OK, continue booting."
|
||||||
else
|
else
|
||||||
echo "ERROR: one or more files are corrupted"
|
echo "ERROR: one or more files are corrupted"
|
||||||
echo "see /checksum.log for details"
|
echo "see /tmp/checksum.${arch}.log for details"
|
||||||
launch_interactive_shell
|
launch_interactive_shell
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR: checksum=y option specified but checksum.md5 not found"
|
echo "ERROR: checksum=y option specified but checksum.${arch}.md5 not found"
|
||||||
launch_interactive_shell
|
launch_interactive_shell
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -299,13 +299,23 @@ _mkfs () {
|
|||||||
command_checksum () {
|
command_checksum () {
|
||||||
_show_config checksum
|
_show_config checksum
|
||||||
|
|
||||||
if _is_directory_changed "${work_dir}/iso/${install_dir}" "${work_dir}/iso/${install_dir}/checksum.md5"; then
|
local _chk_arch
|
||||||
_msg_info "Creating checksum file for self-test"
|
|
||||||
|
for _chk_arch in i686 x86_64; do
|
||||||
|
if _is_directory_changed "${work_dir}/iso/${install_dir}" "${work_dir}/iso/${install_dir}/checksum.${_chk_arch}.md5"; then
|
||||||
|
_msg_info "Creating checksum file for self-test (${_chk_arch})"
|
||||||
cd "${work_dir}/iso/${install_dir}"
|
cd "${work_dir}/iso/${install_dir}"
|
||||||
find -type f ! -name checksum.md5 -print0 | xargs -0 md5sum > checksum.md5
|
if [[ -d "${_chk_arch}" ]]; then
|
||||||
|
md5sum aitab > checksum.${_chk_arch}.md5
|
||||||
|
find ${_chk_arch} -type f -print0 | xargs -0 md5sum >> checksum.${_chk_arch}.md5
|
||||||
|
if [[ -d "any" ]]; then
|
||||||
|
find any -type f -print0 | xargs -0 md5sum >> checksum.${_chk_arch}.md5
|
||||||
|
fi
|
||||||
|
fi
|
||||||
cd ${OLDPWD}
|
cd ${OLDPWD}
|
||||||
_msg_info "Done!"
|
_msg_info "Done!"
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create an ISO9660 filesystem from "iso" directory.
|
# Create an ISO9660 filesystem from "iso" directory.
|
||||||
|
Loading…
Reference in New Issue
Block a user