Update for jammy and focal

This commit is contained in:
orangepi-xunlong
2022-05-20 14:52:43 +08:00
parent 8a7661b3af
commit 9ac00a9ca6
17 changed files with 73 additions and 67 deletions

View File

@@ -160,7 +160,7 @@ compile_uboot()
# create directory structure for the .deb package
uboottempdir=$(mktemp -d)
chmod 700 ${uboottempdir}
trap "rm -rf \"${uboottempdir}\" ; exit 0" 0 1 2 3 15
trap "ret=\$?; rm -rf \"${uboottempdir}\" ; exit \$ret" 0 1 2 3 15
local uboot_name=${CHOSEN_UBOOT}_${REVISION}_${ARCH}
rm -rf $uboottempdir/$uboot_name
mkdir -p $uboottempdir/$uboot_name/usr/lib/{u-boot,$uboot_name} $uboottempdir/$uboot_name/DEBIAN
@@ -325,7 +325,7 @@ create_linux-source_package ()
ts=$(date +%s)
local sources_pkg_dir tmp_src_dir
tmp_src_dir=$(mktemp -d)
trap "rm -rf \"${tmp_src_dir}\" ; exit 0" 0 1 2 3 15
trap "ret=\$?; rm -rf \"${tmp_src_dir}\" ; exit \$ret" 0 1 2 3 15
sources_pkg_dir=${tmp_src_dir}/${CHOSEN_KSRC}_${REVISION}_all
mkdir -p "${sources_pkg_dir}"/usr/src/ \
"${sources_pkg_dir}"/usr/share/doc/linux-source-${version}-${LINUXFAMILY} \
@@ -495,6 +495,7 @@ CUSTOM_KERNEL_CONFIG
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
if [[ ${PIPESTATUS[0]} -ne 0 || ! -f arch/$ARCHITECTURE/boot/$KERNEL_IMAGE_TYPE ]]; then
grep -i error $DEST/${LOG_SUBPATH}/compilation.log
exit_with_error "Kernel was not built" "@host"
fi
@@ -580,7 +581,7 @@ compile_firmware()
firmwaretempdir=$(mktemp -d)
chmod 700 ${firmwaretempdir}
trap "rm -rf \"${firmwaretempdir}\" ; exit 0" 0 1 2 3 15
trap "ret=\$?; rm -rf \"${firmwaretempdir}\" ; exit \$ret" 0 1 2 3 15
plugin_dir="orangepi-firmware${FULL}"
mkdir -p "${firmwaretempdir}/${plugin_dir}/lib/firmware"

View File

