macOS: FileVaultの解除が失敗したとき

OpenCoreでACPIを変更するとFileVaultの解除に失敗する時があります。

FileVaultを解除してからシステムを変更することをお勧めします。

方法としてはリカバリーモードで立ち上げて次のコマンドを打ちます。

FileVaultの解除が始まったら通常に立ち上げて作業ができます。

diskutil apfs list
diskutil apfs unlockVolume /dev/identifier
diskutil apfs listcryptousers /dev/identifier
diskutil apfs decryptVolume /dev/identifier -user uuid

参考

  • https://cccapital.jp/recovery-mode-filevault-decrypt/
Posted in macOS | Comments Off on macOS: FileVaultの解除が失敗したとき

Thinkpad x260: macOS Venturaのセットアップ

Vetunraへアップグレードとスリープの不具合のフィックスをしました。

  • https://github.com/Neelakurinji123/ThinkPad-x260-OpenCore
Screenshot

参考

  • https://github.com/5T33Z0/OC-Little-Translated/blob/main/14_OCLP_Wintel/Guides/Skylake.md
  • https://dortania.github.io/OpenCore-Install-Guide/config-laptop.plist/skylake.html
  • https://github.com/tylernguyen/x1c6-hackintosh/issues/84
  • https://www.insanelymac.com/forum/topic/342002-darkwake-on-macos-catalina-boot-args-darkwake8-darkwake10-are-obsolete/
  • https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/19_ASL_Reference/ACPI_Source_Language_Reference.html
  • https://github.com/5T33Z0/OC-Little-Translated/tree/main/04_Fixing_Sleep_and_Wake_Issues
  • https://apple.stackexchange.com/questions/302630/where-to-see-kernel-startup-messages-after-boot
Posted in macOS, ThinkPad | Comments Off on Thinkpad x260: macOS Venturaのセットアップ

ThinkPad x200: macOS Big Surのセットアップ

Screenshot

ThinkPad x200にBig Surをインストールしました。

大きな制約はグラフィックスは対応していないのでもちろんですが、Core2DuoはSSE4.2に準拠していないので稀に不具合が出ます。例えば日本語I MEが使えないなどです。その場合はGoogle IMEを使います。

  • https://github.com/Neelakurinji123/Thinkpad-x200-OpenCore

参考

  • https://github.com/82ghost82/BigSurFlat
  • https://dortania.github.io/OpenCore-Install-Guide/config.plist/penryn.html
  • https://github.com/5T33Z0/OC-Little-Translated/blob/main/14_OCLP_Wintel/Guides/Sandy_Bridge.md
Posted in macOS, ThinkPad | Comments Off on ThinkPad x200: macOS Big Surのセットアップ

macOS: ntfsのmount方法、ついでにext4も

訳あってntfsの外付けHDDをマウントの方法が分からず、調べて備忘録を作りました。

brew install --cask macfuse
brew install gromgit/fuse/ntfs-3g-mac
brew install --cask mounty

ここまでは良かったのですが、HDDは実はext4でフォーマットされたものでした。そこでext4fuseを入れようとしたのですが、依存関係のため入れられません。そこで検索したところからコピペして次のファイルext4fuse.rbを作成します。

class MacFuseRequirement < Requirement
  fatal true

  satisfy(build_env: false) { self.class.binary_mac_fuse_installed? }

  def self.binary_mac_fuse_installed?
    File.exist?("/usr/local/include/fuse/fuse.h") &&
      !File.symlink?("/usr/local/include/fuse")
  end

  env do
    ENV.append_path "PKG_CONFIG_PATH", HOMEBREW_LIBRARY/"Homebrew/os/mac/pkgconfig/fuse"

    unless HOMEBREW_PREFIX.to_s == "/usr/local"
      ENV.append_path "HOMEBREW_LIBRARY_PATHS", "/usr/local/lib"
      ENV.append_path "HOMEBREW_INCLUDE_PATHS", "/usr/local/include/fuse"
    end
  end

  def message
    "macFUSE is required. Please run `brew install --cask macfuse` first."
  end
