MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
August 27, 2012 03:36PM
MacPlug : Filesharing/AFPD, Printserver/p910nd and much more, all in NAND Flash
SMBPlug : Filesharing/Samba, Printserver/p910nd and much more, all in NAND Flash

Installation is by a bootable USB image. You simply format a USB flash drive, untar the installer image on it, boot the USB drive (using default UBoot settings), run 4 install commands, and then reboot.

Works out-of-the-box:
  • Apple-style afpd access for NAS and TimeMachine storage [ MacPlug only]
  • Windows-style Samba access for NAS and TimeMachine storage [ SMBPlug only]
  • p910nd printer daemon for USB printers (just needs printer name)
  • sftpd, sshd & ssh
  • Avahi/Bonjour zeroconf network service advertising



Also includes (requires some configuration):
  • ssl/tls w/ trust certificate
  • msmtp and mailx (msmtp is tested and works for sending email via gmail.com)
  • inadyn (dyndns updater client)
  • nfsd and nfs utilities (only in MacPlug)
  • CIFS mounts and CIFS utilities (only in SMBPlug)
  • smartmontools
  • filesystem utilities for ext2/3/4, parted (partition editor), and others
  • gdisk (for setting up partitions larger than 2TB)
  • wide variety of maintenence/rescue tools and setup utilities

The image is pretty much flash-and-go if you read and follow the directions, but can be customized a bit.

Background:
This image was built using buildroot-2012.08 and Ubuntu/Debian, and bits of Jeff's V2 fs-skeleton are there. The package selection is very different, though. I wanted to build something that would mesh well with Macs/Linux mainly, be robust enough to __always__ withstand power outages and the like, and be simple. For me, robust=plug-n-go-even-after-power-outages.

A major change in Buildroot with uClibc 0.31.2 brought NPTL support, which allowed BerkeleyDB to play nicely with Netatalk. This took a while to get configured correctly, but the results have been positive.

It was also a bit of a challenge to get Samba 3.6.6 to fit nicely in a UBI image that wouldn't fill up 32MB entirely.

What I didn't want was a boxlet with a bloated webserver, perl, python, compilers or any development stuff - just a small rootfs that would fit inside 32MB of flash and let a little Kirkwood box do what it does best - low power consumption, small footprint, good server-performance-per-wattage, etc.


Requirements:
  • Pogoplug E01/E02, Dockstar, GoFlexNet/Home, perhaps other Kirkwood boxes
  • a large USB-based-SATA or SATA Hard Drive (for AFP Fileserving and TimeMachine/Capsule NAS)
  • a USB printer that is supported under Windows, Mac and/or Linux
  • a USB flash drive (512MB or larger) for use as installation media, known working/bootable w/ your Kirkwood box
  • familiarity with command-line activities, and a Desktop/Laptop with a working local network connection and ssh client access
  • tested and working socat/netcat access so that you can control the boot process OR serial access with tested and working minicom access
  • Windows users should install Bonjour print services before setting up your printer


Installation:
0. Understand the disclaimer : Flash at your own risk - there is always some level of risk in when flashing a chip; I've flashed some of my devices dozens of times and they are fine. For me, MacPlug/SMBPlug both work wonderfully, but YMMV. There is no warranty, neither implied nor expressed. Proceed at your own risk.