@@ -199,36 +199,45 @@ add_apt_sources() {
get_all_potential_paths "${DESKTOP_ENVIRONMENTS_SEARCH_RELATIVE_DIRS}" "." "sources/apt"
get_all_potential_paths "${DESKTOP_APPGROUPS_SEARCH_RELATIVE_DIRS}" "${DESKTOP_APPGROUPS_SELECTED}" "sources/apt"
display_alert "ADDING ADDITIONAL APT SOURCES"
display_alert "Adding additional apt sources"
for apt_sources_dirpath in ${potential_paths}; do
if [[ -d "${apt_sources_dirpath}" ]]; then
for apt_source_filepath in "${apt_sources_dirpath}/"*.source; do
local new_apt_source="$(cat "${apt_source_filepath}")"
display_alert "Adding APT Source ${new_apt_source}"
# -y -> Assumes yes to all queries
# -n -> Do not update package cache after adding
run_on_sdcard "add-apt-repository -y -n \"${new_apt_source}\""
display_alert "Return code : $?"
# temporally exception for jammy
[[ $RELEASE == "jammy" ]] && find "${SDCARD}/etc/apt/sources.list.d/." -type f \( -name "*.list" ! -name "armbian.list" \) -print0 | xargs -0 sed -i 's/jammy/hirsute/g'
apt_source_filepath=$(echo $apt_source_filepath | sed -re 's/(^.*[^/])\.[^./]*$/\1/')
local new_apt_source="$(cat "${apt_source_filepath}.source")"
local apt_source_gpg_filepath="${apt_source_filepath}.gpg"
# PPA provide GPG keys automatically, it seems.
# But other repositories (Docker for example) require the
# user to import GPG keys manually
# Myy : FIXME We need some automatic Git warnings when someone
# add a GPG key, since trusting the wrong keys could lead to
# serious issues.
if [[ -f "${apt_source_gpg_filepath}" ]]; then
display_alert "Adding GPG Key ${apt_source_gpg_filepath}"
local apt_source_gpg_filename="$(basename ${apt_source_gpg_filepath})"
cp "${apt_source_gpg_filepath}" "${SDCARD}/tmp/${apt_source_gpg_filename}"
run_on_sdcard "apt-key add \"/tmp/${apt_source_gpg_filename}\""
echo "APT Key returned : $?"
# extract filenames
local apt_source_gpg_filename="$(basename ${apt_source_gpg_filepath})"
local apt_source_filename="$(basename ${apt_source_filepath}).list"
display_alert "Adding APT Source ${new_apt_source}"
if [[ "${new_apt_source}" == ppa* ]] ; then
# ppa with software-common-properties
run_on_sdcard "add-apt-repository -y -n \"${new_apt_source}\""
# add list with apt-add
# -y -> Assumes yes to all queries
# -n -> Do not update package cache after adding
if [[ -f "${apt_source_gpg_filepath}" ]]; then
display_alert "Adding GPG Key ${apt_source_gpg_filepath}"
cp "${apt_source_gpg_filepath}" "${SDCARD}/tmp/${apt_source_gpg_filename}"
run_on_sdcard "apt-key add \"/tmp/${apt_source_gpg_filename}\""
echo "APT Key returned : $?"
fi
else
# installation without software-common-properties, sources.list + key.gpg
echo "${new_apt_source}" > "${SDCARD}/etc/apt/sources.list.d/${apt_source_filename}"
if [[ -f "${apt_source_gpg_filepath}" ]]; then
display_alert "Adding GPG Key ${apt_source_gpg_filepath}"
# local apt_source_gpg_filename="$(basename ${apt_source_gpg_filepath})"
mkdir -p "${SDCARD}"/usr/share/keyrings/
cp "${apt_source_gpg_filepath}" "${SDCARD}"/usr/share/keyrings/
fi
fi
done
fi
done
@@ -242,8 +251,10 @@ add_desktop_package_sources() {
# Myy : I see Snap and Flatpak coming up in the next releases
# so... let's prepare for that
add_apt_sources
run_on_sdcard "apt-get -y -q update"
ls -l "${SDCARD}/usr/share/keyrings" >> "${DEST}"/${LOG_SUBPATH}/install.log
ls -l "${SDCARD}/etc/apt/sources.list.d" >> "${DEST}"/${LOG_SUBPATH}/install.log
cat "${SDCARD}/etc/apt/sources.list" >> "${DEST}"/${LOG_SUBPATH}/install.log

View File

@@ -435,8 +435,9 @@ POST_INSTALL_KERNEL_DEBS
# copy boot splash images
cp "${EXTER}"/packages/blobs/splash/orangepi-u-boot.bmp "${SDCARD}"/boot/boot.bmp
# copy audio.wav
# copy audio.wav and mute.wav
cp "${EXTER}"/packages/blobs/audio_wav/audio.wav "${SDCARD}"/usr/share/sounds/alsa/
cp "${EXTER}"/packages/blobs/audio_wav/mute.wav "${SDCARD}"/usr/share/sounds/alsa/
# copy watchdog test programm
cp "${EXTER}"/packages/blobs/watchdog/watchdog_test_${ARCH} "${SDCARD}"/usr/local/bin/watchdog_test