Mercurial > hg > aboriginal
changeset 590:8e7db79a3d75
Make initramfs work, add "--memory MEGS" option to ./run-emulator.sh and make run-from-build.sh use it.
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 16 Jan 2009 02:31:18 -0600 |
parents | 5b62607168fd |
children | 4750bed36a72 |
files | run-from-build.sh sources/targets/i686/miniconfig-linux sources/toys/run-emulator.sh system-image.sh |
diffstat | 4 files changed, 24 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/run-from-build.sh Fri Jan 16 02:28:05 2009 -0600 +++ b/run-from-build.sh Fri Jan 16 02:31:18 2009 -0600 @@ -7,8 +7,9 @@ cd "${BUILD}/system-image-$ARCH_NAME" || exit 1 # A little paranoia. -fsck.ext2 -y "image-${ARCH}.ext2" </dev/null +[ -f "image-${ARCH}.ext2" ] && fsck.ext2 -y "image-${ARCH}.ext2" </dev/null # And run it, using the distccd we built (if necessary) and the cross-compiler. -PATH="$HOSTTOOLS:$PATH" ./run-emulator.sh --make-hdb 2048 --with-distcc "$CROSS" +PATH="$HOSTTOOLS:$PATH" ./run-emulator.sh --make-hdb 2048 --memory 256 \ + --with-distcc "$CROSS"
--- a/sources/targets/i686/miniconfig-linux Fri Jan 16 02:28:05 2009 -0600 +++ b/sources/targets/i686/miniconfig-linux Fri Jan 16 02:31:18 2009 -0600 @@ -45,4 +45,3 @@ CONFIG_ENABLE_MUST_CHECK=y CONFIG_MAGIC_SYSRQ=y CONFIG_SQUASHFS=y -CONFIG_EXT3_FS=y
--- a/sources/toys/run-emulator.sh Fri Jan 16 02:28:05 2009 -0600 +++ b/sources/toys/run-emulator.sh Fri Jan 16 02:31:18 2009 -0600 @@ -23,9 +23,21 @@ shift DISTCC_PATH="$1" + elif [ "$1" == "--memory" ] + then + shift + MEMORY="-m $1" else - echo "unknown argument $1" - echo 'Usage: run-emulator.sh [--make-hdb $MEGS] [--with-hdb $FILE] [$CROSS_COMPILER_PATH]' >&2 + ( + echo "unknown argument $1" + echo 'Usage: run-emulator.sh [OPTIONS]' + echo ' --make-hdb $MEGS - create a sparse image (if none exists) to mount on /home' + echo ' --with-hdb $FILE - Use an image file name other than hdb.img' + echo ' --with-distcc $DISTCC_PATH - set up distcc accelerator.' + echo ' Argument is path to cross compiler.' + echo ' --memory $MEGS - Tell emulator to use this many megabytes of memory.' + echo ' Default is 128 megs for 32 bit targets, 256 megs for 64 bit.' + ) >&2 exit 1 fi
--- a/system-image.sh Fri Jan 16 02:28:05 2009 -0600 +++ b/system-image.sh Fri Jan 16 02:31:18 2009 -0600 @@ -32,7 +32,7 @@ setupfor linux [ -z "$BOOT_KARCH" ] && BOOT_KARCH="$KARCH" make ARCH="${BOOT_KARCH}" KCONFIG_ALLCONFIG="$(getconfig linux)" \ - allnoconfig > /dev/null || dienow + allnoconfig || dienow # Build kernel in parallel with initramfs @@ -52,9 +52,9 @@ (./my_gen_init_cpio <( "$SOURCES"/toys/gen_initramfs_list.sh "$NATIVE" [ ! -e "$NATIVE"/init ] && - echo "slink /init /bin/hello 755 0 0" # /$TOOLSDIR/sbin/init.sh 755 0 0" + echo "slink /init /$TOOLSDIR/sbin/init.sh 755 0 0" [ ! -d "$NATIVE"/dev ] && echo "dir /dev 755 0 0" - echo "nod /dev/console 640 0 0 c 5 1" + echo "nod /dev/console 660 0 0 c 5 1" ) || dienow ) | gzip -9 > initramfs_data.cpio.gz || dienow echo Initramfs generated. @@ -130,12 +130,12 @@ if [ "$SYSIMAGE_TYPE" != "initramfs" ] then HDA="-hda \"$1\" " - APPEND="root=/dev/$ROOT console=$CONSOLE rw init=/$TOOLSDIR/sbin/init.sh " + APPEND="root=/dev/$ROOT rw init=/$TOOLSDIR/sbin/init.sh " fi - echo "-nographic -no-reboot -kernel \"$2\" \$WITH_HDB $HDA" \ - "-append \"${APPEND}panic=1 PATH=\$DISTCC_PATH_PREFIX/$TOOLSDIR/bin" \ - '$KERNEL_EXTRA"' + echo "-nographic -no-reboot -kernel \"$2\" \$WITH_HDB \$MEMORY ${HDA}" \ + "-append \"${APPEND}panic=1 PATH=\$DISTCC_PATH_PREFIX/${TOOLSDIR}/bin" \ + "console=$CONSOLE \$KERNEL_EXTRA\"" } # Write out a script to call the appropriate emulator. We split out the