From 183e1271f86797fe7b473cbcf78671eca075c122 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 19 Sep 2019 13:34:40 -0400 Subject: image_signing: drop set_chronos_password.sh We're dropping this from the signer, so drop it from here too. Nothing else has referred to it. BUG=None TEST=CQ passes BRANCH=None Change-Id: I855ef036b620082ec98af7aac8ea330ae472435a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1814697 Reviewed-by: George Engelbrecht Commit-Queue: Mike Frysinger Tested-by: Mike Frysinger --- scripts/image_signing/set_chronos_password.sh | 56 --------------------------- 1 file changed, 56 deletions(-) delete mode 100755 scripts/image_signing/set_chronos_password.sh diff --git a/scripts/image_signing/set_chronos_password.sh b/scripts/image_signing/set_chronos_password.sh deleted file mode 100755 index 0b8bce80..00000000 --- a/scripts/image_signing/set_chronos_password.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2010 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Customizes a Chrome OS release image by setting the chronos user password. - -# Usage: ./set_chronos_password.sh [--force] - -# Load common constants and variables. -. "$(dirname "$0")/common.sh" - -change_chronos_password() { - local rootfs=$1 - local password=$2 - echo "Setting chronos password..." - local crypted_password="$(echo $password | openssl passwd -1 -stdin)" - local temp_shadow="$rootfs/etc/tempshadow" - echo "chronos:$crypted_password:14500:0:99999::::" \ - | sudo tee "$temp_shadow" > /dev/null - sudo grep -Ev ^chronos: "$rootfs/etc/shadow" \ - | sudo tee -a "$temp_shadow" > /dev/null - sudo mv -f "$temp_shadow" "$rootfs/etc/shadow" -} - -main() { - set -e - - local image=$1 - local chronos_password=$2 - if [ $# -ne 2 ] && [ $# -ne 3 ] || [ ! $3 = "--force" ] ; then - echo "Usage: $PROG [--force]" - exit 1 - fi - - local loopdev=$(loopback_partscan "${image}") - local rootfs=$(make_temp_dir) - if [ $# -eq 2 ]; then - mount_loop_image_partition_ro "${loopdev}" 3 "${rootfs}" - if ! no_chronos_password "$rootfs"; then - echo "Password is already set [use --force if you'd like to update it]" - exit 1 - fi - # Prepare for remounting read/write. We can't use `mount -o rw,remount` - # because of the bits in the ext4 header we've set to block that. See - # enable_rw_mount for details. - sudo umount "${rootfs}" - fi - mount_loop_image_partition "${loopdev}" 3 "${rootfs}" - change_chronos_password "$rootfs" "$chronos_password" - touch "$image" # Updates the image modification time. - echo "Password Set." -} - -main $@ -- cgit v1.2.1