Ubuntu Core Snappy ported to OMAP4-PANDA board
Pranav Wangikar
pranav_wangikar at persistent.com
Mon May 11 12:30:51 UTC 2015
Hi Ash,
Files(.snap & .tar.xz) are uploaded at following location.
https://drive.google.com/folderview?id=0B7pEv0byOnjNfjVKQ0luME1ScUlZZVRZY2NvV3NOWmF5RkNjaVhDdXVGN1hlUi1uTUdoZ0E&usp=sharing_eid
Please have a look.
Regards,
Pranav
From: Ash Charles [mailto:ashcharles at gmail.com]
Sent: Friday, May 08, 2015 8:44 PM
To: Pranav Wangikar
Cc: snappy-devel at lists.ubuntu.com; Loïc Minier
Subject: Re: Ubuntu Core Snappy ported to OMAP4-PANDA board
Hi Pranav,
Are you able to share your device-panda-0.9.tar.xz file? I'd like to see if I can replicate the issue. Perhaps the snap file is conflicting with the device file in providing some of the content for the system-boot partition.
--Ash
On May 8, 2015 6:57 AM, "Pranav Wangikar" <pranav_wangikar at persistent.com<mailto:pranav_wangikar at persistent.com>> wrote:
Hi Loic, Ash
We have tried steps mentioned on
https://github.com/gumstix/snappy
--1) device.tar.xz kept same (as mentioned in my previous post).
--2) We have referred panda.snap from
http://gumstix-snappy.s3.amazonaws.com/panda.snap
--3) Content of our snap is
panda_snap_extract
|-- meta
| |-- package.yaml
| |-- panda.png
| `-- readme.md<http://readme.md>
|-- MLO
|-- u-boot.img
`-- uEnv.txt
--4) Content of our package.yaml is
___________package.yaml______________
name: pandaboard-psl
vendor: ABC
icon: meta/panda.png
version: 0.1
type: oem
oem:
branding:
name: OMAP4-PandaBoard
store:
id: panda-store
oem-key: 123456
hardware:
platform: panda
architecture: armhf
partition-layout: system-AB
bootloader: u-boot
boot-assets:
files:
- path: uEnv.txt
- path: MLO
- path: u-boot.bin
raw-files:
- path: MLO
offset: 131072 # @ 128kB
- path: u-boot.bin
offset: 3293216 #@384kB
_______________________________________
--5) Created panda.img using following command
$ sudo ubuntu-device-flash --tls-skip-verify core 15.04 --oem panda.snap --developer-mode --device-part=device-panda-0.9.tar.xz -o panda.img
--6) Viewed created image from kpartx
$ sudo kpartx panda.img -a
-- Content of all partions is ok except system-boot
-- system-boot: boot artifacts are missing MLO, u-boot.bin, uEnv.txt, Snappy-system.txt
-- system-boot/a contains kernel & initrd as expected.
Can you please share if anything we missed out.
Thanks & Regards,
Pranav/Prashant
________________________________________
From: loic.minier at canonical.com<mailto:loic.minier at canonical.com> <loic.minier at canonical.com<mailto:loic.minier at canonical.com>> on behalf of Loïc Minier <loic.minier at ubuntu.com<mailto:loic.minier at ubuntu.com>>
Sent: Friday, May 1, 2015 3:04 PM
To: Pranav Wangikar
Cc: snappy-devel at lists.ubuntu.com<mailto:snappy-devel at lists.ubuntu.com>
Subject: Re: Ubuntu Core Snappy ported to OMAP4-PANDA board
These files ought to be present if you create the image with a recent ubuntu-device-flash and using an OEM snap like the RPi2 one; you might want to checkout Sergio's original BBB OEM snap:
https://github.com/sergiusens/beagleboneblack.sergiusens/tree/master/
or the more recent work by Ash to support a bunch of OMAP boards:
https://lists.ubuntu.com/archives/snappy-devel/2015-May/000592.html
Cheers,
On Thu, Apr 30, 2015 at 11:34 AM, Pranav Wangikar <pranav_wangikar at persistent.com<mailto:pranav_wangikar at persistent.com>> wrote:
Hi Loic,
Thanks for sharing instruction. We are able to create OEM snap, tarball & .img file for Panda.
We used following folders to create device-panda(tarball) & OEM snap:
device-panda
|-- assets
| |-- initrd.img
| `-- vmlinuz
|-- hardware.yaml
|-- MLO
|-- README.md
|-- system
| `-- lib
| `-- modules
| `-- 3.4.0-1491-omap4
|-- u-boot.bin
`-- uEnv.txt
extracted
|-- boot-assets
| |-- MLO
| |-- u-boot.bin
| `-- uEnv.txt
`-- meta
|-- package.yaml
|-- panda-plus-ubuntu.png
`-- readme.md<http://readme.md>
We have referred following links
http://people.canonical.com/~lool/pi2-device-and-oem/
https://developer.ubuntu.com/en/snappy/guides/porting/
https://developer.ubuntu.com/en/snappy/start/#snappy-raspi2
SYSTEM-BOOT partition has folder "a" and "b" only.
But SYSTEM-BOOT partition does not contain bootloader and boot environment files:
MLO, u-boot.bin, uEnv.txt, Snappy-system.txt
Please let us know if we need to refer any articles/guidelines.
Thanks,
Pranav , Prashant
From: loic.minier at canonical.com<mailto:loic.minier at canonical.com> [mailto:loic.minier at canonical.com<mailto:loic.minier at canonical.com>] On Behalf Of Loïc Minier
Sent: Thursday, April 16, 2015 7:38 PM
To: Pranav Wangikar
Cc: snappy-devel at lists.ubuntu.com<mailto:snappy-devel at lists.ubuntu.com>
Subject: Re: Ubuntu Core Snappy ported to OMAP4-PANDA board
Hey Pranav,
that's awesome!
it seems you went through a bunch of similar steps like the ones we had for BBB; one thing I had to do is rebuilding u-boot with a patch to enable support for raw initrd:
http://people.canonical.com/~lool/snappy-bbb/README
BTW my own panda support files are at:
http://people.canonical.com/~lool/snappy-panda/
but haven't tested them recently.
What would be really cool is creating a device tarball and an OEM snap for the pandaboard and pushing the snap to the store, so that it could be used like the Raspberry Pi 2 snap:
http://people.canonical.com/~lool/snappy-panda/
We can help you on this list in this process :-)
Cheers,
On Tue, Apr 14, 2015 at 11:59 PM, Pranav Wangikar <pranav_wangikar at persistent.com<mailto:pranav_wangikar at persistent.com>> wrote:
Hello,
We have successfully ported ubuntu-core snappy on OMAP4-Panda Board.
Steps for porting are as follows:
1) Ubuntu-Core on OMAP4 Panda Board
(To get Panda Specific updated Kernel & drivers for snappy)
2) Porting Snappy on OMAP4 Panda Board
3) References
**************************************************************
********************* (1) Ubuntu-Core on OMAP4 Panda Board *********
**************************************************************
To get Panda Specific updated Kernel & drivers for snappy.
1. Set up Ubuntu Host machine
Enable & install the pre-requisite tools required for snappy ubuntu & ubuntu-core snappy tools PPA: Latest tools needed to develop for snappy
ubuntu-device-flash: Main tool for installing Ubuntu for devices
bzr: Bazaar is a version control system, like git or svn.
u-boot-tools: mkimage package from uboot-tools allows generation of U-Boot images in various formats to comply bootloader requirements of Snappy & Ubuntu-Core
gparted: Use to partition
# sudo add-apt-repository ppa:snappy-dev/beta # sudo apt-get update # sudo apt-get upgrade # sudo apt-get install ubuntu-device-flash snappy-tools bzr u-boot-tools gparted
2. Partition SD card for Ubuntu-Core
For configuring SD card for ubuntu-core there are 2 methods as mentioned in URL http://omappedia.org/wiki/SD_Configuration
2.1. Script method
open the link and copy the script to a local file(omap3-mkcard.sh) http://git.openembedded.org/openembedded/tree/contrib/angstrom/omap3-mkcard.sh
Connect the SD card (for instance it is detected as /dev/sdb) # sudo ./omap3-mkcard.sh /dev/sdb Accordingly partition will be created 2.2. Command Line Method As described on http://git.openembedded.org/openembedded/tree/contrib/angstrom/omap3-mkcard.sh
2.3. Use Partion tool such as Gparted
At the end of step-2 SD partition will look like
For instance SD card is of 4GB
|--------------------------4GB SD Card-------------------------|
| LABEL |system-boot|system-a |system-b |writable|
|-------------|-----------|----------- |--------------|--------|
| SIZE |100 MB |1200 MB |1200 MB |1400 MB |
| TYPE |FAT32 |EXT2,3,4 |EXT2,3,4 |EXT2,3,4|
| FLAGS |boot, lba | | | |
| DESCRIPTION |Boot Files |Primary root|Secondary root| |
| | |Filesystem |Filesystem | |
|-------------|-----------|------------|--------------|--------|
Note: All these instructions are common across all OMAP platforms.
viz. Panda, BeagleBone, Ninja.
3. Boot Ubuntu Core on Panda Board
3.1 Configuring Boot Partition
On Ubuntu Host Machine
Create Temparory directory
$ sudo mkdir -p ~/workdir/panda_rootfs
$ cd ~/workdir/panda_rootfs
3.2 Create the boot script file boot.script with the following content:
$ sudo vim boot.script
_____________________boot.script________________________
fatload mmc 0:1 0x80000000 uImage
setenv bootargs rw vram=32M fixrtc mem=1G at 0x80000000 root=/dev/mmcblk0p2 console=ttyO2,115200n8 rootwait bootm 0x80000000 ________________________________________________________
3.3 Generate the boot.scr file
$ sudo mkimage -A arm -T script -C none -n "Boot Image" -d boot.script boot.scr Download the 12.04 release from Canonical:
3.4 Download the image from Canonical for generic-arm $ sudo wget http://cdimage.ubuntu.com/ubuntu-core/releases/12.04/release/ubuntu-core-12.04.4-core-armhf.tar.gz
3.5 Download MLO, Uboot & Kernel Image for generic-arm $ sudo wget -O MLO http://ports.ubuntu.com/ubuntu-ports/dists/precise/main/installer-armhf/current/images/omap4/netboot/MLO
$ sudo wget -O u-boot.bin http://ports.ubuntu.com/ubuntu-ports/dists/precise/main/installer-armhf/current/images/omap4/netboot/u-boot.bin
$ sudo wget -O uImage http://ports.ubuntu.com/ubuntu-ports/dists/precise/main/installer-armhf/current/images/omap4/netboot/uImage
3.6 Copy files over to the boot partition(i.e system-boot) on SD Card $ sudo cp MLO u-boot.bin uImage boot.scr /media/<user_name>/system-boot
Note: MLO "must" be copied first to the system-boot partition.
3.7 Extract filesystem on SDCard remaining partition (system-a) $ cd /media/<user_name>/system-a $ sudo tar --numeric-owner -xzvf ~/workdir/panda_rootfs/ubuntu-core-12.04.4-core-armhf.tar.gz
Let us term extracted directory as <panda_ucore_rootfs>
3.8 Update, Configure system parameters <console, network, proxy>
3.8.1 Create Serial Console configuration file under <panda_rootfs>/etc with the following content
$ sudo vim etc/serial-auto-detect-console.conf
__________________________serial-auto-detect-console.conf_______________
# serial-auto-detect-console - starts getty on serial console # # This service starts a getty on the serial port given in the 'console' kernel argument.
#
start on runlevel [23]
stop on runlevel [!23]
respawn
exec /bin/sh /bin/serial-console
________________________________________________________________________
3.8.2 Create Serial Console configuration file under bin with following content
$ sudo vim bin/serial-console
__________________serial-console_______________
for arg in $(cat /proc/cmdline)
do
case $arg in
console=*)
tty=${arg#console=}
tty=${tty#/dev/}
case $tty in
tty[a-zA-Z]* )
PORT=${tty%%,*}
# check for service which do something on this port
if [ -f /etc/init/$PORT.conf ];then continue;fi
tmp=${tty##$PORT,}
SPEED=${tmp%%n*}
BITS=${tmp##${SPEED}n}
# 8bit serial is default
[ -z $BITS ] && BITS=8
[ 8 -eq $BITS ] && GETTY_ARGS="$GETTY_ARGS -8 "
[ -z $SPEED ] && SPEED='115200,57600,38400,19200,9600'
GETTY_ARGS="$GETTY_ARGS $SPEED $PORT"
exec /sbin/getty $GETTY_ARGS
esac
esac
done
_________________________________________________
Assign execute the permission the file
$ sudo chmod +x $<panda_ucore_rootfs>/bin/serial-console
3.8.3 Login root without password (required for first boot)
Edit Shadow file & remove * from root line $ sudo vim etc/shadow
__________shadow_____________
root::15259:...
_____________________________
3.8.4 Configure network configuration
a) Edit etc/network/interfaces file and add the bottom 4 lines $ sudo vim etc/network/interfaces
__________interfaces_____________
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp
_________________________________
b) Configure DNS server in etc/resolv.conf (Optional)
$ sudo chmod +w etc/resolv.conf
$ sudo vim etc/resolv.conf
__________resolv.conf_____________
search <something.dhcp.mycompany.com<http://something.dhcp.mycompany.com>>
domain <Domain name Server>
nameserver <IP address of DNS server 1>
nameserver <IP address of DNS server 2>
__________________________________
c) Configure Proxy settings (Optional) etc/environment
__________environment_____________
http_proxy="http://<user_name>:<password>@<proxy_server>:8080/<http://%3cuser_name%3e:%3cpassword%3e@%3cproxy_server%3e:8080/>"
https_proxy="https://<user_name>:<password>@<proxy_server>:8080/<https://%3cuser_name%3e:%3cpassword%3e@%3cproxy_server%3e:8080/>"
ftp_proxy="ftp://<user_name>:<password>@<proxy_server>:8080/"
_________________________________
d) Configure Proxy settings for apt, Create etc/apt/apt.conf.d/95proxies with following content
$ sudo vim etc/apt/apt.conf.d/95proxies
___________________95proxies_______________________
Acquire::http::proxy "http://<user_name>:<password>@<proxy_server>:8080/<http://%3cuser_name%3e:%3cpassword%3e@%3cproxy_server%3e:8080/>";
Acquire::https::proxy "https://<user_name>:<password>@<proxy_server>:8080/<https://%3cuser_name%3e:%3cpassword%3e@%3cproxy_server%3e:8080/>";
Acquire::ftp::proxy "ftp://<user_name>:<password>@<proxy_server>:8080/";
___________________________________________________
3.9 Chroot the panda_ucore_rootfs
a) Check & install qemu-user-static package on host ubuntu system
$ sudo dpkg -l qemu-user-static
$ sudo apt-get install qemu-user-static
b) Copy the qemu for arm file from host to panda_ucore_rootfs (SD card) $ sudo cp -p /usr/bin/qemu-arm-static usr/bin/.
c) Mount sys proc dev/pts directories
$ for m in `echo 'sys dev proc dev/pts'`; do sudo mount /$m ./$m -o bind; done
d) Chroot the panda_ucore_rootfs
$ cd /media/sd<X>/system-a/
OR
$ cd $<panda_ucore_rootfs>
$ sudo LC_ALL=C chroot . /bin/bash
e) Update panda_ucore_rootfs in Chroot environment <panda_ucore_rootfs>$ apt-get install vim.tiny
f) Modify TI, Canonical repositories to get updates <panda_ucore_rootfs>$ vim.tiny /etc/apt/sources.list Add following lines
___________________________sources.list__________________
# Ubuntu repositories
deb http://ports.ubuntu.com/ubuntu-ports/ precise universe multiverse deb http://ports.ubuntu.com/ubuntu-ports/ precise-updates universe multiverse deb http://ports.ubuntu.com/ubuntu-ports/ precise-security universe multiverse
# TI release PPA
deb http://ppa.launchpad.net/tiomap-dev/release/ubuntu precise main deb-src http://ppa.launchpad.net/tiomap-dev/release/ubuntu precise main
_________________________________________________________
g) Apply updates to rootfs
<panda_ucore_rootfs>$ apt-get update
<panda_ucore_rootfs>$ apt-get dist-upgrade --yes <panda_ucore_rootfs>$ apt-get install apt-utils ubuntu-omap4-extras u-boot-tools --yes --force-yes
h) Create flash-kernel.conf with following content $ vim.tiny etc/flash-kernel.conf ______________flash-kernel.conf_______________________
UBOOT_PART=/dev/mmcblk0p1
ROOT=/dev/mmcblk0p2
______________________________________________________
i) Update boot.script with following content & copy it to rootfs boot $ vim boot.script
______________boot.script_______________________
fatload mmc 0:1 0x80000000 uImage
fatload mmc 0:1 0x81600000 uInitrd
setenv bootargs ro elevator=noop console=ttyO2,115200n8 mem=1G at 0x80000000 root=/dev/mmcblk0p2 fixrtc bootm 0x80000000 0x81600000 ________________________________________________
$ sudo cp boot.script /media/<user_name>/system-a/boot/.
h) Getting out of "chroot"
<panda_ucore_rootfs>$ for m in `echo 'sys dev proc dev/pts'`; do sudo umount ./$m; done
i) Convert vmlinuz to uImage & update the uImage in system-boot partition $ cd /media/<user_name>/system-a/boot/ $ sudo mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux" -d ./vmlinuz-* ~/workdir/panda_rootfs/uImage_new
Check the properties of newly created uImage $ file ~/workdir/panda_rootfs/uImage_new $ sudo cp -f ~/workdir/panda_rootfs/uImage_new /media/<user_name>/system-boot/uImage
3.10 Boot the Board with SD card connected
<panda_ucore>$$ flash-kernel
<panda_ucore>$$ reboot
a) Unmount,remove the SD card from Host Ubuntu
b) Connect Serial Cable, Keyboard, Monitor(HDMI), Ethernet Cable, Power Cable to Panda Board
c) Boot the Board, Ubuntu Core is running on Panda Board, You can able to login with root with no password.
******************************************************************
******* (2) Porting Snappy on OMAP4 Panda Board ******************
******************************************************************
1. Take backup of Ubuntu-core system-boot & system-a partition, we will require MLO, boot.script, boot.scr & uImage files
Take backup of Copy ubuntu-core rootfs files to known location on ubuntu host
$ sudo mkdir -p /bkp/panda_ubuntu_core/system-boot
$ sudo mkdir -p /bkp/panda_ubuntu_core/system-a $ sudo cp -rp /media/<user_name>/system-boot/. /bkp/panda_ubuntu_core/system-boot/.
$ sudo cp -rp /media/<user_name>/system-a/. /bkp/panda_ubunutu_core/system-a/.
2. Make sure system-a partition is empty (delete everything)
$ cd /media/<user_name>/system-a
$ sudo rm -rvf ./*
3. Download armhf.tar.gz (Link ???)
$ sudo wget http://cdimage.ubuntu.com/ubuntu-core/daily-preinstalled/current/vivid-preinstalled-core-armhf.tar.gz
4. Extract the tar ball to system-a so that system-a is root filesystem for snappy $ sudo cd /media/<user_name>/system-a $ sudo tar --numeric-owner -xzvf /media/<user_name>/system-a/vivid-preinstalled-core-armhf.tar.gz
5. Customization of Snappy Rootfile system (system-a)
5.1 Create uboot,writable directory
$ cd /media/<user_name>/system-a
$ sudo mkdir -p boot/uboot writable
5.2 Copy system-boot files to boot/uboot $ sudo cp -rp /media/<user_name>/system-boot /media/system-a/boot/uboot $ sync
5.3 Copy lib/modules directory from panda_ucore_rootfs location to snappy root filesystems $ sudo cp -rpf /bkp/panda_ubuntu_core/system-a/lib/modules /media/<user_name>/system-a/lib/.
5.4 Copy Network configuration files from panda_ucore_rootfs to snappy_ucore_rootfs
$ cd /bkp/panda_ubuntu_core/system-a/
$ sudo cp -p etc/resolv.conf /media/<user_name>/system-a/etc/resolv.conf
$ sudo cp -p etc/network/interfaces /media/<user_name>/system-a/etc/network/interfaces
$ sudo cp -p etc/shadow /media/<user_name>/system-a/etc/shadow
This step is optional
5.5 Wrtiable folder content
a) Download beagle bone arm-hf image to temporary location $ mkdir -p /tmp/armbb_tarball; cd /tmp/armbb_tarball $ wget http://cdimage.ubuntu.com/ubuntu-core/releases/alpha-3/ubuntu-core-WEBDM-alpha-03_armhf-bbb.img.xz
b) Extract/View/Mount beaglebone image-> writable partion $ sudo unxz ubuntu-core-WEBDM-alpha-03_armhf-bbb.img.xz
View beagle bone image
$ sudo kpartx ubuntu-core-WEBDM-alpha-03_armhf-bbb.img -a $ sudo kpartx ubuntu-core-WEBDM-alpha-03_armhf-bbb.img -l
loop0p1 : 0 131072 /dev/loop0 8192
loop0p2 : 0 2097152 /dev/loop0 139264
loop0p3 : 0 2097152 /dev/loop0 2236416
loop0p4 : 0 3477504 /dev/loop0 4333568
c) Mount & Copy content of beaglebone->writable partion to SDK writable partition $ mkdir -p /tmp/armbb_tarball/tst_mnt $ sudo mount /dev/mapper/loop0p4 /tmp/armbb_tarball/tst_mnt $ sudo cp -rp /tmp/armbb_img/tst_mnt /media/<user_name>/writable
6. Getting the Snappy Boot Partition (system-boot) ready
The system-boot partition is where all the boot essential artifacts are stored
6.1 Retain system-boot artifacts from ubuntucore
a) MLO
b) uboot.bin
c) uImage
d) boot.scr
e) boot.script
f) Create directory a & b under system-boot $ mkdir -p /media/<user_name>/system-boot/a $ mkdir -p /media/<user_name>/system-boot/b
g) Copy uImage, uInitrd from system-boot to a $ cp -p /media/<user_name>/system-boot/uImage /media/<user_name>/system-boot/a/.
$ cp -p /media/<user_name>/system-boot/uInitrd /media/<user_name>/system-boot/a/.
7.1 Making Boot Loader ready for snappy
a) Create snappy-system.txt with following content $ vim /media/<user_name>/system-boot/snappy-system.txt
____________________snappy-system.txt______________________________
# This is a snappy variables and boot logic file and is entirely generated and # managed by Snappy. Modifications may break boot ###### # functions to load kernel, initrd and fdt from various env values # Modified for Snappy loadfiles=run loadkernel; run loadinitrd; run loadfdt
mmcdev=0
mmcpart=1
loadfiles=run loadkernel; run loadinitrd # Modified for Snappy: loadkernel=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${snappy_ab}/${kernel_file} loadkernel=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${snappy_ab}/${kernel_file} # Modified for Snappy loadinitrd=load mmc ${mmcdev}:${mmcpart} ${initrd_addr} ${snappy_ab}/${initrd_file}; setenv initrd_size ${filesize} loadinitrd=fatload mmc ${mmcdev}:${mmcpart} ${initrd_addr} ${snappy_ab}/${initrd_file}; setenv initrd_size ${filesize} loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdtaddr} ${snappy_ab}/dtbs/${fdtfile}
# standard kernel and initrd file names; NB: fdtfile is set early from bootcmd kernel_file=uImage initrd_file=uInitrd fdtfile=am335x-boneblack.dtb
# extra kernel cmdline args, set via mmcroot # Modified for Snappy: snappy_cmdline=init=/lib/systemd/systemd ro panic=-1 fixrtc snappy_cmdline=init=/lib/systemd/systemd ro panic=-1 elevator=noop console=ttyO2,115200n8 mem=1G at 0x80000000 root=/dev/mmcblk0p2 fixrtc ip=dhcp
# boot logic
# either "a" or "b"; target partition we want to boot snappy_ab=a # stamp file indicating a new version is being tried; removed by s-i after boot snappy_stamp=snappy-stamp.txt # either "regular" (normal boot) or "try" when trying a new version snappy_mode=regular # if we're trying a new version, check if stamp file is already there to revert # to other version # Modified for Snappy:
# snappy_boot=if test "${snappy_mode}" = "try"; then if test -e mmc ${bootpart} ${snappy_stamp}; then if test "${snappy_ab}" = "a"; then setenv snappy_ab "b"; else setenv snappy_ab "a"; fi; else fatwrite mmc ${mmcdev}:${mmcpart} 0x0 ${snappy_stamp} 0; fi; fi; run loadfiles; setenv mmcroot /dev/disk/by-label/system-${snappy_ab} ${snappy_cmdline}; run mmcargs; bootz ${loadaddr} ${initrd_addr}:${initrd_size} ${fdtaddr} snappy_boot=if test "${snappy_mode}" = "try"; then if test -e mmc ${bootpart} ${snappy_stamp}; then if test "${snappy_ab}" = "a"; then setenv snappy_ab "b"; else setenv snappy_ab "a"; fi; fi; fi; run loadfiles; setenv mmcroot /dev/mmcblk0p1/system-${snappy_ab} ${snappy_cmdline}; setenv bootargs ${snappy_cmdline}; bootm ${loadaddr} ${initrd_addr}
_______________________________________________________________
b) Create uEnv.txt
$ vim /media/<user_name>/system-boot/uEnv.txt
__________________uEnv.txt________________________
# where to load initrd
# Modified for Snappy: initrd_addr=0x88080000
initrd_addr=0x81600000
loadaddr=0x80000000
bootpart=0:1
# load Snappy environment and call into Snappy boot after processing this file # Modified for Snappy: uenvcmd=load mmc ${bootpart} ${loadaddr} snappy-system.txt; env import -t $loadaddr $filesize; run snappy_boot uenvcmd=fatload mmc ${bootpart} ${loadaddr} snappy-system.txt; env import -t $loadaddr $filesize; run snappy_boot _______________________________________________________
c) Create hardware.yaml with following content $ vim /media/<user_name>/system-boot/a/hardware.yaml
__________________hardware.yaml________________________
kernel: assets/uImage
initrd: assets/uInitrd
partition-layout: system-AB
bootloader: u-boot
_______________________________________________________
7.2 Creating initrd image for snappy on panda
a) Use existing mount point of Beagle image to copy uInitrd.img (if not use kpartx) $ sudo kpartx ubuntu-core-WEBDM-alpha-03_armhf-bbb.img -a $ sudo kpartx ubuntu-core-WEBDM-alpha-03_armhf-bbb.img -l
loop0p1 : 0 131072 /dev/loop0 8192
loop0p2 : 0 2097152 /dev/loop0 139264
loop0p3 : 0 2097152 /dev/loop0 2236416
loop0p4 : 0 3477504 /dev/loop0 4333568
$ sudo mkdir -p /tmp/armbb_img/tst_mnt ; sudo mount /dev/mapper/loop0p1 /tmp/armbb_img/tst_mnt
b) Copy initrd.img to known location
$ sudo mkdir -p ~/workdir/test
$ sudo cp /tmp/armbb_img/tst_mnt/a/initrd.img ~/workdir/test/initrd.img_bb
c) Copy uInitrd from system-boot on local directory $ sudo cp /media/<user_name>/system-boot/uInitrd ~/workdir/test/uInitrd_ucore
d) Convert uInitrd to initrd(panda) form $ cd ~/workdir/test $ sudo dd if=uInitrd_ucore of=initrd_panda skip=64 bs=1
e) Unzip/View initrd(panda)
$ sudo mkdir ~/workdir/test/panda_initrd $ cd ~/workdir/test/panda_initrd $ sudo cat ../initrd_panda | gunzip -c | sudo cpio -i OR $ sudo zcat ../initrd_panda | sudo cpio -i $ ls -l drwxr-xr-x 9 root root 4096 Apr 6 13:37 ./ drwxr-xr-x 3 root root 4096 Apr 6 13:31 ../ drwxr-xr-x 2 root root 4096 Apr 6 13:37 bin/ drwxr-xr-x 3 root root 4096 Apr 6 13:37 conf/ drwxr-xr-x 5 root root 4096 Apr 6 13:37 etc/ -rwxr-xr-x 1 root root 7237 Apr 6 13:37 init* drwxr-xr-x 6 root root 4096 Apr 6 13:37 lib/ drwxr-xr-x 2 root root 4096 Apr 6 13:37 run/ drwxr-xr-x 2 root root 4096 Apr 6 13:37 sbin/ drwxr-xr-x 7 root root 4096 Apr 6 13:37 scripts/
So panda_initrd has rootfilesystem, we re-package this for panda rootfs
f) Copy required drivers (mtd, block) from ucore_rootfs to panda extracted rootfs $ sudo cp -rp /bkp/panda_ubunutu_core/system-a/lib/modules/3.4.0-1491-omap4/kernel/drivers/mtd lib/modules/3.4.0-1491-omap4/kernel/drivers/.
$ sudo cp -rp /bkp/panda_ubunutu_core/system-a/lib/modules/3.4.0-1491-omap4/kernel/drivers/block lib/modules/3.4.0-1491-omap4/kernel/drivers/.gunzipgunzip
g) Unzip/View initrd(beaglebone)
$ mkdir -p ~/workdir/test/bb_initrd
$ cd ~/workdir/test/bb_initrd
$ sudo cat ../initrd_panda | gunzip -c | sudo cpio -i $ ls -l ~/workdir/test/bb_initrd$ ll total 44 drwxr-xr-x 9 root root 4096 Apr 6 14:31 ./ drwxr-xr-x 4 root root 4096 Apr 6 14:28 ../ drwxr-xr-x 2 root root 4096 Apr 6 14:31 bin/ drwxr-xr-x 3 root root 4096 Apr 6 14:31 conf/ drwxr-xr-x 5 root root 4096 Apr 6 14:31 etc/ -rwxr-xr-x 1 root root 7237 Apr 6 14:31 init* drwxr-xr-x 6 root root 4096 Apr 6 14:31 lib/ drwxr-xr-x 2 root root 4096 Apr 6 14:31 run/ drwxr-xr-x 2 root root 4096 Apr 6 14:31 sbin/ drwxr-xr-x 7 root root 4096 Apr 6 14:31 scripts/
Copy following 2 files from <beaglebone> rootfs to <Panda> rootfs
$ sudo cp -p conf/conf.d/ubuntu-core-rootfs ~/workdir/test/panda_initrd/conf/conf.d/.
$ sudo cp -p scripts/ubuntu-core-rootfs ~/workdir/test/panda_initrd/scripts/.
h) Create new initrd from Panda rootfs (/workdir/test/panda_initrd/)
$ cd ~/workdir/test/panda_initrd
$ find . | cpio --create --format=newc | lzma > ../initrd_panda_new.img
i) Convert initrd to uInitrd
$ cd ../.
$ sudo mkimage -A arm -T ramdisk -C none -n "Panda Snappy Initrd" -d initrd_panda_new.img uInitrd_panda_new
$ file uInitrd_panda_new
j) Copy uInitrd to system-boot
$ cp -pf uInitrd_panda_new /media/<user_name>/system-boot/a/uInitrd
$ cp -pf uInitrd_panda_new /media/<user_name>/system-boot/uInitrd
Now unmount, remove the SD card, connect it to board & boot
******************************************************************
**************** References ****************************************
******************************************************************
1) Snappy for Devices porting guide
https://developer.ubuntu.com/en/snappy/porting/
2) Porting Ubuntu Snappy to a yet unsupported armhf board
https://ograblog.wordpress.com/2015/01/25/porting-ubuntu-snappy-to-a-yet-unsupported-armhf-board/
3) Omap Ubuntu Core
http://www.omappedia.com/wiki/OMAP_Ubuntu_Core
4) Snappy system
https://developer.ubuntu.com/en/snappy/guides/filesystem-layout/
5) From the Canyon Edge
http://blog.dustinkirkland.com/2014/12/its-a-snap.html
Regards,
Prashant Khoje
Pranav Wangikar
Persistent Systems Ltd. | Partners in Innovation | www.persistentsys.com<http://www.persistentsys.com>
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
--
snappy-devel mailing list
snappy-devel at lists.ubuntu.com<mailto:snappy-devel at lists.ubuntu.com>
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snappy-devel
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
--
snappy-devel mailing list
snappy-devel at lists.ubuntu.com<mailto:snappy-devel at lists.ubuntu.com>
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snappy-devel
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snappy-devel/attachments/20150511/339123ac/attachment-0001.html>
More information about the snappy-devel
mailing list