From 42ed690870526c31b9fcf7b89f58a75093f25ca1 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sat, 2 Sep 2023 15:04:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0deb=E5=8C=85=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deb/debian-core/DEBIAN/config | 10 ++ deb/debian-core/DEBIAN/control | 8 ++ deb/debian-core/DEBIAN/postinst | 35 +++++ deb/debian-core/DEBIAN/postrm | 16 +++ deb/debian-core/DEBIAN/templates | 20 +++ .../initrd.img-6.1.11-amd64-desktop-hwe | 0 .../deepin/vmlinuz-6.1.11-amd64-desktop-hwe | 0 deb/debian-core/etc/grub.d/01_live | 9 ++ deb/debian-core/etc/grub.d/15_linux_bar | 132 ++++++++++++++++++ .../recovery_live/filesystem.squashfs | 0 deb/debian/DEBIAN/config | 10 ++ deb/debian/DEBIAN/control | 8 ++ deb/debian/DEBIAN/postinst | 35 +++++ deb/debian/DEBIAN/postrm | 16 +++ deb/debian/DEBIAN/templates | 20 +++ .../initrd.img-6.1.11-amd64-desktop-hwe | 0 .../deepin/vmlinuz-6.1.11-amd64-desktop-hwe | 0 deb/debian/etc/grub.d/01_live | 9 ++ deb/debian/etc/grub.d/15_linux_bar | 132 ++++++++++++++++++ deb/debian/recovery_live/filesystem.squashfs | 0 deb/full/DEBIAN/config | 10 ++ deb/full/DEBIAN/control | 8 ++ deb/full/DEBIAN/postinst | 35 +++++ deb/full/DEBIAN/postrm | 16 +++ deb/full/DEBIAN/templates | 20 +++ .../initrd.img-6.1.11-amd64-desktop-hwe | 0 .../deepin/vmlinuz-6.1.11-amd64-desktop-hwe | 0 deb/full/etc/grub.d/01_live | 9 ++ deb/full/etc/grub.d/15_linux_bar | 132 ++++++++++++++++++ deb/full/recovery_live/filesystem.squashfs | 0 deb/mini/DEBIAN/config | 10 ++ deb/mini/DEBIAN/control | 8 ++ deb/mini/DEBIAN/postinst | 35 +++++ deb/mini/DEBIAN/postrm | 16 +++ deb/mini/DEBIAN/templates | 20 +++ .../initrd.img-6.1.11-amd64-desktop-hwe | 0 .../deepin/vmlinuz-6.1.11-amd64-desktop-hwe | 0 deb/mini/etc/grub.d/01_live | 9 ++ deb/mini/etc/grub.d/15_linux_bar | 132 ++++++++++++++++++ deb/mini/recovery_live/filesystem.squashfs | 0 deb/tiny/DEBIAN/config | 10 ++ deb/tiny/DEBIAN/control | 8 ++ deb/tiny/DEBIAN/postinst | 35 +++++ deb/tiny/DEBIAN/postrm | 16 +++ deb/tiny/DEBIAN/templates | 20 +++ .../initrd.img-6.1.11-amd64-desktop-hwe | 0 .../deepin/vmlinuz-6.1.11-amd64-desktop-hwe | 0 deb/tiny/etc/grub.d/01_live | 9 ++ deb/tiny/etc/grub.d/15_linux_bar | 132 ++++++++++++++++++ deb/tiny/recovery_live/filesystem.squashfs | 0 50 files changed, 1150 insertions(+) create mode 100755 deb/debian-core/DEBIAN/config create mode 100644 deb/debian-core/DEBIAN/control create mode 100755 deb/debian-core/DEBIAN/postinst create mode 100755 deb/debian-core/DEBIAN/postrm create mode 100644 deb/debian-core/DEBIAN/templates create mode 100644 deb/debian-core/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe create mode 100644 deb/debian-core/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe create mode 100755 deb/debian-core/etc/grub.d/01_live create mode 100755 deb/debian-core/etc/grub.d/15_linux_bar create mode 100644 deb/debian-core/recovery_live/filesystem.squashfs create mode 100755 deb/debian/DEBIAN/config create mode 100644 deb/debian/DEBIAN/control create mode 100755 deb/debian/DEBIAN/postinst create mode 100755 deb/debian/DEBIAN/postrm create mode 100644 deb/debian/DEBIAN/templates create mode 100644 deb/debian/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe create mode 100644 deb/debian/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe create mode 100755 deb/debian/etc/grub.d/01_live create mode 100755 deb/debian/etc/grub.d/15_linux_bar create mode 100644 deb/debian/recovery_live/filesystem.squashfs create mode 100755 deb/full/DEBIAN/config create mode 100644 deb/full/DEBIAN/control create mode 100755 deb/full/DEBIAN/postinst create mode 100755 deb/full/DEBIAN/postrm create mode 100644 deb/full/DEBIAN/templates create mode 100644 deb/full/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe create mode 100644 deb/full/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe create mode 100755 deb/full/etc/grub.d/01_live create mode 100755 deb/full/etc/grub.d/15_linux_bar create mode 100644 deb/full/recovery_live/filesystem.squashfs create mode 100755 deb/mini/DEBIAN/config create mode 100644 deb/mini/DEBIAN/control create mode 100755 deb/mini/DEBIAN/postinst create mode 100755 deb/mini/DEBIAN/postrm create mode 100644 deb/mini/DEBIAN/templates create mode 100644 deb/mini/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe create mode 100644 deb/mini/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe create mode 100755 deb/mini/etc/grub.d/01_live create mode 100755 deb/mini/etc/grub.d/15_linux_bar create mode 100644 deb/mini/recovery_live/filesystem.squashfs create mode 100755 deb/tiny/DEBIAN/config create mode 100644 deb/tiny/DEBIAN/control create mode 100755 deb/tiny/DEBIAN/postinst create mode 100755 deb/tiny/DEBIAN/postrm create mode 100644 deb/tiny/DEBIAN/templates create mode 100644 deb/tiny/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe create mode 100644 deb/tiny/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe create mode 100755 deb/tiny/etc/grub.d/01_live create mode 100755 deb/tiny/etc/grub.d/15_linux_bar create mode 100644 deb/tiny/recovery_live/filesystem.squashfs diff --git a/deb/debian-core/DEBIAN/config b/deb/debian-core/DEBIAN/config new file mode 100755 index 0000000..6342909 --- /dev/null +++ b/deb/debian-core/DEBIAN/config @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +. /usr/share/debconf/confmodule + +if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi +${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } + + diff --git a/deb/debian-core/DEBIAN/control b/deb/debian-core/DEBIAN/control new file mode 100644 index 0000000..01372c6 --- /dev/null +++ b/deb/debian-core/DEBIAN/control @@ -0,0 +1,8 @@ +Package: live-filesystem-community-debian-core +Version: 2.0.0 +Architecture: amd64 +Maintainer: LinuxDeepin Project , gfdgd xi<3025613752@qq.com> +Section: devel +Priority: extra +Conflicts: live-filesystem, live-filesystem-community-full, live-filesystem-community-tiny, live-filesystem-community-full-15.11, live-filesystem-community-debian, live-filesystem-community-debian-mini +Description: Deepin Community Live CD Debian Core diff --git a/deb/debian-core/DEBIAN/postinst b/deb/debian-core/DEBIAN/postinst new file mode 100755 index 0000000..59dba84 --- /dev/null +++ b/deb/debian-core/DEBIAN/postinst @@ -0,0 +1,35 @@ +#!/bin/sh +# Copy needed firmware + +. /usr/share/debconf/confmodule +db_get live/root_password && rootpw="$RET" +db_stop +sha256=`echo -n $rootpw | sha256sum | cut -d ' ' -f1` +if [ ! -f "/recovery/cryptauth" ]; then + mkdir -p /recovery + echo $sha256 > /recovery/cryptauth + chmod 0600 /recovery/cryptauth +fi + + +if [ -f /proc/modules ];then + # Need installer to override this file. + install -Dm644 /proc/modules /recovery/modules +fi + +# set grub default value +if [ ! -f /etc/default/grub ];then + echo "No grub default configuration.Exit..." >&2 +else + if grep -q '^GRUB_DEFAULT=' /etc/default/grub;then + sed -i "s|^GRUB_DEFAULT=.*|GRUB_DEFAULT=saved|g" /etc/default/grub + else + cat >> /etc/default/grub << EOF +# Important change by live-filesystem. +GRUB_DEFAULT=saved +EOF + fi + update-grub || true +fi + +exit 0 diff --git a/deb/debian-core/DEBIAN/postrm b/deb/debian-core/DEBIAN/postrm new file mode 100755 index 0000000..aca5c27 --- /dev/null +++ b/deb/debian-core/DEBIAN/postrm @@ -0,0 +1,16 @@ +#!/bin/bash +case "${1}" in + remove) + . /usr/share/debconf/confmodule + # Remove my changes to the db. + db_purge + rm -f /recovery/cryptauth + rm -f /recovery/modules + # Update grub + if [ -e /boot/grub/grub.cfg ] && [ -x "$(which update-grub)" ]; then + update-grub + fi + ;; +esac + +exit 0 diff --git a/deb/debian-core/DEBIAN/templates b/deb/debian-core/DEBIAN/templates new file mode 100644 index 0000000..e53a168 --- /dev/null +++ b/deb/debian-core/DEBIAN/templates @@ -0,0 +1,20 @@ +Template: live/root_password +Type: password +Description: Please enter a password for LIVE system: + To secure your system, it is recommended to set a password for the LIVE system + if the password is empty, no password is required to enter the LIVE system. +Description-zh_CN.UTF-8: 请输入LIVE系统的密码: + 为了保障您的系统安全,建议为LIVE系统设置密码, 如果密码为空,则进入LIVE系统时不需要密码。 + +Template: live/root_password_again +Type: password +Description: Repeat password for LIVE system: +Description-zh_CN.UTF-8: 请再次输入密码: + +Template: live/password_mismatch +Type: error +Description: Password input error + The two passwords you entered were not the same. Please try again. +Description-zh_CN.UTF-8: 输入密码错误 + 两次输入密码不同,请重新输入。 + diff --git a/deb/debian-core/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe b/deb/debian-core/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe new file mode 100644 index 0000000..e69de29 diff --git a/deb/debian-core/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe b/deb/debian-core/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe new file mode 100644 index 0000000..e69de29 diff --git a/deb/debian-core/etc/grub.d/01_live b/deb/debian-core/etc/grub.d/01_live new file mode 100755 index 0000000..0dd98d0 --- /dev/null +++ b/deb/debian-core/etc/grub.d/01_live @@ -0,0 +1,9 @@ +#!/bin/sh +cat <. + +prefix="/usr" +exec_prefix="/usr" +datarootdir="/usr/share" +quiet_boot="0" + +. "$pkgdatadir/grub-mkconfig_lib" + +export TEXTDOMAIN=grub +export TEXTDOMAINDIR="${datarootdir}/locale" + +CLASS="--class gnu-linux --class gnu --class os" + +if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then + OS=GNU/Linux +else + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" +fi + +if [ -f /etc/default/locale ];then + LOCALE=$(cat /etc/default/locale | grep ^LANG=.*$ | head -n 1 | sed 's/"//g') + LOCALE=${LOCALE#LANG=} +fi + +LOCALE=${LOCALE:-en_US.UTF-8} + +title_correction_code= + +linux_entry () +{ + os="$1" + version="$2" + type="$3" + args="boot=live \$load_config components quiet toram locales=${LOCALE} acpi_backlight=vendor" + + if [ -z "$boot_device_id" ]; then + boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" + fi + args="$args live-media-path=recovery_live" + echo "menuentry 'uos Recovery' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" + + echo " insmod gzio" | sed "s/^/$submenu_indentation/" + + if [ x$dirname = x/ ]; then + if [ -z "${prepare_root_cache}" ]; then + prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | grub_add_tab)" + fi + printf '%s\n' "${prepare_root_cache}" | sed "s/^/$submenu_indentation/" + else + if [ -z "${prepare_boot_cache}" ]; then + prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)" + fi + printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" + fi + if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then + message="$(gettext_printf "Loading Linux %s ..." ${version})" + sed "s/^/$submenu_indentation/" << EOF +EOF + fi + if test -d /sys/firmware/efi && test -e "${linux}.efi.signed"; then + sed "s/^/$submenu_indentation/" << EOF + linux ${rel_dirname}/${basename}.efi.signed ro ${args} +EOF + else + sed "s/^/$submenu_indentation/" << EOF + linux ${rel_dirname}/${basename} ro ${args} +EOF + fi + if test -n "${initrd}" ; then + # TRANSLATORS: ramdisk isn't identifier. Should be translated. + if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then + message="$(gettext_printf "Loading initial ramdisk ...")" + sed "s/^/$submenu_indentation/" << EOF +EOF + fi + sed "s/^/$submenu_indentation/" << EOF + initrd ${rel_dirname}/${initrd} +EOF + fi + sed "s/^/$submenu_indentation/" << EOF +} +EOF +} + +submenu_indentation="" +is_top_level=true +for i in /boot/deepin/vmlinuz-*; do + if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi +done + +linux=`version_find_latest $list` + +gettext_printf "Found deepin image: %s\n" "$linux" >&2 +basename=`basename $linux` +dirname=`dirname $linux` +rel_dirname=`make_system_path_relative_to_its_root $dirname` +version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` +alt_version=`echo $version | sed -e "s,\.old$,,g"` + +initrd= +for i in "initrd.img-${version}"; do + if test -e "${dirname}/${i}" ; then + initrd="$i" + break + fi +done + +if test -n "${initrd}" ; then + gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 +fi + +linux_entry "${OS}" "${version}" simple + +echo "$title_correction_code" diff --git a/deb/debian-core/recovery_live/filesystem.squashfs b/deb/debian-core/recovery_live/filesystem.squashfs new file mode 100644 index 0000000..e69de29 diff --git a/deb/debian/DEBIAN/config b/deb/debian/DEBIAN/config new file mode 100755 index 0000000..6342909 --- /dev/null +++ b/deb/debian/DEBIAN/config @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +. /usr/share/debconf/confmodule + +if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi +${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } + + diff --git a/deb/debian/DEBIAN/control b/deb/debian/DEBIAN/control new file mode 100644 index 0000000..00f7f98 --- /dev/null +++ b/deb/debian/DEBIAN/control @@ -0,0 +1,8 @@ +Package: live-filesystem-community-debian +Version: 2.0.0 +Architecture: amd64 +Maintainer: LinuxDeepin Project , gfdgd xi<3025613752@qq.com> +Section: devel +Priority: extra +Conflicts: live-filesystem, live-filesystem-community-full, live-filesystem-community-tiny, live-filesystem-community-full-15.11, live-filesystem-community-mini, live-filesystem-community-debian-core +Description: Deepin Community Live CD Debian diff --git a/deb/debian/DEBIAN/postinst b/deb/debian/DEBIAN/postinst new file mode 100755 index 0000000..59dba84 --- /dev/null +++ b/deb/debian/DEBIAN/postinst @@ -0,0 +1,35 @@ +#!/bin/sh +# Copy needed firmware + +. /usr/share/debconf/confmodule +db_get live/root_password && rootpw="$RET" +db_stop +sha256=`echo -n $rootpw | sha256sum | cut -d ' ' -f1` +if [ ! -f "/recovery/cryptauth" ]; then + mkdir -p /recovery + echo $sha256 > /recovery/cryptauth + chmod 0600 /recovery/cryptauth +fi + + +if [ -f /proc/modules ];then + # Need installer to override this file. + install -Dm644 /proc/modules /recovery/modules +fi + +# set grub default value +if [ ! -f /etc/default/grub ];then + echo "No grub default configuration.Exit..." >&2 +else + if grep -q '^GRUB_DEFAULT=' /etc/default/grub;then + sed -i "s|^GRUB_DEFAULT=.*|GRUB_DEFAULT=saved|g" /etc/default/grub + else + cat >> /etc/default/grub << EOF +# Important change by live-filesystem. +GRUB_DEFAULT=saved +EOF + fi + update-grub || true +fi + +exit 0 diff --git a/deb/debian/DEBIAN/postrm b/deb/debian/DEBIAN/postrm new file mode 100755 index 0000000..aca5c27 --- /dev/null +++ b/deb/debian/DEBIAN/postrm @@ -0,0 +1,16 @@ +#!/bin/bash +case "${1}" in + remove) + . /usr/share/debconf/confmodule + # Remove my changes to the db. + db_purge + rm -f /recovery/cryptauth + rm -f /recovery/modules + # Update grub + if [ -e /boot/grub/grub.cfg ] && [ -x "$(which update-grub)" ]; then + update-grub + fi + ;; +esac + +exit 0 diff --git a/deb/debian/DEBIAN/templates b/deb/debian/DEBIAN/templates new file mode 100644 index 0000000..e53a168 --- /dev/null +++ b/deb/debian/DEBIAN/templates @@ -0,0 +1,20 @@ +Template: live/root_password +Type: password +Description: Please enter a password for LIVE system: + To secure your system, it is recommended to set a password for the LIVE system + if the password is empty, no password is required to enter the LIVE system. +Description-zh_CN.UTF-8: 请输入LIVE系统的密码: + 为了保障您的系统安全,建议为LIVE系统设置密码, 如果密码为空,则进入LIVE系统时不需要密码。 + +Template: live/root_password_again +Type: password +Description: Repeat password for LIVE system: +Description-zh_CN.UTF-8: 请再次输入密码: + +Template: live/password_mismatch +Type: error +Description: Password input error + The two passwords you entered were not the same. Please try again. +Description-zh_CN.UTF-8: 输入密码错误 + 两次输入密码不同,请重新输入。 + diff --git a/deb/debian/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe b/deb/debian/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe new file mode 100644 index 0000000..e69de29 diff --git a/deb/debian/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe b/deb/debian/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe new file mode 100644 index 0000000..e69de29 diff --git a/deb/debian/etc/grub.d/01_live b/deb/debian/etc/grub.d/01_live new file mode 100755 index 0000000..0dd98d0 --- /dev/null +++ b/deb/debian/etc/grub.d/01_live @@ -0,0 +1,9 @@ +#!/bin/sh +cat <. + +prefix="/usr" +exec_prefix="/usr" +datarootdir="/usr/share" +quiet_boot="0" + +. "$pkgdatadir/grub-mkconfig_lib" + +export TEXTDOMAIN=grub +export TEXTDOMAINDIR="${datarootdir}/locale" + +CLASS="--class gnu-linux --class gnu --class os" + +if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then + OS=GNU/Linux +else + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" +fi + +if [ -f /etc/default/locale ];then + LOCALE=$(cat /etc/default/locale | grep ^LANG=.*$ | head -n 1 | sed 's/"//g') + LOCALE=${LOCALE#LANG=} +fi + +LOCALE=${LOCALE:-en_US.UTF-8} + +title_correction_code= + +linux_entry () +{ + os="$1" + version="$2" + type="$3" + args="boot=live \$load_config components quiet toram locales=${LOCALE} acpi_backlight=vendor" + + if [ -z "$boot_device_id" ]; then + boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" + fi + args="$args live-media-path=recovery_live" + echo "menuentry 'uos Recovery' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" + + echo " insmod gzio" | sed "s/^/$submenu_indentation/" + + if [ x$dirname = x/ ]; then + if [ -z "${prepare_root_cache}" ]; then + prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | grub_add_tab)" + fi + printf '%s\n' "${prepare_root_cache}" | sed "s/^/$submenu_indentation/" + else + if [ -z "${prepare_boot_cache}" ]; then + prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)" + fi + printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" + fi + if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then + message="$(gettext_printf "Loading Linux %s ..." ${version})" + sed "s/^/$submenu_indentation/" << EOF +EOF + fi + if test -d /sys/firmware/efi && test -e "${linux}.efi.signed"; then + sed "s/^/$submenu_indentation/" << EOF + linux ${rel_dirname}/${basename}.efi.signed ro ${args} +EOF + else + sed "s/^/$submenu_indentation/" << EOF + linux ${rel_dirname}/${basename} ro ${args} +EOF + fi + if test -n "${initrd}" ; then + # TRANSLATORS: ramdisk isn't identifier. Should be translated. + if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then + message="$(gettext_printf "Loading initial ramdisk ...")" + sed "s/^/$submenu_indentation/" << EOF +EOF + fi + sed "s/^/$submenu_indentation/" << EOF + initrd ${rel_dirname}/${initrd} +EOF + fi + sed "s/^/$submenu_indentation/" << EOF +} +EOF +} + +submenu_indentation="" +is_top_level=true +for i in /boot/deepin/vmlinuz-*; do + if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi +done + +linux=`version_find_latest $list` + +gettext_printf "Found deepin image: %s\n" "$linux" >&2 +basename=`basename $linux` +dirname=`dirname $linux` +rel_dirname=`make_system_path_relative_to_its_root $dirname` +version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` +alt_version=`echo $version | sed -e "s,\.old$,,g"` + +initrd= +for i in "initrd.img-${version}"; do + if test -e "${dirname}/${i}" ; then + initrd="$i" + break + fi +done + +if test -n "${initrd}" ; then + gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 +fi + +linux_entry "${OS}" "${version}" simple + +echo "$title_correction_code" diff --git a/deb/debian/recovery_live/filesystem.squashfs b/deb/debian/recovery_live/filesystem.squashfs new file mode 100644 index 0000000..e69de29 diff --git a/deb/full/DEBIAN/config b/deb/full/DEBIAN/config new file mode 100755 index 0000000..6342909 --- /dev/null +++ b/deb/full/DEBIAN/config @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +. /usr/share/debconf/confmodule + +if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi +${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } + + diff --git a/deb/full/DEBIAN/control b/deb/full/DEBIAN/control new file mode 100644 index 0000000..a02f5bb --- /dev/null +++ b/deb/full/DEBIAN/control @@ -0,0 +1,8 @@ +Package: live-filesystem-community-full +Version: 2.0.0 +Architecture: amd64 +Maintainer: LinuxDeepin Project , gfdgd xi<3025613752@qq.com> +Section: devel +Priority: extra +Conflicts: live-filesystem, live-filesystem-community-mini, live-filesystem-community-tiny, live-filesystem-community-full-15.11, live-filesystem-community-debian, live-filesystem-community-debian-core +Description: Deepin Community Live CD Full diff --git a/deb/full/DEBIAN/postinst b/deb/full/DEBIAN/postinst new file mode 100755 index 0000000..59dba84 --- /dev/null +++ b/deb/full/DEBIAN/postinst @@ -0,0 +1,35 @@ +#!/bin/sh +# Copy needed firmware + +. /usr/share/debconf/confmodule +db_get live/root_password && rootpw="$RET" +db_stop +sha256=`echo -n $rootpw | sha256sum | cut -d ' ' -f1` +if [ ! -f "/recovery/cryptauth" ]; then + mkdir -p /recovery + echo $sha256 > /recovery/cryptauth + chmod 0600 /recovery/cryptauth +fi + + +if [ -f /proc/modules ];then + # Need installer to override this file. + install -Dm644 /proc/modules /recovery/modules +fi + +# set grub default value +if [ ! -f /etc/default/grub ];then + echo "No grub default configuration.Exit..." >&2 +else + if grep -q '^GRUB_DEFAULT=' /etc/default/grub;then + sed -i "s|^GRUB_DEFAULT=.*|GRUB_DEFAULT=saved|g" /etc/default/grub + else + cat >> /etc/default/grub << EOF +# Important change by live-filesystem. +GRUB_DEFAULT=saved +EOF + fi + update-grub || true +fi + +exit 0 diff --git a/deb/full/DEBIAN/postrm b/deb/full/DEBIAN/postrm new file mode 100755 index 0000000..aca5c27 --- /dev/null +++ b/deb/full/DEBIAN/postrm @@ -0,0 +1,16 @@ +#!/bin/bash +case "${1}" in + remove) + . /usr/share/debconf/confmodule + # Remove my changes to the db. + db_purge + rm -f /recovery/cryptauth + rm -f /recovery/modules + # Update grub + if [ -e /boot/grub/grub.cfg ] && [ -x "$(which update-grub)" ]; then + update-grub + fi + ;; +esac + +exit 0 diff --git a/deb/full/DEBIAN/templates b/deb/full/DEBIAN/templates new file mode 100644 index 0000000..e53a168 --- /dev/null +++ b/deb/full/DEBIAN/templates @@ -0,0 +1,20 @@ +Template: live/root_password +Type: password +Description: Please enter a password for LIVE system: + To secure your system, it is recommended to set a password for the LIVE system + if the password is empty, no password is required to enter the LIVE system. +Description-zh_CN.UTF-8: 请输入LIVE系统的密码: + 为了保障您的系统安全,建议为LIVE系统设置密码, 如果密码为空,则进入LIVE系统时不需要密码。 + +Template: live/root_password_again +Type: password +Description: Repeat password for LIVE system: +Description-zh_CN.UTF-8: 请再次输入密码: + +Template: live/password_mismatch +Type: error +Description: Password input error + The two passwords you entered were not the same. Please try again. +Description-zh_CN.UTF-8: 输入密码错误 + 两次输入密码不同,请重新输入。 + diff --git a/deb/full/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe b/deb/full/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe new file mode 100644 index 0000000..e69de29 diff --git a/deb/full/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe b/deb/full/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe new file mode 100644 index 0000000..e69de29 diff --git a/deb/full/etc/grub.d/01_live b/deb/full/etc/grub.d/01_live new file mode 100755 index 0000000..0dd98d0 --- /dev/null +++ b/deb/full/etc/grub.d/01_live @@ -0,0 +1,9 @@ +#!/bin/sh +cat <. + +prefix="/usr" +exec_prefix="/usr" +datarootdir="/usr/share" +quiet_boot="0" + +. "$pkgdatadir/grub-mkconfig_lib" + +export TEXTDOMAIN=grub +export TEXTDOMAINDIR="${datarootdir}/locale" + +CLASS="--class gnu-linux --class gnu --class os" + +if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then + OS=GNU/Linux +else + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" +fi + +if [ -f /etc/default/locale ];then + LOCALE=$(cat /etc/default/locale | grep ^LANG=.*$ | head -n 1 | sed 's/"//g') + LOCALE=${LOCALE#LANG=} +fi + +LOCALE=${LOCALE:-en_US.UTF-8} + +title_correction_code= + +linux_entry () +{ + os="$1" + version="$2" + type="$3" + args="boot=live \$load_config components quiet toram locales=${LOCALE} acpi_backlight=vendor" + + if [ -z "$boot_device_id" ]; then + boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" + fi + args="$args live-media-path=recovery_live" + echo "menuentry 'uos Recovery' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" + + echo " insmod gzio" | sed "s/^/$submenu_indentation/" + + if [ x$dirname = x/ ]; then + if [ -z "${prepare_root_cache}" ]; then + prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | grub_add_tab)" + fi + printf '%s\n' "${prepare_root_cache}" | sed "s/^/$submenu_indentation/" + else + if [ -z "${prepare_boot_cache}" ]; then + prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)" + fi + printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" + fi + if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then + message="$(gettext_printf "Loading Linux %s ..." ${version})" + sed "s/^/$submenu_indentation/" << EOF +EOF + fi + if test -d /sys/firmware/efi && test -e "${linux}.efi.signed"; then + sed "s/^/$submenu_indentation/" << EOF + linux ${rel_dirname}/${basename}.efi.signed ro ${args} +EOF + else + sed "s/^/$submenu_indentation/" << EOF + linux ${rel_dirname}/${basename} ro ${args} +EOF + fi + if test -n "${initrd}" ; then + # TRANSLATORS: ramdisk isn't identifier. Should be translated. + if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then + message="$(gettext_printf "Loading initial ramdisk ...")" + sed "s/^/$submenu_indentation/" << EOF +EOF + fi + sed "s/^/$submenu_indentation/" << EOF + initrd ${rel_dirname}/${initrd} +EOF + fi + sed "s/^/$submenu_indentation/" << EOF +} +EOF +} + +submenu_indentation="" +is_top_level=true +for i in /boot/deepin/vmlinuz-*; do + if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi +done + +linux=`version_find_latest $list` + +gettext_printf "Found deepin image: %s\n" "$linux" >&2 +basename=`basename $linux` +dirname=`dirname $linux` +rel_dirname=`make_system_path_relative_to_its_root $dirname` +version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` +alt_version=`echo $version | sed -e "s,\.old$,,g"` + +initrd= +for i in "initrd.img-${version}"; do + if test -e "${dirname}/${i}" ; then + initrd="$i" + break + fi +done + +if test -n "${initrd}" ; then + gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 +fi + +linux_entry "${OS}" "${version}" simple + +echo "$title_correction_code" diff --git a/deb/full/recovery_live/filesystem.squashfs b/deb/full/recovery_live/filesystem.squashfs new file mode 100644 index 0000000..e69de29 diff --git a/deb/mini/DEBIAN/config b/deb/mini/DEBIAN/config new file mode 100755 index 0000000..6342909 --- /dev/null +++ b/deb/mini/DEBIAN/config @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +. /usr/share/debconf/confmodule + +if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi +${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } + + diff --git a/deb/mini/DEBIAN/control b/deb/mini/DEBIAN/control new file mode 100644 index 0000000..ea69dd5 --- /dev/null +++ b/deb/mini/DEBIAN/control @@ -0,0 +1,8 @@ +Package: live-filesystem-community-mini +Version: 2.0.0 +Architecture: amd64 +Maintainer: LinuxDeepin Project , gfdgd xi<3025613752@qq.com> +Section: devel +Priority: extra +Conflicts: live-filesystem, live-filesystem-community-full, live-filesystem-community-tiny, live-filesystem-community-full-15.11, live-filesystem-community-debian, live-filesystem-community-debian-core +Description: Deepin Community Live CD Mini diff --git a/deb/mini/DEBIAN/postinst b/deb/mini/DEBIAN/postinst new file mode 100755 index 0000000..59dba84 --- /dev/null +++ b/deb/mini/DEBIAN/postinst @@ -0,0 +1,35 @@ +#!/bin/sh +# Copy needed firmware + +. /usr/share/debconf/confmodule +db_get live/root_password && rootpw="$RET" +db_stop +sha256=`echo -n $rootpw | sha256sum | cut -d ' ' -f1` +if [ ! -f "/recovery/cryptauth" ]; then + mkdir -p /recovery + echo $sha256 > /recovery/cryptauth + chmod 0600 /recovery/cryptauth +fi + + +if [ -f /proc/modules ];then + # Need installer to override this file. + install -Dm644 /proc/modules /recovery/modules +fi + +# set grub default value +if [ ! -f /etc/default/grub ];then + echo "No grub default configuration.Exit..." >&2 +else + if grep -q '^GRUB_DEFAULT=' /etc/default/grub;then + sed -i "s|^GRUB_DEFAULT=.*|GRUB_DEFAULT=saved|g" /etc/default/grub + else + cat >> /etc/default/grub << EOF +# Important change by live-filesystem. +GRUB_DEFAULT=saved +EOF + fi + update-grub || true +fi + +exit 0 diff --git a/deb/mini/DEBIAN/postrm b/deb/mini/DEBIAN/postrm new file mode 100755 index 0000000..aca5c27 --- /dev/null +++ b/deb/mini/DEBIAN/postrm @@ -0,0 +1,16 @@ +#!/bin/bash +case "${1}" in + remove) + . /usr/share/debconf/confmodule + # Remove my changes to the db. + db_purge + rm -f /recovery/cryptauth + rm -f /recovery/modules + # Update grub + if [ -e /boot/grub/grub.cfg ] && [ -x "$(which update-grub)" ]; then + update-grub + fi + ;; +esac + +exit 0 diff --git a/deb/mini/DEBIAN/templates b/deb/mini/DEBIAN/templates new file mode 100644 index 0000000..e53a168 --- /dev/null +++ b/deb/mini/DEBIAN/templates @@ -0,0 +1,20 @@ +Template: live/root_password +Type: password +Description: Please enter a password for LIVE system: + To secure your system, it is recommended to set a password for the LIVE system + if the password is empty, no password is required to enter the LIVE system. +Description-zh_CN.UTF-8: 请输入LIVE系统的密码: + 为了保障您的系统安全,建议为LIVE系统设置密码, 如果密码为空,则进入LIVE系统时不需要密码。 + +Template: live/root_password_again +Type: password +Description: Repeat password for LIVE system: +Description-zh_CN.UTF-8: 请再次输入密码: + +Template: live/password_mismatch +Type: error +Description: Password input error + The two passwords you entered were not the same. Please try again. +Description-zh_CN.UTF-8: 输入密码错误 + 两次输入密码不同,请重新输入。 + diff --git a/deb/mini/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe b/deb/mini/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe new file mode 100644 index 0000000..e69de29 diff --git a/deb/mini/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe b/deb/mini/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe new file mode 100644 index 0000000..e69de29 diff --git a/deb/mini/etc/grub.d/01_live b/deb/mini/etc/grub.d/01_live new file mode 100755 index 0000000..0dd98d0 --- /dev/null +++ b/deb/mini/etc/grub.d/01_live @@ -0,0 +1,9 @@ +#!/bin/sh +cat <. + +prefix="/usr" +exec_prefix="/usr" +datarootdir="/usr/share" +quiet_boot="0" + +. "$pkgdatadir/grub-mkconfig_lib" + +export TEXTDOMAIN=grub +export TEXTDOMAINDIR="${datarootdir}/locale" + +CLASS="--class gnu-linux --class gnu --class os" + +if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then + OS=GNU/Linux +else + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" +fi + +if [ -f /etc/default/locale ];then + LOCALE=$(cat /etc/default/locale | grep ^LANG=.*$ | head -n 1 | sed 's/"//g') + LOCALE=${LOCALE#LANG=} +fi + +LOCALE=${LOCALE:-en_US.UTF-8} + +title_correction_code= + +linux_entry () +{ + os="$1" + version="$2" + type="$3" + args="boot=live \$load_config components quiet toram locales=${LOCALE} acpi_backlight=vendor" + + if [ -z "$boot_device_id" ]; then + boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" + fi + args="$args live-media-path=recovery_live" + echo "menuentry 'uos Recovery' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" + + echo " insmod gzio" | sed "s/^/$submenu_indentation/" + + if [ x$dirname = x/ ]; then + if [ -z "${prepare_root_cache}" ]; then + prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | grub_add_tab)" + fi + printf '%s\n' "${prepare_root_cache}" | sed "s/^/$submenu_indentation/" + else + if [ -z "${prepare_boot_cache}" ]; then + prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)" + fi + printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" + fi + if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then + message="$(gettext_printf "Loading Linux %s ..." ${version})" + sed "s/^/$submenu_indentation/" << EOF +EOF + fi + if test -d /sys/firmware/efi && test -e "${linux}.efi.signed"; then + sed "s/^/$submenu_indentation/" << EOF + linux ${rel_dirname}/${basename}.efi.signed ro ${args} +EOF + else + sed "s/^/$submenu_indentation/" << EOF + linux ${rel_dirname}/${basename} ro ${args} +EOF + fi + if test -n "${initrd}" ; then + # TRANSLATORS: ramdisk isn't identifier. Should be translated. + if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then + message="$(gettext_printf "Loading initial ramdisk ...")" + sed "s/^/$submenu_indentation/" << EOF +EOF + fi + sed "s/^/$submenu_indentation/" << EOF + initrd ${rel_dirname}/${initrd} +EOF + fi + sed "s/^/$submenu_indentation/" << EOF +} +EOF +} + +submenu_indentation="" +is_top_level=true +for i in /boot/deepin/vmlinuz-*; do + if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi +done + +linux=`version_find_latest $list` + +gettext_printf "Found deepin image: %s\n" "$linux" >&2 +basename=`basename $linux` +dirname=`dirname $linux` +rel_dirname=`make_system_path_relative_to_its_root $dirname` +version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` +alt_version=`echo $version | sed -e "s,\.old$,,g"` + +initrd= +for i in "initrd.img-${version}"; do + if test -e "${dirname}/${i}" ; then + initrd="$i" + break + fi +done + +if test -n "${initrd}" ; then + gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 +fi + +linux_entry "${OS}" "${version}" simple + +echo "$title_correction_code" diff --git a/deb/mini/recovery_live/filesystem.squashfs b/deb/mini/recovery_live/filesystem.squashfs new file mode 100644 index 0000000..e69de29 diff --git a/deb/tiny/DEBIAN/config b/deb/tiny/DEBIAN/config new file mode 100755 index 0000000..6342909 --- /dev/null +++ b/deb/tiny/DEBIAN/config @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +. /usr/share/debconf/confmodule + +if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi +${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } + + diff --git a/deb/tiny/DEBIAN/control b/deb/tiny/DEBIAN/control new file mode 100644 index 0000000..f322bd9 --- /dev/null +++ b/deb/tiny/DEBIAN/control @@ -0,0 +1,8 @@ +Package: live-filesystem-community-tiny +Version: 2.0.0 +Architecture: amd64 +Maintainer: LinuxDeepin Project , gfdgd xi<3025613752@qq.com> +Section: devel +Priority: extra +Conflicts: live-filesystem, live-filesystem-community-mini, live-filesystem-community-full, live-filesystem-community-full-15.11, live-filesystem-community-debian, live-filesystem-community-debian-core +Description: Deepin Community Live CD Tiny diff --git a/deb/tiny/DEBIAN/postinst b/deb/tiny/DEBIAN/postinst new file mode 100755 index 0000000..59dba84 --- /dev/null +++ b/deb/tiny/DEBIAN/postinst @@ -0,0 +1,35 @@ +#!/bin/sh +# Copy needed firmware + +. /usr/share/debconf/confmodule +db_get live/root_password && rootpw="$RET" +db_stop +sha256=`echo -n $rootpw | sha256sum | cut -d ' ' -f1` +if [ ! -f "/recovery/cryptauth" ]; then + mkdir -p /recovery + echo $sha256 > /recovery/cryptauth + chmod 0600 /recovery/cryptauth +fi + + +if [ -f /proc/modules ];then + # Need installer to override this file. + install -Dm644 /proc/modules /recovery/modules +fi + +# set grub default value +if [ ! -f /etc/default/grub ];then + echo "No grub default configuration.Exit..." >&2 +else + if grep -q '^GRUB_DEFAULT=' /etc/default/grub;then + sed -i "s|^GRUB_DEFAULT=.*|GRUB_DEFAULT=saved|g" /etc/default/grub + else + cat >> /etc/default/grub << EOF +# Important change by live-filesystem. +GRUB_DEFAULT=saved +EOF + fi + update-grub || true +fi + +exit 0 diff --git a/deb/tiny/DEBIAN/postrm b/deb/tiny/DEBIAN/postrm new file mode 100755 index 0000000..aca5c27 --- /dev/null +++ b/deb/tiny/DEBIAN/postrm @@ -0,0 +1,16 @@ +#!/bin/bash +case "${1}" in + remove) + . /usr/share/debconf/confmodule + # Remove my changes to the db. + db_purge + rm -f /recovery/cryptauth + rm -f /recovery/modules + # Update grub + if [ -e /boot/grub/grub.cfg ] && [ -x "$(which update-grub)" ]; then + update-grub + fi + ;; +esac + +exit 0 diff --git a/deb/tiny/DEBIAN/templates b/deb/tiny/DEBIAN/templates new file mode 100644 index 0000000..e53a168 --- /dev/null +++ b/deb/tiny/DEBIAN/templates @@ -0,0 +1,20 @@ +Template: live/root_password +Type: password +Description: Please enter a password for LIVE system: + To secure your system, it is recommended to set a password for the LIVE system + if the password is empty, no password is required to enter the LIVE system. +Description-zh_CN.UTF-8: 请输入LIVE系统的密码: + 为了保障您的系统安全,建议为LIVE系统设置密码, 如果密码为空,则进入LIVE系统时不需要密码。 + +Template: live/root_password_again +Type: password +Description: Repeat password for LIVE system: +Description-zh_CN.UTF-8: 请再次输入密码: + +Template: live/password_mismatch +Type: error +Description: Password input error + The two passwords you entered were not the same. Please try again. +Description-zh_CN.UTF-8: 输入密码错误 + 两次输入密码不同,请重新输入。 + diff --git a/deb/tiny/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe b/deb/tiny/boot/deepin/initrd.img-6.1.11-amd64-desktop-hwe new file mode 100644 index 0000000..e69de29 diff --git a/deb/tiny/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe b/deb/tiny/boot/deepin/vmlinuz-6.1.11-amd64-desktop-hwe new file mode 100644 index 0000000..e69de29 diff --git a/deb/tiny/etc/grub.d/01_live b/deb/tiny/etc/grub.d/01_live new file mode 100755 index 0000000..0dd98d0 --- /dev/null +++ b/deb/tiny/etc/grub.d/01_live @@ -0,0 +1,9 @@ +#!/bin/sh +cat <. + +prefix="/usr" +exec_prefix="/usr" +datarootdir="/usr/share" +quiet_boot="0" + +. "$pkgdatadir/grub-mkconfig_lib" + +export TEXTDOMAIN=grub +export TEXTDOMAINDIR="${datarootdir}/locale" + +CLASS="--class gnu-linux --class gnu --class os" + +if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then + OS=GNU/Linux +else + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" +fi + +if [ -f /etc/default/locale ];then + LOCALE=$(cat /etc/default/locale | grep ^LANG=.*$ | head -n 1 | sed 's/"//g') + LOCALE=${LOCALE#LANG=} +fi + +LOCALE=${LOCALE:-en_US.UTF-8} + +title_correction_code= + +linux_entry () +{ + os="$1" + version="$2" + type="$3" + args="boot=live \$load_config components quiet toram locales=${LOCALE} acpi_backlight=vendor" + + if [ -z "$boot_device_id" ]; then + boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" + fi + args="$args live-media-path=recovery_live" + echo "menuentry 'uos Recovery' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" + + echo " insmod gzio" | sed "s/^/$submenu_indentation/" + + if [ x$dirname = x/ ]; then + if [ -z "${prepare_root_cache}" ]; then + prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | grub_add_tab)" + fi + printf '%s\n' "${prepare_root_cache}" | sed "s/^/$submenu_indentation/" + else + if [ -z "${prepare_boot_cache}" ]; then + prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)" + fi + printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" + fi + if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then + message="$(gettext_printf "Loading Linux %s ..." ${version})" + sed "s/^/$submenu_indentation/" << EOF +EOF + fi + if test -d /sys/firmware/efi && test -e "${linux}.efi.signed"; then + sed "s/^/$submenu_indentation/" << EOF + linux ${rel_dirname}/${basename}.efi.signed ro ${args} +EOF + else + sed "s/^/$submenu_indentation/" << EOF + linux ${rel_dirname}/${basename} ro ${args} +EOF + fi + if test -n "${initrd}" ; then + # TRANSLATORS: ramdisk isn't identifier. Should be translated. + if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then + message="$(gettext_printf "Loading initial ramdisk ...")" + sed "s/^/$submenu_indentation/" << EOF +EOF + fi + sed "s/^/$submenu_indentation/" << EOF + initrd ${rel_dirname}/${initrd} +EOF + fi + sed "s/^/$submenu_indentation/" << EOF +} +EOF +} + +submenu_indentation="" +is_top_level=true +for i in /boot/deepin/vmlinuz-*; do + if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi +done + +linux=`version_find_latest $list` + +gettext_printf "Found deepin image: %s\n" "$linux" >&2 +basename=`basename $linux` +dirname=`dirname $linux` +rel_dirname=`make_system_path_relative_to_its_root $dirname` +version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` +alt_version=`echo $version | sed -e "s,\.old$,,g"` + +initrd= +for i in "initrd.img-${version}"; do + if test -e "${dirname}/${i}" ; then + initrd="$i" + break + fi +done + +if test -n "${initrd}" ; then + gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 +fi + +linux_entry "${OS}" "${version}" simple + +echo "$title_correction_code" diff --git a/deb/tiny/recovery_live/filesystem.squashfs b/deb/tiny/recovery_live/filesystem.squashfs new file mode 100644 index 0000000..e69de29