forked from mirrored-repos/manjaro-tools
initcpio: fix pxe, checksum signing checks
This commit is contained in:
parent
c47afc3878
commit
45f5f97ba5
3 changed files with 18 additions and 13 deletions
|
@ -100,7 +100,7 @@ _mnt_dev() {
|
|||
|
||||
_verify_checksum() {
|
||||
local _status
|
||||
cd "/run/archiso/bootmnt/${misobasedir}/${arch}"
|
||||
cd "/run/miso/bootmnt/${misobasedir}/${arch}"
|
||||
md5sum -c $1.md5 > /tmp/checksum.log 2>&1
|
||||
_status=$?
|
||||
cd "${OLDPWD}"
|
||||
|
@ -109,7 +109,7 @@ _verify_checksum() {
|
|||
|
||||
_verify_signature() {
|
||||
local _status
|
||||
cd "/run/archiso/bootmnt/${misobasedir}/${arch}"
|
||||
cd "/run/miso/bootmnt/${misobasedir}/${arch}"
|
||||
gpg --homedir /gpg --status-fd 1 --verify $1.sfs.sig 2>/dev/null | grep -qE '^\[GNUPG:\] GOODSIG'
|
||||
_status=$?
|
||||
cd "${OLDPWD}"
|
||||
|
@ -177,7 +177,7 @@ miso_mount_handler() {
|
|||
for fs in rootfs desktopfs mhwdfs livefs;do
|
||||
if [[ -f "/run/miso/bootmnt/${misobasedir}/${arch}/${fs}.sfs.sig" ]]; then
|
||||
msg -n ":: Signature verification requested, please wait..."
|
||||
if _verify_signature; then
|
||||
if _verify_signature "${fs}"; then
|
||||
msg "done. Signature is OK, continue booting."
|
||||
else
|
||||
echo "ERROR: one or more files are corrupted"
|
||||
|
|
|
@ -100,7 +100,7 @@ _mnt_dev() {
|
|||
_verify_checksum() {
|
||||
local _status
|
||||
cd "/run/miso/bootmnt/${misobasedir}/${arch}"
|
||||
md5sum -c airootfs.md5 > /tmp/checksum.log 2>&1
|
||||
md5sum -c $1.md5 > /tmp/checksum.log 2>&1
|
||||
_status=$?
|
||||
cd "${OLDPWD}"
|
||||
return ${_status}
|
||||
|
@ -109,7 +109,7 @@ _verify_checksum() {
|
|||
_verify_signature() {
|
||||
local _status
|
||||
cd "/run/miso/bootmnt/${misobasedir}/${arch}"
|
||||
gpg --homedir /gpg --status-fd 1 --verify airootfs.sfs.sig 2>/dev/null | grep -qE '^\[GNUPG:\] GOODSIG'
|
||||
gpg --homedir /gpg --status-fd 1 --verify $1.sfs.sig 2>/dev/null | grep -qE '^\[GNUPG:\] GOODSIG'
|
||||
_status=$?
|
||||
cd "${OLDPWD}"
|
||||
return ${_status}
|
||||
|
@ -175,7 +175,7 @@ miso_mount_handler() {
|
|||
for fs in rootfs desktopfs mhwdfs livefs;do
|
||||
if [[ -f "/run/miso/bootmnt/${misobasedir}/${arch}/${fs}.sfs.sig" ]]; then
|
||||
msg -n ":: Signature verification requested, please wait..."
|
||||
if _verify_signature; then
|
||||
if _verify_signature "${fs}"; then
|
||||
msg "done. Signature is OK, continue booting."
|
||||
else
|
||||
echo "ERROR: one or more files are corrupted"
|
||||
|
|
|
@ -34,15 +34,20 @@ miso_pxe_http_mount_handler () {
|
|||
mkdir -p "/run/miso/httpspace"
|
||||
mount -t tmpfs -o size="${miso_http_spc}",mode=0755 httpspace "/run/miso/httpspace"
|
||||
|
||||
_curl_get "${miso_http_srv}${misobasedir}/${arch}/airootfs.sfs" "/${arch}"
|
||||
local _src=${miso_http_srv}${misobasedir}/${arch}
|
||||
|
||||
if [[ "${checksum}" == "y" ]]; then
|
||||
_curl_get "${miso_http_srv}${misobasedir}/${arch}/airootfs.md5" "/${arch}"
|
||||
fi
|
||||
if [[ "${verify}" == "y" ]]; then
|
||||
_curl_get "${miso_http_srv}${misobasedir}/${arch}/airootfs.sfs.sig" "/${arch}"
|
||||
fi
|
||||
for sfs in livefs mhwdfs desktopfs rootfs;do
|
||||
if [[ -f "${_src}/${sfs}.sfs" ]]; then
|
||||
_curl_get "${_src}/${sfs}.sfs" "/${arch}"
|
||||
|
||||
if [[ "${checksum}" == "y" ]]; then
|
||||
_curl_get "${_src}/${sfs}.md5" "/${arch}"
|
||||
fi
|
||||
if [[ "${verify}" == "y" ]]; then
|
||||
_curl_get "${_src}/${sfs}.sfs.sig" "/${arch}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
mkdir -p "/run/miso/bootmnt"
|
||||
mount -o bind /run/miso/httpspace /run/miso/bootmnt
|
||||
|
||||
|
|
Loading…
Reference in a new issue