Re-enable updates of the system

- run che system, get a shell, shutdown, quit qemu nicely
- add kernel config to build a working kernel for qemu
pull/10/head 1.0
Raphaël Vinot 2014-05-09 18:43:33 +02:00
parent e5cd809325
commit 9b08b1dd8f
6 changed files with 2193 additions and 14 deletions

View File

@ -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

View File

@ -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

19
get_shell.exp Executable file
View File

@ -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"

View File

@ -11,7 +11,6 @@ if [ "$(id -u)" != "0" ]; then
fi
set -e
set -x
./mount_image.sh ./copy_force_shell.sh
@ -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}

2166
kernel_config/config Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
set timeout -1
spawn qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb \
spawn qemu-system-arm -kernel 140509-kernel -cpu arm1176 -m 256 -M versatilepb \
-append "root=/dev/sdc2 panic=1 rootfstype=ext4 ro console=ttyAMA0 console=ttyS0" \
-drive file=[lindex $argv 1],index=0,media=disk \
-drive file=[lindex $argv 2],index=1,media=disk \
@ -12,6 +12,6 @@ spawn qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb \
-chardev socket,id=mon1,host=localhost,port=4444,server,nowait \
-mon chardev=mon1,mode=control,pretty=on
expect "System halted."
expect "reboot: System halted"
send "quit\n"