Changeset 4803


Ignore:
Timestamp:
11/19/08 23:41:20 (8 years ago)
Author:
werner
Message:

Support for making a bootable SD card image.

  • werner.init: remount root read-write, in case we booted from microSD
  • myroot: create /etc/fstab, so that we can remount root
  • mkext2: create an ext2 file system image
  • mksd: make a bootable SD card image (u-boot and GTA02 only for now)
  • README: added warnings that we require root and that this is currently for GTA02 only
  • README: described how to make a bootable SD card image
  • werner.myroot: we had tcptraceroute and traceroute. Remove the latter.
Location:
developers/werner/myroot
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • developers/werner/myroot/README

    r4792 r4803  
    11*** WORK IN PROGRESS - USE AT YOUR OWN PERIL ! *** 
     2 
     3*** GTA02 ONLY FOR NOW ! *** 
    24 
    35 
     
    2224=============== 
    2325 
     26 
     27Note: all the scripts described below perform operations that require 
     28root privileges. It's best to operate them from a root shell, e.g. 
     29% sudo /bin/bash 
     30 
     31 
    2432Customization 
    2533------------- 
     
    2937number of adaptations and corrections. 
    3038 
    31 The script "werner" is an example of a relatively complex customization. 
    32 It installs many development tools not normally part of a rootfs and 
    33 reduces the system setup to the bare minimum, so that once can interact 
    34 with a pristine system. 
     39The script "werner.myroot" is an example of a relatively complex 
     40customization.  It installs many development tools not normally part of 
     41a rootfs and reduces the system setup to the bare minimum, so that once 
     42can interact with a pristine system. 
    3543 
    3644The execution environment of this script is as follows: 
     
    5563Just run 
    5664 
    57 ./myroot <customization_script> 
     65# ./myroot <customization_script> 
     66 
     67Example: 
     68 
     69# ./myroot werner.myroot 
    5870 
    5971myroot will print out a flurry of errors at the end when trying to run 
     
    7082 
    7183 
    72 Making a filesystem image 
    73 ------------------------- 
     84Making a JFFS2 filesystem image 
     85------------------------------- 
    7486 
    7587A GTA02 JFFS2 image can be generated with 
    7688 
    77 ./mkjffs2 
     89# ./mkjffs2 
    7890 
    7991The result is a file root.jffs2 which can be copied to the GTA02 with 
    8092the usual 
    8193 
    82 dfu-util -a rootfs -D root.jffs2  
     94# dfu-util -a rootfs -D root.jffs2  
     95 
     96 
     97Making a bootable SD card image (u-boot) 
     98---------------------------------------- 
     99 
     100First, we generate an ext2 image: 
     101 
     102# ./mkext2 
     103 
     104The image is placed in the file root.ext2 
     105 
     106Next, we make a bootable SD card. For this, we also need a kernel. 
     107Let's assume it is in /home/moko/uImage. Then the invocation would 
     108be as follows: 
     109 
     110# ./mksd -u uImage 
     111 
     112After a screenful of diagnostics, errors, and warnings, the result is 
     113in the file sd_image. 
     114 
     115It can be copied directly to an SD card in a card reader attached to 
     116the host, or it can be copied to the SD card in a Neo with 
     117 
     118% ssh neo 'umount /dev/mmcblk0p*' 
     119% ssh neo 'cat >/dev/mmcblk0' <sd_image 
     120% ssh neo blockdev --rereadpt /dev/mmcblk0 
    83121 
    84122 
  • developers/werner/myroot/myroot

    r4793 r4803  
    134134chmod 755 "$root/home" "$root/home/root" 
    135135 
     136echo ROOT / auto defaults 0 0 >"$root/etc/fstab" 
    136137echo "root::0:0:root:/home/root:/bin/sh" >"$root/etc/passwd" 
    137138 
  • developers/werner/myroot/werner.init

    r4799 r4803  
    11#!/bin/sh 
    22PATH=/sbin:/bin/:/usr/bin:/usr/local/bin 
     3 
     4# if booting from microSD, rootfs may be read-only 
     5mount -n -o remount,rw / 
    36 
    47ldconfig 
  • developers/werner/myroot/werner.myroot

    r4800 r4803  
    2323pkg coreutils grep sed gawk util-linux bash findutils debianutils psmisc 
    2424pkg mtd-utils sysfsutils apm 
    25 pkg net-tools iproute2 iputils-ping tcptraceroute openssh ntpdate 
     25pkg net-tools iproute2 iputils-ping openssh ntpdate 
    2626pkg dhcp-client wireless-tools wpa-supplicant 
    2727pkg portmap ppp rsync 
     
    6565 
    6666pkg tcpdump 
    67 pkg traceroute 
     67pkg tcptraceroute 
    6868 
    6969make -C $my/ttcp clean all 
Note: See TracChangeset for help on using the changeset viewer.