Added more scripting to automate the configuration of the Mandrake Linux 8.0 inside achroot
This commit is contained in:
parent
5a9c5814b5
commit
8b991bfa03
34
XF86Config.patch
Normal file
34
XF86Config.patch
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
--- /mnt/etc/X11/XF86Config.bak 2018-04-18 23:28:50.000000000 +0200
|
||||||
|
+++ /mnt/etc/X11/XF86Config 2018-04-18 23:29:01.000000000 +0200
|
||||||
|
@@ -396,21 +396,31 @@
|
||||||
|
Section "Screen"
|
||||||
|
Driver "fbdev"
|
||||||
|
Device ""
|
||||||
|
Monitor "Generic|SVGA haute fréquence, 1024x768 à 70 Hz"
|
||||||
|
DefaultColorDepth 16
|
||||||
|
Subsection "Display"
|
||||||
|
Depth 8
|
||||||
|
Modes "default"
|
||||||
|
ViewPort 0 0
|
||||||
|
EndSubsection
|
||||||
|
Subsection "Display"
|
||||||
|
Depth 15
|
||||||
|
Modes "default"
|
||||||
|
ViewPort 0 0
|
||||||
|
EndSubsection
|
||||||
|
Subsection "Display"
|
||||||
|
Depth 16
|
||||||
|
Modes "default"
|
||||||
|
ViewPort 0 0
|
||||||
|
EndSubsection
|
||||||
|
+ Subsection "Display"
|
||||||
|
+ Depth 24
|
||||||
|
+ Modes "default"
|
||||||
|
+ ViewPort 0 0
|
||||||
|
+ EndSubsection
|
||||||
|
+ Subsection "Display"
|
||||||
|
+ Depth 32
|
||||||
|
+ Modes "default"
|
||||||
|
+ ViewPort 0 0
|
||||||
|
+ EndSubsection
|
||||||
|
EndSection
|
14
audio.txt
Normal file
14
audio.txt
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# install osspd
|
||||||
|
|
||||||
|
sudo adduser georges pulse-access
|
||||||
|
sudo adduser pulse audio
|
||||||
|
|
||||||
|
https://unix.stackexchange.com/questions/382601/how-to-prevent-sound-mute-when-switching-user#382969
|
||||||
|
=> Start pulse audio in system mode: pulseaudio --system=yes
|
||||||
|
|
||||||
|
# to re-enable detection of headphones plugged in / out
|
||||||
|
pactl load-module module-switch-on-port-available
|
||||||
|
|
||||||
|
sudo service osspd status
|
||||||
|
|
||||||
|
don't forget to have the same user ID in the chroot and outside!
|
1
mandrake.raw
Symbolic link
1
mandrake.raw
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
/mandrake/mandrake.raw
|
7
mount.sh
Executable file
7
mount.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
sudo losetup -o $((512*63)) /dev/loop0 mandrake.raw
|
||||||
|
sudo losetup -o $((512*6843753)) /dev/loop1 mandrake.raw
|
||||||
|
sudo mount /dev/loop0 /mnt
|
||||||
|
sudo mount /dev/loop1 /mnt/home
|
||||||
|
sudo mount -t devpts devpts /mnt/dev/pts
|
4
network
Normal file
4
network
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
sudo cp -ai "$mnt/etc/resolv.conf" "/etc/resolv.conf.bak-$(date)"
|
||||||
|
sudo ln -sf "$HOME/outside_of_chroot/etc/resolv.conf" "$mnt/etc/"
|
||||||
|
echo "127.0.0.1 $(hostname)" | sudo tee -a "$mnt/etc/hosts"
|
||||||
|
echo "127.0.0.1 home6.netscape.com" | sudo tee -a "$mnt/etc/hosts"
|
2
qemu.sh
Executable file
2
qemu.sh
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
qemu-system-i386 -cdrom /mandrake/01PW8001.iso01.iso -drive file=/mandrake/mandrake.raw,index=0,format=raw,media=disk #-full-screen
|
|
@ -17,6 +17,29 @@ if [ "$( (sudo ls -A "$mnt/home/georges/outside_of_chroot" || true) | wc -l)" =
|
||||||
sudo mount --rbind / "$mnt/home/georges/outside_of_chroot"
|
sudo mount --rbind / "$mnt/home/georges/outside_of_chroot"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# hack to enable audio:
|
||||||
|
if true; then
|
||||||
|
sudo killall pulseaudio || true
|
||||||
|
# Note: a chmod +x on the directories on this path may be needed.
|
||||||
|
chmod a+rwx ~georges/Documents/git/my/config-private-dot.config/pulse/
|
||||||
|
chmod a+rwx ~georges/Documents/git/my/config-private-dot.config/pulse/cookie
|
||||||
|
sudo killall pulseaudio || true
|
||||||
|
sudo pulseaudio --daemonize=yes --system=yes
|
||||||
|
|
||||||
|
pactl load-module module-switch-on-port-available
|
||||||
|
|
||||||
|
sudo service osspd start
|
||||||
|
sudo service osspd status
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "$mnt/etc/mandrake-chroot-was-configured" ]; then
|
||||||
|
sudo cp "$mnt/etc/X11/XF86Config" "$mnt/etc/X11/XF86Config.bak-$(date +%s)"
|
||||||
|
sudo patch "$mnt/etc/X11/XF86Config" < XF86Config.patch
|
||||||
|
sudo touch "$mnt/etc/mandrake-chroot-was-configured"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\033[1;31mNOTE: to access sound, the user inside the chroot must have the same UID as the user outside of the chroot!\033[m"
|
||||||
|
|
||||||
signal_x_ready="$(tempfile)"
|
signal_x_ready="$(tempfile)"
|
||||||
|
|
||||||
sudo chroot "$mnt" /home/georges/Documents/git/my/config-mandrake-chroot/startmandrake2.sh "$signal_x_ready" &
|
sudo chroot "$mnt" /home/georges/Documents/git/my/config-mandrake-chroot/startmandrake2.sh "$signal_x_ready" &
|
||||||
|
@ -25,7 +48,7 @@ chroot_startmandrake_pid="$!"
|
||||||
# Wait for the chrooted X to be ready
|
# Wait for the chrooted X to be ready
|
||||||
while [ ! -e "$mnt/$signal_x_ready" ]; do
|
while [ ! -e "$mnt/$signal_x_ready" ]; do
|
||||||
echo "Waiting for X to start up …"
|
echo "Waiting for X to start up …"
|
||||||
sleep 0.5
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
# Start a terminal with access to the outer config & files.
|
# Start a terminal with access to the outer config & files.
|
||||||
|
|
|
@ -3,19 +3,22 @@ source /etc/profile
|
||||||
|
|
||||||
signal_x_ready="$1"
|
signal_x_ready="$1"
|
||||||
|
|
||||||
|
/etc/rc.d/init.d/xfs start
|
||||||
|
|
||||||
X -bpp 32 :1 &
|
X -bpp 32 :1 &
|
||||||
x_pid="$!"
|
x_pid="$!"
|
||||||
|
|
||||||
export DISPLAY=:1
|
export DISPLAY=:1
|
||||||
|
|
||||||
while ! xsetroot -solid gray; do
|
while ! xsetroot -solid gray; do
|
||||||
sleep 0.1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
xhost +local:
|
xhost +local:
|
||||||
|
|
||||||
# Fix the sound permissions
|
# Fix the sound permissions
|
||||||
chmod g+rw /dev/dsp
|
chmod g+rw /dev/dsp
|
||||||
|
gpasswd -a georges audio
|
||||||
|
|
||||||
touch "$signal_x_ready" # tell the outer system that our X is ready.
|
touch "$signal_x_ready" # tell the outer system that our X is ready.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user