0. Make a decision: Do you want AFPD (Apple's Filesharing Protocol, successor to AppleTalk/AppleShare), or do you want Samba (More Windows-centric, though it is also used with Linux and Mac)

1. Format the USB flash drive to ext2 and copy the desired tarball to it:

and expand the tarball using something like tar xvf <tarball-name.tar>.

2. Make sure only the USB flashdrive drive is plugged in, and not the USB printer and USB hard drive

3. Boot the USB flashdrive on your Kirkwood box (UBoot's default settings should work fine), log in using username=root , password=root

4. Plug in the USB harddrive and prepare it by formatting the first partition as ext4 (all other partitions can be anything, even swap)

5. STOP and READ: this step will erase whatever kernel and rootfs that is currently residing in mtd1 and mtd2, respectively. If this is not acceptable to you, or if you are unsure of what you are doing, you should stop here and go no further.

If this is what you want to do, then proceed with flashing these files to your NAND partitions mtd1 and mtd2.
Use the following sequence of commands two erase and write to mtd1 and mtd2:

cd /img_files
flash_erase /dev/mtd1 0 0
nandwrite /dev/mtd1 uImage-mtd1.img
flash_erase /dev/mtd2 0 0
ubiformat /dev/mtd2 -s 512 -f rootfs-mtd2.img -y

Normal output for this should look like:
MacPlug:/img_files# flash_erase /dev/mtd1 0 0
Erasing 128 Kibyte @ 3e0000 -- 100 % complete 
MacPlug:/img_files# nandwrite /dev/mtd1 uImage-mtd1.img
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Writing data to block 4 at offset 0x80000
...
Writing data to block 26 at offset 0x340000
Writing data to block 27 at offset 0x360000
MacPlug:/img_files# flash_erase /dev/mtd2 0 0
Erasing 128 Kibyte @ 1fe0000 -- 100 % complete 
MacPlug:/img_files# ubiformat /dev/mtd2 -s 512 -f rootfs-mtd2.img -y
ubiformat: mtd2 (nand), size 33554432 bytes (32.0 MiB), 256 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 s
libscan: scanning eraseblock 255 -- 100 % complete  
ubiformat: 256 eraseblocks are supposedly empty
ubiformat: flashing eraseblock 212 -- 100 % complete  
ubiformat: formatting eraseblock 255 -- 100 % complete  
MacPlug:/img_files#

6. Halt your Kirkwood box, remove the USB flash drive

7. Plug in the USB printer and boot (power down & back up)

8. Log in using ssh, user=root, password=root

9. Adjust the printer spec and name, and choose new passwords. Note that if you are using SMBPlug, the smbpasswd binary is not included, but rather the pdbedit binary is included instead, and provides the same functionality for our uses.

Also make the needed changes to enable the following servers/daemons/services/features from the following list:
  • Samba - the default setup is for a 192.168.x.x network, so if you are using something else, you'll need to modify /etc/smb.conf
  • inadyn - DYNDNS updater client
  • NFSD - network file system daemon, great for Linux/Mac OS X [ only in MacPlug ]
  • CIFS-Utils - mount a Samba share _on_ this device,
  • avah-daemon - Bonjour/Avahi advertising of servers and information via network, enabling ZeroConf setup for printers, etc.
  • msmtp - allows access via SSL/TLS to Google's Gmail service, and many other email providers
  • cron jobs - using crond and the crontab, set up whatever scripts you'd like to run on a scheduled basis
  • swap - you can use a swap partition on the hard drive and use it in conjunction w/ the NAND/UBIFS rootfs
  • customize your hostname
  • customize the printer type/model in the <txt-record>product=( your-printer-brand-and-model-according-to-cups )</txt-record> in the /etc/avahi/services/p910nd.services file; this will allow your printer client on most computers to automagically configure itself
  • automatically advertise and identify your printer(s) - also in /etc/avahi/services/p910nd.service, the line <name replace-wildcards="yes"> my-printers-brand-and-model @ %h</name>
  • lm-sensors - if your machine has any sensors (like the Zyxel NSA-320), you can configure those so you can get period/scheduled emails about warnings/status
  • smartd and smartmontools - set up your system to send you scheduled reports on your drives usage, capacity and health; get email messages when the drive is showing signs of failing health

To make changes to this read-only filesystem :

mount -o rw,remount /         #this remounts the ubifs partition for read-write access
< do-all-of-your-changes-and-test-them-out-to-make-sure-they-are-complete>
mount -o ro,remount /         #this returns the ubifs partition to the default read-only access

10. Browse your LAN with a Avahi/Bonjour scanner and check for function

11. From your Mac, Windows or Linux box, open a Finder window and select the Shared/Network icon. You should be able to see MacPlug on a Mac, while on Windows, add a network place - just as you would for any Samba share. Select it, and wait 15-30 seconds while it generates a database file. When asks for authentication, enter username "timemachine", and password "timemachine" (unless you have changed your password(s)).


12. Enjoy.


Wanted/thought about, but didn't include:
- AirPrint included ... CUPSLite, where are you? We'd also need foomatic and *ostScript of some sort. Too big for now, but this may be a possibility in the future... Printerd, a new print spooler...
- Media Servers ... currently not that well supported in Buildroot...
- LibInklevel : would be great to query ink level in printers... unfortunately, a required libieee component compiles but does not function...



Predefined users:
root, password is root
timemachine, password is timemachine

=====================================================



Edited 29 time(s). Last edit at 10/04/2012 06:40PM by davygravy.
Re: MacPlug : Mac/Linux services in a flash/NAND image
September 08, 2012 01:05PM
Hmmm... perhaps less interest in this for users than I thought... no one is exactly kicking down the doors to make comments or file user reports/experiences...

I'm now working on a Windows-centric version of it... WinPlug I guess, that I've found -can- accommodate a bare set of Samba binaries + SWAT.

I'm tinkering now, and may need to alter a bit of the SWAT webif code in order for it to be able to save user settings... remounting the rootfs RW, edit the smb.conf, and then remount rootfs RO.

=====================================================
dth
Re: MacPlug : Mac/Linux services in a flash/NAND image
September 09, 2012 01:57PM
Hi Jeff,

il try your files with my Dockstar.

I Think it is looping :-(

Best regards,

Dieter


############################
log
############################
U-Boot 2011.12 (Feb 12 2012 - 21:33:07)
Seagate FreeAgent DockStar

SoC: Kirkwood 88F6281_A0
DRAM: 128 MiB
WARNING: Caches not enabled
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot: 0
(Re)start USB...
USB: Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 3 USB Device(s) found
scanning bus for storage devices... 1 Storage Device(s) found
Loading file "/rescueme" from usb device 0:1 (usbda1)
** File not found /rescueme
reading /rescueme.txt

** Unable to read "/rescueme.txt" from usb 0:1 **
Creating 1 MTD partitions on "nand0":
0x000002500000-0x000010000000 : "mtd=3"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 129024 bytes
UBI: smallest flash I/O unit: 2048
UBI: sub-page size: 512
UBI: VID header offset: 512 (aligned 512)
UBI: data offset: 2048
UBI: attached mtd1 to ubi0
UBI: MTD device name: "mtd=3"
UBI: MTD device size: 219 MiB
UBI: number of good PEBs: 1752
UBI: number of bad PEBs: 0
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 0
UBI: available PEBs: 1731
UBI: total number of reserved PEBs: 21
UBI: number of PEBs reserved for bad PEB handling: 17
UBI: max/mean erase counter: 1/1
UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:rootfs", error -19
Error reading superblock on volume 'ubi:rootfs'!
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
1 bytes read
Found bootable drive on usb 0:1
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
3330232 bytes read
Loading file "/boot/uInitrd" from usb device 0:1 (usbda1)
** File not found /boot/uInitrd
## Booting kernel from Legacy Image at 00800000 ...
Image Name: Linux-3.3.2-kirkwide
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3330168 Bytes = 3.2 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.3.2-kirkwide (davygravy@bitbaker64) (gcc version 4.4.7 (Buildroot 2012.08-rc3) ) #1 Sun Sep 2 01:34:32 CDT 2012
[ 0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] Machine: Seagate FreeAgent DockStar
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
[ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/sda1 rootdelay=10 rootfstype=ext2 mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
[ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Memory: 128MB = 128MB total
[ 0.000000] Memory: 122836k/122836k available, 8236k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xc8800000 - 0xff000000 ( 872 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0613ab0 (6191 kB)
[ 0.000000] .init : 0xc0614000 - 0xc063b000 ( 156 kB)
[ 0.000000] .data : 0xc063c000 - 0xc0679238 ( 245 kB)
[ 0.000000] .bss : 0xc067925c - 0xc06e78c0 ( 442 kB)
[ 0.000000] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:114
[ 0.000000] gpiochip_add: registered GPIOs 0 to 31 on device: orion_gpio0
[ 0.000000] gpiochip_add: registered GPIOs 32 to 49 on device: orion_gpio1
[ 0.000000] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 21474ms
[ 0.000000] Console: colour dummy device 80x30
[ 2.944889] Calibrating delay loop... 1191.11 BogoMIPS (lpj=5955584)
[ 3.034815] pid_max: default: 32768 minimum: 301
[ 3.034934] Security Framework initialized
[ 3.034954] SELinux: Disabled at boot.
[ 3.035014] Mount-cache hash table entries: 512
[ 3.035382] Initializing cgroup subsys cpuacct
[ 3.035397] Initializing cgroup subsys devices
[ 3.035407] Initializing cgroup subsys freezer
[ 3.035475] CPU: Testing write buffer coherency: ok
[ 3.035749] Setting up static identity map for 0x481800 - 0x48183c
[ 3.036767] devtmpfs: initialized
[ 3.038446] NET: Registered protocol family 16
[ 3.039011] Kirkwood: MV88F6281-A0, TCLK=200000000.
[ 3.039026] Feroceon L2: Enabling L2
[ 3.039062] Feroceon L2: Cache support initialised.
[ 3.042802] bio: create slab <bio-0> at 0
[ 3.043118] vgaarb: loaded
[ 3.043363] SCSI subsystem initialized
[ 3.043662] usbcore: registered new interface driver usbfs
[ 3.043742] usbcore: registered new interface driver hub
[ 3.043829] usbcore: registered new device driver usb
[ 3.044336] Switching to clocksource orion_clocksource
[ 3.059416] NET: Registered protocol family 2
[ 3.059617] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 3.060185] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 3.060285] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 3.060339] TCP: Hash tables configured (established 4096 bind 4096)
[ 3.060348] TCP reno registered
[ 3.060358] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 3.060381] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 3.060568] NET: Registered protocol family 1
[ 3.060883] RPC: Registered named UNIX socket transport module.
[ 3.060894] RPC: Registered udp transport module.
[ 3.060901] RPC: Registered tcp transport module.
[ 3.060909] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 3.060977] NetWinder Floating Point Emulator V0.97 (double precision)
[ 3.061432] audit: initializing netlink socket (disabled)
[ 3.061465] type=2000 audit(0.090:1): initialized
[ 3.069474] VFS: Disk quotas dquot_6.5.2
[ 3.069718] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 3.072287] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[ 3.073412] NTFS driver 2.1.30 [Flags: R/W].
[ 3.073740] JFFS2 version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
[ 3.074286] fuse init (API version 7.18)
[ 3.074822] msgmni has been set to 239
[ 3.076099] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[ 3.076112] io scheduler noop registered
[ 3.076120] io scheduler deadline registered
[ 3.076154] io scheduler cfq registered (default)
[ 3.076211] mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver
[ 3.076244] mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver
[ 3.114433] mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
[ 3.154416] mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )
[ 3.194406] mv_xor mv_xor.2: Marvell XOR: ( xor cpy )
[ 3.234406] mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
[ 3.234685] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 3.255101] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
[ 3.740488] console [ttyS0] enabled
[ 3.744979] ONFI flash detected
[ 3.748223] ONFI param page 0 valid
[ 3.751728] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron MT29F2G08AAD)
[ 3.759447] Scanning device for bad blocks
[ 3.915748] 4 cmdlinepart partitions found on MTD device orion_nand
[ 3.922043] Creating 4 MTD partitions on "orion_nand":
[ 3.927220] 0x000000000000-0x000000100000 : "u-boot"
[ 3.932942] 0x000000100000-0x000000500000 : "uImage"
[ 3.938568] 0x000000500000-0x000002500000 : "rootfs"
[ 3.944168] 0x000002500000-0x000010000000 : "data"
[ 3.950095] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[ 3.956998] mv643xx_eth smi: probed
[ 3.962517] mv643xx_eth_port mv643xx_eth_port.0: eth0: port 0 with MAC address 00:10:75:1a:c9:66
[ 3.971398] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 3.978006] orion-ehci orion-ehci.0: Marvell Orion EHCI
[ 3.983310] orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
[ 4.014391] orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
[ 4.034374] orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
[ 4.040385] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 4.047218] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 4.054483] usb usb1: Product: Marvell Orion EHCI
[ 4.059209] usb usb1: Manufacturer: Linux 3.3.2-kirkwide ehci_hcd
[ 4.065339] usb usb1: SerialNumber: orion-ehci.0
[ 4.070363] hub 1-0:1.0: USB hub found
[ 4.074139] hub 1-0:1.0: 1 port detected
[ 4.078397] usbcore: registered new interface driver usblp
[ 4.083902] Initializing USB Mass Storage driver...
[ 4.088907] usbcore: registered new interface driver usb-storage
[ 4.094954] USB Mass Storage support registered.
[ 4.099714] mousedev: PS/2 mouse device common for all mice
[ 4.105323] i2c /dev entries driver
[ 4.109258] device-mapper: uevent: version 1.0.3
[ 4.114183] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: dm-devel@redhat.com
[ 4.122751] cpuidle: using governor ladder
[ 4.126959] cpuidle: using governor menu
[ 4.131938] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 4.137347] TCP cubic registered
[ 4.140593] NET: Registered protocol family 17
[ 4.145104] Registering the dns_resolver key type
[ 4.149915] registered taskstats version 1
[ 4.154702] console [netcon0] enabled
[ 4.158379] netconsole: network logging started
[ 4.162925] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[ 4.169281] Initializing network drop monitor service
[ 4.174596] Waiting 10sec before mounting root device...
[ 4.394382] usb 1-1: new high-speed USB device number 2 using orion-ehci
[ 4.545785] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
[ 4.552519] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 4.559697] usb 1-1: Product: USB2.0 Hub
[ 4.564270] hub 1-1:1.0: USB hub found
[ 4.568406] hub 1-1:1.0: 4 ports detected
[ 4.854681] usb 1-1.4: new high-speed USB device number 3 using orion-ehci
[ 4.967785] usb 1-1.4: New USB device found, idVendor=13fe, idProduct=3d00
[ 4.974718] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.982063] usb 1-1.4: Product: USB DISK 2.0
[ 4.986376] usb 1-1.4: Manufacturer:
[ 4.990748] usb 1-1.4: SerialNumber: 07B10F13E55D6481
[ 4.996466] scsi0 : usb-storage 1-1.4:1.0
[ 5.996126] scsi 0:0:0:0: Direct-Access USB DISK 2.0 PMAP PQ: 0 ANSI: 0 CCS
[ 6.005826] sd 0:0:0:0: [sda] 7834944 512-byte logical blocks: (4.01 GB/3.73 GiB)
[ 6.014498] sd 0:0:0:0: [sda] Write Protect is off
[ 6.019685] sd 0:0:0:0: [sda] No Caching mode page present
[ 6.025210] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 6.034436] sd 0:0:0:0: [sda] No Caching mode page present
[ 6.039948] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 6.047186] sda: sda1
[ 6.051928] sd 0:0:0:0: [sda] No Caching mode page present
[ 6.057466] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 6.063589] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 14.184405] md: Waiting for all devices to be available before autodetect
[ 14.191228] md: If you don't use raid, use raid=noautodetect
[ 14.197401] md: Autodetecting RAID arrays.
[ 14.201519] md: Scanned 0 and added 0 devices.
[ 14.205999] md: autorun ...
[ 14.208798] md: ... autorun DONE.
[ 14.215706] EXT2-fs (sda1): warning: mounting unchecked fs, running e2fsck is recommended
[ 14.322334] VFS: Mounted root (ext2 filesystem) on device 8:1.
[ 14.330087] devtmpfs: mounted
[ 14.333554] Freeing init memory: 156K
Starting logging: OK
mount: you must be root
Initializing random number generator... done.
Starting system message bus: Failed to start message bus: The pid file "/var/run/messagebus.pid" exists, if the message bus is not running, remove this file
done
You must be root to start, stop or restart ifplugd.
Starting network...
ip: RTNETLINK answers: Operation not permitted
ip: SIOCSIFFLAGS: Permission denied
Getting initial time via ntp.
Starting network time protocol daemon: ntpd.
Starting sshd: /var/empty must be owned by root and not group or world-writable.
OK
can't open /dev/ttyS0: Permission denied
can't open /dev/ttyS0: Permission denied
can't open /dev/ttyS0: Permission denied
can't open /dev/ttyS0: Permission denied
........................... and so on!
Re: MacPlug : Mac/Linux services in a flash/NAND image
September 09, 2012 06:43PM
hmmm... that was on a Dockstar? Was your output from booting the installer USB image? Or is the output from after installing and booting the ubifs image?

