|
1 | 1 | #!/bin/busybox sh |
2 | 2 |
|
3 | | -KERNEL_VERSION=3.10-3-rpi |
4 | | - |
5 | 3 | # default options, can be overriden in installer-config.txt |
6 | 4 | preset=server |
7 | 5 | packages= |
@@ -496,21 +494,6 @@ echo "" |
496 | 494 | # there is no hw clock on rpi |
497 | 495 | echo "HWCLOCKACCESS=no" >> /rootfs/etc/default/hwclock || fail |
498 | 496 |
|
499 | | -echo "Configuring bootloader to start the installed system..." |
500 | | -mv /rootfs/boot/config.txt /rootfs/boot/config-reinstall.txt |
501 | | - |
502 | | -if [ -f /rootfs/vmlinuz ] ; then |
503 | | - # use latest kernel with initramfs in first boot |
504 | | - echo -n "Install new kernel and initramfs... " |
505 | | - cp /rootfs/vmlinuz /rootfs/boot/kernel.img |
506 | | - echo "OK" |
507 | | - echo "initramfs initrd.img-${KERNEL_VERSION}" > /rootfs/boot/config.txt |
508 | | -else |
509 | | - echo -n "Copying installer kernel to installed system... " |
510 | | - # use install kernel in first boot |
511 | | - cp /rootfs/boot/kernel_install.img /rootfs/boot/kernel.img || fail |
512 | | - echo "OK" |
513 | | -fi |
514 | 497 |
|
515 | 498 | # remove cdebootstrap-helper-rc.d which prevents rc.d scripts from running |
516 | 499 | echo -n "Removing cdebootstrap-helper-rc.d... " |
|
540 | 523 | # add reasonable default modules, works only after kernel is properly installed |
541 | 524 | echo "snd-bcm2835" >> /rootfs/etc/modules |
542 | 525 |
|
| 526 | +echo "Configuring bootloader to start the installed system..." |
| 527 | +mv /rootfs/boot/config.txt /rootfs/boot/config-reinstall.txt |
| 528 | + |
| 529 | +# find kernel/initramfs version |
| 530 | +KERNEL_VERSION=$(sed -n -e '/^Package: linux-image-rpi-rpfv$/,/Package: /{s/^Depends: .*linux-image-\(.*-rpi\).*$/\1/p}' /rootfs/var/lib/dpkg/status) |
| 531 | +echo "Kernel version: '${KERNEL_VERSION}'" |
| 532 | + |
| 533 | +if [ -f /rootfs/vmlinuz ] ; then |
| 534 | + # use latest kernel with initramfs in first boot |
| 535 | + echo -n "Copying new kernel to installed system... " |
| 536 | + cp /rootfs/vmlinuz /rootfs/boot/kernel.img |
| 537 | + echo "OK" |
| 538 | + echo -n "Specify new initramfs in config.txt... " |
| 539 | + echo "initramfs initrd.img-${KERNEL_VERSION}" > /rootfs/boot/config.txt |
| 540 | + echo "OK" |
| 541 | +else |
| 542 | + echo -n "Copying installer kernel to installed system... " |
| 543 | + # use install kernel in first boot |
| 544 | + cp /rootfs/boot/kernel_install.img /rootfs/boot/kernel.img || fail |
| 545 | + echo "OK" |
| 546 | +fi |
| 547 | + |
543 | 548 | # default cmdline.txt |
544 | 549 | echo -n "Creating default cmdline.txt... " |
545 | 550 | echo "$cmdline root=$rootpartition rootfstype=$rootfstype rootwait" > /rootfs/boot/cmdline.txt |
|
0 commit comments