mirror of
				https://github.com/falsycat/ar.falsy.cat.git
				synced 2025-10-31 05:38:20 +00:00 
			
		
		
		
	update
This commit is contained in:
		
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @@ -21,4 +21,4 @@ serve: ## Serve Quartz locally | ||||
| 	hugo server --enableGitInfo --minify --bind=$(or $(HUGO_BIND),0.0.0.0) --baseURL=$(or $(HUGO_BASEURL),http://localhost) --port=$(or $(HUGO_PORT),1313) --appendPort=$(or $(HUGO_APPENDPORT),true) --liveReloadPort=$(or $(HUGO_LIVERELOADPORT),-1) | ||||
|  | ||||
| docker: ## Serve locally using Docker | ||||
| 	docker run -it --volume=$(shell pwd):/quartz -p 1313:1313 ghcr.io/jackyzha0/quartz:hugo | ||||
| 	docker run -it --init --name quartz-preview --volume=$(shell pwd):/quartz -p 1313:1313 ghcr.io/jackyzha0/quartz:hugo; docker rm quartz-preview | ||||
|   | ||||
							
								
								
									
										74
									
								
								content/note/info-tech/install-archlinux.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								content/note/info-tech/install-archlinux.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,74 @@ | ||||
| --- | ||||
| title: ArchLinuxのインストール | ||||
| tags: [note, info-tech, linux] | ||||
| --- | ||||
|  | ||||
| ## 概要 | ||||
| - [ArchLinux](https://archlinux.org)のインストール手順を記録する | ||||
| - Live Environmentの起動方法については触れない | ||||
|  | ||||
| <!-- more --> | ||||
|  | ||||
| ## 前提 | ||||
| - [qemu](note/info-tech/qemu.md)上の仮想マシン | ||||
| - BIOS | ||||
| - GPT | ||||
| - x86_64 | ||||
| - デュアルブートなし | ||||
| - できるだけシンプル,ミニマリスティックに | ||||
|  | ||||
| ## 手順 | ||||
| ### 1. 事前準備 | ||||
|  | ||||
| ```bash | ||||
| loadkeys jp106      # キーボード設定 | ||||
| ping google.com     # インターネット疎通確認 | ||||
| timedatectl status  # 時間の確認 (この時点ではUTC) | ||||
| ``` | ||||
|  | ||||
| ### 2. パーティショニング | ||||
| ```bash | ||||
| cfdisk /dev/sda       # 先頭1MiBをBIOS bootに,残りをLinuxに設定 | ||||
| mkfs.ext4 /dev/sda1   # フォーマット | ||||
| mount /dev/sda1 /mnt  # /mntへマウント | ||||
| ``` | ||||
|  | ||||
| ### 3. インストール | ||||
| ```bash | ||||
| vim /etc/pacman.d/mirrorlist                    # 日本のmirrorを指定しておく | ||||
| pacstrap -K /mnt base linux linux-firmware vim  # Wi-Fiで10分くらい | ||||
| ``` | ||||
|  | ||||
| - 執筆時点で有効な日本のmirror | ||||
| 	- `http://mirrors.cat.net/archlinux/$repo/os/$arch` | ||||
| 	- `https://mirrors.cat.net/archlinux/$repo/os/$arch` | ||||
|  | ||||
| ### 4. 初期設定 | ||||
| ```bash | ||||
| genfstab -U /mnt >> /mnt/etc/fstab | ||||
| arch-chroot /mnt  # 以下仮想rootで作業 | ||||
| ``` | ||||
| #### 時計関係 | ||||
| ```bash | ||||
| ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime  # TZを東京に | ||||
| hwclock --systohc | ||||
| ``` | ||||
|  | ||||
| #### 言語関係 | ||||
| - `/etc/locale.gen`を編集して,`en_US.UTF-8 UTF-8`をアンコメント | ||||
| - `locale-gen` | ||||
| - `/etc/locale.conf`を作成して`LANG=en_US.UTF-8`を追記- | ||||
| - `/etc/vconsole.conf`を作成して`KEYMAP=jp106`を追記 | ||||
|  | ||||
| #### カスタマイズ | ||||
| - `/etc/hostname`にホスト名を設定 | ||||
| - `passwd`でrootパスワードを設定 | ||||
|  | ||||
| #### ブートローダのインストール | ||||
| ```bash | ||||
| pacman -S grub/ | ||||
| grub-install --target=i386-pc /dev/sda | ||||
| grub-mkconfig -o /boot/grub/grub.cfg | ||||
| ``` | ||||
|  | ||||
| 以上. | ||||
| @@ -29,8 +29,13 @@ tags: [note, info-tech, web] | ||||
| 3. pushする | ||||
|  | ||||
| ## ローカルプレビュー | ||||
| - まだ[qemu](note/info-tech/qemu.md)上のマシンへのOSインストール作業ができていないので,また今度試す | ||||
| - なるべくホストマシンは汚したくない(切実) | ||||
| - dockerがあれば,リポジトリrootで`make docker`すれば`localhost:1313`にアクセスできる | ||||
| - `Makefile`の`docker`ターゲットのコマンドを下のように置き換えることで次の問題が解決できる | ||||
| 	- Ctrl+Cでサーバーが終了しない | ||||
| 	- `make docker`する度にゴミコンテナが残る | ||||
| ```bash | ||||
| docker run -it --init --name quartz-preview --volume=$(shell pwd):/quartz -p 1313:1313 ghcr.io/jackyzha0/quartz:hugo; docker rm quartz-preview | ||||
| ``` | ||||
|  | ||||
| ## カスタマイズ | ||||
|  | ||||
|   | ||||
| @@ -21,15 +21,16 @@ $ brew install qemu | ||||
|  | ||||
| ## コマンド逆引き | ||||
|  | ||||
| ### ディスクイメージ作成 | ||||
| ```bash | ||||
| qemu-img create -f qcow2 sda.qcow2 16G | ||||
| ``` | ||||
|  | ||||
| ### archのlive cdを起動 | ||||
| ```bash | ||||
| qemu-system-x86_64 \ | ||||
|   -m 4G  \ | ||||
|   -cdrom ../iso/archlinux-2023.02.01-x86_64.iso | ||||
|   -cdrom ../iso/archlinux-2023.02.01-x86_64.iso  \ | ||||
|   sda.qcow2 | ||||
| ``` | ||||
|  | ||||
| ## オプション一覧 | ||||
| ``` | ||||
| -m 4G         # メモリサイズ指定 | ||||
| -cdrom a.iso  # ISOファイル指定 | ||||
| ``` | ||||
| - [関連: ArchLinuxのインストール方法](note/info-tech/install-archlinux.md) | ||||
		Reference in New Issue
	
	Block a user