Skip to content

Commit

Permalink
Re-enable updates of the system
Browse files Browse the repository at this point in the history
- run che system, get a shell, shutdown, quit qemu nicely
- add kernel config to build a working kernel for qemu
  • Loading branch information
Rafiot committed May 9, 2014
1 parent e5cd809 commit 9b08b1d
Show file tree
Hide file tree
Showing 6 changed files with 2,193 additions and 14 deletions.
4 changes: 2 additions & 2 deletions fs_shell/etc/fstab
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat rw,defaults 0 0
/dev/mmcblk0p2 / ext4 rw,defaults,noatime 0 0
/dev/sda1 /boot vfat rw,defaults 0 1
/dev/sda2 / ext4 rw,defaults,noatime 0 1
tmpfs /tmp tmpfs rw,size=64M,noexec,nodev,nosuid,mode=1777 0 0
# a swapfile is not a swap partition, so no using swapon|off from here on, use dphys-swapfile swap[on|off] for that
8 changes: 3 additions & 5 deletions fs_shell/etc/rc.local
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
#!/bin/bash

set -e

cleanup(){
apt-get autoremove -y
apt-get autoclean -y
apt-get clean -y

/sbin/shutdown -h now
/sbin/shutdown -P -h now
}


trap TERM EXIT
trap cleanup INT TERM EXIT

apt-get update -y
apt-get dist-upgrade
apt-get dist-upgrade -y


/bin/bash
Expand Down
19 changes: 19 additions & 0 deletions get_shell.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/expect -f

set timeout -1

spawn qemu-system-arm -kernel tests/140509-kernel -cpu arm1176 -m 256 -M versatilepb \
-append "root=/dev/sda2 panic=1 rootfstype=ext4 rw console=ttyAMA0 console=ttyS0" \
-drive file=[lindex $argv 0],index=0,media=disk \
-monitor telnet:localhost:4444,server,nowait \
-nographic

expect "root@raspberrypi:/#"

interact +++ return

send "\r"

expect "reboot: System halted"

send "echo quit | telnet localhost 4444"
6 changes: 1 addition & 5 deletions get_shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if [ "$(id -u)" != "0" ]; then
fi

set -e
set -x

./mount_image.sh ./copy_force_shell.sh

Expand All @@ -34,9 +33,6 @@ mount -o loop,offset=${OFFSET_ROOTFS} ${IMAGE} ${SETUP_DIR}
mv ${SETUP_DIR}/etc/ld.so.preload ${SETUP_DIR}/etc/ld.so.preload_bkp
umount ${SETUP_DIR}

qemu-system-arm -kernel tests/kernel-qemu -cpu arm1176 -m 256 -M versatilepb \
-append "root=/dev/sda2 panic=1 rootfstype=ext4 rw console=ttyAMA0 console=ttyS0" \
-drive file=${IMAGE},index=0,media=disk \
-nographic
./get_shell.exp ${IMAGE}


Loading

0 comments on commit 9b08b1d

Please sign in to comment.