=====================================================
dth
Re: MacPlug : Mac/Linux services in a flash/NAND image
September 10, 2012 12:02AM
it is from booting the installer image, the
first time, after installing the image on the USB Stick.
dth
Re: MacPlug : Mac/Linux services in a flash/NAND image
September 10, 2012 02:24AM
ok, my fault.
Sorry, i do not follow ecactly the instruktions.
If i do, it works.

Best regards,

Dieter
Re: MacPlug : Mac/Linux services in a flash/NAND image
September 12, 2012 08:05PM
kk, that's good to know, Dieter. much appreciated.

=====================================================
Re: MacPlug : Mac/Linux services in a flash/NAND image
September 19, 2012 07:25PM
hmmm...really, really, _really_, close to a SMBPlug issue... will post said SMBPlug soon...
... has SMB, avahi, p910nd, rsync, cifs-utils, and as much other Windows-centric stuff as I could fit in...

Works the same as MacPlug : flash-and-go, with customization (of course!) possible...

=====================================================
Re: MacPlug : Mac/Linux services in a flash/NAND image
September 22, 2012 01:39PM
Both a Windows-centric SMBPlug and Mac-centric MacPlug are now available, tested on a Pogoplug E02... see top of thread if interested...

=====================================================
Re: MacPlug : Mac/Linux services in a flash/NAND image
September 25, 2012 06:23PM
Awesome, Davy!

