Browse Source

No generic beaglebone setup

Bob Mottram 8 years ago
parent
commit
bbd3a78570
1 changed files with 35 additions and 8 deletions
  1. 35
    8
      src/freedombone-image-hardware-setup

+ 35
- 8
src/freedombone-image-hardware-setup View File

@@ -176,6 +176,35 @@ beaglebone_repack_kernel() {
176 176
              -d $initRd uInitrd )
177 177
 }
178 178
 
179
+beaglebone_wireless_repack_kernel() {
180
+    echo "info: repacking beaglebone wireless kernel and initrd"
181
+
182
+    kernelVersion=$(ls /usr/lib/*/am335x-boneblack-wireless.dtb | head -1 | cut -d/ -f4)
183
+    version=$(echo $kernelVersion | sed 's/linux-image-\(.*\)/\1/')
184
+    initRd=initrd.img-$version
185
+    vmlinuz=vmlinuz-$version
186
+
187
+    mkdir /tmp/initrd-repack
188
+
189
+    (cd /tmp/initrd-repack ; \
190
+     zcat /boot/$initRd | cpio -i ; \
191
+     rm -f conf/param.conf ; \
192
+     find . | cpio --quiet -o -H newc | \
193
+         gzip -9 > /boot/$initRd )
194
+
195
+    rm -rf /tmp/initrd-repack
196
+
197
+    (cd /boot ; \
198
+     cp /usr/lib/$kernelVersion/am335x-boneblack-wireless.dtb dtb ; \
199
+     cat $vmlinuz dtb >> temp-kernel ; \
200
+     mkimage -A arm -O linux -T kernel -n "Debian kernel ${version}" \
201
+             -C none -a 0x82000000 -e 0x82000000 -d temp-kernel uImage ; \
202
+     rm -f temp-kernel ; \
203
+     mkimage -A arm -O linux -T ramdisk -C gzip -a 0x88080000 -e 0x88080000 \
204
+             -n "Debian ramdisk ${version}" \
205
+             -d $initRd uInitrd )
206
+}
207
+
179 208
 a20_setup_boot() {
180 209
     dtb="$1"
181 210
 
@@ -233,20 +262,18 @@ EOF
233 262
     echo "rtc_sunxi" >> /etc/initramfs-tools/modules
234 263
 }
235 264
 
236
-function generic_beaglebone_steup {
237
-    beaglebone_flash
238
-    beaglebone_repack_kernel
239
-    enable_serial_console ttyO0
240
-}
241
-
242 265
 case "$MACHINE" in
243 266
     beaglebone)
244 267
         beaglebone_setup_boot
245
-        generic_beaglebone_steup
268
+        beaglebone_flash
269
+        beaglebone_repack_kernel
270
+        enable_serial_console ttyO0
246 271
         ;;
247 272
     beaglebonewifi)
248 273
         beaglebone_wireless_setup_boot
249
-        generic_beaglebone_steup
274
+        beaglebone_flash
275
+        beaglebone_wireless_repack_kernel
276
+        enable_serial_console ttyO0
250 277
         ;;
251 278
     cubietruck)
252 279
         a20_setup_boot sun7i-a20-cubietruck.dtb