~ubuntu-branches/ubuntu/wily/rootstock/wily

« back to all changes in this revision

Viewing changes to rootstock

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2010-03-05 10:31:56 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100305103156-7183iluikgdbrbv0
Tags: 0.1.99.2-0ubuntu1
* New upstream bugfix release
 - use ext3 for qemu images if --keepimage is used (LP: #437619)
 - use proper apt caret syntax for tasks
 - set proper application icons for gtk windows
 - make rootstock-gtk build in (LP: #532342) $TMPDIR or fall back to /tmp
 - rework strings of error and success dialogs
 - make output directory selectable (LP: #532342)
 - split progress handling into its various stages in  GUI
 - handle term signal in trap code in rootstock script
 - enable archive kernel for lucid builds in rootstock script and use it for
   all distro releases
 - determine UUID of image and write to fstab inside the rootfs if
   --keepimage is used
 - do not use a swapfile by default (changes --noswap to --do-swap)
 - move .desktop file to System->Settings category (LP: #532343)
 - disable profile load/save UI entries, the feature is not there yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
set -e
34
34
 
35
 
trap cleanup 1 2 3 6
 
35
trap cleanup 1 2 3 6 15
36
36
 
37
37
cleanup()
38
38
{
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)
124
 
--noswap
125
 
    Do not create a swapfile in tmpfs for the virtual machine
 
124
--doswap
 
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
128
128
    (default: 256M)
187
187
{
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)
191
192
}
192
193
 
193
194
mount_image()
286
287
    mkfifo $QEMUFIFO
287
288
 
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
292
 
        VMCPU=""
293
 
    fi
294
291
    if [ -n "$SWAPFILE" ];then
295
292
        SWAPDEV="-hdb $SWAPFILE"
296
293
    fi
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"
299
296
 
300
297
    qemu-system-arm $QEMUOPTS -append "${APPEND}" >$QEMUFIFO 2>&1 &
301
298
 
386
383
    if [ "$RESTORE_PACKAGE_CACHE" ];then
387
384
        cp $CACHEDIR/vmkernel/qemu-vmlinuz $BUILDDIR/qemu-vmlinuz
388
385
    else
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"
393
 
        fi
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}"
399
 
 
400
 
            mkdir -p ${BUILDDIR}/kernel-tmpdir
401
 
 
402
 
            wget -q -O "${BUILDDIR}/kernel-tmpdir/${PKG_FILE}" $PKGS
403
 
 
404
 
            KERNEL_DEB=$(zcat "${BUILDDIR}/kernel-tmpdir/${PKG_FILE}"|grep-dctrl linux-image -a versatile -s Filename -|sed 's/^.* //')
405
 
 
406
 
            wget -q -O "${BUILDDIR}/kernel-tmpdir/$(basename $KERNEL_DEB)" $SERVER/$KERNEL_DEB
407
 
 
408
 
            dpkg -x "${BUILDDIR}/kernel-tmpdir/$(basename $KERNEL_DEB)" $BUILDDIR/kernel-tmpdir/
409
 
            mv $BUILDDIR/kernel-tmpdir/boot/vmlinuz* $BUILDDIR/qemu-vmlinuz
410
 
 
411
 
            rm -rf $BUILDDIR/kernel-tmpdir
412
 
        else
413
 
            LANG=C wget -O $BUILDDIR/qemu-vmlinuz $KERNEL >>$LOG 2>&1
414
 
        fi
 
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/
550
523
DBPID="${BUILDDIR}/debootstrap.pid"
551
524
DBFIFO="${BUILDDIR}/dbfifo"
552
525
DIR="$(pwd)"
 
526
NOSWAP=1
553
527
SWAPSIZE=256
554
528
 
555
529
# general defaults
681
655
            fi
682
656
            SERIAL=1
683
657
            ;;
684
 
        --noswap)
685
 
            NOSWAP=1
 
658
        --doswap)
 
659
            NOSWAP=""
686
660
            ;;
687
661
        --swapsize)
688
662
            checkparm $2
738
712
 
739
713
PW=$(perl -e 'print crypt($ARGV[0], "qemuonarm")', $PASSWD)
740
714
 
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"
751
726
 
752
727
apt-get install -y --no-install-recommends $PACKAGE'
753
728
    OEM_CONFIG_ENABLE="touch /var/lib/oem-config/run
754
 
rm /usr/lib/ubiquity/plugins/ubi-network.py*
755
729
rm /usr/lib/ubiquity/plugins/ubi-tasks.py*"
756
730
fi
757
731
 
774
748
 
775
749
# basic fstab
776
750
echo "proc /proc proc defaults 0 0" >$MOUNTPOINT/etc/fstab
 
751
if [ "$KEEPIMAGE" ];then
 
752
    echo "UUID=${VOLID} / auto errors=remount-ro 0 1" >>$MOUNTPOINT/etc/fstab
 
753
fi
777
754
 
778
755
# set up basic networking
779
756
NETWORKDIR="$MOUNTPOINT/etc/network"
799
776
#!/bin/bash
800
777
set -e
801
778
 
 
779
export MALLOC_CHECK_=0 # workaround for LP: #520465
802
780
export PATH
803
781
export LC_ALL=C
804
782
export DEBIAN_FRONTEND=noninteractive
846
824
 
847
825
${PACKAGE_CLEANUP}
848
826
 
 
827
PKGCOUNT=\$(LANG=C apt-get -s install ${SELECTION} |grep "newly installed"|cut -d ',' -f2|tr -d ' [a-z]')
 
828
echo "packagecount=\${PKGCOUNT:-1}"
849
829
[ -z "${SELECTION}" ] || apt-get -y ${APT_FORCE} install ${SELECTION}
850
830
 
851
831
${KERNEL_IMAGE_CMD}
870
850
    rm -f /rootstock-user-script
871
851
fi
872
852
 
873
 
mount -n -o remount,ro -t ext2 /dev/sda / || true
 
853
mount -n -o remount,ro -t ext3 /dev/sda / || true
874
854
 
875
855
rm /bin/installer && reboot -fp
876
856