HAS_Prepper_Disk README

项目的 README,来自 github.com/schematrix/HAS_Prepper_Disk。合并为一个 markdown 文件:README.md。

HAS_PrepperDisk exploded view

English · Türkçe


Katkıda Bulunanlar / Contributors

HAS_PrepperDisk topluluğun emeğiyle büyüyor. Her katkı gerçek bir Raspberry Pi 5 üzerinde denendi ve sonra eklendi. Emeği geçen herkese teşekkürler.

HAS_PrepperDisk grows with the community's work. Every contribution below was tested on a real Raspberry Pi 5 before it was merged. Thank you to everyone who helped.

PR Katkıda bulunan / Contributor Ne getirdi What it added
#3 @turer73, doğrulama / verified by @volthdl Kaldırılmış ZIM adlarını düzeltti, Türkçe içerikleri (Vikikitap, Vikisöz, Vikikaynak, Vikisözlük, PhET, iFixit) ekledi, sürümleri Kiwix kataloğundan bulup her indirmeyi SHA-256 ile doğrulayan indirme betiği Fixed retired ZIM names, added Turkish content (Wikibooks, Wikiquote, Wikisource, Wiktionary, PhET, iFixit), catalog-based versions and SHA-256 verification for every download
#10 @Proxy34 Ana sayfada telefonun değil kutunun saati, ZIM dosyalarının doğru eşleşmesi ve README düzeltmeleri Homepage shows the box's clock instead of the phone's, correct ZIM matching and README fixes
#11 @Proxy34 AFAD, CDC ve EPA kaynaklı, internetsiz açılan Türkçe acil durum sayfası Turkish emergency page sourced from AFAD, CDC and EPA, works offline
#12 @efeesrefinal Kutunun durumunu tek komutla gösteren salt okunur sağlık kontrolü (status.sh) Read-only health check that shows the box's state in one command (status.sh)
#13 @efeesrefinal Her PR'da kabuk betiklerini otomatik denetleyen ShellCheck CI ShellCheck CI that checks the shell scripts on every PR
#16 @Proxy34 Telefonda rahat okunan ve parmakla kolay basılan ana sayfa Homepage that is easy to read and tap on phones
#17 @Proxy34 Disk dolarken, SSD yıpranırken ya da güç yetersizken ana sayfada uyarı Homepage warnings when the disk is filling up, the SSD is wearing out or power is insufficient
#28 @isihussain İnternetsiz ortamda saati korumak için RTC pili notu RTC battery note for keeping the time without internet
#29 @isihussain Windows'ta klonlanan betiklerin Pi'de bozulmaması için satır sonu ayarı (.gitattributes) Line-ending rules (.gitattributes) so scripts cloned on Windows still run on the Pi

İnceleme ve testleriyle açık PR'lara destek olan @volthdl, @FurkanKY, @Proxy34 ve @ramazansancar'a da ayrıca teşekkürler.

Special thanks also to @volthdl, @FurkanKY, @Proxy34 and @ramazansancar for reviewing and testing open PRs.

English

An offline knowledge archive on a Raspberry Pi 5. Wikipedia, maps, medical references and repair guides, served over the Pi's own Wi-Fi hotspot. Any phone or laptop that joins the network can open them in a browser. No internet needed.

Built on Internet-in-a-Box and Kiwix. This repo adds a ready-made configuration, helper scripts and a custom homepage.

Hardware

Part Notes
Raspberry Pi 5 (4 GB or 8 GB)
M.2 NVMe HAT + NVMe SSD (256 GB+) Content lives here
microSD card (32 GB+) Operating system
5V/5A USB-C power supply The official one is recommended
Active cooler The Pi 5 and SSD get warm
Ethernet cable Recommended during install
RTC battery (optional) Keeps system time offline (e.g. official SC1163)

RTC battery note: Without internet access, the Pi 5 cannot sync time via NTP. When power is lost, the internal RTC clock resets unless a backup battery is connected to the J5 (BAT) connector. If you use the official rechargeable Panasonic ML-2020 battery (SC1163), enable trickle-charging by adding dtparam=rtc_bbat_vchg=3000000 to /boot/firmware/config.txt. (Do not enable charging if using standard non-rechargeable CR2032 cells).

Screenshot 2026-10-30 at 23 22 21

Installation

1. Operating system. Use Raspberry Pi Imager to flash Raspberry Pi OS Lite (64-bit) to the SD card. In Imager's settings, enable SSH and set a username and password. Boot the Pi with the SSD attached and connect it to your router with Ethernet.

2. Update and get this repo.