end

class Ext4fuse < Formula
  desc "Read-only implementation of ext4 for FUSE"
  homepage "https://github.com/gerard/ext4fuse"
  url "https://github.com/gerard/ext4fuse/archive/v0.1.3.tar.gz"
  sha256 "550f1e152c4de7d4ea517ee1c708f57bfebb0856281c508511419db45aa3ca9f"
  license "GPL-2.0"
  head "https://github.com/gerard/ext4fuse.git"

  bottle do
    sha256 cellar: :any, catalina:    "446dde5e84b058966ead0cde5e38e9411f465732527f6decfa1c0dcdbd4abbef"
    sha256 cellar: :any, mojave:      "88c4918bf5218f99295e539fe4499152edb3b60b6659e44ddd68b22359f512ae"
    sha256 cellar: :any, high_sierra: "fc69c8993afd0ffc16a73c9c036ca8f83c77ac2a19b3237f76f9ccee8b30bbc9"
    sha256 cellar: :any, sierra:      "fe8bbe7cd5362f00ff06ef750926bf349d60563c20b0ecf212778631c8912ba2"
    sha256 cellar: :any, el_capitan:  "291047c821b7b205d85be853fb005510c6ab01bd4c2a2193c192299b6f049d35"
    sha256 cellar: :any, yosemite:    "b11f564b7e7c08af0b0a3e9854973d39809bf2d8a56014f4882772b2f7307ac1"
  end

  depends_on "pkg-config" => :build

  on_macos do
    depends_on MacFuseRequirement => :build
  end

  on_linux do
    depends_on "libfuse"
  end

  def install
    system "make"
    bin.install "ext4fuse"
  end
end

brewコマンドでインストールします。

brew install --formula --build-from-source ./ext4fuse.rb

マウントしてみます。

diskutil list
/usr/local/bin/ext4fuse /dev/disk2s1 /Volumes/mntext4

ls /Volumes/mntext4でマウントができたか確認してみます。

参考

  • https://github.com/gerard/ext4fuse/issues/66
Posted in macOS | Comments Off on macOS: ntfsのmount方法、ついでにext4も

mail serverにOpenDMARCを追加

gmailにメールが届かないというニュースを見て設定を更新しました。

低予算のvpsmなのでメモリが512MBしかなく、カツカツの運用なのでメモリーが足りない場合ソケットが消えるという不具合が出ます。

とはいうものの負荷をかけても必要なものは必要ということでやってみました。

設定はガイド通りにコピペで行けるのですが、大事なことは設定でソケットのパスを統一しておくことです。

それさえ間違わなければ動きます。

サーバーの設定が終わったらDNSレコードにDMARCの設定を追加します。

参考

  • https://wiki.archlinux.org/title/OpenDMARC
  • https://www.linuxbabe.com/mail-server/opendmarc-postfix-debian
Posted in Mail | Comments Off on mail serverにOpenDMARCを追加

ThinkPad x220: macOS Montereyのセットアップ

Screenshot

先日、x230のセットアップでサイトの資料を見て、元々High Sierra 10.13止まりだったのですが、OpenCoreの開発でSandyでも最新のSonomaまで入れることができるようです。とはいうものの、いきなり高飛びでSonomaを入れるのはSandyでは難易度が高そうなのでまだサポートがあるMontereyを入れることにしました。

  • https://github.com/Neelakurinji123/Thinkpad-x220-OpenCore

