Improvements for image customization
This commit is contained in:
parent
c3f7ce5b85
commit
f300f20e27
12
common.sh
12
common.sh
@ -15,6 +15,7 @@
|
||||
# compile_kernel
|
||||
# install_external_applications
|
||||
# write_uboot
|
||||
# customize_image
|
||||
|
||||
compile_uboot (){
|
||||
#---------------------------------------------------------------------------------------------------------------------------------
|
||||
@ -418,3 +419,14 @@ write_uboot()
|
||||
rm -r /tmp/usr
|
||||
sync
|
||||
}
|
||||
|
||||
customize_image()
|
||||
{
|
||||
cp $SRC/userpatches/customize-image.sh $CACHEDIR/sdcard/tmp/customize-image.sh
|
||||
chmod +x $CACHEDIR/sdcard/tmp/customize-image.sh
|
||||
mkdir -p $CACHEDIR/sdcard/tmp/overlay
|
||||
mount --bind $SRC/userpatches/overlay $CACHEDIR/sdcard/tmp/overlay
|
||||
display_alert "Calling image customization script" "customize-image.sh" "info"
|
||||
chroot $CACHEDIR/sdcard /bin/bash -c "/tmp/customize-image.sh $RELEASE $FAMILY $BOARD $BUILD_DESKTOP"
|
||||
umount $CACHEDIR/sdcard/tmp/overlay
|
||||
}
|
||||
|
||||
@ -86,10 +86,7 @@ debootstrap_ng()
|
||||
|
||||
# stage: user customization script
|
||||
# NOTE: installing too many packages may fill tmpfs mount
|
||||
cp $SRC/userpatches/customize-image.sh $CACHEDIR/sdcard/tmp/customize-image.sh
|
||||
chmod +x $CACHEDIR/sdcard/tmp/customize-image.sh
|
||||
display_alert "Calling image customization script" "customize-image.sh" "info"
|
||||
chroot $CACHEDIR/sdcard /bin/bash -c "/tmp/customize-image.sh $RELEASE $FAMILY $BOARD $BUILD_DESKTOP"
|
||||
customize_image
|
||||
|
||||
# stage: cleanup
|
||||
rm -f $CACHEDIR/sdcard/usr/sbin/policy-rc.d
|
||||
@ -106,6 +103,7 @@ debootstrap_ng()
|
||||
if [[ $ROOTFS_TYPE == fel || $ROOTFS_TYPE == nfs ]]; then
|
||||
# kill /etc/network/interfaces on target to prevent conflicts between kernel
|
||||
# and userspace network config (mainly on Xenial)
|
||||
|
||||
rm -f $CACHEDIR/sdcard/etc/network/interfaces
|
||||
printf "auto lo\niface lo inet loopback\n\niface eth0 inet manual" > $CACHEDIR/sdcard/etc/network/interfaces
|
||||
fi
|
||||
|
||||
@ -230,10 +230,7 @@ closing_image (){
|
||||
#--------------------------------------------------------------------------------------------------------------------------------
|
||||
# Closing image and clean-up
|
||||
#--------------------------------------------------------------------------------------------------------------------------------
|
||||
display_alert "Possible after install." "customize-image.sh" "info"
|
||||
cp $SRC/userpatches/customize-image.sh $CACHEDIR/sdcard/tmp/customize-image.sh
|
||||
chmod +x $CACHEDIR/sdcard/tmp/customize-image.sh
|
||||
chroot $CACHEDIR/sdcard /bin/bash -c "/tmp/customize-image.sh $RELEASE $FAMILY $BOARD $BUILD_DESKTOP"
|
||||
customize_image
|
||||
chroot $CACHEDIR/sdcard /bin/bash -c "sync"
|
||||
sync
|
||||
sleep 3
|
||||
|
||||
@ -362,7 +362,7 @@ prepare_host() {
|
||||
test -e /proc/sys/fs/binfmt_misc/qemu-arm || update-binfmts --enable qemu-arm
|
||||
|
||||
# create directory structure
|
||||
mkdir -p $SOURCES $DEST/debug $CACHEDIR $CACHEDIR/rootfs $SRC/userpatches/
|
||||
mkdir -p $SOURCES $DEST/debug $CACHEDIR/rootfs $SRC/userpatches/overlay
|
||||
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user