Y.立.强 发表于 2021-12-8 15:31:36

制作Ubuntu 18.04文件系统chroot失败

在官网下载ubuntu-base-18.04.5-base-arm64.tar.gz,解压执行./ch-mount.sh -m ubuntu/时提示chroot: failed to run command ‘/bin/bash’: No such file or directory
ch-mount.sh文件内容如下
#!/bin/bash

function mnt() {
    echo "MOUNTING"
    sudo mount -t proc /proc ${2}proc
    sudo mount -t sysfs /sys ${2}sys
    sudo mount -o bind /dev ${2}dev
    sudo chroot ${2}
}

function umnt() {
    echo "UNMOUNTING"
    sudo umount ${2}proc
    sudo umount ${2}sys
    sudo umount ${2}dev

}


if [ "$1" == "-m" ] && [ -n "$2" ] ;
then
    mnt $1 $2
elif [ "$1" == "-u" ] && [ -n "$2" ];
then
    umnt $1 $2
else
    echo ""
    echo "Either 1'st, 2'nd or both parameters were missing"
    echo ""
    echo "1'st parameter can be one of these: -m(mount) OR -u(umount)"
    echo "2'nd parameter is the full path of rootfs directory(with trailing '/')"
    echo ""
    echo "For example: ch-mount -m /media/sdcard/"
    echo ""
    echo 1st parameter : ${1}
    echo 2nd parameter : ${2}
fi


Y.立.强 发表于 2021-12-8 15:35:52

参考的是https://dev.t-firefly.com/thread-10963-1-1.html
页: [1]
查看完整版本: 制作Ubuntu 18.04文件系统chroot失败