mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 22:21:10 +02:00
use new status=none with dd
The latest coreutils introduces a status=none option which suppresses all information which is more than the current status=noxfer. BUG=None TEST=`./build_image` no longer spews any dd info Change-Id: I3cfefed1d38e7e5ff52342c98e6a306d9a48950a Reviewed-on: https://gerrit.chromium.org/gerrit/41930 Reviewed-by: David James <davidjames@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
87933c73cf
commit
79ae5b4a06
@ -284,7 +284,7 @@ make_image_bootable() {
|
||||
if="${FLAGS_rootfs_hash}" \
|
||||
of="${image}" \
|
||||
conv=notrunc \
|
||||
status=noxfer
|
||||
status=none
|
||||
|
||||
# Move the verification block needed for the hard disk install to the
|
||||
# stateful partition. Mount stateful fs, copy file, and umount fs.
|
||||
@ -296,7 +296,7 @@ make_image_bootable() {
|
||||
|
||||
local koffset="$(partoffset ${image} 2)"
|
||||
sudo dd if="${FLAGS_output_dir}/vmlinuz.image" of="${image}" \
|
||||
conv=notrunc bs=512 seek=${koffset} status=noxfer
|
||||
conv=notrunc bs=512 seek=${koffset} status=none
|
||||
|
||||
# Update the bootloaders. The EFI system partition will be updated.
|
||||
local kernel_part=
|
||||
@ -344,7 +344,7 @@ make_image_bootable() {
|
||||
info "copy the squashfs to the partition"
|
||||
local part_offset="$(partoffset ${image} 3)"
|
||||
sudo dd bs=512 if="${squashfs_img}" of="${image}" \
|
||||
seek=${part_offset} conv=notrunc status=noxfer
|
||||
seek=${part_offset} conv=notrunc status=none
|
||||
sudo rm "${squashfs_img}"
|
||||
fi
|
||||
}
|
||||
@ -356,7 +356,7 @@ verify_image_rootfs() {
|
||||
local rootfs_tmp_file=$(mktemp)
|
||||
trap "rm ${rootfs_tmp_file}" EXIT
|
||||
sudo dd if="${image}" of="${rootfs_tmp_file}" bs=512 skip="${rootfs_offset}" \
|
||||
status=noxfer
|
||||
status=none
|
||||
|
||||
# This flips the read-only compatibility flag, so that
|
||||
# e2fsck does not complain about unknown file system capabilities.
|
||||
|
@ -94,7 +94,7 @@ create_base_image() {
|
||||
# Build root FS image.
|
||||
info "Building ${root_fs_img}"
|
||||
dd if=/dev/zero of="${root_fs_img}" bs=1 count=1 \
|
||||
seek=$((root_fs_bytes - 1)) status=noxfer
|
||||
seek=$((root_fs_bytes - 1)) status=none
|
||||
sudo mkfs.ext2 -F -q -b ${fs_block_size} "${root_fs_img}" \
|
||||
"$((root_fs_bytes / fs_block_size))"
|
||||
sudo tune2fs -L "${root_fs_label}" \
|
||||
@ -114,7 +114,7 @@ create_base_image() {
|
||||
# Build stateful FS disk image.
|
||||
info "Building ${stateful_fs_img}"
|
||||
dd if=/dev/zero of="${stateful_fs_img}" bs=1 count=1 \
|
||||
seek=$((stateful_fs_bytes - 1)) status=noxfer
|
||||
seek=$((stateful_fs_bytes - 1)) status=none
|
||||
sudo mkfs.ext4 -F -q "${stateful_fs_img}"
|
||||
sudo tune2fs -L "${stateful_fs_label}" -U "${stateful_fs_uuid}" \
|
||||
-c 0 -i 0 "${stateful_fs_img}"
|
||||
@ -124,13 +124,13 @@ create_base_image() {
|
||||
# Build ESP disk image.
|
||||
info "Building ${esp_fs_img}"
|
||||
dd if=/dev/zero of="${esp_fs_img}" bs=1 count=1 \
|
||||
seek=$((esp_fs_bytes - 1)) status=noxfer
|
||||
seek=$((esp_fs_bytes - 1)) status=none
|
||||
sudo mkfs.vfat "${esp_fs_img}"
|
||||
|
||||
# Build OEM FS disk image.
|
||||
info "Building ${oem_fs_img}"
|
||||
dd if=/dev/zero of="${oem_fs_img}" bs=1 count=1 \
|
||||
seek=$((oem_fs_bytes - 1)) status=noxfer
|
||||
seek=$((oem_fs_bytes - 1)) status=none
|
||||
sudo mkfs.ext4 -F -q "${oem_fs_img}"
|
||||
sudo tune2fs -L "${oem_fs_label}" -U "${oem_fs_uuid}" \
|
||||
-c 0 -i 0 "${oem_fs_img}"
|
||||
|
@ -196,19 +196,19 @@ build_gpt() {
|
||||
# Now populate the partitions.
|
||||
info "Copying stateful partition..."
|
||||
$sudo dd if="$stateful_img" of="$outdev" conv=notrunc bs=512 \
|
||||
seek=$(partoffset ${outdev} 1)
|
||||
seek=$(partoffset ${outdev} 1) status=none
|
||||
|
||||
info "Copying rootfs..."
|
||||
$sudo dd if="$rootfs_img" of="$outdev" conv=notrunc bs=512 \
|
||||
seek=$(partoffset ${outdev} 3)
|
||||
seek=$(partoffset ${outdev} 3) status=none
|
||||
|
||||
info "Copying EFI system partition..."
|
||||
$sudo dd if="$esp_img" of="$outdev" conv=notrunc bs=512 \
|
||||
seek=$(partoffset ${outdev} 12)
|
||||
seek=$(partoffset ${outdev} 12) status=none
|
||||
|
||||
info "Copying OEM partition..."
|
||||
$sudo dd if="$oem_img" of="$outdev" conv=notrunc bs=512 \
|
||||
seek=$(partoffset ${outdev} 8)
|
||||
seek=$(partoffset ${outdev} 8) status=none
|
||||
|
||||
# Pre-set "sucessful" bit in gpt, so we will never mark-for-death
|
||||
# a partition on an SDCard/USB stick.
|
||||
@ -240,7 +240,7 @@ update_partition_table() {
|
||||
truncate -s ${dst_size} ${dst_img}
|
||||
|
||||
# Copy MBR, initialize GPT.
|
||||
dd if="${src_img}" of="${dst_img}" conv=notrunc bs=512 count=1
|
||||
dd if="${src_img}" of="${dst_img}" conv=notrunc bs=512 count=1 status=none
|
||||
cgpt create ${dst_img}
|
||||
|
||||
# Find partition number of STATE (really should always be "1")
|
||||
@ -287,11 +287,11 @@ update_partition_table() {
|
||||
if [ "${label}" != "STATE" ]; then
|
||||
# Copy source partition as-is.
|
||||
dd if="${src_img}" of="${dst_img}" conv=notrunc bs=512 \
|
||||
skip=${src_start} seek=${dst_start} count=${size}
|
||||
skip=${src_start} seek=${dst_start} count=${size} status=none
|
||||
else
|
||||
# Copy new stateful partition into place.
|
||||
dd if="${src_state}" of="${dst_img}" conv=notrunc bs=512 \
|
||||
seek=${dst_start}
|
||||
seek=${dst_start} status=none
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
|
@ -90,30 +90,30 @@ if ! type -p update_x86_bootloaders; then
|
||||
-e "s|DMTABLEB|${grub_dm_table_b}|g" \
|
||||
-e "s|cros_legacy|${cros_flags}|g" \
|
||||
"${template_dir}"/efi/boot/grub.cfg |
|
||||
sudo dd of="${esp_fs_dir}"/efi/boot/grub.cfg status=noxfer
|
||||
sudo dd of="${esp_fs_dir}"/efi/boot/grub.cfg status=none
|
||||
sed -e "s|/dev/\\\$linuxpartA|${root_a_uuid}|g" \
|
||||
-e "s|/dev/\\\$linuxpartB|${root_b_uuid}|g" \
|
||||
"${template_dir}"/efi/boot/grub.cfg |
|
||||
sudo dd of="${esp_fs_dir}"/efi/boot/grub.cfg status=noxfer
|
||||
sudo dd of="${esp_fs_dir}"/efi/boot/grub.cfg status=none
|
||||
|
||||
# Rewrite syslinux DM_TABLE
|
||||
syslinux_dm_table_usb=${dm_table//${old_root}/${root_a_uuid}}
|
||||
sed -e "s|DMTABLEA|${syslinux_dm_table_usb}|g" \
|
||||
-e "s|cros_legacy|${cros_flags}|g" \
|
||||
"${template_dir}"/syslinux/usb.A.cfg |
|
||||
sudo dd of="${esp_fs_dir}"/syslinux/usb.A.cfg status=noxfer
|
||||
sudo dd of="${esp_fs_dir}"/syslinux/usb.A.cfg status=none
|
||||
|
||||
syslinux_dm_table_a=${dm_table//${old_root}/HDROOTA}
|
||||
sed -e "s|DMTABLEA|${syslinux_dm_table_a}|g" \
|
||||
-e "s|cros_legacy|${cros_flags}|g" \
|
||||
"${template_dir}"/syslinux/root.A.cfg |
|
||||
sudo dd of="${esp_fs_dir}"/syslinux/root.A.cfg status=noxfer
|
||||
sudo dd of="${esp_fs_dir}"/syslinux/root.A.cfg status=none
|
||||
|
||||
syslinux_dm_table_b=${dm_table//${old_root}/HDROOTB}
|
||||
sed -e "s|DMTABLEB|${syslinux_dm_table_b}|g" \
|
||||
-e "s|cros_legacy|${cros_flags}|g" \
|
||||
"${template_dir}"/syslinux/root.B.cfg |
|
||||
sudo dd of="${esp_fs_dir}"/syslinux/root.B.cfg status=noxfer
|
||||
sudo dd of="${esp_fs_dir}"/syslinux/root.B.cfg status=none
|
||||
|
||||
# Copy the vmlinuz's into place for syslinux
|
||||
sudo cp -f "${template_dir}"/vmlinuz "${esp_fs_dir}"/syslinux/vmlinuz.A
|
||||
|
Loading…
x
Reference in New Issue
Block a user