Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Commit

Permalink
add disk utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjm2473 committed May 11, 2019
1 parent 23f6bb3 commit 1887664
Show file tree
Hide file tree
Showing 49 changed files with 265 additions and 0 deletions.
18 changes: 18 additions & 0 deletions root/etc/config/mdadm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
config mdadm
option email root
# list devices /dev/hd*
# list devices /dev/sd*
# list devices partitions

config array
option uuid 52c5c44a:d2162820:f75d3464:799750f8
option device /dev/md0
# option name raid:0
# option super_minor 0
# list devices /dev/sda1
# list devices /dev/sdb1
# option spares 0
# option spare_group spares
# option bitmap /bitmap.md
# option container 00000000:00000000:00000000:00000000
# option member 1
93 changes: 93 additions & 0 deletions root/etc/init.d/mdadm
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/bin/sh /etc/rc.common

START=13
STOP=98

USE_PROCD=1
PROG=/sbin/mdadm
NAME=mdadm

CONF="/var/etc/mdadm.conf"

append_list_item() {
append "$2" "$1" "$3"
}

append_option() {
local var="$1"
local cfg="$2"
local opt="$3"
local name="$4"
local sep="$5"
local str

if [ -n "$sep" ]; then
config_list_foreach "$cfg" "$opt" append_list_item str "$sep"
else
config_get str "$cfg" "$opt"
fi

[ -n "$str" ] && append "$var" $(printf "%s=%s" "${name:-${opt//_/-}}" "$str")
}

mdadm_common() {
local cfg="$1"
local email devices

if [ -x /usr/sbin/sendmail ]; then
config_get email "$cfg" email
[ -n "$email" ] && printf "MAILADDR %s\n" "$email" >> $CONF
fi

config_list_foreach "$cfg" devices append_list_item devices " "
[ -n "$devices" ] && printf "DEVICE %s\n" "$devices" >> $CONF
}

mdadm_array() {
local cfg="$1"
local uuid device devices name array

config_get uuid "$cfg" uuid
config_get name "$cfg" name
config_get device "$cfg" device

if [ -z "$device" ] || [ -z "$uuid$name" ]; then
echo "Skipping array without device, uuid or name" >&2
return
fi

[ -n "$uuid" ] && append array "uuid=$uuid"
[ -n "$name" ] && append array "name=$name"

append_option array "$cfg" super_minor
append_option array "$cfg" spares
append_option array "$cfg" spare_group
append_option array "$cfg" bitmap
append_option array "$cfg" container
append_option array "$cfg" member
append_option array "$cfg" devices devices ","

printf "ARRAY %s %s\n" "$device" "$array" >> $CONF
}

start_service() {
local email

mkdir -p "${CONF%/*}"
printf "# Autogenerated from /etc/config/mdadm, do not edit!\n" > $CONF

config_load mdadm
config_foreach mdadm_common mdadm
config_foreach mdadm_array array

$PROG --assemble --scan --config="$CONF"

procd_open_instance
procd_set_param command "$PROG" --monitor --syslog --scan --config="$CONF"
procd_close_instance
}

stop_service() {
$PROG --stop --scan
}

