add livecd and mhwd script

This commit is contained in:
udeved 2014-12-15 03:50:58 +01:00
parent 1d35d081b8
commit 2ab2437f4b
3 changed files with 156 additions and 32 deletions

View file

@ -55,35 +55,9 @@ CPIOINST = \
inst/miso_pxe_nbd \
inst/miso_kms
# LIVECD = \
# livecd/disable-dpms \
# livecd/km-tr.lng \
# livecd/mhwd \
# livecd/setup-0.8-tr.lng \
# livecd/setup-tr.lng \
# livecd/util-lng.sh \
# livecd/ejectcd \
# livecd/lg \
# livecd/pulseaudio-ctl-normal \
# livecd/setup-0.9 \
# livecd/simple-welcome \
# livecd/util-mount.sh \
# livecd/kbd-model-map \
# livecd/lg-en.lng \
# livecd/setup \
# livecd/setup-0.9-en.lng \
# livecd/update-setup \
# livecd/util.sh \
# livecd/km \
# livecd/lg-tr.lng \
# livecd/setup-0.8 \
# livecd/setup-0.9-tr.lng \
# livecd/update-setup-files \
# livecd/km-en.lng \
# livecd/livecd \
# livecd/setup-0.8-en.lng \
# livecd/setup-en.lng \
# livecd/util-inst.sh
LIVECD = \
livecd/mhwd \
livecd/livecd
all: $(BINPROGS) #bin/bash_completion bin/zsh_completion
@ -121,8 +95,8 @@ install:
install -dm0755 $(DESTDIR)$(PREFIX)/lib/initcpio/install
install -m0755 ${CPIOINST} $(DESTDIR)$(PREFIX)/lib/initcpio/install
#install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools/livecd
#install -m0644 ${LIVECD} $(DESTDIR)$(PREFIX)/share/manjaro-tools/livecd
install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools/livecd
install -m0644 ${LIVECD} $(DESTDIR)$(PREFIX)/share/manjaro-tools/livecd
#install -Dm0644 bin/bash_completion $(DESTDIR)/$(PREFIX)/share/bash-completion/completions/manjaro_tools
#install -Dm0644 bin/zsh_completion $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_manjaro_tools
@ -143,7 +117,7 @@ uninstall:
for f in ${CPIOHOOKS}; do rm -f $(DESTDIR)$(PREFIX)/lib/initcpio/hooks/$$f; done
for f in ${CPIOINST}; do rm -f $(DESTDIR)$(PREFIX)/lib/initcpio/install/$$f; done
#for f in ${LIVECD}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/livecd/$$f; done
for f in ${LIVECD}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/livecd/$$f; done
#rm $(DESTDIR)/$(PREFIX)/share/bash-completion/completions/manjaro_tools
#rm $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_manjaro_tools

119
scripts/livecd Executable file
View file

