From 15a2d5b54ae22b857db447ebd9234240510eee05 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 5 Aug 2019 21:39:06 +0200 Subject: [PATCH] - move partitions-by-name and resizerootfs away from skel-root --- make/target-scripts.mk | 12 +++++ .../armbox/hd51/etc/init.d/partitions-by-name | 16 ------- skel-root/armbox/hd51/etc/init.d/resizerootfs | 44 ------------------- .../scripts/partitions-by-name.init} | 0 .../scripts/resizerootfs.init} | 0 5 files changed, 12 insertions(+), 60 deletions(-) delete mode 100755 skel-root/armbox/hd51/etc/init.d/partitions-by-name delete mode 100755 skel-root/armbox/hd51/etc/init.d/resizerootfs rename skel-root/{armbox/bre2ze4k/etc/init.d/partitions-by-name => general/scripts/partitions-by-name.init} (100%) mode change 100755 => 100644 rename skel-root/{armbox/bre2ze4k/etc/init.d/resizerootfs => general/scripts/resizerootfs.init} (100%) mode change 100755 => 100644 diff --git a/make/target-scripts.mk b/make/target-scripts.mk index f4f20b48..8768465b 100644 --- a/make/target-scripts.mk +++ b/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 $@ diff --git a/skel-root/armbox/hd51/etc/init.d/partitions-by-name b/skel-root/armbox/hd51/etc/init.d/partitions-by-name deleted file mode 100755 index 48570e19..00000000 --- a/skel-root/armbox/hd51/etc/init.d/partitions-by-name +++ /dev/null @@ -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 diff --git a/skel-root/armbox/hd51/etc/init.d/resizerootfs b/skel-root/armbox/hd51/etc/init.d/resizerootfs deleted file mode 100755 index 14f3c004..00000000 --- a/skel-root/armbox/hd51/etc/init.d/resizerootfs +++ /dev/null @@ -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 diff --git a/skel-root/armbox/bre2ze4k/etc/init.d/partitions-by-name b/skel-root/general/scripts/partitions-by-name.init old mode 100755 new mode 100644 similarity index 100% rename from skel-root/armbox/bre2ze4k/etc/init.d/partitions-by-name rename to skel-root/general/scripts/partitions-by-name.init diff --git a/skel-root/armbox/bre2ze4k/etc/init.d/resizerootfs b/skel-root/general/scripts/resizerootfs.init old mode 100755 new mode 100644 similarity index 100% rename from skel-root/armbox/bre2ze4k/etc/init.d/resizerootfs rename to skel-root/general/scripts/resizerootfs.init