mirror of
https://github.com/flatcar/scripts.git
synced 2026-02-15 12:41:24 +01:00
build_image: fall back to ro-mount automatically
A rootfs built with verification cannot be mounted rw, so have the mount script try to mount things ro if the rw mount failed. BUG=None TEST=`./build_image && ./mount.sh` work Change-Id: I291ece366e03e218b3cd9ff8f30bd9a6e9cf879d Reviewed-on: https://gerrit.chromium.org/gerrit/35065 Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
d6b6cf6751
commit
ff73cef8a6
@ -158,8 +158,12 @@ EOF
|
||||
if [[ ${size} -gt 1 ]]; then
|
||||
cat <<-EOF >>"${mount}"
|
||||
mkdir -p ${dir}
|
||||
sudo mount -o loop,offset=${start_b},sizelimit=${size_b} ${target} ${dir} || \
|
||||
rmdir ${dir}
|
||||
m=( sudo mount -o loop,offset=${start_b},sizelimit=${size_b} ${target} ${dir} )
|
||||
if ! "\${m[@]}"; then
|
||||
if ! "\${m[@]}" -o ro; then
|
||||
rmdir ${dir}
|
||||
fi
|
||||
fi
|
||||
EOF
|
||||
cat <<-EOF >>"${umount}"
|
||||
if [[ -d ${dir} ]]; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user