Path: blob/main/e2e_tests/guest_under_test/initramfs/init.sh
5394 views
#!/bin/bash1# Copyright 2023 The ChromiumOS Authors2# Use of this source code is governed by a BSD-style license that can be3# found in the LICENSE file.45mount_root () {6if [ -f "/dev/sda" ]; then7mount /dev/sda /newroot8else9mount /dev/vda /newroot10fi11}1213mount -t proc /proc -t proc14mount -t sysfs none /sys15mount -t devtmpfs none /dev1617mount_root1819if mount_root; then20mkdir -p /newroot/proc /newroot/sys /newroot/dev || true2122mount --move /sys /newroot/sys23mount --move /proc /newroot/proc24mount --move /dev /newroot/dev25ln -sf /proc/self/fd /newroot/dev/fd2627cp /bin/delegate /newroot/bin/delegate || true2829cd /newroot && chroot /newroot /bin/delegate30else31exec /bin/delegate32fi333435