11. 2. SB ブート用 uBoot を書き込み
# flash_erase /dev/mtd0 0 4
Erase Total 4 Units
Performing Flash Erase of length 131072
at offset 0x60000 done
# nandwrite /dev/mtd0
uboot.nandpogoV4-MMC-mtdpartsnoSATA.kwb
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
11
12. 3. uBoot 環境設定を書き込み
# /usr/sbin/flash_erase /dev/mtd0
0xc0000 1
Erase Total 1 Units
Performing Flash Erase of length 131072
at offset 0xc0000 done
# /usr/sbin/nandwrite -s 786432
/dev/mtd0 uboot.environment
Writing data to block 6 at offset 0xc0000
12
15. SD カードを挿入していないときの起動画面
U-Boot 2011.12 (Apr 08 2012 - 19:03:41)
Cloud Engines-Pogoplug v4/Mobile:MMC version
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot: 0
(Re)start USB...
USB:
Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 1 USB Device(s) found
scanning bus for storage devices... 0 Storage Device(s) found
** Block device usb 0 not supported
15
16. ** Invalid boot device **
incorrect device type in data
Partition data not found!
** Block device usb 0 not supported
(途中略)
** Block device usb 0 not supported
Wrong Image Format for bootm command
ERROR: can't get kernel image!
stopping USB..
No MMC card found
No MMC card found
** Bad partition 1 **
** Bad partition 1 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
16
17. 4. printenv で uBOOT 環境を確認
Pogov4> printenv
printenv
arcNumber=3960
baudrate=115200
bootargs=console=ttyS0,115200 root=/dev/mmcblk0p1
rootdelay=10 rootfstype=ext3 mtdparts=orion_nand:2M(uboot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd;
run usb_bootcmd; usb stop; run mmc_bootcmd
bootdelay=10
ceboardver=PPV4A1
console=ttyS0,115200
ethact=egiga0
ethaddr=00:25:31:05:8a:59
force_rescue=0
force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1
0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000
17
/rescueme.txt 1; then run rescue_bootcmd; fi
18. if_netconsole=ping $serverip
ipaddr=192.168.0.230
led_error=orange blinking
led_exit=green off
led_init=green blinking
machid=F78
mainlineLinux=yes
mmc_boot=mw 0x800000 0 1; ext2load mmc 0:1 0x00800000
/boot/uImage; if ext2load mmc 0:1 0x01100000 /boot/uInitrd; then
bootm 0x800000 0x1100000; else bootm 0x800000; fi
mmc_bootcmd=mmc init; mmc init; run mmc_set_bootargs; run
mmc_boot
mmc_root=/dev/mmcblk0p1
mmc_rootdelay=10
mmc_rootfstype=ext3
mmc_set_bootargs=setenv bootargs console=$console
root=$mmc_root rootdelay=$mmc_rootdelay
rootfstype=$mmc_rootfstype $mtdparts
mtddevname=uImage2
mtddevnum=2
18
20. ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data &&
ubifsmount rootfs && ubifsload 0x800000 /boot/uImage &&
ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000
0x1100000; fi
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console
ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts
$ubifs_custom_params
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device
0x800000 /boot/uImage; if ext2load usb $usb_device
0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else
bootm 0x800000; fi
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_device=0:1
usb_init=run usb_scan
usb_root=/dev/sda1
usb_rootdelay=10
usb_rootfstype=ext3
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run
usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb
$usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo
20
"Found bootable drive on usb $usb"; setenv usb_device $usb; setenv
usb_root /dev/$dev; fi; done
27. #copy owncloud files
cd /srv/http
cp -R /tmp/owncloud .
#update owner
chown http:http /srv/http/owncloud
chown http:http /srv/http/owncloud/config
chown http:http /srv/http/owncloud/apps
#uncomment out required modules
sed -i 's^;extension=gd.so^extension=gd.so^' /etc/php/php.ini
sed -i 's^;extension=xmlrpc.so^extension=xmlrpc.so^' /etc/php/php.ini
sed -i 's^;extension=zip.so^extension=zip.so^' /etc/php/php.ini
sed -i 's^;extension=iconv.so^extension=iconv.so^' /etc/php/php.ini
sed -i 's^;extension=sqlite3.so^extension=sqlite3.so^' /etc/php/php.ini
sed -i 's^;extension=pdo_sqlite.so^extension=pdo_sqlite.so^'
/etc/php/php.ini
#Maximum execution time of each script, in seconds
sed -i 's^max_execution_time = 30^max_execution_time = 300^'
/etc/php/php.ini
#Maximum amount of time each script may spend parsing request
data.
sed -i 's^max_input_time = 60^max_input_time = 600^'
/etc/php/php.ini
27
28. #Maximum size of POST data that PHP will accept.
sed -i 's^post_max_size = 8M^post_max_size = 400M^'
/etc/php/php.ini
#Maximum amount of memory a script may consume
sed -i 's^memory_limit = 128M^memory_limit = 512M^'
/etc/php/php.ini
#http://doc.owncloud.org/server/5.0/admin_manual/installation/inst
allation_others.html#nginx-configuration
#backup config and download working nginx.conf
cd /etc/nginx
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.original
wget http://dl.dropbox.com/u/42238/pogoplug/nginx.conf
#Configure SSL
#http://wiki.nginx.org/HttpSslModule
#create folder to store certs
mkdir -p /etc/nginx/certs
cd /etc/nginx/certs
#Now create the server private key
#you'll be asked for a passphrase
openssl genrsa -des3 -out pogoplug.key 1024
28
29. #Create the Certificate Signing Request (CSR):
openssl req -new -key pogoplug.key -out pogoplug.csr
#Remove the necessity of entering a passphrase
#for starting up nginx with SSL using the above private key:
cp pogoplug.key pogoplug.key.org
openssl rsa -in pogoplug.key.org -out pogoplug.key
#sign the certificate using the above private key and CSR
openssl x509 -req -days 3650 -in pogoplug.csr -signkey
pogoplug.key -out pogoplug.crt
#start nginx and php-fpm
systemctl start php-fpm
systemctl start nginx
#autostart nginx and php-fpm after reboot
systemctl enable php-fpm
systemctl enable nginx
#Finish configuration via https://PogoPlugIPAddress/owncloud/ or
https://pogoplug/owncloud
29