diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:31:53 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:31:53 +0000 |
| commit | 8c22ff0d8b70d9b12f0487ef696a7e915b9e3173 (patch) | |
| tree | efdc32587159d0050a69009bdf2330a531727d95 /scripts/runqemu-export-rootfs | |
| parent | d412d2747595c1cc4a5e3ca975e3adc31b2f7891 (diff) | |
| download | poky-8c22ff0d8b70d9b12f0487ef696a7e915b9e3173.tar.gz | |
The poky repository master branch is no longer being updated.
You can either:
a) switch to individual clones of bitbake, openembedded-core, meta-yocto and yocto-docs
b) use the new bitbake-setup
You can find information about either approach in our documentation:
https://docs.yoctoproject.org/
Note that "poky" the distro setting is still available in meta-yocto as
before and we continue to use and maintain that.
Long live Poky!
Some further information on the background of this change can be found
in: https://lists.openembedded.org/g/openembedded-architecture/message/2179
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu-export-rootfs')
| -rwxr-xr-x | scripts/runqemu-export-rootfs | 127 |
1 files changed, 0 insertions, 127 deletions
diff --git a/scripts/runqemu-export-rootfs b/scripts/runqemu-export-rootfs deleted file mode 100755 index 6a8acd0d5a..0000000000 --- a/scripts/runqemu-export-rootfs +++ /dev/null | |||
| @@ -1,127 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # | ||
| 3 | # Copyright (c) 2005-2009 Wind River Systems, Inc. | ||
| 4 | # | ||
| 5 | # SPDX-License-Identifier: GPL-2.0-only | ||
| 6 | # | ||
| 7 | |||
| 8 | usage() { | ||
| 9 | echo "Usage: $0 {start|stop|restart} <nfs-export-dir>" | ||
| 10 | } | ||
| 11 | |||
| 12 | if [ $# != 2 ]; then | ||
| 13 | usage | ||
| 14 | exit 1 | ||
| 15 | fi | ||
| 16 | |||
| 17 | if [[ "$1" != "start" && "$1" != "stop" && "$1" != "restart" ]]; then | ||
| 18 | echo "Unknown command '$1'" | ||
| 19 | usage | ||
| 20 | exit 1 | ||
| 21 | fi | ||
| 22 | |||
| 23 | if [ ! -d "$2" ]; then | ||
| 24 | echo "Error: '$2' does not exist" | ||
| 25 | usage | ||
| 26 | exit 1 | ||
| 27 | fi | ||
| 28 | # Ensure the nfs-export-dir is an absolute path | ||
| 29 | NFS_EXPORT_DIR=$(cd "$2" && pwd) | ||
| 30 | |||
| 31 | SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null` | ||
| 32 | if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then | ||
| 33 | echo "Error: Unable to find the oe-find-native-sysroot script" | ||
| 34 | echo "Did you forget to source your build environment setup script?" | ||
| 35 | exit 1 | ||
| 36 | fi | ||
| 37 | . $SYSROOT_SETUP_SCRIPT qemu-helper-native | ||
| 38 | |||
| 39 | if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/unfsd" ]; then | ||
| 40 | echo "Error: Unable to find unfsd binary in $OECORE_NATIVE_SYSROOT/usr/bin/" | ||
| 41 | |||
| 42 | echo "This shouldn't happen - something is missing from your toolchain installation" | ||
| 43 | exit 1 | ||
| 44 | fi | ||
| 45 | |||
| 46 | if [ ! -d ~/.runqemu-sdk ]; then | ||
| 47 | mkdir -p ~/.runqemu-sdk | ||
| 48 | fi | ||
| 49 | |||
| 50 | NFS_INSTANCE=${NFS_INSTANCE:=0} | ||
| 51 | EXPORTS=~/.runqemu-sdk/exports$NFS_INSTANCE | ||
| 52 | RMTAB=~/.runqemu-sdk/rmtab$NFS_INSTANCE | ||
| 53 | NFSPID=~/.runqemu-sdk/nfs$NFS_INSTANCE.pid | ||
| 54 | MOUNTPID=~/.runqemu-sdk/mount$NFS_INSTANCE.pid | ||
| 55 | |||
| 56 | PSEUDO_OPTS="-P $OECORE_NATIVE_SYSROOT/usr" | ||
| 57 | PSEUDO_LOCALSTATEDIR="$NFS_EXPORT_DIR/../$(basename $NFS_EXPORT_DIR).pseudo_state" | ||
| 58 | export PSEUDO_LOCALSTATEDIR | ||
| 59 | |||
| 60 | if [ ! -d "$PSEUDO_LOCALSTATEDIR" ]; then | ||
| 61 | echo "Error: $PSEUDO_LOCALSTATEDIR does not exist." | ||
| 62 | echo "Did you create the export directory using runqemu-extract-sdk?" | ||
| 63 | exit 1 | ||
| 64 | fi | ||
| 65 | |||
| 66 | # NFS server port number | ||
| 67 | NFSD_PORT=${NFSD_PORT:=$[ 3049 + 2 * $NFS_INSTANCE ]} | ||
| 68 | # mountd port number | ||
| 69 | MOUNTD_PORT=${MOUNTD_PORT:=$[ 3048 + 2 * $NFS_INSTANCE ]} | ||
| 70 | |||
| 71 | ## For debugging you would additionally add | ||
| 72 | ## --debug all | ||
| 73 | UNFSD_OPTS="-p -i $NFSPID -e $EXPORTS -n $NFSD_PORT -m $MOUNTD_PORT" | ||
| 74 | |||
| 75 | # See how we were called. | ||
| 76 | case "$1" in | ||
| 77 | start) | ||
| 78 | echo "Creating exports file..." | ||
| 79 | echo "$NFS_EXPORT_DIR (rw,no_root_squash,no_all_squash,insecure)" > $EXPORTS | ||
| 80 | |||
| 81 | echo "Starting User Mode nfsd" | ||
| 82 | echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/bin/unfsd $UNFSD_OPTS" | ||
| 83 | $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/bin/unfsd $UNFSD_OPTS | ||
| 84 | if [ ! $? = 0 ]; then | ||
| 85 | echo "Error starting nfsd" | ||
| 86 | exit 1 | ||
| 87 | fi | ||
| 88 | # Check to make sure everything started ok. | ||
| 89 | if [ ! -f $NFSPID ]; then | ||
| 90 | echo "rpc.nfsd did not start correctly" | ||
| 91 | exit 1 | ||
| 92 | fi | ||
| 93 | ps -fp `cat $NFSPID` > /dev/null 2> /dev/null | ||
| 94 | if [ ! $? = 0 ]; then | ||
| 95 | echo "rpc.nfsd did not start correctly" | ||
| 96 | exit 1 | ||
| 97 | fi | ||
| 98 | echo " " | ||
| 99 | echo "On your target please remember to add the following options for NFS" | ||
| 100 | echo "nfsroot=IP_ADDRESS:$NFS_EXPORT_DIR,nfsvers=3,port=$NFSD_PORT,udp,mountport=$MOUNTD_PORT" | ||
| 101 | ;; | ||
| 102 | stop) | ||
| 103 | if [ -f "$NFSPID" ]; then | ||
| 104 | echo "Stopping rpc.nfsd" | ||
| 105 | kill `cat $NFSPID` | ||
| 106 | rm -f $NFSPID | ||
| 107 | else | ||
| 108 | echo "No PID file, not stopping rpc.nfsd" | ||
| 109 | fi | ||
| 110 | if [ -f "$EXPORTS" ]; then | ||
| 111 | echo "Removing exports file" | ||
| 112 | rm -f $EXPORTS | ||
| 113 | fi | ||
| 114 | ;; | ||
| 115 | restart) | ||
| 116 | $0 stop $NFS_EXPORT_DIR | ||
| 117 | $0 start $NFS_EXPORT_DIR | ||
| 118 | if [ ! $? = 0 ]; then | ||
| 119 | exit 1 | ||
| 120 | fi | ||
| 121 | ;; | ||
| 122 | *) | ||
| 123 | echo "$0 {start|stop|restart} <nfs-export-dir>" | ||
| 124 | ;; | ||
| 125 | esac | ||
| 126 | |||
| 127 | exit 0 | ||
