Skip to main content.

14.1.4. Installation on Local Harddisk

Question:
I have a local harddisk drive connected to my target board. Can I install the ELDK on it and run it like a standard Linux distribution?

Answer:
Yes, this is possible. It requires only minor adjustments. The following example assumes you are using a SCSI disk drive, but the same can be done with standard SATA or PATA drives, too:
  1. Boot the target with root file system over NFS.
  2. Create the necessary partitions on your disk drive: you need at last a swap partition and a file system partition.
    bash-3.00# fdisk -l 
    
    Disk /dev/sda: 36.9 GB, 36951490048 bytes
    64 heads, 32 sectors/track, 35239 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1         978     1001456   82  Linux swap / Solaris
    /dev/sda2             979       12423    11719680   83  Linux
    /dev/sda3           12424       23868    11719680   83  Linux
    /dev/sda4           23869       35239    11643904   83  Linux
    
  3. Format the partititons:
    bash-3.00# mkswap /dev/sda1
    bash-3.00# mke2fs -j -m1 /dev/sda2
    
  4. Mount the file system:
    bash-3.00# mount /dev/sda2 /mnt
    
  5. Copy the content of the (NFS) root file system into the mounted file system:
    bash-3.00# tar --one-file-system -c -f - / | ( cd /mnt ; tar xpf - )
    
  6. Adjust /etc/fstab for the disk file system:
    bash-3.00# vi /mnt/etc/fstab
    bash-3.00# cat /mnt/etc/fstab
    /dev/sda2       /               ext3    defaults        1 1
    /dev/sda1       swap            swap    defaults        0 0
    proc            /proc           proc    defaults        0 0
    sysfs           /sys            sysfs   defaults        0 0
    
  7. Adjust /etc/rc.sysinit for running from local disk; remove the following comments:
    bash-3.00# diff -u /mnt/etc/rc.sysinit.ORIG /mnt/etc/rc.sysinit
    --- /mnt/etc/rc.sysinit.ORIG    2007-01-21 04:37:00.000000000 +0100
    +++ /mnt/etc/rc.sysinit 2007-03-02 10:58:22.000000000 +0100
    @@ -460,9 +460,9 @@
     
     # Remount the root filesystem read-write.
     update_boot_stage RCmountfs
    -#state=`LC_ALL=C awk '/ \/ / && ($3 !~ /rootfs/) { print $4 }' /proc/mounts`
    -#[ "$state" != "rw" -a "$READONLY" != "yes" ] && \
    -#  action $"Remounting root filesystem in read-write mode: " mount -n -o remount,rw /
    +state=`LC_ALL=C awk '/ \/ / && ($3 !~ /rootfs/) { print $4 }' /proc/mounts`
    +[ "$state" != "rw" -a "$READONLY" != "yes" ] && \
    +  action $"Remounting root filesystem in read-write mode: " mount -n -o remount,rw /
     
     # Clean up SELinux labels
     if [ -n "$SELINUX" ]; then
    
  8. Unmount disk:
    bash-3.00# umount /mnt
    
  9. Reboot, and adjust boot arguments to use disk partition as root file system
    => setenv diskargs setenv bootargs root=/dev/sda2 ro
    => setenv net_disk 'tftp ${loadaddr} ${bootfile};run diskargs addip addcons;bootm'
    => saveenv
    
  10. Boot with these settings
    => run net_disk
    
14.1.3. .gvfs: Permission Denied 1. Abstract 14.1.5. System Include Files Missing
Prev Home Next