Use common .gitignore suffix and gitignore* prefix for most ignores

This commit is contained in:
Ciro Santilli
2018-03-18 10:54:38 +00:00
parent f124af09c4
commit 8233b9249b
5 changed files with 27 additions and 40 deletions

22
.gitignore vendored
View File

@@ -1,22 +1,14 @@
*.cmd # Extensions and prefixes.
*.ko
*.log *.log
*.mod.c
*.o
*.out
*.tmp *.tmp
*~ *~
.tmp_versions ?*.gitignore
/br2_cli gitignore*
/br2_local
/ignore.sh # Specific files.
/rootfs_overlay/etc/init.d/S99
/rootfs_overlay/ignore.sh
/9p /9p
Module.symvers /README.html
README.html /trace*
modules.order
trace*
# GEM5 # GEM5
/m5out /m5out

View File

@@ -914,8 +914,8 @@ If the script is large, you can add it to a gitignored file and pass that to `-E
echo ' echo '
insmod /hello.ko insmod /hello.ko
/poweroff.out /poweroff.out
' > ignore.sh ' > gitignore.sh
./run -E "$(cat ignore.sh)" -n ./run -E "$(cat gitignore.sh)" -n
.... ....
or add it to a file to the root filesystem guest and rebuild: or add it to a file to the root filesystem guest and rebuild:
@@ -924,10 +924,10 @@ or add it to a file to the root filesystem guest and rebuild:
echo '#!/bin/sh echo '#!/bin/sh
insmod /hello.ko insmod /hello.ko
/poweroff.out /poweroff.out
' > rootfs_overlay/ignore.sh ' > rootfs_overlay/gitignore.sh
chmod +x rootfs_overlay/ignore.sh chmod +x rootfs_overlay/gitignore.sh
./build ./build
./run -e 'init=/ignore.sh' -n ./run -e 'init=/gitignore.sh' -n
.... ....
Remember that if your init returns, the kernel will panic, there are just two non-panic possibilities: Remember that if your init returns, the kernel will panic, there are just two non-panic possibilities:
@@ -968,16 +968,14 @@ The `lkmc_eval` option gets evaled by our default `S98` startup script if presen
Alternatively, add them to a new `init.d` entry to run at the end o the BusyBox init: Alternatively, add them to a new `init.d` entry to run at the end o the BusyBox init:
.... ....
cp rootfs_overlay/etc/init.d/S98 rootfs_overlay/etc/init.d/S99 cp rootfs_overlay/etc/init.d/S98 rootfs_overlay/etc/init.d/S99.gitignore
vim S99 vim rootfs_overlay/etc/init.d/S99.gitignore
./build ./build
./run ./run
.... ....
and they will be run automatically before the login prompt. and they will be run automatically before the login prompt.
`S99` is a git tracked convenience symlink to the gitignored `rootfs_overlay/etc/init.d/S99`
Scripts under `/etc/init.d` are run by `/etc/init.d/rcS`, which gets called by the line `::sysinit:/etc/init.d/rcS` in `/etc/inittab`. Scripts under `/etc/init.d` are run by `/etc/init.d/rcS`, which gets called by the line `::sysinit:/etc/init.d/rcS` in `/etc/inittab`.
=== Path to init === Path to init
@@ -2209,9 +2207,9 @@ External open source benchmarks. We will try to create Buildroot packages for th
Buildroot supports it, which makes everything just trivial: Buildroot supports it, which makes everything just trivial:
.... ....
printf 'BR2_PACKAGE_OPENBLAS=y\n' >> br2_local printf 'BR2_PACKAGE_OPENBLAS=y\n' >> br2.gitignore
printf 'BR2_TARGET_ROOTFS_EXT2_SIZE="128M"\n' >> br2_local printf 'BR2_TARGET_ROOTFS_EXT2_SIZE="128M"\n' >> br2.gitignore
./build -a arm -g -b br2_local -- kernel_module-reconfigure ./build -a arm -g -b br2.gitignore -- kernel_module-reconfigure
.... ....
and then inside the guest run our test program: and then inside the guest run our test program:
@@ -2223,7 +2221,7 @@ and then inside the guest run our test program:
For x86, you also need: For x86, you also need:
.... ....
printf 'BR2_PACKAGE_OPENBLAS_TARGET="NEHALEM"\n' >> br2_local printf 'BR2_PACKAGE_OPENBLAS_TARGET="NEHALEM"\n' >> br2.gitignore
.... ....
to overcome this bug: https://bugs.busybox.net/show_bug.cgi?id=10856 to overcome this bug: https://bugs.busybox.net/show_bug.cgi?id=10856
@@ -2794,12 +2792,10 @@ dmesg
We provide the following mechanisms: We provide the following mechanisms:
* `./build -b br2_local`: append the file `br2_local` to a single build. Must be passed every time you run `./build`. * `./build -b br2.gitignore`: append the file `br2.gitignore` to a single build. Must be passed every time you run `./build`.
+
For convenience, we already gitignore `br2_local` for you. A template is provided by:
+ +
.... ....
cp br2_local.example br2_local cp br2.gitignore.example br2.gitignore
.... ....
+ +
* `./build -c 'BR2_SOM_OPTION="myval"'`: append a single option to a single build. * `./build -c 'BR2_SOM_OPTION="myval"'`: append a single option to a single build.

1
S99
View File

@@ -1 +0,0 @@
rootfs_overlay/etc/init.d/S99

14
build
View File

@@ -3,8 +3,8 @@ set -eu
help_text=' help_text='
' '
arch=x86_64 arch=x86_64
rm -f br2_cli rm -f br2_cli.gitignore
touch br2_cli touch br2_cli.gitignore
configure=true configure=true
config_fragments='br2' config_fragments='br2'
extra_make_args='' extra_make_args=''
@@ -23,7 +23,7 @@ while getopts 'a:b:c:Cgj:IiK:klp:qSv' OPT; do
config_fragments="$config_fragments $OPTARG" config_fragments="$config_fragments $OPTARG"
;; ;;
c) c)
echo "$OPTARG" >> br2_cli echo "$OPTARG" >> br2_cli.gitignore
;; ;;
C) C)
configure=false configure=false
@@ -36,17 +36,17 @@ while getopts 'a:b:c:Cgj:IiK:klp:qSv' OPT; do
BR2_TARGET_ROOTFS_CPIO=n BR2_TARGET_ROOTFS_CPIO=n
BR2_TARGET_ROOTFS_EXT2=n BR2_TARGET_ROOTFS_EXT2=n
BR2_TARGET_ROOTFS_INITRAMFS=y BR2_TARGET_ROOTFS_INITRAMFS=y
" >> br2_cli " >> br2_cli.gitignore
;; ;;
i) i)
echo " echo "
BR2_TARGET_ROOTFS_CPIO=y BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_EXT2=n BR2_TARGET_ROOTFS_EXT2=n
BR2_TARGET_ROOTFS_INITRAMFS=n BR2_TARGET_ROOTFS_INITRAMFS=n
" >> br2_cli " >> br2_cli.gitignore
;; ;;
j) j)
echo "$OPTARG" >> br2_cli echo "$OPTARG" >> br2_cli.gitignore
;; ;;
k) k)
extra_make_args="$extra_make_args kernel_module-reconfigure" extra_make_args="$extra_make_args kernel_module-reconfigure"
@@ -99,7 +99,7 @@ root_dir="$(pwd)"
buildroot_dir="${root_dir}/buildroot" buildroot_dir="${root_dir}/buildroot"
out_dir="${buildroot_dir}/output.${arch_dir}~" out_dir="${buildroot_dir}/output.${arch_dir}~"
config_file="${out_dir}/.config" config_file="${out_dir}/.config"
config_fragments="$config_fragments br2_cli" config_fragments="$config_fragments br2_cli.gitignore"
if "$configure"; then if "$configure"; then
cd "${buildroot_dir}" cd "${buildroot_dir}"