Compare commits

..

3 commits

Author SHA1 Message Date
023095a01a Usar cache
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-06-17 22:46:16 -03:00
670bc889ef alpine: Chequear bien por error 2022-06-17 22:41:34 -03:00
82d7066d0f alpine: No llamar a apk innecesariamente 2022-06-17 22:28:42 -03:00
2 changed files with 11 additions and 5 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@ root/
v00001/
boot/
image.squashfs
cache/

View file

@ -94,16 +94,21 @@ end
-- Returns nil when no failure, otherwise string error or apk's status code
function alpine.make_world(rootfs_path, packages)
local world = alpine.write_file(rootfs_path,
local err = alpine.symlink(rootfs_path, "/etc/apk/cache", "../../../cache")
if err then return err end
local err = alpine.mkdir(rootfs_path, "../cache")
if err then return err end
local err = alpine.write_file(rootfs_path,
"/etc/apk/world",
utils.join_table(packages, "\n"))
if err then return err end
local status = os.execute("sudo apk update --no-cache --root "..rootfs_path)
local status = os.execute("sudo apk upgrade --clean-protected --root "..rootfs_path)
if not (status == 0) then return status end
local status = os.execute("sudo apk upgrade --clean-protected --no-cache --root "..rootfs_path)
if not (status == 0) then return status end
local status = os.execute("sudo apk add --clean-protected --no-cache --root "..rootfs_path)
local status = os.execute(t("rm {{rootfs_path}}/etc/apk/cache",
{ rootfs_path = rootfs_path }))
if not (status == 0) then return status end
end