#!/bin/bash -e # # blackarmor-nas-debian-postinstall.sh # # Install Debian GNU/Linux to a Seagate Blackarmor NAS 110 / 220 / 440 # # (C) 2018-2022 Hajo Noerenberg # # # http://www.noerenberg.de/ # https://github.com/hn/seagate-blackarmor-nas # # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3.0 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # RAWREPO=https://raw.githubusercontent.com/hn/seagate-blackarmor-nas/master MACHINE=$(tr -d '\0' /usr/share/flash-kernel/db/seagate-blackarmor-nas220.db Machine: Seagate Blackarmor NAS220 Kernel-Flavors: kirkwood marvell DTB-Id: kirkwood-blackarmor-nas220.dtb DTB-Append: yes Mtd-Kernel: uimage Mtd-Initrd: rootfs U-Boot-Kernel-Address: 0x00040000 U-Boot-Initrd-Address: 0x00800000 Required-Packages: u-boot-tools EOF fi if ! grep -q "Seagate Blackarmor NAS440" /usr/share/flash-kernel/db/*.db; then cat </usr/share/flash-kernel/db/seagate-blackarmor-nas440.db Machine: Seagate Blackarmor NAS440 Kernel-Flavors: kirkwood marvell DTB-Id: kirkwood-blackarmor-nas440.dtb DTB-Append: yes Mtd-Kernel: uimage Mtd-Initrd: rootfs U-Boot-Kernel-Address: 0x00040000 U-Boot-Initrd-Address: 0x00800000 Required-Packages: u-boot-tools EOF fi uudecode <> /etc/fstab fi apt-get install sysfsutils wget $WGETOPTS -nc -P /etc/sysfs.d $RAWREPO/blackarmor-$NASMODEL-fan.conf if [ -f /sys/class/hwmon/hwmon0/device/pwm1_enable ]; then # kernel 4.x "hwmon0/device/..." perl -i -p -e 's%hwmon0(/device)?%hwmon0/device%' /etc/sysfs.d/blackarmor-$NASMODEL-fan.conf else # kernel 5.x "hwmon0/..." perl -i -p -e 's%hwmon0/device%hwmon0%' /etc/sysfs.d/blackarmor-$NASMODEL-fan.conf fi