@ -0,0 +1,119 @@
#!/bin/sh
[[ -r /opt/livecd/util.sh ]] && source /opt/livecd/util.sh
load_config "/opt/livecd/manjaro-tools.conf"
[[ -r /opt/livecd/util-lng.sh ]] && source /opt/livecd/util-lng.sh
[[ -r /opt/livecd/util-livecd.sh ]] && source /opt/livecd/util-livecd.sh
CONSOLEFONT="$(kernel_cmdline vconsole.font)"
CONSOLEMAP="$(kernel_cmdline vconsole.font.map)"
PACMAN_LNG="pacman --config /opt/livecd/pacman-lng.conf --noconfirm --noprogressbar"
arch=$(uname -m)
_kernver=$(uname -r)
_kernver=${_kernver%%-*}
_kernver=${_kernver%%.[00-99].[00-99]}
EXTRAMODULES=extramodules-${_kernver}-MANJARO
echo "update fstab for swap" > /tmp/livecd.log
## Systemd should do it
# scan_swap
swapdev="$(fdisk -l 2>/dev/null | grep swap | cut -d' ' -f1)"
if [ -e "${swapdev}" ]; then
swapon ${swapdev}
echo "${swapdev} swap swap defaults 0 0 #configured by manjaroiso" >>/etc/fstab
fi
echo "set locale" >> /tmp/livecd.log
# set_locale
set_locale
locale-gen
echo "configure alsa" >> /tmp/livecd.log
# configure alsa
set_alsa
# configure pulse
if [ -e "/usr/bin/pulseaudio-ctl" ] ; then
pulseaudio-ctl normal
fi
# save settings
alsactl -f /etc/asound.state store &>/dev/null
echo "enable default mirror" >> /tmp/livecd.log
# enable default mirror
#cp -f /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
#if [ ! -z "$ping_check" ] ; then
# pacman-mirrors -g &>/dev/null
#fi
echo "configure system" >> /tmp/livecd.log
# add BROWSER var
echo "BROWSER=/usr/bin/xdg-open" >> /etc/environment
echo "BROWSER=/usr/bin/xdg-open" >> /etc/skel/.bashrc
echo "BROWSER=/usr/bin/xdg-open" >> /etc/profile
# add TERM var
if [ -e "/usr/bin/mate-session" ] ; then
echo "TERM=mate-terminal" >> /etc/environment
echo "TERM=mate-terminal" >> /etc/profile
fi
## FIXME - Workaround to launch mate-terminal
if [ -e "/usr/bin/mate-session" ] ; then
sed -i -e "s~^.*Exec=.*~Exec=mate-terminal -e 'sudo setup'~" "/etc/skel/Desktop/installer-launcher-cli.desktop"
sed -i -e "s~^.*Terminal=.*~Terminal=false~" "/etc/skel/Desktop/installer-launcher-cli.desktop"
fi
# do_configsforroot
cp -a /etc/skel/. /root/
echo "configure sudoers" >> /tmp/livecd.log
# do_fix_perms
chown root:root /etc/sudoers
sed -i -e 's|# %wheel ALL=(ALL) ALL|%wheel ALL=(ALL) ALL|g' /etc/sudoers
chmod 440 /etc/sudoers
echo "configure applications" >> /tmp/livecd.log
# fix_gnome_apps
glib-compile-schemas /usr/share/glib-2.0/schemas
gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor
if [ -e "/usr/bin/dconf" ] ; then
dconf update
fi
if [ -e "/usr/bin/gnome-keyring-daemon" ] ; then
setcap cap_ipc_lock=ep /usr/bin/gnome-keyring-daemon &> /dev/null
fi
# fix_ping_installation
setcap cap_net_raw=ep /usr/bin/ping &> /dev/null
setcap cap_net_raw=ep /usr/bin/ping6 &> /dev/null
install_localization
# set unique machine-id
#dbus-uuidgen --ensure=/etc/machine-id
#dbus-uuidgen --ensure=/var/lib/dbus/machine-id
# depmod extramodules
depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
# check if we are running inside a virtual machine and unistall kalu
DESTDIR="/"
if [ -e "/usr/bin/kalu" ] ; then
_rm_kalu
fi
configure_live_installer_live
configure_thus_live
configure_calamares_live

31
scripts/mhwd Executable file
View file

@ -0,0 +1,31 @@
#!/bin/sh
[[ -r /opt/livecd/util-lng.sh ]] && source /opt/livecd/util-lng.sh
USENONFREE="$(kernel_cmdline nonfree no)"
VIDEO="$(kernel_cmdline xdriver no)"
# hwdetect_graphics
if [ -e "/opt/livecd/pacman-gfx.conf" ] ; then
echo "run mhwd" >> /tmp/livecd.log
if [ "${USENONFREE}" == "yes" ] || [ "${USENONFREE}" == "true" ]; then
if [ "${VIDEO}" == "vesa" ]; then
mhwd --install pci video-vesa --pmconfig "/opt/livecd/pacman-gfx.conf"
else
mhwd --auto pci nonfree 0300 --pmconfig "/opt/livecd/pacman-gfx.conf"
fi
else
if [ "${VIDEO}" == "vesa" ]; then
mhwd --install pci video-vesa --pmconfig "/opt/livecd/pacman-gfx.conf"
else
mhwd --auto pci free 0300 --pmconfig "/opt/livecd/pacman-gfx.conf"
fi
fi
fi
if [[ -e /run/openrc ]];then
if [[ -f /etc/X11/mhwd.d/virtualbox.conf ]];then
VBoxService &> /dev/null
fi
fi
echo "MHWD DONE" > /tmp/mhwd.task