ãŸããæãéèŠãªããšã qemu-user 㯠ãã«ãŒãã«ã·ã¹ãã ã³ãŒã«ã®ã»ããå šäœããµããŒãããŠããŸãã ã ãããŠãããã¯ãœãããŠã§ã¢ã®äžéšïŒç¹ã«ãã¢ãã©ã«ïŒãæ©èœããªãããšãæå³ããŸãã ãã®åé¡ã¯ããã«ãšãã¥ã¬ãŒã·ã§ã³ã¢ãŒãã§ã¢ãŒã ã·ã¹ãã ããç°å¢ã«chrootããããšã§è§£æ±ºã§ããŸããããã€ã³ã1ãåç §ããŠãã ããã
äžè¬çã«ãæ²æšãªå ±æã§ã誰ã®æãæ¬æ Œçãªãããžã§ã¯ãã§ããã䜿çšãããšããã¢ã€ãã¢ãæèµ·ããã®ãããŸã£ããæ³åã§ããŸããã
ååãšããŠãããã€ã¹äžã§çŽæ¥ã³ã³ãã€ã«ã§ããŸãã ããããããã§åé¡ã¯busyboxãããã«ç«ã£ãŠãããšããããšã§ãããããšãŸã£ããåãdpkg-buildpackageã¯éåžžã«è²§åŒ±ãªå人ã§ãã ãããã£ãŠãããã€ã¹ããrootfsã転éããŠäœ¿çšããããšãããšããã®ã¬ãŒãã¯ã©ãã«ãæ¶ããŸããã ãããcoreutilsã«çœ®ãæããã®ã¯ããã»ã©ç°¡åã§ã¯ãããŸãããäŸåé¢ä¿ã®äžéšãå£ããããŒãã·ã¹ãã ããèœã¡ãããã§ãã
ãããŠäœããã¹ããïŒ ãããŠãç§ãã¡ã¯ä»ã®æ¹æ³ã§è¡ããŸãã ãã¥ã³ãããŠãŒã³ç·çµã®ç±çãªä¿¡è ãè£ ããããŒãã¹ãã©ããæé ã®æé«ã®äŒçµ±ïŒéŽã²ãã§èªåãæã¡äžããïŒã§ãã·ã¹ãã ãããã±ãŒãžãããŒãããã€ã³ã¹ããŒã«ããŸãã æ£ç¢ºã«ãã«ããã®äžã§èªãã§ãã ããã
å®éãDebianã«åºã¥ãããã£ã¹ããªãã¥ãŒã·ã§ã³ïŒAPTããã±ãŒãžç®¡çã·ã¹ãã ïŒãæã«å ¥ããŠããã®å¿èéšãåããå¿ èŠããããŸãã ãããŠãapt-getã®å©ããåããŠåããŠãä»ã®ãã¹ãŠãã€ã³ã¹ããŒã«ã§ããŸãã ãã ãããã®æäœã«ã¯dpkgãå¿ èŠã§ãã ãŸããdpkgãéå§ããã«ã¯ãå°ãªããšãããã€ãã®åºæ¬çãªç°å¢ãå¿ èŠã§ãã äžè¬çã«èšãã°ãéåžžã®ãã£ã¹ããªãã¥ãŒã·ã§ã³ã§ã¯ãdebootstrapã¯äœæã®å€§ãŸããªäœæ¥ãè¡ããŸãããMaemoçšã®ã¹ã¯ãªããã¯ãããŸããã ãã®ããããããè¡ãæãç°¡åãªæ¹æ³ã¯ãæã§è¡ãããšã§ãã
ãŸããã¡ã€ã³ã·ã¹ãã ã«ãã®dpkgãã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã Debianã«åºã¥ãããã®ããªããã°ãå¿é ããå¿ èŠã¯ãããŸãããdpkgã¯ã»ãšãã©ãã¹ãŠã®ãã£ã¹ããªãã¥ãŒã·ã§ã³ã®ãªããžããªã«ãããŸãã ããã«å ããŠãäœããã®æ¹æ³ã§ãã²ã¹ããã·ã¹ãã ã«chroot-goããå¿ èŠããããŸãã ãããã®ç®çã®ããã«ãqemu-userãŠãŒãã£ãªãã£ïŒäžèšã®ã¹ã¯ã©ããããã¯ã¹ã«ãã£ãŠå®¹èµŠãªãæªçšãããïŒããããŸããããã¯ãbinfmtã«ãŒãã«ã¢ãžã¥ãŒã«ã«ç¥ãããçŸåšã®ã«ãŒãã«ã§çŽæ¥ä»ã®ã¢ãŒããã¯ãã£ã®ãã€ããªãå®è¡ããããã»ããµããšãã¥ã¬ãŒãããã·ã¹ãã ã³ãŒã«ïŒsyscallïŒãé©åã«å€æããŸãã ã©ãã§ãããã±ãŒãžã®ååã¯ç°ãªããŸãããqemu-arm-staticãã¡ã€ã«ãšãå¿ èŠã«å¿ããŠæžã蟌ããã®ãå¿ èŠã§ãã Ubuntuã§ã¯ãå¿ èŠãªããã±ãŒãžã¯qemu-kvm-extras-staticãšåŒã°ããŸãã
ããã«ã8ã€ã®debããã±ãŒãžãååŸããå¿ èŠããããŸãã libc6ãgcc-4.2-baseãlibgcc1ãperl-baseãsysv-rcãdpkgãlibstdc ++ 6ããã³aptã ã¯ããã·ã¹ãã ããŒãããæã¡äžããã®ã«å¿ èŠãªããã±ãŒãžã¯8ã€ã ãã§ãã maemo.org/packagesãèŠããšãå®å šã«ããããå§çž®ã§ããŸãã ããããåãã€ããŠããŸãã 圌ããèšãããã«ããããã®ããã±ãŒãžã®å 容ã¯ãshãlnãrmãªã©ã®åºæ¬çãªãã®ããªããã°ãé¢éžããŸãããã ãããŠã圌ãã¯coreutilsã«æšªããã£ãŠããŸãã ãŸããcoreutilsããã®ããã«ã¯ã€ã³ã¹ããŒã«ããããããããçš®é¡ã®éããå¿ èŠã§ãã ã«ãªãæ¹æ³
åè¿°ã®busyboxãå©ãã«ãªããŸãã ããã«ãMaemoã®ããŒãžã§ã³ã¯ç§ãã¡ã«ãšã£ãŠèå³æ·±ããã®ã§ã¯ãªããã©ã€ãã©ãªãå¿ èŠã§ãã ãã®ãããports.ubuntu.comãèžã¿ãŸãïŒãŸãã¯ãå¿ èŠã«å¿ããŠdebian.orgã§ïŒãããããéçã«ãªã³ã¯ãããããžãã¹ããã¯ã¹ãå«ãããã±ãŒãžãåŒãåºããŸãã 圌ã¯éåžžãã«ãŒãã«ã·ã¹ãã ã³ãŒã«ã€ã³ã¿ãŒãã§ã€ã¹ä»¥å€ã¯å¿ èŠãããŸããã ãã®èªäœã dpkg -xã䜿çšããŠããã±ãŒãžã解æããããããç®çã®å®è¡å¯èœãã¡ã€ã«ãåŒãåºããŸãã
ããŠãããã§ãã¹ãŠã®æºåãæŽããŸããã次ã«é²ãããšãã§ããŸãã
æåã«ãå°æ¥ã®ã·ã¹ãã çšã®ãã£ã¬ã¯ããªãäœæããããã«qemuãããããããŸãïŒchrootã«ãªããããå éšã«ããå¿ èŠããããŸããããããªããšãå¥è·¡ã¯æ©èœããŸããïŒã
mkdir -p root / usr / bin
cp / usr / bin / qemu-arm-static root / usr / bin
ä»ãç§ãã¡ã¯biziboksaã®ã³ããŒã/ãã³ã«æã蟌ã¿ãŸãã coreutilsããã³ãã®ä»ã®ããã±ãŒãžã®ãŠãŒãã£ãªãã£ã¯ãããã䜿çšããŸãããä»ã§ã¯éèŠã§ãã
mkdir -p root / bin
cp busybox root / bin / sh
cp busybox root / bin / ln
cp busybox root / bin / touch
cp busybox root / bin / chmod
cp busybox root / bin / chown
cp busybox root / bin / cp
cp busybox root / bin / tar
cp busybox root / bin / rm
cp busybox root / bin / gzip
cp busybox root / bin / grep
ããã§ãæå°éã®ãã£ã¬ã¯ããªã»ãããäœæããå¿ èŠããããŸããããããªããšãã¡ã€ã³ã·ã¹ãã ã®dpkgã¯ãã²ã¹ããã«å¯ŸããŠäœãã§ããŸããã
mkdir root / etc
mkdir -p root / var / lib / dpkg
mkdir root / var / lib / dpkg / tmp.ci
mkdir root / var / lib / dpkg /ã¢ããããŒã
mkdir root / var / lib / dpkg / info
mkdir -p root / var / log
mkdir -p root / dev / pts
ã¿ããã«ãŒã/ var / lib / dpkg / status
touch root / var / lib / dpkg / available
ã«ãŒã/ etc / ld.so.confã«è§ŠããŸã
mkdir / var / backups
/var/backups/infodir.bakãã¿ããããŸã
ä»ããããã±ãŒãžã眮ãæ¹æ³ã¯ïŒ ã¯ããç°¡åã§ãã Dpkgã«ã¯--rootãã©ã¡ãŒã¿ãŒããããæå®ããããã£ã¬ã¯ããªãã«ãŒããšèŠãªããŠæ©èœããŸãã ãšãŠãå©ãããŸããã äžè¬ã«ã圌ã¯ã¢ãŒããã¯ãã£ã®äžäžèŽãèªãå¿ èŠããããŸãïŒããã«ã¡ã€ã³ã·ã¹ãã ãARMã«ãªãã®ã§ããïŒïŒãããšãã°--force-architecture
export DPKG = "dpkg --force-architecture --root = root -iâ
$ DPKGããã±ãŒãž/ libc6_2.5.1-1eglibc27 + 0m5_armel.deb
$ DPKGããã±ãŒãž/ gcc-4.2-base_4.2.1-4maemo13 + 0m5_armel.deb
$ DPKGããã±ãŒãž/ libgcc1_4.2.1-4maemo13 + 0m5_armel.deb
$ DPKGããã±ãŒãž/ perl-base.deb
$ DPKGããã±ãŒãž/ dpkg_1.14.25maemo3 + 0m5_armel.deb
$ DPKGããã±ãŒãž/ sysv-rc_2.85-22.osso15_all.deb
çè«çã«ã¯ã圌ã¯ãã¹ãŠãæåããããšãå ±åããå¿ èŠããããŸãã ããã€ãã®ããã±ãŒãžãã€ã³ã¹ããŒã«ãããšãã«å¿ èŠã«ãªããããããã§ã²ã¹ãã«/ dev / ptsãããŠã³ãããŸãã
ããŠã³ã--bind / dev / pts root / dev / pts
ã§ããããšã¯ãchroot root / bin / shã ãã§ãã ããã§ãæ°ããäœæãããã·ã¹ãã ã«ãªããŸããã ããã§ã¯ãŸã 空ã§ãããå®éã«ã¯äœãæ©èœããŸããã 次ã«ãAPTãã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã 以åã«ã³ããŒããæ®ãã®2ã€ã®ããã±ãŒãžã«ãã·ã¹ãã ã«ãã§ã«ååšããdpkgãèšå®ããŸãã ãŸãããã±ãŒã«ããŸã èšå®ããŠããªãããããã±ãŒã«ãCã«èšå®ããŸãã
ãšã¯ã¹ããŒãLC_ALL = C
dpkg -i libstdc ++ 6_4.2.1-4maemo13 + 0m5_armel.deb
dpkg -i apt_0.7.20.2maemo13.1 + 0m5_armel.deb
次ã«ãresolv.confã«DNSãç»é²ããŸãã ç§ã¯éåžž8.8.8.8ãå ¥ããŸãããããã¯çã®ããã§ã¯ãããŸããã ãŸããsources.listã次ã®åœ¢åŒã«ããŸãã
deb http_ïŒ//repository.maemo.org/extras/ fremantle-1.3 free non-free
deb http_ïŒ//repository.maemo.org/extras-testing/ fremantle-1.3 free non-free
deb http_ïŒ//repository.maemo.org/extras-devel/ fremantle-1.3 free non-free
deb http_ïŒ//repository.maemo.org/ fremantle / sdk free non-free
apt-get update
apt-get --allow-unauthenticated -y install apt-transport-https coreutils tar build-essential gzip grep bash aptitude libgtk2.0-dev
apt-get clean
apt-getãããã±ãŒãžããã°ããããŠã³ããŒãããŠã€ã³ã¹ããŒã«ããéãç§ãã¡ã¯åº§ã£ãŠåŸ ã¡ãŸãã resolv.confãäžæžããããã©ãããå°ãããããããã©ã¬ã¹ããéä¿¡ããŸãã åºåã§ã¯ãã³ã³ãã¯ããªç°å¢ïŒçŽ200ã¡ã¬ãã€ããäžè¬ã«ãããã¯ãŒã¯ããçŽ60ãã³ãã§æåºïŒãåŸãããããã«ããããçš®é¡ã®éããå®å šã«chrootããŠã³ã³ãã€ã«ã§ããŸãã ãããŠãScratchboxã®ç°ãªãæ²ç·ã䜿çšããã«ããããã¹ãŠãå®è¡ã§ããŸãã ã§ããããšã¯Xephirã䜿çšããããšã ãã§ãããããŒããŠã§ã¢ãããã°ã«å€å°ãªããšãè¿ã¥ããŠããŸãã å¿ èŠã«å¿ããŠãåãã·ã¹ãã ãi386ããŒãžã§ã³ã«ãããã€ã§ããŸããããã»ã¹ã«éãã¯ãããŸããããXãµãŒããŒãéžæããã¯ãã§ãã
äžèšã®æé ã®åŸãææè ïŒç¹ã«ãOpenGLã©ã€ãã©ãªã§ã¯ãªããQtãã€ã³ã¹ããŒã«ãããŠããªãïŒã«ã¢ã¯ã»ã¹ããããã«ã ããã«è¡ãå¿ èŠãããå ŽåããããŸãã ãšããã§ãnokia-binariesãšnokia-appsã¯aptitudeãä»ããŠã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã apt-getã¯äœããã®çç±ã§äŸåé¢ä¿ã解決ã§ããŸããã
qemu-userã¢ãŒãã§ã¯ãäžéšã®ãœãããŠã§ã¢ã»ãããæ©èœããªãããšãæãåºããŸãã qemu-arm-systemã䜿çšããŠãARMã§ã¢ã»ã³ãã«ãããéåžžã®Linuxã®ã€ã¡ãŒãžã«å¯ŸããŠèšå®ããããããchrootãå®è¡ããããšã匷ããå§ãããŸãã ubuntaã®ã€ã¡ãŒãžã¯ã ãã®ããã¥ã¢ã«ã§ããã§äœæã§ããŸããè€éãªããšã¯äœããããŸããã ããããéåžžã®GCCã§ã¯ãqemu-userã§ååã§ãã
ãæž èŽããããšãããããŸãããããã«äŒããŸãããã
ããã±ãŒãžãšã€ã³ã¹ããŒã©ãŒã¹ã¯ãªããã§ã¢ãŒã«ã€ããã