I'll try this on one of my plugs.

Another question/suggestion: have you looked into auto port forwarding? I've been searching and only found one Code Project implementing uPnP that potentially could provide a way to do auto port forwarding.
Re: MacPlug : Mac/Linux services in a flash/NAND image
September 25, 2012 08:13PM
@Bodhi, you're welcome. If you try it w/ a hard drive, please let me know what the transfer speeds look like for you. From what I can see, it is a bit faster than Debian (which is to be expected - it is a barebones system w/ no extra daemons running).

Is the UPnP/AutoPortForwarding code/project you are talking about included in Buildroot's package set ?
http://git.buildroot.net/buildroot/tree/package

BTW, I'm in the midst of culling back, pruning and trying to make the AFPD plug (MacPlug) more RAM and resource efficient... when I created the SMBPlug suite, it took a __lot__ of pruning to get it down to size... then I realized that so many packages were being used, and that Busybox was a better choice for the vast majority of needs - this reduced the total size by maybe 4MB. Only a small number of non-Busybox binaries are included now - pretty much only ones that had no such functionality in BB, or ones that didn't seem to work very well.

The end result was something that was not really Debianesque, but instead, very focused, very single-purposed, very efficient, much smaller, with no "dead wood". It also provided better performance than the Debian system was giving. That approach was so successful that I decided to go back and do the same for the AFPD plug image.

