Skip to content

Instantly share code, notes, and snippets.

@nathanchance
Created October 12, 2018 19:03
Show Gist options
  • Save nathanchance/e331a237f855cf1db632466ba6967a19 to your computer and use it in GitHub Desktop.
Save nathanchance/e331a237f855cf1db632466ba6967a19 to your computer and use it in GitHub Desktop.
BR2_aarch64=y
BR2_cortex_a57=y
BR2_OPTIMIZE_3=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TARGET_GENERIC_ROOT_PASSWD="root"
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_BASH=y
BR2_PACKAGE_HTOP=y
BR2_PACKAGE_VIM=y
BR2_TARGET_ROOTFS_CPIO=y
# BR2_TARGET_ROOTFS_TAR is not set
@nickdesaulniers
Copy link

Is there any way to remove the root password? I was getting stuck trying to make an image that would log in automatically. Guenter Roeck's rootfs images boot without a password, but I'm not sure how to control that in Linux.

@nathanchance
Copy link
Author

Why doesn't GitHub notify of gist comments...?

I actually never looked into it for buildroot because I wasn't able to find anything for debootstrap for x86. However, I just found this that I should try later: https://unix.stackexchange.com/questions/299408/how-to-login-automatically-without-typing-the-root-username-or-password-in-build

@nickdesaulniers
Copy link

I think these defconfigs are the way to go, and would prefer having those to fetching Guenter's images. As in build the image immediately then boot it. What's the procedure for using these defconfigs in buildroot?

@nickdesaulniers
Copy link

This is the document I was following for buildroot, as per our dynamic tools team:
https://github.com/google/syzkaller/blob/master/docs/linux/setup_linux-host_qemu-vm_arm64-kernel.md

@nickdesaulniers
Copy link

Thanks for the link @nathanchance, that worked.

$ cd buildroot
$ mkdir -p overlays/etc/
$ cp output/target/etc/inittab overlays/etc/.
$ vim overlays/etc/inittab
-console::respawn:/sbin/getty -L console 0 vt100
+::respawn:-/bin/sh
$ make menuconfig

System configuration > Root filesystem overlay directories set to overlays

$ make
$ cd ~/linux
$ qemu-system-aarch64 -kernel arch/arm64/boot/Image.gz -machine virt -cpu cortex-a57 -m 2048 -append "console=ttyAMA0 root=/dev/vda" -nographic -hda ~/buildroot/output/images/rootfs.ext2 -no-reboot

@nickdesaulniers
Copy link

nickdesaulniers commented Oct 30, 2018

$ make savedefconfig

doesn't create a defconfig file for me, though. Am I holding it wrong? 🐈

@nickdesaulniers
Copy link

Am I holding it wrong?

[Yes] 🌵

$ make savedefconfig BR2_DEFCONFIG=path/to/save/defconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment