Browse Source

- move partitions-by-name and resizerootfs away from skel-root

master
vanhofen 6 years ago
parent
commit
15a2d5b54a
  1. 12
      make/target-scripts.mk
  2. 16
      skel-root/armbox/hd51/etc/init.d/partitions-by-name
  3. 44
      skel-root/armbox/hd51/etc/init.d/resizerootfs
  4. 0
      skel-root/general/scripts/partitions-by-name.init
  5. 0
      skel-root/general/scripts/resizerootfs.init

12
make/target-scripts.mk

@ -15,6 +15,8 @@ init-scripts: \
$(TARGET_DIR)/etc/init.d/hostname \
$(TARGET_DIR)/etc/init.d/inetd \
$(TARGET_DIR)/etc/init.d/networking \
$(TARGET_DIR)/etc/init.d/partitions-by-name \
$(TARGET_DIR)/etc/init.d/resizerootfs \
$(TARGET_DIR)/etc/init.d/swap \
$(TARGET_DIR)/etc/init.d/syslogd
@ -64,6 +66,16 @@ $(TARGET_DIR)/etc/init.d/networking:
$(INSTALL_EXEC) -D $(IMAGEFILES)/scripts/networking.init $@
ln -sf networking $(TARGET_DIR)/etc/init.d/K99networking
$(TARGET_DIR)/etc/init.d/partitions-by-name:
ifeq ($(BOXSERIES), $(filter $(BOXSERIES), hd51 bre2ze4k))
$(INSTALL_EXEC) -D $(IMAGEFILES)/scripts/partitions-by-name.init $@
endif
$(TARGET_DIR)/etc/init.d/resizerootfs:
ifeq ($(BOXSERIES), $(filter $(BOXSERIES), hd51 bre2ze4k))
$(INSTALL_EXEC) -D $(IMAGEFILES)/scripts/resizerootfs.init $@
endif
$(TARGET_DIR)/etc/init.d/swap:
ifeq ($(BOXSERIES), $(filter $(BOXSERIES), hd51 bre2ze4k))
$(INSTALL_EXEC) -D $(IMAGEFILES)/scripts/swap.init $@

16
skel-root/armbox/hd51/etc/init.d/partitions-by-name

@ -1,16 +0,0 @@
#!/bin/sh
if grep -q mmcblk1 /proc/cmdline
then
search=/sys/block/mmcblk1/mmcblk1p*
else
search=/sys/block/mmcblk0/mmcblk0p*
fi
for i in $search;
do
if [ "$i" != "$search" ]; then
partname=`cat /$i/uevent | grep PARTNAME | cut -d '=' -f 2`
devname=`cat /$i/uevent | grep DEVNAME | cut -d '=' -f 2`
mkdir -p /dev/block/by-name/
ln -sf /dev/$devname /dev/block/by-name/$partname
fi
done

44
skel-root/armbox/hd51/etc/init.d/resizerootfs

@ -1,44 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: resize2fs mmcblk0p3
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: S
# Default-Stop:
# Short-Description: Resizes once linuxrootfs and userdata to full partition size
### END INIT INFO
if [ ! -f "/.resize-linuxrootfs" ] && [ -e "/dev/block/by-name/linuxrootfs" ]
then
echo "Resizing linuxrootfs partition, Do not unplug power!..."
resize2fs /dev/block/by-name/linuxrootfs
touch "/.resize-linuxrootfs"
fi
if [ ! -f "/.resize-userdata" ] && [ -e "/dev/block/by-name/userdata" ] && [ -x "/sbin/blkid" ]; then
if blkid /dev/block/by-name/userdata | grep "ext4"; then
echo "Resizing userdata partition, Do not unplug power!..."
resize2fs /dev/block/by-name/userdata
touch "/.resize-userdata"
else
echo "userdata partition is not format!..."
echo "Setup userdata partitions, Do not unplug power!..."
mkfs.ext4 -F /dev/block/by-name/userdata
touch "/.resize-userdata"
fi
fi
if [ ! -f "/.resize-storage" ] && [ -e "/dev/block/by-name/storage" ] && [ -x "/sbin/blkid" ]; then
if blkid /dev/block/by-name/storage | grep "ext4"; then
echo "Resizing storage partition, Do not unplug power!..."
resize2fs /dev/block/by-name/storage
touch "/.resize-storage"
else
echo "storage partition is not format!..."
echo "Setup storage partitions, Do not unplug power!..."
mkfs.ext4 -F /dev/block/by-name/storage
touch "/.resize-storage"
fi
fi
: exit 0

0
skel-root/armbox/bre2ze4k/etc/init.d/partitions-by-name → skel-root/general/scripts/partitions-by-name.init

0
skel-root/armbox/bre2ze4k/etc/init.d/resizerootfs → skel-root/general/scripts/resizerootfs.init

Loading…
Cancel
Save