Tự lực cánh sinh thôi các bác ơi !
Lấy con Pi3 ra làm Linux dùng SSH a .
########################################################
#
# Build Recipe v1.0, 2017-10-31
#
# These instructions are written for Linux Enthusiasts
# and System Integrators and provide a recipe for making
# a custom OS for running moOde audio player.
#
# Unless otherwise noted or if a command requires user
# interaction, groups of commands can be run in batch.
#
# moOde 4.0 Beta 6
#
# (C) Tim Curtis 2017
http://moodeaudio.org
#
########################################################
////////////////////////////////////////////////////////
//
// STEP 1 - Download Raspbian Stretch Lite 2017-09-07
//
////////////////////////////////////////////////////////
Download the file to a computer that has SD Card image writing capability, then unzip it.
http://downloads.raspberrypi.org/ra...17-09-08/2017-09-07-raspbian-stretch-lite.zip
////////////////////////////////////////////////////////
//
// STEP 2 - Enable SSH and remove the Auto-Expand task
//
////////////////////////////////////////////////////////
1. Copy the Stretch Lite image file to a USB stick.
2. Insert the USB stick in a computer running Linux.
NOTE: Offsets used in the mount commands are derived from partition data on 2017-09-07-raspbian-stretch-lite.img.
Use "sudo fdisk -l -o Device,Start,Type | grep 0p" to print the partition data. Offset = Start * 512.
sudo mkdir /mnt/tmp
sudo mkdir /mnt/tmp1
sudo mount /dev/sda1 /mnt/tmp
sudo mount -v -o offset=4194304 -t vfat /mnt/tmp/2017-09-07-raspbian-stretch-lite.img /mnt/tmp1
sudo touch /mnt/tmp1/ssh
sudo sed -i "s/init=.*//" /mnt/tmp1/cmdline.txt
sudo sed -i "s/quiet.*//" /mnt/tmp1/cmdline.txt
sudo sed -i "s/^/net.ifnames=0 /" /mnt/tmp1/cmdline.txt
sudo umount /mnt/tmp1
sudo mount -v -o offset=48234496 -t ext4 /mnt/tmp/2017-09-07-raspbian-stretch-lite.img /mnt/tmp1
sudo rm /mnt/tmp1/etc/init.d/resize2fs_once
sudo umount /mnt/tmp1
sudo umount /mnt/tmp
sudo rm -rf /mnt/tmp*
sync
3. Remove the USB stick.
////////////////////////////////////////////////////////
//
// STEP 3 - Expand the root partition to 3GB
//
////////////////////////////////////////////////////////
1. Write the image file contained on the USB stick to an SD Card.
2. Insert the SD Card into a Raspberry Pi and POWER UP.
3. Change the current password (raspberry) to moodeaudio and the host name to moode.
ssh pi@raspberrypi (pwd=raspberry)
passwd
sudo sed -i "s/raspberrypi/moode/" /etc/hostname
sudo sed -i "s/raspberrypi/moode/" /etc/hosts
4. Download moOde application sources and configs.
NOTE: We are downloading the Sources in this particular step in order to obtain the resizefs.sh file.
cd ~
wget
http://moodeaudio.org/downloads/beta/r40b6/rel-stretch.zip
sudo unzip ./rel-stretch.zip
5. Expand the root partition to 3GB.
sudo cp ./rel-stretch/www/command/resizefs.sh ./
sudo chmod 0755 ./resizefs.sh
sudo sed -i "/PART_END=/c\PART_END=+3000M" ./resizefs.sh
sudo ./resizefs.sh start
sudo rm ./resizefs.sh
sudo cp ./rel-stretch/boot/config.txt.default /boot/config.txt
sudo poweroff
////////////////////////////////////////////////////////
//
// STEP 4 - Install core packages
//
////////////////////////////////////////////////////////
1. First lets make some basic optimizations
ssh pi@moode (pwd=moodeaudio)
sudo dphys-swapfile swapoff
sudo update-rc.d dphys-swapfile remove
sudo rm /var/swap
sudo systemctl disable cron.service
sudo systemctl enable rpcbind
sudo apt-get -y purge triggerhappy
2. Install core packages.
# NOTE: run these two commands separately
sudo apt-get update
sudo apt-get -y upgrade
sudo reboot
sudo apt-get -y install rpi-update php-fpm nginx sqlite3 php-sqlite3 memcached php-memcache mpc \
bs2b-ladspa libbs2b0 libasound2-plugin-equal telnet automake sysstat squashfs-tools tcpdump shellinabox \
samba smbclient udisks-glue ntfs-3g exfat-fuse git inotify-tools libav-tools
sudo systemctl disable shellinabox
////////////////////////////////////////////////////////
//
// STEP 5 - Install enhanced networking
//
////////////////////////////////////////////////////////
1. Install Host AP mode
sudo apt-get -y install dnsmasq hostapd
sudo systemctl daemon-reload
sudo systemctl disable hostapd
sudo systemctl disable dnsmasq
2. Install Bluetooth
sudo apt-get -y install bluez bluez-firmware pi-bluetooth \
dh-autoreconf expect libortp-dev libbluetooth-dev libasound2-dev \
libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc-dev
NOTE: Ignore warnings from autoreconf and configure
cd /tmp
sudo git clone
https://github.com/Arkq/bluez-alsa.git
cd bluez-alsa
sudo autoreconf --install
sudo mkdir build
cd build
sudo ../configure --disable-hcitop --with-alsaplugindir=/usr/lib/arm-linux-gnueabihf/alsa-lib
sudo make
sudo make install
cd ~
sudo rm -rf /tmp/bluez-alsa
3. Services are started by moOde Worker so lets disable them here.
sudo systemctl daemon-reload
sudo systemctl disable bluetooth.service
sudo systemctl disable bluealsa.service
sudo systemctl disable hciuart.service
4. Finish up
sudo mkdir -p /var/run/bluealsa
sudo sync
sudo apt-get clean
sudo reboot
////////////////////////////////////////////////////////
//
// STEP 6 - Install Rotary encoder driver
//
////////////////////////////////////////////////////////
1. WiringPi
NOTE: Ignore warnings during build
sudo cp ./rel-stretch/other/wiringpi/wiringPi-2.44-96344ff.tar.gz ./
sudo tar xfz ./wiringPi-2.44-96344ff.tar.gz
cd wiringPi-96344ff
sudo ./build
cd ~/
sudo rm -rf ./wiringPi-96344ff
sudo rm ./wiringPi-2.44-96344ff.tar.gz
2. Rotenc
sudo cp ./rel-stretch/other/rotenc/rotenc.c ./
sudo gcc -std=c99 rotenc.c -orotenc -lwiringPi
sudo cp ./rotenc /usr/local/bin
sudo rm ./rotenc*
////////////////////////////////////////////////////////
//
// STEP 7 - Compile and install MPD
//
////////////////////////////////////////////////////////
1. Create MPD runtime environment.
sudo useradd mpd
sudo mkdir /var/lib/mpd
sudo mkdir /var/lib/mpd/music
sudo mkdir /var/lib/mpd/playlists
sudo touch /var/lib/mpd/state
sudo chown -R mpd:audio /var/lib/mpd
sudo mkdir /var/log/mpd
sudo touch /var/log/mpd/mpd.log
sudo chmod 644 /var/log/mpd/mpd.log
sudo chown -R mpd:audio /var/log/mpd
sudo cp ./rel-stretch/mpd/mpd.conf.default /etc/mpd.conf
sudo chown mpd:audio /etc/mpd.conf
sudo chmod 0666 /etc/mpd.conf
2. Install MPD dev libs.
sudo apt-get -y install libmad0-dev libmpg123-dev libid3tag0-dev \
libflac-dev libvorbis-dev libfaad-dev \
libwavpack-dev \
libavcodec-dev libavformat-dev \
libmp3lame-dev \
libsoxr-dev \
libcdio-paranoia-dev libiso9660-dev \
libcurl4-gnutls-dev \
libasound2-dev \
libshout3-dev libyajl-dev \
libmpdclient-dev \
libavahi-client-dev \
libsystemd-dev \
libwrap0-dev \
libboost-dev \
libicu-dev \
libglib2.0-dev
3. Download MPD 0.20.10 sources and prep for compile.
sudo wget
http://www.musicpd.org/download/mpd/0.20/mpd-0.20.10.tar.xz
sudo tar xf mpd-0.20.10.tar.xz
cd mpd-0.20.10
sudo sh autogen.sh
4. Configure compile options.
sudo ./configure --enable-database --enable-libmpdclient --enable-alsa \
--enable-curl --enable-dsd --enable-ffmpeg --enable-flac \
--enable-id3 --enable-soundcloud --enable-lame-encoder --enable-mad \
--enable-mpg123 --enable-pipe-output --enable-recorder-output --enable-shout \
--enable-vorbis --enable-wave-encoder --enable-wavpack --enable-httpd-output \
--enable-soxr --with-zeroconf=avahi \
--disable-bzip2 --disable-zzip --disable-fluidsynth --disable-gme \
--disable-wildmidi --disable-sqlite --disable-jack --disable-ao --disable-oss \
--disable-ipv6 --disable-pulse --disable-nfs --disable-smbclient \
--disable-upnp --disable-expat --disable-lsr \
--disable-sndfile --disable-audiofile --disable-sidplay
5. Compile and install.
// Enjoy a Coffee and listen to some Tunes while the compile runs
sudo make
sudo make install
sudo strip --strip-unneeded /usr/local/bin/mpd
cd ~
sudo rm -rf ./mpd-0.20.10*
sudo apt-get clean
sudo apt-get autoremove
sudo reboot
////////////////////////////////////////////////////////
//
// STEP 8 - Create moOde runtime environment
//
////////////////////////////////////////////////////////
1. Privilages
sudo -i
echo -e 'pi\tALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
echo -e 'www-data\tALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
logout
2. Directories and files
# Dirs
sudo mkdir /var/local/www
sudo mkdir /var/local/www/commandw
sudo mkdir /var/local/www/cssw
sudo mkdir /var/local/www/jsw
sudo mkdir /var/local/www/imagesw
sudo mkdir /var/local/www/imagesw/toggle
sudo mkdir /var/local/www/db
sudo mkdir /var/local/www/templatesw#
sudo mkdir /var/lib/mpd/music/RADIO
sudo mkdir /mnt/NAS
sudo mkdir /mnt/SDCARD
sudo mkdir /mnt/UPNP
# Symlinks
sudo ln -s /mnt/NAS /var/lib/mpd/music/NAS
sudo ln -s /mnt/SDCARD /var/lib/mpd/music/SDCARD
sudo ln -s /media /var/lib/mpd/music/USB
sudo ln -s /var/lib/mpd/music /var/www/mpdmusic
# Logs
sudo touch /var/log/moode.log
sudo chmod 0666 /var/log/moode.log
sudo touch /var/log/php_errors.log
sudo chmod 0666 /var/log/php_errors.log
# Files
sudo cp ./rel-stretch/mpd/sticker.sql /var/lib/mpd
sudo cp -r "./rel-stretch/other/sdcard/Stereo Test/" /var/lib/mpd/music/SDCARD
sudo cp ./rel-stretch/network/interfaces.default /etc/network/interfaces
sudo cp ./rel-stretch/network/wpa_supplicant.conf.default /etc/wpa_supplicant/wpa_supplicant.conf
sudo cp ./rel-stretch/network/dhcpcd.conf.default /etc/dhcpcd.conf
sudo cp ./rel-stretch/network/hostapd.conf.default /etc/hostapd/hostapd.conf
sudo cp ./rel-stretch/var/local/www/db/moode-sqlite3.db.default /var/local/www/db/moode-sqlite3.db
# Permissions
sudo chmod 0777 /var/lib/mpd/music/RADIO
sudo chmod -R 0777 /var/local/www/db
# Deletes
sudo rm -r /var/www/html
sudo rm /etc/update-motd.d/10-uname
////////////////////////////////////////////////////////
//
// STEP 9 - Install moOde sources and configs
//
////////////////////////////////////////////////////////
1. Application sources and configs
sudo rm /var/lib/mpd/music/RADIO/*
sudo rm /var/www/images/radio-logos/*
sudo cp ./rel-stretch/mpd/RADIO/* /var/lib/mpd/music/RADIO
sudo cp ./rel-stretch/mpd/playlists/* /var/lib/mpd/playlists
sudo cp -r ./rel-stretch/etc/* /etc
sudo cp -r ./rel-stretch/home/* /home/pi
sudo cp -r ./rel-stretch/home/.dircolors /home/pi
sudo cp -r ./rel-stretch/lib/* /lib
sudo cp -r ./rel-stretch/usr/* /usr
sudo cp -r ./rel-stretch/var/* /var
sudo cp -r ./rel-stretch/www/* /var/www
sudo chmod 0755 /var/www/command/*
sudo /var/www/command/util.sh "emerald" "2ecc71" "27ae60"
sudo sqlite3 /var/local/www/db/moode-sqlite3.db "update cfg_system set value='Emerald' where param='themecolor'"
3. Permissions for service files
# MPD
sudo chmod 0755 /etc/init.d/mpd
sudo chmod 0644 /lib/systemd/system/mpd.service
sudo chmod 0644 /lib/systemd/system/mpd.socket
# Bluetooth
sudo chmod 0666 /etc/bluealsaaplay.conf
sudo chmod 0644 /etc/systemd/system/
[email protected]
sudo chmod 0644 /etc/systemd/system/bluealsa.service
sudo chmod 0644 /lib/systemd/system/bluetooth.service
sudo chmod 0755 /usr/local/bin/a2dp-autoconnect
# Rotenc
sudo chmod 0644 /lib/systemd/system/rotenc.service
# Udev
sudo chmod 0644 /etc/udev/rules.d/*
4. Services are started by moOde Worker so lets disable them here.
sudo systemctl daemon-reload
sudo systemctl disable mpd.service
sudo systemctl disable mpd.socket
sudo systemctl disable rotenc.service
# The binaries will not have been installed yet, but let's disable the services here
sudo chmod 0644 /lib/systemd/system/squeezelite-armv6l.service
sudo chmod 0644 /lib/systemd/system/squeezelite-armv7l.service
sudo systemctl disable squeezelite-armv6l
sudo systemctl disable squeezelite-armv7l
sudo chmod 0644 /lib/systemd/system/upmpdcli.service
sudo systemctl disable upmpdcli.service
5. Initial permissions for certain files. These also get set during moOde Worker startup.
sudo chmod 0777 /var/local/www/playhistory.log
sudo chmod 0777 /var/local/www/currentsong.txt
sudo touch /var/local/www/libcache.json
sudo chmod 0777 /var/local/www/libcache.json
sudo reboot
////////////////////////////////////////////////////////
//
// STEP 10 - Alsaequal
//
////////////////////////////////////////////////////////
NOTE: The alsamixer command below will generate the alsaequal bin file.
sudo alsamixer -D alsaequal
sudo chmod 0755 /usr/local/bin/alsaequal.bin
sudo chown mpd:audio /usr/local/bin/alsaequal.bin
sudo rm /usr/share/alsa/alsa.conf.d/equal.conf
mpc enable only 1
////////////////////////////////////////////////////////
//
// STEP 11 - Squash /var/www for performance/reliability
//
////////////////////////////////////////////////////////
NOTE: This is optional but highly recommended.
sudo -i
echo "/var/local/moode.sqsh /var/www squashfs ro,defaults 0 0" >>/etc/fstab
logout
cd ~
sudo rm /var/local/moode.sqsh
sudo mksquashfs /var/www /var/local/moode.sqsh
sudo rm -rf /var/www/*
sync
sudo reboot
////////////////////////////////////////////////////////
//
// STEP 12 - Install latest Linux Kernel
//
////////////////////////////////////////////////////////
sudo PRUNE_MODULES=1 rpi-update
sudo reboot
sudo rm -rf /lib/modules.bak
////////////////////////////////////////////////////////
//
// STEP 13 -
http://moode
//
////////////////////////////////////////////////////////
1. Initial configuration
a. http//moode
b. Browse Tab, Default Playlist, Add
c. Menu, Configure, Sources, UPDATE mpd database
d. Menu, Audio, Mpd options, EDIT SETTINGS, APPLY
e. Menu, System, Set timezone
f. Clear system logs, YES
g. Compact sqlite database, YES
h. Keyboard
i. Layout
2. Verification
a) Playback tab
b) Scroll to the last item which should be the Stereo Test track
c) Click to begin play
d) Menu, Audio info
e) Verify Output stream is 16 bit 48 kHz
////////////////////////////////////////////////////////
//
// STEP 14 - Final prep for image
//
////////////////////////////////////////////////////////
2. Check the boot partition.
sudo umount /boot
sudo dosfsck -tawl /dev/mmcblk0p1
sudo dosfsck -r /dev/mmcblk0p1
sudo dosfsck -V /dev/mmcblk0p1
sudo mount /boot
2. Remove DHCP lease files
sudo rm /var/lib/dhcp/*
sudo rm /var/lib/dhcpcd5/*
3. Remove annoying hidden OSX dot files and dirs (Mac only prep)
4. Reset the network config to defaults
*** IMPORTANT! ***
Don't forget to do this!
sudo cp ./rel-stretch/network/interfaces.default /etc/network/interfaces
sudo cp ./rel-stretch/network/wpa_supplicant.conf.default /etc/wpa_supplicant/wpa_supplicant.conf
sudo cp ./rel-stretch/network/dhcpcd.conf.default /etc/dhcpcd.conf
sudo cp ./rel-stretch/network/hostapd.conf.default /etc/hostapd/hostapd.conf
5. Shut down
sudo poweroff
NOTE: Resetting the network config allows the moodecfg.txt automation file to be used to automatically change the
host name and other names at first boot. See the file /var/www/setup.txt for more information on this feature.
########################################################
#
#
# Install additional components
#
#
########################################################
////////////////////////////////////////////////////////
//
// COMPONENT 1 - MiniDLNA
//
////////////////////////////////////////////////////////
sudo apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install minidlna
sudo systemctl disable minidlna
sudo apt-get -y install djmount
////////////////////////////////////////////////////////
//
// COMPONENT 2 - Autoshuffle
//
////////////////////////////////////////////////////////
cd ~
sudo git clone
https://github.com/Joshkunz/ashuffle.git
cd ashuffle
sudo make
cd ~
sudo cp ./ashuffle/ashuffle /usr/local/bin
sudo rm -rf ./ashuffle
////////////////////////////////////////////////////////
//
// COMPONENT 3 - MPD Audio Scrobbler
//
////////////////////////////////////////////////////////
cd ~
sudo git clone
https://github.com/hrkfdn/mpdas
cd mpdas
sudo make
sudo cp ./mpdas /usr/local/bin
cd ~/
sudo rm -rf ./mpdas
sudo cp ./rel-stretch/usr/local/etc/mpdasrc.default /usr/local/etc/mpdasrc
sudo chmod 0755 /usr/local/etc/mpdasrc
////////////////////////////////////////////////////////
//
// COMPONENT 4 - Shairport-sync
//
////////////////////////////////////////////////////////
sudo apt-get -y install autoconf libtool libdaemon-dev libasound2-dev libpopt-dev libconfig-dev \
avahi-daemon libavahi-client-dev libssl-dev libsoxr-dev
cd ~
sudo git clone
https://github.com/mikebrady/shairport-sync.git
cd shairport-sync
sudo autoreconf -i -f
sudo ./configure --with-alsa --with-avahi --with-ssl=openssl --with-soxr --with-metadata --with-stdout --with-systemd
sudo make
sudo make install
sudo systemctl disable shairport-sync
cd ~
sudo rm -rf ./shairport-sync
sudo cp ./rel-stretch/usr/local/etc/shairport-sync.conf /usr/local/etc
////////////////////////////////////////////////////////
//
// COMPONENT 5 - Squeezelite
//
////////////////////////////////////////////////////////
1. Use either the pre-compled binaries or compile directly from Sources
OPTION A: Copy squeezelite pre-compiled binaries for armv6l and armv7l
sudo cp ./rel-stretch/other/squeezelite/squeezelite-1.8.7-999-armv6l /usr/local/bin/squeezelite-armv6l
sudo cp ./rel-stretch/other/squeezelite/squeezelite-1.8.7-999-armv7l /usr/local/bin/squeezelite-armv7l
Sources: ./rel-stretch/other/squeezelite-master.zip
OPTION B: Compile squeezelite from Sources (to get latest version)
sudo git clone
https://github.com/ralph-irving/squeezelite
cd ./squeezelite
On Armv6l
sudo make clean
sudo make OPTS="-s -O3 -march=armv6 -mfloat-abi=hard -mfpu=vfp -DDSD -DRESAMPLE"
sudo cp ./squeezelite /usr/local/bin/squeezelite-armv6l
cd ~
sudo rm -rf ./squeezelite
On Armv7l
sudo make clean
sudo make OPTS="-DDSD -DRESAMPLE"
sudo cp ./squeezelite /usr/local/bin/squeezelite-armv7l
cd ~
sudo rm -rf ./squeezelite
3. See STEP 7 main procedure
#sudo chmod 0644 /lib/systemd/system/squeezelite-armv6l.service
#sudo chmod 0644 /lib/systemd/system/squeezelite-armv7l.service
#sudo systemctl disable squeezelite-armv6l
#sudo systemctl disable squeezelite-armv7l
////////////////////////////////////////////////////////
//
// COMPONENT 6 - Upmpdcli
//
////////////////////////////////////////////////////////
// Enjoy a Coffee and listen to some Tunes while the compiles run
1. Dev libraries
sudo apt-get -y install libmicrohttpd-dev libexpat1-dev \
libjsoncpp-dev python-requests python-pip
sudo pip install gmusicapi
2. Libupnp jfd5
cd ~
sudo cp ./rel-stretch/other/upmpdcli/libupnp-1.6.20.jfd5.tar.gz ./
sudo tar xfz ./libupnp-1.6.20.jfd5.tar.gz
cd libupnp-1.6.20.jfd5
./configure --prefix=/usr --sysconfdir=/etc
make
sudo make install
cd ~
sudo rm -rf ./libupnp-1.6.20.jfd5
sudo rm libupnp-1.6.20.jfd5.tar.gz
3. Libupnpp
sudo cp ./rel-stretch/other/upmpdcli/libupnpp-0.16.0.tar.gz ./
sudo tar xfz ./libupnpp-0.16.0.tar.gz
cd libupnpp-0.16.0
./configure --prefix=/usr --sysconfdir=/etc
make
sudo make install
cd ~
sudo rm -rf ./libupnpp-0.16.0
sudo rm libupnpp-0.16.0.tar.gz
4. Upmpdcli
sudo cp ./rel-stretch/other/upmpdcli/upmpdcli-1.2.15.tar.gz ./
sudo tar xfz ./upmpdcli-1.2.15.tar.gz
cd upmpdcli-1.2.15
./configure --prefix=/usr --sysconfdir=/etcmake
make
sudo make install
cd ~
sudo rm -rf ./upmpdcli-1.2.15
sudo rm upmpdcli-1.2.15.tar.gz
sudo useradd upmpdcli
sudo cp ./rel-stretch/lib/systemd/system/upmpdcli.service /lib/systemd/system
sudo cp ./rel-stretch/etc/upmpdcli.conf /etc
sudo systemctl daemon-reload
sudo systemctl disable upmpdcli
5. upexplorer
NOTE: This also installs a bunch of other utils
sudo git clone
https://@opensourceprojects.eu/git/p/libupnppsamples/code libupnppsamples-code
cd libupnppsamples-code
sudo ./autogen.sh
sudo ./configure
sudo make
sudo make install
cd ~
sudo rm -rf ./libupnppsamples-code
////////////////////////////////////////////////////////
//
// FINAL - Clean up
//
////////////////////////////////////////////////////////
cd ~
sudo apt-get clean
sudo /var/www/command/util.sh clear-syslogs
sudo reboot
########################################################
#
#
# Appendix
#
#
########################################################
////////////////////////////////////////////////////////
//
// Squashfs procedures
//
////////////////////////////////////////////////////////
1. SQUASH /var/www
sudo -i
echo "/var/local/moode.sqsh /var/www squashfs ro,defaults 0 0" >>/etc/fstab
logout
cd ~
sudo rm /var/local/moode.sqsh
sudo mksquashfs /var/www /var/local/moode.sqsh
sudo rm -rf /var/www/*
sync
sudo reboot
2. UNSQUASH /var/www
sudo killall -s 9 watchdog.sh
sudo systemctl stop nginx
sudo systemctl stop php7.0-fpm
sudo umount /var/www
sudo rmdir /var/www
sudo unsquashfs -d /var/www /var/local/moode.sqsh
sync
sudo sed -i /moode.sqsh/d /etc/fstab
sudo rm /var/local/moode.sqsh
sudo reboot
////////////////////////////////////////////////////////
//
// SD Card procedures (Mac OSX)
//
////////////////////////////////////////////////////////
1. Write SD Card to image file with truncation to the root partition end blk.
NOTE: This assumes the 3GB root expansion in STEP 3.
diskutil list
diskutil unmountDisk /dev/disk3
sudo dd if=/dev/disk3 of=/Users/Lt1user/Documents/moode.img count=6238208 bs=512
diskutil eject /dev/disk3
4. Write image to SD Card.
diskutil list
diskutil unmountDisk /dev/disk3
sudo dd if=/Users/Lt1user/Documents/moode.img of=/dev/rdisk3 bs=1m
diskutil eject /dev/disk3
########################################################
#
# END
#
########################################################