OpenCore 0.9.9でconfig.plistの設定と必要なkextsの情報はリンクの資料でほぼ間に合いました。

  • https://x220.mcdonnelltech.com/
  • X220_v1.46_Modified_BIOS.zip
  • https://github.com/5T33Z0/OC-Little-Translated/blob/main/14_OCLP_Wintel/Guides/Sandy_Bridge.md
  • https://dortania.github.io/OpenCore-Post-Install/universal/pm.html#sandy-and-ivy-bridge-power-management
  • https://github.com/Piker-Alpha/ssdtPRGen.sh
  • https://www.insanelymac.com/forum/topic/350719-power-management-sandy-bridge-x79-big-sur-1163-opencore-077/
  • https://github.com/5T33Z0/OC-Little-Translated/blob/main/14_OCLP_Wintel/Enable_Features/WiFi_Sonoma.md
  • https://github.com/5T33Z0/OC-Little-Translated/blob/main/I_Windows/SMBIOS_Windows.md
  • https://www.tonymacx86.com/threads/custom-ssdts-using-corpnewts-ssdttime.318976/
Posted in macOS | Comments Off on ThinkPad x220: macOS Montereyのセットアップ

ThinkPad x230i: macOS Venturaのセットアップ

Screenshot

Thinkpad X230iにmacOS Venturaをインストールしました。

  • https://github.com/Neelakurinji123/Thinkpad-x230i-EFI

参考

  • https://www.tonymacx86.com/threads/ventura-on-ivy-bridge.324225/page-10
  • https://github.com/acidanthera/OpenCorePkg
  • https://dortania.github.io/OpenCore-Legacy-Patcher/
  • https://github.com/ic005k/OCAuxiliaryTools
  • https://github.com/5T33Z0/OC-Little-Translated/tree/main/09_Board-ID_VMM-Spoof
  • https://github.com/5T33Z0/OC-Little-Translated/tree/main/14_OCLP_Wintel
  • https://github.com/5T33Z0/OC-Little-Translated/blob/main/14_OCLP_Wintel/Guides/Ivy_Bridge.md
  • https://dortania.github.io/OpenCore-Post-Install/usb/misc/keyboard.html#method-1-add-wake-type-property-recommended
  • https://elitemacx86.com/threads/storage-compatibility-for-macos.875/
  • https://dortania.github.io/Anti-Hackintosh-Buyers-Guide/Storage.html
Posted in macOS | Comments Off on ThinkPad x230i: macOS Venturaのセットアップ

ThinkCentre M73 Tiny: macOS Venturaのセットアップ

OpenCoreの完成度が高く旧型PCでも十分使えるのでHaswellでも問題ないようです。EFIはGithubからダウンロードして使います。

  • https://github.com/UHDbits/M73-Tiny-OpenCore

サイトを読むといくつか制約がありそれをクリアしているかどうか確認します。

この中で大きい制約はGPUでMonterey以降はHD Graphics 4600であることが重要です。

wifiはBrodcomモジュールを新たにインストールするのも勿体無いので、すでにあるCentrino® Advanced-N 6205を使います。したがってOpenCoreの設定もその部分は変更します。

BiosはWhitelistを外さなくても使えますが、一応外し方があるので紹介しておきます。

  • https://www.bios-mods.com/forum/Thread-REQUEST-Lenovo-ThinkCentre-M73-Tiny-FHKTxxAUS-Whitelist-Removal?page=5

Biosのアップデートの時にmodelとserialに’INVALID’を入れればいいようです。ちょっとしたグリンチ、不具合はブート時にビープ音が鳴ります。

それとBiosの設定はOpenCoreのサイトにある通りであとGPUのメモリをMAXに変更します。メモリが少ないと表示に不具合が発生します。

Screenshot

成果物

https://github.com/Neelakurinji123/M73-Tiny-OpenCore

Posted in macOS | Comments Off on ThinkCentre M73 Tiny: macOS Venturaのセットアップ

SIP電話機:SIP-2100Pの設定

Budgetone -100がとうとう壊れてしまったので新たにSIP電話機を導入しました。

以前よりサンヨーのSIP電話機が使えるということを知ってまして今回Amazonで注文しました。

