121
121
Run this script at the end of the installation process
122
122
--serial <devicename>
123
123
Create a serial tty of <devicename> inside the rootfs for login (i.e. ttyS0)
125
Do not create a swapfile in tmpfs for the virtual machine
125
Do create a swapfile in tmpfs for the virtual machine
126
126
--swapsize <size in megabyte>
127
127
Use a different size for the swapfile used by the virtual machine
188
188
[ $QUIET ] || echo "I: Creating temporary Image"
189
189
LANG=C qemu-img create $IMAGENAME $IMAGESIZE >$LOG 2>&1
190
LANG=C mkfs.ext2 -F $IMAGENAME >>$LOG 2>&1
190
LANG=C mkfs.ext3 -F $IMAGENAME >>$LOG 2>&1
191
VOLID=$(blkid -o value $IMAGENAME|head -1)
288
289
[ $QUIET ] || echo "I: Switching to Virtual Machine for second stage processing"
289
# jaunty requires v5, karmic v6 and VFP, lucid and later v7
290
290
VMCPU="cortex-a8"
291
if [ "$DIST" = "jaunty" ];then
294
291
if [ -n "$SWAPFILE" ];then
295
292
SWAPDEV="-hdb $SWAPFILE"
297
QEMUOPTS="-M versatilepb ${VMCPU:+-cpu $VMCPU} -kernel ${BUILDDIR}/qemu-vmlinuz -no-reboot -nographic -pidfile ${QEMUPID} -hda ${IMAGENAME} ${SWAPDEV} -m 256M"
298
APPEND="console=ttyAMA0,115200n8 root=/dev/sda rw init=/bin/installer quiet"
294
QEMUOPTS="-M versatilepb ${VMCPU:+-cpu $VMCPU} -kernel ${BUILDDIR}/qemu-vmlinuz -no-reboot -nographic -pidfile ${QEMUPID} -hda ${IMAGENAME} ${SWAPDEV} -m 256"
295
APPEND="console=ttyAMA0,115200n8 root=/dev/sda rw mem=256M devtmpfs.mount=0 init=/bin/installer quiet"
300
297
qemu-system-arm $QEMUOPTS -append "${APPEND}" >$QEMUFIFO 2>&1 &
386
383
if [ "$RESTORE_PACKAGE_CACHE" ];then
387
384
cp $CACHEDIR/vmkernel/qemu-vmlinuz $BUILDDIR/qemu-vmlinuz
389
# jaunty requires v5, karmic v6 and VFP, lucid and later v7
390
KERNEL="http://people.canonical.com/~ogra/arm/qemu/vmlinuz-2.6.31-rc3versatile1-cortex-a8"
391
if [ "$DIST" = "jaunty" ];then
392
KERNEL="http://people.canonical.com/~ogra//arm/qemu/kernel/vmlinuz-2.6.28-versatile"
394
# below code is disabled temporary until lucid versatile package is fixed.
395
if [ "$DIST" = "xxxlucid" ];then
396
SERVER="http://ports.ubuntu.com"
397
PKG_FILE="Packages.gz"
398
PKGS="${SERVER}/dists/${DIST}/main/binary-armel/${PKG_FILE}"
400
mkdir -p ${BUILDDIR}/kernel-tmpdir
402
wget -q -O "${BUILDDIR}/kernel-tmpdir/${PKG_FILE}" $PKGS
404
KERNEL_DEB=$(zcat "${BUILDDIR}/kernel-tmpdir/${PKG_FILE}"|grep-dctrl linux-image -a versatile -s Filename -|sed 's/^.* //')
406
wget -q -O "${BUILDDIR}/kernel-tmpdir/$(basename $KERNEL_DEB)" $SERVER/$KERNEL_DEB
408
dpkg -x "${BUILDDIR}/kernel-tmpdir/$(basename $KERNEL_DEB)" $BUILDDIR/kernel-tmpdir/
409
mv $BUILDDIR/kernel-tmpdir/boot/vmlinuz* $BUILDDIR/qemu-vmlinuz
411
rm -rf $BUILDDIR/kernel-tmpdir
413
LANG=C wget -O $BUILDDIR/qemu-vmlinuz $KERNEL >>$LOG 2>&1
386
KERNEL="http://ports.ubuntu.com/ubuntu-ports/dists/lucid/main/installer-armel/current/images/versatile/netboot/vmlinuz"
387
LANG=C wget -O $BUILDDIR/qemu-vmlinuz $KERNEL >>$LOG 2>&1
415
388
if [ "$COPY_PACKAGE_CACHE" ];then
416
389
mkdir -p $CACHEDIR/vmkernel/
417
390
cp $BUILDDIR/qemu-vmlinuz $CACHEDIR/vmkernel/
739
713
PW=$(perl -e 'print crypt($ARGV[0], "qemuonarm")', $PASSWD)
741
USERADD_CMD="useradd -G ${DEFGROUPS} -s /bin/bash -m -p ${PW} -c "${FULLNAME}" ${NEWUSER} || true"
715
USERADD_CMD="useradd -G ${DEFGROUPS} -s /bin/bash -m -p ${PW} -c \"${FULLNAME}\" ${NEWUSER} || true"
742
716
if [ ! "${NEWUSER}" ] || [ ! "${PASSWD}" ];then
743
717
USERADD_CMD='PACKAGE="oem-config"
718
echo "I: Enabling firstboot configuration"
744
719
if [ -n "$(dpkg -l xserver-xorg 2>/dev/null|grep ^ii)" ];then
745
720
if [ $(which gdm) ];then
746
721
PACKAGE="oem-config-gtk"
870
850
rm -f /rootstock-user-script
873
mount -n -o remount,ro -t ext2 /dev/sda / || true
853
mount -n -o remount,ro -t ext3 /dev/sda / || true
875
855
rm /bin/installer && reboot -fp