Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
とある帽子の大蛇料理Ⅱ
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Masami Ichikawa
May 22, 2011
Programming
99
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
とある帽子の大蛇料理Ⅱ
Masami Ichikawa
May 22, 2011
More Decks by Masami Ichikawa
See All by Masami Ichikawa
cgroupsとプロセス生成・終了処理
masami256
1
1.4k
Linux の Debug 機能
masami256
0
110
Linux Namespaces
masami256
0
81
slub: alloc and free
masami256
0
99
SLUB data structures
masami256
0
130
SystemV IPC
masami256
0
140
Linux Namespace
masami256
0
93
Gnomeとdogtail
masami256
0
110
x86 とコンテキストスイッチ
masami256
0
300
Other Decks in Programming
See All in Programming
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.1k
RTSPクライアントを自作してみた話
simotin13
0
610
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
150
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
880
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
11
4.3k
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.4k
Claspは野良GASの夢をみるか
takter00
0
200
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.2k
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
550
Oxlintのカスタムルールの現況
syumai
6
1.1k
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
250
Featured
See All Featured
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
The Invisible Side of Design
smashingmag
302
52k
4 Signs Your Business is Dying
shpigford
187
22k
AI: The stuff that nobody shows you
jnunemaker
PRO
8
720
It's Worth the Effort
3n
188
29k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Side Projects
sachag
455
43k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
310
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
370
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
340
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
210
Transcript
Twitter : @masami256 Mail :
[email protected]
Anaconda Overview • Stage1,2 の 2 段階でインストーラが起動 • Stage1 •
ブートオプション処理 • メディアチェック • ネットワーク設定(必要なら) • Stage2 の実行 • Stage2 • 言語、キーボード、パーティション設定などの 実際のインストール処理
これが出ると Stage1 完了
None
C(Stage1) と Python(Stage2) GUI は PyGtk Anaconda Programming
Anaconda UI • インストーラの機能( GUI を使う場合)は以 下のファイルにクラスを登録 • dispatch.py •
gui.py • installclass.py
dispatch.py • インストール手順に関するファイル • 各機能が動く順番を設定 • 次のステップに進む / 前のステップに戻るなど の処理を実施
installSteps = [ ("kernelvm_top", ), ("installTinyCoreNag", installTinyCoreNagScreen, ), キー名 関数名
gui.py • GUI に関する基本的な処理を実施 • 変数 stepToClass にキー名とファイル名、クラ ス名を設定 stepToClass
= { "kernelvm_top" : ("kernelvm_top_gui", "KernelvmTopWindow"),
installcalss.py • • dispatch クラスに dispath.py で登録したキー名を登録 dispatch.setStepList( "kernelvm_top", "installTinyCoreNag",
Anaconda UI and Logic • UI 周りの処理と、実際の処理はファイルが分 かれてます • pyanaconda/language.py
– 言語回りでの処理を実施 • pyanaconda/iw/language_gui.py – Langauge の画面に関する処理 • GUI のコード • PyGtk の場合は pyanaconda/iw • テキストの場合は pyanaconda/textw
class KernelvmTopWindow (InstallWindow): windowTitle = "Kernel/VM" #N_("KernelVM") def __init__ (self,
ics): InstallWindow.__init__ (self, ics) ics.setGrabNext (1) self.anaconda = None def getScreen (self, anaconda): self.anaconda = anaconda box = gtk.VBox (False, 10) pix = gui.readImageFromFile ("kernelvm.png") if pix: a = gtk.Alignment () a.add (pix) a.set (0.5, 0.5, 1.0, 1.0) a.set_size_request(200, -1) box.pack_start (a, False) box.pack_start(self.createHbox()) return box iw/kernelvm_top_gui.py
kerenelvm_top.py class kernelvm_top (object): def __init__ (self, display_mode = 'g'):
pass def write(self, instPath): pass def writeKS(self, f): pass
None
Anaonda Testing • iso イメージ作るのは大変です>< • 既存の iso イメージ弄るのも面倒 •
そこで updates.img の出番です!
updates.img • make updates するだけ • updates.img というファイルができます • 差分のあるファイルのみを抽出して
cpio でまと めて gzip したファイルです • .spec ファイルのリリースバージョン、 git の tag から差分を見ているようです • ブート時にオプションを渡します • updates=http://10.0.2.2/updates.img
Anaconda 弄りは割と手軽にできますね ^q^
ってことで作りました
Linux の代わりに自作カーネルのインストール
誰得?
変更箇所 • yuminstall.py • rpm ファイルのインストール部分 • bootloader.py • Grub
周りの処理 •
packages.py def doInstallTinyCore(self, anaconda): gzipImage = "/tmp/updates/tinycore.gz" f = gzip.open(gzipImage,
'rb') data = f.read() cpioFile = "/tmp/tinycore.cpio" w = open(cpioFile,'wb') w.write(data) w.close() f.close() cmd = "cd %(rootPath)s && cpio -id < %(cpiofile)s" % {'rootPath' : anaconda.rootPath, 'cpiofile' : cpioFile} os.system(cmd)
bootloader.py def installGrubForTinyCore(anaconda): Grub の rpm を /mnt/sysimage にインストール
grub-install –root-directroy=/mnt/sysimage /dev/sda grub –batch --device-map=/dev/null << EOF\ndevice (hd0)\t%(sda)s1\nroot (hd0)\nsetup (hd0)\nquit\nEOF カーネルを /mnt/sysimage/boot にコピー
bootloader.py def writeBootloader(anaconda): # for (version, arch, nick) in \
# anaconda.backend.kernelVersionList(anaconda.rootPath): # if plainLabelUsed: # kernelList.append(("%s-%s" %(kernelLabel, nick), # "%s-%s" %(kernelLongLabel, nick), # version)) # else: # kernelList.append((kernelLabel, kernelLongLabel, version)) # if nick != "base": # defkern = "kernel-%s" %(nick,) # plainLabelUsed = 1 kernelList.append(('miko', 'miko', '0'))
カーネル自作したら Anaconda でインストーラを作り 配布しましょう\ (^o^) /
URL • Fedora Anaconda repogitory • git://git.fedorahosted.org/git/anaconda.git • Anaconda for
Ore ore kernel • https://github.com/masami256/Anaconda-for- ore-ore-kernel