Browse Source

Extended Raspi config, fixed flash.sh script

Thomas Buck 8 years ago
parent
commit
6c21349297
2 changed files with 43 additions and 47 deletions
  1. 6
    17
      configs/raspi_defconfig
  2. 37
    30
      flash.sh

+ 6
- 17
configs/raspi_defconfig View File

1
 BR2_arm=y
1
 BR2_arm=y
2
 BR2_arm1176jzf_s=y
2
 BR2_arm1176jzf_s=y
3
-BR2_ARM_EABIHF=y
4
-
5
 BR2_DL_DIR="$(HOME)/.buildroot-dl"
3
 BR2_DL_DIR="$(HOME)/.buildroot-dl"
6
 BR2_CCACHE=y
4
 BR2_CCACHE=y
7
-
5
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y
6
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
8
 BR2_TARGET_GENERIC_HOSTNAME="raspberrypi"
7
 BR2_TARGET_GENERIC_HOSTNAME="raspberrypi"
9
 BR2_TARGET_GENERIC_ISSUE="Welcome to the CamCorder"
8
 BR2_TARGET_GENERIC_ISSUE="Welcome to the CamCorder"
10
 BR2_TARGET_GENERIC_ROOT_PASSWD="camcorder"
9
 BR2_TARGET_GENERIC_ROOT_PASSWD="camcorder"
11
-
12
 BR2_TARGET_GENERIC_GETTY_PORT="tty1"
10
 BR2_TARGET_GENERIC_GETTY_PORT="tty1"
13
-
14
-# Linux headers same as kernel, a 4.1 series
15
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y
16
-
17
-BR2_TOOLCHAIN_BUILDROOT_CXX=y
18
-
11
+BR2_SYSTEM_DHCP="eth0"
12
+BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL)/board/raspi/post_image.sh"
19
 BR2_LINUX_KERNEL=y
13
 BR2_LINUX_KERNEL=y
20
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
14
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
21
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux.git"
15
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux.git"
22
 BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d33d0293e245badc4ca6ede3984d8bb8ea63cb1a"
16
 BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d33d0293e245badc4ca6ede3984d8bb8ea63cb1a"
23
 BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi"
17
 BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi"
24
 BR2_LINUX_KERNEL_ZIMAGE=y
18
 BR2_LINUX_KERNEL_ZIMAGE=y
25
-
26
-# Build the DTBs for A/B, A+/B+ and compute module from the kernel sources
27
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
19
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
28
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-b bcm2708-rpi-b-plus bcm2708-rpi-cm"
20
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-b bcm2708-rpi-b-plus bcm2708-rpi-cm"
29
-
30
-BR2_PACKAGE_RPI_FIRMWARE=y
31
-# BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS is not set
32
-
33
 BR2_PACKAGE_FFMPEG=y
21
 BR2_PACKAGE_FFMPEG=y
34
 BR2_PACKAGE_FFMPEG_SWSCALE=y
22
 BR2_PACKAGE_FFMPEG_SWSCALE=y
35
-
23
+BR2_PACKAGE_RPI_FIRMWARE=y
24
+# BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS is not set

+ 37
- 30
flash.sh View File

14
 echo Overwriting old partition table
14
 echo Overwriting old partition table
15
 sudo dd if=/dev/zero of=$1 bs=1024 count=1024
15
 sudo dd if=/dev/zero of=$1 bs=1024 count=1024
16
 
16
 
17
-echo Recreating new partition table
18
-sudo fdisk $1 << EOF
19
-n
20
-p
21
-1
22
-
23
-+16MB
24
-t
25
-53
26
-n
27
-p
28
-2
29
-
30
-
31
-w
17
+if [ -e output/images/u-boot.sd ] ; then
18
+	echo Recreating new partition table
19
+	sed 's/#.*//' << EOF | tr -d " \t"  | sudo fdisk $1
20
+		n	# new partition
21
+		p	# primary partition
22
+		1	# number 1
23
+			# default start
24
+		+16M	# 16MB
25
+		t	# New Type field
26
+		53	# OnTrack DM6 Aux3
27
+		n	# new partition
28
+		p	# primary partition
29
+		2	# number 2
30
+			# default start
31
+			# default size
32
+		w	# write changes
32
 EOF
33
 EOF
33
 
34
 
34
-if [ -e output/images/imx23_olinuxino_dev_linux.sb ] ; then
35
-	echo Writing mxs-bootlet bootstream
36
-	sudo dd if=output/images/imx23_olinuxino_dev_linux.sb bs=512 of="$1"1 seek=4
37
-elif [ -e output/images/u-boot.sd ] ; then
38
 	echo Writing U-Boot bootstream
35
 	echo Writing U-Boot bootstream
39
 	sudo dd if=output/images/u-boot.sd of="$1"1
36
 	sudo dd if=output/images/u-boot.sd of="$1"1
40
-elif [ -e output/images/ ] ; then
41
-    echo Creaeting boot filesystem
42
-    sudo mkfs.vfat -F 16 -n boot "$1"1
37
+elif [ -d output/images/rpi-firmware ] ; then
38
+	SIZE=`sudo fdisk -l $1 | grep Disk | grep bytes | awk '{print $5}'`	
39
+	echo Disk size: $SIZE bytes
40
+	CYLINDERS=`echo $SIZE/255/63/512 | bc`
41
+	echo Cylinders: $CYLINDERS
42
+
43
+	sed 's/#.*//' << EOF | tr -d " \t"  | sudo sfdisk -D -H 255 -S 63 -C $CYLINDERS $1
44
+		,9,0x0C,*	# From http://downloads.angstrom-distribution.org/demo/beaglebone/mkcard.txt
45
+		,,,-		# Found in http://elinux.org/RPi_Advanced_Setup#Advanced_SD_card_setup
46
+EOF
47
+
48
+	echo Creaeting boot filesystem
49
+	sudo mkfs.vfat -F 32 -n boot "$1"1
43
 
50
 
44
-    echo Mounting boot filesystem
51
+	echo Mounting boot filesystem
45
 	sudo mkdir -p /media/boot
52
 	sudo mkdir -p /media/boot
46
 	sudo mount "$1"1 /media/boot
53
 	sudo mount "$1"1 /media/boot
47
 
54
 
48
-    echo Copying bootloader files
49
-    sudo cp output/images/rpi-firmware/* /media/boot/
50
-    sudo cp output/images/*.dtb /media/boot/
55
+	echo Copying bootloader files
56
+	sudo cp output/images/rpi-firmware/* /media/boot/
57
+	sudo cp output/images/*.dtb /media/boot/
51
 
58
 
52
-    echo Preparing and copying Kernel Image
53
-    output/host/usr/bin/mkknlimg output/images/zImage /media/boot/zImage
59
+	echo Preparing and copying Kernel Image
60
+	sudo output/host/usr/bin/mkknlimg output/images/zImage /media/boot/zImage
54
 
61
 
55
-    echo Synchronising changes to disk
62
+	echo Synchronising changes to disk
56
 	sudo sync
63
 	sudo sync
57
 
64
 
58
 	echo Unmounting boot filesystem
65
 	echo Unmounting boot filesystem
86
 	echo Synchronising changes to disk
93
 	echo Synchronising changes to disk
87
 	sudo sync
94
 	sudo sync
88
 else
95
 else
89
-    echo Could not find a suitable root filesystem!
96
+	echo Could not find a suitable root filesystem!
90
 fi
97
 fi
91
 
98
 

Loading…
Cancel
Save