Skip to content

Commit

Permalink
initrd: rename goinitrd to initrd
Browse files Browse the repository at this point in the history
Signed-off-by: Nobuhiro MIKI <nob@bobuhiro11.net>
  • Loading branch information
bobuhiro11 committed May 9, 2022
1 parent 1555e05 commit cf8ad48
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
File renamed without changes.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
gokvm
golangci-lint
initrd
goinitrd
bzImage
linux-*.tar.xz
linux.tar.xz
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ before_script:
- sudo -E env "PATH=$PATH" ./cc-test-reporter before-build
- sudo -E env "PATH=$PATH" "GO111MODULE=off" go get github.com/mattn/goveralls
- sudo -E env "PATH=$PATH" "GO111MODULE=off" go get github.com/u-root/u-root
- sudo -E env "PATH=$PATH" make golangci-lint goinitrd vda.img
- sudo -E env "PATH=$PATH" make golangci-lint initrd vda.img
- sudo -E env "PATH=$PATH" make -j $(nproc) bzImage
script:
- sudo -E env "PATH=$PATH" make gokvm
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ vda.img:
# You need to have installed the u-root command.
# GOPATH needs to be set.
# Something weird here: if I use $SHELL in this it expands to /bin/sh *in this makefile*, but not outside. WTF?
goinitrd:
sed -i -e 's|{{ GUEST_IPV4_ADDR }}|$(GUEST_IPV4_ADDR)|g' goinitrd.bashrc
initrd:
sed -i -e 's|{{ GUEST_IPV4_ADDR }}|$(GUEST_IPV4_ADDR)|g' .bashrc
(cd $(GOPATH)/src/github.com/u-root/u-root && \
u-root \
-defaultsh `which bash` \
-o $(PWD)/goinitrd \
-o $(PWD)/initrd \
-files `which ethtool` \
-files `which lspci` \
-files `which lsblk` \
Expand All @@ -44,7 +44,7 @@ goinitrd:
-files `which tic` \
-files "/usr/share/terminfo/l/linux-c:/usr/share/terminfo/l/linux" \
-files "/usr/share/misc/pci.ids" \
-files "$(PWD)/goinitrd.bashrc:/.bashrc" \
-files "$(PWD)/.bashrc:.bashrc" \
core boot github.com/u-root/u-root/cmds/exp/srvfiles)

linux.tar.xz:
Expand All @@ -60,7 +60,7 @@ bzImage: linux.config linux.tar.xz
cp _linux/arch/x86/boot/bzImage .

.PHONY: run
run: goinitrd bzImage
run: initrd bzImage
go run . -c 4

.PHONY: run-system-kernel
Expand All @@ -85,14 +85,14 @@ golangci: golangci-lint
--disable gocognit \
./...

test: golangci goinitrd bzImage vda.img
test: golangci initrd bzImage vda.img
go test -coverprofile c.out ./...

.PHONY: clean
clean:
rm -rf ./gokvm ./golangci-lint bzImage _linux

.PHONY: qemu
qemu: goinitrd bzImage
qemu-system-x86_64 -kernel ./bzImage -initrd ./goinitrd --nographic --enable-kvm \
qemu: initrd bzImage
qemu-system-x86_64 -kernel ./bzImage -initrd ./initrd --nographic --enable-kvm \
--append "root=/dev/ram rw console=ttyS0 rdinit=/init" --enable-kvm
2 changes: 1 addition & 1 deletion flag/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

func ParseArgs(args []string) (string, string, string, string, string, int, error) {
kernel := flag.String("k", "./bzImage", "kernel image path")
initrd := flag.String("i", "./goinitrd", "initrd path")
initrd := flag.String("i", "./initrd", "initrd path")
nCpus := flag.Int("c", 1, "number of cpus")
tapIfName := flag.String("t", "tap", "name of tap interface")
disk := flag.String("d", "/dev/zero", "path of disk file (for /dev/vda)")
Expand Down
2 changes: 1 addition & 1 deletion machine/machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestNewAndLoadLinux(t *testing.T) { // nolint:paralleltest
t.Fatal(err)
}

initrd, err := os.Open("../goinitrd")
initrd, err := os.Open("../initrd")
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit cf8ad48

Please sign in to comment.