Nick Posted February 20, 2016 Share Posted February 20, 2016 Subtitle: Or I've screwed (Which is more than likely ;-) I'm trying to add some custom apt sources via customize_image.sh. They appear to be being added, but they are then deleted again. #!/bin/bash # arguments: $RELEASE $FAMILY $BOARD $BUILD_DESKTOP # # This is the image customization script # # NOTE: It is copied to /tmp directory inside the image # and executed there inside chroot environment # so don't reference any files that are not already installed RELEASE=$1 FAMILY=$2 BOARD=$3 BUILD_DESKTOP=$4 # add TV Headend echo "deb http://dl.bintray.com/tvheadend/deb jessie release" >> /etc/apt/sources.list.d/nimo.list wget apt.nimo.co.uk/conf/tvheadend.key cat ./tvheadend.key |apt-key add - #rm ./tvheadend.key #Add NIMO GPG key echo "deb http://apt.nimo.co.uk/'>http://apt.nimo.co.uk/ nimo main" >> /etc/apt/sources.list.d/nimo.list wget apt.nimo.co.uk/conf/nimo.gpg.key cat ./nimo.gpg.key | apt-key add - #rm ./nimo.gpg.key #Add nimobridge setup program apt-get -y update apt-get -y install nimoapsetup nimocoresetup case $RELEASE in wheezy) # your code here ;; jessie) # your code here ;; trusty) # your code here ;; esac When apt-get -y update is run by the build process it appears to find my repository and is happy. Get:1 http://apt.nimo.co.uk nimo InRelease [1,474 B] Hit http://security.debian.org jessie/updates InRelease Get:2 http://apt.nimo.co.uk nimo/main armhf Packages [937 B] Get:3 http://httpredir.debian.org jessie-updates InRelease [136 kB] Ign http://httpredir.debian.org jessie InRelease Hit http://security.debian.org jessie/updates/main Sources Hit http://security.debian.org jessie/updates/contrib Sources Hit http://security.debian.org jessie/updates/non-free Sources Hit http://httpredir.debian.org jessie Release.gpg Hit http://security.debian.org jessie/updates/main armhf Packages Hit http://security.debian.org jessie/updates/contrib armhf Packages Hit http://httpredir.debian.org jessie Release Hit http://security.debian.org jessie/updates/non-free armhf Packages Ign http://apt.nimo.co.uk nimo/main Translation-en_GB Hit http://security.debian.org jessie/updates/contrib Translation-en Ign http://apt.nimo.co.uk nimo/main Translation-en Hit http://security.debian.org jessie/updates/main Translation-en Hit http://security.debian.org jessie/updates/non-free Translation-en Get:4 http://httpredir.debian.org jessie-updates/main Sources [2,296 B] Get:5 http://httpredir.debian.org jessie-updates/main armhf Packages/DiffIndex [367 B] Get:6 http://httpredir.debian.org jessie-updates/contrib Sources [32 B] Get:7 http://httpredir.debian.org jessie-updates/contrib armhf Packages [32 B] Get:8 http://httpredir.debian.org jessie-updates/non-free Sources [32 B] Get:9 http://httpredir.debian.org jessie-updates/non-free armhf Packages [32 B] Get:10 http://httpredir.debian.org jessie-updates/contrib Translation-en [14 B] Get:11 http://httpredir.debian.org jessie-updates/main Translation-en [2,506 B] Hit http://httpredir.debian.org jessie/main Sources Hit http://httpredir.debian.org jessie/contrib Sources Hit http://httpredir.debian.org jessie/non-free Sources Hit http://httpredir.debian.org jessie/main armhf Packages Get:12 http://httpredir.debian.org jessie-updates/non-free Translation-en [14 B] Hit http://httpredir.debian.org jessie/contrib armhf Packages Hit http://httpredir.debian.org jessie/non-free armhf Packages Hit http://httpredir.debian.org jessie/contrib Translation-en Hit http://httpredir.debian.org jessie/main Translation-en Hit http://httpredir.debian.org jessie/non-free Translation-en Which leads me to believe that nimo.list is being created and that the keys are being added correctly. However when I copy the final .raw file to an SD card and look at it, /etc/apt/sources.list.d/nimo.list has gone as well as the two key files which as far as I understand it should be in /tmp This is my first attempt at using customize_image.sh so there may be other things going on which I haven't taken into account yet. Link to comment Share on other sites More sharing options...
zador.blood.stained Posted February 21, 2016 Share Posted February 21, 2016 What options did you use for building (especially CLEAN_LEVEL)? Maybe image building failed and you checked previous version without your customizations. /tmp directory is not copied into the image, but apt-key stores added keys somewhere in /var, I believe, so you don't need them in /tmp after installation. Link to comment Share on other sites More sharing options...
Nick Posted February 21, 2016 Author Share Posted February 21, 2016 I've have just looked at the last SD card that I burned last night and everything looks to be in place now. I was having trouble with an SD card so I switched to a new one. I'm guessing the old card was not being written properly for some reason. Sorry about that, all appears to be good now :-) Thanks for the hint regarding /tmp not being copied into the image, I didn't know that. It makes sense for it not to be copied, but it might be worth adding a note to the comment at the top of the script. 1 Link to comment Share on other sites More sharing options...
blindpet Posted March 7, 2016 Share Posted March 7, 2016 I'm having trouble getting this working, I compile images just fine on Ubuntu 14.04. I renamed the customize-image.sh.template to customize-image.sh Then I added my custom commands RELEASE=$1 FAMILY=$2 BOARD=$3 BUILD_DESKTOP=$4 git clone https://github.com/blindpet/MediaServerInstaller /root/HTPCGuides Tried also without renaming the template file and still nothing. On earlier versions of the build script I did this in another way but it seems to be deprecated. Link to comment Share on other sites More sharing options...
Schwemmlandebene Posted March 7, 2016 Share Posted March 7, 2016 Did you copy customize-image.sh to lib/../userpatches/ ? Link to comment Share on other sites More sharing options...
Nick Posted March 7, 2016 Author Share Posted March 7, 2016 Is git installed at that point? Bear in mind that customize-image.sh uses tools installed in the target image NOT the hosts tools. Unless Armbian is already installing git you will most likely need to do something like this: apt-get -y install git git clone https://github.com/blindpet/MediaServerInstaller /root/HTPCGuides Link to comment Share on other sites More sharing options...
zador.blood.stained Posted March 8, 2016 Share Posted March 8, 2016 I renamed the customize-image.sh.template to customize-image.sh Then I added my custom commands ... Tried also without renaming the template file and still nothing. On earlier versions of the build script I did this in another way but it seems to be deprecated. You don't need to edit anything in lib/ directly. In fact it's better that you reset or remove lib directory so your changes don't prevent pulling future updates. You shoud use "customize-image.sh" conviniently (auto) copied to "userpatches/". Because it is copied only if it doesn't exist already, your changes in lib/scripts didn't have any effect. Is git installed at that point? Bear in mind that customize-image.sh uses tools installed in the target image NOT the hosts tools. Unless Armbian is already installing git you will most likely need to do something like this: Yes, git should be installed at this point. 1 Link to comment Share on other sites More sharing options...
blindpet Posted March 8, 2016 Share Posted March 8, 2016 Thank you, I see it in the userpatches folder and it worked now. I made the mistake of looking in the github instead of the documentation page Link to comment Share on other sites More sharing options...
Recommended Posts