Powered by SmartDoc

6.2 FreeBSD ブート SD で起動して eMMC にインストール

  1. "Welcome"でシェルプロンプトへ
    # tcsh -l
    root@:~ # 
    
  2. eMMC (/dev/mmcsd1)へインストール
    root@:~ # gpart destroy -F mmcsd1
    mmcsd1 destroyed
    root@:~ # dd if=/boot/uboot/idbloader.img of=/dev/mmcsd1 \
        conv=sync bs=512 seek=64
    322+0 records in
    322+0 records out
    164864 bytes transferred in 0.364296 secs (452555 bytes/sec)
    root@:~ # dd if=/boot/uboot/u-boot.itb of=/dev/mmcsd1 conv=sync \
        bs=512 seek=16384
    1800+0 records in
    1800+0 records out
    921600 bytes transferred in 1.633649 secs (564136 bytes/sec)
    root@:~ # gpart create -s GPT mmcsd1
    mmcsd1 created
    root@:~ # gpart add -t efi -l efi -a 512k -s 50m -b 16m mmcsd1
    mmcsd1p1 added
    root@:~ # gpart add -t freebsd-ufs -a 64k -l rootfs mmcsd1
    mmcsd1p2 added
    root@:~ # newfs_msdos -L 'efi' /dev/mmcsd1p1
    /dev/mmcsd1p1: 102264 sectors in 12783 FAT16 clusters (4096 \
        bytes/cluster)
    BytesPerSec=512 SecPerClust=8 ResSectors=1 FATs=2 RootDirEnts=512 \
        Media=0xf0 FATsecs=50 SecPerTrack=63 Heads=255 HiddenSecs=0 \
        HugeSectors=102400
    root@:~ # mount_msdosfs /dev/mmcsd1p1 /mnt
    root@:~ # mkdir -p /mnt/EFI/BOOT
    root@:~ # cp /boot/loader.efi /mnt/EFI/BOOT/bootaa64.efi
    root@:~ # sync; sync; sync
    root@:~ # umount /mnt
    lock order reversal:
    1st 0xffffa0001d958070 ufs (ufs, lockmgr) @ \
        /usr/src/sys/kern/vfs_mount.c:1724
    2nd 0xffffa0001d9299f8 devfs (devfs, lockmgr) @ \
        /usr/src/sys/fs/msdosfs/msdosfs_vfsops.c:943
    root@:~ # newfs -L 'rootfs' /dev/mmcsd1p2
    /dev/mmcsd1p2: 59573.9MB (122007424 sectors) block size 32768, \
        fragment size 4096
    using 96 cylinder groups of 626.09MB, 20035 blks, 80256 inodes.
    super-block backups (for fsck_ffs -b #) at:
    192, 1282432, 2564672, 3846912, 5129152, 6411392, 7693632, \
        8975872, 10258112,
    11540352, 12822592, 14104832, 15387072, 16669312, 17951552, \
        19233792,
    20516032, 21798272, 23080512, 24362752, 25644992, 26927232, \
        28209472,
    29491712, 30773952, 32056192, 33338432, 34620672, 35902912, \
        37185152,
    38467392, 39749632, 41031872, 42314112, 43596352, 44878592, \
        46160832,
    47443072, 48725312, 50007552, 51289792, 52572032, 53854272, \
        55136512,
    56418752, 57700992, 58983232, 60265472, 61547712, 62829952, \
        64112192,
    65394432, 66676672, 67958912, 69241152, 70523392, 71805632, \
        73087872,
    74370112, 75652352, 76934592, 78216832, 79499072, 80781312, \
        82063552,
    83345792, 84628032, 85910272, 87192512, 88474752, 89756992, \
        91039232,
    92321472, 93603712, 94885952, 96168192, 97450432, 98732672, \
        100014912,
    101297152, 102579392, 103861632, 105143872, 106426112, 107708352, \
        108990592,
    110272832, 111555072, 112837312, 114119552, 115401792, 116684032, \
        117966272,
     119248512, 120530752, 121812992
    root@:~ # tunefs -N enable -a enable -t enable -L 'rootfs' \
        /dev/mmcsd1p2
    tunefs: POSIX.1e ACLs set
    tunefs: NFSv4 ACLs and POSIX.1e ACLs are mutually exclusive
    tunefs: issue TRIM to the disk set
    root@:~ # mount /dev/mmcsd1p2 /mnt
    root@:~ # tar -xpf /usr/freebsd-dist/kernel.txz -C /mnt
    root@:~ # tar -xpf /usr/freebsd-dist/base.txz -C /mnt
    root@:~ # cat /mnt/etc/fstab 
    # Device	Mountpoint	FStype	Options	Dump	Pass#
    /dev/mmcsd0p2	/		ufs	rw	1	1
    tmpfs		/tmp		tmpfs	rw,mode=1777	0	0
    devfs		/dev		devfs	rw	0	0
    root@:~ # cat > /mnt/etc/rc.conf
    defaultrouter="192.168.1.254"
    hostname="kazu.tfc"
    ifconfig_ue0="inet 192.168.1.65  netmask 255.255.255.0"
    saver="logo"
    sendmail_enable="YES"
    sshd_enable="YES"
    ntpd_enable="YES"
    usbd_enable="YES"
    usb_load="YES"
    root@:~ # cat > /mnt/etc/resolv.conf
    search  tfc
    nameserver      192.168.1.2
    nameserver      8.8.8.8
    nameserver      8.8.4.4
    root@:~ # cp /usr/share/zoneinfo/Asia/Tokyo /mnt/etc/localtime
    root@:~ # umount /mnt
    root@:~ # shutdown -p now
    Shutdown NOW!
    shutdown: [pid 1025]
    root@:~ # 
    System shutdown time has arrivedJan 27 22:23:03 syslogd: exiting \
        on signal 15
    Waiting (max 60 seconds) for system process `vnlru' to stop... \
        done
    Waiting (max 60 seconds) for system process `syncer' to stop... 
    Syncing disks, vnodes remaining... 0 0 done
    Waiting (max 60 seconds) for system thread `bufdaemon' to stop... \
        done
    Waiting (max 60 seconds) for system thread `bufspacedaemon-1' to \
        stop... done
    Waiting (max 60 seconds) for system thread `bufspacedaemon-0' to \
        stop... done
    All buffers synced.
    Uptime: 15h37m46s