From 6694885e186b127de6d05a690d1ffd4ee7365327 Mon Sep 17 00:00:00 2001 From: Gen Li Date: Tue, 4 Jul 2017 15:39:54 +0800 Subject: [PATCH] Add support for CDlinux --- boot/grub/distro/cdlinux.sh | 16 ++++++++++++++++ boot/grub/isoboot.sh | 2 ++ lang/zh_CN/fm.po | 4 ++++ lang/zh_TW/fm.po | 4 ++++ 4 files changed, 26 insertions(+) create mode 100644 boot/grub/distro/cdlinux.sh diff --git a/boot/grub/distro/cdlinux.sh b/boot/grub/distro/cdlinux.sh new file mode 100644 index 00000000..f8b6f99a --- /dev/null +++ b/boot/grub/distro/cdlinux.sh @@ -0,0 +1,16 @@ +set icon="slackware"; +set vmlinuz_img="(loop)/CDlinux/bzImage"; +set initrd_img="(loop)/CDlinux/initrd*"; +regexp --set=cdl_dir '^(.*)/.*$' "$isofile" +regexp --set=cdl_img '^.*/(.*)$' "$isofile" +set linux_extra="CDL_IMG=${cdl_img} CDL_DIR=${cdl_dir}"; +set kcmdline=""; +if [ "${lang}" == "zh_CN" ]; then + kcmdline="${kcmdline} CDL_LANG=zh_CN.UTF-8"; +fi; +if test -f $vmlinuz_img -a -f $initrd_img; then + menuentry $"Boot CDlinux From ISO" --class $icon{ + linux $vmlinuz_img $kcmdline $linux_extra; + initrd $initrd_img; + } +fi; diff --git a/boot/grub/isoboot.sh b/boot/grub/isoboot.sh index 1aed417c..d903f41a 100644 --- a/boot/grub/isoboot.sh +++ b/boot/grub/isoboot.sh @@ -99,6 +99,8 @@ function CheckLinuxType { source $prefix/distro/freebsd.sh; elif test -f (loop)/*/*/bsd.rd; then source $prefix/distro/openbsd.sh; + elif test -d (loop)/CDlinux; then + source $prefix/distro/cdlinux.sh; fi; if test -f (loop)/boot/grub/loopback.cfg; then menuentry $"Boot ISO (Loopback)" "$isofile" --class gnu-linux{ diff --git a/lang/zh_CN/fm.po b/lang/zh_CN/fm.po index 766346de..ba516242 100644 --- a/lang/zh_CN/fm.po +++ b/lang/zh_CN/fm.po @@ -220,6 +220,10 @@ msgstr "作为 BlackArch LiveCD 启动 (i386)" msgid "Boot FreeBSD From ISO" msgstr "作为 FreeBSD ISO 启动" +#: distro/cdlinux.sh:6 +msgid "Boot CDlinux From ISO" +msgstr "作为 CDlinux ISO 启动" + #: distro/debian.sh:21 msgid "Please input the username. Default:user Super User:root Devuan:devuan" msgstr "请输入登录用户名。默认:user 超级用户:root Devuan:devuan" diff --git a/lang/zh_TW/fm.po b/lang/zh_TW/fm.po index a1131f24..6f2d6de5 100644 --- a/lang/zh_TW/fm.po +++ b/lang/zh_TW/fm.po @@ -220,6 +220,10 @@ msgstr "作爲 BlackArch LiveCD 啓動 (i386)" msgid "Boot FreeBSD From ISO" msgstr "作爲 FreeBSD ISO 啓動" +#: distro/cdlinux.sh:6 +msgid "Boot CDlinux From ISO" +msgstr "作爲 CDlinux ISO 啓動" + #: distro/debian.sh:21 msgid "Please input the username. Default:user Super User:root Devuan:devuan" msgstr "請輸入登錄用戶名。默認:user 超級用戶:root Devuan:devuan"