mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 22:51:03 +02:00
feat(vm_image_util): Add /usr/.noupdate flag file in PXE images.
This can be used by update_engine as a quick test to determine if it is running on a system that it can handle. This avoids needing something like the 'coreos.diskless' kernel command line flag.
This commit is contained in:
parent
7b6e547751
commit
a6328f7c2b
@ -301,6 +301,9 @@ _write_cpio_disk() {
|
|||||||
${squashfs} /sysroot squashfs x-initrd.mount 0 0
|
${squashfs} /sysroot squashfs x-initrd.mount 0 0
|
||||||
tmpfs /sysroot/usr/share/oem tmpfs size=0,mode=755,x-initrd.mount 0 0
|
tmpfs /sysroot/usr/share/oem tmpfs size=0,mode=755,x-initrd.mount 0 0
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Inject /usr/.noupdate into squashfs to disable update_engine
|
||||||
|
echo "/usr/.noupdate f 444 root root echo -n" >"${VM_TMP_DIR}/extra"
|
||||||
else
|
else
|
||||||
# Set tmpfs as default root, squashfs as default /usr
|
# Set tmpfs as default root, squashfs as default /usr
|
||||||
sudo_clobber "${cpio_target}/etc/fstab" <<EOF
|
sudo_clobber "${cpio_target}/etc/fstab" <<EOF
|
||||||
@ -320,11 +323,14 @@ users:
|
|||||||
passwd: $(</etc/shared_user_passwd.txt)
|
passwd: $(</etc/shared_user_passwd.txt)
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Inject /usr/.noupdate into squashfs to disable update_engine
|
||||||
|
echo "/.noupdate f 444 root root echo -n" >"${VM_TMP_DIR}/extra"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build the squashfs, embed squashfs into a gzipped cpio
|
# Build the squashfs, embed squashfs into a gzipped cpio
|
||||||
pushd "${cpio_target}" >/dev/null
|
pushd "${cpio_target}" >/dev/null
|
||||||
sudo mksquashfs "${base_dir}" "./${squashfs}"
|
sudo mksquashfs "${base_dir}" "./${squashfs}" -pf "${VM_TMP_DIR}/extra"
|
||||||
find . | cpio -o -H newc | gzip > "$2"
|
find . | cpio -o -H newc | gzip > "$2"
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user