Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archiso
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2011-08-12 00:10:44 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2011-08-15 01:07:31 -0300
commit7b23acf301c9899a2ec0658ee0eb9af15ebe5ace (patch)
tree7e08ffaa9a735c0bcc83f488e8279a13759cc65f /archiso
parent929b1ed26e5ba17d09797dfd4482cf7056ec91d1 (diff)
[archiso] Add checksum= boot param
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Diffstat (limited to 'archiso')
-rw-r--r--archiso/hooks/archiso26
1 files changed, 26 insertions, 0 deletions
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso
index 66dbafd..c973ffc 100644
--- a/archiso/hooks/archiso
+++ b/archiso/hooks/archiso
@@ -77,6 +77,16 @@ _mnt_sfs() {
fi
}
+_verify_checksum() {
+ local _status
+ cd "/bootmnt/${archisobasedir}"
+ md5sum -c checksum.md5 > /checksum.log 2>&1
+ _status=$?
+ cd "${OLDPWD}"
+ return ${_status}
+}
+
+
run_hook() {
[[ -z "${arch}" ]] && arch="$(uname -m)"
[[ -z "${cowspace_size}" ]] && cowspace_size="75%"
@@ -135,6 +145,22 @@ archiso_mount_handler() {
launch_interactive_shell
fi
+ if [[ "${checksum}" == "y" ]]; then
+ if [[ -f "/bootmnt/${archisobasedir}/checksum.md5" ]]; then
+ msg -n ":: Self-test requested, please wait..."
+ if _verify_checksum; then
+ msg "done. Checksum is OK, continue booting."
+ else
+ echo "ERROR: one or more files are corrupted"
+ echo "see /checksum.log for details"
+ launch_interactive_shell
+ fi
+ else
+ echo "ERROR: checksum=y option specified but checksum.md5 not found"
+ launch_interactive_shell
+ fi
+ fi
+
if [[ "${copytoram}" == "y" ]]; then
msg -n ":: Mounting /copytoram (tmpfs) filesystem, size=${copytoram_size}..."
mount -t tmpfs -o "size=${copytoram_size}",mode=0755 copytoram /copytoram