=====================================================



Edited 2 time(s). Last edit at 09/26/2012 07:14PM by davygravy.
Re: MacPlug : Mac/Linux services in a flash/NAND image
September 25, 2012 09:58PM
@Davy, thanks!

That UPnP/AutoPortForwarding package is not in the Buildroot's set (looks like it was coded in Windows VC++). Here is the project:
http://www.codeproject.com/Articles/27237/Easy-Port-Forwarding-and-Managing-Router-with-UPnP.

Found another one (also coded in VC++):
http://www.codeproject.com/Articles/13285/Using-UPnP-for-Programmatic-Port-Forwardings-and-N

Found a Debian package:
upnp-router-control, along with other upnp library packages. Will try this out.

-bodhi



Edited 2 time(s). Last edit at 09/26/2012 03:28AM by bodhi.
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
October 04, 2012 08:46PM
Both images are now quite a bit smaller - at now at version 0.7...

quite a bit more compact and efficient...

=====================================================
eas
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
October 21, 2012 02:44AM
Cool!

I may give this is shot with my old dockstar once I get debian on my new NSA320 and get it set up.
how to install additional software
would be nice to have luks and cryptsetup.

maybe u add a short script witch monitors the space left using the front led.
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
November 20, 2012 07:45PM
This is a static setup - there is no intent for adding more packages/binaries.