中古で黄ばみがひどい商品とのことでしたが、実際に届いてみると新品同様、パネルに少し傷がついてる程度でした。当初の製品ではACアダプターがついてないということでしたがこの商品にはついてました。

ということで三千円でかなりのお買い得でした。

肝心の設定ですが、実際に簡単マニュアルしかなく、検索したところありました。😀

https://fullcover.blog.ss-blog.jp/2009-09-21

  • ユーザ名: admin
  • パスワード: 1234 

これでネットワーク設定とSIP設定ができます。

1台しかないのでpbxのような大掛かりなシステムは必要なく、ポートフォワーディングでSIPフォンに直接外部環境に繋げてあります。一つだけ前回から変更したのはRTP Port(Start):10000からなので範囲を+10にしてゲートウェイのFWと同時に変更しました。

Posted in VoIP | Leave a comment

自動水やり器の制作

Fonera Simpl(fon2405e 8M)を使って自動水やりシステム器の制作をしました。Fonera Simplは以前にSPIフラッシュを換装してOpenWrtをインストールしたものを使います。今回、リセットボタンのgpioを使うのでDTSを修正して使います。

cronでシェルスクリプトを起動させて稼働させます。

#!/bin/sh

GPIO='/sys/devices/platform/gpio-leds/leds/switch1/brightness'
#TMPF='/tmp/tap.log'
#DATE=`date -I'seconds'`
MINS=$1

if [ -z "$1" ]; then
  MINS=1
elif [ "$1" -gt "3" ]; then  # MAX 3min
  MINS=5
fi

STATE=`cat $GPIO`
if [ "$STATE" -ne "0" ] ; then
  echo 0 > $GPIO
  logger -p notice -t tap "start"
#  water_control.sh &
  sleep $(( $MINS * 60 ))
fi

STATE=`cat $GPIO`
if [ "$STATE" -eq "0" ] ; then
  echo 255 > $GPIO
  logger -p notice -t tap "stop"
fi

STATE=`cat $GPIO`
if [ "$STATE" -ne "255" ] ; then
  logger -p err -t tap "tap malfunction"  
fi

さらに天気に合わせて水やりをコントロールしてみます。

#!/bin/sh

GPIO='/sys/devices/platform/gpio-leds/leds/switch1/brightness'

tap_off () {
  echo 255 > $GPIO
  logger -p notice -t tap "stop"
}

get_data () {
  DATA=`wget -q -O - 'https://api.openweathermap.org/data/2.5/onecall?lat=35.4761&lon=139.2810&units=metric&lang=en&exclude=minutely&appid=**********************'`
  TEMP=`echo $DATA | jq ".daily[0].temp.day"`
  PREC=`echo $DATA | jq ".daily[0].rain"`
}

get_data || exit

if [ "$PREC" = "null" ]; then
    PREC=0
fi

if [ `echo $TEMP'<'10 | bc` -eq "1" ] && [ `echo $PREC'>'1 | bc` -eq "1" ]; then
    sleep 30
    tap_off
elif [ `echo $TEMP'<'10 | bc` -eq "1" ] && [ `echo $PREC'<='2 | bc` -eq "1" ]; then
    sleep 45
    tap_off
elif [ `echo $TEMP'<'20 | bc` -eq "1" ] && [ `echo $PREC'>'2 | bc` -eq "1" ]; then
    sleep 45
    tap_off
elif [ `echo $TEMP'<'20 | bc` -eq "1" ] && [ `echo $PREC'<='2 | bc` -eq "1" ]; then
    sleep 60
    tap_off
elif [ `echo $TEMP'<'30 | bc` -eq "1" ] && [ `echo $PREC'>'2 | bc` -eq "1" ]; then
    sleep 60
    tap_off
fi

logger -p notice -t tap "Temp: ${TEMP}  Precipitation: $PREC"

Posted in DIY, OpenWrt | Comments Off on 自動水やり器の制作