今回はrpmパッケージベースのFedora CoreをT-SH7706LSRボードの導入に挑戦してみます。
Fedora Coreパッケージについて
SHアーキテクチャの現状について
以前まではSHプロセッサ向けの組込みLinuxサポートは、
ルネサスのLinux向けプロセッサは、
ただ、
しかし、
SH3プロセッサ向けFedora Coreパッケージ
2012年4月現在ではかろうじてSH3プロセッサ向けのFedora Coreが以下で一般公開されています。
このサイトでもFedora Core8以降はSH3プロセッサのサポートは打ち切っていますので、
SH3プロセッサ向けのFedora Coreパッケージは、
パッケージの精選は、
T-SH7706LSR配布パッケージ
T-SH7706LSR配布パッケージについて
SH3プロセッサ向けのFedora Coreパッケージは、
いきなりFedora Coreを導入する前に、
T-SH7706LSR配布パッケージの導入
すでにT-SH7706LSR配布パッケージでT-SH7706LSRで運用している場合は作業は不要ですが、
購入時点ではLinuxパーティションがないので、
コマンド (m でヘルプ): p ディスク /dev/sdb: 7948 MB, 7948206080 バイト ヘッド 255, セクタ 63, シリンダ 966, 合計 15523840 セクタ Units = セクタ数 of 1 * 512 = 512 バイト セクタサイズ (論理 / 物理): 512 バイト / 512 バイト I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト ディスク識別子: 0x00000000 デバイス ブート 始点 終点 ブロック Id システム /dev/sdb1 63 80324 40131 b W95 FAT32 /dev/sdb2 80325 15518789 7719232+ 83 Linux
パーティションを設定したら、
# mkfs -t vfat [第1パーティション] # mkfs -t ext3 [第2パーティション]
T-SH7706LSRの配布サイトでファイルを入手し、
- boot.
exe - initrd.
img - vmlinux
第2パーティションには rootfs.
SH3版Fedora Coreのインストール
インストール準備
PC上でファイルシステムのインストールを行います。場所は任意ですが、
あらかじめ、
# mkdir ~/fc7_fs/var # mkdir ~/fc7_fs/var/tmp # mkdir ~/fc7_fs/var/lib # mkdir ~/fc7_fs/var/lib/rpm
ファイルシステムのインストール
次にrpmパッケージ管理データベースを以下のように初期化をします。このときに注意しなければいけないことは、
# rpm --root ~/fc7_fs --initdb
rpmパッケージ管理データベースを初期化したら、
# cd ~/fc7_rpm # rpm --root ~/fc7_fs -ivh --force --nodeps --ignorearch --noscripts *.rpm
このときにPC上のアカウントとFedora Core 7のアカウントが異なることによる警告メッセージが出ますが、
インストールとカスタマイズ
今回はとにかく起動することを目的としていますので、
SDカードへのインストール
第1パーティションはT-SH7706LSRの配布ファイルをそのまま使用し、
# cd ~/fc7_fs # cp -a * [SDカード第2パーティション]
Fedora Coreのカスタマイズ
Fedora CoreのデバイスファイルとT-SH7706LSRのファイルシステムとは互換性がないので、
/etc以下のファイルは基本的にそのまま使いますが、
1 #
2 # inittab This file describes how the INIT process should set up
3 # the system in a certain run-level.
4 #
5 # Author: Miquel van Smoorenburg, >[email protected]<
6 # Modified for RHS Linux by Marc Ewing and Donnie Barnes
7 #
8
9 # Default runlevel. The runlevels used by RHS are:
10 # 0 - halt (Do NOT set initdefault to this)
11 # 1 - Single user mode
12 # 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
13 # 3 - Full multiuser mode
14 # 4 - unused
15 # 5 - X11
16 # 6 - reboot (Do NOT set initdefault to this)
17 #
18 id:1:initdefault:
19
20 # System initialization.
21 si::sysinit:/etc/rc.d/rc.sysinit
22
23 l0:0:wait:/etc/rc.d/rc 0
24 l1:1:wait:/etc/rc.d/rc 1
25 l2:2:wait:/etc/rc.d/rc 2
26 l3:3:wait:/etc/rc.d/rc 3
27 l4:4:wait:/etc/rc.d/rc 4
28 l5:5:wait:/etc/rc.d/rc 5
29 l6:6:wait:/etc/rc.d/rc 6
30
31 # Trap CTRL-ALT-DELETE
32 ca::ctrlaltdel:/sbin/shutdown -t3 -r now
33
34 # When our UPS tells us power has failed, assume we have a few minutes
35 # of power left. Schedule a shutdown for 2 minutes from now.
36 # This does, of course, assume you have powerd installed and your
37 # UPS connected and working correctly.
38 pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
39
40 # If power was restored before the shutdown kicked in, cancel it.
41 pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
42
43
44 # Run gettys in standard runlevels
45 1:2345:respawn:/sbin/mingetty ttySC1 115200 vt100
46 2:2345:respawn:/sbin/mingetty ttySC1 115200 vt100
47 3:2345:respawn:/sbin/mingetty ttySC1 115200 vt100
48 4:2345:respawn:/sbin/mingetty ttySC1 115200 vt100
49 5:2345:respawn:/sbin/mingetty ttySC1 115200 vt100
50 6:2345:respawn:/sbin/mingetty ttySC1 115200 vt100
51
52 # Run xdm in runlevel 5
53 x:5:respawn:/etc/X11/prefdm -nodaemon
リスト1の変更点は18行目でランレベルを1に変更し、
inittabでは/etc/
1 #! /bin/bash
2 #
3 # rc This file is responsible for starting/stopping
4 # services when the runlevel changes.
5 #
6 # Original Author:
7 # Miquel van Smoorenburg, >[email protected]<
8 #
9
10 /bin/mount -t proc proc /proc
11 /bin/mount -o rw,remount /
12 mke2fs -q /dev/ram1
13 mke2fs -q /dev/ram2
14 mount /dev/ram1 /tmp
15 mount /dev/ram2 /mnt
16 cp -a /initrd/dev/shmmc* /mnt
17 cp -a /dev/* /mnt
18 umount /mnt
19 mount /dev/ram2 /dev
20 umount /initrd
21 umount /proc
22 /bin/mount -a
23 mount -t devpts devpts /dev/pts
24
25 set -m
26
27 # check a file to be a correct runlevel script
28 check_runlevel ()
29 {
30 # Check if the file exists at all.
31 [ -x "$1" ] || return 1
32 is_ignored_file "$1" && return 1
33 return 0
34 }
35
36 # Now find out what the current and what the previous runlevel are.
37 argv1="$1"
38 set `/sbin/runlevel`
39 runlevel=$2
40 previous=$1
41 export runlevel previous
42
43 . /etc/init.d/functions
44
45 # See if we want to be in user confirmation mode
46 if [ "$previous" = "N" ]; then
47 if [ -f /var/run/confirm ]; then
48 echo $"Entering interactive startup"
49 else
50 echo $"Entering non-interactive startup"
51 fi
52 fi
53
54 # Get first argument. Set new runlevel to this argument.
55 [ -n "$argv1" ] && runlevel="$argv1"
56
57 # Is there an rc directory for this new runlevel?
58 [ -d /etc/rc$runlevel.d ] || exit 0
59
60 # First, run the KILL scripts.
61 for i in /etc/rc$runlevel.d/K* ; do
62 check_runlevel "$i" || continue
63
64 # Check if the subsystem is already up.
65 subsys=${i#/etc/rc$runlevel.d/K??}
66 [ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] \
67 || continue
68
69 # Bring the subsystem down.
70 if LC_ALL=C egrep -q "^..*init.d/functions" $i ; then
71 $i stop
72 else
73 action $"Stopping $subsys: " $i stop
74 fi
75 done
76
77 # Now run the START scripts.
78 for i in /etc/rc$runlevel.d/S* ; do
79 check_runlevel "$i" || continue
80
81 # Check if the subsystem is already up.
82 subsys=${i#/etc/rc$runlevel.d/S??}
83 [ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] \
84 && continue
85
86 # If we're in confirmation mode, get user confirmation
87 if [ -f /var/run/confirm ]; then
88 confirm $subsys
89 test $? = 1 && continue
90 fi
91
92 update_boot_stage "$subsys"
93 # Bring the subsystem up.
94 if [ "$subsys" = "halt" -o "$subsys" = "reboot" ]; then
95 export LC_ALL=C
96 exec $i start
97 fi
98 if LC_ALL=C egrep -q "^..*init.d/functions" $i \
99 || [ "$subsys" = "single" -o "$subsys" = "local" ]; then
100 $i start
101 else
102 action $"Starting $subsys: " $i start
103 fi
104 done
105 rm -f /var/run/confirm
106 if [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --ping ; then
107 /usr/bin/rhgb-client --quit
108 fi
追加部分はリスト2の10~23行目で、
Fedora Core 7の起動確認
今回はとりあえず起動するということでランレベル1で起動します。T-SH7706LSRでの起動方法は従来と同じ方法です。
今回の起動メッセージは以下のようになり、
Linux version 2.6.28.10 ([email protected]) (gcc version 3.4.5) #1 1 Boot params: ... MOUNT_ROOT_RDONLY - 00000001 ... RAMDISK_FLAGS - 0000c000 ... ORIG_ROOT_DEV - 00000200 ... LOADER_TYPE - 00000001 ... INITRD_START - 01037200 ... INITRD_SIZE - 0002dfe2 Booting machvec: SHMIN This is SH7706LAN board Ver 2.0 Node 0: start_pfn = 0xc000, low = 0xe000 Zone PFN ranges: Normal 0x0000c000 -< 0x0000e000 Movable zone start PFN for each node early_node_map[1] active PFN ranges 0: 0x0000c000 -< 0x0000e000 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128 Kernel command line: mem=32M console=ttySC1,115200 root=/dev/shmmc2 PID hash table entries: 128 (order: 7, 512 bytes) Using tmu for system timer Using 10.000 MHz high precision timer. Console: colour dummy device 80x25 Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Memory: 29268k/32768k available (1688k kernel code, 375k data, 100k init) SLUB: Genslabs=11, HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 Calibrating delay loop... 59.00 BogoMIPS (lpj=118016) Mount-cache hash table entries: 512 CPU: SH7706 net_namespace: 288 bytes NET: Registered protocol family 16 NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 1024 (order: 1, 8192 bytes) TCP bind hash table entries: 1024 (order: 0, 4096 bytes) TCP: Hash tables configured (established 1024 bind 1024) TCP reno registered NET: Registered protocol family 1 checking if image is initramfs...it isn't (no cpio magic); looks like an initrd Freeing initrd memory: 183k freed msgmni has been set to 57 Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253) io scheduler noop registered io scheduler anticipatory registered (default) SuperH SCI(F) driver initialized sh-sci: ttySC0 at MMIO 0xfffffe80 (irq = 25) is a sci sh-sci: ttySC1 at MMIO 0xa4000150 (irq = 59) is a scif console [ttySC1] enabled brd: module loaded loop: module loaded ne.c:v1.10 9/23/94 Donald Becker ([email protected]) Last modified Nov 1, 2000 by Paul Gortmaker NE*000 ethercard probe at 0x300:00:18:5f:00:09:cb eth0: NE2000 found at 0x300, using IRQ 34. Generic platform RAM MTD, (c) 2004 Simtec Electronics slram: not enough parameters. ftl_cs: FTL header not found. sh-rtc sh-rtc: rtc core: registered sh as rtc0 shmmc: MMC Reset OK. shmmc: SDHC Card blk_queue_max_sectors: set to minimum 8 shmmc: shmmc1 shmmc2 TCP cubic registered Initializing XFRM netlink socket NET: Registered protocol family 17 NET: Registered protocol family 15 sh-rtc sh-rtc: setting system clock to 2012-04-09 17:20:01 UTC (1333992001) RAMDISK: Compressed image found at block 0 EXT2-fs warning: checktime reached, running e2fsck is recommended VFS: Mounted root (ext2 filesystem). kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. VFS: Mounted root (ext3 filesystem) readonly. Trying to move old root to /initrd ... okay Freeing unused kernel memory: 100k freed modprobe: FATAL: Could not load /lib/modules/2.6.28.10/modules.dep: No such fily INIT: version 2.86 booting Welcome to Fedora Press 'I' to enter interactive startup. modprobe: FATAL: Could not load /lib/modules/2.6.28.10/modules.dep: No such fily modprobe: FATAL: Could not load /lib/modules/2.6.28.10/modules.dep: No such fily Cannot access the Hardware Clock via any known method. Use the --debug option to see the details of our search for an access method. Setting clock : Mon Apr 9 13:20:15 EDT 2012 [ OK ] Starting udev: MAKEDEV: no such group: fuse /sbin/start_udev: line 185: /proc/sys/kernel/hotplug: No such file or directory modprobe: FATAL: Could not load /lib/modules/2.6.28.10/modules.dep: No such fily udevd[72]: init_uevent_netlink_sock: bind failed: No such file or directory error initializing netlink socket udevd[72]: main: error initializing netlink socket Wait timeout. Will continue in the background.[FAILED] Setting hostname localhost: [ OK ] Checking filesystems Checking all file systems. [ OK ] Remounting root filesystem in read-write mode: [ OK ] Mounting local filesystems: mount: special device /dev/shmmc1 does not exist [FAILED] getgrnam failed for floppy getgrnam failed for video chgrp: invalid group `utmp' Enabling /etc/fstab swaps: [ OK ] INIT: Entering runlevel: 1 mount: proc already mounted Could not stat /dev/ram1 --- No such file or directory The device apparently does not exist; did you specify it correctly? Could not stat /dev/ram2 --- No such file or directory The device apparently does not exist; did you specify it correctly? modprobe: FATAL: Could not load /lib/modules/2.6.28.10/modules.dep: No such fily mount: you must specify the filesystem type modprobe: FATAL: Could not load /lib/modules/2.6.28.10/modules.dep: No such fily mount: you must specify the filesystem type cp: cannot create special file `/mnt/console': File exists cp: cannot create special file `/mnt/fuse': File exists cp: cannot create fifo `/mnt/initctl': File exists cp: cannot create special file `/mnt/loop0': File exists cp: cannot create special file `/mnt/loop1': File exists cp: cannot create special file `/mnt/loop2': File exists cp: cannot create special file `/mnt/loop3': File exists cp: cannot create special file `/mnt/loop4': File exists cp: cannot create special file `/mnt/loop5': File exists cp: cannot create special file `/mnt/loop6': File exists Telling INIT to go to single user mode. INIT: Going single user INIT: Sending processes the TERM signal sh-3.2#
起動時はudevの部分になるとシステムが固まったような印象を受けますが、
次回は
次回は引き続きFedora Coreの導入について解説します。