Skip to content

Commit

Permalink
Merge pull request #51 from YoeDistro/yoe/mut
Browse files Browse the repository at this point in the history
Add support for kiosk image
  • Loading branch information
cbrake authored Apr 2, 2020
2 parents 869aed1 + ca95c85 commit aa07755
Show file tree
Hide file tree
Showing 22 changed files with 785 additions and 3 deletions.
8 changes: 8 additions & 0 deletions conf/distro/eglfs.inc
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
DISTRO_FEATURES_remove = " x11 wayland"

# Use bcm userland graphics driver
DISABLE_VC4GRAPHICS = "1"

# Use rdk backend for eglfs
PREFERRED_PROVIDER_virtual/wpebackend = "wpebackend-rdk"

PACKAGECONFIG_pn-wpebackend-rdk_rpi = "rpi"
2 changes: 2 additions & 0 deletions conf/distro/wayland.inc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
DISTRO_FEATURES_append = " wayland"

PACKAGECONFIG_append_pn-cog_rpi = " drm"
7 changes: 4 additions & 3 deletions conf/distro/yoe.inc
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ PREFERRED_PROVIDER_nativesdk-u-boot-mkimage ??= "nativesdk-${IMX_DEFAULT_BOOTLOA

# wpe backend selection, wpebackend-fdo, wpebackend-mesa, wpebackend-rdk
#
PREFERRED_RPROVIDER_virtual/wpebackend = "${WPEBACKEND}"
WPEBACKEND_rpi ?= "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', 'wpebackend-fdo', ' wpebackend-rdk', d)}"
WPEBACKEND = "wpebackend-rdk"
PREFERRED_PROVIDER_virtual/wpebackend ??= "wpebackend-fdo"

# Disable qt in wpe
PACKAGECONFIG_remove = "qtwpe"

# Pin versions, some BSP layers are housing older versions and have higher BBFILE_PRIORITY
# as a result DEFAULT_PREFERENCE = "-1" does not help either so pin it here
Expand Down
4 changes: 4 additions & 0 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ BBFILES_DYNAMIC += " \
qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/*/*/*.bbappend \
meta-96boards:${LAYERDIR}/dynamic-layers/meta-96boards/*/*/*.bb \
meta-96boards:${LAYERDIR}/dynamic-layers/meta-96boards/*/*/*.bbappend \
swupdate:${LAYERDIR}/dynamic-layers/swupdate/*/*/*.bb \
swupdate:${LAYERDIR}/dynamic-layers/swupdate/*/*/*.bbappend \
webkit:${LAYERDIR}/dynamic-layers/webkit/*/*/*.bb \
webkit:${LAYERDIR}/dynamic-layers/webkit/*/*/*.bbappend \
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
function os.capture(cmd)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
return s
end

function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end

function cmdexec(cmd)
local ret, s, status = os.execute(cmd)
if (status ~= 0) then
return false, cmd .. " return with error"
end

return true,""
end

function preinst()
local out
local s1
local ret

local log = os.tmpname()

local eMMC = "/dev/mmcblk1"
ret = file_exists("/dev/mmcblk1")

if (ret == false) then
return false, "Cannot fine eMMC"
end

cmdexec("/usr/sbin/sfdisk -d " .. eMMC .. "> /tmp/dumppartitions")

-- check if there are two identical partitions
-- and create the second one if no available
f = io.input("/tmp/dumppartitions")
fo = io.output("/tmp/partitions")
t = f:read()
found = false
while (t ~= nil) do
j=0
j=string.find(t, "/dev/mmcblk1p3")
fo:write(t .. "\n")
if (j == 1) then
found=true
break
end
j=string.find(t, "/dev/mmcblk1p2")
if (j == 1) then
start, size = string.match(t, "%a+%s*=%s*(%d+), size=%s*(%d+)")
end
t = f:read()
end

if (found) then
f:close()
fo:close()
return true, out
end

start=start+size
partitions = eMMC .. "p3 : start= " .. string.format("%d", start) .. ", size= " .. size .. ", type=83\n"

fo:write(partitions)
fo:close()
f:close()

