mirror of
https://github.com/armbian/build.git
synced 2026-01-06 09:58:46 -08:00
New way of customizing images
This commit is contained in:
@@ -370,7 +370,9 @@ closing_image (){
|
||||
# Closing image and clean-up
|
||||
#--------------------------------------------------------------------------------------------------------------------------------
|
||||
display_alert "Possible after install." "$AFTERINSTALL" "info"
|
||||
chroot $DEST/cache/sdcard /bin/bash -c "$AFTERINSTALL"
|
||||
cp $SRC/userpatches/customize-image.sh $DEST/cache/sdcard/tmp/customize-image.sh
|
||||
chmod +x $DEST/cache/sdcard/tmp/customize-image.sh
|
||||
chroot $DEST/cache/sdcard /bin/bash "$DEST/cache/sdcard/tmp/customize-image.sh $RELEASE $FAMILY $BOARD $BUILD_DESKTOP"
|
||||
chroot $DEST/cache/sdcard /bin/bash -c "sync"
|
||||
sync
|
||||
sleep 3
|
||||
|
||||
@@ -17,7 +17,6 @@ CLEAN_LEVEL="make,debs" # comma-sparated list of clean targets: "make" = mak
|
||||
# "images" = delete "./output/images", "debs" = delete "./output/debs",
|
||||
# "cache" = delete "./output/cache", "sources" = delete "./sources"
|
||||
# user
|
||||
AFTERINSTALL="" # last command before closing image, example: apt-get install joe
|
||||
DEST_LANG="en_US.UTF-8" # sl_SI.UTF-8, en_US.UTF-8
|
||||
CONSOLE_CHAR="UTF-8"
|
||||
ROOTPWD="1234" # Must be changed @first login
|
||||
@@ -91,4 +90,4 @@ fi
|
||||
|
||||
# If you are committing new version of this file, increment VERSION
|
||||
# Only integers are supported
|
||||
# VERSION=5
|
||||
# VERSION=6
|
||||
|
||||
@@ -351,6 +351,8 @@ prepare_host() {
|
||||
mkdir -p $SOURCES $DEST/debug $DEST/cache $DEST/cache/rootfs $SRC/userpatches/
|
||||
find $SRC/lib/patch -type d ! -name . | sed "s%lib/patch%userpatches%" | xargs mkdir -p
|
||||
|
||||
[[ ! -f $SRC/userpatches/customize-image.sh ]] && cp $SRC/lib/scripts/customize-image.sh.template $SRC/userpatches/customize-image.sh
|
||||
|
||||
# TODO: needs better documentation
|
||||
echo 'Place your patches and kernel.config / u-boot.config / lib.config here.' > $SRC/userpatches/readme.txt
|
||||
echo 'They will be automatically included if placed here!' >> $SRC/userpatches/readme.txt
|
||||
|
||||
26
scripts/customize-image.sh.template
Normal file
26
scripts/customize-image.sh.template
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
|
||||
case $RELEASE in
|
||||
wheezy)
|
||||
# your code here
|
||||
;;
|
||||
jessie)
|
||||
# your code here
|
||||
;;
|
||||
trusty)
|
||||
# your code here
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user