1 change: 1 addition & 0 deletions root/etc/rc.d/K98mdadm
1 change: 1 addition & 0 deletions root/etc/rc.d/S13mdadm
Binary file added root/sbin/mdadm
Binary file not shown.
Binary file added root/usr/bin/findmnt
Binary file not shown.
Binary file added root/usr/bin/mount
Binary file not shown.
Binary file added root/usr/bin/mountpoint
Binary file not shown.
Binary file added root/usr/bin/umount
Binary file not shown.
1 change: 1 addition & 0 deletions root/usr/lib/libmount.so.1
Binary file added root/usr/lib/libmount.so.1.1.0
Binary file not shown.
1 change: 1 addition & 0 deletions root/usr/lib/libparted-fs-resize.so
1 change: 1 addition & 0 deletions root/usr/lib/libparted-fs-resize.so.0
Binary file added root/usr/lib/libparted-fs-resize.so.0.0.1
Binary file not shown.
1 change: 1 addition & 0 deletions root/usr/lib/libparted.so
1 change: 1 addition & 0 deletions root/usr/lib/libparted.so.2
Binary file added root/usr/lib/libparted.so.2.0.1
Binary file not shown.
12 changes: 12 additions & 0 deletions root/usr/lib/opkg/info/dosfstools.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Package: dosfstools
Version: 4.1-1
Depends: libc
Source: feeds/packages/utils/dosfstools
SourceName: dosfstools
License: GPL-3.0+
LicenseFiles: COPYING
Section: utils
Maintainer: Álvaro Fernández Rojas <[email protected]>
Architecture: aarch64_cortex-a53
Installed-Size: 60352
Description: The dosfstools package includes the mkfs.fat and fsck.fat utilities, which respectively make and check MS-DOS FAT filesystems.
3 changes: 3 additions & 0 deletions root/usr/lib/opkg/info/dosfstools.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/usr/sbin/mkfs.fat
/usr/sbin/fsck.fat
/usr/sbin/fatlabel
5 changes: 5 additions & 0 deletions root/usr/lib/opkg/info/dosfstools.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
[ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
[ -x ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
default_postinst $0 $@
4 changes: 4 additions & 0 deletions root/usr/lib/opkg/info/dosfstools.prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
[ -x ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
default_prerm $0 $@
13 changes: 13 additions & 0 deletions root/usr/lib/opkg/info/libmount1.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Package: libmount1
Version: 2.33-2
Depends: libc, libblkid1
Provides: libmount
Source: feeds/base/package/utils/util-linux
SourceName: libmount
License: GPL-2.0
LicenseFiles: COPYING libblkid/COPYING libmount/COPYING Documentation/licenses/COPYING.GPLv2 Documentation/licenses/COPYING.LGPLv2.1 libuuid/COPYING Documentation/licenses/COPYING.BSD-3
Section: libs
Architecture: aarch64_cortex-a53
Installed-Size: 129245
Description: The libmount library is used to parse /etc/fstab, /etc/mtab and
/proc/self/mountinfo files, manage the mtab file, evaluate mount options...
2 changes: 2 additions & 0 deletions root/usr/lib/opkg/info/libmount1.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/usr/lib/libmount.so.1
/usr/lib/libmount.so.1.1.0
5 changes: 5 additions & 0 deletions root/usr/lib/opkg/info/libmount1.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
[ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
[ -x ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
default_postinst $0 $@
4 changes: 4 additions & 0 deletions root/usr/lib/opkg/info/libmount1.prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
[ -x ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
default_prerm $0 $@
1 change: 1 addition & 0 deletions root/usr/lib/opkg/info/mdadm.conffiles
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/config/mdadm
13 changes: 13 additions & 0 deletions root/usr/lib/opkg/info/mdadm.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Package: mdadm
Version: 4.1-1
Depends: libc, libpthread, kmod-md-mod, kmod-md-raid0, kmod-md-raid10, kmod-md-raid1
Source: feeds/base/package/utils/mdadm
SourceName: mdadm
Section: utils
Maintainer: Felix Fietkau <[email protected]>
Architecture: aarch64_cortex-a53
Installed-Size: 199034
Description: A tool for managing Linux Software RAID arrays.
RAID 0, 1 and 10 support included.
If you need RAID 4,5 or 6 functionality please
install kmod-md-raid456 .
3 changes: 3 additions & 0 deletions root/usr/lib/opkg/info/mdadm.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/etc/init.d/mdadm
/sbin/mdadm
/etc/config/mdadm
5 changes: 5 additions & 0 deletions root/usr/lib/opkg/info/mdadm.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
[ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
[ -x ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
default_postinst $0 $@
4 changes: 4 additions & 0 deletions root/usr/lib/opkg/info/mdadm.prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
[ -x ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
default_prerm $0 $@
11 changes: 11 additions & 0 deletions root/usr/lib/opkg/info/mount-utils.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Package: mount-utils
Version: 2.33-2
Depends: libc, librt, libmount1, libsmartcols1
Source: feeds/base/package/utils/util-linux
SourceName: mount-utils
License: GPL-2.0
LicenseFiles: COPYING libblkid/COPYING libmount/COPYING Documentation/licenses/COPYING.GPLv2 Documentation/licenses/COPYING.LGPLv2.1 libuuid/COPYING Documentation/licenses/COPYING.BSD-3
Section: utils
Architecture: aarch64_cortex-a53
Installed-Size: 43138
Description: contains: mount, umount, findmnt
4 changes: 4 additions & 0 deletions root/usr/lib/opkg/info/mount-utils.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/usr/bin/mountpoint
/usr/bin/mount
/usr/bin/umount
/usr/bin/findmnt
5 changes: 5 additions & 0 deletions root/usr/lib/opkg/info/mount-utils.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
[ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
[ -x ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
default_postinst $0 $@
4 changes: 4 additions & 0 deletions root/usr/lib/opkg/info/mount-utils.prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
[ -x ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
default_prerm $0 $@
10 changes: 10 additions & 0 deletions root/usr/lib/opkg/info/parted.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Package: parted
Version: 3.2-1
Depends: libc, libuuid1, libblkid1
Source: package/third/parted-on-openwrt
SourceName: parted
Section: utils
Architecture: aarch64_cortex-a53
Installed-Size: 186351
Description: parted Partition editor
http://www.gnu.org/software/parted/index.shtml
8 changes: 8 additions & 0 deletions root/usr/lib/opkg/info/parted.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/usr/lib/libparted.so.2.0.1
/usr/lib/libparted-fs-resize.so.0
/usr/sbin/parted
/usr/lib/libparted-fs-resize.so
/usr/lib/libparted-fs-resize.so.0.0.1
/usr/sbin/partprobe
/usr/lib/libparted.so
/usr/lib/libparted.so.2
5 changes: 5 additions & 0 deletions root/usr/lib/opkg/info/parted.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
[ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
[ -x ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
default_postinst $0 $@
4 changes: 4 additions & 0 deletions root/usr/lib/opkg/info/parted.prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
[ -x ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
default_prerm $0 $@
11 changes: 11 additions & 0 deletions root/usr/lib/opkg/info/swap-utils.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Package: swap-utils
Version: 2.33-2
Depends: libc, librt, libblkid1
Source: feeds/base/package/utils/util-linux
SourceName: swap-utils
License: GPL-2.0
LicenseFiles: COPYING libblkid/COPYING libmount/COPYING Documentation/licenses/COPYING.GPLv2 Documentation/licenses/COPYING.LGPLv2.1 libuuid/COPYING Documentation/licenses/COPYING.BSD-3
Section: utils
Architecture: aarch64_cortex-a53
Installed-Size: 34023
Description: contains: mkswap, swaplabel
2 changes: 2 additions & 0 deletions root/usr/lib/opkg/info/swap-utils.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/usr/sbin/mkswap
/usr/sbin/swaplabel
5 changes: 5 additions & 0 deletions root/usr/lib/opkg/info/swap-utils.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
[ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
[ -x ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
default_postinst $0 $@
4 changes: 4 additions & 0 deletions root/usr/lib/opkg/info/swap-utils.prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
[ -x ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
default_prerm $0 $@
Binary file added root/usr/sbin/fatlabel
Binary file not shown.
Binary file added root/usr/sbin/fsck.fat
Binary file not shown.
Binary file added root/usr/sbin/mkfs.fat
Binary file not shown.
Binary file added root/usr/sbin/mkswap
Binary file not shown.
Binary file added root/usr/sbin/parted
Binary file not shown.
Binary file added root/usr/sbin/partprobe
Binary file not shown.
Binary file added root/usr/sbin/swaplabel
Binary file not shown.

0 comments on commit 1887664

Please sign in to comment.