æºåãã
å¿ èŠãªãã®ïŒ
- USBãã©ãã·ã¥ãã©ã€ããŸãã¯SD / MMC / CF / ...ã¡ã¢ãªã«ãŒã
- åäœããLinuxã·ã¹ãã ãã§ããã°ã³ã³ãã€ã«çšã®å®å šãªã»ãããŸãã¯ããã±ãŒãžãããŒãžã£ãŒãå¿ èŠã§ãã
- åäœããããã«è¿œå ã®ã¢ãžã¥ãŒã«ãå¿ èŠãšããªãLinuxã«ãŒãã«
ã«ãŒãã«ã«é¢ããŠã¯ãå¿ èŠãªã¢ãžã¥ãŒã«ãã³ã³ãã€ã«ãããinitrdãµããŒããç¡å¹ã«ãªã£ãŠããã«ãŒãã«ã䜿çšããŠããŸãã ãã£ã¹ã¯ãæäœããããã«è¿œå ã®ã¢ãžã¥ãŒã«ãå¿ èŠãšããªãã«ãŒãã«ãæ¢ã«ããå Žåã¯ãããã䜿çšã§ããŸãã ãã®ãããªã«ãŒãã«ããªãå Žåã¯ã kernel.orgããã«ãŒãã«ãœãŒã¹ã³ãŒããããŠã³ããŒãããæåã§ãã«ãããŸãã ãã®èšäºã§ã¯ãã«ãŒãã«ã®æ§ç¯æ¹æ³ã«ã€ããŠã¯èª¬æããŸããã
ãã©ãã·ã¥ãã©ã€ãã/ dev / sdcã§ããããšã«åæããŸãããã
ããžãŒããã¯ã¹
ç§ã¯BusyBoxã䜿çšããããšãããã«èšããããšæããŸã-BusyBoxã¯ããããã«åãæšãŠãããæ©èœã§ã¯ãããŸãããä»ã®ãŠãŒãã£ãªãã£ã®éåžžã«å€§ããªã»ããã眮ãæãããŠãŒãã£ãªãã£ã§ãã ãã®çŠç¹ã¯ãå®è¡æ¹æ³ã«å¿ããŠããããã©ã®ããã«åäœãããã§ãã ããšãã°ãlnãšããååã§busyboxãžã®ã·ã³ããªãã¯ãªã³ã¯ãäœæãããšãlnã«ãªããŸãã ãªã³ã¯ã®ååãddã®å ŽåãddãååŸãããŸãã 1.5ã¡ã¬ãã€ãã®éã¿ãšäŸåé¢ä¿ãªã-ããã¯å¥è·¡ã§ãã
ãã©ã¡ãŒã¿ãŒãªãã§busyboxãèµ·åãããšã䜿çšäžã®ããŒãžã§ã³ã§äœ¿çšå¯èœãªãŠãŒãã£ãªãã£ã®ãªã¹ãã衚瀺ããããã®æ©èœã¯busyboxã«çœ®ãæããããšãã§ããŸãã ãµã€ãºãéåžžã«éèŠãªå Žåã¯ããœãŒã¹ããBusyBoxãæ§ç¯ããäžèŠãªæ©èœãç¡å¹ã«ããŠããã€ããªãã¡ã€ã«ã®ãµã€ãºãå°ããããããšãã§ããŸãã ãªããžããªããæ¢è£œã®ããã±ãŒãžã䜿çšããŸããã
ããã€ã¹ã®æºåïŒ
fdiskã䜿çšããŠãããã€ã¹ã®ãã©ãã·ã¥ãã©ã€ãã«1ã€ã®ããŒãã£ã·ã§ã³ãäœæããèµ·åå¯èœã«ããŸãã
fdisk /dev/sdc
ãŸãããã®ããã€ã¹äžã®ãã¹ãŠã®ããŒãã£ã·ã§ã³ãåé€ããŸã ã ã»ãšãã©ã®å Žåãã»ã¯ã·ã§ã³ã¯1ã€ã ããªã®ã§ãdã1åå ¥åããŸãã 次ã«ãæ°ãããã©ã€ããªããŒãã£ã·ã§ã³ãäœæããŸã ã n ã [Enter] ã p ã [Enter] ã 1 ã [Enter] ã [Enter] ã [Enter]ãæŒããŸãã ãã®ã»ã¯ã·ã§ã³ãèµ·åå¯èœã«ããŸã-ãå ¥åããŸãã ããã€ã¹ã«æ°ããããŒãã£ã·ã§ã³ããŒãã«ãæžã蟌ãã«ã¯ã wãæŒããŸãã
次ã«ããã©ãã·ã¥ãã©ã€ãã®æåã®ã»ã¯ã·ã§ã³ã«æ°ãããã¡ã€ã«ã·ã¹ãã ãäœæããŸãã ãã¡ã€ã«ã·ã¹ãã ãšããŠExt2ãéžæããŸãã-ãã®ãµããŒãã¯ã©ãã«ã§ãããããã®çš®ã®ã·ã¹ãã ã§ã®ãžã£ãŒããªã³ã°ã¯ããŸãæå³ããããŸããã Ext2ã§ããŒãã£ã·ã§ã³ããã©ãŒãããããã«ã¯ã次ã®ã³ãã³ããå®è¡ããŸãã
mke2fs -m 0 -N 2000 /dev/sdc1
-m 0ã¯ãã«ãŒãã¹ããŒã¹ã®äºçŽãç¡å¹ã«ããŸãïŒãããæå³ãããã®ã¯äœã§ãïŒ
-N 2000ã¯ååãªinodãæäŸããŸãã
ã·ã¹ãã ããŸãšãã
æ°ããããŒãã£ã·ã§ã³ãå¥ã®ãã£ã¬ã¯ããªïŒããšãã°ã/ newrootïŒã«ããŠã³ãããŸãã
mkdir /newroot
mount /dev/sdc1 /newroot
åLinuxãã£ã¹ããªãã¥ãŒã·ã§ã³ã«ã¯ãå¿ èŠãªãã£ã¬ã¯ããªã®ã»ããããããŸãã 次ã®ãã£ã¬ã¯ããªãäœæããŸãã
/bin
/boot
/dev
/etc
/proc
/sbin
/var
ãªãã·ã§ã³ã¯ã/ sysã/ libã/ varã/ mntã/ usrãããã³/ homeã§ããå¿ èŠã«å¿ããŠåŸã§äœæã§ããŸãã
/ dev
ãŸããå¿ èŠãªããã€ã¹ã/ devãã£ã¬ã¯ããªã«å ¥åããŸãã ãããã¯ãconsoleãkmemãmemãnullãram0ãtty1ã§ãã
cp -dpR /dev/DEVICE /newroot/dev
ã䜿çšããŠäœæ¥ã·ã¹ãã ããçŽæ¥ã³ããŒã
cp -dpR /dev/DEVICE /newroot/dev
ã¯äžèšã®åããã€ã¹ã§ãã -dpRãªãã·ã§ã³ã䜿çšãããšããã¡ã€ã«ã®å 容ã§ã¯ãªãããã¡ã€ã«èªäœãã³ããŒããããã¹ãŠã®ã¢ã¯ã»ã¹æš©ãä¿æãããŸãã ãã®æ¹æ³ãããªãã®å¥œã¿ã«åããªãå Žå-ããæéãããããŸãããããããããæ£ç¢ºã«ããããšãã§ããŸã-ls -lã䜿çšããŠåããã€ã¹ã®ã¡ã€ã³çªå·ãšäœãçªå·ãèŠã€ãã mknodã䜿çšããŠäœæããŸãã
åè¿°ã®å¿ èŠãªããã€ã¹ã«å ããŠãããŒããã£ã¹ã¯ããã€ã¹ïŒ hd *ããã³sd * ïŒãã³ããŒãã1ããŒã¹ã®ç«¯æ«ããã€ã¹ïŒ tty * ïŒãããã³ããŒããŸãã loop *ãå¿ èŠã«ãªãå ŽåããããŸã ã å¿ èŠã«å¿ããŠãæ®ãã®ããã€ã¹ãã¡ã€ã«ãã³ããŒããŸãã
/ãªã©
ãã®ãã£ã¬ã¯ããªã«ã¯ã·ã¹ãã èšå®ãå«ãŸããŠããå¿ èŠããããŸãã ããã§ã®å¿ é ãã¡ã€ã«ã¯ãrcïŒã·ã¹ãã ã«ãã£ãŠåŒã³åºãæ¹æ³ãç°ãªãïŒãinittabãfstabãpasswdãgroupãshadowã§ãã ã°ã«ãŒãã¯å¿ èŠãªããããããŸããããç§ã¯ããã確èªããããšããŸããã§ããã
ãããã®ãã¡ã€ã«ãæ°ããã·ã¹ãã ã«ã³ããŒãããã次ã®ãã¡ã€ã«ãç·šéããå¿ èŠããããŸãã
inittab- / bin / initã¯ãããèµ·åããŸãã ããŸããŸãªå®è¡ã¬ãã«ã§ã®ã·ã¹ãã ã®åäœã決å®ããŸãã
man inittab
inittabãã¡ã€ã«ã®ãšã³ããªã®åœ¢åŒã«ã€ããŠè©³ããèªãããšãã§ããŸãããéåžžã«éèŠãªç¹ããããŸãïŒæšæºã®inittabãšã¯ç°ãªããbusyboxã®ããŒãžã§ã³ã«ã¯idãã£ãŒã«ããšrunlevelãã£ãŒã«ããå«ããã¹ãã§ã¯ãããŸããã ç§ã®ããªããã£ããªinittabã¯æ¬¡ã®ããã«ãªããŸãã
ïŒ/ etc / inittab
:: sysinitïŒ/ etc / rc
ïŒã²ããã£ãçæãã
:: respawnïŒ/ sbin / getty -L 115200 tty1 vt100
::ãªã¹ããŒã³ïŒ/ sbin / getty -L 115200 tty2 vt100
::ãªã¹ããŒã³ïŒ/ sbin / getty -L 115200 tty3 vt100
:: respawnïŒ/ sbin / getty -L 115200 tty4 vt100
ïŒinitããã»ã¹ãåèµ·åãããšãã®äœæ¥
::åèµ·åïŒ/ sbin / init
ïŒåèµ·åããåã«ããã¹ãããš
:: ctrlaltdelïŒ/ sbin / reboot
fstab-ããã§ã¯ãã¹ãŠãéåžžéãã§ãã ã«ãŒãã·ã¹ãã ãšããŠãããŒããã©ã€ãã§ã¯ãªãããã©ãã·ã¥ãã©ã€ããšããŠæå®ããã ãã§ãã
passwdããã³shadow-ãããã®ãã¡ã€ã«ã«ã¯ãã«ãŒãã®ãšã³ããªã®ã¿ãæ®ãããŸãã æ®ãã¯å¿ èŠãããŸããã ããã«ãããã©ã«ãã®ããŒã ãã£ã¬ã¯ããªãšã³ãã³ãã©ã€ã³ã·ã§ã«ãå€æŽããããšãã§ããŸãã éåžžã/ bin / bashãŸãã¯/ bin / zshãã·ã§ã«ãšããŠæå®ãããŸãããbusyboxã«ã¯ããªããã£ããªshãããããŸããã ãã¡ããã誰ãã·ã³ããªãã¯ãªã³ã¯bashãäœæããããšãæ°ã«ããŸãã-> shã
rcã¯ãinittabã§æå®ãããããŒãã¹ã¯ãªããã§ãã ããã¯éåžžã«è€éã§ä»ã®rcãã¹ã¯ãªãããå«ãããšãã§ããŸãããåçŽãªã·ã¹ãã ã®å Žåã¯å€§å¹ ã«åçŽåã§ããŸãïŒç§ã®rcã®äŸïŒïŒ
ïŒïŒ/ bin / sh
ïŒæ£ããrc.confããããããã䜿çšã§ããå Žåã¯ã次ã®è¡ã®ã³ã¡ã³ããå€ããŸã
ïŒ/ etc / rc.conf
PS1 = [ã¬ã¹ãã¥ãŒã·ã¹ãã ]ïŒ
PATH = / sbinïŒ/ binïŒ/ usr / bin
/ bin / mount -av
/ bin / hostname localhost
/ãã³
Busyboxã¯ãã®ãã£ã¬ã¯ããªã«ã€ã³ã¹ããŒã«ãããŸãã ããã¯å€ãã®æ¹æ³ã§å®çŸã§ããŸãã ããšãã°ãæåã§ãã«ãããå Žåã¯ãæ§æäžã«--prefix = / newrootãè¿œå ããŸãã ããã±ãŒãžãããŒãžã£ã䜿çšããå Žåã¯ããã«ããèªãã§ãã ãããã€ã³ã¹ããŒã«ããããã±ãŒãžã®ã«ãŒããã£ã¬ã¯ããªãæå®ã§ãããªãã·ã§ã³ãå¿ èŠã§ãã ããšãã°ãArchLinuxã§ã¯ãpacmanã§ããã¯-rã¹ã€ããã§ãã
pacman -S busybox -r /newroot -b /var/lib/pacman
/ pacman pacmanã¯/ newrootå ã®ããã±ãŒãžããŒã¿ããŒã¹ãèŠã€ããããšãã§ããªãããã-bãªãã·ã§ã³ãå¿ èŠã§ãã
ã€ã³ã¹ããŒã«åŸã/ newroot / binãã£ã¬ã¯ããªã«ç§»åããŸãã busyboxãèµ·åããå¿ èŠãªçµã¿èŸŒã¿ãŠãŒãã£ãªãã£ãšäžèŠãªçµã¿èŸŒã¿ãŠãŒãã£ãªãã£ã決å®ããŸãã åãŠãŒãã£ãªãã£ã«ã€ããŠã察å¿ãããŠãŒãã£ãªãã£åã§busyboxãžã®ã·ã³ããªãã¯ãªã³ã¯ãäœæããŸãã äŸïŒ
ln -s ./busybox ./cdå¿ ãshãloginãmountãšããååã®ãªã³ã¯ãäœæããŠãã ããïŒ
/ sbin
ãã®ãã£ã¬ã¯ããªã«ç§»åããŠã.. / bin / busyboxãžã®å¿ èŠãªãªã³ã¯ãäœæããŸãã äžè¬ã«ããã®ã·ã¹ãã ã§ã¯2ã€ã®ãã£ã¬ã¯ããª-/ binãš/ sbin-ã«åããããšã¯ããŸãæå³ããããŸããããŠãŒã¶ãŒãšã«ãŒãã1人ããããªãããã§ãã
initãgettyãpoweroffãshutfownãrebootãhaltãšããååã®ãªã³ã¯ãäœæããŠãã ããïŒ
/ããŒã
ãã®ãã£ã¬ã¯ããªã«ãã«ãŒãã«ã®ã¿ãã³ããŒããvmlinuzãšããååãä»ããŸãã
GRUBãã€ã³ã¹ããŒã«ãã
GRUBããŒãããŒããŒã®ã€ã³ã¹ããŒã«ã¯ãgrub-installã³ãã³ãã䜿çšããŠè¡ããŸãã
grub-install --root-directory=/newroot /dev/sdc1
ã€ã³ã¹ããŒã«ãå®äºããããç°¡åãªGRUBã¡ãã¥ãŒãã¡ã€ã«ïŒ/boot/grub/menu.lstïŒãäœæããŸãã
ã¿ã€ãã«ããŒãã¬ã¹ãã¥ãŒblob
ã«ãŒãïŒhd0.0ïŒ
ã«ãŒãã«/ããŒã/ vmlinuz rootdelay = 6 root = / dev / sdc1 rw
ã«ãŒãè¡ã§ã¯ãããã€ã¹ã®å€æŽãå¿ èŠãªå ŽåããããŸãããEee PC 900ã§ã¯ãBIOSãéžæããŠã¡ã¢ãªã«ãŒãããèµ·åãããšãGRUBã¯ãã®ããã«å®çŸ©ããŸããã
ããã«ãrootdelayã¯éèŠãªãã©ã¡ãŒã¿ãŒã§ããããããªããšãã«ãŒãã«ã¯ã«ãŒããªãŒããŒããã€ã¹ãèŠã€ããããšãã§ããã次ã®ããã«åãåããŸããã
ã«ãŒãã«ãããã¯ïŒVFSïŒã«ãŒãfsã/ dev / sdcã«ããŠã³ãã§ããªã
ãããã«
ããã ãã§ãã ããã§ãåèµ·åããŠæ°ããã·ã¹ãã ãè©Šãããšãã§ããŸãã ãã¡ãããBusyBoxã䜿çšãããšãéåžžã«æ©èœçãªã·ã¹ãã ãååŸããå¯èœæ§ã¯äœããªããŸãããã·ã¹ãã ã¯çšŒåäžã®ã·ã¹ãã ã®ãµãŒãã¹ãšãã芳ç¹ããã¯å€ãã®èœåãçºæ®ããŸãã ããã«ãlive-OSã®ãã®ãªãã·ã§ã³ã¯ãã¡ã€ã«ã·ã¹ãã ã®å§çž®ã€ã¡ãŒãžã䜿çšããªããããã·ã¹ãã ã«å ãããã¹ãŠã®å€æŽã¯åèµ·ååŸãæ®ããŸãããã®ããã䜿çšäžã«ã¹ã¯ãªããã§æ©èœãå®å šã«è£å®ã§ããæ¥çžŸã倱ãããšãæããŸããã
ãã¡ãããæé©åã§ãããã®ã¯ãŸã ãããããããŸããç§ã¯åŸã ã«ãããè¡ããŸããããã£ã¹ã¯ããã¯ã¢ããã®äœæãšåŸ©å ã®åºæ¬çãªããŒãºã«åãããŠãã·ã¹ãã ã®æºåã¯æŽã£ãŠããŸãã
åç §ïŒ
ã«ãŒãã«ããŒãã³ãã³ãã©ã€ã³ãã©ã¡ãŒã¿ãŒã®ããã¥ã¡ã³ã ã å€ãLinuxããŒããã£ã¹ã¯äœæã¬ã€ã ã
ããã¯welinux.ruããã®ã¯ãã¹ãã¹ãã§ã