手動安裝(離線)

    版本為 01:04, 8 Jul 2024

    到這個版本。

    返回到 版本存檔.

    查閱目前版本

    手動安裝 NextRadio

    開始改機

    要將網樂通變身成網路收音機,第一步就是換上支持 OSS (Open Sound System) 的 kernel 和 Debian 5.0(Lenny)的 rootf。

    換 Kernel/rootfs

    • 將網樂通連上一個有DHCP Server的網路上,開機,並用 telent 連進去。
      • $ cd /mnt/usb
      • $ rm -rf * (注意,做這一步之前,請確認/dev/sda3 是 mount 在/mnt/usb上)
      • $ wget http://www.openfoundry.org/of/download_path/nextpbx/nextradio-vmlinux/vmlinux.ub.oss1.cpu
      • $ wget http://www.openfoundry.org/of/download_path/nextpbx/nextradio-rootfs/lenny.sh4.tar.bz2
      • $ bunzip2 -dc lenny.sh4.tar.bz2 | tar xvf -
      • $ sync; sync; sync (因網樂通的 usb storage 寫入速度非慢,所以建議改完任何檔案內容後,都要下 sync 指令,以確認所做的更動己經寫入usb storage)
    • 改rootfs中網路卡的MAC
      • $ vi etc/network/interfaces
      • 將這行 "hwaddress ether 00:01:04:1b:2C:1F"修改為機器外盒上註明的 MAC
    • 換 kernel
      • $ cp vmlinux.ub.oss1.cpu /vmlinux.ub  (注意, 此處假設 /dev/sda2 mount 在 / 上)
      • $ sync; sync; sync
    • 改完了,重新開機。開機後可以用 ssh  root/root 連進去。

    安裝 NextRadio

    • 插上 USB 音效卡
    • 重開機, 使用 ssh 用 root/root 登入
    • $ apt-get install python psmisc lirc wget
    • $ cd /root
    • $ mkdir NextRadio
    • $ cd NextRadio
    • $ wget https://raw.github.com/sp0500/NextRadio/master/lircd_V1.conf
    • $ wget https://raw.github.com/sp0500/NextRadio/master/radio.pls
    • $ wget https://raw.github.com/sp0500/NextRadio/master/a.py
    • $ wget https://github.com/sp0500/NextRadio/raw/master/mplayer-sh4
    • $ wget https://raw.github.com/sp0500/NextRadio/master/mplayer.conf
    • $ cp mplayer-sh4 /usr/bin/mplayer
    • $ cp mplayer.conf /etc/mplayer/
    • $ cp lircd_V1.conf /etc/lirc/lircd.conf
    • $ sync
    • $ /etc/init.d/lirc restart
    • $ python a.py 
    • 用遙控器的數字轉台, radio.txt 是電台列表,可自行編輯。
    • 如果一切正常,可將"/usr/bin/python /root/NextRadio/a.py &" 這行命令放入 /etc/rc.local 讓它開機自動執行。
    • 完工

    節能設定

    • 修改/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    • $ echo "conservative" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    • 改完後,可以用 cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq  就可以看到現在的CPU 時脈是多少。通常會降為112500KHz (原來是450000KHz)
    • 這個設定重開機後會消失, 可以將這行命令 echo "conservative" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor  放入 /etc/rc.local,使其一開機就啟動。
    • 參考資料 如何為網樂通節能 
    Powered by MindTouch Core