Closed toddtreece closed 9 years ago
This looks solid. Testing now; will report back.
Installs, boots clean on Pi 2, allows for installation of new packages without getting stuck in dependency hell. Dig the way the tarball-plus-install.sh thing worked out. Nice work.
pi@raspberrypi ~/kernels/custom_kernel_1.20150208-1 $ sudo ./install.sh \ Installing custom kernel ** (Reading database ... 82113 files and directories currently installed.) Preparing to replace raspberrypi-bootloader 1.20150130-1 (using raspberrypi-boot loader_1.20150208-1_armhf.deb) ... /bin/sh: 0: Illegal option - dpkg: error processing raspberrypi-bootloader_1.20150208-1_armhf.deb (--install) : subprocess new pre-installation script returned error exit status 2 No diversion 'diversion of /boot/COPYING.linux by rpikernelhack', none removed. No diversion 'diversion of /boot/LICENCE.broadcom by rpikernelhack', none remove d. No diversion 'diversion of /boot/bcm2708-rpi-b-plus.dtb by rpikernelhack', none removed. No diversion 'diversion of /boot/bcm2708-rpi-b.dtb by rpikernelhack', none remov ed. No diversion 'diversion of /boot/bcm2709-rpi-2-b.dtb by rpikernelhack', none rem oved. No diversion 'diversion of /boot/bootcode.bin by rpikernelhack', none removed. No diversion 'diversion of /boot/fixup.dat by rpikernelhack', none removed. No diversion 'diversion of /boot/fixup_cd.dat by rpikernelhack', none removed. No diversion 'diversion of /boot/fixup_x.dat by rpikernelhack', none removed. No diversion 'diversion of /boot/kernel.img by rpikernelhack', none removed. No diversion 'diversion of /boot/kernel7.img by rpikernelhack', none removed. No diversion 'diversion of /boot/start.elf by rpikernelhack', none removed. No diversion 'diversion of /boot/start_cd.elf by rpikernelhack', none removed. No diversion 'diversion of /boot/start_x.elf by rpikernelhack', none removed. No diversion 'diversion of /boot/overlays/README by rpikernelhack', none removed . No diversion 'diversion of /boot/overlays/hifiberry-amp-overlay.dtb by rpikernel hack', none removed. No diversion 'diversion of /boot/overlays/hifiberry-dac-overlay.dtb by rpikernel hack', none removed. No diversion 'diversion of /boot/overlays/hifiberry-dacplus-overlay.dtb by rpike rnelhack', none removed. No diversion 'diversion of /boot/overlays/hifiberry-digi-overlay.dtb by rpikerne lhack', none removed. No diversion 'diversion of /boot/overlays/iqaudio-dac-overlay.dtb by rpikernelha ck', none removed. No diversion 'diversion of /boot/overlays/iqaudio-dacplus-overlay.dtb by rpikern elhack', none removed. No diversion 'diversion of /boot/overlays/lirc-rpi-overlay.dtb by rpikernelhack' , none removed. No diversion 'diversion of /boot/overlays/pcf8523-rtc-overlay.dtb by rpikernelha ck', none removed. No diversion 'diversion of /boot/overlays/pps-gpio-overlay.dtb by rpikernelhack' , none removed. No diversion 'diversion of /boot/overlays/w1-gpio-overlay.dtb by rpikernelhack', none removed. No diversion 'diversion of /boot/overlays/w1-gpio-pullup-overlay.dtb by rpikerne lhack', none removed. Errors were encountered while processing: raspberrypi-bootloader_1.20150208-1_armhf.deb Error completing: dpkg
@ladyada weird. i just ran the install again on a pi 1 and it went fine. i see the raspberrypi-bootloader
pre-install script died on yours because it looks like /bin/sh
didn't know how to deal with -e
on your pi. what do you get for sh
if you try this?
$ cd /bin
$ ls -l | grep " sh "
I get a symlink to dash
:
pi@raspberrypi /bin $ ls -l | grep " sh "
lrwxrwxrwx 1 root root 4 Mar 30 2012 sh -> dash
i've also been testing with a fresh copy of the latest raspbian on both pi v1 and v2, so maybe there's a difference if you are running an older copy. thanks for testing this out @brennen & @ladyada!
yeah this is bizarre. lrwxrwxrwx 1 root root 4 Mar 29 2012 sh -> dash
and
pi@raspberrypi ~ $ apt-cache policy dash
dash:
Installed: 0.5.7-3
Candidate: 0.5.7-3
Version table:
*** 0.5.7-3 0
500 http://mirrordirector.raspbian.org/raspbian/ wheezy/main armhf Packages
100 /var/lib/dpkg/status
and
pi@raspberrypi ~ $ dash
$ echo -e "hello\nworld"
-e hello
world
note i have not installed occidentalis/bootstrap - we should probably assume that users don't have that installed.../or/ tell them its required before installing (but better to not require!)
also, by chance do you guys have any personal dotfiles?
by chance do you guys have any personal dotfiles?
Hmm. Definitely not on either of my test images. I'll start with a fresh one though and see if I can reproduce.
ok i have used this Pi 1 for some development, it could be me. will image a fresh raspbian in a bit
@ladyada nope. no dotfiles here, and i think the only thing i changed on the image was manually configuring wifi and installing vim.
i'm not sure what you both are using to image, but using pv
with dd
recently changed my life. dd
is no longer a black box, which is nice.
$ pv 2015-01-31-raspbian.img | sudo dd bs=1m of=/dev/disk2
@ladyada & @brennen: i think i just figured it out. i'm pretty sure CRLF struck again. maybe try running dos2unix
on the install.sh file from the pi, and then try running it again.
i'll add the install script to .gitattributes
. grumble.
?? even though its tgz'd in vagrant? ok will try soon!
@ladyada i'm referring to the wrong script that's breaking. .gitattributes
correctly sets line endings for *.sh
, which covers install.sh
, but the preinst & postinst overrides in the debian folder don't have that file extension so they are missed by .gitattributes
and converted to CRLF.
the .gitattributes
file should now have the proper info after a pull on this branch, but i think the .deb
files will need a rebuild since the scripts are packaged with them. i'm glad we caught this bug now.
note to self: if unexplainable weird stuff is happening with shell scripts, it's git on windows doing its auto LF -> CRLF magic.
sigh ok lemme do this up again :)
Argh. Gah, sorry, I got caught up in it being 70° and sunny out in front of my apartment. Anyway, I think we should have a short bug checklist for these projects that starts with "is it line endings?"
go outside NERD! :)
not sure why i/my pi is so cursed...i swapped out power supplies and at least do not get a kernel panic on install. still getting the /bin/sh complaint
pi@raspberrypi:~/custom_kernel_1.20150208-1$ sudo ./install.sh \ Installing custom kernel ** (Reading database ... 76944 files and directories currently installed.) Preparing to replace raspberrypi-bootloader 1.20150130-1 (using raspberrypi-bootloader_1.20150208-1_armhf.deb) ... /bin/sh: 0: Illegal option - dpkg: error processing raspberrypi-bootloader_1.20150208-1_armhf.deb (--install): subprocess new pre-installation script returned error exit status 2
ooooh i understand, the crlf is in the preinst file, yeah i see it there, its not in install.sh
pi@raspberrypi:~/custom_kernel_1.20150208-1$ od -t a preinst
0000000 # ! / b i n / s h sp - e cr nl F I
sneaky lil thing...
@ladyada i'll mess with the windows testing tomorrow. don't waste your time. i wonder if a fresh clone is needed to fix the existing CRLFs
todd, its totally a crlf its inside the deb ... but i think maybe a git pull wasnt enough, maybe i have to do a new git checkout (?)
lemme start a totally fresh setup
yeah. it's the pre & post install scripts that are included with the deb here: https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic/tree/debhelper/debian
i was assuming that git pull & rebuilding the kernel packages would fix any CRLF issues, but maybe git doesn't fix the files it has already converted with a pull. the easy way to check before running another build is to see if those files have CRLFs from your vagrant instance. they should be in /vagrant/debian
yeah they're gone now
vagrant@vagrant-ubuntu-precise-32:~$ od -t a /vagrant/scripts/package/DEBIAN/preinst
0000000 # ! / b i n / s h sp - e nl nl F I
0000020 L E S = " b o o t c o d e . b i
its likely something i did wrong :) will rerun now!
it's not you, it's my inability to remember to account for windows & linux line ending sadness. this wouldn't have been an issue, but what seems to be the official repo doesn't yet support kernel7.img
, so we need to include these overrides to add support for Pi v2. i have a pull req in so we can remove these from our repo, so that should cut down on errors like this: https://github.com/asb/firmware/pull/2
i just added a pre-commit hook to my local copy of the repo to force me to check .gitattributes
when i add a new text file to this repo:
#!/usr/bin/env bash
#
# check for new files, and make sure
# they are handled in .gitattributes
names=`git status --porcelain | grep ^A`
# no files added, continue with commit
if [ "$names" == "" ]; then
exit
fi
# allow for interaction
exec < /dev/tty
# list the new files
echo "files to be added:"
echo -e $names
# ask me if i'm being an idiot
read -p "are you sure these files are all added to .gitattributes to avoid CRLF hell? (y/n): " -n 1 -r
echo
# abort commit if i'm being an idiot
if [[ $REPLY =~ ^[Yy]$ ]]; then
exit
else
exit 1
fi
ok! of course i forgot to switch branches before vagrant up, so doing it again now... whee
yayyyyy! it works!
pi@pi2 ~ $ uname -a
Linux pi2 3.18.6+ #3 PREEMPT Mon Feb 9 03:48:07 UTC 2015 armv6l GNU/Linux
pi@pi2 ~ $ dmesg | head
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.18.6+ (root@vagrant-ubuntu-precise-32) (gcc version 4.7.1 20120402 (prerelease) (crosstool-NG 1.15.2) ) #3 PREEMPT Mon Feb 9 03:48:07 UTC 2015
will try on Pi2
pi@pi2 ~ $ uname -a Linux pi2 3.18.6-v7+ #4 SMP PREEMPT Mon Feb 9 03:57:40 UTC 2015 armv7l GNU/Linux pi@pi2 ~ $ dmesg | head [ 0.000000] Booting Linux on physical CPU 0xf00 [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Initializing cgroup subsys cpuacct [ 0.000000] Linux version 3.18.6-v7+ (root@vagrant-ubuntu-precise-32) (gcc version 4.8.3 20140106 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2014.01 - Linaro GCC 2013.11) ) #4 SMP PREEMPT Mon Feb 9 03:57:40 UTC 2015
works for me - pull it! :)
nice. thanks!
thx for helping fix - man this is a really funny hangup whenever using windows+vagrant->linux deploy
i could make you like a CRLF-blinking knuckle ring https://learn.adafruit.com/3d-printed-led-knuckle-jewelry :)
hah! i could continue in the tradition of night of the hunter & do the right thing with the battle of CRLF and LF
thanks for being patient while the battle played out again.
This branch is an attempt to properly create the required dependencies needed to install the new
raspberrypi-bootloader
package without breaking apt or forcing an install. This is as close as we could find to the 'official' way to package new RasPi kernels. Documentation on how to build the required set of closely coupled.deb
packages is pretty much non-existent, but this seems to be how they are doing it.Changes
.deb
files with the proper versions so the strict dependency settings don't throw errors on install. Included are:raspberrypi-bootloader
,libraspberrypi0
,libraspberrypi-dev,
libraspberrypi-bin
, &libraspberrypi-doc
.install.sh
bash script &INSTALL
docs were added to ensure that the.deb
files were installed in the proper order..deb
files are now all packaged into atar.gz
archive before output to the Kernel-o-Matic folder.debian
folder that are applied before runningdebuild
to deal with the addition ofkernel7.img
in/boot
for the RasPi v2. The source repo doesn't reflect that change, but I will probably send a pull request to fix the bug.Testing
vagrant provision
to make sure you have the new build dependencies installed.sudo adabuild
with the default settings should be good enough. The finished tarball should be present in the Kernel-o-Matic folder on your host machine after the build has finished. Install using the instructions in the tarball, and the same SD card should work on v1 & v2 RasPi's after installing and rebooting.kernel.img
andkernel7.img
both need to be built.menuconfig
will pop up again halfway through for the start of the v2 build, so keep an eye on the progress./me goes outside