As far as luks and cryptsetup, are they in Buildroot's recipe/package repository? If not, perhaps you could add them in... how large are the binaries? Do they compile under uClibc?

=====================================================
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
November 21, 2012 03:25PM
Davy,

What is the rationale for limiting the flash size to 32mb? Can you make notes on your process for building this available?
i have no idee how to check the size of cryptsetup and luks. the bins are round about 100k but dont ask me for dependencies! i have a running dockstar with standard debian installation and the mentioned packages. if you tell me how to check, then i will post the result.

but to fulfill your all in one / out of the box approach - it would be nice to have:

- a small script which send mails (example would be sufficient)
- how to put the disk into sleep?

but overall - GREAT JOB !!
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
December 01, 2012 07:49PM
Still no idea RE luks or cryptsetup...

The email stuff included is sufficient to send email to say gmail... I've tried it myself... a short tutorial or example wouldn't be that tough... OK

Putting a disk to sleep may be possible via sdparm - which I included, but haven't tried w/ a harddisk.

=====================================================
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
December 07, 2012 02:41PM
Hello all,

Long time lurker, first time poster here.

I had to register to post so that I can thank Davy for this wonderful work! I installed SMBPlug on my GoflexHome and Dockstar and it works beautifully. In preliminary speed test, I can get 20-23 MBps transfer speed between my 3TB (7200 rpm) hard drive and my Windows 7 desktop. I could not change the timezone and the system displays UTC time. (I tried to chance the TZ file in /etc/ directory but it does not seem to work!).