sudo apt update && sudo apt full-upgrade -y
sudo apt install -y git
git clone https://github.com/schematrix/HAS_Prepper_Disk.git
cd HAS_Prepper_Disk
chmod +x install.sh scripts/*.sh

3. Mount the SSD at /library. Find the disk name with lsblk; it is usually nvme0n1. If the disk is not ext4 it will be formatted, and the script asks before doing so.

sudo ./scripts/setup-ssd.sh /dev/nvme0n1

4. Install. The script asks for the Wi-Fi name and password, then installs Internet-in-a-Box (30–60 min). If the Pi reboots or the install stops, run the same command again. It continues where it left off.

sudo ./install.sh

During the install Internet-in-a-Box asks three things of its own: a new password for the iiab-admin user (used for http://<pi-ip>/admin, write it down), a key press to confirm you will re-run the command if something goes wrong, and at the end Enter to reboot. After the reboot run sudo ./install.sh once more; it skips the finished part and installs the homepage.

5. Download content. Edit config/content.conf to choose what to download, then run the script below. The defaults need about 160 GB, and downloads can take many hours. If a download is interrupted, re-run the script and it resumes. The script looks up the newest version of each ZIM in the Kiwix catalog, checks free disk space before each download and verifies every file against its SHA-256 checksum.

sudo ./scripts/download-content.sh

6. Maps. Open http://<pi-ip>/admin (user iiab-admin), go to the maps section of the Install Content menu and choose the regions you want.

7. Use it. Join the Wi-Fi network you created and open http://box.lan/home.

Optional: internet over a USB Wi-Fi adapter

The Pi's built-in Wi-Fi is dedicated to the hotspot. If the Pi needs internet temporarily (updates, new content) and there is no Ethernet cable, add a cheap USB Wi-Fi adapter as a second card. Adapters with the MediaTek MT7601U chip work out of the box.

  1. Plug the adapter in, preferably into a black USB 2.0 port. The blue USB 3.0 ports can interfere with 2.4 GHz Wi-Fi.
  2. Join the Pi's hotspot from your laptop and connect: ssh [email protected]
  3. Connect the adapter (usually wlan1) to a Wi-Fi network:
    nmcli device wifi list ifname wlan1
    sudo nmcli device wifi connect "NETWORK_NAME" password "PASSWORD" ifname wlan1 name temp-wifi
    
  4. When you are done, remove the connection: sudo nmcli connection delete temp-wifi

Never run sudo iiab-network while a USB Wi-Fi adapter is plugged in. It may move the hotspot onto the adapter. Unplug it first.

Disk and power health

Every 6 hours (and 5 minutes after boot) scripts/disk-health.sh checks the /library disk and the Pi's power supply. If something is wrong, a red warning appears at the top of the homepage:

Check now: sudo ./scripts/disk-health.sh. Disks behind some USB adapters don't report SMART; those checks are then skipped silently.

Repo layout

install.sh                 main installer
scripts/setup-ssd.sh       mounts the SSD at /library
scripts/download-content.sh  downloads/updates ZIM files from Kiwix
scripts/install-homepage.sh  installs the custom homepage
scripts/status.sh          health check: disk, services, hotspot, content, power
scripts/disk-health.sh     disk and power health check (saglik/: its systemd timer)
config/iiab-overrides.yml  Internet-in-a-Box settings
config/content.conf        list of content to download
www/home/index.html        homepage
www/home/acil.html         emergency page (Turkish, sourced from AFAD and EPA)

Troubleshooting

Start with the health check. It only reads, needs no sudo, and points to the matching fix below:

./scripts/status.sh

It checks free space on the SD card and SSD, the web, Kiwix, hotspot and DHCP services, the hotspot bridge, which ZIMs from config/content.conf are missing or not yet in the Kiwix library, unfinished downloads, CPU temperature and under-voltage. It exits with 1 if it finds a problem, so it can also run from cron.

License

The scripts and homepage in this repo are released under the MIT License. Internet-in-a-Box, Kiwix and all downloaded content (Wikipedia, OpenStreetMap, etc.) keep their own licenses. This project is not affiliated with Internet-in-a-Box or Kiwix.


Türkçe

Raspberry Pi 5 üzerinde çevrimdışı bilgi arşivi. Wikipedia, haritalar, tıbbi başvuru kaynakları ve tamir rehberleri Pi'nin kendi Wi-Fi ağı üzerinden sunulur. Ağa bağlanan herhangi bir telefon ya da bilgisayar bunları tarayıcıdan açabilir. İnternet gerekmez.

Internet-in-a-Box ve Kiwix üzerine kurulmuştur. Bu repo hazır ayarlar, yardımcı betikler ve özel bir ana sayfa ekler.

Donanım

Parça Not
Raspberry Pi 5 (4 GB veya 8 GB)
M.2 NVMe HAT + NVMe SSD (256 GB+) İçerikler burada durur
microSD kart (32 GB+) İşletim sistemi
5V/5A USB-C adaptör Resmi adaptör önerilir
Aktif soğutucu Pi 5 ve SSD ısınır
Ethernet kablosu Kurulum sırasında önerilir
RTC pili (isteğe bağlı) İnternetsiz ortamda sistem saatini korur (örn. resmi SC1163)

RTC pili notu: Afet durumunda internet bağlantısı olmadığı için Pi 5 zamanı NTP üzerinden eşitleyemez. Elektrik kesildiğinde sistem saatinin sıfırlanmaması için Pi 5'in J5 (BAT) yuvasına bir yedek pil takılması önerilir. Resmi şarj edilebilir Panasonic ML-2020 pil (SC1163) kullanıyorsanız, /boot/firmware/config.txt dosyasına dtparam=rtc_bbat_vchg=3000000 ekleyerek şarj özelliğini açabilirsiniz. (Standart şarj edilmeyen CR2032 pillerde bu ayarı kesinlikle açmayın).

Kurulum

1. İşletim sistemi. Raspberry Pi Imager ile SD karta Raspberry Pi OS Lite (64-bit) yaz. Imager ayarlarında SSH'ı aç, kullanıcı adı ve şifre belirle. Pi'yi SSD takılıyken başlat ve modeme Ethernet ile bağla.

2. Sistemi güncelle ve repoyu indir.

sudo apt update && sudo apt full-upgrade -y
sudo apt install -y git
git clone https://github.com/schematrix/HAS_Prepper_Disk.git
cd HAS_Prepper_Disk
chmod +x install.sh scripts/*.sh

3. SSD'yi /library klasörüne bağla. Disk adını lsblk ile bul, genelde nvme0n1 olur. Disk ext4 değilse formatlanır, ama betik bunu yapmadan önce onay ister.

sudo ./scripts/setup-ssd.sh /dev/nvme0n1

4. Kur. Betik önce Wi-Fi adını ve şifresini sorar, sonra Internet-in-a-Box'ı kurar (30–60 dk). Pi yeniden başlarsa ya da kurulum yarıda kalırsa aynı komutu tekrar çalıştır. Kaldığı yerden devam eder.

sudo ./install.sh

Kurulum sırasında Internet-in-a-Box kendisi üç şey sorar: iiab-admin kullanıcısı için yeni bir şifre (http://<pi-ip>/admin girişinde kullanılır, bir yere not et), bir sorun olursa komutu tekrar çalıştıracağını onaylaman için bir tuşa basman ve en sonda yeniden başlatmak için Enter. Pi açıldıktan sonra sudo ./install.sh komutunu bir kez daha çalıştır; biten kısmı atlar ve ana sayfayı kurar.

5. İçerikleri indir. Ne indirileceğini config/content.conf dosyasından seç, sonra aşağıdaki betiği çalıştır. Varsayılan liste yaklaşık 160 GB tutar ve indirme saatler sürebilir. İndirme yarıda kalırsa betiği tekrar çalıştırman yeterli, kaldığı yerden devam eder. Betik her ZIM'in en yeni sürümünü Kiwix kataloğundan bulur, her indirmeden önce boş alanı kontrol eder ve inen dosyayı SHA-256 özetiyle doğrular.

sudo ./scripts/download-content.sh

6. Haritalar. http://<pi-ip>/admin adresine gir (kullanıcı adı iiab-admin), Install Content menüsündeki harita bölümüne git ve istediğin bölgeleri seç.

7. Kullan. Oluşturduğun Wi-Fi ağına bağlan ve http://box.lan/home adresini aç.

İsteğe bağlı: USB Wi-Fi adaptörüyle internet

Pi'nin dahili Wi-Fi kartı sadece hotspot için kullanılıyor. Pi'nin geçici olarak internete çıkması gerekirse (güncelleme, yeni içerik) ve Ethernet kablosu yoksa ikinci kart olarak ucuz bir USB Wi-Fi adaptörü tak. MediaTek MT7601U yongalı adaptörler kurulumsuz çalışıyor.

  1. Adaptörü mümkünse siyah USB 2.0 portlarından birine tak. Mavi USB 3.0 portları 2,4 GHz Wi-Fi'da parazit yapabiliyor.
  2. Bilgisayarını Pi'nin hotspot'una bağla ve SSH ile gir: ssh [email protected]
  3. Adaptörü (genelde wlan1) bir Wi-Fi ağına bağla:
    nmcli device wifi list ifname wlan1
    sudo nmcli device wifi connect "AG_ADI" password "SIFRE" ifname wlan1 name gecici-wifi
    
  4. İşin bitince bağlantıyı sil: sudo nmcli connection delete gecici-wifi

USB Wi-Fi adaptörü takılıyken asla sudo iiab-network çalıştırma. Hotspot'u adaptöre taşıyabilir. Önce adaptörü çıkar.

Disk ve güç sağlığı

scripts/disk-health.sh 6 saatte bir (ve açılıştan 5 dakika sonra) /library diskine ve Pi'nin güç kaynağına bakar. Bir sorun varsa ana sayfanın en üstünde kırmızı bir uyarı çıkar:

Hemen kontrol: sudo ./scripts/disk-health.sh. Bazı USB adaptörlerinin arkasındaki diskler SMART bilgisi vermez; o zaman bu kontrol sessizce atlanır.

Repo yapısı

install.sh                   ana kurulum betiği
scripts/setup-ssd.sh         SSD'yi /library klasörüne bağlar
scripts/download-content.sh  Kiwix'ten ZIM dosyalarını indirir/günceller
scripts/install-homepage.sh  özel ana sayfayı kurar
scripts/status.sh            sağlık kontrolü: disk, servisler, hotspot, içerik, güç
scripts/disk-health.sh       disk ve güç sağlığı denetimi (saglik/: systemd zamanlayıcısı)
config/iiab-overrides.yml    Internet-in-a-Box ayarları
config/content.conf          indirilecek içerik listesi
www/home/index.html          ana sayfa
www/home/acil.html           acil durum sayfası (AFAD ve EPA kaynaklı)

Sorun giderme

Önce sağlık kontrolünü çalıştır. Sadece okur, sudo gerektirmez ve aşağıdaki ilgili çözüme yönlendirir:

./scripts/status.sh

SD kart ve SSD'deki boş alanı, web, Kiwix, hotspot ve DHCP servislerini, hotspot köprüsünü, config/content.conf içindeki ZIM'lerden eksik olanları ya da Kiwix kütüphanesine henüz eklenmemiş olanları, yarım kalan indirmeleri, işlemci sıcaklığını ve düşük voltajı kontrol eder. Sorun bulursa 1 koduyla çıkar, bu yüzden cron ile de çalıştırılabilir.

Lisans

Bu repodaki betikler ve ana sayfa MIT Lisansı ile yayınlanmıştır. Internet-in-a-Box, Kiwix ve indirilen tüm içerikler (Wikipedia, OpenStreetMap vb.) kendi lisanslarına tabidir. Bu proje Internet-in-a-Box veya Kiwix ile bağlantılı değildir.

HAS_Prepper_Disk (schematrix/HAS_Prepper_Disk)

正在搜索数据库…

这是什么?一个供 Raspberry Pi 5 使用的离线知识库。它通过树莓派自身的 Wi-Fi 热点提供维基百科、地图、医学参考资料和维修指南,因此任何手机或笔记本电脑无需联网,都可以在浏览器中打开这些内容。
这是我要安装的应用,还是一整套系统?它是基于 Internet-in-a-Box 和 Kiwix 构建的现成方案,包含预设配置、辅助脚本和自定义首页,需要安装到专用的树莓派上。
我该如何让它运行起来?使用 Raspberry Pi Imager 烧录 Raspberry Pi OS Lite(64 位),启用 SSH,将 SSD 挂载到 /library,然后运行仓库中的安装脚本。脚本会询问 Wi-Fi 名称和密码,大约需要 30 到 60 分钟。如果中途停止,再次运行同一条命令即可继续。重启后,再运行一次 install.sh 以添加首页。
我需要什么硬件?一台 4 GB 或 8 GB 版本的 Raspberry Pi 5、一块用于存放内容的 M.2 NVMe HAT 及容量 256 GB 以上的 SSD、一张用于系统的 microSD 卡(容量 32 GB 以上)、一个 5V/5A USB-C 电源和一个主动散热器。安装期间建议使用有线以太网连接,RTC 电池为可选配件。
设置完成后还需要联网吗?不需要。连接到树莓派热点的设备会在本地读取所有内容。只有在更新或添加新内容时才需要联网,此时可以临时加装一个 USB 无线网卡。
离线资料库里有什么内容?维基百科、OpenStreetMap 地图、医学参考资料和维修指南,均通过 Kiwix 提供。该仓库还加入了土耳其语资料,如 Wikibooks、Wikiquote、Wikisource、Wiktionary、PhET 和 iFixit,以及一个基于 AFAD、CDC 和 EPA 来源制作的土耳其语应急页面。
有没有快速检查设备运行状况的方法?有。status.sh 是一个只读的健康检查脚本,无需 sudo 即可运行。它会检查磁盘空间、核心服务、热点、缺失的 ZIM 文件、未完成的下载、CPU 温度和欠压情况,并指出对应的修复方法。
大小
2.5 MB
星标
811
更新
提交Nov 07
时长
22天
提交 · 90 天