Subversion Repositories Kolibri OS

Rev

Rev 8018 | Rev 8091 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8018 Rev 8060
Line 762... Line 762...
762
  if v ~= img_dirs[i-1] then
762
  if v ~= img_dirs[i-1] then
763
    make_img_command = make_img_command .. ' && mmd -i kolibri.img "::' .. v .. '"'
763
    make_img_command = make_img_command .. ' && mmd -i kolibri.img "::' .. v .. '"'
764
  end
764
  end
765
end
765
end
766
-- copy files
766
-- copy files
-
 
767
output_deps = {"kolibri.img"}
767
for i,v in ipairs(img_files) do
768
for i,v in ipairs(img_files) do
768
  local_file = v[2]
769
  local_file = v[2]
769
  if v[1] == "KERNEL.MNT" and tup.getconfig("INSERT_REVISION_ID") ~= ""
770
  if v[1] == "KERNEL.MNT" and tup.getconfig("INSERT_REVISION_ID") ~= ""
770
  then
771
  then
771
    -- for kernel.mnt, insert autobuild revision identifier
772
    -- for kernel.mnt, insert autobuild revision identifier
772
    -- from .revision to .kernel.mnt
773
    -- from .revision to .kernel.mnt
773
    -- note that .revision and .kernel.mnt must begin with .
774
    -- note that .revision and .kernel.mnt must begin with .
774
    -- to prevent tup from tracking them
775
    -- to prevent tup from tracking them
775
    if build_type == "rus"
776
    if build_type == "rus"
776
    then str='$(LANG=ru_RU.utf8 date -u +"[автосборка %d %b %Y %R, r$(cat .revision)]"|iconv -f utf8 -t cp866)'
777
    then str='$(LANG=ru_RU.utf8 date -u +"[автосборка %d %b %Y %R, r$(get-current-revision)]"|iconv -f utf8 -t cp866)'
777
    else str='$(date -u +"[auto-build %d %b %Y %R, r$(cat .revision)]")'
778
    else str='$(date -u +"[auto-build %d %b %Y %R, r$(get-current-revision)]")'
778
    end
779
    end
779
    str = string.gsub(str, "%$", "\\$") -- escape $ as \$
780
    str = string.gsub(str, "%$", "\\$") -- escape $ as \$
780
    str = string.gsub(str, "%%", "%%%%") -- escape % as %%
781
    str = string.gsub(str, "%%", "%%%%") -- escape % as %%
781
    make_img_command = make_img_command .. " && cp " .. local_file .. " .kernel.mnt"
782
    make_img_command = make_img_command .. " && cp " .. local_file .. " .kernel.mnt"
782
    make_img_command = make_img_command .. " && str=" .. str
783
    make_img_command = make_img_command .. " && str=" .. str
783
    make_img_command = make_img_command .. ' && echo -n $str | dd of=.kernel.mnt bs=1 seek=`expr 279 - length "$str"` conv=notrunc 2>/dev/null'
784
    make_img_command = make_img_command .. ' && echo -n $str | dd of=.kernel.mnt bs=1 seek=`expr 279 - length "$str"` conv=notrunc 2>/dev/null'
784
    local_file = ".kernel.mnt"
785
    local_file = ".kernel.mnt"
-
 
786
    table.insert(output_deps, local_file)
785
  end
787
  end
786
  make_img_command = make_img_command .. ' && mcopy -moi kolibri.img "' .. local_file .. '" "::' .. v[1] .. '"'
788
  make_img_command = make_img_command .. ' && mcopy -moi kolibri.img "' .. local_file .. '" "::' .. v[1] .. '"'
787
end
789
end
Line 788... Line 790...
788
 
790
 
789
-- generate tup rule for kolibri.img
791
-- generate tup rule for kolibri.img
790
tup.definerule{inputs = input_deps, command = make_img_command, outputs = {"kolibri.img"}}
792
tup.definerule{inputs = input_deps, command = make_img_command, outputs = output_deps}
Line 791... Line 793...
791
tup.definerule{inputs = {"../kernel/trunk/boot/uefi4kos.asm", "kolibri.img", "../kernel/trunk/kernel.bin"}, command = "fasm ../kernel/trunk/boot/uefi4kos.asm %o", outputs = {"kolibri.efi"}}
793
tup.definerule{inputs = {"../kernel/trunk/boot/uefi4kos.asm", "kolibri.img", "../kernel/trunk/kernel.bin"}, command = "fasm ../kernel/trunk/boot/uefi4kos.asm %o", outputs = {"kolibri.efi"}}
792
 
794
 
793
-- generate command and dependencies for mkisofs
795
-- generate command and dependencies for mkisofs