out = os.capture("/usr/sbin/sfdisk --force " .. eMMC .. " < /tmp/partitions")

-- use partprobe to inform the kernel of the new partitions

cmdexec("/usr/sbin/partprobe " .. eMMC)

return true, out
end

function postinst()
local out = "Post installed script called"

return true, out
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
software =
{
version = "0.1.0";

beaglebone = {
hardware-compatibility: [ "1.0"];
stable : {
copy1 : {
images: (
{
filename = "core-image-full-cmdline-beaglebone.ext4.gz";
device = "/dev/mmcblk1p2";
type = "raw";
compressed = true;
}
);
scripts: (
{
filename = "emmcsetup.lua";
type = "lua";
}
);
uboot: (
{
name = "boot_targets";
value = "legacy_mmc1 mmc1 nand0 pxe dhcp";
},
{
name = "bootcmd_legacy_mmc1";
value = "setenv mmcdev 1;setenv bootpart 1:2; run mmcboot";
}
);

};
copy2 : {
images: (
{
filename = "core-image-full-cmdline-beaglebone.ext4.gz";
device = "/dev/mmcblk1p3";
type = "raw";
compressed = true;
}
);
scripts: (
{
filename = "emmcsetup.lua";
type = "lua";
}
);
uboot: (
{
name = "boot_targets";
value = "legacy_mmc1 mmc1 nand0 pxe dhcp";
},
{
name = "bootcmd_legacy_mmc1";
value = "setenv mmcdev 1;setenv bootpart 1:3; run mmcboot";
}
);
};
};
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
function os.capture(cmd)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
return s
end

function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end

function cmdexec(cmd)
local ret, s, status = os.execute(cmd)
if (status ~= 0) then
return false, cmd .. " return with error"
end

return true,""
end

function preinst()
local out
local s1
local ret

local log = os.tmpname()

local eMMC = "/dev/mmcblk0"
ret = file_exists("/dev/mmcblk0")

if (ret == false) then
return false, "Cannot find eMMC"
end

cmdexec("/usr/sbin/sfdisk -d " .. eMMC .. "> /tmp/dumppartitions")

-- check if there are two identical partitions
-- and create the second one if no available
f = io.input("/tmp/dumppartitions")
fo = io.output("/tmp/partitions")
t = f:read()
found = false
while (t ~= nil) do
j=0
j=string.find(t, "/dev/mmcblk0p3")
fo:write(t .. "\n")
if (j == 1) then
found=true
break
end
j=string.find(t, "/dev/mmcblk0p2")
if (j == 1) then
start, size = string.match(t, "%a+%s*=%s*(%d+), size=%s*(%d+)")
end
t = f:read()
end

if (found) then
f:close()
fo:close()
return true, out
end

start=start+size
partitions = eMMC .. "p3 : start= " .. string.format("%d", start) .. ", size= " .. size .. ", type=83\n"

fo:write(partitions)
fo:close()
f:close()

out = os.capture("/usr/sbin/sfdisk --force " .. eMMC .. " < /tmp/partitions")

-- use partprobe to inform the kernel of the new partitions

cmdexec("/usr/sbin/partprobe " .. eMMC)

return true, out
end

function postinst()
local out = "Post install script called"

return true, out
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
software =
{
version = "0.1.0";

raspberrypi3 = {
hardware-compatibility: [ "1.0"];
stable : {
copy1 : {
images: (
{
filename = "yoe-debug-image-raspberrypi3.ext4.gz";
type = "raw";
compressed = true;
device = "/dev/mmcblk0p2";
}
);
scripts: (
{
filename = "emmcsetup.lua";
type = "lua";
}
);
uboot: (
{
name = "rpipart";
value = "2";
}
);

};
copy2 : {
images: (
{
filename = "yoe-debug-image-raspberrypi3.ext4.gz";
type = "raw";
compressed = true;
device = "/dev/mmcblk0p3";
}
);
scripts: (
{
filename = "emmcsetup.lua";
type = "lua";
}
);
uboot: (
{
name = "rpipart";
value = "3";
}
);
};
};
}
}
Loading

0 comments on commit aa07755

Please sign in to comment.