Commit Graph

9 Commits

Author SHA1 Message Date
Stefan Hajnoczi
a7bafc53c9 initrd-builder: make initrd_builder.sh idempotent
If initrd_builder.sh fails partway through it may not be possible to run
it again without creating a new rootfs.

This happens because initrd_builder.sh checks for the presence of
/sbin/init and refuses to run if it is missing.  Later on, the script
moves /sbin/init to /init, where the kernel expects to find it in an
initramfs.  After this step initrd_builder.sh will refuse to run again
since /sbin/init is now missing.

Create a symlink from /init to /sbin/init instead of moving the file.
This allows initrd_builder.sh to be run repeatedly on the same rootfs.

Fixes: #130
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-06-29 15:08:56 +01:00
James O. D. Hunt
ddb71e8ef5 initrd: Remove mention of USE_DOCKER
Removed `USE_DOCKER` from the initrd builder usage statement as that
builder does not use Docker.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 11:17:02 +01:00
James O. D. Hunt
019a80f304 refactor: Move more functions to script library
Moved the display functions to the script library to avoid duplication.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 08:29:23 +01:00
James O. D. Hunt
a18753b2ff refactor: Remove duplicate variable
Some of the scripts had two variables to refer to the program name.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-19 16:00:37 +01:00
James O. D. Hunt
f3e89d38a9 refactor: Simplify enabling debug
Simplify the logic to enable debug and also enable debug as early as
possible.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-19 15:55:34 +01:00
Nitesh Konkar
6930c24d14 initrd-builder: fix initrd image name
The initrd image name should be kata-containers-initrd.img,
as its referenced by this name later on.

Fixes #14

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2018-04-04 17:55:32 +05:30
Peng Tao
56ab8c99fe initrd-builder: fix ROOTFS_DIR typo
It should be just ROOTFS.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-22 23:18:07 +08:00
Peng Tao
de6e4dc93f builder: fix agent binary path
kata agent is installed in `${ROOTFS}/usr/bin/` rather than `${ROOTFS}/bin/`.
It just happended to work because `bin` is a symlink to `usr/bin`, which
might not be true in some distros. So do not rely on it.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-02-05 17:18:52 +08:00
Peng Tao
82759dac14 initrd: add script to build kata initrd image
Build a kata initrd image based on rootfs created by rootfs.sh.

Fixes: #5

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-02-01 23:27:36 +08:00