Automatically update deviceinfo, extlinux fdt, and boot.img when switching target devices
This commit is contained in:
1 parent
49830e137d
commit
699444d717
2 files changed
+22
-5
No files matched your search
+6
-2
@@ -405,8 +405,11 @@ EOF
|
|||||||
|
|
||||||
depmod -b "$ROOTFS" 6.12.1-msm8916
|
depmod -b "$ROOTFS" 6.12.1-msm8916
|
||||||
|
|
||||||
if [ "$RUN_MKINITFS" = "--mkinitfs" ] || [ ! -f "$ROOTFS/boot/initramfs" ]; then
|
# Automatically regenerate boot.img/initramfs if switching target devices
|
||||||
echo "[2/5] Running depmod and mkinitfs inside $ROOTFS..."
|
LAST_DEV_FILE="$ROOTFS/boot/.bananarchy_target_device"
|
||||||
|
LAST_DEV="$(cat "$LAST_DEV_FILE" 2>/dev/null || true)"
|
||||||
|
if [ "$RUN_MKINITFS" = "--mkinitfs" ] || [ ! -f "$ROOTFS/boot/initramfs" ] || [ "$LAST_DEV" != "$TARGET_DEVICE" ]; then
|
||||||
|
echo "[2/5] Running depmod and mkinitfs inside $ROOTFS (target: $TARGET_DEVICE)..."
|
||||||
rm -rf "$ROOTFS/tmp/hostbin"
|
rm -rf "$ROOTFS/tmp/hostbin"
|
||||||
mkdir -p "$ROOTFS/tmp/hostbin"
|
mkdir -p "$ROOTFS/tmp/hostbin"
|
||||||
cp /bin/busybox.static "$ROOTFS/tmp/hostbin/busybox.static"
|
cp /bin/busybox.static "$ROOTFS/tmp/hostbin/busybox.static"
|
||||||
@@ -446,6 +449,7 @@ EOF
|
|||||||
|
|
||||||
ln -sf /bin/busybox "$ROOTFS/bin/sh"
|
ln -sf /bin/busybox "$ROOTFS/bin/sh"
|
||||||
rm -rf "$ROOTFS/tmp/hostbin" "$ROOTFS/lib/ld-musl-x86_64.so.1" "$ROOTFS/proc/1"
|
rm -rf "$ROOTFS/tmp/hostbin" "$ROOTFS/lib/ld-musl-x86_64.so.1" "$ROOTFS/proc/1"
|
||||||
|
echo "$TARGET_DEVICE" > "$LAST_DEV_FILE"
|
||||||
else
|
else
|
||||||
echo "[2/5] Using existing $ROOTFS/boot/initramfs (pass --mkinitfs to regenerate)..."
|
echo "[2/5] Using existing $ROOTFS/boot/initramfs (pass --mkinitfs to regenerate)..."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -14,22 +14,32 @@ fi
|
|||||||
case "$DEVICE" in
|
case "$DEVICE" in
|
||||||
nokia-argon|argon)
|
nokia-argon|argon)
|
||||||
DEVICE="nokia-argon"
|
DEVICE="nokia-argon"
|
||||||
|
DEVICE_DIR="nokia-argon"
|
||||||
|
DEVICEINFO_FILE="deviceinfo"
|
||||||
DTB_FILE="qcom-msm8905-nokia-argon.dtb"
|
DTB_FILE="qcom-msm8905-nokia-argon.dtb"
|
||||||
;;
|
;;
|
||||||
nokia-beatles|beatles)
|
nokia-beatles|beatles)
|
||||||
DEVICE="nokia-beatles"
|
DEVICE="nokia-beatles"
|
||||||
|
DEVICE_DIR="nokia-beatles"
|
||||||
|
DEVICEINFO_FILE="deviceinfo"
|
||||||
DTB_FILE="qcom-msm8905-nokia-beatles.dtb"
|
DTB_FILE="qcom-msm8905-nokia-beatles.dtb"
|
||||||
;;
|
;;
|
||||||
nokia-tough|nokia-coconut|tough|coconut)
|
nokia-tough|nokia-coconut|tough|coconut)
|
||||||
DEVICE="nokia-tough"
|
DEVICE="nokia-tough"
|
||||||
|
DEVICE_DIR="nokia-tough"
|
||||||
|
DEVICEINFO_FILE="deviceinfo"
|
||||||
DTB_FILE="qcom-msm8905-nokia-coconut.dtb"
|
DTB_FILE="qcom-msm8905-nokia-coconut.dtb"
|
||||||
;;
|
;;
|
||||||
nokia-sparkler|sparkler)
|
nokia-sparkler|sparkler)
|
||||||
DEVICE="nokia-sparkler"
|
DEVICE="nokia-sparkler"
|
||||||
|
DEVICE_DIR="nokia-sparkler"
|
||||||
|
DEVICEINFO_FILE="deviceinfo"
|
||||||
DTB_FILE="qcom-msm8909-nokia-sparkler.dtb"
|
DTB_FILE="qcom-msm8909-nokia-sparkler.dtb"
|
||||||
;;
|
;;
|
||||||
nokia-leo|leo)
|
nokia-leo|leo)
|
||||||
DEVICE="nokia-sparkler"
|
DEVICE="nokia-leo"
|
||||||
|
DEVICE_DIR="nokia-sparkler"
|
||||||
|
DEVICEINFO_FILE="deviceinfo.nokia-leo"
|
||||||
DTB_FILE="qcom-msm8909-nokia-leo.dtb"
|
DTB_FILE="qcom-msm8909-nokia-leo.dtb"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -264,8 +274,11 @@ mkdir -p "$TARGET_ROOTFS/var/lib/tinydm"
|
|||||||
ln -sf /usr/share/xsessions/sxmo.desktop "$TARGET_ROOTFS/var/lib/tinydm/default-session.desktop"
|
ln -sf /usr/share/xsessions/sxmo.desktop "$TARGET_ROOTFS/var/lib/tinydm/default-session.desktop"
|
||||||
|
|
||||||
echo "[4/4] Installing deviceinfo for $DEVICE ($DTB_FILE)..."
|
echo "[4/4] Installing deviceinfo for $DEVICE ($DTB_FILE)..."
|
||||||
if [ -f "$BASE_DIR/devices/$DEVICE/deviceinfo" ]; then
|
if [ -f "$BASE_DIR/devices/$DEVICE_DIR/$DEVICEINFO_FILE" ]; then
|
||||||
cp -a "$BASE_DIR/devices/$DEVICE/deviceinfo" "$TARGET_ROOTFS/etc/deviceinfo"
|
cp -a "$BASE_DIR/devices/$DEVICE_DIR/$DEVICEINFO_FILE" "$TARGET_ROOTFS/etc/deviceinfo"
|
||||||
|
fi
|
||||||
|
if [ -f "$TARGET_ROOTFS/boot/extlinux/extlinux.conf" ]; then
|
||||||
|
sed -i "s|^[[:space:]]*fdt .*|\tfdt /$DTB_FILE|" "$TARGET_ROOTFS/boot/extlinux/extlinux.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Bananarchy overlay applied to $TARGET_ROOTFS for device $DEVICE."
|
echo "Bananarchy overlay applied to $TARGET_ROOTFS for device $DEVICE."
|
||||||
Reference in new issue
Block a user