Installing Ubuntu

From Ambedded
Jump to: navigation, search

Prepare a SATA hard disk and download the ubuntu core image from You could get the Ubuntu core image from or make the image for CyOne by yourself. If you get the core image from Ambedded, then you just need to do step 1 to step 5, then jump to step 9.

In ambedded build image the IP address will be configured by script ambnet which locate at folder /etc/init.d/ ,and it will change eth0 IP by board id to,eth1 to dhcp.

1. Connect the hard disk to your PC

2. Need to use root privilege

sudo -s 

3. Create a 1GB Linux partition

fdisk /dev/sdX

a. Use d repeatedly to delete all the partitions. b. Use n to new the partition, then select primary partition. c. Type <enter> for start sector, then type +1G for partition size.

4. Format and mount the partition

mkfs.ext3 /dev/sdX1
mount /dev/sdX1 /mnt

5. Extract the core image to the partition

tar xvzf /<located path>/ubuntu-core-14.04-core-armhf.tar.gz -C /mnt 

6. Create /mnt/etc/init/serial-auto-detect-console.conf and insert the following lines into the file.

start on runlevel [23]
stop on runlevel [!23]

exec /bin/sh /bin/serial-console

6 Create /mnt/bin/serial-console and insert the following lines into the file, then change the file mode.

chmod +x /mnt/bin/serial-console

for arg in $(cat /proc/cmdline)
   case $arg in

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

7. Modify /mnt/etc/network/interfaces to the following content.

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp		 

8. Remove ttyX.conf

rm /mnt/etc/init/tty*.conf

9.clean the root password, the first line of file /mnt/etc/shadow should be like this:

root@(none):/# cat /mnt/etc/shadow

10.If you want to install gluster or ceph ,you may need to add universe source,but please ATTENTION the source do not be reviewed or updated form ubuntu.

sed -i.bak "s/restricted/restricted universe/g"  /mnt/etc/apt/sources.list

11. Umount the partition

umount /mnt

Personal tools