Browse Source

- hd2: add init script to mount rootX to mnt/rootX

master
vanhofen 3 years ago
parent
commit
ef8ff81c15
  1. 7
      make/target-scripts.mk
  2. 25
      skel-root/general/scripts/rootx-mount.init

7
make/target-scripts.mk

@ -25,6 +25,7 @@ init-scripts: \
\
$(TARGET_sysconfdir)/init.d/stb_update.sh \
\
$(TARGET_sysconfdir)/init.d/rootx-mount \
$(TARGET_sysconfdir)/init.d/var_mount.sh \
$(TARGET_sysconfdir)/init.d/var_update.sh
@ -112,6 +113,12 @@ ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd1 hd2))
$(INSTALL_EXEC) -D $(TARGET_FILES)/scripts/stb_update_$(BOXSERIES).sh $(@)
endif
$(TARGET_sysconfdir)/init.d/rootx-mount:
ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd2))
$(INSTALL_EXEC) -D $(TARGET_FILES)/scripts/rootx-mount.init $(@)
$(UPDATE-RC.D) $(@F) defaults 01 98
endif
$(TARGET_sysconfdir)/init.d/var_mount.sh:
ifeq ($(PERSISTENT_VAR_PARTITION),yes)
$(INSTALL_EXEC) -D $(TARGET_FILES)/scripts/var_mount.sh $(@)

25
skel-root/general/scripts/rootx-mount.init

@ -0,0 +1,25 @@
#!/bin/sh
. /etc/init.d/functions
. /etc/init.d/globals
case $1 in
start)
if grep -q "root=mtd:root1" /proc/cmdline; then
LOGINFO "mounting root0 to /mnt/root0 ..."
mkdir -p /mnt/root0
mount -t jffs2 /dev/mtdblock0 /mnt/root0
elif grep -q "root=mtd:root0" /proc/cmdline; then
LOGINFO "mounting root1 to /mnt/root1 ..."
mkdir -p /mnt/root1
mount -t jffs2 /dev/mtdblock2 /mnt/root1
fi
;;
stop)
umount /mnt/root0
umount /mnt/root1
;;
*)
echo "[$BASENAME] Usage: $0 {start|stop}"
;;
esac
Loading…
Cancel
Save