Edit: Just found an answer for the timezone setting. Apparently uclibc based systems need timezone data as prescribed at http://www.sonoracomm.com/support/20-voice-support/107-uclibc-tz. So for me I just have to put CST6CDT into /etc/TZ file.

I also installed MACPlug on another Dockstar and notice the followings:
1. Date is not set. It looks like ntpd did not rung at boot up.
2. nsfd is not running.

I think I may need to do some configuration for MACPlug and will try to dig a bit more later.

I installed MACPlug because I wanted to use NFS capability on my home network. For my purposes I would like to use both CIFS and NFS. So Davy, is it possible to include NFS in SambaPlug? Also how difficult it is to roll my own NAND images for this?

Someone has also asked about installing new applications and you answered that this is static installation and I agree, since the file system is in NAND. Perhaps if we can have some package management included in the image so that we can install packages on an attached hard drive we can customize the system to our need. Just a thought!

Again, thank you so much for sharing this wonderful work with us!



Edited 1 time(s). Last edit at 12/08/2012 10:06AM by nnSlick.
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
December 10, 2012 06:51PM
I'm thinking that space was _really_ limited, ie. that the needed modules and nfs support binaries wouldn't fit in SMBPlug ... (IIRC).

The binaries for NFS are in MacPlug, but by default they aren't running. IIRC, there is a startup script for them in /etc/init.d/ that would need to be activated.

