Changeset 10871 in hybrid for branches/releng-9.0/nanobsd/tools/image
- Timestamp:
- May 15, 2012, 10:10:24 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/releng-9.0/nanobsd/tools/image
r10830 r10871 20 20 # build force kernel - Build NanoBSD and force rebuilding the kernel 21 21 # build force world - Build NanoBSD and force rebuilding world 22 # edit - Manually edit the image 22 23 # config [for <node>] - Configure image to be used for <node> 23 24 # rebuild - Rebuild NanoBSD (aka force rebuilding all) … … 77 78 # Try to fetch and store config 78 79 chroot $mnt /tools/wl-config -d -n -m startup $node_name || exit 1 80 } 81 82 edit_image() { 83 img=$OBJDIR/_.disk.full 84 85 mnt=`mktemp -d -t $(basename $0)` 86 md=`mdconfig -a -t vnode -f $img` 87 88 # Clean up when done 89 trap "umount $mnt/dev; umount $mnt/cfg; umount $mnt; mdconfig -d -u $md; rm -d $mnt" 0 90 trap "exit 1" 1 2 3 15 91 92 # Root filesystem 93 mount /dev/${md}s1a $mnt || exit 1 94 95 # /dev/null in chroot 96 mount -t devfs devfs ${mnt}/dev || exit 1 97 98 # Config files lives at /cfg location 99 mount /dev/${md}s3 $mnt/cfg || exit 1 100 101 # Nasty hack to set custom prompt 102 prompt='set prompt = "image# "' 103 echo $prompt >> $mnt/root/.cshrc 104 105 p_info "Type exit when done" 106 chroot $mnt 107 p_info "Any changes are made permanent on image $img" 108 109 # Unset prompt again 110 sed -I '' "/^$prompt$/d" $mnt/root/.cshrc 79 111 } 80 112 … … 213 245 fi 214 246 config_image $node_name 247 elif [ "$1" = "edit" ]; then 248 edit_image 215 249 else 216 250 echo "Argument Error - '$1'"; exit 128
Note:
See TracChangeset
for help on using the changeset viewer.