ü1ÀŽÀŽØŽÐ¼|¾|¿¹æó¤éŠ1ö»¾±8/tu…öuq‰Þ€Ãâï…öuÍ€ú€r Š6u€Æ€8òrŠ‰çŠt‹L»|ö½€t-QS»ªU´AÍr ûUªuöÁt[fjfÿtSjj‰æ¸Bë[Y¸Í‰ür¿þUªu ÿã¾¹ë¾Ñë ¾ð뻴ͬ„ÀuôëþInvalid partition tableError loading operating systemMissing operating system€==ƒ-€¥=4À-`f5=: ”À-Uªëvu4,294,967,296 ƒoƒCƒg (4.0G)v) ‚ÍAŽÀÛ‚É‚¨Žg‚¢‚̃n[ƒh ƒfƒBƒXƒN‚Ìî•ñ‚ª•\Ž¦‚³‚ê‚Ü‚·B +---------------- ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx ----------------+ | šƒƒCƒ“ƒƒjƒ…[š | | Œ»Ý‘I‘𒆂̃fƒBƒXƒN‚Í /dev/ad0 ‚Å‚·B | | ƒfƒBƒXƒN‚Ì—e—Ê‚Í 4,294,967,296 ƒoƒCƒg (4.0G) ‚Å‚·B | | ˆÈ‰º‚̃ƒjƒ…[‚©‚爗‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢B | | | | +------------------------------------------------------------------+ | | | z 0‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· | | | | h ‘€ì•û–@‚ÌŠT—v‚ð•\Ž¦‚·‚é | | | | n •¡”‰ñã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ð”O“ü‚è‚ÉÁ‚· | | | | m ”O“ü‚èÁ‹Ž‚Ìã‘‚«•û–@‚ð‘I‘ð‚·‚é | | | | v ƒf[ƒ^‚ªÁ‹Ž‚³‚ꂽ‚©Šm”F‚·‚é (‚‘¬^ˆê•”‚ðƒ`ƒFƒbƒN) | | | | V ƒf[ƒ^‚ªÁ‹Ž‚³‚ꂽ‚©Šm”F‚·‚é (’Êí^‘S•”‚ðƒ`ƒFƒbƒN) | | | | w Á‹ŽƒƒO‚ðƒfƒBƒXƒN‚É‘‚«ž‚Þ | | | | L “®ì‹L˜^‚ðƒtƒƒbƒs[‚É‘‚«o‚· | | | +-----v(+)---------------------------------------------------------+ | | | +----------------------------------------------------------------------+ | [ OK ] Cancel | +----------------------------------------------------------------------+ ‚±‚±‚ÅAƒn[ƒhƒfƒBƒXƒN‚Ì–¼‘O‚â—e—Ê‚ªAƒf[ƒ^‚ðÁ‹Ž‚µ‚½‚¢ƒn[ƒh ƒfƒBƒXƒN‚Ì‚à‚Ì‚Å‚ ‚é‚©‚Ç‚¤‚©‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢B‚»‚̃n[ƒhƒfƒBƒX ƒN‚̃f[ƒ^‚ðÁ‹Ž‚·‚éꇂÍAu0‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ ƒ^‚ðÁ‚·v‚ªƒnƒCƒ‰ƒCƒg‚³‚ê‚Ä‚¢‚éó‘ԂŃGƒ“ƒ^[ƒL[‚ð‰Ÿ‚µ‚Ä‚­‚¾‚³ ‚¢ (ˆÈ‰ºA‚±‚Ì‘€ì‚ðu‘I‘ð‚·‚év‚ÆÌ‚µ‚Ü‚·)B ã‚̃ƒjƒ…[‚Åu0‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚·v‚ð ‘I‘ð‚·‚é‚ÆAŽŸ‚̂悤‚ÉŠm”FƒƒbƒZ[ƒW‚ª•\Ž¦‚³‚ê‚Ü‚·B ƒfƒBƒXƒN ad0 ‚Ì ‘Sƒf[ƒ^ 4,294,967,296 ƒoƒCƒg‚ðA 0‚Åã‘‚«‚µ‚ÄÁ‹Ž‚µ‚Ü‚·B ‚æ‚낵‚¢‚Å‚·‚©? [ Yes ] No ƒf[ƒ^‚ðÁ‹Ž‚·‚éꇂÍA‚±‚±‚ÅuYesv‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢BuYesv ‚ð‘I‘ð‚·‚é‚ÆA‚³‚ç‚É‚µ‚‚±‚­AˆÈ‰º‚ÌŠm”FƒƒbƒZ[ƒW‚ª•\Ž¦‚³‚ê‚Ü‚·B –{“–‚Éad0 (4.0G) ‚̃f[ƒ^‚ðÁ‹Ž‚µ‚Ä‚¢‚¢‚Å‚·‚©? [ Yes ] No ƒf[ƒ^‚ðÁ‹Ž‚·‚éꇂÍAÄ“xuYesv‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢BuNov ‚ð‘I‘ð‚·‚é‚Æʼn‚̃ƒjƒ…[‚É–ß‚è‚Ü‚·BuYesv‚ð‘I‘ð‚·‚é‚ƃf[ƒ^ ‚ÌÁ‹Ž‚ªŽn‚Ü‚è‚Ü‚·B ƒf[ƒ^‚ÌÁ‹Ž’†‚ÍAŽŸ‚̂悤‚Éi’»ó‹µ‚ª•\Ž¦‚³‚ê‚Ü‚·B ƒfƒBƒXƒN ad1 ‚̃f[ƒ^‚ðÁ‹Ž‚µ‚Ä‚¢‚Ü‚·B 25% (1024/4096) I—¹ ^ 21•b Œo‰ß Žc‚è ‚¨‚æ‚»128•b 0%|############______________________________________|100% ‰æ–Ê‚Ìʼnºs‚É‚ÍAŽŸ‚̂悤‚É‘‚«ž‚Ý‘¬“x‚ª•\Ž¦‚³‚ê‚Ü‚·B 33554432 bytes transferred in 1.307584 secs (25661396 bytes/sec) ƒf[ƒ^‚ÌÁ‹Ž‚É—v‚·‚鎞ŠÔ‚ÍA‚¨Žg‚¢‚̃n[ƒhƒfƒBƒXƒN‚Ì—e—Ê‚âƒpƒ\ ƒRƒ“‚É‚æ‚Á‚ĈقȂè‚Ü‚·Bƒn[ƒhƒfƒBƒXƒN‚Ì—e—Ê‚ª¬‚³‚­Aƒpƒ\ƒRƒ“‚Ì ˆ—‘¬“x‚ª‘¬‚¯‚ê‚ÎAÁ‹Ž‚É—v‚·‚鎞ŠÔ‚Í’Z‚­‚È‚è‚Ü‚·B ƒf[ƒ^‚ÌÁ‹Ž‚ªI‚í‚é‚ÆA ƒfƒBƒXƒN‚̃f[ƒ^Á‹Ž‚ªI—¹‚µ‚Ü‚µ‚½ (2•ª30•b) [OK] ‚Æ‚¢‚¤ƒƒbƒZ[ƒW‚ª•\Ž¦‚³‚ê‚Ü‚·B‚±‚±‚ÅAƒGƒ“ƒ^[ƒL[‚ð‰Ÿ‚·‚ÆAÅ ‰‚̃ƒjƒ…[‚É–ß‚è‚Ü‚·B œ‘€ì•û–@‚ɂ‚¢‚Ä ƒƒCƒ“ƒƒjƒ…[‚©‚çu‘€ì•û–@‚ÌŠT—v‚ð•\Ž¦‚·‚év‚ð‘I‘ð‚·‚é‚ÆAŠÈ ’P‚È‘€ì•û–@‚Ìà–¾‚ª•\Ž¦‚³‚ê‚Ü‚·B œÁ‹ŽˆÈŠO‚Ì‘€ì‚ɂ‚¢‚Ä ƒƒCƒ“ƒƒjƒ…[‚Å㉺ƒJ[ƒ\ƒ‹ƒL[‚ð‰Ÿ‚·‚ÆA•Ê‚Ì€–Ú‚ðƒnƒCƒ‰ƒCƒg ‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·BƒƒCƒ“ƒƒjƒ…[‚É‚Í8‚‚̑I‘ðŽˆ‚µ‚©•\Ž¦‚³‚ê‚Ä ‚¢‚Ü‚¹‚ñ‚ªA㉺ƒJ[ƒ\ƒ‹ƒL[‚ð‰Ÿ‚·‚ƃXƒNƒ[ƒ‹‚É‚æ‚èAŠeŽí‘€ìƒ ƒjƒ…[‚ª•\Ž¦‚³‚ê‚Ü‚·Buƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outxv‚Å ‚ÍAƒf[ƒ^Á‹ŽˆÈŠO‚É‚àAÁ‹Ž‚³‚ê‚Ä‚¢‚é‚©‚Ç‚¤‚©‚ÌŠm”FA“®ì‹L˜^‚Ì ‘‚«ž‚ÝAƒn[ƒhƒfƒBƒXƒN‚̃Rƒs[AƒVƒFƒ‹‚Ì‹N“®AÄ‹N“®AƒVƒƒƒbƒg ƒ_ƒEƒ“‚È‚Ç‚Ì‘€ìƒƒjƒ…[‚ª—pˆÓ‚³‚ê‚Ä‚¢‚Ü‚·BˆÈ‰º‚ɃƒCƒ“ƒƒjƒ…[ ‚©‚ç‘I‘ð‚Å‚«‚é‘€ì‚̈ꗗ‚ðŽ¦‚µ‚Ü‚·B E0‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· E‘€ì•û–@‚ÌŠT—v‚ð•\Ž¦‚·‚é E•¡”‰ñã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ð”O“ü‚è‚ÉÁ‚· E”O“ü‚èÁ‹Ž‚Ìã‘‚«•û–@‚ð‘I‘ð‚·‚é Eƒf[ƒ^‚ªÁ‹Ž‚³‚ꂽ‚©Šm”F‚·‚éi‚‘¬^ˆê•”‚ðƒ`ƒFƒbƒNj Eƒf[ƒ^‚ªÁ‹Ž‚³‚ꂽ‚©Šm”F‚·‚éi’Êí^‘S•”‚ðƒ`ƒFƒbƒNj EÁ‹ŽƒƒO‚ðƒfƒBƒXƒN‚É‘‚«ž‚Þ E“®ì‹L˜^‚ðƒtƒƒbƒs[‚É‘‚«o‚· E•Ê‚̃fƒBƒXƒN‚ð‘I‘ð‚·‚é EƒfƒBƒXƒN‚̃f[ƒ^‚ð•\Ž¦‚·‚é Eƒf[ƒ^‚ð•\Ž¦‚·‚éƒZƒNƒ^‚ÌŽw’è Euwwipe-outx‚ɂ‚¢‚Äv‚ðŒ©‚é E‹N“®Žž‚̃VƒXƒeƒ€ƒƒbƒZ[ƒW‚ðŠm”F‚·‚é EƒfƒBƒXƒN‚ðƒRƒs[‚·‚éi‚‘¬^ƒoƒbƒNƒAƒbƒvŒü‚¯j EƒfƒBƒXƒN‚ðƒRƒs[‚·‚éi’ᑬ^ƒf[ƒ^ƒTƒ‹ƒx[ƒWŒü‚¯j E1‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· Eƒ‰ƒ“ƒ_ƒ€ƒpƒ^[ƒ“‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· Eƒpƒ^[ƒ“‚̕│ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· Eƒ‰ƒ“ƒ_ƒ€ƒf[ƒ^‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· E“®ì‹L˜^‚ð•\Ž¦‚·‚é EƒfƒBƒXƒN‚ÌŽ©ŒÈf’fî•ñ (SMARTî•ñ) ‚ð•\Ž¦‚·‚é EƒVƒFƒ‹ishj‚ð‹N“®‚·‚é EƒVƒFƒ‹icshj‚ð‹N“®‚·‚é ECD-ROM‚ðmount‚·‚é ECD-ROM‚ðumount‚·‚é EMBR *‚Ì‚Ý* ‚ðÁ‹Ž‚·‚é EƒVƒƒƒbƒgƒ_ƒEƒ“‚·‚é EÄ‹N“®‚·‚é œ‘Ήž‹@Ží‚ɂ‚¢‚Ä E–{ƒc[ƒ‹‚ÍAFreeBSD/i386‚ª“®ì‚·‚éƒRƒ“ƒsƒ…[ƒ^‚Å—˜—p‚Å‚«‚Ü‚·B E–{ƒc[ƒ‹‚Ńf[ƒ^‚ðÁ‹Ž‚Å‚«‚éƒXƒgƒŒ[ƒWƒfƒoƒCƒX‚ÍŽŸ‚Ì‚Æ‚¨‚è‚Å‚·B EFreeBSD‚̃J[ƒlƒ‹ (ƒCƒ“ƒXƒg[ƒ‹—pCD‚̃J[ƒlƒ‹) ‚ňµ‚¦‚é‚à ‚Ì‚Ì‚¤‚¿AˆÈ‰º‚ÌðŒ‚ð–ž‚½‚·‚à‚Ì EATAƒfƒBƒXƒNƒRƒ“ƒgƒ[ƒ‰ƒhƒ‰ƒCƒo (ada(4)) ‚ňµ‚¦‚é‚à‚Ì Eˆê”Ê“I‚ÈS-ATA/P-ATAƒCƒ“ƒ^[ƒtƒFƒCƒX‚̃n[ƒhƒfƒBƒXƒN E“¯ASSDƒhƒ‰ƒCƒu ESCSIƒ_ƒCƒŒƒNƒgƒAƒNƒZƒXƒfƒoƒCƒXƒhƒ‰ƒCƒo (da(4)) ‚ňµ‚¦ ‚é‚à‚Ì Eˆê”Ê“I‚ÈSCSIƒCƒ“ƒ^[ƒtƒFƒCƒX‚̃n[ƒhƒfƒBƒXƒN EFreeBSD‚ňµ‚¦‚éRAIDƒRƒ“ƒgƒ[ƒ‰ (asr(4)) ‚È‚Ç‚ÉÚ‘± ‚³‚ꂽƒn[ƒhƒfƒBƒXƒN EUSBƒƒ‚ƒŠƒJ[ƒhƒAƒ_ƒvƒ^‚ÉÚ‘±‚µ‚½ŠeŽíƒƒ‚ƒŠƒJ[ƒh‚âA USBƒtƒ‰ƒbƒVƒ…ƒƒ‚ƒŠ‚È‚Ç‚ÌUSB‘å—e—ʃXƒgƒŒ[ƒW ¦ada(4), da(4), asr(4) ‚È‚Ç‚ÌÚׂɂ‚¢‚Ä‚ÍAFreeBSD‚̃}ƒjƒ…ƒA ƒ‹ƒy[ƒW‚È‚Ç‚ð‚²——‚­‚¾‚³‚¢B œ“®ì‚Ì‹L˜^‚Ì•Û‘¶‚ɂ‚¢‚Ä uƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outxv‚Å‚ÍA“®ì‚Ì‹L˜^‚ð•Û‘¶ ‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B•Û‘¶‰Â”\‚ȃƒfƒBƒA‚̓tƒƒbƒs[ƒfƒBƒXƒN‚âUSB ƒƒ‚ƒŠ‚È‚Ç‚Å‚·B“®ì‚Ì‹L˜^‚ð•Û‘¶‚·‚郃fƒBƒA (ƒtƒƒbƒs[‚âUSBƒ ƒ‚ƒŠ) ‚ÍA‚ ‚ç‚©‚¶‚ßFATƒtƒH[ƒ}ƒbƒg‚ðs‚¢AuWIPE-OUTv‚Æ‚¢‚¤–¼ ‘O‚̃tƒHƒ‹ƒ_‚ðƒ‹[ƒgƒfƒBƒŒƒNƒgƒŠ‚É쬂µ‚Ä‚¨‚¢‚Ä‚­‚¾‚³‚¢B œ‚¨‚±‚Æ‚í‚è E–{ƒc[ƒ‹‚ÍAOS‚Æ‚µ‚ÄFreeBSD‚ð—˜—p‚µ‚Ä‚¢‚Ü‚·B E–{ƒc[ƒ‹‚̓tƒŠ[ƒEƒFƒA‚Å‚·B’˜ìŒ ‚ÍAìŽÒ‚Å‚ ‚é ‚¢‚µ‚¶‚Ü™‚¾‚¢ ‚ª•Û—L‚µ‚Ä‚¢‚Ü‚·B E–{ƒc[ƒ‹‚ð—˜—p‚µ‚½A‚ ‚é‚¢‚Í—˜—p‚µ‚È‚©‚Á‚½‚±‚Æ‚É‚æ‚Á‚Ķ‚¶‚½ ‚¢‚©‚Ȃ錋‰Ê‚ɂ‚¢‚Ä‚àAìŽÒ‚ÍÓ”C‚ðˆêØ•‰‚¢‚Ü‚¹‚ñB œŽQl•¶Œ£ EŽÐ’c–@l “dŽqî•ñ‹ZpŽY‹Æ‹¦‰ï (http://www.jeita.or.jp/japanese/index.htm) uƒpƒ\ƒRƒ“‚Ì”pŠüE÷“nŽž‚É‚¨‚¯‚éƒn[ƒhƒfƒBƒXƒNã‚̃f[ƒ^Á‹Ž ‚ÉŠÖ‚·‚é—¯ˆÓŽ–€v(http://it.jeita.or.jp/perinfo/committee/ pc/JEITA_HDDdata100219F.pdf) œ–{ƒc[ƒ‹‚Ì“üŽè•û–@ –{ƒc[ƒ‹‚¨‚æ‚ÑŽo–…•i‚ÍAìŽÒ‚̃EƒFƒuƒTƒCƒg‚ÅŒöŠJ‚µ‚Ä‚¢‚Ü‚·BƒA ƒhƒŒƒX‚Í http://hp.vector.co.jp/authors/VA004814/ ‚Å‚·B•K—v‚ɉž ‚¶‚ă_ƒEƒ“ƒ[ƒh‚µ‚Ä‚­‚¾‚³‚¢B ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹uwipe-outvv2.2 Copyright (C) 2022 by Dai ISHIJIMA WIPE-OUT-22T_998 (2022-11-20) . ’»JtUtU»JtU .. ’»JtUtU»JtUArcÿÿÿÿNÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRC •»JtUtU»JtU EAstartíup.shÿÿÿÿSTARTUP SH •»JtUtU»JtU š Amainm˜enu.shÿÿMAINMENUSH •»JtUtU»JtU  2Aseldi“sk.shÿÿÿÿSELDISK SH •»JtUtU»JtU{AeraseU.shÿÿÿÿÿÿÿÿERASE SH •»JtUtU»JtU×!Afine-Äerase.shFINE-E~1SH •»JtUtU»JtUÿ'Asel-fÕine.shÿÿSEL-FINESH •»JtUtU»JtU Averif×y.shÿÿÿÿÿÿVERIFY SH •»JtUtU»JtU€Adump.shÿÿÿÿÿÿÿÿÿÿDUMP SH •»JtUtU»JtU(Awrite¹log.shÿÿWRITELOGSH •»JtUtU»JtUÛ Acopy.ûshÿÿÿÿÿÿÿÿÿÿCOPY SH •»JtUtU»JtUA!Aembr.nshÿÿÿÿÿÿÿÿÿÿEMBR SH –»JtUtU»JtU # Acrlf.rshÿÿÿÿÿÿÿÿÿÿCRLF SH –»JtUtU»JtU!AfloppAylog.shFLOPPY~1SH –»JtUtU»JtU"ôAdummyread.shDUMMYR~1SH –»JtUtU»JtU$Akon2s³tart.shKON2ST~1SH –»JtUtU»JtU%¹ Akon2aölt.shÿÿÿÿKON2ALT SH –»JtUtU»JtU&^Avtsta,rt.shÿÿÿÿVTSTART SH –»JtUtU»JtU'. Asanitize.shÿÿSANITIZESH –»JtUtU»JtU((Aalt-m¬enu.shÿÿALT-MENUSH –»JtUtU»JtU*Ê Ascsavÿer.shÿÿÿÿSCSAVER SH –»JtUtU»JtU+éBhÿÿÿÿÿÿ&ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿatase&curity.sATASEC~1SH –»JtUtU»JtU,÷Awaitsôecure.shWAITSE~1SH –»JtUtU»JtU.›AchimeÈ.shÿÿÿÿÿÿÿÿCHIME SH –»JtUtU»JtU/­AtimerÙ.shÿÿÿÿÿÿÿÿTIMER SH –»JtUtU»JtU0ÑApoko.shÿÿÿÿÿÿÿÿÿÿPOKO SH —»JtUtU»JtU1²Alogdehv.shÿÿÿÿÿÿLOGDEV SH —»JtUtU»JtU2jBshÿÿÿÿÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshow-Ûelapsed.SHOW-E~1SH —»JtUtU»JtU3îAncoun­tdown.shNCOUNT~1SH —»JtUtU»JtU44Ainfo.ØtxtÿÿÿÿÿÿÿÿINFO TXT —»JtUtU»JtU5_Areadmse.txtÿÿÿÿREADME TXT —»JtUtU»JtU6# Ahelp.½txtÿÿÿÿÿÿÿÿHELP TXT —»JtUtU»JtU9 Amani.ltxtÿÿÿÿÿÿÿÿMANI TXT —»JtUtU»JtU:`Atermc·apÿÿÿÿÿÿÿÿÿÿTERMCAP —»JtUtU»JtU;Adiskseize.cÿÿÿÿDISKSIZEC —»JtUtU»JtU=+Astuff¼.cÿÿÿÿÿÿÿÿÿÿSTUFF C —»JtUtU»JtU?ÙAtinyd#ate.cÿÿÿÿTINYDATEC —»JtUtU»JtUA!AtinydUump.cÿÿÿÿTINYDUMPC —»JtUtU»JtUBïAcheck°.cÿÿÿÿÿÿÿÿÿÿCHECK C ˜»JtUtU»JtUCƒ Amakemñbr.cÿÿÿÿÿÿMAKEMBR C ˜»JtUtU»JtUD[Awpoutp-mbr.sÿÿWPOUT-~1S ˜»JtUtU»JtUEA Ashell-on.cÿÿÿÿSHELL-ONC ˜»JtUtU»JtUFVAtread.cÿÿÿÿÿÿÿÿÿÿTREAD C ˜»JtUtU»JtUG Asessi²on.cÿÿÿÿÿÿSESSION C ˜»JtUtU»JtUH•#! /bin/sh # # rc -- ƒXƒ^[ƒgƒAƒbƒvƒXƒNƒŠƒvƒg # # 0.0: Jun. 15, 2004 by Dai ISHIJIMA # 0.1: Aug. 1, 2006 (CD‰Šú‰»‚µ‚Ä‚©‚çkon‚Å“ú–{Œê‰» for wpout07) # 0.2: Feb. 10, 2007 (ƒƒO‹L˜^ for wpout08) # 0.3: Feb. 17, 2007 (ƒVƒŠƒAƒ‹ƒRƒ“ƒ\[ƒ‹‘Ήž) # 0.4: Sep. 12, 2007 (for wpout09ŠJ”­”Å) # 0.5: Sep. 17, 2007 (shutdownŽž‚̉æ–Ê•œ‹A) # 0.6: Oct. 2, 2007 (expr(1)‚ÌPOSIX‘Ήž) # 0.7: Jan. 3, 2008 (‹N“®Žž‰Šú‰»Žè‡C³) # 0.8: Feb. 10, 2008 (‹N“®Žž‚ɃƒbƒZ[ƒW) # 0.9: Feb. 11, 2008 (CD‚ÌŠm”F•û–@C³) # 1.0: Jul. 24, 2009 (ƒVƒŠƒAƒ‹ƒRƒ“ƒ\[ƒ‹‘Ήž, wpout10) # 1.1: May 5, 2013 (wpout13, 8.3R, "mount -rw /dev/md0a /") # 1.2: May 3, 2014 (wpout14, 8.3R, sio->uart) # 1.3: Jul. 26, 2016 (wpout16, 10.3R, vt -> sc) # # ƒtƒ@ƒCƒ‹ƒVƒXƒeƒ€‚ð‘‚«ž‚݉”\‚É /sbin/mount -rw /dev/md0a / # ƒVƒFƒA[ƒhƒ‰ƒCƒuƒ‰ƒŠ‚̃pƒXÝ’è /sbin/ldconfig -elf /lib /usr.lib PATH=/usr.bin:/usr/bin:/bin:/usr.sbin:/usr/sbin:/sbin:/usr/local/bin:/wipeout:. export PATH # 2016-12-04 export HOME=/root #export DEBUG=y cd /tmp # # ʼn‚̃ƒO # LOGFIL=/tmp/wpoutlog.txt export LOGFIL echo -n 'booting wipe-out, at epoch ' > $LOGFIL tinydate >> $LOGFIL echo -n 'version: ' >> $LOGFIL cat /version.txt >> $LOGFIL # ‹N“®‚µ‚½‚±‚Æ‚ðŽ¦‚·ƒƒbƒZ[ƒW‚ð•\Ž¦ cat $LOGFIL # # expr(1) ‚ÌPOSIX‘Ήž‚É‚æ‚錅‚ ‚Ó‚ê‘Έ (4.xŒÝŠ·ƒ‚[ƒh) # export EXPR_COMPAT= # # CD-ROM‚Ȃǂ̉Šú‰» # echo -n 'checking boot device..' # CD-ROM‚ª‘¶Ý‚·‚é‚©? (PXEƒu[ƒg‚©Aƒ[ƒJƒ‹CDƒu[ƒg‚©?) CDROM=NONE echo 'checking CD-ROM device' >> $LOGFIL # ‚Ü‚¸AATAPI CD-ROM‚ðƒ}ƒEƒ“ƒg‚µ‚Ä‚Ý‚é echo -n 'mounting CD-ROM (acd0) ..' mount_cd9660 /dev/acd0 /cdrom 1>/dev/null 2>&1 echo '.' CDROM=/dev/acd0 if [ ! -f /cdrom/version.txt ]; then # SCSI CD-ROM‚ðƒ}ƒEƒ“ƒg‚µ‚Ä‚Ý‚é echo -n 'mounting CD-ROM (cd0) ..' mount_cd9660 /dev/cd0 /cdrom 1>/dev/null 2>&1 echo '.' CDROM=/dev/cd0 if [ ! -f /cdrom/version.txt ]; then # CD-ROM‚ðƒ}ƒEƒ“ƒg‚Å‚«‚È‚©‚Á‚½ CDROM=NONE fi fi case x"$CDROM" in x/dev/*) echo "CD-ROM device: $CDROM" >> $LOGFIL echo "re-initializing shared library path" >> $LOGFIL echo -n "re-initializing shared library path.." if [ -r /cdrom/lib/libc.so ]; then ldconfig -elf /lib /usr.lib /usr/lib fi echo '.' ;; *) echo "no CD-ROM device, may be PXE boot mode" >> $LOGFIL echo "no CD-ROM device, may be PXE boot mode" ;; esac if [ -x /bin/hostname ]; then hostname wipeout fi if [ -x /usr.sbin/powerd ]; then echo -n 'Starting powerd... ' powerd > $LOGFIL 2>&1 case x"$?" in x0) echo done. ;; *) echo failed. ;; esac fi # ˆê“xCD-ROM‚ðƒAƒ“ƒ}ƒEƒ“ƒg case x"$CDROM" in x/dev/*) echo "unmounting CD-ROM ($CDROM)" >> $LOGFIL echo -n "umounting CD-ROM ($CDROM).." umount /cdrom echo '.' ;; esac export CDROM # debugging case x"$DEBUG" in x[Yy]*) for i in 1 2 3 ; do echo -n '.' sleep 1 done echo '' ;; esac cd /wipeout echo -n "wipe-out initialized successfully on " >> $LOGFIL date >> $LOGFIL # rm -f /var/run/nologin # need terminal settings? (9.3R) export TERM=vt100 # ƒVƒŠƒAƒ‹ƒRƒ“ƒ\[ƒ‹‚̃`ƒFƒbƒN #comconsole=`dmesg | /usr.bin/sed -n '/^sio0:.*, console/p'` comconsole=`dmesg | /usr.bin/sed -n '/^uart.*console/p'` case x"$comconsole" in xuart*console*) export TTY=comconsole export CONSOLE=comconsole sh /wipeout/startup.sh ;; *) export TTY=ttyv0 export CONSOLE=vidconsole # ƒRƒ“ƒ\[ƒ‹‚ð“ú–{Œê‰»‚µ‚ÄAƒXƒ^[ƒgƒAƒbƒvƒXƒNƒŠƒvƒg‚ð‹N“® #sh /wipeout/vtstart.sh sh /wipeout/kon2start.sh ;; esac # ƒVƒƒƒbƒgƒ_ƒEƒ“‚·‚é‚©? if [ -f /var/run/nologin ]; then nologin=`sed -n 1p /var/run/nologin` case x"$nologin" in xh*) shutdown -p now ;; xr*) shutdown -r now ;; esac fi # ‘ΘbƒVƒFƒ‹‚ð‹N“®‚·‚é /bin/sh -i if [ -x /sbin/shutdown ]; then /sbin/shutdown -h now fi exit 0 # EOF #! /bin/sh # # startup.sh -- ƒXƒ^[ƒgƒAƒbƒvƒXƒNƒŠƒvƒg (“ú–{Œê‰»ƒRƒ“ƒ\[ƒ‹—p) # # 0.0: Jun. 15, 2004 by Dai ISHIJIMA # 0.1: Jun. 19, 2005 (for PXEBOOT) # 0.2: Aug. 1, 2006 (v07ACD‰Šú‰»‚ðrc‚ÖAƒ‰ƒ“ƒ_ƒ€ƒpƒ^[ƒ“‚Æ‚»‚Ì•â”) # 0.3: Aug. 6, 2006 (ƒL[ƒ{[ƒhƒ`ƒFƒbƒN) # 0.4: Sep. 18, 2006 (/var ‚ð mkdir ‚µ‚È‚¢) # 0.5: Feb. 10, 2007 (ƒƒO‹L˜^ for wpout08) # 0.6: Sep. 12, 2007 (for wpout09ŠJ”­”Å) # 0.7: Sep. 17, 2007 (shutdownŽž‚̉æ–Ê•œ‹A) # 0.8: Jan. 3, 2008 (‹N“®ŽžƒƒWƒbƒN‚̉ü—Ç) # 0.8: Jul. 24, 2009 (dmesg.boot‚Ìd•¡ƒ`ƒFƒbƒN, wpout10) # 0.9: Dec. 7, 2013 (ƒfƒBƒXƒN‚̃fƒoƒCƒX–¼) # 1.0: Aug. 4, 2015 (ad -> ada, FreeBSD 9.3R) # 1.1: Jul. 26, 2016 (10.3R, vt -> sc/kon2) # PATH=/usr.bin:/usr/bin:/bin:/usr.sbin:/usr/sbin: PATH="${PATH}"':'"/sbin:/usr/local/bin:/wipeout:." export PATH ##PATH=/usr/bin:/bin:/usr/sbin:/sbin:/:. ##export PATH export LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" export DMESG="${DMESG:-/var/run/dmesg.boot}" export ERRORLOG="${ERRORLOG:-/tmp/wperrlog.txt}" export STATEFIL="${STATEFIL:-/tmp/status.txt}" export HISTFIL="${HISTFIL:-/tmp/history.txt}" export WIPEOUTDIR="${WIPEOUTDIR:-/wipeout}" export DIALOG="--ascii-lines --no-collapse" echo -n '‹N“®Žž‚̃VƒXƒeƒ€ƒƒbƒZ[ƒW‚ð•Û‘¶‚µ‚Ä‚¢‚Ü‚·...' dmesg > $DMESG echo '' # umd0v‚ªs“ª‚ÉŒ»‚ê‚és”Ô†‚𒲂ׂéB•¡”‚ ‚ê‚Îd•¡ lin1=`sed -n '/^md0/=' $DMESG | sed -n '1p'` lin2=`sed -n '/^md0/=' $DMESG | sed -n '$p'` if [ $lin1 -ne $lin2 ]; then echo 'ƒVƒXƒeƒ€ƒƒbƒZ[ƒW‚ªd•¡‚µ‚Ä‚¢‚Ü‚·B' echo 'ˆê“x“dŒ¹‚ðØ‚Á‚Ä‚©‚çÄ‹N“®‚·‚邱‚Æ‚ð„§‚µ‚Ü‚·B' echo 'ˆ—‚ð‘±s‚·‚éꇂÍuexitv‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B' /bin/sh -i fi echo '# ---------------------------- #' >> $LOGFIL echo -n "script startup.sh started on " >> $LOGFIL date >> $LOGFIL ####export TERMCAP=/etc/termcap export TERM=kons25jx export PATTERNFIL=/tmp/pattern.dat # 2013-12-07 names of disk device node # !ata(4) -> ad (P-ATA: ad0, S-ATA: ad4, etc.) # ada(4) -> ada (SATA/PATA, FreeBSD 9.3R) # SCSI (da(4)) -> da (SCSI, CAM) # ataraid(4) -> ar # aac(4) -> aacd # amr(4) -> amrd(?) or da(?) (SCSI CAM) # arcmsr(4) -> da (SCSI CAM) # asr(4) -> da(?) (SCSI CAM) # graid3(4) -> da (SCSI CAM) # hptiop(4) -> da(?) # hptmv(4) -> da(?) # hptrr(4) -> da(?) # ida(4) -> idad(?), da(?) # iir(4) -> da(?) # ips(4) -> ipsd(?), da(?) # mfi(4) -> mfid # mlx(4) -> mlxd(?), da(?) # mly(4) -> da(?) # twa(4) -> da(?) # twe(4) -> da(?) export DEVICES='da|ada|ar|aacd|amrd|idad|ipsd|mfid|mlxd|twed' # ˆê“x‚É32MƒoƒCƒg‚¸‚ÂÁ‚· export BLKLEN=$(( 32 * 1024 * 1024 )) # o—̓uƒƒbƒN’·‚Í1MƒoƒCƒg export OBS=$(( 1024 * 1024 )) # “ü—̓uƒƒbƒN’· (stuff‚Ìo—Í’·) ‚Í1kƒoƒCƒg export IBS=1024 # Á‹ŽŠm”F‚Í10MƒoƒCƒg‚¸‚ export VBLKLEN=$(( 10 * 1024 * 1024 )) # Á‹ŽŠm”F‚Ì“ü—̓uƒƒbƒN’·‚Í1MƒoƒCƒg export VBS=$(( 1024 * 1024 )) # ƒRƒs[Žž‚Í512ƒoƒCƒg‚¸‚ export CBS=512 echo '' # debugging case x"$DEBUG" in x[Yy]*) for i in 1 2 3 ; do echo -n '.' sleep 1 done echo '' ;; esac cd /wipeout stuff -g > $PATTERNFIL echo "random pattern file $PATTERNFIL generated" >> $LOGFIL if ! /bin/sh mainmenu.sh ; then exit 1 fi # ‚Æ‚è‚ ‚¦‚¸‘ΘbƒVƒFƒ‹‚ð“®‚©‚µ‚Ä‚¨‚­ :-) /bin/sh -i exit 0 # EOF #! /bin/sh # # mainmenu.sh -- CD-ROM”ŃƒCƒ“ƒƒjƒ…[ # # 0.0: Jun. 20, 2004 by Dai ISHIJIMA (for wpout03) # 0.1: Jul. 11 2004 (for wpout04) # 0.2: Jun. 23 2005 (for wpout05) # 0.3: Jul. 8 2005 (for wpout06) # 0.4: Aug. 5, 2006 (for wpout07) # 0.5: Dec. 21, 2006 (erase MBR) # 0.6: Feb. 10, 2007 (ƒƒO‹L˜^ for wpout08) # 0.7: Feb. 15, 2007 (ƒGƒ“ƒ^[ƒL[’·‰Ÿ‚µ‘Îô) # 0.8: Feb. 18, 2007 (ƒƒjƒ…[‚̇”Ô‚ð•ÏX) # 0.9: Sep. 12, 2007 (wpout09, FreeBSD 6.2R) # 1.0: Sep. 17, 2007 (shutdownŽž‚̉æ–Ê•œ‹A) # 1.1: Oct. 6, 2007 (expr(1) ‚ÌPOSIX€‹’‘Ήž) # 1.2: Feb. 10, 2008 (ƒwƒ‹ƒvƒƒbƒZ[ƒW‚Ì•\Ž¦A“®ìƒƒO‚Ì•\Ž¦) # 1.3: Apr. 19, 2009 (‚‘¬ƒfƒBƒXƒNƒRƒs[, wpout10) # 1.4: Sep. 30, 2009 (IBM ServeRAID, ips(4), /dev/ipsd%d) # 1.5: Dec. 22, 2012 (smartctl) # 1.6: Feb. 1, 2014 (擪‚É–ß‚é) # 1.7: Aug. 4, 2015 (FreeBSD 9.3R, camcontrol sanitize) # 1.8: Nov. 8, 2015 (ƒXƒNƒŠ[ƒ“ƒZ[ƒo[) # 1.9: Dec. 4, 2016 (ttyname) # 2.0: Jan. 2. 2017 (Šù‘¶FreeBSDã‚̃AƒvƒŠ‚Æ‚µ‚Ä“®ì) # 2.1: Aug. 12, 2017 (v1.7, FreeBSD 11.1R) # 2.2: Aug. 3, 2018 (pre v1.8, FreeBSD 11.2R) # 2.3: Sep. 23, 2019 (pre v1.9, FreeBSD 12.0R) # 2.4: May 6, 2020 (pre v2.0, FreeBSD 11.3R) # 2.5: Aug. 8, 2021 (pre v2.1, FreeBSD 12.2R) # 2.6: Oct. 16, 2021 (pre v2.1, FreeBSD 12.2R), é‹ÊŒ§‹³ˆÏ # exec 2>/tmp/mm-error.txt # dmesg="${DMESG:-/var/run/dmesg.boot}" devices="${DEVICES:-da|ada|aacd|amrd|idad|ipsd|mfid|mlxd|twed|ad|ar}" # export LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" export ERRORLOG="${ERRORLOG:-/tmp/wperrlog.txt}" export DISPUPD="${DISPUPD:-5}" export STATEFIL="${STATEFIL:-/tmp/status.txt}" export HISTFIL="${HISTFIL:-/tmp/history.txt}" export WIPEOUTDIR="${WIPEOUTDIR:-/wipeout}" # 2020-05-18 export CHIMEMIN="${CHIMEMIN:-10}" export EPOCH="${EPOCH:-1589760000}" # Mon May 18 09:00:00 JST 2020 export SID="${SID:-ABCD:EFGH}" # export DIALOG="--ascii-lines --no-collapse" cbs="${CBS:-512}" obs="${OBS:-1048576}" resultfil=/tmp/result nsec=/tmp/sector nmin=/tmp/chime # 2020-05-22 stuffs='10' ##sed -n -E "/^(${devices})[0-9][0-9]*:.* $resultfil sed -n -E "/^(${devices})[0-9][0-9]*:.*B [<(]/p" $dmesg | sed 's/^\([a-z][a-z]*[0-9][0-9]*\).*/\1/' > $resultfil disk=`sed -n '1p' $resultfil` export VERSION=`sed 's/^.*OUT-\([0-9]\)\([0-9]\).*/\1.\2/' /version.txt` ttyname=`tty | sed 's+/dev/++' | sed 's|/|.|'` export TTYNAME="$ttyname" TITLE="ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx" export TITLE="$TITLE v$VERSION (${ttyname}/${SID})" dumpskip=0 echo '# ---------------------------- #' >> $LOGFIL echo -n "script mainmenu.sh ($ttyname) started on " >> $LOGFIL date >> $LOGFIL echo '# ---------------------------- #' >> $ERRORLOG echo -n "script mainmenu.sh ($ttyname) started on " >> $ERRORLOG date >> $ERRORLOG credit='' if [ -s /credit.txt ]; then credit=`sed -n 1p /credit.txt` fi case x"$credit" in x) credit="’´Á‚í‚¢‚Õ‚½‚ñE–¼‘O“ü‚êƒT[ƒrƒX" ;; *) hlinecredit="--hline $credit" dialog --title "$TITLE" \ --hline 'Press ENTER or wait a seconds...' \ --infobox "$credit" 3 72 prompt="press ENTER key or wait a second... " count=5 . ncountdown.sh ;; esac while true ; do dname=`sed -n -E "/^${disk}:.*<.*>/p" $dmesg | sed 's/.*\(<.*>\).*/\1/'` bytes=`disksize -B /dev/$disk` cap=`disksize -p /dev/$disk` echo '# ---------------------------- #' >> $ERRORLOG echo -n "preparing mainmenu ($ttyname)" >> $ERRORLOG date >> $ERRORLOG msg=" šƒƒCƒ“ƒƒjƒ…[š\n" msg="${msg}Œ»Ý‘I‘𒆂̃fƒBƒXƒN‚Í /dev/${disk} ${dname} ‚Å‚·B\n" msg="${msg}ƒfƒBƒXƒN‚Ì—e—Ê‚Í $bytes ƒoƒCƒg ($cap) ‚Å‚·B\n" msg="${msg}ˆÈ‰º‚̃ƒjƒ…[‚©‚爗‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢B\n" echo 'displaying main menu' >> $HISTFIL cp /dev/null $STATEFIL sh dummyread.sh dialog 2>$resultfil \ $hlinecredit --title "$TITLE" \ --menu "$msg" \ 21 74 10 \ z '0‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚·' \ E 'ATA SSD/HDD‚ð (ATA Security‚Å) ƒZƒLƒ…ƒAÁ‹Ž‚·‚é' \ v 'ƒf[ƒ^‚ªÁ‹Ž‚³‚ꂽ‚©Šm”F‚·‚é (‚‘¬^ˆê•”‚ðƒ`ƒFƒbƒN)' \ V 'ƒf[ƒ^‚ªÁ‹Ž‚³‚ꂽ‚©Šm”F‚·‚é (’Êí^‘S•”‚ðƒ`ƒFƒbƒN)' \ L '“®ì‹L˜^‚ðUSBƒƒ‚ƒŠ‚âƒtƒƒbƒs[‚É‘‚«o‚·' \ n '•¡”‰ñã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ð”O“ü‚è‚ÉÁ‚·' \ m '”O“ü‚èÁ‹Ž‚Ìã‘‚«•û–@‚ð‘I‘ð‚·‚é' \ s '•Ê‚̃fƒBƒXƒN‚ð‘I‘ð‚·‚é' \ d 'ƒfƒBƒXƒN‚̃f[ƒ^‚ð•\Ž¦‚·‚é' \ h '‰º‚É‚à‘±‚««‚ª‚ ‚è‚Ü‚·^‘€ì•û–@‚ÌŠT—v‚ð•\Ž¦‚·‚é' \ S 'ƒf[ƒ^‚ð•\Ž¦‚·‚éƒZƒNƒ^‚ÌŽw’è' \ a 'uwwipe-outx‚ɂ‚¢‚Äv‚ðŒ©‚é' \ C '•\Ž¦‚ðƒXƒNƒŠ[ƒ“ƒZ[ƒo[‚ÉØ‚è‘Ö‚¦‚é' \ D '‹N“®Žž‚̃VƒXƒeƒ€ƒƒbƒZ[ƒW‚ðŠm”F‚·‚é' \ P '“®ì‹L˜^‚ð•\Ž¦‚·‚é' \ Y 'ƒfƒBƒXƒN‚ðƒRƒs[‚·‚éi‚‘¬^ƒoƒbƒNƒAƒbƒvŒü‚¯j' \ y 'ƒfƒBƒXƒN‚ðƒRƒs[‚·‚éi’ᑬ^ƒf[ƒ^ƒTƒ‹ƒx[ƒWŒü‚¯j' \ f '1‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚·' \ p 'ƒ‰ƒ“ƒ_ƒ€ƒpƒ^[ƒ“‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚·' \ q 'ƒpƒ^[ƒ“‚̕│ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚·' \ r 'ƒ‰ƒ“ƒ_ƒ€ƒf[ƒ^‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚·' \ T 'ƒfƒBƒXƒN‚ÌŽ©ŒÈf’fî•ñ (SMARTî•ñ) ‚ð•\Ž¦‚·‚é' \ Z 'ƒTƒjƒ^ƒCƒY‹@”\ (SCSI Sanitize) ‚ŃZƒLƒ…ƒAÁ‹Ž‚·‚é' \ X 'ATA SSD/HDD‚ðƒGƒ“ƒnƒ“ƒXƒgƒZƒLƒ…ƒAÁ‹Ž‚·‚é' \ O 'ƒTƒjƒ^ƒCƒY‹@”\‚ŃZƒLƒ…ƒAÁ‹Ž‚·‚é (BLOCKƒ‚[ƒh)' \ F 'ŒÅ’蕶Žš—ñ‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚·' \ K 'Á‹Ž‘ÎÛƒfƒBƒXƒN‚ðŽè“®‚ÅÝ’è‚·‚é' \ w 'Á‹ŽƒƒO‚ðƒfƒBƒXƒN‚Ì擪‚É‘‚«ž‚Þ' \ b 'ƒVƒFƒ‹ (sh) ‚ð‹N“®‚·‚é' \ t 'ƒVƒFƒ‹ (csh) ‚ð‹N“®‚·‚é' \ M 'CD-ROM‚ðmount‚·‚é' \ U 'CD-ROM‚ðumount‚·‚é' \ B 'MBR *‚Ì‚Ý* ‚ðÁ‹Ž‚·‚é' \ c 'I—¹Žž‚̃`ƒƒƒCƒ€ŽžŠÔ‚ðÝ’è‚·‚é' \ x 'ƒVƒƒƒbƒgƒ_ƒEƒ“‚·‚é' \ R 'Ä‹N“®‚·‚é' \ N 'ƒƒjƒ…[‚Ì擪‚É–ß‚é' \ # end of menu case x"$?" in x1) break ;; esac result=`cat $resultfil` case x"${result}" in x[zfrpq]) echo "starting erase ($ttyname)" >> $HISTFIL sh erase.sh -$result $disk ;; xF) echo "starting erase ($ttyname)" >> $HISTFIL cp mani.txt $PATTERNFIL sh erase.sh -F $disk ;; xE) echo -n 'starting ata secure erase ' >> $HISTFIL echo "($ttyname)" >> $HISTFIL sh atasecurity.sh -e $disk ;; xX) echo -n 'starting ata enhanced ' >> $HISTFIL echo "secure erase ($ttyname)" >> $HISTFIL sh atasecurity.sh -h $disk ;; xh) echo "displaying instruction ($ttyname)" >> $HISTFIL dialog --title '‘€ì•û–@‚ÌŠT—v' \ --textbox help.txt 20 76 ;; xs) echo "selecting disk ($ttyname)" >> $HISTFIL . seldisk.sh ;; xn) echo "starting fine erase ($ttyname)" >> $HISTFIL sh fine-erase.sh $stuffs $disk ;; xm) echo "selecting erase method ($ttyname)" >> $HISTFIL . sel-fine.sh ;; xv) echo "starting quick verify ($ttyname)" >> $HISTFIL sh verify.sh 90 $disk ;; xV) echo "starting verify ($ttyname)" >> $HISTFIL sh verify.sh 0 $disk ;; xw) echo "writing log ($ttyname)" >> $HISTFIL sh writelog.sh $disk ;; xL) echo "saving log ($ttyname)" >> $HISTFIL sh floppylog.sh ;; xd) echo "dump sector ($ttyname)" >> $HISTFIL sh dump.sh $dumpskip $disk dumpskip=`expr $dumpskip + 1` ;; xS) echo "selecting sector ($ttyname)" >> $HISTFIL msg="ƒZƒNƒ^‚ðŽw’肵‚Ä‚­‚¾‚³‚¢ ($dumpskip)" dialog 2>$nsec \ --title "$TITLE" \ --inputbox "$msg" 8 64 case x"$?" in x0) echo '' >> $nsec echo "$dumpskip" >> $nsec dumpskip=`sed -n '/^[0-9]/p' $nsec | sed -n 1p` ;; esac ;; xa) echo "displaying about ($ttyname)" >> $HISTFIL dialog --title 'wwipe-outx‚ɂ‚¢‚Ä' \ --textbox info.txt 20 76 ;; xC) echo "displaying saver ($ttyname)" >> $HISTFIL msg='Alt+F8‚ð‰Ÿ‚·‚ƃXƒNƒŠ[ƒ“ƒZ[ƒo[‚ÉØ‚è‘Ö‚¦‚Ü‚·B' msg="${msg}\nƒAƒvƒŠƒ‚[ƒh‚âƒVƒŠƒAƒ‹ƒRƒ“ƒ\[ƒ‹" msg="${msg}‚Å‚Í“®ì‚µ‚Ü‚¹‚ñB" dialog --title "$TITLE" \ --msgbox "$msg" 6 64 ;; xD) echo -n "displaying system message " >> $HISTFIL echo "($ttyname)" >> $HISTFIL dialog --title '‹N“®Žž‚̃VƒXƒeƒ€ƒƒbƒZ[ƒW' \ --textbox /var/run/dmesg.boot 20 76 ;; xy) echo "starting copy ($ttyname)" >> $HISTFIL srcdisk=$disk . seldisk.sh dstdisk=$disk sh copy.sh $srcdisk $dstdisk $cbs disk=$srcdisk ;; xY) echo "starting quick copy ($ttyname)" >> $HISTFIL srcdisk=$disk . seldisk.sh dstdisk=$disk sh copy.sh $srcdisk $dstdisk $obs disk=$srcdisk ;; xP) echo "displaying history ($ttyname)" >> $HISTFIL echo "::: $LOGFIL ($ttyname) :::" > /tmp/loglog.txt cat $LOGFIL >> /tmp/loglog.txt echo '' >> /tmp/loglog.txt for f in /tmp/erase-log.* ; do if [ -f "$f" ]; then echo "::: $f :::" >> /tmp/loglog.txt cat $f >> /tmp/loglog.txt echo '' >> /tmp/loglog.txt fi done for f in /tmp/verify-log.* ; do if [ -f "$f" ]; then echo "::: $f :::" >> /tmp/loglog.txt cat $f >> /tmp/loglog.txt echo '' >> /tmp/loglog.txt fi done echo '::: history :::' >> /tmp/loglog.txt cat $HISTFIL >> /tmp/loglog.txt echo '' >> /tmp/loglog.txt echo '::: shell variables :::' >> /tmp/loglog.txt set >> /tmp/loglog.txt echo '' >> /tmp/loglog.txt dialog --title '“®ìƒƒO' \ --textbox /tmp/loglog.txt 20 76 ;; xT) echo "displaying smart info ($ttyname)" >> $HISTFIL if [ ! -x /usr/local/sbin/smartctl ]; then echo '::: no smartctl found :::' \ >> $LOGFIL dialog --title "$TITLE" \ --msgbox 'smartctl(8) ‚ª‚ ‚è‚Ü‚¹‚ñ' 5 64 else echo -n "displaying smart infomation " \ >> $HISTFIL echo "($TTYNAME)" >> $HISTFIL /usr/local/sbin/smartctl -s on /dev/$disk \ > /tmp/smart.txt 2>&1 /usr/local/sbin/smartctl -a /dev/$disk \ >> /tmp/smart.txt 2>&1 case x"$?" in x0) echo "SMART‚ͳíI—¹‚µ‚Ü‚µ‚½" \ > /tmp/smartmsg.txt ;; *) echo "SMART‚Í“®ì‚µ‚Ü‚¹‚ñ‚Å‚µ‚½" \ > /tmp/smartmsg.txt ;; esac echo '' >> $LOGFIL echo '::: SMART (smartctl output) :::' \ >> $LOGFIL cat /tmp/smart.txt >> $LOGFIL cat /tmp/smart.txt >> /tmp/smartmsg.txt dialog --title 'SMARTƒƒO' \ --textbox /tmp/smartmsg.txt 20 76 fi ;; xZ) echo "starting sanitize ($ttyname)" >> $HISTFIL sh sanitize.sh crypto $disk ;; xO) echo "starting block sanitize ($ttyname)" >> $HISTFIL sh sanitize.sh block $disk ;; xK) echo "selecting disk (manual) ($ttyname)" >> $HISTFIL msg="ƒfƒBƒXƒN‚ðŽw’肵‚Ä‚­‚¾‚³‚¢ ($disk)" dialog 2>/tmp/diskname \ --title "$TITLE" \ --inputbox "$msg" 8 64 case x"$?" in x0) echo '' >> /tmp/diskname echo "$disk" >> /tmp/diskname cat /tmp/diskname | sed -n '/^[a-z][a-z]*[0-9][0-9]*/p' | sed -n 1p > /tmp/diskname.new disk=`cat /tmp/diskname.new` ;; esac ;; xb) echo "starting shell ($ttyname)" >> $HISTFIL /bin/sh -i ;; xt) echo "starting shell ($ttyname)" >> $HISTFIL if [ -x /bin/csh ]; then /bin/csh -i else msg='csh‚Ì“ü‚Á‚½CD-ROM‚ðƒ}ƒEƒ“ƒg‚µ‚Ä‚­‚¾‚³‚¢' dialog --title "$TITLE" \ --msgbox "$msg" 5 64 fi ;; xM) echo "mounting CD-ROM ($ttyname)" >> $HISTFIL if [ -x /cdrom/usr.bin/dialog ]; then msg='CD-ROM‚Í‚·‚łɃ}ƒEƒ“ƒg‚³‚ê‚Ä‚¢‚Ü‚·' elif mount_cd9660 $CDROM /cdrom > /dev/null 2>&1; then msg='CD-ROM‚ðƒ}ƒEƒ“ƒg‚µ‚Ü‚µ‚½' else msg='CD-ROM‚ðƒ}ƒEƒ“ƒg‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½' fi dialog --title "$TITLE" \ --msgbox "$msg" 5 64 ;; xU) echo "unmounting CD-ROM ($ttyname)" >> $HISTFIL msg='' if [ ! -x /cdrom/usr.bin/dialog ]; then msg='CD-ROM‚Í‚·‚łɃAƒ“ƒ}ƒEƒ“ƒg‚³‚ê‚Ä‚¢‚Ü‚·' fi if umount /cdrom > /dev/null 2>&1; then msg='CD-ROM‚ðƒAƒ“ƒ}ƒEƒ“ƒg‚µ‚Ü‚µ‚½' elif [ -z "$msg" ]; then msg='CD-ROMƒAƒ“ƒ}ƒEƒ“ƒg‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½' fi dialog --title "$TITLE" \ --msgbox "$msg" 5 64 ;; xc) echo "setting chime idle time ($ttyname)" >> $HISTFIL msg="I—¹Žžƒ`ƒƒƒCƒ€Ý’è ($CHIMEMIN) •ª" dialog 2>$nmin \ --title "$TITLE" \ --inputbox "$msg" 8 64 case x"$?" in x0) echo '' >> $nmin echo "$CHIMEMIN" >> $nmin CHIMEMIN=`sed -n '/^[0-9]/p' $nmin | sed -n 1p` export CHIMEMIN ;; esac ;; xB) echo "erasing MBR ($ttyname)" >> $HISTFIL sh embr.sh $disk ;; xx) echo "starting shutdown ($ttyname)" >> $HISTFIL echo "halt" > /var/run/nologin (sleep 30; /sbin/shutdown -p now) > /dev/null 2>&1 & exit 1 ;; xR) echo "starting reboot ($ttyname)" >> $HISTFIL echo "reboot" > /var/run/nologin (sleep 30; /sbin/shutdown -r now) > /dev/null 2>&1 & exit 1 ;; #xN) # NOP # ;; esac done dialog --title "$TITLE" \ --infobox 'I—¹‚µ‚Ü‚·' 3 64 echo "u/bin/sh ${WIPEOUTDIR}/mainmenu.shv‚Ńƒjƒ…[‰æ–Ê‚ðŒÄ‚Ño‚¹‚Ü‚·B" echo '' exit 0 # EOF #! /bin/sh # # seldisk.sh - ƒfƒBƒXƒN‚Ì‘I‘ð # # ƒ_ƒCƒAƒƒOƒ{ƒbƒNƒX‚ð•\Ž¦‚µ‚ăfƒBƒXƒN‚ð‘I‘ðA‚ ‚é‚¢‚Í“ü—Í‚·‚éB # ƒfƒoƒCƒXƒtƒ@ƒCƒ‹–¼‚ð•Ô‚·B # # 0.0: May 30, 2004 by Dai ISHIJIMA # 0.1: Jun. 29, 2006 (support some more disk types) # 0.2: Sep. 12, 2007 (wpout09) # dmesg="${DMESG:-/var/run/dmesg.boot}" devices="${DEVICES:-da|ad|ar|aacd|amrd|ipsd}" resultfil=/tmp/result title="${TITLE:-ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx}" #sed -n -E "/^(${devices})[0-9]:.* $resultfil sed -n -E "/^(${devices})[0-9]:.*B [(<]/p" $dmesg | sed 's/^\([a-z][a-z]*[0-9]\).*/\1/' > $resultfil disks=`cat $resultfil` n=0 taglist='' for d in $disks ; do dname=`sed -n -E "/^${d}:.*<.*>/p" $dmesg | sed 's/.*\(<.*>\).*/\1/'` bytes=`disksize -B /dev/$d` cap=`disksize -p /dev/$d` taglist="$taglist $d '$dname (${bytes}ƒoƒCƒg, $cap)'" done #######taglist="$taglist XX 'ã‹LˆÈŠO‚ð“ü—Í‚·‚é'" eval dialog \ --title "'$title'" \ --menu "'ƒfƒBƒXƒN‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢'" \ 12 72 5 \ $taglist \ 2>$resultfil status=$? /bin/sh logdev.sh > /tmp/devices.txt if [ -s /tmp/devices.txt ]; then sed -n "/$disk/p" /tmp/devices.txt > /tmp/checkdev.txt 2>&1 if [ -s /tmp/checkdev.txt ]; then sh dummyread.sh msg="${disk}‚Íuwipe-outv‚Ì‹N“®ƒƒfƒBƒA‚ÆŽv‚í‚ê‚Ü‚·B‘I‘ð‚µ‚Ü‚·‚©?\n" msg="${msg}\n ‚æ‚낵‚¢‚Å‚·‚©?" dialog --title "$title" --yesno "$msg" 9 64 case x"$?" in x1) status=1 esac fi fi case "$status" in 0) newdisk=`cat $resultfil` if [ x"$disk" != x"$newdisk" ]; then msg="ƒfƒBƒXƒN‚ð ${disk} ‚©‚ç" msg="${msg} ${newdisk} ‚É•ÏX‚µ‚Ü‚µ‚½B" dialog --title "$title" \ --infobox "$msg" 5 72 sleep 2 fi disk="$newdisk" ;; 1) dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚Ì‘I‘ð‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 ;; esac # EOF #! /bin/sh # # erase.sh -- ƒf[ƒ^‚ðã‘‚«‚µ‚ăfƒBƒXƒN‚̃f[ƒ^‚ðÁ‹Ž‚·‚é # # Žg‚¢•û: /bin/sh erase.sh -Á‚µ•û ƒfƒBƒXƒN # Á‚µ•û: [zfr] # ƒfƒBƒXƒN: ƒfƒoƒCƒXƒtƒ@ƒCƒ‹‚ÅŽw’èA擪‚Ìu/dev/v‚ÍÈ‚­ # —á: /bin/sh erase.sh -z ad0 # # 0.0: Jun. 20, 2004 by Dai ISHIJIMA (for wpout03) # 0.1: Jul. 11, 2004 # 0.2: Jun. 28, 2006 (ƒ‰ƒ“ƒ_ƒ€ƒpƒ^[ƒ“‚Æ•â” for wpout07) # 0.3: Aug. 1, 2006 (ƒ^ƒCƒ€ƒXƒ^ƒ“ƒv) # 0.4: Aug. 12, 2006 (ƒ^ƒCƒ€ƒXƒ^ƒ“ƒv‚É—e—Ê) # 0.5: Feb. 10, 2007 (ƒƒO‹L˜^ for wpout08) # 0.6: Feb. 15, 2007 (ƒGƒ“ƒ^[ƒL[’·‰Ÿ‚µ‘ÎôAƒGƒ‰[‚Æ“]‘—‘¬“x‚̃ƒO) # 0.7: Sep. 12, 2007 (wpout09) # 0.8: Oct. 6, 2007 (ŒvŽZ‚ð32ƒrƒbƒg•„†•t‚«®”‚͈̔͂Ås‚¤) # 0.9: Dec. 23, 2007 (ƒo[ƒOƒ‰ƒt•\Ž¦‚ÌŒvŽZC³) # 1.0: Jan. 2, 2008 (ƒƒOC³) # 1.1: Mar. 22, 2014 (‰æ–Ê‚Ì‚¿‚ç‚‚«‚ðŒ¸‚ç‚· (XV‚ðŒ¸‚ç‚·)) # 1.2: May 18, 2020 (v2.0 I—¹Žž‚̃`ƒƒƒCƒ€) # 1.3: Sep. 23, 2021 (ÅIŠm”F) # ERRORLOG="${ERRORLOG:-/tmp/wperrlog.txt}" CHIMEMIN="${CHIMEMIN:-10}" exec 2>> $ERRORLOG echo "# start $0, $@" 1>&2 echo '# ---------------------------- #' 1>&2 # ’P“Æ‚Å‚à“®‚­‚悤‚É LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" DMESG="${DMESG:-/var/run/dmesg.boot}" STATEFIL="${STATEFIL:-/tmp/status.txt}" PATTERNFIL="${PATTERNFIL:-/tmp/pattern.dat}" dispupd="${DISPUPD:-5}" echo '# ---------------------------- #' >> $LOGFIL echo -n "script $0 started on " >> $LOGFIL date >> $LOGFIL echo "starting erase ($TTYNAME)" > $STATEFIL if [ ! -s $PATTERNFIL ]; then stuff -g > $PATTERNFIL echo "random pattern file $PATTERNFIL generated" >> $LOGFIL fi # stuff="${1:--z}" disk="${2:-ad0}" dmesg="${DMESG:-/var/run/dmesg.boot}" # ˆê“x‚É32MƒoƒCƒg‚¸‚ blklen="${BLKLEN:-33554432}" # o—̓uƒƒbƒNƒTƒCƒY‚Í1MƒoƒCƒg obs="${OBS:-1048576}" ocnt=$(( $blklen / $obs )) ounit=$(( $obs / 1048576 )) # “ü—̓uƒƒbƒNƒTƒCƒY‚Í1kƒoƒCƒg ibs="${IBS:-1024}" icnt=$(( $blklen / $ibs )) # resultfil=/tmp/result # title="${TITLE:-ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx}" # if [ ! -w /dev/$disk ]; then dialog --title "$title" \ --hline "$dname" \ --msgbox "ƒfƒBƒXƒN $disk ‚ª‘¶Ý‚µ‚È‚¢‚©A‘‚«ž‚Ý‚Å‚«‚Ü‚¹‚ñ" \ 5 64 echo "$0: can't write to $disk" 1>&2 exit 1 fi # mount -p | sed -n -E "/^.dev.$disk/p" > $resultfil if [ -s $resultfil ]; then dialog --title "$title" \ --hline "$dname" \ --msgbox "ƒ}ƒEƒ“ƒg’†‚̃fƒBƒXƒN $disk ‚ðÁ‹Ž‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ" \ 5 64 echo "$0: can't write to $disk, mounted" 1>&2 exit 1 fi /bin/sh logdev.sh > /tmp/devices.txt if [ -s /tmp/devices.txt ]; then sed -n "/$disk/p" /tmp/devices.txt > /tmp/checkdev.txt 2>&1 if [ -s /tmp/checkdev.txt ]; then sh dummyread.sh msg="${disk}‚Íuwipe-outv‚Ì‹N“®ƒƒfƒBƒA‚ÆŽv‚í‚ê‚Ü‚·BÁ‹Ž‚µ‚Ü‚·‚©?\n" msg="${msg}\n ‚æ‚낵‚¢‚Å‚·‚©?" dialog --title "$title" --yesno "$msg" 9 64 case x"$?" in x1) dialog --title "$title" \ --hline "$dname" \ --infobox '\nƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 5 64 sleep 2 exit 1 ;; esac fi fi dname=`sed -n -E "/^${disk}:.*<.*>/p" $dmesg | sed 's/.*\(<.*>\).*/\1/'` bytes=`disksize -B /dev/$disk` cap=`disksize -p /dev/$disk` msg="ƒfƒBƒXƒN ${disk} ${dname} ‚Ì\n" msg="${msg}‘Sƒf[ƒ^ ${bytes}ƒoƒCƒg‚ðA\n" case x"$stuff" in x-[0z]) msg="${msg}0‚Åã‘‚«‚µ‚ÄÁ‹Ž‚µ‚Ü‚·B\n" method='write 0' ;; x-[1f]) msg="${msg}1‚Åã‘‚«‚µ‚ÄÁ‹Ž‚µ‚Ü‚·B\n" method='write 1' ;; x-[Rr]) msg="${msg}ƒ‰ƒ“ƒ_ƒ€ƒf[ƒ^‚Åã‘‚«‚µ‚ÄÁ‹Ž‚µ‚Ü‚·B\n" method='write random' ;; x-[Pp]) stuff -g > $PATTERNFIL echo "random pattern file $PATTERNFIL generated" >> $LOGFIL msg="${msg}ƒ‰ƒ“ƒ_ƒ€ƒpƒ^[ƒ“‚Åã‘‚«‚µ‚ÄÁ‹Ž‚µ‚Ü‚·B\n" method='write pattern' ;; x-F) msg="${msg}ŒÅ’蕶Žš—ñ‚Åã‘‚«‚µ‚ÄÁ‹Ž‚µ‚Ü‚·B\n" method='write pattern' ;; x-[Qq]) msg="${msg}’¼‘Oƒpƒ^[ƒ“‚̕│Åã‘‚«‚µ‚ÄÁ‹Ž‚µ‚Ü‚·B\n" method='write inverted pattern' ;; *) msg="${msg}Á‹Ž‚µ‚Ü‚·B\n" method='overwrite' ;; esac msg="${msg}\n [Q:1/2] ‚æ‚낵‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" --yesno "$msg" 9 64 case x"$?" in x1) dialog --title "$title" \ --hline "$dname" \ --infobox '\nƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 5 64 sleep 2 exit 1 ;; esac msg="–{“–‚É${disk} ($cap) ‚̃f[ƒ^‚ðÁ‹Ž‚µ‚Ä‚¢‚¢‚Å‚·‚©?\n\n" msg="$msg [Q:2/2] (ÅIŠm”F)" sh dummyread.sh dialog --title "$title" \ --hline "$dname" \ --yesno "$msg" \ 7 72 case x"$?" in x1) dialog --title "$title" \ --hline "$dname" \ --infobox '\nƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 5 64 sleep 2 exit 1 ;; esac # Á‹Ž‚̃pƒ‰ƒ[ƒ^ (MƒoƒCƒg’PˆÊ‚Å”‚¦‚é) mbytes=`disksize -m /dev/$disk` max=$(( $mbytes / $ounit )) startsec=`tinydate '+%s'` rems='' # ŠJŽnŽž startstamp=`date '+%Y-%m-%d %H:%M'` # echo "v ---------------------------- v" >> $LOGFIL echo -n "erase started on " >> $LOGFIL date >> $LOGFIL echo " $disk ($dname) $bytes bytes with $method" >> $LOGFIL nerrs=0 skip=0 xcent=100 xmill=1000 mcent=$max mmill=$max if [ $max -gt 1048576 ]; then xcent=1 xmill=1 mcent=$(( ( $max + 99 ) / 100 )) mmill=$(( ( $max + 999 ) / 1000 )) fi lastdisp=0 dispintv=0 while [ $skip -le $max ]; do # ŒvŽž cursec=`tinydate '+%s'` # ƒo[ƒOƒ‰ƒt p=$(( ( $xcent * $skip ) / $mcent )) m=$(( ( $xmill * $skip ) / $mmill )) q=$(( $p / 2 )) i=0 bar='' while [ $i -lt $q ]; do bar="$bar"'#' i=$(( $i + 1 )) done while [ $i -lt 50 ]; do bar="$bar"'_' i=$(( $i + 1 )) done # Žc‚莞ŠÔ elapsed=$(( $cursec - $startsec )) if [ $elapsed -gt 10 ]; then if [ $m -gt 0 ]; then remain=$(( ( 1000 - $m ) * $elapsed / $m + 1 )) if [ $remain -gt 120 ]; then rems=$(( ( $remain + 59 ) / 60 )) rems="Žc‚è ‚¨‚æ‚»${rems}•ª" else rems="Žc‚è ‚¨‚æ‚»${remain}•b" dispupd=5 fi fi fi if [ $elapsed -gt 120 ]; then elas=$(( ( $elapsed + 30 ) / 60 )) elas="${elas}•ª" dispupd=30 else elas="${elapsed}•b" fi # echo "erasing $disk, $p % done. ($TTYNAME)" > $STATEFIL text="ƒfƒBƒXƒN ${disk} ‚̃f[ƒ^‚ðÁ‹Ž‚µ‚Ä‚¢‚Ü‚·B\n" text="${text} ${p}% ($skip/$max) I—¹ ^ " text="${text}${elas} Œo‰ß ${rems} \n\n" text="${text} 0%|${bar}|100%" text="${text}\n${errormsg}" dispintv=$(( $cursec - $lastdisp )) if [ $dispintv -ge $dispupd ]; then dialog --title "$title" \ --hline "$dname" \ --infobox "$text" 7 72 lastdisp=$cursec else echo -e '\r\c' fi sh poko.sh echo -n "$status2 " case x$DEBUG in x[Yy]*) status2='now in debug mode...' errormsg='' sleep 1 ;; *) status=`stuff $stuff < $PATTERNFIL | dd ibs=$ibs obs=$obs seek=$skip count=$icnt of=/dev/$disk 2>&1` status2=`echo "$status" | sed -n '/transfer/p'` errormsg=`echo "$status" | sed -n -E '/records (in|out)$/!p' | sed -n '/transferred in/!p'` ;; esac # ‹L˜^ case x"$skip" in x0) echo "skip: $skip, $status2" >> $LOGFIL ;; esac case x"${nerrs}"x"${errormsg}" in x[0-8]x?*) echo "errmesg[${nerrs}]: $errormsg" >> $LOGFIL nerrs=$(( $nerrs + 1 )) ;; x9x?*) echo "errmesg[${nerrs}]: $errormsg" >> $LOGFIL echo "Too many errors encounterd..." >> $LOGFIL nerrs=$(( $nerrs + 1 )) ;; esac # ŽŸƒ‹[ƒv skip=$(( $skip + $ocnt )) done sleep 2 # echo "skip: $skip, $status2" >> $LOGFIL echo "number of error messages: $nerrs" >> $LOGFIL echo -n "erase finished on " >> $LOGFIL date >> $LOGFIL echo " $disk ($dname, $cap) with $method" >> $LOGFIL echo "^ ---------------------------- ^" >> $LOGFIL cursec=`tinydate '+%s'` elapsed=$(( $cursec - $startsec )) if [ $elapsed -gt 120 ]; then min=$(( $elapsed / 60 )) sec=$(( $elapsed - $min * 60 )) elas="${min}•ª${sec}•b" else elas="${elapsed}•b" fi # I—¹Žž endstamp=`date '+%H:%M'` # ƒƒO•Û‘¶ echo 'The contents of this storage device' > /tmp/erase-log.$disk echo "$disk ($cap) '$dname'" >> /tmp/erase-log.$disk echo -n 'were erased with ' >> /tmp/erase-log.$disk echo -n 'hard disk wiping tool "wipe-out."' >> /tmp/erase-log.$disk echo " ($TTYNAME)" >> /tmp/erase-log.$disk echo "Erased with '$method'" >> /tmp/erase-log.$disk echo " $startstamp -> $endstamp" >> /tmp/erase-log.$disk echo "but NOT verified" > /tmp/verify-log.$disk echo "$disk erased ($elapsed [s]) ($TTYNAME)" > $STATEFIL sh chime.sh $CHIMEMIN & 2>&1 child=$! sh dummyread.sh dialog --title "$title" \ --hline "$dname" \ --msgbox "ƒfƒBƒXƒN‚̃f[ƒ^Á‹Ž‚ªI—¹‚µ‚Ü‚µ‚½ (${elas})" 5 72 kill $child > /dev/null 2>&1 # echo '# ---------------------------- #' 1>&2 exit 0 # EOF #! /bin/sh # # fine-erase.sh -- •¡”‰ñ‘‚«ž‚Ý‚Å”O“ü‚è‚ɃfƒBƒXƒN‚̃f[ƒ^‚ðÁ‹Ž‚·‚é # # Žg‚¢•û: /bin/sh fine-erase.sh Á‚µ•û ƒfƒBƒXƒN # Á‚µ•û: [0z1fRr]+ # ƒfƒBƒXƒN: ƒfƒoƒCƒXƒtƒ@ƒCƒ‹‚ÅŽw’èA擪‚Ìu/dev/v‚ÍÈ‚­ # —á: /bin/sh fine-erase.sh 0101010 ad0 # # 0.0: Jun. 27, 2004 by Dai ISHIJIMA # 0.1: Jul. 11, 2004 # 0.2: Jun. 28, 2006 # 0.3: Aug. 1, 2006 (ƒ^ƒCƒ€ƒXƒ^ƒ“ƒv for wpout07) # 0.4: Feb. 10, 2007 (ƒƒO‹L˜^ for wpout08) # 0.5: Feb. 15, 2007 (ƒGƒ“ƒ^[ƒL[’·‰Ÿ‚µ‘Îô) # 0.6: Sep. 12, 2007 (wpout09) # 0.7: Oct. 6, 2007 (ŒvŽZ‚ð32ƒrƒbƒg•„†•t‚«®”‚͈̔͂Ås‚¤) # 0.8: Dec. 23, 2007 (ƒo[ƒOƒ‰ƒt•\Ž¦‚ÌŒvŽZC³) # 0.9: Jan. 2, 2008 (ƒƒOC³) # 1.0: Mar. 22, 2014 (‰æ–Ê‚Ì‚¿‚ç‚‚«‚ðŒ¸‚ç‚· (XV‚ðŒ¸‚ç‚·)) # 1.1: Aug. 4, 2015 (expr *, FreeBSd 9.3R) # 1.2: Jan. 15, 2017 (0x55‘Ήž) # 1.3: May 18, 2020 (v2.0 I—¹Žž‚̃`ƒƒƒCƒ€) # ERRORLOG="${ERRORLOG:-/tmp/wperrlog.txt}" CHIMEMIN="${CHIMEMIN:-10}" exec 2>> $ERRORLOG echo "# start $0, $@" 1>&2 echo '# ---------------------------- #' 1>&2 # ’P“Æ‚Å‚à“®‚­‚悤‚É LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" DMESG="${DMESG:-/var/run/dmesg.boot}" PATTERNFIL="${PATTERNFIL:-/tmp/pattern.dat}" STATEFIL="${STATEFIL:-/tmp/status.txt}" dispupd="${DISPUPD:-5}" echo '# ---------------------------- #' >> $LOGFIL echo -n "script $0 started on " >> $LOGFIL date >> $LOGFIL echo "starting erase ($TTYNAME)" > $STATEFIL if [ ! -s $PATTERNFIL ]; then stuff -g > $PATTERNFIL echo "random pattern file $PATTERNFIL generated" >> $LOGFIL fi stuffs="${1:-fz}" disk="${2:-ad0}" dmesg="${DMESG:-/var/run/dmesg.boot}" # ˆê“x‚É32MƒoƒCƒg‚¸‚ blklen="${BLKLEN:-33554432}" # o—̓uƒƒbƒNƒTƒCƒY‚Í1MƒoƒCƒg obs="${OBS:-1048576}" ocnt=$(( $blklen / $obs )) ounit=$(( $obs / 1048576 )) # “ü—̓uƒƒbƒNƒTƒCƒY‚Í1kƒoƒCƒg ibs="${IBS:-1024}" icnt=$(( $blklen / $ibs )) # resultfil=/tmp/result # title="${TITLE:-ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx}" # if [ ! -w /dev/$disk ]; then dialog --title "$title" \ --hline "$dname" \ --msgbox "ƒfƒBƒXƒN $disk ‚ª‘¶Ý‚µ‚È‚¢‚©A‘‚«ž‚Ý‚Å‚«‚Ü‚¹‚ñ" \ 5 64 echo "$0: can't write to $disk" 1>&2 exit 1 fi # mount -p | sed -n -E "/^.dev.$disk/p" > $resultfil if [ -s $resultfil ]; then dialog --title "$title" \ --hline "$dname" \ --msgbox "ƒ}ƒEƒ“ƒg’†‚̃fƒBƒXƒN $disk ‚ðÁ‹Ž‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ" \ 5 64 echo "$0: can't write to $disk, mounted" 1>&2 exit 1 fi /bin/sh logdev.sh > /tmp/devices.txt if [ -s /tmp/devices.txt ]; then sed -n "/$disk/p" /tmp/devices.txt > /tmp/checkdev.txt 2>&1 if [ -s /tmp/checkdev.txt ]; then sh dummyread.sh msg="${disk}‚Íuwipe-outv‚Ì‹N“®ƒƒfƒBƒA‚ÆŽv‚í‚ê‚Ü‚·BÁ‹Ž‚µ‚Ü‚·‚©?\n" msg="${msg}\n ‚æ‚낵‚¢‚Å‚·‚©?" dialog --title "$title" \ --hline "$dname" \ --yesno "$msg" 9 64 case x"$?" in x1) dialog --title "$title" \ --hline "$dname" \ --infobox '\nƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 5 64 sleep 2 exit 1 ;; esac fi fi dname=`sed -n -E "/^${disk}:.*<.*>/p" $dmesg | sed 's/.*\(<.*>\).*/\1/'` bytes=`disksize -B /dev/$disk` cap=`disksize -p /dev/$disk` msg="ƒfƒBƒXƒN ${disk} ${dname} ‚Ì\n" msg="${msg}‘Sƒf[ƒ^ ${bytes}ƒoƒCƒg‚ðA\n" nstuff=0 for stuff in `echo $stuffs | sed 's/\(.\)/\1 /g'` ; do case x"$stuff" in x[0z]) msg="${msg}0A" ;; x[1f]) msg="${msg}1A" ;; x[Rr]) msg="${msg}RA" ;; x[Pp]) msg="${msg}PA" ;; x[An]) msg="${msg}AA" ;; x[U5]) msg="${msg}5A" ;; esac nstuff=$(( $nstuff + 1 )) done msg="${msg}‚̇‚É\n${nstuff}‰ñã‘‚«‚µ‚ÄÁ‹Ž‚µ‚Ü‚·\n" msg="${msg}\n [Q:1/2] ‚æ‚낵‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" --yesno "$msg" 10 64 case x"$?" in x1) dialog --title "$title" \ --hline "$dname" \ --infobox '\nƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 5 64 sleep 2 exit 1 ;; esac msg="–{“–‚É${disk} ($cap) ‚̃f[ƒ^‚ðÁ‹Ž‚µ‚Ä‚¢‚¢‚Å‚·‚©?\n\n" msg="$msg [Q:2/2] (ÅIŠm”F)" sh dummyread.sh dialog --title "$title" \ --hline "$dname" \ --yesno "$msg" \ 7 72 case x"$?" in x1) dialog --title "$title" \ --hline "$dname" \ --infobox '\nƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 5 64 sleep 2 exit 1 ;; esac # Á‹Ž‚̃pƒ‰ƒ[ƒ^ (MƒoƒCƒg’PˆÊ‚Å”‚¦‚é) mbytes=`disksize -m /dev/$disk` max=$(( $mbytes / $ounit )) stage=0 xstage=1 startsec=`tinydate '+%s'` totalrems='' # ŠJŽnŽž startstamp=`date '+%Y-%m-%d %H:%M'` # echo "v ---------------------------- v" >> $LOGFIL echo -n "erase ($nstuff times) started on " >> $LOGFIL date >> $LOGFIL echo " $disk ($dname) $bytes bytes with $stuffs" >> $LOGFIL nerrs=0 xcent=100 xmill=1000 mcent=$max mmill=$max if [ $max -gt 1048576 ]; then xcent=1 xmill=1 mcent=$(( ( $max + 99 ) / 100 )) mmill=$(( ( $max + 999 ) / 1000 )) fi for stuff in `echo $stuffs | sed 's/\(.\)/\1 /g'` ; do skip=0 stagestart=`tinydate '+%s'` case "$stuff" in [0z]) method="'0'‚ðã‘‚«‚µ‚Ä" ;; [1f]) method="'1'‚ðã‘‚«‚µ‚Ä" ;; [Rr]) method="ƒ‰ƒ“ƒ_ƒ€ƒf[ƒ^‚ðã‘‚«‚µ‚Ä" ;; [Pp]) stuff -g > $PATTERNFIL echo "random pattern file $PATTERNFIL generated" \ >> $LOGFIL method="ƒ‰ƒ“ƒ_ƒ€ƒpƒ^[ƒ“‚ðã‘‚«‚µ‚Ä" ;; [Qq]) method="’¼‘Oƒpƒ^[ƒ“‚̕│ðã‘‚«‚µ‚Ä" ;; [An]) method="'0xAA'‚ðã‘‚«‚µ‚Ä" ;; [U5]) method="'0x55'‚ðã‘‚«‚µ‚Ä" ;; esac rems='' status='' status2='' errormsg='' # echo -n "stage: $stage, with writing $stuff " >> $LOGFIL echo -n "started on " >> $LOGFIL date >> $LOGFIL # lastdisp=0 dispintv=0 while [ $skip -le $max ]; do # ŒvŽž cursec=`tinydate '+%s'` # ƒo[ƒOƒ‰ƒt p=$(( ( $xcent * $skip ) / $mcent )) m=$(( ( $xmill * $skip ) / $mmill )) q=$(( $p / 2 )) i=0 bar='' while [ $i -lt $q ]; do bar="$bar"'#' i=$(( $i + 1 )) done while [ $i -lt 50 ]; do bar="$bar"'_' i=$(( $i + 1 )) done # Žc‚莞ŠÔ elapsed=$(( $cursec - $stagestart )) if [ $elapsed -gt 10 ]; then if [ $m -gt 0 ]; then remain=$(( ( 1000 - $m ) * $elapsed / $m + 1 )) if [ $remain -gt 120 ]; then rems=$(( ( $remain + 59 ) / 60 )) rems="Žc‚è ‚¨‚æ‚»${rems}•ª" else rems="Žc‚è ‚¨‚æ‚»${remain}•b" fi fi fi if [ $elapsed -gt 120 ]; then elas=$(( ( $elapsed + 30 ) / 60 )) elas="${elas}•ª" else elas="${elapsed}•b" fi # ‘S‘̃o[ƒOƒ‰ƒt pp=$(( ( $p + 100 * $stage ) / $nstuff )) mm=$(( ( $m + 1000 * $stage ) / $nstuff )) q=$(( $pp / 2 )) i=0 totalbar='' while [ $i -lt $q ]; do totalbar="$totalbar"'#' i=$(( $i + 1 )) done while [ $i -lt 50 ]; do totalbar="$totalbar"'_' i=$(( $i + 1 )) done ee=$(( $cursec - $startsec )) if [ $mm -gt 0 ]; then rr=$(( ( 1000 - $mm ) * $ee / $mm + 1 )) if [ $rr -gt 120 ]; then totalrems=$(( ( $rr + 59 ) / 60 )) totalrems="Žc‚è ‚¨‚æ‚»${totalrems}•ª" else totalrems="Žc‚è ‚¨‚æ‚»${rr}•b" dispupd=10 fi fi if [ $ee -gt 120 ]; then totalelas=$(( ( $ee + 30 ) / 60 )) totalelas="${totalelas}•ª" dispupd=30 else totalelas="${ee}•b" fi # echo "erasing $disk, fine, $pp % done. ($TTYNAME)" > $STATEFIL text="ƒfƒBƒXƒN ${disk} ‚̃f[ƒ^‚ðÁ‹Ž‚µ‚Ä‚¢‚Ü‚·B\n\n" text="${text}‘S ${nstuff} H’ö’†‚Ì ${xstage} ”Ô‚ß " text="${text} ‘S‘Ì‚Ì ${pp}% I—¹\n" text="${text}${totalelas} Œo‰ß ${totalrems} \n\n" text="${text} 0%|${totalbar}|100%\n\n" text="${text}‚±‚ÌH’ö‚Å‚Í${method}Aƒf[ƒ^‚ðÁ‹Ž‚µ‚Ä‚¢‚Ü‚·B\n" text="${text}${p}% ($skip/$max) I—¹ ^ " text="${text}${elas} Œo‰ß ${rems} \n\n" text="${text} 0%|${bar}|100%\n\n" text="${text}\n${errormsg}" dispintv=$(( $cursec - $lastdisp )) if [ $dispintv -ge $dispupd ]; then dialog --title "$title" \ --hline "$dname" \ --infobox "$text" 15 72 lastdisp=$cursec else echo -e '\r\c' fi sh poko.sh echo -n "$status2 " case x$DEBUG in x[Yy]*) status2='now in debug mode...' errormsg='' sleep 1 ;; *) status=`stuff -$stuff < $PATTERNFIL | dd ibs=$ibs obs=$obs seek=$skip count=$icnt of=/dev/$disk 2>&1` status2=`echo "$status" | sed -n '/transfer/p'` errormsg=`echo "$status" | sed -n -E '/records (in|out)$/!p' | sed -n '/transferred in/!p'` ;; esac # ‹L˜^ case x"$skip" in x0) echo "stage: $stage, skip: $skip, $status2" >> $LOGFIL ;; esac case x"${nerrs}"x"${errormsg}" in x[0-8]x?*) echo "errmesg[${nerrs}]: $errormsg" >> $LOGFIL nerrs=$(( $nerrs + 1 )) ;; x9x?*) echo "errmesg[${nerrs}]: $errormsg" >> $LOGFIL echo "Too many errors encounterd..." >> $LOGFIL nerrs=$(( $nerrs + 1 )) ;; esac # ŽŸƒ‹[ƒv skip=$(( $skip + $ocnt )) done stage=$(( $stage + 1 )) xstage=$(( $xstage + 1 )) echo "stage: $stage, skip: $skip, $status2" >> $LOGFIL done sleep 2 # echo "number of errmessages: $nerrs" >> $LOGFIL echo -n "erase finished on " >> $LOGFIL date >> $LOGFIL echo " $disk ($dname, $cap) with overwriting $nstuff times" >> $LOGFIL echo "^ ---------------------------- ^" >> $LOGFIL cursec=`tinydate '+%s'` elapsed=$(( $cursec - $startsec )) if [ $elapsed -gt 120 ]; then min=$(( $elapsed / 60 )) sec=$(( $elapsed - $min * 60 )) elas="${min}•ª${sec}•b" else elas="${elapsed}•b" fi # I—¹Žž endstamp=`date '+%H:%M'` # ƒƒO•Û‘¶ echo 'The contents of this storage device' > /tmp/erase-log.$disk echo "$disk ($cap) '$dname'" >> /tmp/erase-log.$disk echo -n 'were erased with ' >> /tmp/erase-log.$disk echo -n 'hard disk wiping tool "wipe-out."' >> /tmp/erase-log.$disk echo " ($TTYNAME)" >> /tmp/erase-log.$disk echo "Erase $nstuff times ($stuffs)" >> /tmp/erase-log.$disk echo " $startstamp -> $endstamp" >> /tmp/erase-log.$disk echo "but NOT verified" > /tmp/verify-log.$disk echo "$disk erased ($elapsed [s]) ($TTYNAME)" > $STATEFIL sh chime.sh $CHIMEMIN & 2>&1 child=$! sh dummyread.sh dialog --title "$title" \ --hline "$dname" \ --msgbox "ƒfƒBƒXƒN‚̃f[ƒ^Á‹Ž‚ªI—¹‚µ‚Ü‚µ‚½ (${elas})" 5 72 kill $child > /dev/null 2>&1 # echo '# ---------------------------- #' 1>&2 exit 0 # EOF #! /bin/sh # # sel-fine.sh - ”O“ü‚èÁ‹Ž–@‚Ì‘I‘ð # # 0.0: Jun. 26, 2004 by Dai ISHIJIMA # 0.1: Jul. 9, 2005 # 0.2: Jun. 28, 2006 (ƒ‰ƒ“ƒ_ƒ€ƒpƒ^[ƒ“‚Æ•â” for wpout07) # 0.3: Feb. 18, 2007 (15‰ñÁ‹Ž‚ð’ljÁ for wpout08) # 0.4: Jan. 15, 2017 (ŒëŽšC³Aƒpƒ^[ƒ“’ljÁ) # resultfil=/tmp/result stuffs="${stuffs:-10}" title="${TITLE:-ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx}" dialog 2>$resultfil \ --title "$title" \ --menu 'Á‹Ž•û–@‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢B«ªƒL[‚ŃXƒNƒ[ƒ‹‚µ‚Ü‚·B' \ 19 74 12 \ 10 '1¨0‚̇‚É2‰ñã‘‚«‚·‚é' \ 01 '0¨1‚̇‚É2‰ñã‘‚«‚·‚é' \ PQ 'ƒpƒ^[ƒ“¨•â”‚̇‚É2‰ñã‘‚«‚·‚é' \ R0 'ƒ‰ƒ“ƒ_ƒ€¨0‚̇‚É2‰ñã‘‚«‚·‚é' \ RR0 'ƒ‰ƒ“ƒ_ƒ€¨ƒ‰ƒ“ƒ_ƒ€¨0‚̇‚É3‰ñã‘‚«‚·‚é' \ R10 'ƒ‰ƒ“ƒ_ƒ€¨1¨0‚̇‚É3‰ñã‘‚«‚·‚é' \ PQ0 'ƒ‰ƒ“ƒ_ƒ€ƒpƒ^[ƒ“¨•â”¨0‚̇‚É3‰ñã‘‚«‚·‚é' \ 5A0 '0x55¨0xAA¨0‚̇‚É3‰ñã‘‚«‚·‚é' \ PQR 'ƒpƒ^[ƒ“¨•â”¨ƒ‰ƒ“ƒ_ƒ€‚̇‚É3‰ñã‘‚«' \ 5AR '0x55¨0xAA¨ƒ‰ƒ“ƒ_ƒ€‚̇‚É3‰ñã‘‚«‚·‚é' \ RR10 'ƒ‰ƒ“ƒ_ƒ€~2¨1¨0‚̇‚É4‰ñã‘‚«‚·‚é' \ 1010 '1¨0¨1¨0‚̇‚É4‰ñã‘‚«‚·‚é' \ 0101 '0¨1¨0¨1‚̇‚É4‰ñã‘‚«‚·‚é' \ PQ10 'ƒpƒ^[ƒ“¨•â”¨1¨0‚̇‚É4‰ñã‘‚«‚·‚é' \ PQR0 'ƒpƒ^[ƒ“¨•â”¨ƒ‰ƒ“ƒ_ƒ€¨0‚̇‚É4‰ñã‘‚«' \ 5AR0 '0x55¨0xAA¨ƒ‰ƒ“ƒ_ƒ€¨0‚̇‚É4‰ñã‘‚«' \ 01010 '(0¨1)~2¨0‚̇‚É5‰ñã‘‚«‚·‚é' \ RRR10 'ƒ‰ƒ“ƒ_ƒ€~3¨1¨0‚̇‚É5‰ñã‘‚«‚·‚é' \ PQPQ0 '(ƒpƒ^[ƒ“¨•â”)~2¨0‚̇‚É5‰ñã‘‚«‚·‚é' \ 101010 '1¨0¨1¨0¨1¨0‚̇‚É6‰ñã‘‚«‚·‚é' \ RRRR10 'ƒ‰ƒ“ƒ_ƒ€~4¨1¨0‚̇‚É6‰ñã‘‚«‚·‚é' \ PQPQ10 '(ƒpƒ^[ƒ“¨•â”)~2¨1¨0‚̇‚É6‰ñã‘‚«' \ 0101010 '(0¨1)~3¨0‚̇‚É7‰ñã‘‚«‚·‚é' \ R101010 'ƒ‰ƒ“ƒ_ƒ€¨1¨0¨1¨0¨1¨0‚̇‚É7‰ñã‘‚«' \ 5A5A5AR '(0x55¨0xAA)~3¨ƒ‰ƒ“ƒ_ƒ€‚̇‚É7‰ñã‘‚«' \ R10R10R10 '(ƒ‰ƒ“ƒ_ƒ€¨1¨0)~3‚̇‚É9‰ñã‘‚«‚·‚é' \ PQRPQRPQR0 '(ƒpƒ^[ƒ“¨•â”¨ƒ‰ƒ“ƒ_ƒ€)~3¨0‚̇‚É10‰ñ' \ PQRPQRPQR10 '(ƒp[ƒ^ƒ“¨•â”¨ƒ‰ƒ“ƒ_ƒ€)~3¨1¨0‚̇‚É11‰ñ' \ R10R10R10R10 '(ƒ‰ƒ“ƒ_ƒ€¨1¨0)~4‚̇‚É12‰ñã‘‚«‚·‚é' \ PQRPQRPQRPQR0 '(ƒpƒ^[ƒ“¨•â”¨ƒ‰ƒ“ƒ_ƒ€)~4¨0‚̇‚É13‰ñ' \ PQRPQRPQRPQR10 '(ƒpƒ^[ƒ“¨•â”¨ƒ‰ƒ“ƒ_ƒ€)~4¨1¨0‚̇‚É14‰ñ' \ PQR10PQR10PQR10 '(ƒpƒ^[ƒ“¨•â”¨ƒ‰ƒ“ƒ_ƒ€¨1¨0)~3‚̇‚É15‰ñ' \ case x"$?" in x0) newstuff=`cat $resultfil` if [ x"$stuffs" != x"$newstuff" ]; then msg="Á‹Ž•û–@‚ð ${stuffs} ‚©‚ç" msg="${msg} ${newstuff} ‚É•ÏX‚µ‚Ü‚µ‚½B" dialog --title "$title" \ --infobox "$msg" 3 72 sleep 2 fi stuffs="$newstuff" ;; x1) dialog --title "$title" \ --infobox 'Á‹Ž•û–@‚Ì‘I‘ð‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 ;; esac # EOF #! /bin/sh # # verify.sh -- ƒf[ƒ^‚ªÁ‚¦‚Ä‚¢‚é‚©Šm”F‚·‚é # # Žg‚¢•û: /bin/sh verify.sh step ƒfƒBƒXƒN # step: ƒXƒLƒbƒv‚·‚é’·‚³ # ƒfƒBƒXƒN: ƒfƒoƒCƒXƒtƒ@ƒCƒ‹‚ÅŽw’èA擪‚Ìu/dev/v‚ÍÈ‚­ # —á: /bin/sh verify.sh 0 ad0 (ƒfƒBƒXƒN‘S•”) # /bin/sh verify.sh 90 ad0 (‘S‘Ì‚Ì1/10) # /bin/sh verify.sh 990 ad0 (‘S‘Ì‚Ì1/100) # # 0.0: Jul. 8, 2005 by Dai ISHIJIMA (for wpout06) # 0.2: Aug. 1, 2006 (ƒ^ƒCƒ€ƒXƒ^ƒ“ƒv for wpout07) # 0.3: Feb. 10, 2007 (ƒƒO‹L˜^ for wpout08) # 0.4: Feb. 15, 2007 (ƒGƒ“ƒ^[ƒL[’·‰Ÿ‚µ‘Îô) # 0.5: Sep. 12, 2007 (wpout09) # 0.6: Oct. 6, 2007 (ŒvŽZ‚ð32ƒrƒbƒg•„†•t‚«®”‚͈̔͂Ås‚¤) # 0.7: Dec. 23, 2007 (ƒo[ƒOƒ‰ƒt•\Ž¦‚ÌŒvŽZC³) # 0.8: Jan. 2, 2008 (ƒƒOC³) # 0.9: Apr. 19, 2009 (Šm”FƒƒbƒZ[ƒW, wpout10) # 1.0: Mar. 21, 2014 (Žc‚莞ŠÔŒvŽZC³) # 1.1: Mar. 22, 2014 (‰æ–Ê‚Ì‚¿‚ç‚‚«‚ðŒ¸‚ç‚· (XV‚ðŒ¸‚ç‚·)) # 1.2: May 18, 2020 (v2.0 I—¹Žž‚̃`ƒƒƒCƒ€) # 1.3: Sep. 23, 2021 (—”‚ÅÁ‹Ž) # ERRORLOG="${ERRORLOG:-/tmp/wperrlog.txt}" CHIMEMIN="${CHIMEMIN:-10}" exec 2>> $ERRORLOG echo "# start $0, $@" 1>&2 echo '# ---------------------------- #' 1>&2 # ’P“Æ‚Å‚à“®‚­‚悤‚É LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" DMESG="${DMESG:-/var/run/dmesg.boot}" PATTERNFIL="${PATTERNFIL:-/tmp/pattern.dat}" STATEFIL="${STATEFIL:-/tmp/status.txt}" dispupd="${DISPUPD:-5}" echo '# ---------------------------- #' >> $LOGFIL echo -n "script $0 started on " >> $LOGFIL date >> $LOGFIL echo "starting verify ($TTYNAME)" > $STATEFIL step="${1:-1}" disk="${2:-ad0}" dmesg="${DMESG:-/var/run/dmesg.boot}" # 10MƒoƒCƒg’PˆÊ‚ÅŠm”F vblklen="${VBLKLEN:-10485760}" # ˆê“x‚É1MƒoƒCƒg vbs="${VBS:-1048576}" vunit=$(( $vbs / 1048576 )) # ˆê“x‚É10ƒuƒƒbƒN vcnt=$(( $vblklen / $vbs )) # resultfil=/tmp/result # title="${TITLE:-ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx}" if [ ! -r /dev/$disk ]; then dialog --title "$title" \ --hline "$dname" \ --msgbox "ƒfƒBƒXƒN $disk ‚ª‘¶Ý‚µ‚È‚¢‚©A“Ç‚ß‚Ü‚¹‚ñ" \ 5 64 exit 1 fi dname=`sed -n -E "/^${disk}:.*<.*>/p" $dmesg | sed 's/.*\(<.*>\).*/\1/'` dbytes=`disksize -p /dev/$disk` bytes=`disksize -B /dev/$disk` # Šm”F‚̃pƒ‰ƒ[ƒ^ mbytes=`disksize -m /dev/$disk` # ƒuƒƒbƒNƒTƒCƒY’PˆÊ‚ł̃fƒBƒXƒNƒTƒCƒY max=$(( $mbytes / $vunit )) msg="ƒfƒBƒXƒN ${disk} ${dname} ‚Ì\n" msg="${msg}ƒf[ƒ^ ${bytes}ƒoƒCƒg‚ª\n" msg="${msg}Á‹Ž‚³‚ê‚Ä‚¢‚邱‚Æ‚ðŠm”F‚µ‚Ü‚·B\n" msg="${msg}\n ‚æ‚낵‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" --yesno "$msg" 9 64 case x"$?" in x1) dialog --title "$title" \ --hline "$dname" \ --infobox 'Á‹ŽŠm”F‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac # Œ‹‰Ê zero=0 one=0 maybe=0 unerased=0 checked=0 random=0 startsec=`tinydate '+%s'` rems='' # ŠJŽnŽž startstamp=`date '+%Y-%m-%d %H:%M'` # echo "v ---------------------------- v" >> $LOGFIL echo -n "verify started on " >> $LOGFIL date >> $LOGFIL echo " $disk ($dname) $bytes bytes" >> $LOGFIL nerrs=0 skip=0 xcent=100 xmill=1000 mcent=$max mmill=$max if [ $max -gt 1048576 ]; then xcent=1 xmill=1 mcent=$(( ( $max + 99 ) / 100 )) mmill=$(( ( $max + 999 ) / 1000 )) fi lastdisp=0 dispintv=0 while [ $skip -lt $max ]; do # ŒvŽž cursec=`tinydate '+%s'` # ƒo[ƒOƒ‰ƒt p=$(( ( $xcent * $skip ) / $mcent )) m=$(( ( $xmill * $skip ) / $mmill )) q=$(( $p / 2 )) i=0 bar='' while [ $i -lt $q ]; do bar="$bar"'#' i=$(( $i + 1 )) done while [ $i -lt 50 ]; do bar="$bar"'_' i=$(( $i + 1 )) done # Žc‚莞ŠÔ elapsed=$(( $cursec - $startsec )) if [ $elapsed -gt 10 ]; then if [ $m -gt 0 ]; then remain=$(( ( 1000 - $m ) * $elapsed / $m + 1 )) if [ $remain -gt 120 ]; then rems=$(( ( $remain + 59 ) / 60 )) rems="Žc‚è ‚¨‚æ‚»${rems}•ª" else rems="Žc‚è ‚¨‚æ‚»${remain}•b" dispupd=10 fi fi fi if [ $elapsed -gt 120 ]; then elas=$(( ( $elapsed + 30 ) / 60 )) elas="${elas}•ª" dispupd=30 else elas="${elapsed}•b" fi # echo -n "verify $disk, $p % done. ($TTYNAME)" > $STATEFIL text="ƒfƒBƒXƒN ${disk} ‚̃f[ƒ^‚ðƒ`ƒFƒbƒN‚µ‚Ä‚¢‚Ü‚·B\n" text="${text}${max}ƒuƒƒbƒN‚Ì‚¤‚¿${skip}ƒuƒƒbƒN^${p}% I—¹\n" text="${text}${elas} Œo‰ß ${rems} \n\n" text="${text} 0%|${bar}|100%" text="${text}\n${errormsg}" dispintv=$(( $cursec - $lastdisp )) if [ $dispintv -ge $dispupd ]; then dialog --title "$title" \ --hline "$dname" \ --infobox "$text" 8 72 lastdisp=$cursec else echo -e '\r\c' fi sh poko.sh echo -n "$status2 " case x$DEBUG in x[Yy]*) status2='now in debug mode...' errormsg='' sleep 1 ;; *) status=`(dd if=/dev/$disk ibs=$vbs obs=$vbs skip=$skip count=$vcnt | check -s) 2>&1` case $? in 0) zero=$(( $zero + $vcnt )) ;; 1) one=$(( $one + $vcnt )) ;; 2) maybe=$(( $maybe + $vcnt )) ;; 3) random=$(( $random + $vcnt )) ;; *) unerased=$(( $unerased + $vcnt )) ;; esac status2=`echo "$status" | sed -n '/transfer/p'` errormsg=`echo "$status" | sed -n -E '/records (in|out)$/!p' | sed -n '/transferred in/!p'` ;; esac # ʼnºs‚Éo‚·ƒXƒe[ƒ^ƒX‚ª‹ó‚Ì‚Æ‚« case x"$status2" in x) status2="skipping unerased block $unerased at $skip" ;; esac # ‹L˜^ case x"$skip" in x0) echo "skip: $skip, $status2" >> $LOGFIL ;; esac case x"${nerrs}"x"${errormsg}" in x[0-8]x?*) echo "errmesg[${nerrs}]: $errormsg" >> $LOGFIL nerrs=$(( $nerrs + 1 )) ;; x9x?*) echo "errmesg[${nerrs}]: $errormsg" >> $LOGFIL echo "Too many errors encounterd..." >> $LOGFIL nerrs=$(( $nerrs + 1 )) ;; esac # ŽŸƒ‹[ƒv checked=$(( $checked + $vcnt )) skip=$(( $skip + $vcnt + $step )) done sleep 2 # echo "skip: $skip, $status2" >> $LOGFIL echo "number of error messages: $nerrs" >> $LOGFIL echo -n "verify finished on" >> $LOGFIL date >> $LOGFIL echo " $disk ($dname, $dbytes), max = $max, checked = $checked" >> $LOGFIL echo "^ ---------------------------- ^" >> $LOGFIL cursec=`tinydate '+%s'` elapsed=$(( $cursec - $startsec )) if [ $elapsed -gt 120 ]; then min=$(( $elapsed / 60 )) sec=$(( $elapsed - $min * 60 )) elas="${min}•ª${sec}•b" else elas="${elapsed}•b" fi # I—¹Žž endstamp=`date '+%H:%M'` unerased=$(( $unerased + $maybe )) zp=$(( $zero * 100 / $checked )) op=$(( $one * 100 / $checked )) rp=$(( $random * 100 / $checked )) np=$(( $unerased * 100 / $checked )) msg="ƒfƒBƒXƒN ($disk, $dbytes ƒoƒCƒg) ‚̃`ƒFƒbƒN‚ªI—¹‚µ‚Ü‚µ‚½ (${elas})\n" msg="${msg}‘S $max ƒuƒƒbƒN’†‚Ì $checked ƒuƒƒbƒN‚ðŒŸ¸‚µ‚Ü‚µ‚½\n" msg="${msg} '0' ‚ÅÁ‹Ž‚³‚ê‚Ä‚¢‚éƒuƒƒbƒN”: $zero ($zp %)\n" msg="${msg} '1' ‚ÅÁ‹Ž‚³‚ê‚Ä‚¢‚éƒuƒƒbƒN”: $one ($op %)\n" msg="${msg} —” ‚ÅÁ‹Ž‚³‚ê‚Ä‚¢‚éƒuƒƒbƒN”: $random ($rp %)\n" msg="${msg} ‚»‚êˆÈŠO (‚½‚Ô‚ñ–¢Á‹Ž) ‚̃uƒƒbƒN”: $unerased ($np %)\n" # ƒƒO•Û‘¶ echo "Verified $checked blocks ($TTYNAME)" > /tmp/verify-log.$disk echo -n " erased with 0:${zp}%, 1:${op}%, " >> /tmp/verify-log.$disk echo "unerased:${np}%" >> /tmp/verify-log.$disk echo " $startstamp -> $endstamp" >> /tmp/verify-log.$disk echo -n "$disk verified ($elapsed [s]) ($TTYNAME)" > $STATEFIL sh dummyread.sh # ‚È‚º‚©Ž~‚Ü‚é? #echo -n "final confirmation message displayed on " >> $LOGFIL #date >> $LOGFIL sh chime.sh $CHIMEMIN & 2>&1 child=$! sh dummyread.sh dialog --title "$title" \ --hline "$dname" \ --msgbox "$msg" 10 72 kill $child > /dev/null 2>&1 # echo '# ---------------------------- #' 1>&2 exit 0 # EOF #! /bin/sh # # dump.sh -- ƒfƒBƒXƒN‚̃f[ƒ^‚ð•\Ž¦‚·‚é # # 0.0: Jul. 8, 2005 by Dai ISHIJIMA (wpout06) # 0.1: Sep. 12, 2007 (wpout09) # 0.2: Aug. 4, 2018 (wpout18) # # Žg‚¢•û: /bin/sh dump.sh skip ƒfƒBƒXƒN # skip: ƒXƒLƒbƒv‚·‚é’·‚³ # ƒfƒBƒXƒN: ƒfƒoƒCƒXƒtƒ@ƒCƒ‹‚ÅŽw’èA擪‚Ìu/dev/v‚ÍÈ‚­ # —á: /bin/sh dump.sh 0 ad0 # # skip="${1:-0}" disk="${2:-ad0}" title="¡ $disk ‚Ì ƒZƒNƒ^ $skip ‚Ì“à—e" (dd if=/dev/$disk skip=$skip count=1 | xd > /tmp/dump.txt) 2>/dev/null dialog --title "$title" \ --textbox /tmp/dump.txt 20 76 #! /bin/sh # # writelog.sh -- Á‹ŽƒƒO‚ðƒfƒBƒXƒN‚É‘‚«ž‚Þ # # Žg‚¢•û: /bin/sh writelog.sh ƒfƒBƒXƒN # ƒfƒBƒXƒN: ƒfƒoƒCƒXƒtƒ@ƒCƒ‹‚ÅŽw’èA擪‚Ìu/dev/v‚ÍÈ‚­ # —á: /bin/sh writelog.sh ad0 # # 0.0: Aug. 1, 2006 by Dai ISHIJIMA (for wpout07) # 0.1: Aug. 7, 2006 ”O“ü‚è‚ÉŠm”F # 0.2: Feb. 10, 2007 (ƒƒO‹L˜^ for wpout08) # 0.3: Feb. 15, 2007 (ƒGƒ“ƒ^[ƒL[’·‰Ÿ‚µ‘Îô) # 0.4: Sep. 12, 2007 (wpout09) # disk="${1:-ad0}" mbr="${MBR:-wpout-mbr.boot}" title="${TITLE:-ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx}" # ‚·‚Å‚ÉÁ‹ŽÏ‚Ý‚©? if [ ! -s /tmp/erase-log.$disk ]; then dialog --title "$title" \ --yesno 'Á‹Ž‘€ì‚ªs‚í‚ê‚Ä‚¢‚Ü‚¹‚ñ\n–{“–‚É‘‚«ž‚Ý‚Ü‚·‚©?' \ 6 64 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒƒO‚Ì‘‚«ž‚Ý‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac fi # –{“–‚ÉÁ‹Ž‚³‚ê‚Ä‚¢‚é‚Ì‚©? dd if=/dev/$disk count=1 of=/tmp/org-mbr.$disk 1>/dev/null 2>&1 if ! check < /tmp/org-mbr.$disk 1>/dev/null 2>&1 ; then dialog --title "$title" \ --yesno 'MBR‚Í0‚ÅÁ‹Ž‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ\n–{“–‚É‘‚«ž‚Ý‚Ü‚·‚©?' \ 6 64 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒƒO‚Ì‘‚«ž‚Ý‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac fi # ƒƒO‚ª‘¶Ý‚µ‚È‚©‚Á‚½‚ç‚»‚ê‚炵‚­ì¬ if [ ! -s /tmp/erase-log.$disk ]; then echo 'The contents of this storage device' > /tmp/erase-log.$disk echo 'may have been erased' >> /tmp/erase-log.$disk echo 'with hard disk wiping tool "wipe-out."' >> /tmp/erase-log.$disk fi if [ ! -s /tmp/verify-log.$disk ]; then echo 'But NOT verified.' > /tmp/verify-log.$disk fi # ÅIŠm”F sh dummyread.sh dialog --title "$title" \ --yesno "Á‹ŽƒƒO‚ðƒfƒBƒXƒN ($disk) ‚É‘‚«ž‚Ý‚Ü‚·‚©?" \ 6 64 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒƒO‚Ì‘‚«ž‚Ý‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac echo -n 'Logged: ' > /tmp/stamp-log.$disk date '+%Y-%m-%d %H:%M:%S' >> /tmp/stamp-log.$disk echo 'ABSOLUTELY NO WARRANTY.' >> /tmp/stamp-log.$disk # ‘‚«ž‚Ý‘€ì cat $mbr /tmp/erase-log.$disk /tmp/verify-log.$disk /tmp/stamp-log.$disk | makembr > /tmp/boot.$disk # echo -n "MBR log was written on " >> $LOGFIL date >> $LOGFIL echo "==" >> $LOGFIL cat /tmp/erase-log.$disk /tmp/verify-log.$disk /tmp/stamp-log.$disk >> $LOGFIL echo "==" >> $LOGFIL case x$DEBUG in x[Yy]*) echo 'debug mode, no write' mesg="Á‹ŽƒƒO‚ðƒfƒBƒXƒN ($disk) ‚É‘‚«ž‚Ý‚Ü‚µ‚½ (in debug mode)" ;; *) if dd if=/tmp/boot.$disk of=/dev/$disk > /dev/null 2>&1; then mesg="Á‹ŽƒƒO‚ðƒfƒBƒXƒN ($disk) ‚É‘‚«ž‚Ý‚Ü‚µ‚½" else mesg="Á‹ŽƒƒO‚ðƒfƒBƒXƒN ($disk) ‚É‘‚«ž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½" fi ;; esac sh dummyread.sh dialog --title "$title" --msgbox "$mesg" 5 72 exit 0 # EOF #! /bin/sh # # copy.sh -- ƒGƒ‰[‚𖳎‹‚µ‚ăf[ƒ^‚ðƒRƒs[ # # Žg‚¢•û: /bin/sh copy.sh ƒRƒs[Œ³ƒfƒBƒXƒN ƒRƒs[æƒfƒBƒXƒN # ƒfƒBƒXƒN: ƒfƒoƒCƒXƒtƒ@ƒCƒ‹‚ÅŽw’èA擪‚Ìu/dev/v‚ÍÈ‚­ # —á: /bin/sh copy.sh ad0 ad1 # # 0.0: Aug. 5, 2006 by Dai ISHIJIMA (for wpout07) # 0.1: Feb. 10, 2007 (ƒƒO‹L˜^ for wpout08) # 0.2: Feb. 15, 2007 (ƒGƒ“ƒ^[ƒL[’·‰Ÿ‚µ‘Îô) # 0.3: Sep. 12, 2007 (wpout09) # 0.4: Oct. 6, 2007 (expr(1) ‚ÌPOSIX‘Ήž) # 0.4: Dec. 13, 2007 (ƒo[ƒOƒ‰ƒtAŽc‚芗vŽžŠÔ‚̃I[ƒo[ƒtƒ[C³) # 0.5: Jan. 2, 2008 (ƒƒOC³) # 0.6: Apr. 19, 2009 (ƒuƒƒbƒNƒTƒCƒY‰Â•Ï, wpout10) # 0.7: Oct. 11, 2013 (ƒRƒs[’†‚̃fƒBƒXƒN–¼•\Ž¦, wpout13) # 0.8: Jan. 3, 2017 (ƒ}ƒEƒ“ƒg‚µ‚Ä‚¢‚é‚©ƒ`ƒFƒbƒN) # 0.9: May 18, 2020 (v2.0 I—¹Žž‚̃`ƒƒƒCƒ€) # ERRORLOG="${ERRORLOG:-/tmp/wperrlog.txt}" CHIMEMIN="${CHIMEMIN:-10}" exec 2>> $ERRORLOG echo "# start $0, $@" 1>&2 echo '# ---------------------------- #' 1>&2 # ’P“Æ‚Å‚à“®‚­‚悤‚É LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" DMESG="${DMESG:-/var/run/dmesg.boot}" STATEFIL="${STATEFIL:-/tmp/status.txt}" PATTERNFIL="${PATTERNFIL:-/tmp/pattern.dat}" dispupd="${DISPUPD:-2}" echo '# ---------------------------- #' >> $LOGFIL echo -n "script $0 started on " >> $LOGFIL date >> $LOGFIL echo "starting copy ($TTYNAME)" > $STATEFIL # ŒvŽZŽž‚É 32bit signed int ‚ÌŒÀŠE‚Ɉø‚Á‚©‚©‚ç‚È‚¢‚悤‚É‚·‚é export EXPR_COMPAT # ƒuƒƒbƒNƒTƒCƒY‚Í512ƒoƒCƒg cbs="${CBS:-512}" srcdisk="${1:-ad0}" dstdisk="${2:-ad1}" cbs="${3:-$cbs}" dmesg="${DMESG:-/var/run/dmesg.boot}" if [ ! -r /dev/$srcdisk ]; then msg="ƒfƒBƒXƒN $srcdisk ‚ª‘¶Ý‚µ‚È‚¢‚©A“Ç‚Ýž‚Ý‚Å‚«‚Ü‚¹‚ñ" dialog --title "$title" \ --msgbox "$msg" 5 64 echo "$0: can't read $srcdisk" 1>&2 exit 1 fi if [ ! -w /dev/$dstdisk ]; then msg="ƒfƒBƒXƒN $dstdisk ‚ª‘¶Ý‚µ‚È‚¢‚©A‘‚«ž‚Ý‚Å‚«‚Ü‚¹‚ñ" dialog --title "$title" \ --msgbox "$msg" 5 64 echo "$0: can't write to $dstdisk" 1>&2 exit 1 fi # ˆê“x‚É32MƒoƒCƒg‚¸‚ blklen="${BLKLEN:-33554432}" # ƒRƒs[‚̃pƒ‰ƒ[ƒ^ # MƒoƒCƒg’PˆÊ‚Å”‚¦‚é mbytes=`disksize -m /dev/$srcdisk` # 524288MƒoƒCƒgˆÈ‰º‚È‚çƒuƒƒbƒNƒTƒCƒY‚Í512ƒoƒCƒg # ƒuƒƒbƒN”‚̃JƒEƒ“ƒg‚ª30ƒrƒbƒg‚ÅŽû‚Ü‚é‚悤‚É‚·‚é xbs=$(( ( $mbytes + 524288 - 1 ) / 524288 )) minbs=512 xbs=$(( $xbs >> 1 )) # ƒuƒƒbƒN’·‚̓fƒBƒXƒNƒTƒCƒY‚ɉž‚¶‚Ä 512, 1k, 2k, 4k,.. while [ $xbs -gt 0 ]; do minbs=$(( $minbs << 1 )) xbs=$(( $xbs >> 1 )) done # Žw’èƒuƒƒbƒN’·‚ª’Z‚¢ (ŒvŽZ‚ª‚ ‚Ó‚ê‚é‹°‚ê‚Ì‚ ‚é) ‚Æ‚«‚Í’·‚­‚·‚é if [ $cbs -lt $minbs ]; then cbs=$minbs fi ccnt=$(( $blklen / $cbs )) # obs="${OBS:-1048576}" ocnt=$(( $blklen / $obs )) ounit=$(( $obs / 1048576 )) # resultfil=/tmp/result title="${TITLE:-ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx}" # mount -p | sed -n -E "/^.dev.$dstdisk/p" > $resultfil if [ -s $resultfil ]; then msg="ƒ}ƒEƒ“ƒg’†‚̃fƒBƒXƒN $dstdisk ‚É‘‚«ž‚Þ‚±‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ" dialog --title "$title" --msgbox "$msg" 5 64 echo "$0: can't write to $dstdisk, mounted" 1>&2 exit 1 fi sname=`sed -n -E "/^${srcdisk}:.*<.*>/p" $dmesg | sed 's/.*\(<.*>\).*/\1/'` sbytes=`disksize -B /dev/$srcdisk` dname=`sed -n -E "/^${dstdisk}:.*<.*>/p" $dmesg | sed 's/.*\(<.*>\).*/\1/'` dbytes=`disksize -B /dev/$dstdisk` msg="ƒfƒBƒXƒN ${srcdisk} ${sname} ‚Ì\n" msg="${msg}‘Sƒf[ƒ^ ${sbytes}ƒoƒCƒg‚ðA${cbs}ƒoƒCƒg’PˆÊ‚Å\n" msg="${msg}ƒfƒBƒXƒN ${dstdisk} ${dname}\n" msg="${msg}(${dbytes}ƒoƒCƒg) ‚ɃRƒs[‚µ‚Ü‚·B" msg="${msg}\n ‚æ‚낵‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" --yesno "$msg" 9 64 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚̃Rƒs[‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac msg="–{“–‚É${srcdisk}‚̃f[ƒ^‚ð${dstdisk}‚ɃRƒs[‚µ‚Ä‚¢‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" \ --hline "$dname" \ --yesno "$msg" \ 5 72 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚̃Rƒs[‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac dd if=/dev/$dstdisk ibs=512 count=1 | check -s 2>&1 case $? in 0) dstempty="may be empty or erased." ;; *) dstempty="may NOT be empty or erased." msg="ƒRƒs[æ‚̃fƒBƒXƒN${dstdisk} ${dname}\n" msg="${msg}‚ɂ̓f[ƒ^‚ªŽc‚Á‚Ä‚¢‚é‰Â”\«‚ª‚ ‚è‚Ü‚·\n" msg="${msg}–{“–‚É${srcdisk}‚̃f[ƒ^‚ð" msg="${msg}${dstdisk}‚ɃRƒs[‚µ‚Ä‚¢‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" \ --hline "$dname" \ --yesno "$msg" \ 7 72 case x"$?" in x1) dialog --title "$title" \ --infobox \ 'ƒfƒBƒXƒN‚̃Rƒs[‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac ;; esac ccnt=$(( $blklen / $cbs )) max=$(( $mbytes * (1048576 / $cbs) )) startsec=`tinydate '+%s'` rems='' # echo "v ---------------------------- v" >> $LOGFIL echo -n "copy started on " >> $LOGFIL date >> $LOGFIL echo " copy $srcdisk ($sname)" >> $LOGFIL echo " -> $dstdisk ($dname)" >> $LOGFIL echo " destination disk $dstdisk ($dname) $dstempty" >> $LOGFIL echo " copying $sbytes bytes ($mbytes Mbytes)" >> $LOGFIL echo " cbs=$cbs, ccnt=$ccnt, max=$max, obs=$obs, ocnt=$ocnt" >> $LOGFIL nerrs=0 skip=0 oseek=0 xcent=100 xmill=1000 mcent=$max mmill=$max if [ $max -gt 1048576 ]; then xcent=1 xmill=1 mcent=$(( ( $max + 99 ) / 100 )) mmill=$(( ( $max + 999 ) / 1000 )) fi # echo " xcent=$xcent, xmill=$xmill, mcent=$mcent, mmill=$mmill" >> $LOGFIL lastdisp=0 dispintv=0 while [ $skip -le $max ]; do # ŒvŽž cursec=`tinydate '+%s'` # ƒo[ƒOƒ‰ƒt p=$(( ( $xcent * $skip ) / $mcent )) m=$(( ( $xmill * $skip ) / $mmill )) q=$(( $p / 2 )) i=0 bar='' while [ $i -lt $q ]; do bar="$bar"'#' i=$(( $i + 1 )) done while [ $i -lt 50 ]; do bar="$bar"'_' i=$(( $i + 1 )) done # Žc‚莞ŠÔ elapsed=$(( $cursec - $startsec )) if [ $elapsed -gt 10 ]; then if [ $m -gt 0 ]; then remain=$(( ( 1000 - $m ) * $elapsed / $m + 1 )) if [ $remain -gt 120 ]; then rems=$(( ( $remain + 59 ) / 60 )) rems="Žc‚è ‚¨‚æ‚»${rems}•ª" else rems="Žc‚è ‚¨‚æ‚»${remain}•b" dispupd=10 fi fi fi if [ $elapsed -gt 120 ]; then elas=$(( ( $elapsed + 30 ) / 60 )) elas="${elas}•ª" dispupd=30 else elas="${elapsed}•b" fi # echo "copying $srcdisk to $dstdisk, $p % done. ($TTYNAME)" > $STATEFIL text="ƒfƒBƒXƒN ${srcdisk} ${sname} ‚Ì\n" text="${text}ƒf[ƒ^‚ð ${dstdisk} ${dname} ‚É\n" text="${text}${cbs}ƒoƒCƒg’PˆÊ‚ŃRƒs[‚µ‚Ä‚¢‚Ü‚·B\n" text="${text} ${p}% ($skip/$max) I—¹ ^ " text="${text}${elas} Œo‰ß ${rems} \n\n" text="${text} 0%|${bar}|100%" text="${text}\n${errormsg}" dispintv=$(( $cursec - $lastdisp )) if [ $dispintv -ge $dispupd ]; then dialog --title "$title" --infobox "$text" 9 72 lastdisp=$cursec else echo -e '\r\c' fi sh poko.sh echo -n " $status2 " case x$DEBUG in x[Yy]*) status2='now in debug mode...' errormsg='' sleep 1 ;; *) status=`dd if=/dev/$srcdisk ibs=$cbs skip=$skip conv=noerror,sync obs=$obs seek=$oseek count=$ccnt of=/dev/$dstdisk 2>&1` status2=`echo "$status" | sed -n '/transfer/p'` errormsg=`echo "$status" | sed -n -E '/records (in|out)$/!p' | sed -n '/transferred in/!p'` ;; esac # ‹L˜^ case x"$skip" in x0) echo "skip: $skip, $status2" >> $LOGFIL ;; esac case x"${nerrs}"x"${errormsg}" in x[0-8]x?*) echo "errmesg[${nerrs}]: $errormsg" >> $LOGFIL nerrs=$(( $nerrs + 1 )) ;; x9x?*) echo "errmesg[${nerrs}]: $errormsg" >> $LOGFIL echo "Too many errors encounterd..." >> $LOGFIL nerrs=$(( $nerrs + 1 )) ;; esac # ŽŸƒ‹[ƒv skip=$(( $skip + $ccnt )) oseek=$(( $oseek + $ocnt )) done sleep 2 # echo "skip: $skip, $status2" >> $LOGFIL echo "number of error messages: $nerrs" >> $LOGFIL echo -n "copy finished ($TTYNAME) on " >> $LOGFIL date >> $LOGFIL echo -n "$srcdisk ($sname, $sbytes)" >> $LOGFIL echo " -> $dstdisk ($dname, $dbytes)" >> $LOGFIL echo "^ ---------------------------- ^" >> $LOGFIL cursec=`tinydate '+%s'` elapsed=$(( $cursec - $startsec )) if [ $elapsed -gt 120 ]; then min=$(( $elapsed / 60 )) sec=$(( $elapsed - $min * 60 )) elas="${min}•ª${sec}•b" else elas="${elapsed}•b" fi echo "$disk copied ($elapsed [s]) ($TTYNAME)" > $STATEFIL sh chime.sh $CHIMEMIN & 2>&1 child=$! sh dummyread.sh dialog --title "$title" \ --msgbox "ƒfƒBƒXƒN‚̃Rƒs[‚ªI—¹‚µ‚Ü‚µ‚½ (${elas})" 5 72 kill $child > /dev/null 2>&1 # echo '# ---------------------------- #' 1>&2 exit 0 # EOF #! /bin/sh # # embr.sh -- MBR‚Ì‚ÝÁ‹Ž‚·‚é # # Žg‚¢•û: /bin/sh embr.sh ƒfƒBƒXƒN # ƒfƒBƒXƒN: ƒfƒoƒCƒXƒtƒ@ƒCƒ‹‚ÅŽw’èA擪‚Ìu/dev/v‚ÍÈ‚­ # —á: /bin/sh embr.sh ad0 # # 0.0: Dec. 21, 2006 by Dai ISHIJIMA (for wpout07) # 0.1: Feb. 10, 2007 (ƒƒO‹L˜^ for wpout08) # 0.2: Feb. 15, 2007 (ƒGƒ“ƒ^[ƒL[’·‰Ÿ‚µ‘Îô) # 0.3: Sep. 12, 2007 (wpout09) # 0.4: Jan. 2, 2008 (ƒƒOC³) # LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" dmesg="${DMESG:-/var/run/dmesg.boot}" disk="${1:-ad0}" echo '# ---------------------------- #' >> $LOGFIL echo -n "script $0 started on " >> $LOGFIL date >> $LOGFIL #if [ ! -w /dev/$disk ]; then # echo "$0: disk '$disk' does not exist or is not writable" # echo "Usage: $0 disk" # echo "Example: $0 ad0" # exit 1 #fi title="${TITLE:-ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx}" dname=`sed -n -E "/^${disk}:.*<.*>/p" $dmesg | sed 's/.*\(<.*>\).*/\1/'` msg="ƒfƒBƒXƒN ${disk} ${dname} ‚Ì\n" msg="${msg}MBR (ƒ}ƒXƒ^Eƒu[ƒgEƒŒƒR[ƒh; 擪ƒZƒNƒ^)\n" msg="${msg}*‚¾‚¯* ‚ðÁ‹Ž‚µ‚Ü‚·B\n" msg="${msg}\n" msg="${msg}MBR‚ðÁ‚·‚ÆAƒfƒBƒXƒNã‚Ì‚·‚ׂẴf[ƒ^‚ª\n" msg="${msg}‚È‚­‚È‚Á‚½‚©‚̂悤‚ÉŒ©‚¦‚Ü‚·B‚µ‚©‚µA\n" msg="${msg}•œŒ³ƒc[ƒ‹‚ÅŒ³‚É–ß‚·‚±‚Æ‚à‰Â”\‚È‚Ì‚Å\n" msg="${msg}î•ñ˜R‰k‚̊댯‚ª‚ ‚è‚Ü‚·B‚²’ˆÓ‚­‚¾‚³‚¢B\n" msg="${msg}\n ‚æ‚낵‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" --yesno "$msg" 15 52 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac msg="ƒfƒBƒXƒN ${disk} ‚ÌMBRÁ‹Ž‚𒆎~‚µ‚Ü‚·‚©?" sh dummyread.sh dialog --title "$title" \ --hline "$dname" \ --yesno "$msg" \ 5 72 case x"$?" in x0) dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac echo "v ---------------------------- v" >> $LOGFIL echo -n "erase MBR ($disk) started on " >> $LOGFIL date >> $LOGFIL case x$DEBUG in x[Yy]*) echo -n "now in debug mode..." echo 'debug mode' >> $LOGFIL ;; *) dd bs=512 count=1 if=/dev/zero of=/dev/$disk ;; esac sleep 3 # echo -n "erase MBR ONLY $disk ($dname) on " >> $LOGFIL date >> $LOGFIL echo "^ ---------------------------- ^" >> $LOGFIL sh dummyread.sh dialog --title "$title" \ --msgbox "MBR‚ÌÁ‹Ž‚ªI—¹‚µ‚Ü‚µ‚½" 5 64 exit 0 # EOF #! /bin/sh # # crlf.sh -- s––ƒR[ƒh‚ð LF (\n) ‚©‚ç CRLF (\r\n) ‚É # # 0.0: Feb. 5, 2007 by Dai ISHIJIMA # 0.1: Feb. 18, 2007 by Dai ISHIJIMA # cr=`echo -e '\r'` if sed 's/$/'"$cr"'/' ; then exit 0 else echo "crlf.sh: write failed" exit 1 fi # EOF#! /bin/sh # # floppylog.sh -- ƒtƒƒbƒs[‚ɃƒO‚ð‹L˜^‚·‚é # # Žg‚¢•û: /bin/sh floppylog.sh [ƒfƒBƒXƒN] # ƒfƒBƒXƒN: ƒfƒoƒCƒXƒtƒ@ƒCƒ‹‚ÅŽw’èA擪‚Ìu/dev/v‚ÍÈ‚­ # —á: /bin/sh floppylog.sh fd0 # # 0.0: Feb. 10, 2007 by Dai ISHIJIMA (for wpout08) # 0.1: Feb. 15, 2007 (ƒfƒBƒXƒN‚ð‘I‘ð‚·‚é) # 0.2: Feb. 15, 2007 (dmesg -a ‚ðÅŒã‚É) # 0.3: Feb. 18, 2007 (ƒLƒƒƒ“ƒZƒ‹Ž¸”sbugfix) # 0.4: Feb. 20, 2007 (ƒVƒFƒ‹•Ï”‚à) # 0.5: Feb. 21, 2007 (ì‹Æ“à—e‚ðʼnºs‚É•\Ž¦) # 0.6: Feb. 23, 2007 (‰ü—Ç: ì‹Æ“à—e‚ðʼnºs‚É•\Ž¦) # 0.7: Sep. 12, 2007 (wpout09) # 0.8: Oct. 6, 2007 (expr ‚Ì‘ã‚í‚è‚É $(( )) ) # 0.9: Mar. 22, 2014 (ƒGƒ‰[ƒƒO) # 1.0: Aug. 3, 2018 (‘€ì—š—ð) # 1.1: May. 21, 2020 for ‚Ń‹[ƒv, v2.0 # dmesg="${DMESG:-/var/run/dmesg.boot}" ERRORLOG="${ERRORLOG:-/tmp/wperrlog.txt}" disk="${1:-fd0}" resultfil=/tmp/result header=/tmp/header.txt #cd /tmp devfil=/tmp/devices.txt title="${TITLE:-ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx}" dialog --title "$TITLE" \ --infobox "ƒƒO‚Ì•Û‘¶æ‚ðŒŸõ‚µ‚Ä‚¢‚Ü‚·" 3 64 /bin/sh logdev.sh > $devfil if [ ! -s $devfil ]; then echo "no device to write log" >> $LOGFIL msg="ƒƒO‚Ì•Û‘¶æ‚ª‚݂‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½" sh dummyread.sh dialog --title "$title" --msgbox "$msg" 5 64 exit 1 fi devs=`cat $devfil` ndevs=0 for d in $devs ; do ndevs=$(( $ndevs + 1 )) done case x"$ndevs" in x0) echo "no device to write log" >> $LOGFIL msg="ƒƒO‚Ì•Û‘¶æ‚ª‚݂‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½" sh dummyread.sh dialog --title "$title" --msgbox "$msg" 5 64 exit 1 ;; esac taglist='' for dev in $devs ; do d=`echo $dev | sed 's/^\([a-z][a-z]*[0-9]\).*/\1/'` dname=`sed -n -E "/^${d}:.*<.*>/p" $dmesg | sed 's/.*\(<.*>\).*/\1/'` taglist="$taglist $dev '$dname'" done sh dummyread.sh eval dialog \ --title "'$title'" \ --menu "'ƒƒO‚Ì•Û‘¶æ‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢'" \ 10 72 3 \ $taglist \ 2>$resultfil case "$?" in 0) disk=`cat $resultfil` msg="ƒƒO‚ð ${disk} ‚É•Û‘¶‚µ‚Ü‚·" dialog --title "$title" --infobox "$msg" 3 64 ;; 1) dialog --title "$title" \ --infobox 'ƒƒO‚Ì•Û‘¶‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 # 2007-02-18 exit 1 ;; esac echo -e "\r \r\c" echo -n "mounting floppy" if ! mount_msdosfs -s /dev/$disk /floppy > /dev/null 2>&1; then msg="•Û‘¶æ ${disk} ‚ð‘‚«ž‚݃}ƒEƒ“ƒg‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½" dialog --title "$title" --msgbox "$msg" 5 64 exit 1 fi # Á‹ŽƒƒO cp /dev/null /tmp/eraselog.txt for i in /tmp/erase-log.* ; do if [ -s $i ]; then cat $i >> /tmp/eraselog.txt fi done if [ ! -s /tmp/eraselog.txt ]; then echo 'No erase log found' >> /tmp/eraselog.txt fi # Šm”FƒƒO cp /dev/null /tmp/verifylog.txt for i in /tmp/verify-log.* ; do if [ -s $i ]; then cat $i >> /tmp/verifylog.txt fi done if [ ! -s /tmp/verifylog.txt ]; then echo 'No verify log found' >> /tmp/verifylog.txt fi # ƒVƒFƒ‹•Ï” set > /tmp/environ.txt # cp /var/run/dmesg.boot /tmp # dmesg-a dmesg -a > /tmp/dmesg-a.txt echo "" > $header echo -n "####################################" >> $header echo "####################################" >> $header echo -n "following messages were logged on " >> $header date >> $header echo -n "====================================" >> $header echo "====================================" >> $header logs="dmesg.boot mm-error.txt wpoutlog.txt mbrlog.txt" logs="${logs} wperrlog.txt history.txt" logs="${logs} eraselog.txt verifylog.txt environ.txt dmesg-a.txt" logs="${logs} fd-mode.txt" cd /tmp for log in $logs ; do if [ -s $log ]; then echo -e "\r \r\c" echo -n "writing $log header" name=`echo $log | sed 's/.txt$//' | tr -d '\.'` if ! crlf.sh < $header >> /floppy/wipe-out/${name}.txt ; then umount /floppy msg="${log} ƒwƒbƒ_‚Ì‘‚«ž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½" dialog --title "$title" --msgbox "$msg" 5 64 exit 1 fi echo -e "\r \r\c" echo -n "writing $log body" if ! crlf.sh < $log >> /floppy/wipe-out/${name}.txt ; then umount /floppy msg="${log} –{‘Ì‚Ì‘‚«ž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½" dialog --title "$title" --msgbox "$msg" 5 64 exit 1 fi fi done umount /floppy dialog --title "$title" \ --msgbox "ƒƒO‚Ì‘‚«ž‚Ý‚ªI—¹‚µ‚Ü‚µ‚½" 5 64 exit 0 # EOF #! /bin/sh # # dummyread.sh -- ƒL[ƒ{[ƒh‚©‚ç“ü—Í‚³‚ê‚Ä‚¢‚镶Žš‚ð“Ç‚ñ‚ÅŽÌ‚Ä‚é # # 0.0: Feb. 12, 2007 by Dai ISHIJIMA (for wpout08) # while read -t 0 keyin > /dev/null 1>&2 ; do case x"$DEBUG" in xY*) echo "|$keyin|" ;; esac done exit 0 # EOF #! /bin/sh # # kon2start.sh -- ƒJƒEƒ“ƒgƒ_ƒEƒ“‚µ‚‚ÂA‚ǂ̃‚[ƒh‚ɈÚs‚·‚é‚©‘I‘ð # # 0.0: May 5, 2009 by Dai ISHIJIMA (as countdown.sh) # 0.1: Apr. 11, 2011 for wpout11 # 0.2: Oct. 11, 2013 (use /dev/ttyv0, wpout13) # 0.3: May 11, 2014 (comconsole -> serial console) # 0.4: Aug 3, 2015 (FreeBSD 9.3R, kon -s for single user mode) # 0.5: May 17, 2020 (FreeBSD 11.3R, legacy console mode, v0.8 based) # export TTY="${TTY:-ttyv0}" export LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" ####export TERMCAP=/etc/termcap export TERM=vt100 # for kon #### 12.x cursor color /usr.sbin/vidcontrol -c charcolors,base=2 echo '' echo 'Starting yet another console session on VTY1 (Alt+F2)' /wipeout/shell-on /dev/ttyv1 echo -n 'You can start yet another wipe-out session with ' > /dev/ttyv1 echo '"sh /wipeout/kon2alt.sh"' > /dev/ttyv1 echo -n "Starting console session on VTY1 " >> $LOGFIL date >> $LOGFIL export STATEFIL=/tmp/status.txt echo -n 'selecting console' > $STATEFIL echo 'Starting screen saver on VTY7 (Alt+F8)' /wipeout/shell-on /dev/ttyv7 /bin/sh /wipeout/scsaver.sh echo -n "Starting screen saver on VTY7 " >> $LOGFIL date >> $LOGFIL echo '' prompt="waiting for device to settle... (press SPACE to pause) " #count=5 # 2020-05-17 count=8 . /wipeout/ncountdown.sh echo '' echo '' echo '' echo "# select console mode" echo " 0: Start wipe-out on KON2 (Kanji on console) [default]" echo " 1: Start wipe-out on KON2 fixed for some Laptops" # 2020-05-17 echo " 9: Start wipe-out on Legacy Console (non-VGA) mode" if [ -c /dev/cuau0 ]; then echo " c: Start wipe-out on serial console (regacy serial, uart0)" fi if [ -c /dev/cuaU0 ]; then echo " u: Start wipe-out on serial console (USB adaptor, ucom0)" fi echo " S: Start interactive shell, stay in Native console (non Japanese)" prompt="# Just press ENTER to select default mode" count=9 keyin=0 . /wipeout/ncountdown.sh session > /tmp/session.txt export EPOCH=`sed -n '1p' < /tmp/session.txt` export SID=`sed -n '2p' < /tmp/session.txt` echo -n "kon2start with keyin = $keyin, " >> $LOGFIL date >> $LOGFIL touch /tmp/fd-mode.txt export KON2MODE=NONE case x"$keyin" in x*S*) /bin/sh -i ;; x*c*) export TTY=comconsole.cuau0 dmesg > /dev/cuau0 /wipeout/shell-on /dev/cuau0 /bin/sh /wipeout/startup.sh ;; x*u*) export TTY=comconsole.cuaU0 dmesg > /dev/cuaU0 /wipeout/shell-on /dev/cuaU0 /bin/sh /wipeout/startup.sh ;; x*0*) export KON2MODE=default echo 'default' > /tmp/kon2mode.txt /usr/local/bin/kon -s -e /wipeout/startup.sh \ < /dev/ttyv0 ;; x*9*) export KON2MODE=legacy_console echo 'legacy_console' > /tmp/kon2mode.txt cd /fd-mode script -a /tmp/fd-mode.txt /bin/sh /fd-mode/startup.sh ;; *) export KON2MODE=FIXed echo 'FIXed' > /tmp/kon2mode.txt /usr/local/bin/kon2fixed FIX -s -e /wipeout/startup.sh \ < /dev/ttyv0 ;; esac exit 0 # EOF #! /bin/sh # # kon2alt.sh -- start kon2 on another VTY session # 0.0: Aug. 7, 2015 (v1.5) # 0.1: Nov. 23, 2016 (v1.6) # PATH=/usr.bin:/usr/bin:/bin:/usr.sbin:/usr/sbin:/sbin:/usr/local/bin:/wipeout:. export PATH export TERM=vt100 export TTY=`/usr.bin/tty` export TTY="${TTY:-ttyv0}" export LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" n=`echo "$TTY" | sed 's/^.*\([0-9]\)/\1/'` n=$(( $n + 1 )) m=$(( $n + 1 )) ntty=`echo $TTY | sed 's/[0-9]$/'"$n"'/'` case x"$n" in x[0-6]) echo '' echo "Starting new console session on VTY$n (Alt+F$m)" /wipeout/shell-on $ntty echo -n 'You can start yet another wipe-out session with '> $ntty echo '"sh /wipeout/kon2alt.sh"' > $ntty echo -n "Starting console session on VTY$n" >> $LOGFIL date >> $LOGFIL ;; esac sleep 2 # 2016-12-07 KON2MODE='default' if [ -f /tmp/kon2mode.txt ]; then KON2MODE=`sed -n 1p /tmp/kon2mode.txt` fi export KON2MODE case x"$KON2MODE" in xF*) /usr/local/bin/kon2fixed FIX -s -e /wipeout/alt-menu.sh < $TTY ;; *) /usr/local/bin/kon -s -e /wipeout/alt-menu.sh < $TTY ;; esac # EOF #! /bin/sh # # vtsstart.sh -- ƒJƒEƒ“ƒgƒ_ƒEƒ“‚µ‚‚ÂA‚ǂ̃‚[ƒh‚ɈÚs‚·‚é‚©‘I‘ð # # 0.0: May 5, 2009 by Dai ISHIJIMA (as countdown.sh) # 0.1: Apr. 11, 2011 for wpout11 # 0.2: Oct. 11, 2013 (use /dev/ttyv0, wpout13) # 0.3: May 11, 2014 (comconsole -> serial console) # 0.4: Aug 3, 2015 (FreeBSD 9.3R, kon -s for single user mode) # 0.5: Jul. 26, 2016 (10.3R, vt), as vtstart.sh # export TTY="${TTY:-ttyv0}" export LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" ####export TERMCAP=/etc/termcap export TERM=vt100 # for kon echo '' echo 'Starting another console session on VTY3 (Alt+F4)' /wipeout/shell-on /dev/ttyv3 echo 'You can start another wipe-out session with "sh kon2alt.sh"' \ > /dev/ttyv3 echo -n "Starting console session on VTY3" >> $LOGFIL date >> $LOGFIL export STATEFIL=/tmp/status.txt echo -n 'selecting console' > $STATEFIL echo 'Starting screen saver on VTY7 (Alt+F8)' /wipeout/shell-on /dev/ttyv7 /bin/sh /wipeout/scsaver.sh echo -n "Starting screen saver on VTY7" >> $LOGFIL date >> $LOGFIL echo '' echo '' echo '' echo "# select console mode" echo " 0: Start wipe-out on VT console [default]" if [ -c /dev/cuau0 ]; then echo " c: Start wipe-out on serial console (regacy serial, uart0)" fi if [ -c /dev/cuaU0 ]; then echo " u: Start wipe-out on serial console (USB adaptor, ucom0)" fi echo " 2: Start interactive shell, stay in Native console (non Japanese)" prompt="# Just press ENTER to select default mode" count=9 while [ $count -gt 0 ]; do echo -e "\r$prompt[$count] \c" if read -t 1 keyin 1>/dev/null 2>&1 ; then count=0 fi count=$(( $count - 1 )) done case x"$count" in x0) echo -e "\r$prompt[0] 0" keyin=0 ;; esac echo -n "vtstart with keyin = $keyin, " >> $LOGFIL date >> $LOGFIL case x"$keyin" in x2) /bin/sh -i ;; xc) export TTY=comconsole.cuau0 dmesg > /dev/cuau0 /wipeout/shell-on /dev/cuau0 /bin/sh /wipeout/startup.sh ;; xu) export TTY=comconsole.cuaU0 dmesg > /dev/cuaU0 /wipeout/shell-on /dev/cuaU0 /bin/sh /wipeout/startup.sh ;; *) /usr.sbin/vidcontrol -f /usr/local/share/fonts/vt/paw16vt.fnt export LC_CTYPE=ja_JP.UTF-8 /bin/sh /wipeout/startup.sh ;; esac echo -n "vstart.sh finished, " >> $LOGFIL date >> $LOGFIL exit 0 # EOF #! /bin/sh # # sanitize.sh -- camcontrol sanitize ‚Ńf[ƒ^‚ðÁ‹Ž‚·‚é # # Žg‚¢•û: /bin/sh sanitize.sh ƒfƒBƒXƒN # —á: /bin/sh sanitize da0 # # 0.0: Aug. 4, 2015 by Dai ISHIJIMA (for wpout15, FreeBSD 9.3R) # ERRORLOG="${ERRORLOG:-/tmp/wperrlog.txt}" exec 2>> $ERRORLOG echo "# start $0, $@" 1>&2 echo '# ---------------------------- #' 1>&2 # ’P“Æ‚Å‚à“®‚­‚悤‚É LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" DMESG="${DMESG:-/var/run/dmesg.boot}" echo '# ---------------------------- #' >> $LOGFIL echo -n "script $0 started on " >> $LOGFIL date >> $LOGFIL echo "starting scsi sanitize ($TTYNAME)" > $STATEFIL # method="${1:-crypto}" disk="${2:-da0}" dmesg="${DMESG:-/var/run/dmesg.boot}" # resultfil=/tmp/result # title="${TITLE:-ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx}" # if [ ! -w /dev/$disk ]; then dialog --title "$title" \ --msgbox "ƒfƒBƒXƒN $disk ‚ª‘¶Ý‚µ‚È‚¢‚©A‘‚«ž‚Ý‚Å‚«‚Ü‚¹‚ñ" \ 5 64 exit 1 fi # mount -p | sed -n -E "/^.dev.$disk/p" > $resultfil if [ -s $resultfil ]; then dialog --title "$title" \ --msgbox "ƒ}ƒEƒ“ƒg’†‚̃fƒBƒXƒN $disk ‚ðÁ‹Ž‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ" \ 5 64 exit 1 fi dname=`sed -n -E "/^${disk}:.*<.*>/p" $dmesg | sed 's/.*\(<.*>\).*/\1/'` bytes=`disksize -B /dev/$disk` cap=`disksize -p /dev/$disk` msg="ƒfƒBƒXƒN ${disk} ${dname} ‚Ì\n" msg="${msg}‘Sƒf[ƒ^ ${bytes}ƒoƒCƒg‚ðA\n" msg="${msg}ƒTƒjƒ^ƒCƒY‹@”\ (Sanitize Device Feature) ‚ÅÁ‹Ž‚µ‚Ü‚·B\n" msg="${msg}\n ‚æ‚낵‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" --yesno "$msg" 9 64 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac msg="ATAƒfƒoƒCƒX‚âUSBÚ‘±‚̃fƒoƒCƒXAV‚µ‚­‚È‚¢SCSIƒfƒoƒCƒX‚Å‚Í\n" msg="${msg}ƒTƒjƒ^ƒCƒY (SCSI Sanitize) ‚ª“®ì‚µ‚È‚©‚Á‚½‚è\n" msg="${msg}³íI—¹‚µ‚Ä‚àƒf[ƒ^‚ÌÁ‹Ž‚ªŽÀs‚³‚ê‚Ä‚¢‚È‚¢‚±‚Æ‚ª‚ ‚è‚Ü‚·B\n" msg="${msg}\n ‚æ‚낵‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" --yesno "$msg" 9 64 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac msg="–{“–‚É${disk} ($cap) ‚̃f[ƒ^‚ðƒTƒjƒ^ƒCƒY‚µ‚Ä‚¢‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" \ --hline "$dname" \ --yesno "$msg" \ 5 72 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚ðƒTƒjƒ^ƒCƒY‚µ‚Ä‚¢‚Ü‚·' 3 64 sleep 2 # ŠJŽnŽž startstamp=`date '+%Y-%m-%d %H:%M'` # echo "v ---------------------------- v" >> $LOGFIL echo -n "sanitize $method ($TTYNAME) started on " >> $LOGFIL date >> $LOGFIL echo "erasing $disk with scsi sanitize ($TTYNAME)" > $STATEFIL date '+%s' > /tmp/secure-stamp-${TTYNAME}.txt sh waitsecure.sh /tmp/secure-stamp-${TTYNAME}.txt & echo "sanitize $method $disk ($dname) $bytes bytes" >> $LOGFIL script /tmp/sanitize-${TTYNAME}.txt \ /sbin/camcontrol sanitize $disk -a $method -y case x"$?" in x0) status="finished" echo "ƒTƒjƒ^ƒCƒY‚ͳíI—¹‚µ‚Ü‚µ‚½B" > /tmp/sanitizemsg.txt ;; *) status="failed" echo "ƒTƒjƒ^ƒCƒY‚Í“®ì‚µ‚Ü‚¹‚ñ‚Å‚µ‚½B" > /tmp/sanitizemsg.txt ;; esac cp /dev/null /tmp/secure-stamp-${TTYNAME}.txt echo '' >> $LOGFIL echo '::: Sanitize (camcontrol output) :::' >> $LOGFIL nkf -d /tmp/sanitize-${TTYNAME}.txt >> $LOGFIL echo 'ƒRƒ}ƒ“ƒhŽÀsŽž‚̃ƒO‚͈ȉº‚Ì‚Æ‚¨‚è‚Å‚·B' >> /tmp/sanitizemsg.txt #echo '«ªƒL[‚ŃXƒNƒ[ƒ‹‚µ‚Ü‚·B' >> /tmp/sanitizemsg.txt echo '' >> /tmp/sanitizemsg.txt echo '/* ======== */' >> /tmp/sanitizemsg.txt nkf -d /tmp/sanitize-${TTYNAME}.txt >> /tmp/sanitizemsg.txt echo "show result of scsi sanitize ($TTYNAME)" > $STATEFIL sh dummyread.sh dialog --title 'SCSIƒTƒjƒ^ƒCƒY‚̃ƒO' --textbox /tmp/sanitizemsg.txt 19 76 # echo -n "sanitize $status on " >> $LOGFIL date >> $LOGFIL echo "sanitize $disk ($dname, $cap)" >> $LOGFIL echo "^ ---------------------------- ^" >> $LOGFIL # I—¹Žž endstamp=`date '+%H:%M'` case x"$status" in xfinished) # ƒƒO•Û‘¶ echo 'The contents of this storage device' > /tmp/erase-log.$disk echo "$disk ($cap) '$dname'" >> /tmp/erase-log.$disk echo -n 'were erased with ' >> /tmp/erase-log.$disk echo 'hard disk wiping tool "wipe-out."' >> /tmp/erase-log.$disk echo "Erased with 'SANITIZE'" >> /tmp/erase-log.$disk echo " $startstamp -> $endstamp" >> /tmp/erase-log.$disk echo "but NOT verified" > /tmp/verify-log.$disk ;; esac # echo '# ---------------------------- #' 1>&2 exit 0 # EOF #! /bin/sh # # alt-menu.sh -- •ÊƒXƒ^[ƒgƒAƒbƒvƒXƒNƒŠƒvƒg (“ú–{Œê‰»ƒRƒ“ƒ\[ƒ‹—p) # # 0.0: Aug. 7, 2015 (for v15, FreeBSD 9.3R), from startup.sh, v1.0 # PATH=/usr.bin:/usr/bin:/bin:/usr.sbin:/usr/sbin: PATH="${PATH}"':'"/sbin:/usr/local/bin:/wipeout:." export PATH ##PATH=/usr/bin:/bin:/usr/sbin:/sbin:/:. ##export PATH LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" DMESG="${DMESG:-/var/run/dmesg.boot}" export DMESG ####echo -n '‹N“®Žž‚̃VƒXƒeƒ€ƒƒbƒZ[ƒW‚ð•Û‘¶‚µ‚Ä‚¢‚Ü‚·...' ####dmesg > $DMESG echo '' # umd0v‚ªs“ª‚ÉŒ»‚ê‚és”Ô†‚𒲂ׂéB•¡”‚ ‚ê‚Îd•¡ lin1=`sed -n '/^md0/=' $DMESG | sed -n '1p'` lin2=`sed -n '/^md0/=' $DMESG | sed -n '$p'` if [ $lin1 -ne $lin2 ]; then echo 'ƒVƒXƒeƒ€ƒƒbƒZ[ƒW‚ªd•¡‚µ‚Ä‚¢‚Ü‚·B' echo 'ˆê“x“dŒ¹‚ðØ‚Á‚Ä‚©‚çÄ‹N“®‚·‚邱‚Æ‚ð„§‚µ‚Ü‚·B' echo 'ˆ—‚ð‘±s‚·‚éꇂÍuexitv‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B' /bin/sh -i fi echo '# ---------------------------- #' >> $LOGFIL echo -n "script startmenu2.sh started on " >> $LOGFIL date >> $LOGFIL ####export TERMCAP=/etc/termcap export TERM=kons25jx export PATTERNFIL=/tmp/pattern.dat # 2013-12-07 names of disk device node # !ata(4) -> ad (P-ATA: ad0, S-ATA: ad4, etc.) # ada(4) -> ada (SATA/PATA, FreeBSD 9.3R) # SCSI (da(4)) -> da (SCSI, CAM) # ataraid(4) -> ar # aac(4) -> aacd # amr(4) -> amrd(?) or da(?) (SCSI CAM) # arcmsr(4) -> da (SCSI CAM) # asr(4) -> da(?) (SCSI CAM) # graid3(4) -> da (SCSI CAM) # hptiop(4) -> da(?) # hptmv(4) -> da(?) # hptrr(4) -> da(?) # ida(4) -> idad(?), da(?) # iir(4) -> da(?) # ips(4) -> ipsd(?), da(?) # mfi(4) -> mfid # mlx(4) -> mlxd(?), da(?) # mly(4) -> da(?) # twa(4) -> da(?) # twe(4) -> da(?) export DEVICES='da|ada|ar|aacd|amrd|idad|ipsd|mfid|mlxd|twed' # ˆê“x‚É32MƒoƒCƒg‚¸‚ÂÁ‚· BLKLEN=$(( 32 * 1024 * 1024 )) export BLKLEN # o—̓uƒƒbƒN’·‚Í1MƒoƒCƒg OBS=$(( 1024 * 1024 )) export OBS # “ü—̓uƒƒbƒN’· (stuff‚Ìo—Í’·) ‚Í1kƒoƒCƒg IBS=1024 export IBS # Á‹ŽŠm”F‚Í10MƒoƒCƒg‚¸‚ VBLKLEN=$(( 10 * 1024 * 1024 )) export VBLKLEN # Á‹ŽŠm”F‚Ì“ü—̓uƒƒbƒN’·‚Í1MƒoƒCƒg VBS=$(( 1024 * 1024 )) export VBS # ƒRƒs[Žž‚Í512ƒoƒCƒg‚¸‚ CBS=512 export CBS echo '' # debugging case x"$DEBUG" in x[Yy]*) for i in 1 2 3 ; do echo -n '.' sleep 1 done echo '' ;; esac cd /wipeout ####stuff -g > $PATTERNFIL echo "random pattern file $PATTERNFIL generated" >> $LOGFIL if ! /bin/sh mainmenu.sh ; then exit 1 fi # ‚Æ‚è‚ ‚¦‚¸‘ΘbƒVƒFƒ‹‚ð“®‚©‚µ‚Ä‚¨‚­ :-) /bin/sh -i exit 0 # EOF #! /bin/sh # # scsaver.sh -- ƒXƒNƒŠ[ƒ“ƒZ[ƒo[ # # 0.0: Nov. 8, 2015 by Dai ISHIJIMA (for wpout15) # STATEFIL="${STATEFIL:-/tmp/status.txt}" HISTFIL="${HISTFIL:-/tmp/history.txt}" xpos=0 ypos=0 xmov=13 ymov=19 xmax=40 ymax=23 while true ; do npid=`sh -c 'echo "$$"'` #nsec=`date '+%S'` ### 08 ‚Æ‚©‚̓Gƒ‰[ xpos=$(( (( $xpos + $xmov + $npid ) % xmax) + 1 )) ypos=$(( (( $ypos + $ymov + $npid ) % ymax) + 1 )) # clear screen echo -e '\e[H\e[J\c' # move cursor echo -e '\e['"$ypos"';'"$xpos"'H\c' if [ -s $STATEFIL ]; then sed -n '$p' < $STATEFIL else sed -n '$p' < $HISTFIL fi ypos=$(( $ypos + 1 )) echo -e '\e['"$ypos"';'"$xpos"'H\c' echo -n 'Alt+F1 to main screen...' sleep 3 done#! /bin/sh # # atasecurity.sh -- camcontrol security ‚Ńf[ƒ^‚ðÁ‹Ž‚·‚é # # Žg‚¢•û: /bin/sh atasecurity.sh •û–@ ƒfƒBƒXƒN # —á: /bin/sh atasecurity -e ada0 # # 0.0: Aug. 4, 2015 by Dai ISHIJIMA (for wpout15, FreeBSD 9.3R) # 0.1: May 20, 2020 for wpout20, FreeBSD 11.3R # ERRORLOG="${ERRORLOG:-/tmp/wperrlog.txt}" exec 2>> $ERRORLOG echo "# start $0, $@" 1>&2 echo '# ---------------------------- #' 1>&2 # ’P“Æ‚Å‚à“®‚­‚悤‚É LOGFIL="${LOGFIL:-/tmp/wpoutlog.txt}" DMESG="${DMESG:-/var/run/dmesg.boot}" echo '# ---------------------------- #' >> $LOGFIL echo -n "script $0 started on " >> $LOGFIL date >> $LOGFIL echo "starting ata security ($TTYNAME)" > $STATEFIL # method="${1:--e}" disk="${2:-ada0}" dmesg="${DMESG:-/var/run/dmesg.boot}" # resultfil=/tmp/result # title="${TITLE:-ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx}" # if [ ! -w /dev/$disk ]; then dialog --title "$title" \ --msgbox "ƒfƒBƒXƒN $disk ‚ª‘¶Ý‚µ‚È‚¢‚©A‘‚«ž‚Ý‚Å‚«‚Ü‚¹‚ñ" \ 5 64 exit 1 fi # mount -p | sed -n -E "/^.dev.$disk/p" > $resultfil if [ -s $resultfil ]; then dialog --title "$title" \ --msgbox "ƒ}ƒEƒ“ƒg’†‚̃fƒBƒXƒN $disk ‚ðÁ‹Ž‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ" \ 5 64 exit 1 fi /bin/sh logdev.sh > /tmp/devices.txt if [ -s /tmp/devices.txt ]; then sed -n "/$disk/p" /tmp/devices.txt > /tmp/checkdev.txt 2>&1 if [ -s /tmp/checkdev.txt ]; then sh dummyread.sh msg="${disk}‚Íuwipe-outv‚Ì‹N“®ƒƒfƒBƒA‚ÆŽv‚í‚ê‚Ü‚·BÁ‹Ž‚µ‚Ü‚·‚©?\n" msg="${msg}\n ‚æ‚낵‚¢‚Å‚·‚©?" dialog --title "$title" --yesno "$msg" 9 64 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac fi fi dname=`sed -n -E "/^${disk}:.*<.*>/p" $dmesg | sed 's/.*\(<.*>\).*/\1/'` bytes=`disksize -B /dev/$disk` cap=`disksize -p /dev/$disk` msg="ƒfƒBƒXƒN ${disk} ${dname} ‚Ì\n" msg="${msg}‘Sƒf[ƒ^ ${bytes}ƒoƒCƒg‚ðA\n" msg="${msg}ƒZƒLƒ…ƒAÁ‹Ž (ATA Security) ‚ÅÁ‹Ž‚µ‚Ü‚·B\n" msg="${msg}\n ‚æ‚낵‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" --yesno "$msg" 9 64 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac msg="P-ATAƒfƒoƒCƒX‚âSCSIƒfƒoƒCƒXAUSBÚ‘±‚̃fƒoƒCƒX‚Å‚Í\n" msg="${msg}ƒZƒLƒ…ƒAÁ‹Ž (ATA Security) ‚ª“®ì‚µ‚È‚©‚Á‚½‚è\n" msg="${msg}³íI—¹‚µ‚Ä‚àƒf[ƒ^‚ÌÁ‹Ž‚ªŽÀs‚³‚ê‚Ä‚¢‚È‚¢‚±‚Æ‚ª‚ ‚è‚Ü‚·B\n" msg="${msg}\n ‚æ‚낵‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" --yesno "$msg" 9 64 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac msg="–{“–‚É${disk} ($cap) ‚̃f[ƒ^‚ðƒZƒLƒ…ƒAÁ‹Ž‚µ‚Ä‚¢‚¢‚Å‚·‚©?" sh dummyread.sh dialog --title "$title" \ --hline "$dname" \ --yesno "$msg" \ 5 72 case x"$?" in x1) dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚ÌÁ‹Ž‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ü‚µ‚½' 3 64 sleep 2 exit 1 ;; esac dialog --title "$title" \ --infobox 'ƒfƒBƒXƒN‚ðƒZƒLƒ…ƒAÁ‹Ž‚µ‚Ä‚¢‚Ü‚·' 3 64 sleep 2 # ŠJŽnŽž startstamp=`date '+%Y-%m-%d %H:%M'` # echo "v ---------------------------- v" >> $LOGFIL echo -n "ata security $method ($TTYNAME) started on " >> $LOGFIL date >> $LOGFIL date '+%s' > /tmp/secure-stamp-${TTYNAME}.txt sh waitsecure.sh /tmp/secure-stamp-${TTYNAME}.txt & child="$!" echo "ata security $method $disk ($dname) $bytes bytes" >> $LOGFIL echo "confirm ata security ($TTYNAME)" > $STATEFIL script /tmp/sanitize-${TTYNAME}.txt \ /sbin/camcontrol security $disk -U user case x"$?" in x0) stat="ok" echo "ƒZƒLƒ…ƒAÁ‹Ž‚ÌŽ–‘OŠm”F‚ͳíI—¹‚µ‚Ü‚µ‚½" > /tmp/sanitizemsg.txt ;; *) stat="failed" echo "ƒZƒLƒ…ƒAÁ‹Ž‚ÌŽ–‘OŠm”F‚Í“®ì‚µ‚Ü‚¹‚ñ‚Å‚µ‚½" > /tmp/sanitizemsg.txt cp /dev/null /tmp/secure-stamp-${TTYNAME}.txt ;; esac kill $child > /dev/null 2>&1 echo 'erase time: UNKNOWN' > /tmp/erasetime.txt case "x${method}" in x-e) sed -n '/^erase time/p' < /tmp/sanitize-${TTYNAME}.txt \ >> /tmp/erasetime.txt ;; *) sed -n '/^erase time/p' < /tmp/sanitize-${TTYNAME}.txt \ >> /tmp/erasetime.txt ;; esac erasetime=`sed -n '$p' < /tmp/erasetime.txt` echo "erasetime = $erasetime" >> $LOGFIL echo '' >> $LOGFIL echo '::: ATA Security (camcontrol output) :::' >> $LOGFIL nkf -d /tmp/sanitize-${TTYNAME}.txt >> $LOGFIL nkf -d /tmp/sanitize-${TTYNAME}.txt >> /tmp/sanitizemsg.txt echo '' >> /tmp/sanitizemsg.txt case x"$stat" in xok) sh waitsecure.sh /tmp/secure-stamp-${TTYNAME}.txt & child="$!" echo "erasing $disk with ata security ($TTYNAME)" > $STATEFIL script /tmp/sanitize-${TTYNAME}.txt \ /sbin/camcontrol security $disk -U user -y -s wipe $method wipe status="$?" kill $child > /dev/null 2>&1 case "x$status" in x0) status="finished" echo "ƒZƒLƒ…ƒAÁ‹Ž‚ͳíI—¹‚µ‚Ü‚µ‚½" >> /tmp/sanitizemsg.txt echo "ƒZƒLƒ…ƒAÁ‹Ž‚ͳíI—¹‚µ‚Ü‚µ‚½B" > /tmp/dialogmsg.txt cp /dev/null /tmp/secure-stamp-${TTYNAME}.txt ;; *) status="failed" echo "ƒZƒLƒ…ƒAÁ‹Ž‚Í“®ì‚µ‚Ü‚¹‚ñ‚Å‚µ‚½" >> /tmp/sanitizemsg.txt echo "ƒZƒLƒ…ƒAÁ‹Ž‚Í“®ì‚µ‚Ü‚¹‚ñ‚Å‚µ‚½B" > /tmp/dialogmsg.txt cp /dev/null /tmp/secure-stamp-${TTYNAME}.txt ;; esac nkf -d /tmp/sanitize-${TTYNAME}.txt >> $LOGFIL nkf -d /tmp/sanitize-${TTYNAME}.txt >> /tmp/sanitizemsg.txt esac cp /dev/null /tmp/secure-stamp-${TTYNAME}.txt echo -n 'ƒRƒ}ƒ“ƒhŽÀsŽž‚̃ƒO‚͈ȉº‚Ì‚Æ‚¨‚è‚Å‚·B' >> /tmp/dialogmsg.txt echo '«ªƒL[‚ŃXƒNƒ[ƒ‹‚µ‚Ü‚·B' >> /tmp/dialogmsg.txt echo '' >> /tmp/dialogmsg.txt echo '/* ======== */' >> /tmp/dialogmsg.txt cat /tmp/sanitizemsg.txt >> /tmp/dialogmsg.txt echo "show result of ata security ($TTYNAME)" > $STATEFIL sh dummyread.sh dialog --title 'ƒZƒLƒ…ƒAÁ‹Ž‚̃ƒO' --textbox /tmp/dialogmsg.txt 19 76 # echo -n "sanitize $status on " >> $LOGFIL date >> $LOGFIL echo "sanitize $disk ($dname, $cap)" >> $LOGFIL echo "^ ---------------------------- ^" >> $LOGFIL # I—¹Žž endstamp=`date '+%H:%M'` case x"$status" in xfinished) # ƒƒO•Û‘¶ echo 'The contents of this storage device' > /tmp/erase-log.$disk echo "$disk ($cap) '$dname'" >> /tmp/erase-log.$disk echo -n 'were erased with ' >> /tmp/erase-log.$disk echo 'hard disk wiping tool "wipe-out."' >> /tmp/erase-log.$disk echo "Erased with 'ATA SECURITY'" >> /tmp/erase-log.$disk echo " $startstamp -> $endstamp" >> /tmp/erase-log.$disk echo "but NOT verified" > /tmp/verify-log.$disk ;; esac # echo '# ---------------------------- #' 1>&2 exit 0 # EOF #! /bin/sh # # waitsecure.sh # fil="$1" startsec=`cat $1` sleep 30 while [ -s $fil ]; do cursec=`date '+%s'` elapsed=$(( $cursec - $startsec )) if [ $elapsed -gt 120 ]; then elas=$(( ( $elapsed + 30 ) / 60 )) elas="${elas}•ª" else elas="${elapsed}•b" fi text="ƒZƒLƒ…ƒAÁ‹Ž’†‚Å‚·B${elas}Œo‰ß" dialog --title "$title" --infobox "$text" 5 72 sleep 30 done exit 0 # EOF#! /bin/sh # # chime.sh -- ‰¹‚Å’m‚点‚é # # 0.0: May 22, 2020 by Dai ISHIJIMA (v2.0, FreeBSD 11.3R) # min=10 case x"$1" in x[0-9]*) min=$1 ;; esac timeout=$(( ($min + 0) * 60 )) waitfor=$(( ($timeout + 2) / 2 )) speaker=/dev/speaker if [ $timeout -le 0 ]; then exit 0 fi sleep $waitfor while true; do if [ -w $speaker ]; then # Œ»Ý‚̃J[ƒ\ƒ‹ˆÊ’u‚ð•Û‘¶‚µ‚ÄAʼnºs‚Ì擪‚Ɉړ® echo -e '\e7\e[24;1H\c' echo -n "ôCHIME" # Œ³ƒJ[ƒ\ƒ‹ˆÊ’u‚É–ß‚· echo -e '\e8\c' echo "t80 ceddec n0 ecddec" > /dev/speaker fi echo -e '\e7\e[24;1H\c' echo -n "¥ MUTE" echo -e '\e8\c' sleep $timeout done exit 0 # EOF #! /bin/sh # # timer.sh -- Œo‰ßŽžŠÔ‚ð•\Ž¦ # # 0.0: May 18, 2020 (for v20, FreeBSD 11.3R) # # opt1="$1" opt2="$2" epoch=`date '+%s'` #sleep 30 lastmin=0 current=`date '+%s'` elapsed=$(( $current - $epoch )) min=$(( $elapsed / 60 )) hh=$(( $elapsed / 3600 )) mm=$(( ($elapsed - hh * 3600) / 60 )) ss=$(( $elapsed - hh * 3600 - $mm * 60 )) trap '/bin/sh show-elapsed.sh "$elapsed"; exit 0' 1 2 15 sleep 10 while true; do echo -e "\r\c" current=`date '+%s'` elapsed=$(( $current - $epoch )) min=$(( $elapsed / 60 )) hh=$(( $elapsed / 3600 )) mm=$(( ($elapsed - hh * 3600) / 60 )) ss=$(( $elapsed - hh * 3600 - $mm * 60 )) if [ $elapsed -le 60 ]; then case "x${elapsed}x" in x*[0]x) echo $1 "$elapsed [sec]" "$2" ;; esac elif [ $elapsed -le 120 ]; then mod2=$(( $elapsed - ($elapsed / 20 ) * 20 )) if [ $mod2 -eq 0 ]; then echo $1 "$elapsed [sec]" "$2" fi elif [ $elapsed -le 600 ]; then if [ $ss -eq 0 ]; then if [ $lastmin -le $min ]; then echo $1 "$min [min]" "$2" fi fi elif [ $elapsed -le 1800 ]; then mod2=$(( $min - ($min / 5) * 5 )) if [ '(' $ss -eq 0 ')' -a '(' $mod2 -eq 0 ')' ]; then if [ $lastmin -le $min ]; then echo $1 "$min [min]" "$2" fi fi elif [ $elapsed -le 3600 ]; then mod2=$(( $min - ($min / 15 ) * 15 )) if [ '(' $ss -eq 0 ')' -a '(' $mod2 -eq 0 ')' ]; then if [ $lastmin -le $min ]; then echo $1 "$min [min]" "$2" fi fi else mod2=$(( $min - ($min / 30 ) * 30 )) if [ '(' $ss -eq 0 ')' -a '(' $mod2 -eq 0 ')' ]; then if [ $lastmin -le $min ]; then echo $1 "$min [min]" "$2" fi fi fi sh poko.sh lastmin=$min sleep 1 done exit 0 # EOF #! # # poko.sh -- ‚Û‚±‚Û‚± # curtty=`tty | sed 's|/|-|g'` if [ ! -w /tmp/poko-$curtty.txt ]; then touch /tmp/poko-$curtty.txt fi pokochar=`sed -n '1p' < /tmp/poko-$curtty.txt` case "x${pokochar}x" in xO*) pokochar='›' ;; xo*) pokochar='O ' ;; xB*) pokochar='o ' ;; x.*) pokochar='B' ;; *) pokochar='. ' ;; esac echo -n "$pokochar " echo "$pokochar" > /tmp/poko-$curtty.txt exit 0 # EOF #! /bin/sh # # ƒƒO•Û‘¶æƒfƒoƒCƒX‚ð’T‚· # # 0.0: May 21, 2020 by Dai ISHIJIMA (for v2.0, FreeBSD 11.3R) # searchfor="/dev/fd0 /dev/da0 /dev/da*s*" ndevs=0 cp /dev/null /tmp/logdevs.txt for dev in $searchfor ; do if [ -w $dev ]; then echo -e "\r \r\c" 1>&2 echo -n "checking $dev" 1>&2 if mount_msdosfs -s -o rdonly $dev /floppy > /dev/null 2>&1; then if [ -d /floppy/wipe-out ]; then echo $dev >> /tmp/logdevs.txt ndevs=$(( $ndevs + 1 )) fi umount /floppy fi fi done cat "/tmp/logdevs.txt" | sed 's|/dev/||' exit 0 # EOF #! /bin/sh # # show-elapsed.sh -- Œo‰ßŽžŠÔ‚ð•\Ž¦ # # 0.0: May 21, 2020 by Dai ISHIJIMA (v2.0, FreeBSD 11.3R) # elapsed="$1" hh=$(( $elapsed / 3600 )) mm=$(( ($elapsed - hh * 3600) / 60 )) ss=$(( $elapsed - hh * 3600 - $mm * 60 )) echo '' echo "# ------------------------------ #" if [ $elapsed -le 60 ]; then echo "${ss}s" elif [ $elapsed -le 3660 ]; then echo "${mm}m${ss}s" else echo "${hh}h${mm}m${ss}s" fi echo "# ------------------------------ #" exit 0 #! /bin/sh # inputs # prompt="press ENTER key or wait a second... " # count=5 # output # keyin keyin=0 while [ $count -ge 0 ]; do echo -e "\r$prompt[$count] \c" if tread -t 1 -e 1 > /tmp/keyin; then count=0 keyin=`sed -n 1p /tmp/keyin` fi count=$(( $count - 1 )) done echo '' ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹uwipe-outvƒo[ƒWƒ‡ƒ“ 2.2 Copyright (C) 2022 by ‚¢‚µ‚¶‚Ü™‚¾‚¢ E‚±‚̃c[ƒ‹‚ÍAƒIƒyƒŒ[ƒeƒBƒ“ƒOƒVƒXƒeƒ€‚ÉuFreeBSDv‚ð—˜—p‚µ‚Ä‚¢‚Ü‚·B E‚±‚̃c[ƒ‹‚ÍA“ú–{ŒêƒRƒ“ƒ\[ƒ‹ukon2v‚ð—˜—p‚µ‚Ä‚¢‚Ü‚·B E‚±‚̃c[ƒ‹‚ÍA“ú–{ŒêƒtƒHƒ“ƒg‚Éu‚Ï‚¤ƒtƒHƒ“ƒgv‚ð—˜—p‚µ‚Ä‚¢‚Ü‚·B Eƒƒjƒ…[•\Ž¦‚É‚ÍAuFreeBSDv‚Ìudialog(1)vƒRƒ}ƒ“ƒh‚ð—˜—p‚µ‚Ä‚¢‚Ü‚·B ‚±‚êˆÈŠO‚É‚àuFreeBSDv‚É•t‚·‚éŠeŽíƒ\ƒtƒgƒEƒFƒA‚ð—˜—p‚µ‚Ä‚¢‚Ü‚·B E‚±‚̃c[ƒ‹‚ÍAFreeBSD/i386‚ª“®ì‚·‚éƒRƒ“ƒsƒ…[ƒ^‚Å—˜—p‚Å‚«‚Ü‚·B E‚±‚̃c[ƒ‹‚Ńf[ƒ^‚ðÁ‹Ž‚Å‚«‚éƒn[ƒhƒfƒBƒXƒNiƒXƒgƒŒ[ƒWƒfƒoƒCƒXj‚Í ŽŸ‚Ì‚Æ‚¨‚è‚Å‚·B EFreeBSD 12.3R‚̃Cƒ“ƒXƒg[ƒ‹—pƒJ[ƒlƒ‹‚ňµ‚¦‚é‚à‚Ì‚Ì‚¤‚¿A ˆÈ‰º‚ÌðŒ‚ð–ž‚½‚·‚à‚Ì EƒJ[ƒlƒ‹‚ɃfƒoƒCƒXƒhƒ‰ƒCƒo‚ª‘g‚Ýž‚Ü‚ê‚Ä‚¢‚éƒCƒ“ƒ^[ƒtƒFƒCƒX ‚ÉÚ‘±‚³‚ꂽƒn[ƒhƒfƒBƒXƒNiƒXƒgƒŒ[ƒWƒfƒoƒCƒXj EATAƒfƒBƒXƒNƒRƒ“ƒgƒ[ƒ‰ƒhƒ‰ƒCƒo ada(4) ‚ňµ‚¦‚é‚à‚Ì Eˆê”Ê“I‚ÈATA/IDEƒCƒ“ƒ^[ƒtƒFƒCƒX‚̃n[ƒhƒfƒBƒXƒN ESCSIƒ_ƒCƒŒƒNƒgƒAƒNƒZƒXƒfƒoƒCƒXƒhƒ‰ƒCƒo da(4) ‚ňµ‚¦‚é‚à‚Ì Eˆê”Ê“I‚ÈSCSIƒCƒ“ƒ^[ƒtƒFƒCƒX‚̃n[ƒhƒfƒBƒXƒN ESCSIƒRƒ“ƒgƒ[ƒ‰‚ÉÚ‘±‚³‚ꂽMOiŒõŽ¥‹CƒfƒBƒXƒNj‚Å ƒZƒNƒ^ƒTƒCƒY‚ª512ƒoƒCƒg‚Ì‚à‚Ì EFreeBSD‚ňµ‚¦‚éRAIDƒRƒ“ƒgƒ[ƒ‰iasr(4) ‚È‚Çj‚É Ú‘±‚³‚ꂽƒn[ƒhƒfƒBƒXƒN EUSBƒƒ‚ƒŠƒJ[ƒhƒAƒ_ƒvƒ^‚ÉÚ‘±‚µ‚½ ŠeŽíƒtƒ‰ƒbƒVƒ…ƒƒ‚ƒŠƒJ[ƒh‚âAUSBƒtƒ‰ƒbƒVƒ…ƒƒ‚ƒŠ‚È‚Ç‚Ì USB‘å—e—ʃXƒgƒŒ[ƒW EŽŸ‚̂悤‚ȃXƒgƒŒ[ƒWƒfƒoƒCƒX‚ɂ͑Ήž‚µ‚Ä‚¢‚Ü‚¹‚ñ EFreeBSD 12.3R‚̃Cƒ“ƒXƒg[ƒ‹—pƒJ[ƒlƒ‹‚ňµ‚¦‚È‚¢‚à‚Ì‚â ƒu[ƒgŽž‚ɳ‚µ‚­”FŽ¯‚Å‚«‚È‚¢ƒXƒgƒŒ[ƒWƒfƒoƒCƒX EFreeBSD‚ňµ‚¦‚È‚¢ƒCƒ“ƒ^[ƒtƒFƒCƒX‚ÉÚ‘±‚³‚ꂽƒfƒBƒXƒN Eada(4) ‚¨‚æ‚Ñ da(4) ƒfƒoƒCƒXƒhƒ‰ƒCƒo‚ňµ‚¦‚È‚¢‚à‚Ì E‚±‚̃c[ƒ‹‚ð—˜—p‚µ‚½A‚ ‚é‚¢‚Í—˜—p‚µ‚È‚©‚Á‚½‚±‚Æ‚É‚æ‚Á‚Ķ‚¶‚½ ‚¢‚©‚Ȃ錋‰Ê‚ɂ‚¢‚Ä‚àAìŽÒ‚ÍÓ”C‚ðˆêØ•‰‚¢‚Ü‚¹‚ñB ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹uwipe-outv version 2.2 ` ŠÈ’P‘€ì‚Ńn[ƒhƒfƒBƒXƒN‚̃f[ƒ^‚ðÁ‹Ž‚·‚é ` Copyright (C) 2022 by Dai ISHIJIMA œ‚Í‚¶‚ß‚É ƒpƒ\ƒRƒ“‚Ì÷“nŽž‚∕ªŽž‚ÉAƒn[ƒhƒfƒBƒXƒN‚̃f[ƒ^‚ªÁ‚³‚ꂸ‚É Žc‚Á‚Ä‚¢‚邱‚Æ‚ªŒ´ˆö‚ÅAŒÂlî•ñ‚âŠé‹Æî•ñ‚È‚Ç‚ª˜R‰k‚·‚邱‚Æ‚ª–â ‘è‚Æ‚È‚Á‚Ä‚¢‚Ü‚·B ‚±‚Ìuƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outxv‚ðŽg‚¤‚ÆAŠÈ’P‚ÉA ‚©‚ˆÀ‘S‚ÉAƒn[ƒhƒfƒBƒXƒN‚É‹L˜^‚³‚ê‚Ä‚¢‚éƒf[ƒ^‚ðÁ‹Ž‚·‚邱‚Æ‚ª ‚Å‚«‚Ü‚·B‚±‚̃c[ƒ‹‚ÍAƒn[ƒhƒfƒBƒXƒN‚Ƀf[ƒ^‚ðã‘‚«‚·‚邱‚Æ‚É ‚æ‚Á‚ÄA‹L˜^‚³‚ê‚Ä‚¢‚½ƒf[ƒ^‚ðÁ‹Ž‚µ‚Ü‚·B œ‚±‚ÌCD‚Ì’†g ‚±‚ÌCD‚̓u[ƒ^ƒuƒ‹CD‚Å‚·Bƒpƒ\ƒRƒ“‚ðCD‚âDVDƒhƒ‰ƒCƒu‚©‚ç‹N“®‚Å ‚«‚é‚悤‚Éݒ肵A‚±‚ÌCD‚©‚ç‹N“®‚·‚é‚ÆAuwipe-outv‚ª“®‚«‚Ü‚·B œƒfƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· ‚±‚ÌCD‚©‚çƒu[ƒg‚·‚é‚ÆAŽŸ‚̂悤‚ȃƒjƒ…[‰æ–Ê‚ª•\Ž¦‚³‚ê‚Ü‚·B ƒn[ƒhƒfƒBƒXƒN‚Ì–¼‘O‚â—e—Ê (‚±‚Ì—á‚Å‚Íu/dev/ad0 vu4,294,967,296 ƒoƒCƒg (4.0G)v) ‚ÍAŽÀÛ‚É‚¨Žg‚¢‚̃n[ƒh ƒfƒBƒXƒN‚Ìî•ñ‚ª•\Ž¦‚³‚ê‚Ü‚·B +---------------- ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outx ----------------+ | šƒƒCƒ“ƒƒjƒ…[š | | Œ»Ý‘I‘𒆂̃fƒBƒXƒN‚Í /dev/ad0 ‚Å‚·B | | ƒfƒBƒXƒN‚Ì—e—Ê‚Í 4,294,967,296 ƒoƒCƒg (4.0G) ‚Å‚·B | | ˆÈ‰º‚̃ƒjƒ…[‚©‚爗‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢B | | | | +------------------------------------------------------------------+ | | | z 0‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· | | | | h ‘€ì•û–@‚ÌŠT—v‚ð•\Ž¦‚·‚é | | | | n •¡”‰ñã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ð”O“ü‚è‚ÉÁ‚· | | | | m ”O“ü‚èÁ‹Ž‚Ìã‘‚«•û–@‚ð‘I‘ð‚·‚é | | | | v ƒf[ƒ^‚ªÁ‹Ž‚³‚ꂽ‚©Šm”F‚·‚é (‚‘¬^ˆê•”‚ðƒ`ƒFƒbƒN) | | | | V ƒf[ƒ^‚ªÁ‹Ž‚³‚ꂽ‚©Šm”F‚·‚é (’Êí^‘S•”‚ðƒ`ƒFƒbƒN) | | | | w Á‹ŽƒƒO‚ðƒfƒBƒXƒN‚É‘‚«ž‚Þ | | | | L “®ì‹L˜^‚ðƒtƒƒbƒs[‚É‘‚«o‚· | | | +-----v(+)---------------------------------------------------------+ | | | +----------------------------------------------------------------------+ | [ OK ] Cancel | +----------------------------------------------------------------------+ ‚±‚±‚ÅAƒn[ƒhƒfƒBƒXƒN‚Ì–¼‘O‚â—e—Ê‚ªAƒf[ƒ^‚ðÁ‹Ž‚µ‚½‚¢ƒn[ƒh ƒfƒBƒXƒN‚Ì‚à‚Ì‚Å‚ ‚é‚©‚Ç‚¤‚©‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢B‚»‚̃n[ƒhƒfƒBƒX ƒN‚̃f[ƒ^‚ðÁ‹Ž‚·‚éꇂÍAu0‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ ƒ^‚ðÁ‚·v‚ªƒnƒCƒ‰ƒCƒg‚³‚ê‚Ä‚¢‚éó‘ԂŃGƒ“ƒ^[ƒL[‚ð‰Ÿ‚µ‚Ä‚­‚¾‚³ ‚¢ (ˆÈ‰ºA‚±‚Ì‘€ì‚ðu‘I‘ð‚·‚év‚ÆÌ‚µ‚Ü‚·)B ã‚̃ƒjƒ…[‚Åu0‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚·v‚ð ‘I‘ð‚·‚é‚ÆAŽŸ‚̂悤‚ÉŠm”FƒƒbƒZ[ƒW‚ª•\Ž¦‚³‚ê‚Ü‚·B ƒfƒBƒXƒN ad0 ‚Ì ‘Sƒf[ƒ^ 4,294,967,296 ƒoƒCƒg‚ðA 0‚Åã‘‚«‚µ‚ÄÁ‹Ž‚µ‚Ü‚·B ‚æ‚낵‚¢‚Å‚·‚©? [ Yes ] No ƒf[ƒ^‚ðÁ‹Ž‚·‚éꇂÍA‚±‚±‚ÅuYesv‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢BuYesv ‚ð‘I‘ð‚·‚é‚ÆA‚³‚ç‚É‚µ‚‚±‚­AˆÈ‰º‚ÌŠm”FƒƒbƒZ[ƒW‚ª•\Ž¦‚³‚ê‚Ü‚·B –{“–‚Éad0 (4.0G) ‚̃f[ƒ^‚ðÁ‹Ž‚µ‚Ä‚¢‚¢‚Å‚·‚©? [ Yes ] No ƒf[ƒ^‚ðÁ‹Ž‚·‚éꇂÍAÄ“xuYesv‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢BuNov ‚ð‘I‘ð‚·‚é‚Æʼn‚̃ƒjƒ…[‚É–ß‚è‚Ü‚·BuYesv‚ð‘I‘ð‚·‚é‚ƃf[ƒ^ ‚ÌÁ‹Ž‚ªŽn‚Ü‚è‚Ü‚·B ƒf[ƒ^‚ÌÁ‹Ž’†‚ÍAŽŸ‚̂悤‚Éi’»ó‹µ‚ª•\Ž¦‚³‚ê‚Ü‚·B ƒfƒBƒXƒN ad1 ‚̃f[ƒ^‚ðÁ‹Ž‚µ‚Ä‚¢‚Ü‚·B 25% (1024/4096) I—¹ ^ 21•b Œo‰ß Žc‚è ‚¨‚æ‚»128•b 0%|############______________________________________|100% ‰æ–Ê‚Ìʼnºs‚É‚ÍAŽŸ‚̂悤‚É‘‚«ž‚Ý‘¬“x‚ª•\Ž¦‚³‚ê‚Ü‚·B 33554432 bytes transferred in 1.307584 secs (25661396 bytes/sec) ƒf[ƒ^‚ÌÁ‹Ž‚É—v‚·‚鎞ŠÔ‚ÍA‚¨Žg‚¢‚̃n[ƒhƒfƒBƒXƒN‚Ì—e—Ê‚âƒpƒ\ ƒRƒ“‚É‚æ‚Á‚ĈقȂè‚Ü‚·Bƒn[ƒhƒfƒBƒXƒN‚Ì—e—Ê‚ª¬‚³‚­Aƒpƒ\ƒRƒ“‚Ì ˆ—‘¬“x‚ª‘¬‚¯‚ê‚ÎAÁ‹Ž‚É—v‚·‚鎞ŠÔ‚Í’Z‚­‚È‚è‚Ü‚·B ƒf[ƒ^‚ÌÁ‹Ž‚ªI‚í‚é‚ÆA ƒfƒBƒXƒN‚̃f[ƒ^Á‹Ž‚ªI—¹‚µ‚Ü‚µ‚½ (2•ª30•b) [OK] ‚Æ‚¢‚¤ƒƒbƒZ[ƒW‚ª•\Ž¦‚³‚ê‚Ü‚·B‚±‚±‚ÅAƒGƒ“ƒ^[ƒL[‚ð‰Ÿ‚·‚ÆAÅ ‰‚̃ƒjƒ…[‚É–ß‚è‚Ü‚·B œ‘€ì•û–@‚ɂ‚¢‚Ä ƒƒCƒ“ƒƒjƒ…[‚©‚çu‘€ì•û–@‚ÌŠT—v‚ð•\Ž¦‚·‚év‚ð‘I‘ð‚·‚é‚ÆAŠÈ ’P‚È‘€ì•û–@‚Ìà–¾‚ª•\Ž¦‚³‚ê‚Ü‚·B œÁ‹ŽˆÈŠO‚Ì‘€ì‚ɂ‚¢‚Ä ƒƒCƒ“ƒƒjƒ…[‚Å㉺ƒJ[ƒ\ƒ‹ƒL[‚ð‰Ÿ‚·‚ÆA•Ê‚Ì€–Ú‚ðƒnƒCƒ‰ƒCƒg ‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·BƒƒCƒ“ƒƒjƒ…[‚É‚Í8‚‚̑I‘ðŽˆ‚µ‚©•\Ž¦‚³‚ê‚Ä ‚¢‚Ü‚¹‚ñ‚ªA㉺ƒJ[ƒ\ƒ‹ƒL[‚ð‰Ÿ‚·‚ƃXƒNƒ[ƒ‹‚É‚æ‚èAŠeŽí‘€ìƒ ƒjƒ…[‚ª•\Ž¦‚³‚ê‚Ü‚·Buƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outxv‚Å ‚ÍAƒf[ƒ^Á‹ŽˆÈŠO‚É‚àAÁ‹Ž‚³‚ê‚Ä‚¢‚é‚©‚Ç‚¤‚©‚ÌŠm”FA“®ì‹L˜^‚Ì ‘‚«ž‚ÝAƒn[ƒhƒfƒBƒXƒN‚̃Rƒs[AƒVƒFƒ‹‚Ì‹N“®AÄ‹N“®AƒVƒƒƒbƒg ƒ_ƒEƒ“‚È‚Ç‚Ì‘€ìƒƒjƒ…[‚ª—pˆÓ‚³‚ê‚Ä‚¢‚Ü‚·BˆÈ‰º‚ɃƒCƒ“ƒƒjƒ…[ ‚©‚ç‘I‘ð‚Å‚«‚é‘€ì‚̈ꗗ‚ðŽ¦‚µ‚Ü‚·B E0‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· E‘€ì•û–@‚ÌŠT—v‚ð•\Ž¦‚·‚é E•¡”‰ñã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ð”O“ü‚è‚ÉÁ‚· E”O“ü‚èÁ‹Ž‚Ìã‘‚«•û–@‚ð‘I‘ð‚·‚é Eƒf[ƒ^‚ªÁ‹Ž‚³‚ꂽ‚©Šm”F‚·‚éi‚‘¬^ˆê•”‚ðƒ`ƒFƒbƒNj Eƒf[ƒ^‚ªÁ‹Ž‚³‚ꂽ‚©Šm”F‚·‚éi’Êí^‘S•”‚ðƒ`ƒFƒbƒNj EÁ‹ŽƒƒO‚ðƒfƒBƒXƒN‚É‘‚«ž‚Þ E“®ì‹L˜^‚ðƒtƒƒbƒs[‚É‘‚«o‚· E•Ê‚̃fƒBƒXƒN‚ð‘I‘ð‚·‚é EƒfƒBƒXƒN‚̃f[ƒ^‚ð•\Ž¦‚·‚é Eƒf[ƒ^‚ð•\Ž¦‚·‚éƒZƒNƒ^‚ÌŽw’è Euwwipe-outx‚ɂ‚¢‚Äv‚ðŒ©‚é E‹N“®Žž‚̃VƒXƒeƒ€ƒƒbƒZ[ƒW‚ðŠm”F‚·‚é EƒfƒBƒXƒN‚ðƒRƒs[‚·‚éi‚‘¬^ƒoƒbƒNƒAƒbƒvŒü‚¯j EƒfƒBƒXƒN‚ðƒRƒs[‚·‚éi’ᑬ^ƒf[ƒ^ƒTƒ‹ƒx[ƒWŒü‚¯j E1‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· Eƒ‰ƒ“ƒ_ƒ€ƒpƒ^[ƒ“‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· Eƒpƒ^[ƒ“‚̕│ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· Eƒ‰ƒ“ƒ_ƒ€ƒf[ƒ^‚ðã‘‚«‚µ‚ÄA‚±‚̃fƒBƒXƒN‚̃f[ƒ^‚ðÁ‚· E“®ì‹L˜^‚ð•\Ž¦‚·‚é EƒfƒBƒXƒN‚ÌŽ©ŒÈf’fî•ñ (SMARTî•ñ) ‚ð•\Ž¦‚·‚é EƒVƒFƒ‹ishj‚ð‹N“®‚·‚é EƒVƒFƒ‹icshj‚ð‹N“®‚·‚é ECD-ROM‚ðmount‚·‚é ECD-ROM‚ðumount‚·‚é EMBR *‚Ì‚Ý* ‚ðÁ‹Ž‚·‚é EƒVƒƒƒbƒgƒ_ƒEƒ“‚·‚é EÄ‹N“®‚·‚é œ‘Ήž‹@Ží‚ɂ‚¢‚Ä E–{ƒc[ƒ‹‚ÍAFreeBSD/i386‚ª“®ì‚·‚éƒRƒ“ƒsƒ…[ƒ^‚Å—˜—p‚Å‚«‚Ü‚·B E–{ƒc[ƒ‹‚Ńf[ƒ^‚ðÁ‹Ž‚Å‚«‚éƒXƒgƒŒ[ƒWƒfƒoƒCƒX‚ÍŽŸ‚Ì‚Æ‚¨‚è‚Å‚·B EFreeBSD‚̃J[ƒlƒ‹ (ƒCƒ“ƒXƒg[ƒ‹—pCD‚̃J[ƒlƒ‹) ‚ňµ‚¦‚é‚à ‚Ì‚Ì‚¤‚¿AˆÈ‰º‚ÌðŒ‚ð–ž‚½‚·‚à‚Ì EATAƒfƒBƒXƒNƒRƒ“ƒgƒ[ƒ‰ƒhƒ‰ƒCƒo (ada(4)) ‚ňµ‚¦‚é‚à‚Ì Eˆê”Ê“I‚ÈS-ATA/P-ATAƒCƒ“ƒ^[ƒtƒFƒCƒX‚̃n[ƒhƒfƒBƒXƒN E“¯ASSDƒhƒ‰ƒCƒu ESCSIƒ_ƒCƒŒƒNƒgƒAƒNƒZƒXƒfƒoƒCƒXƒhƒ‰ƒCƒo (da(4)) ‚ňµ‚¦ ‚é‚à‚Ì Eˆê”Ê“I‚ÈSCSIƒCƒ“ƒ^[ƒtƒFƒCƒX‚̃n[ƒhƒfƒBƒXƒN EFreeBSD‚ňµ‚¦‚éRAIDƒRƒ“ƒgƒ[ƒ‰ (asr(4)) ‚È‚Ç‚ÉÚ‘± ‚³‚ꂽƒn[ƒhƒfƒBƒXƒN EUSBƒƒ‚ƒŠƒJ[ƒhƒAƒ_ƒvƒ^‚ÉÚ‘±‚µ‚½ŠeŽíƒƒ‚ƒŠƒJ[ƒh‚âA USBƒtƒ‰ƒbƒVƒ…ƒƒ‚ƒŠ‚È‚Ç‚ÌUSB‘å—e—ʃXƒgƒŒ[ƒW ¦ada(4), da(4), asr(4) ‚È‚Ç‚ÌÚׂɂ‚¢‚Ä‚ÍAFreeBSD‚̃}ƒjƒ…ƒA ƒ‹ƒy[ƒW‚È‚Ç‚ð‚²——‚­‚¾‚³‚¢B œ“®ì‚Ì‹L˜^‚Ì•Û‘¶‚ɂ‚¢‚Ä uƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹wwipe-outxv‚Å‚ÍA“®ì‚Ì‹L˜^‚ð•Û‘¶ ‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B•Û‘¶‰Â”\‚ȃƒfƒBƒA‚̓tƒƒbƒs[ƒfƒBƒXƒN‚âUSB ƒƒ‚ƒŠ‚È‚Ç‚Å‚·B“®ì‚Ì‹L˜^‚ð•Û‘¶‚·‚郃fƒBƒA (ƒtƒƒbƒs[‚âUSBƒ ƒ‚ƒŠ) ‚ÍA‚ ‚ç‚©‚¶‚ßFATƒtƒH[ƒ}ƒbƒg‚ðs‚¢AuWIPE-OUTv‚Æ‚¢‚¤–¼ ‘O‚̃tƒHƒ‹ƒ_‚ðƒ‹[ƒgƒfƒBƒŒƒNƒgƒŠ‚É쬂µ‚Ä‚¨‚¢‚Ä‚­‚¾‚³‚¢B œ‚¨‚±‚Æ‚í‚è E–{ƒc[ƒ‹‚ÍAOS‚Æ‚µ‚ÄFreeBSD‚ð—˜—p‚µ‚Ä‚¢‚Ü‚·B E–{ƒc[ƒ‹‚̓tƒŠ[ƒEƒFƒA‚Å‚·B’˜ìŒ ‚ÍAìŽÒ‚Å‚ ‚é ‚¢‚µ‚¶‚Ü™‚¾‚¢ ‚ª•Û—L‚µ‚Ä‚¢‚Ü‚·B E–{ƒc[ƒ‹‚ð—˜—p‚µ‚½A‚ ‚é‚¢‚Í—˜—p‚µ‚È‚©‚Á‚½‚±‚Æ‚É‚æ‚Á‚Ķ‚¶‚½ ‚¢‚©‚Ȃ錋‰Ê‚ɂ‚¢‚Ä‚àAìŽÒ‚ÍÓ”C‚ðˆêØ•‰‚¢‚Ü‚¹‚ñB œŽQl•¶Œ£ EŽÐ’c–@l “dŽqî•ñ‹ZpŽY‹Æ‹¦‰ï (http://www.jeita.or.jp/japanese/index.htm) uƒpƒ\ƒRƒ“‚Ì”pŠüE÷“nŽž‚É‚¨‚¯‚éƒn[ƒhƒfƒBƒXƒNã‚̃f[ƒ^Á‹Ž ‚ÉŠÖ‚·‚é—¯ˆÓŽ–€v(http://it.jeita.or.jp/perinfo/committee/ pc/JEITA_HDDdata100219F.pdf) œ–{ƒc[ƒ‹‚Ì“üŽè•û–@ –{ƒc[ƒ‹‚¨‚æ‚ÑŽo–…•i‚ÍAìŽÒ‚̃EƒFƒuƒTƒCƒg‚ÅŒöŠJ‚µ‚Ä‚¢‚Ü‚·BƒA ƒhƒŒƒX‚Í http://hp.vector.co.jp/authors/VA004814/ ‚Å‚·B•K—v‚ɉž ‚¶‚ă_ƒEƒ“ƒ[ƒh‚µ‚Ä‚­‚¾‚³‚¢B ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹uwipe-outvv2.2 Copyright (C) 2022 by Dai ISHIJIMA ‚à‚µA‚ ‚È‚½‚ª‚±‚̃tƒ@ƒCƒ‹‚ðuwipe-outv‚ð‹N“®‚µ‚½ƒ}ƒVƒ“‚Å ƒƒCƒ“ƒƒjƒ…[‚©‚猩‚邱‚Æ‚ª‚Å‚«‚½‚Æ‚·‚ê‚ÎA—]Œv‚Èà–¾‚Í•s—v ‚©‚à‚µ‚ê‚Ü‚¹‚ñB yƒƒCƒ“ƒƒjƒ…[‚Å‚Ì‘€ìz ƒƒCƒ“ƒƒjƒ…[‰æ–Ê‚Ì‘€ì‚ÌŠî–{‚ÍA E㉺ƒJ[ƒ\ƒ‹ƒL[‚É‚æ‚ès‚¢‚½‚¢€–Ú‚ð‘I‘ð EƒGƒ“ƒ^[ƒL[‚É‚æ‚è‘I‘ð‚µ‚½€–Ú‚ðŽÀs ‚Å‚·B‘I‘ð‚³‚ê‚Ä‚¢‚逖ڂ̓nƒCƒ‰ƒCƒg•\Ž¦‚³‚ê‚Ä‚¢‚Ü‚·Buwipe- outv‹N“®Žž‚ÍAu0‚ðã‘‚«‚µ‚Äcv‚ªƒnƒCƒ‰ƒCƒg•\Ž¦‚³‚ê‚Ä‚¢‚é ‚Í‚¸‚Å‚·B ƒƒCƒ“ƒƒjƒ…[‚©‚炱‚̉æ–Ê‚ð•\Ž¦‚³‚¹‚é‚É‚ÍA‰ºƒJ[ƒ\ƒ‹ƒL[ ‚ð‹ã‰ñ‰Ÿ‚µAƒGƒ“ƒ^[ƒL[‚ð‰Ÿ‚µ‚Ü‚·B‰æ–Ê‚É•\Ž¦‚µ‚«‚ê‚È‚¢•”•ª ‚ÍA㉺ƒJ[ƒ\ƒ‹ƒL[‚ð‰½“x‚©‰Ÿ‚·‚ÆAƒXƒNƒ[ƒ‹‚µ‚Ä‚Å‚Ä‚«‚Ü‚·B ‚½‚Æ‚¦‚ÎAƒƒCƒ“ƒƒjƒ…[‚É‚ÍuÄ‹N“®‚·‚év‚Æ‚¢‚¤€–Ú‚ª‚ ‚è ‚Ü‚·‚ªA‚±‚ê‚͈ê”Ô‰º‚Ì‚Ù‚¤‚ɉB‚ê‚Ä‚¢‚Ü‚·B‚±‚ê‚ð•\Ž¦‚·‚é‚É‚ÍA ‰½“x‚à‰ºƒJ[ƒ\ƒ‹ƒL[‚ð‰Ÿ‚µ‚Ä‚Ý‚Ä‚­‚¾‚³‚¢B ƒXƒNƒ[ƒ‹‚µ‚Äã‚ÉÁ‚¦‚Ä‚¢‚Á‚½€–Ú‚ð•\Ž¦‚³‚¹‚é‚É‚ÍAãƒJ[ ƒ\ƒ‹ƒL[‚ð‰Ÿ‚µ‚Ä‚­‚¾‚³‚¢B yƒfƒBƒXƒN‚É‹L˜^‚³‚ꂽî•ñ‚ðÁ‚·‚É‚Íz u0‚ðã‘‚«‚µ‚Äcv‚̂悤‚ÈAucÁ‚·v‘€ì‚ðƒƒCƒ“ƒƒjƒ…[ ‚©‚ç‘I‘ð‚µAƒGƒ“ƒ^[ƒL[‚ð‰Ÿ‚µ‚Ä‚­‚¾‚³‚¢B uÁ‚·v‘€ì‚ðŽÀs‚·‚é‚ÆAŠm”F‰æ–Ê‚ª•\Ž¦‚³‚ê‚Ü‚·B‚±‚Ì‚Æ‚«A ƒfƒBƒXƒN‚ÌŒ^”Ô‚â—e—Ê‚È‚Ç‚ª•\Ž¦‚³‚ê‚é‚Ì‚ÅAÁ‚µ‚½‚¢ƒfƒBƒXƒN‚Å ‚ ‚é‚©‚Ç‚¤‚©‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢B•\Ž¦‚³‚ê‚Ä‚¢‚é“à—e‚ðŠm”F‚µ‚½ ‚çƒGƒ“ƒ^[ƒL[‚ð‰Ÿ‚µ‚Ä‚­‚¾‚³‚¢B ʼn‚ÌŠm”F‰æ–ʂŃGƒ“ƒ^[ƒL[‚ð‰Ÿ‚µ‚½‚çAÄ“x‚µ‚‚±‚­Šm”F‰æ –Ê‚ª‚Å‚Ä‚«‚Ü‚·B–{“–‚ÉÁ‚µ‚Ä‚à‚悢ꇂɂ̂݃Gƒ“ƒ^[ƒL[‚ð‰Ÿ ‚µ‚Ä‚­‚¾‚³‚¢B “ñ‰ñ–Ú‚ÌŠm”F‰æ–ʂŃGƒ“ƒ^[ƒL[‚ð‰Ÿ‚·‚ÆÁ‹Ž‚ªŽn‚Ü‚è‚Ü‚·B’Ê íAƒfƒBƒXƒN‚ÌÁ‹Ž‚É‚Í”•ª‚©‚甎žŠÔ’ö“x‚ÌŽžŠÔ‚ª‚©‚©‚è‚Ü‚·B Á‹Ž‚ª‚Í‚¶‚Ü‚Á‚Ä‚µ‚΂炭‚·‚é‚ÆAŽc‚芗vŽžŠÔ‚Ì—\‘ª’l‚ª•\Ž¦‚³ ‚ê‚Ü‚·B Á‹Ž‚ªI—¹‚µ‚½‚çAÁ‹Ž‚É‚©‚©‚Á‚½ŽžŠÔ‚ª•\Ž¦‚³‚ê‚Ü‚·B‚±‚±‚Å ƒGƒ“ƒ^[ƒL[‚ð‰Ÿ‚·‚ÆAƒƒCƒ“ƒƒjƒ…[‚É–ß‚è‚Ü‚·B ‚È‚¨Aã‘‚«Á‹Ž‚ªˆêu‚ÅI—¹‚·‚邱‚Æ‚Í‚ ‚蓾‚È‚¢‚Í‚¸‚Å‚·B ‚»‚ÌꇂÍA–{ƒ\ƒtƒguwipe-outv‚̃oƒO‚©‚à‚µ‚ê‚Ü‚¹‚ñBuƒf[ ƒ^‚ªÁ‹Ž‚³‚ꂽ‚©Šm”F‚·‚év‚ð‘I‚ñ‚Å–{“–‚ÉÁ‚¦‚½‚©Šm”F‚µ‚Ä‚­‚¾ ‚³‚¢B ‚È‚¨AƒZƒLƒ…ƒAÁ‹Ž‚Í”•b‚ÅŠ®—¹‚·‚邱‚Æ‚ª‚ ‚è‚Ü‚·B y“®ì‹L˜^‚ð•Û‘¶‚·‚é‚É‚Íz –{ƒ\ƒtƒguwipe-outv‚Ì‹““®‚ª‚¨‚©‚µ‚¢‚ÆŠ´‚¶‚ç‚ꂽꇂÍAƒ ƒCƒ“ƒƒjƒ…[‚©‚çu“®ì‹L˜^‚ðUSBƒƒ‚ƒŠ‚âƒtƒƒbƒs[‚É‘‚«o‚·v ‚ð‘I‚ñ‚Å‚­‚¾‚³‚¢Bƒƒjƒ…[‚É‘‚©‚ê‚Ä‚¢‚é‚Æ‚¨‚èA“®ì‹L˜^‚ðUSB ƒƒ‚ƒŠ‚âƒtƒƒbƒs[‚É‹L˜^‚Å‚«‚Ü‚·B ‚È‚¨A“®ì‹L˜^‚ð•Û‘¶‚·‚éUSBƒƒ‚ƒŠ‚âƒtƒƒbƒs[‚É‚ÍA‚ ‚ç‚©‚¶ ‚ßu\WIPE-OUT\v‚Æ‚¢‚¤ƒtƒHƒ‹ƒ_‚ð쬂µ‚Ä‚¨‚¢‚Ä‚­‚¾‚³‚¢B yƒƒCƒ“ƒƒjƒ…[‚É–ß‚é‚É‚Íz ‚±‚̉æ–Ê‚ð•Â‚¶‚ăƒCƒ“ƒƒjƒ…[‚É–ß‚é‚É‚ÍAƒGƒ“ƒ^[ƒL[‚ð‰Ÿ ‚µ‚Ä‚­‚¾‚³‚¢B ƒn[ƒhƒfƒBƒXƒNÁ‹Žƒc[ƒ‹uwipe-outvv2.0 Copyright (C) 2001-2020 by Dai ISHIJIMA ƒ}ƒjŽÔ‚É‚ÍAŠÏ‰¹•ìŽF‚Ì^Œ¾‚Æ‚³‚ê‚éuƒIƒ€Eƒ}ƒjEƒyƒEƒtƒ€v iOmEManiEPadmeEHumj‚ª‚Ü‚ê‚Ä‚¢‚é‚»‚¤‚Å‚·B EJEƒqƒVƒˆAƒqAƒ}BuƒGƒ€ƒCƒTƒnû׃@Aƒzƒ\ƒ\ƒNƒ^AƒlAƒIAæ¢æ@›£…£àŸƒ£Ÿ£–@ƒ££á@ƒ£›DàŸ iOmEManiEPadmeEHumj‚ª‚Ü‚ê‚Ä‚¢‚é‚»‚¤‚Å‚·B ƒ}ƒjŽÔ‚É‚ÍAŠÏ‰¹•ìŽF‚Ì^Œ¾‚Æ‚³‚ê‚éuƒIƒ€Eƒ}ƒjEƒyƒEƒtƒ€v iOmEManiEPadmeEHumj‚ª‚Ü‚ê‚Ä‚¢‚é‚»‚¤‚Å‚·B EJEƒqƒVƒˆAƒqAƒ}BuƒGƒ€ƒCƒTƒnû׃@Aƒzƒ\ƒ\ƒNƒ^AƒlAƒIAæ¢æ@›£…£àŸƒ£Ÿ£–@ƒ££á@ƒ£›DàŸ iOmEManiEPadmeEHumj‚ª‚Ü‚ê‚Ä‚¢‚é‚»‚¤‚Å‚·B ƒ}ƒjŽÔ‚É‚ÍAŠÏ‰¹•ìŽF‚Ì^Œ¾‚Æ‚³‚ê‚éuƒIƒ€Eƒ}ƒjEƒyƒEƒtƒ€v iOmEManiEPadmeEHumj‚ª‚Ü‚ê‚Ä‚¢‚é‚»‚¤‚Å‚·B EJEƒqƒVƒˆAƒqAƒ}BuƒGƒ€ƒCƒTƒnû׃@Aƒzƒ\ƒ\ƒNƒ^AƒlAƒIAæ¢æ@›£…£àŸƒ£Ÿ£–@ƒ££á@ƒ£›DàŸ iOmEManiEPadmeEHumj‚ª‚Ü‚ê‚Ä‚¢‚é‚»‚¤‚Å‚·B ƒ}ƒjŽÔ‚É‚ÍAŠÏ‰¹•ìŽF‚Ì^Œ¾‚Æ‚³‚ê‚éuƒIƒ€Eƒ}ƒjEƒyƒEƒtƒ€v iOmEManiEPadmeEHumj‚ª‚Ü‚ê‚Ä‚¢‚é‚»‚¤‚Å‚·B EJEƒqƒVƒˆAƒqAƒ}BuƒGƒ€ƒCƒTƒnû׃@Aƒzƒ\ƒ\ƒNƒ^AƒlAƒIAæ¢æ@›£…£àŸƒ£Ÿ£–@ƒ££á@ƒ£›DàŸ iOmEManiEPadmeEHumj‚ª‚Ü‚ê‚Ä‚¢‚é‚»‚¤‚Å‚·B ƒ}ƒjŽÔ‚É‚ÍAŠÏ‰¹•ìŽF‚Ì^Œ¾‚Æ‚³‚ê‚éuƒIƒ€Eƒ}ƒjEƒyƒEƒtƒ€v iOmEManiEPadmeEHumj‚ª‚Ü‚ê‚Ä‚¢‚é‚»‚¤‚Å‚·B # termcap for wipeout # original copyright notice follows... # ------------------------------------------------------------ # # Copyright (c) 1980, 1985, 1989, 1993 # The Regents of the University of California. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: # This product includes software developed by the University of # California, Berkeley and its contributors. # 4. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # @(#)termcap.src 8.2 (Berkeley) 11/17/93 # $FreeBSD: releng/9.3/share/termcap/termcap.src 267911 2014-06-26 11:02:51Z gavin $ # Termcap source file # John Kunze, Berkeley # Craig Leres, Berkeley # # Please submit changes via https://bugs.freebsd.org/submit/ # # ------------------------------------------------------------ # # # ------------------------------------------------------------ # # for syscons # common entry without semigraphics cons25w|ansiw|ansi80x25-raw:\ :am:bs:NP:ms:pt:AX:eo:bw:ut:km:\ :co#80:li#25:pa#64:Co#8:it#8:\ :al=\E[L:cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:\ :dc=\E[P:dl=\E[M:do=\E[B:bt=\E[Z:ho=\E[H:ic=\E[@:cb=\E[1K:\ :nd=\E[C:rs=\Ec:so=\E[7m:se=\E[27m:up=\E[A:cr=^M:ta=^I:\ :AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:sc=\E7:rc=\E8:\ :k1=\E[M:k2=\E[N:k3=\E[O:k4=\E[P:k5=\E[Q:k6=\E[R:k7=\E[S:k8=\E[T:\ :k9=\E[U:k;=\E[V:F1=\E[W:F2=\E[X:K2=\E[E:nw=\E[E:ec=\E[%dX:\ :kb=^H:kh=\E[H:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:le=^H:sf=\E[S:sr=\E[T:\ :kN=\E[G:kP=\E[I:@7=\E[F:kI=\E[L:kD=\177:kB=\E[Z:\ :IC=\E[%d@:DC=\E[%dP:SF=\E[%dS:SR=\E[%dT:AL=\E[%dL:DL=\E[%dM:\ :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:cv=\E[%i%dd:ch=\E[%i%d`:\ :mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:bl=^G:\ :ve=\E[=S:vi=\E[=1S:vs=\E[=2S: # CP437 FreeBSD console with ACS support cons25|ansis|ansi80x25:\ :ac=l\332m\300k\277j\331u\264t\303v\301w\302q\304x\263n\305`^Da\260f\370g\361~\371.^Y-^Xh\261i^U0\333y\363z\362:\ :tc=cons25w: # ------------------------------------------------------------ # xterm|X11 terminal emulator:\ :tc=xterm-new: # ------------------------------------------------------------ # xterm-new|modern xterm:\ :@7=\EOF:@8=\EOM:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kI=\E[2~:\ :kN=\E[6~:kP=\E[5~:kd=\EOB:kh=\EOH:kl=\EOD:kr=\EOC:ku=\EOA:\ :tc=xterm-basic: # # This chunk is used for building the VT220/Sun/PC keyboard variants. xterm-basic|modern xterm common:\ :am:bs:km:mi:ms:ut:xn:AX:\ :Co#8:co#80:kn#12:li#24:pa#64:\ :AB=\E[4%dm:AF=\E[3%dm:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:\ :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=\E(B:al=\E[L:\ :as=\E(0:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\ :cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:\ :ei=\E[4l:ho=\E[H:im=\E[4h:is=\E[!p\E[?3;4l\E[4l\E>:\ :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:kB=\E[Z:le=^H:md=\E[1m:\ :me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\ :rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\ :so=\E[7m:sr=\EM:st=\EH:\ :ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: # ------------------------------------------------------------ # vt100|dec-vt100|vt100-am|vt100am|dec vt100:\ :do=2\E[B:co#80:li#24:cl=50\E[H\E[J:sf=2*\ED:\ :le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\ :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\ :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:\ :is=\E>\E[?1;3;4;5l\E[?7;8h\E[1;24r\E[24;1H:\ :if=/usr/share/tabset/vt100:nw=2\EE:ho=\E[H:\ :as=2\E(0:ae=2\E(B:\ :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||:\ :rs=\E>\E[?1;3;4;5l\E[?7;8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\ :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=\177:\ :k0=\EOy:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\EOt:\ :k6=\EOu:k7=\EOv:k8=\EOl:k9=\EOw:k;=\EOx:@8=\EOM:\ :K1=\EOq:K2=\EOr:K3=\EOs:K4=\EOp:K5=\EOn:pt:sr=2*\EM:xn:\ :sc=2\E7:rc=2\E8:cs=5\E[%i%d;%dr:UP=2\E[%dA:DO=2\E[%dB:RI=2\E[%dC:\ :LE=2\E[%dD:ct=2\E[3g:st=2\EH:ta=^I:ms:bl=^G:cr=^M:eo:it#8:\ :RA=\E[?7l:SA=\E[?7h:po=\E[5i:pf=\E[4i: tvi925|925|televideo model 925:\ :hs:xn:am:bs:co#80:li#24:cm=\E=%+ %+ :cl=\E*:cd=\Ey:ce=\Et:is=\El\E":\ :al=\EE:dl=\ER:ic=\EQ:dc=\EW:if=/usr/share/tabset/stdcrt:\ :ho=^^:nd=^L:bt=\EI:pt:so=\EG4:se=\EG0:sg#1:us=\EG8:ue=\EG0:ug#1:\ :up=^K:do=^V:kb=^H:ku=^K:kd=^V:kl=^H:kr=^L:kh=^^:ma=^V^J^L :\ :k1=^A@\r:k2=^AA\r:k3=^AB\r:k4=^AC\r:k5=^AD\r:k6=^AE\r:k7=^AF\r:\ :k8=^AG\r:k9=^AH\r:k0=^AI\r:ko=ic,dc,al,dl,cl,ce,cd,bt:\ :ts=\Ef:fs=^M\Eg:ds=\Eh:sr=\Ej: # ------------------------------------------------------------ # vt100-color|vt100-co|vt100 emulator with ANSI colors:\ :pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m\E[m:tc=vt100: # ------------------------------------------------------------ # kons25jx|kon3jx|jkons3jx|kons24-jis1983-j:as@:ae@:ac@:tc=vt100-color # ------------------------------------------------------------ # /* * disksize -- ƒfƒBƒXƒN‚̃WƒIƒƒgƒŠî•ñ‚ðŽæ“¾ * * revision history * diskinfo: * 0.0: Sep. 6, 2002 by Dai ISHIJIMA (‚Æ‚è‚ ‚¦‚¸ƒo[ƒWƒ‡ƒ“) * 0.1: Oct. 21, 2002 * 0.2: Apr. 28, 2004 * 0.3: May 1, 2004 * 0.4: May 30, 2004 * 0.5: Jun. 19, 2004 * 0.6: Aug. 5, 2006 (‚¿‚å‚Á‚ÆC³) * 0.7: Aug. 12, 2006 (—LŒøŒ…”‚̉ü‘P) * disksize: * 0.9: Sep. 12, 2007 (exit(3)‚Ì錾, ƒpƒ‰ƒ[ƒ^Žæ“¾–@•ÏX) * 1.0: Oct. 2, 2007 (MƒoƒCƒg’PˆÊ‚Å‚Ì•\Ž¦) * * ŽQl•¶Œ£: * fdisk(8) ‚̃\[ƒX (/usr/src/sbin/i386/fdisk/fdisk.c) * wpout09ˆÈ~ (/usr/src/sbin/fdisk/fdisk.c), diskinfo(8) */ #include #include #include #include #include #define SHOW_CYLS 1 #define SHOW_HEAD 2 #define SHOW_SECS 4 #define SHOW_BYTES 8 #define SHOW_BYTES_WITH_UNITS 16 #define SHOW_BLOCKS 32 #define SHOW_BYTES_WITH_COMMA 64 #define SHOW_MEGABYTES 128 #define shift --argc; ++argv #define DFLT_DISK "/dev/ad0" #define EOS '\0' #define NEWLINE '\n' #ifndef BUFSIZ #define BUFSIZ 512 #endif #define MEGABYTES (1024 * 1024) /* ”’l‚𕶎š—ñ‚É•ÏŠ· */ char *num2str(long long d, char *s) { int p; int q; int ch; p = 0; do { s[p] = '0' + (d % 10); ++p; d /= 10; } while (d > 0); s[p] = EOS; for (q = 0; q < p / 2; q++) { ch = s[q]; s[q] = s[p - q - 1]; s[p - q - 1] = ch; } return(s); } /* ”’l‚𕶎š—ñ‚É•ÏŠ· */ char *num2commastr(long long d, char *s) { int p; int q; int n; int ch; p = 0; n = 0; do { if ((n > 0) && ((n % 3) == 0)) { s[p] = ','; ++p; } s[p] = '0' + (d % 10); ++p; ++n; d /= 10; } while (d > 0); s[p] = EOS; for (q = 0; q < p / 2; q++) { ch = s[q]; s[q] = s[p - q - 1]; s[p - q - 1] = ch; } return(s); } /* ˆê•¶Žšo—Í */ void putch(int fd, unsigned char ch) { write(fd, &ch, 1); } /* •¶Žš—ño—Í */ void myputs(int fd, char *s) { while (*s) { putch(fd, *s); ++s; } } int main(int argc, char *argv[]) { char *disk; char s[BUFSIZ]; int show; int fd; off_t mediasize, blocks; unsigned long secsiz, nsecs, nhead, ncyls; unsigned char units[] = { 'k', 'M', 'G', 'T', EOS }; int p; off_t m; int fraction; show = 0; shift; while ((argc > 0) && (argv[0][0] == '-')) { if (argv[0][1] == 'c') { show |= SHOW_CYLS; } else if (argv[0][1] == 'h') { show |= SHOW_HEAD; } else if (argv[0][1] == 's') { show |= SHOW_SECS; } else if (argv[0][1] == 'b') { show |= SHOW_BYTES; } else if (argv[0][1] == 'm') { /* MƒoƒCƒg’PˆÊ‚Å */ show |= SHOW_MEGABYTES; } else if (argv[0][1] == 'B') { /* ƒoƒCƒg”‚ðƒRƒ“ƒ}‹æØ‚è‚Å */ show |= SHOW_BYTES_WITH_COMMA; } else if (argv[0][1] == 'p') { /* “K“–‚É’PˆÊ•t‚¯Bk, M, G, etc. */ show |= SHOW_BYTES_WITH_UNITS; } else if (argv[0][1] == 'l') { show |= SHOW_BLOCKS; } else { myputs(STDERR_FILENO, "Usage: diskinfo [-chsbBpl] [device]\n"); exit(1); } shift; } if (show == 0) { show = SHOW_CYLS | SHOW_HEAD | SHOW_SECS; } if (argc > 0) { disk = *argv; } else { disk = DFLT_DISK; } if ((fd = open(disk, O_RDONLY)) < 0) { myputs(STDERR_FILENO, "diskinfo: unable to open disk "); myputs(STDERR_FILENO, disk); putch(STDERR_FILENO, NEWLINE); exit(1); } /* FreeBSD 5.1ˆÈ~‚®‚ç‚¢‚Åuioctl(fd, DIOCGDINFO, &disklabel)v*/ /* ‚ðŽg‚í‚È‚­‚È‚Á‚½? */ if (ioctl(fd, DIOCGSECTORSIZE, &secsiz) != 0) { myputs(STDERR_FILENO, "diskinfo: can't get sectorsize\n"); exit(1); } if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) != 0) { myputs(STDERR_FILENO, "diskinfo: can't get mediasize\n"); exit(1); } if (ioctl(fd, DIOCGFWSECTORS, &nsecs) != 0) { myputs(STDERR_FILENO, "diskinfo: can't get number of sectors\n"); exit(1); } if (ioctl(fd, DIOCGFWHEADS, &nhead) != 0) { myputs(STDERR_FILENO, "diskinfo: can't get number of heads\n"); exit(1); } blocks = mediasize / secsiz; ncyls = mediasize / (secsiz * nhead * nsecs); if (show & SHOW_BLOCKS) { num2str(blocks, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, NEWLINE); } if (show & SHOW_BYTES) { num2str(mediasize, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, NEWLINE); } if (show & SHOW_MEGABYTES) { num2str((mediasize + MEGABYTES - 1) / MEGABYTES, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, NEWLINE); } if (show & SHOW_BYTES_WITH_COMMA) { num2commastr(mediasize, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, NEWLINE); } if (show & SHOW_BYTES_WITH_UNITS) { m = mediasize / 1024; p = 0; fraction = 0; while ((m > 1000) && (units[p] != EOS)) { fraction = ((m * 10) / 1024) % 10; m /= 1024; ++p; } num2str(m, s); myputs(STDOUT_FILENO, s); if (m < 10) { putch(STDOUT_FILENO, '.'); num2str(fraction, s); myputs(STDOUT_FILENO, s); } putch(STDOUT_FILENO, units[p]); putch(STDOUT_FILENO, NEWLINE); } if (show & SHOW_CYLS) { num2str(ncyls, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, NEWLINE); } if (show & SHOW_HEAD) { num2str(nhead, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, NEWLINE); } if (show & SHOW_SECS) { num2str(nsecs, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, NEWLINE); } exit(0); } /* Local Variables: */ /* compile-command:"cc -Wall -O -s -o disksize disksize.c" */ /* End: */ /* * stuff -- ƒn[ƒhƒfƒBƒXƒNÁ‹Ž‚Ì‚½‚ß‚Ì‹l‚ß•¨ƒf[ƒ^‚ðì¬ * * revision history: * 0.0: Apr. 30, 2004 by Dai ISHIJIMA * 0.1: May 1, 2004 * 0.2: Jun. 28, 2006 (ƒ‰ƒ“ƒ_ƒ€ƒpƒ^[ƒ“‚Æ‚»‚Ì•â”) * 0.3: Jan. 12, 2017 (•¶Žš 'U' 0x55) * 0.4: Sep. 23, 2021 (o—Í’·‚ÌŽw’è) */ #include #include #include #include #include #define BSIZ 1024 #define STDIN 0 #define STDOUT 1 #define STDERR 2 #define NEWLINE '\n' #define ZERO 'z' #define FILL 'f' #define RAND 'r' #define GENERATE 'g' #define PATTERN 'p' #define INVERT 'q' #define CHAR_55 'U' /* 0x55 */ #define CHAR_AA 'n' /* 0xAA */ #define shift --argc; ++argv #define swap(t,a,b) {t _swap_tmp; _swap_tmp=(a); a=b; b=_swap_tmp;} /* ˆê•¶Žšo—Í */ void putch(int fd, unsigned char ch) { write(fd, &ch, 1); } /* •¶Žš—ño—Í */ void myputs(int fd, char *s) { while (*s) { putch(fd, *s); ++s; } } /* —”‚Ńf[ƒ^‚ð‚©‚«‚Ü‚º‚é */ void stair(int len, unsigned char *buf) { int i, n; for (i = 0; i < len; i++) { n = random() & (len - 1); /* len ‚Í 2^n ‚Ɖ¼’è */ swap(unsigned char, buf[i], buf[n]); } } /* ‘‚«ž‚Ý—pƒf[ƒ^‚̉Šú‰» */ void init(int len, unsigned char *buf, int mode) { int i; if (mode == ZERO) { for (i = 0; i < len; i++) { buf[i] = 0; } } else if (mode == FILL) { for (i = 0; i < len; i++) { buf[i] = 0xff; } } else if (mode == CHAR_55) { for (i = 0; i < len; i++) { buf[i] = 0x55; /* 0x55 -> 0101 0101b */ } } else if (mode == CHAR_AA) { for (i = 0; i < len; i++) { buf[i] = 0xAA; /* 0xAA -> 1010 1010bb */ } } else if ((mode == RAND) || (mode == GENERATE)) { srandom(time(NULL)); for (i = 0; i < len; i++) { buf[i] = i; } stair(len, buf); } else if (mode == PATTERN) { for (i = 0; i < BSIZ; i++) { buf[i] = 0; } read(STDIN, buf, BSIZ); } else if (mode == INVERT) { for (i = 0; i < BSIZ; i++) { buf[i] = 0; } read(STDIN, buf, BSIZ); for (i = 0; i < len; i++) { buf[i] = ~buf[i]; } } else if (mode < 0) { /* ‚í‚©‚è‚É‚­‚¢‚©‚È */ for (i = 0; i < len; i++) { buf[i] = -mode; } } else { /* ‚±‚±‚É‚Í—ˆ‚È‚¢‚Í‚¸ */ myputs(STDERR, "stuff: unknown mode: "); putch(STDERR, mode); putch(STDERR, NEWLINE); exit(1); } } /* ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“Žw’è‚ÉŠî‚¢‚ÄA0, 1, ƒ‰ƒ“ƒ_ƒ€ƒf[ƒ^‚ðo—Í */ int main(int argc, char *argv[]) { int mode; unsigned char buf[BSIZ]; int len = 0; mode = ZERO; shift; while ((argc > 0) && (argv[0][0] == '-')) { if ((argv[0][1] == '0') || (argv[0][1] == 'z')) { /* 0 ‚ðo—Í */ mode = ZERO; } else if ((argv[0][1] == '1') || (argv[0][1] == 'f')) { /* 1 ‚ðo—Í */ mode = FILL; } else if ((argv[0][1] == 'R') || (argv[0][1] == 'r')) { /* ƒ‰ƒ“ƒ_ƒ€ƒf[ƒ^‚ðo—Í */ mode = RAND; } else if ((argv[0][1] == 'G') || (argv[0][1] == 'g')) { /* ƒ‰ƒ“ƒ_ƒ€ƒpƒ^[ƒ“‚𶬠*/ mode = GENERATE; } else if ((argv[0][1] == 'P') || (argv[0][1] == 'p')) { /* ƒpƒ^[ƒ“‚ðŒJ‚è•Ô‚µo—Í */ mode = PATTERN; } else if (argv[0][1] == 'F') { /* ƒpƒ^[ƒ“‚ðŒJ‚è•Ô‚µo—Í */ mode = PATTERN; } else if ((argv[0][1] == 'U') || (argv[0][1] == '5')) { /* •¶Žš "U" 0x55 ‚ðŒJ‚è•Ô‚µo—Í */ mode = CHAR_55; } else if ((argv[0][1] == 'n') || (argv[0][1] == 'A')) { /* •¶Žš "U" 0x55 ‚̃rƒbƒg”½“] 0xAA ‚ðŒJ‚è•Ô‚µo—Í */ mode = CHAR_AA; } else if ((argv[0][1] == 'Q') || (argv[0][1] == 'q')) { /* ƒpƒ^[ƒ“‚̕│ðŒJ‚è•Ô‚µo—Í */ mode = INVERT; } else if (argv[0][1] == 'l') { shift; len = atoi(*argv); } else if (argv[0][1] == 'v') { shift; mode = -atoi(*argv); } else { myputs(STDERR, "Usage: stuff [-[01Rzfrgpqu]]\n"); exit(1); } shift; } if (argc > 0) { myputs(STDERR, "Usage: stuff [-[01Rzfrgpq]]\n"); exit(1); } init(BSIZ, buf, mode); if (mode == GENERATE) { write(STDOUT, buf, BSIZ); } else { if (len == 0) { for (;;) { if (mode == RAND) { stair(BSIZ, buf); } write(STDOUT, buf, BSIZ); } } else { while (len > 0) { if (mode == RAND) { stair(BSIZ, buf); } write(STDOUT, buf, BSIZ); --len; } } } exit(0); } /* Local Variables: */ /* compile-command:"cc -Wall -O -s -static -o stuff stuff.c" */ /* End: */ /* * tinydate.c * */ #include #include #include #include #define USE_CTIME #define EOS '\0' #define NEWLINE '\n' #ifndef BUFSIZ #define BUFSIZ 512 #endif /* ”’l‚𕶎š—ñ‚É•ÏŠ· */ char *num2str(long long d, char *s) { int p; int q; int ch; p = 0; do { s[p] = '0' + (d % 10); ++p; d /= 10; } while (d > 0); s[p] = EOS; for (q = 0; q < p / 2; q++) { ch = s[q]; s[q] = s[p - q - 1]; s[p - q - 1] = ch; } return(s); } /* ˆê•¶Žšo—Í */ void putch(int fd, unsigned char ch) { write(fd, &ch, 1); } /* •¶Žš—ño—Í */ void myputs(int fd, char *s) { while (*s) { putch(fd, *s); ++s; } } int main(int argc, char *argv[]) { char s[BUFSIZ]; time_t t; #ifdef USE_LOCALTIME struct tm *lt; #endif if ((argc > 1) && (argv[1][0] == '-')) { #ifdef USE_CTIME t = time(NULL); myputs(STDOUT_FILENO, ctime(&t)); #endif #ifdef USE_LOCALTIME t = time(NULL); lt = localtime(&t); num2str(lt->tm_year + 1900, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, '-'); num2str(lt->tm_mon + 1, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, '-'); num2str(lt->tm_mday, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, ' '); num2str(lt->tm_hour, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, ':'); num2str(lt->tm_min, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, ':'); num2str(lt->tm_sec, s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, ':'); #endif } else { num2str(time(NULL), s); myputs(STDOUT_FILENO, s); putch(STDOUT_FILENO, NEWLINE); } exit(0); } /* Local Variables: */ /* compile-command:"cc -Wall -O -s -static -o tinydate tinydate.c" */ /* End: */ /* * tinydump -- 512ƒoƒCƒg‚ð16iƒ_ƒ“ƒv‚·‚é * * revision history: * 0.0: Jul. 7, 2005 by Dai ISHIJIMA * 0.1: Sep. 12, 2007 (for wpout09, FreeBSD 6.2R) * 0.2: Apr. 18, 2009 (for wpout09, FreeBSD 7.1R, unsigned char) */ #include #include #include #include #include #define EOS '\0' #define BLKSIZ 512 #define NCOLS 16 /* ”’l‚𕶎š—ñ‚É•ÏŠ· */ unsigned char *num2str(long long d, unsigned char *s) { int p; int q; int ch; p = 0; do { s[p] = '0' + (d % 10); ++p; d /= 10; } while (d > 0); s[p] = EOS; for (q = 0; q < p / 2; q++) { ch = s[q]; s[q] = s[p - q - 1]; s[p - q - 1] = ch; } return(s); } /* ”’l‚𕶎š—ñ‚É•ÏŠ· */ unsigned char *num2hex(long long d, int cols, unsigned char *s) { int p; int q; int ch; p = 0; do { s[p] = '0' + (d % 16); if (s[p] > '9') { s[p] += ('a' - '9' - 1); } ++p; d /= 16; } while (d > 0); while (p < cols) { s[p] = '0'; ++p; } s[p] = EOS; /* •¶Žš—ñ‚ð‚ЂÁ‚­‚è‚©‚¦‚· */ for (q = 0; q < p / 2; q++) { ch = s[q]; s[q] = s[p - q - 1]; s[p - q - 1] = ch; } return(s); } /* ˆê•¶Žšo—Í */ void putch(int fd, unsigned char ch) { write(fd, &ch, 1); } /* •¶Žš—ño—Í */ void myputs(int fd, unsigned char *s) { while (*s) { putch(fd, *s); ++s; } } int main() { unsigned char s[BLKSIZ]; unsigned char t[BLKSIZ]; int i, j; read(STDIN_FILENO, s, BLKSIZ); for (i = 0; i < BLKSIZ; i += NCOLS) { num2hex(i, 3, t); myputs(STDOUT_FILENO, t); myputs(STDOUT_FILENO, " "); for (j = 0; j < NCOLS; j++) { if (j == NCOLS / 2) { putch(STDOUT_FILENO, ' '); } num2hex(s[i + j], 2, t); myputs(STDOUT_FILENO, t); putch(STDOUT_FILENO, ' '); } myputs(STDOUT_FILENO, " "); for (j = 0; j < NCOLS; j++) { if ((0x20 < s[i + j]) && (s[i + j] < 0x7f)) { putch(STDOUT_FILENO, s[i + j]); } else { putch(STDOUT_FILENO, '.'); } } putch(STDOUT_FILENO, '\n'); } exit(0); } /* Local Variables: */ /* compile-command:"cc -Wall -O -s -static -o tinydump tinydump.c" */ /* End: */ /* * check -- ƒf[ƒ^‚ªÁ‹Ž‚³‚ê‚Ä‚¢‚é‚©’²‚ׂé * * revision history: * 0.0: Oct. 26, 2001 by Dai ISHIJIMA * 0.1: May 1, 2004 * 0.2: Jul. 7, 2005 * 0.3: Sep. 12, 2007 (for wpout09, FreeBSD 6.2R) * 0.4: Sep. 23, 2021 (for wpout21, FreeBSD 12.2R) */ #include #include #include #include #include #define YES 1 #define NO 0 #define EOS '\0' #ifndef BUFSIZ #define BUFSIZ 512 #endif #define BSIZ 1024 #define NCHARS 256 #define ERROR 5 /* Á‚³‚ê‚Ä‚¢‚È‚¢‚©‚à */ #define OK 0 /* 0‚ÅÁ‚³‚ê‚Ä‚¢‚é */ #define ONE 1 /* 1‚ÅÁ‚³‚ê‚Ä‚¢‚é */ #define NONZERO 2 /* “¯‚¶’l */ #define RANDOM 3 /* —”‚ÅÁ‚³‚ê‚Ä‚¢‚é */ #define shift --argc; ++argv /* ”’l‚𕶎š—ñ‚É•ÏŠ· */ char *num2str(long long d, char *s) { int p; int q; int ch; p = 0; do { s[p] = '0' + (d % 10); ++p; d /= 10; } while (d > 0); s[p] = EOS; for (q = 0; q < p / 2; q++) { ch = s[q]; s[q] = s[p - q - 1]; s[p - q - 1] = ch; } return(s); } /* ˆê•¶Žšo—Í */ void putch(int fd, unsigned char ch) { write(fd, &ch, 1); } /* •¶Žš—ño—Í */ void myputs(int fd, char *s) { while (*s) { putch(fd, *s); ++s; } } /* ŠeƒoƒCƒg‚ÌoŒ»•p“x */ int chkfreq(int len, unsigned char buf[]) { int freq[NCHARS]; int f, i; for (i = 0; i < NCHARS; i++) { freq[i] = 0; } for (i = 0; i < len; i++) { ++freq[buf[i]]; } f = freq[0]; for (i = 0; i < NCHARS; i++) { if (f != freq[i]) { break; } } if (i >= NCHARS) { return(YES); } return(NO); } int main(int argc, char *argv[]) { char s[BSIZ]; unsigned char buf[BSIZ]; unsigned char last; int n; int i, j; int isrand = NO; int verbose = YES; shift; while ((argc > 0) && (argv[0][0] == '-')) { if (argv[0][1] == 'v') { verbose = YES; } else if (argv[0][1] == 's') { verbose = NO; } else { myputs(STDERR_FILENO, "Usage: check [-v|-s]\n"); exit(1); } shift; } last = 0; i = 0; while ((n = read(STDIN_FILENO, buf, BSIZ)) > 0) { if ((isrand = chkfreq(n, buf)) == YES) { i += n; } else { if ((i > 0) && (last != buf[0])) { if (verbose) { myputs(STDOUT_FILENO, "not erased at "); num2str(i, s); myputs(STDOUT_FILENO, s); myputs(STDOUT_FILENO, "\n"); } exit(ERROR); } ++i; for (j = 1; j < n; j++) { if (buf[j] != buf[j - 1]) { if (verbose) { myputs(STDOUT_FILENO, "not erased at "); num2str(i, s); myputs(STDOUT_FILENO, s); myputs(STDOUT_FILENO, "\n"); } exit(ERROR); } ++i; } } last = buf[n - 1]; } if (verbose) { num2str(i, s); myputs(STDOUT_FILENO, s); } if (isrand) { if (verbose) { myputs(STDOUT_FILENO, " bytes erased with RANDOM\n"); } exit(RANDOM); } if (last == 0x00ff) { if (verbose) { myputs(STDOUT_FILENO, " bytes erased with 1\n"); } exit(ONE); } if (last != 0) { if (verbose) { myputs(STDOUT_FILENO, " bytes may be erased, but not zero\n"); } exit(NONZERO); } if (verbose) { myputs(STDOUT_FILENO, " bytes erased with 0\n"); } exit(0); } /* Local Variables: */ /* compile-command:"cc -Wall -O -static -o check check.c" */ /* End: */ /* * makembr -- ƒƒO‚ð–„‚ß‚±‚ñ‚¾MBR‚𶬠* * revision history: * 0.0: Aug. 1, 2006 by Dai ISHIJIMA (for wpout07) * 0.1: Sep. 12, 2007 (for wpout09, FreeBSD 6.2R) */ #include #include #include #include #define STDIN 0 #define STDOUT 1 #define STDERR 2 #ifndef EOF #define EOF -1 #endif #define NEWLINE '\n' #define CRET '\r' #define MBRSIZ 512 #define MESGLEN 398 #define TBLOFF 0x01be #define MESG (TBLOFF - MESGLEN) #define MAXLINE 50 /* ˆê•¶Žš“ü—Í */ int getch(int fd) { unsigned char ch; if (read(fd, &ch, 1) <= 0) { return(EOF); } return(ch); } int main() { unsigned char mbrbuf[MBRSIZ]; int ch; int len; int pos; /* ‚Æ‚è‚ ‚¦‚¸512ƒoƒCƒg“Ç‚Þ */ read(STDIN, mbrbuf, MBRSIZ); /* ‚»‚ÌŽŸ‚©‚炪‘‚«ž‚ÞƒƒO */ len = 0; pos = 0; while ((len < MESGLEN) && ((ch = getch(STDIN)) != EOF)) { if (ch == NEWLINE) { mbrbuf[MESG + len] = CRET; ++len; mbrbuf[MESG + len] = NEWLINE; ++len; pos = 0; } else if (pos < MAXLINE) { mbrbuf[MESG + len] = ch; ++len; ++pos; } else if (pos == MAXLINE) { mbrbuf[MESG + len] = '.'; ++len; ++pos; mbrbuf[MESG + len] = '.'; ++len; ++pos; mbrbuf[MESG + len] = '.'; ++len; ++pos; } } if (len < MESGLEN) { mbrbuf[MESG + len] = 0; } write(STDOUT, mbrbuf, MBRSIZ); exit(0); } /* Local Variables: */ /* compile-command:"cc -Wall -O -s -static -o makembr makembr.c" */ /* End: */ # # wpout-mbr -- ƒn[ƒhƒfƒBƒXƒNÁ‹Ž‹L˜^‚ð•\Ž¦‚·‚é # ## 0.0: Jul. 24, 2006 by Dai ISHIJIMA (for wpout07) ## 0.1: Sep. 12, 2007 (for wpout09, FreeBSD 6.2R) # # 16ƒrƒbƒg—pƒR[ƒh‚𶬠.code16 .arch i8086 .set START, 0x0000 .set LOAD, 0x7c00 # ƒvƒƒOƒ‰ƒ€‚ªƒ[ƒh‚³‚ê‚éêŠ .set TBLOFF, 0x01be # ƒp[ƒeƒBƒVƒ‡ƒ“ƒe[ƒuƒ‹ .set BOOTMAGIC, 0xAA55 # ƒu[ƒgƒZƒNƒ^‚ðŽ¦‚·ƒ}ƒWƒbƒNƒiƒ“ƒo[ .set MESGLEN, 398 # •ÛŽ‚·‚郃bƒZ[ƒW‚Ì’·‚³ .set PARTBL, START + TBLOFF .set MESG, START + TBLOFF - MESGLEN .set MESGADDR, LOAD + TBLOFF - MESGLEN .set VIDEOBIOS, 0x10 # ƒrƒfƒIBIOS (INT 10H) .set PUTCHAR, 0x0e # •¶Žš (ƒeƒŒƒ^ƒCƒv) o—Í .set VIDEOATTR, 7 # ƒrƒfƒIBIOS‚É“n‚·ƒAƒgƒŠƒrƒ…[ƒgƒpƒ‰ƒ[ƒ^ .set KEYBIOS, 0x16 # ƒL[ƒ{[ƒhBIOS .set GETCHAR, 0x00 # ˆê•¶Žš“ü—Í .set RETKEY, 0x0d # ƒGƒ“ƒ^[ƒL[ .globl start start: # ‚Æ‚è‚ ‚¦‚¸Š„‚èž‚Ý‚ð‹ÖŽ~ cli # ƒXƒ^ƒbƒN‚ð 0000:7c00 ‚ÉÝ’è xorw %ax, %ax movw %ax, %ss movw $LOAD, %sp # ƒZƒOƒƒ“ƒgƒŒƒWƒXƒ^‚ð 0000 ‚ÉBCS ‚Í•ÏX•s—v?? push %ax pop %ds push %ax pop %es # ‚±‚±‚ÅŠ„‚èž‚Ý‚ð‹–‰Â sti # ‚±‚̃vƒƒOƒ‰ƒ€‚©‚炳‚ç‚Ƀu[ƒgƒXƒgƒ‰ƒbƒv‚ð“Ç‚ñ‚¾‚è‚Í‚µ‚È‚¢‚Ì‚ÅA # ƒvƒƒOƒ‰ƒ€‚ðƒŠƒƒP[ƒg‚·‚é‚Æ‚¢‚Á‚½‘€ì‚Í‚µ‚È‚¢ main: # ƒƒbƒZ[ƒW‚ð•\Ž¦‚·‚é movw $MESGADDR, %si disp: # ASCIZ•¶Žš—ñ‚ðˆê•¶Žš‚¸‚ÂBIOSƒR[ƒ‹‚Å•\Ž¦ lodsb # ˆê•¶Žš‚¸‚Âo—Í testb %al, %al # NULL•¶Žš‚È‚ç•\Ž¦I—¹ jz keywait # •¶Žš—ñ‚Ì•\Ž¦‚ªI‚í‚Á‚½‚çƒL[“ü—Í‘Ò‚¿‚Ö push %si movw $VIDEOATTR, %bx movb $PUTCHAR, %ah int $VIDEOBIOS # ƒrƒfƒIBIOS‚ðƒR[ƒ‹‚µ‚Ä•\Ž¦ pop %si jmp disp keywait: # ƒL[ƒ{[ƒh‚ª‰Ÿ‚³‚ê‚é‚Ì‚ð‘Ò‚Â movb $GETCHAR, %ah int $KEYBIOS cmpb $RETKEY, %al jnz keywait # ƒŠƒZƒbƒg‚Í FFFF:0000 ‚ɃWƒƒƒ“ƒv(?) ljmp $0xFFFF,$0x0000 # •\Ž¦‚·‚郃bƒZ[ƒW .org MESG mesg: # ‚±‚Ì‹L‰¯‘•’u‚Ì“à—e‚Í‚í‚¢‚Õ‚½‚ñ‚ÅÁ‚³‚ꂽ‚©‚à‚µ‚ê‚È‚¢ :-) .ascii "The contents of this storage device \r\n" .ascii "may have been erased \r\n" .ascii "with hard disk wiping tool " .ascii "``wipe-out''.\r\n" .ascii "ABSOLUTELY NO WARRANTY.\r\n" .byte 0 # ‰¼‚̃p[ƒeƒBƒVƒ‡ƒ“ƒe[ƒuƒ‹‚ƃ}ƒWƒbƒN .org PARTBL ptable: .fill 0x10, 0x04, 0x00 .word BOOTMAGIC # # ƒAƒZƒ“ƒuƒ‹•û–@ # as -o wpout-mbr.o wpout-mbr.s # ld -N -e start -Ttext 0 -o wpout-mbr.out wpout-mbr.o # objcopy -S -O binary wpout-mbr.out wpout-mbr.boot # rm wpout-mbr.o wpout-mbr.out # # ‚¨‚µ‚Ü‚¢ /* * shell-on -- Žw’肵‚½tty‚ŃVƒFƒ‹‚ð‹N“®‚·‚é * * 0.0: May 5, 2014 by Dai ISHIJIMA * * usage: * shell-on tty [command [args]...] * * see also: * /usr/src/usr.sbin/sysinstall/system.c */ #include #include #include #include #include #include /* login_tty(3), -lutil */ #include #include int main(int argc, char *argv[]) { int pid; char *tty; int fd; int i; char *prog; char *shell; char **args; prog = argv[0]; if (argc <= 1) { fprintf(stderr, "Usage: %s tty [command [arg]...]\n", prog); exit(1); } tty = argv[1]; if ((fd = open(tty, O_RDWR)) < 0) { fprintf(stderr, "%s: can't open %s\n", prog, tty); exit(1); } close(fd); args = (char **)calloc(argc, sizeof(char *)); if (argc <= 2) { /* ƒIƒvƒVƒ‡ƒ“‚È‚µ¨ƒVƒFƒ‹ */ shell = "sh"; args[0] = "-sh"; args[1] = NULL; } else { shell = argv[2]; for (i = 0; i < argc - 2; i++) { args[i] = argv[2 + i]; } args[i] = NULL; } #ifdef EBUG fprintf(stderr, "%s: tty = %s, shell = %s\n", prog, tty, shell); i = 0; while (args[i] != NULL) { fprintf(stderr, "%s\n", args[i]); ++i; } #endif if ((pid = fork()) == 0) { /* Žq‹Ÿ */ int cfd; int fd; struct termios t; ioctl(0, TIOCNOTTY, NULL); for (cfd = 0; cfd < getdtablesize(); cfd++) { close(cfd); } if ((fd = open(tty, O_RDWR)) < 0) { exit(1); } ioctl(0, TIOCSCTTY, &fd); dup2(0, 1); dup2(0, 2); if (login_tty(fd) < 0) { exit(1); } signal(SIGTTOU, SIG_IGN); if (tcgetattr(fd, &t) < 0) { fprintf(stderr, "unable to get terminal attributes\n"); } else { t.c_cc[VERASE] = '\010'; if (tcsetattr(fd, TCSANOW, &t) < 0) { fprintf(stderr, "unable to set terminal attributes\n"); } } execvp(shell, args); fprintf(stderr, "unable to execute sh\n"); exit(1); } exit(0); } /* Local Variables: */ /* compile-command:"cc -Wall -o shell-on shell-on.c -lutil" */ /* End: */ /* * tread -- read with timeout * * revision history * 0.1: Dec. 8, 2016 by Dai ISHIJIMA */ #include #include #include #include #include #include #include #include #include #include #define YES 1 #define NO 0 char *prog; #define shift --argc; ++argv static struct termios keyorg, keynew; /* ƒL[ƒ{[ƒh (stdin) ‚Ìó‘Ô‚ð•ÛŽ */ /* ƒL[ƒ{[ƒh (stdin) ‚ðu¶vƒ‚[ƒhAƒGƒR[‚È‚µ‚É */ void kbdinit(int echo) { if (isatty(fileno(stdin))) { tcgetattr(fileno(stdin), &keyorg); memcpy(&keynew, &keyorg, sizeof(struct termios)); cfmakeraw(&keynew); /* keynew.c_lflag &= ~ECHO; */ if (echo > 0) { /* -e ³‚Ì” -> ƒGƒR[‚ ‚è */ keynew.c_lflag |= ECHO; } if (echo < 0) { /* -e •‰‚Ì” -> ƒGƒR[‚È‚µ */ keynew.c_lflag &= ~ECHO; } tcsetattr(fileno(stdin), TCSANOW, &keynew); } } /* ƒL[ƒ{[ƒh (stdin) ‚ÌÝ’è‚ðŒ³‚É–ß‚· */ void kbdrestore() { if (isatty(fileno(stdin))) { tcsetattr(fileno(stdin), TCSANOW, &keyorg); } } /* “ü—Í‚ª‚ ‚é‚Ü‚Å‘Ò‚Â */ int waitfor(long seconds, int echo) { int nfds; fd_set readfds; struct timeval timeout; int status = 0; kbdinit(echo); FD_ZERO(&readfds); FD_SET(fileno(stdin), &readfds); timeout.tv_sec = seconds; timeout.tv_usec = 0; nfds = select(fileno(stdin) + 1, &readfds, NULL, NULL, &timeout); if ((nfds < 0) && (errno != EINTR)) { fprintf(stderr, "%s: select failed\n", prog); status = -1; } if ((nfds > 0) && (FD_ISSET(fileno(stdin), &readfds))) { /* ƒL[ƒ{[ƒh“ü—Í‚ ‚è */ status = 1; } kbdrestore(); return(status); } /* Žg‚¢•û‚̊ȈÕà–¾ */ void usage() { fprintf(stderr, "Usage: %s [option...]\n", prog); fprintf(stderr, " options:\n"); fprintf(stderr, "\t-t #: set timeout\n"); fprintf(stderr, "\t-p #: set prompt\n"); fprintf(stderr, "\t-e #: set echo mode\n"); } /* ƒƒCƒ“ */ int main(int argc, char *argv[]) { long seconds=10; char value[BUFSIZ]; char prompt[BUFSIZ]; int echo = 0; prog = *argv; shift; prompt[0] = '\0'; while ((argc > 0) && (argv[0][0] == '-')) { if ((argv[0][1] == 't') && (argc > 1)) { /* ƒ^ƒCƒ€ƒAƒEƒg */ shift; seconds = atoi(*argv); } else if ((argv[0][1] == 'p') && (argc > 1)) { /* ƒvƒƒ“ƒvƒg */ shift; strncpy(prompt, *argv, BUFSIZ); } else if ((argv[0][1] == 'e') && (argc > 1)) { /* ECHO */ shift; echo = atoi(*argv); } else { usage(); exit(1); } shift; } fputs(prompt, stderr); if (waitfor(seconds, echo) > 0) { fgets(value, BUFSIZ, stdin); fputs(value, stdout); exit(0); } exit(1); } /* Local Variables: */ /* compile-command:"cc -Wall -o tread tread.c" */ /* End: */ /* * session.c -- ƒZƒbƒVƒ‡ƒ“ID‚ðŒvŽZ‚·‚é * * 0.0: May 18, 2020 by Dai ISHIJIMA */ #include #include #include #include int main() { struct timeval t; unsigned long sec, usec; unsigned long id; gettimeofday(&t, NULL); /* 01234567 */ sec = (t.tv_sec & 0xffffffff); usec = (t.tv_usec & 0xffffffff); id = sec ^ usec; printf("%d\n", sec); printf("%04x:%04x\n", id & 0xffff, (id & 0xffff0000) >> 16); exit(0); } /* Local Variables: */ /* compile-command:"cc -Wall -O -static -o session session.c" */ /* End: */