diff options
author | Jason Kridner <jdk@ti.com> | 2011-11-15 07:29:24 -0600 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2011-11-15 14:34:21 +0100 |
commit | 5a27c486e99d347692b2c6986dd1558ab6ad7f5c (patch) | |
tree | 382ec535850a30cd06c566b2706c87577d1b157e /recipes-ti/beagleboard | |
parent | 215974bb9cac89c18a559e79047dd5feca881663 (diff) | |
download | meta-ti-5a27c486e99d347692b2c6986dd1558ab6ad7f5c.tar.gz |
gadget-init: create info.txt upon starting storage gadget
This creates a file called info.txt that saves some useful information
for image versioning, network connectivity and beginner user debugging.
Signed-off-by: Jason Kridner <jdk@ti.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'recipes-ti/beagleboard')
3 files changed, 37 insertions, 1 deletions
diff --git a/recipes-ti/beagleboard/gadget-init.bb b/recipes-ti/beagleboard/gadget-init.bb index 0d4682ef..16137fae 100644 --- a/recipes-ti/beagleboard/gadget-init.bb +++ b/recipes-ti/beagleboard/gadget-init.bb | |||
@@ -1,6 +1,6 @@ | |||
1 | DESCRIPTION = "Units to initialize usb gadgets" | 1 | DESCRIPTION = "Units to initialize usb gadgets" |
2 | 2 | ||
3 | PR = "r11" | 3 | PR = "r12" |
4 | 4 | ||
5 | LICENSE = "MIT" | 5 | LICENSE = "MIT" |
6 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" | 6 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" |
@@ -19,6 +19,7 @@ SRC_URI = "file://storage-gadget-init.service \ | |||
19 | file://g-storage-reinsert.sh \ | 19 | file://g-storage-reinsert.sh \ |
20 | file://g-ether-start-service.sh \ | 20 | file://g-ether-start-service.sh \ |
21 | file://g-ether-load.sh \ | 21 | file://g-ether-load.sh \ |
22 | file://update-image-info-on-mmcblk0p1.sh \ | ||
22 | " | 23 | " |
23 | 24 | ||
24 | do_install() { | 25 | do_install() { |
@@ -46,6 +47,7 @@ FILES_${PN} = "${sysconfdir}/udev/rules.d/99-hokey-pokey.rules \ | |||
46 | FILES_${PN}-storage = "${base_libdir}/systemd/system/storage-gadget-init.service \ | 47 | FILES_${PN}-storage = "${base_libdir}/systemd/system/storage-gadget-init.service \ |
47 | ${base_libdir}/systemd/system/basic.target.wants/storage-gadget-init.service \ | 48 | ${base_libdir}/systemd/system/basic.target.wants/storage-gadget-init.service \ |
48 | ${bindir}/g-storage-reinsert.sh \ | 49 | ${bindir}/g-storage-reinsert.sh \ |
50 | ${bindir}/update-image-info-on-mmcblk0p1.sh \ | ||
49 | ${sysconfdir}/udev/rules.d/bone-gmass-eject.rules" | 51 | ${sysconfdir}/udev/rules.d/bone-gmass-eject.rules" |
50 | 52 | ||
51 | FILES_${PN}-network = "${base_libdir}/systemd/system/network-gadget-init.service \ | 53 | FILES_${PN}-network = "${base_libdir}/systemd/system/network-gadget-init.service \ |
diff --git a/recipes-ti/beagleboard/gadget-init/storage-gadget-init.service b/recipes-ti/beagleboard/gadget-init/storage-gadget-init.service index 9a8513e8..601e0d7c 100644 --- a/recipes-ti/beagleboard/gadget-init/storage-gadget-init.service +++ b/recipes-ti/beagleboard/gadget-init/storage-gadget-init.service | |||
@@ -4,6 +4,7 @@ After=dev-mmcblk0p1.device | |||
4 | 4 | ||
5 | [Service] | 5 | [Service] |
6 | RemainAfterExit=yes | 6 | RemainAfterExit=yes |
7 | ExecStartPre=/usr/bin/update-image-info-on-mmcblk0p1.sh | ||
7 | ExecStart=/sbin/modprobe g_mass_storage file=/dev/mmcblk0p1 cdrom=0 stall=0 removable=1 nofua=1 | 8 | ExecStart=/sbin/modprobe g_mass_storage file=/dev/mmcblk0p1 cdrom=0 stall=0 removable=1 nofua=1 |
8 | ExecStop=/sbin/rmmod g_mass_storage | 9 | ExecStop=/sbin/rmmod g_mass_storage |
9 | 10 | ||
diff --git a/recipes-ti/beagleboard/gadget-init/update-image-info-on-mmcblk0p1.sh b/recipes-ti/beagleboard/gadget-init/update-image-info-on-mmcblk0p1.sh new file mode 100755 index 00000000..62aab39e --- /dev/null +++ b/recipes-ti/beagleboard/gadget-init/update-image-info-on-mmcblk0p1.sh | |||
@@ -0,0 +1,33 @@ | |||
1 | #!/bin/sh | ||
2 | mount /dev/mmcblk0p1 /mnt | ||
3 | echo "Image info snapshot" > /mnt/info.txt | ||
4 | |||
5 | echo >> /mnt/info.txt | ||
6 | echo "/etc/angstrom-version:" >> /mnt/info.txt | ||
7 | cat /etc/angstrom-version >> /mnt/info.txt | ||
8 | |||
9 | echo >> /mnt/info.txt | ||
10 | echo "/proc/cpuinfo:" >> /mnt/info.txt | ||
11 | cat /proc/cpuinfo >> /mnt/info.txt | ||
12 | |||
13 | echo >> /mnt/info.txt | ||
14 | echo "uname -a:" >> /mnt/info.txt | ||
15 | uname -a >> /mnt/info.txt | ||
16 | |||
17 | echo >> /mnt/info.txt | ||
18 | echo "/proc/cmdline:" >> /mnt/info.txt | ||
19 | cat /proc/cmdline >> /mnt/info.txt | ||
20 | |||
21 | echo >> /mnt/info.txt | ||
22 | echo "ifconfig:" >> /mnt/info.txt | ||
23 | ifconfig >> /mnt/info.txt | ||
24 | |||
25 | echo >> /mnt/info.txt | ||
26 | echo "/etc/angstrom-build-info:" >> /mnt/info.txt | ||
27 | cat /etc/angstrom-build-info >> /mnt/info.txt | ||
28 | |||
29 | echo >> /mnt/info.txt | ||
30 | echo "opkg list-installed:" >> /mnt/info.txt | ||
31 | opkg list-installed >> /mnt/info.txt | ||
32 | |||
33 | umount /mnt | ||