forked from pool/libguestfs
* Various MacOS fixes and enhancements * ocaml: INSTALL_OCAMLLIB Makefile parameter * appliance/init: Don't set impossible "noop" disk scheduler * Pull in some fixes from the common submodule. mlcustomize: Add Inject_virtio_win.inject_blnsvr implementation mlcustomize: firstboot: Use Linux path for Powershell script path mlcustomize: firstboot: Use powershell.exe instead of path mlcustomize: firstboot: Use Powershell -NoProfile flag mlcustomize: Revert delay installation of qemu-ga MSI mldrivers/linux_kernels.ml: Prefix general information with ^info: mlcustomize: Use Start-Process -Wait to run qemu-ga installer mlcustomize: Add Firstboot.firstboot_dir function mlcustomize: Place powershell scripts into <firstboot_dir>\Temp mlcustomize: Inject qemu-ga & blnsvr into <firstboot_dir>/Temp mlcustomize: Write qemu-ga log file name to log.txt mlcustomize: Add some comments to firstboot batch file mlcustomize: Reboot Windows between each firstboot script OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=587
46 lines
766 B
Bash
46 lines
766 B
Bash
#!/bin/bash
|
|
# Usage: $0 /dev/sda5
|
|
rootfs=$1
|
|
mnt=/sysroot
|
|
mounts=
|
|
|
|
if test -b "${rootfs}"
|
|
then
|
|
|
|
mkdir -v -p "${mnt}"
|
|
|
|
if mount -v "${rootfs}" "${mnt}"
|
|
then
|
|
|
|
for i in dev dev/pts proc sys selinux
|
|
do
|
|
if test -d /${i} && test -d "${mnt}/${i}" && test "`stat -c %D /`" != "`stat -c %D ${i}`"
|
|
then
|
|
mount -v --bind /${i} "${mnt}/${i}"
|
|
fi
|
|
done
|
|
|
|
chroot "${mnt}" su -
|
|
|
|
while read b m rest
|
|
do
|
|
case "${m}" in
|
|
${mnt}*)
|
|
mounts="${m} ${mounts}"
|
|
;;
|
|
esac
|
|
done <<-EOF
|
|
`
|
|
cat < /proc/mounts
|
|
`
|
|
EOF
|
|
|
|
for i in ${mounts}
|
|
do
|
|
umount -v "${i}"
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|