=====================================================
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
December 11, 2012 08:51PM
Many thanks for your response, Davy! I will play around with MacPlug to change the initialization to include nfs.

I understand the limit of the image to be written to NAND partition 2, which has only 32MB, if we do not want to re-partition the device. I am wondering if we could include minimal package management capability in the image? If we could then we can install add-on packages on the remaining NAND partition, which has more than 200MB on our Dockstar. (Just a thought.)

Thanks again for your wonderful contributions to our 'hacked Linux devices'!
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
February 12, 2013 09:18PM
I have this setup and booting.but I cannot see the network shares on my network anywhere. All of my machines are Win7 (if that matters) with no homegroup active.

I tried to use map network drive but that did not work.

Also I cannot seem to make the system set the time on its own. I changed TZ like mentioned above but it still does not set the time.

Any help would be appreciated.
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
February 13, 2013 08:19PM
OK, it seems that windows 7 has some stringent security that blocks almost everything except other windows 7 boxes unless you get deep into the settings pages.

I cna now access my box, but only via IP address. I cannot see the hostname of the box on the network. Can anyone tell me how to broadcast the machines hostname so I don't have to keep a static IP?

Also, I still have no figured out network time.

Thanks for any help
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
February 14, 2013 01:55AM
Optim,

You should see your MacPlug name on the network. It's advertising the hostname with Avahi. Nothing on Win 7 network places?
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
February 14, 2013 05:44PM
Nope. Nothing listed as a name. I can see all the other computers, the Roku, the router, the network printer.

When I map network drive I have to use the IP address then it see timemachine.

This is SMBPlug not MACplug though. If that matters.
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
February 14, 2013 06:00PM
Perhaps Davy did not set it up to start automatically. You can try starting it:
/etc/init.d/avahi-daemon start

If it already started, then restart:
/etc/init.d/avahi-daemon restart

It'll take some time to propagate through the network.
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
February 14, 2013 09:17PM
It appears to be running.

109 1 default S 2792 2% 0% avahi-daemon: running [DockstarNFS.local]

I changed the name to DockstarNFS

also:

DockstarNFS:~# /etc/init.d/avahi-daemon restart
-sh: /etc/init.d/avahi-daemon: not found

is what I get when I try to resart.

EDIT: I just noticed that this is the only proces running as default and not as root. Could that be the problem?



Edited 1 time(s). Last edit at 02/14/2013 09:21PM by optim.
Re: MacPlug & SMBPLug : Mac/AFPD or Windows/SMB + Print services in a flash/NAND image
February 14, 2013 10:15PM
Sorry I can't check it for you (I don't have access to mine, atm). And, the avahi-daemon should be running as avahi user, not root. You could try to find it
#which avahi-daemon

if it is found in the path, then restart it with
avahi-daemon restart

If you have a Mac, it should show up automatically in Finder. If the Mac can't find it, then definitely something is missing in your SMBplug setup. Or your router has prevented the broadcast.



Edited 1 time(s). Last edit at 02/14/2013 10:17PM by bodhi.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: