Skip to content

Commit 9a954f7

Browse files
KamelitolovelessKamelito
andauthored
Rollback of change to make demos running and added working Dockerfile and docker.sh (#151)
* Revert "Fix non working demos using AddInterServer through Disable and removal of uncessary delay in Enable.s (#150)" demos were working but moving the mouse froze them. This reverts commit 9e71193. * working docker.sh and dockerfile --------- Co-authored-by: Kamelito <kamelitoloveless@gmail.com>
1 parent 80d3e50 commit 9a954f7

4 files changed

Lines changed: 132 additions & 36 deletions

File tree

Dockerfile

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
1-
FROM phusion/baseimage:master-amd64
1+
FROM ubuntu:22.04
22

33
LABEL maintainer="Georgios Sokianos <walkero@gmail.com>"
44

5-
# Use baseimage-docker's init system.
6-
CMD ["/sbin/my_init"]
5+
ENV DEBIAN_FRONTEND=noninteractive
76

8-
RUN dpkg --add-architecture i386; \
7+
RUN dpkg --add-architecture i386 && \
98
apt-get update && apt-get -y install \
109
autoconf ccache make mmake automake cmake \
11-
gcc \
10+
gcc g++ gcc-multilib \
1211
wget \
1312
lhasa \
1413
git subversion mercurial \
1514
gawk bison flex netpbm genisoimage sshpass \
16-
python-mako libswitch-perl gperf gcc-multilib g++ \
15+
python3-mako libswitch-perl gperf \
1716
patch bzip2 ca-certificates xz-utils \
1817
libpng-dev zlib1g-dev libxcursor-dev libgl1-mesa-dev libasound2-dev \
19-
libx11-dev libxext-dev libc6-dev liblzo2-dev libxxf86vm-dev libsdl1.2-dev byacc libxxf86vm1:i386; \
20-
ln -s /usr/bin/genisoimage /usr/bin/mkisofs; \
21-
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*;
18+
libx11-dev libxext-dev libc6-dev liblzo2-dev libxxf86vm-dev libsdl2-dev \
19+
byacc libxxf86vm1:i386 \
20+
&& [ -e /usr/bin/mkisofs ] || ln -s /usr/bin/genisoimage /usr/bin/mkisofs \
21+
&& apt-get clean \
22+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2223

23-
# Add git branch name to bash prompt
24-
RUN sed -i '4c\'"\nparse_git_branch() {\n\
25-
git branch 2> /dev/null | sed -e \'/^[^*]/d\' -e \'s/* \\\(.*\\\)/ (\\\1)/\'\n\
26-
}\n" ~/.bashrc; \
27-
sed -i '43c\'"force_color_prompt=yes" ~/.bashrc; \
28-
sed -i '57c\'" PS1=\'\${debian_chroot:+(\$debian_chroot)}\\\[\\\033[01;32m\\\]\\\u@\\\h\\\[\\\033[00m\\\]:\\\[\\\033[01;34m\\\]\\\w\\\[\\\033[01;31m\\\]\$(parse_git_branch)\\\[\\\033[00m\\\]\\\$ '" ~/.bashrc; \
29-
sed -i '59c\'" PS1=\'\${debian_chroot:+(\$debian_chroot)}\\\u@\\\h:\\\w \$(parse_git_branch)\$ \'" ~/.bashrc;
30-
# Clean up APT when done.
31-
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3224
WORKDIR /usr/src
25+
CMD ["/bin/bash"]

arch/m68k-amiga/exec/enable.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 1995-2010, The AROS Development Team. All rights reserved.
2+
Copyright © 1995-2010, The AROS Development Team. All rights reserved.
33
$Id$
44

55
Desc: Enable() - Allow interrupts to occur after Disable().
@@ -72,4 +72,6 @@ AROS_SLIB_ENTRY(Enable,Exec,21):
7272
subq.b #1,%a6@(IDNestCnt)
7373
bge.s 0f
7474
move.w #0xc000,0xdff09a
75+
tst.b 0xbfe001
76+
tst.b 0xbfe001
7577
0: rts

arch/m68k-amiga/timer/lowlevel.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 1995-2018, The AROS Development Team. All rights reserved.
2+
Copyright © 1995-2018, The AROS Development Team. All rights reserved.
33
$Id$
44
55
Desc: CIA timer.device
@@ -264,10 +264,7 @@ AROS_INTH1(cia_vbint, struct TimerBase *, TimerBase)
264264
return 0;
265265
inc64(&TimerBase->tb_vb_count);
266266

267-
/* Disable(); */
268-
asm volatile ("move.w #0x4000,0xdff09a\n");
269-
/* Disable() / Enable() here interfere with demos using AddInterServer called from Disable() */
270-
/* replaced by disabling / enabling Interrupt using INTENA */
267+
Disable();
271268
ForeachNodeSafe(&TimerBase->tb_Lists[UNIT_VBLANK], tr, next) {
272269
if (cmp64(&TimerBase->tb_vb_count, &tr->tr_time)) {
273270
Remove((struct Node *)tr);
@@ -283,8 +280,7 @@ AROS_INTH1(cia_vbint, struct TimerBase *, TimerBase)
283280
if (IsListEmpty(&TimerBase->tb_Lists[UNIT_VBLANK])) {
284281
TimerBase->tb_vblank_on = FALSE;
285282
}
286-
/* Enable(); */
287-
asm volatile ("move.w #0xc000,0xdff09a\n");
283+
Enable();
288284

289285
return 0;
290286

docker.sh

Lines changed: 115 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,120 @@
11
#!/bin/bash
2-
#sudo docker run -it --rm -v "$PWD":/git ubuntu "/bin/bash -c \"apt-get install git-core gcc g++ make cmake gawk bison flex bzip2 netpbm autoconf automake libx11-dev libxext-dev libc6-dev liblzo2-dev libxxf86vm-dev libpng-dev libsdl1.2-dev byacc python-mako libxcursor-dev gcc-multilib\"; /bin/bash"
3-
IMAGE_NAME=apolloos/builder
42

3+
IMAGE_NAME="apolloos/builder"
4+
DOCKERFILE="Dockerfile"
55

6-
#Do we have this image already?
7-
DOCKER_IMAGE_COUNT=$(docker image ls | awk -F\ '{ print $1 }' | grep "${IMAGE_NAME} | wc -l")
8-
echo ${DOCKER_IMAGE_COUNT}
9-
if [ "${DOCKER_IMAGE_COUNT}" == "" ]
10-
then
11-
docker build -t ${IMAGE_NAME} .
6+
# Colors
7+
GREEN="\033[1;32m"
8+
RED="\033[1;31m"
9+
YELLOW="\033[1;33m"
10+
RESET="\033[0m"
11+
12+
show_help() {
13+
echo -e "${GREEN}ApolloOS Docker Build Script${RESET}"
14+
echo ""
15+
echo -e "${YELLOW}Usage:${RESET}"
16+
echo " ./docker.sh Build ApolloOS (default)"
17+
echo " ./docker.sh build Build ApolloOS (no clean)"
18+
echo " ./docker.sh clean Clean only (make clean)"
19+
echo " ./docker.sh rebuild Clean + build"
20+
echo " ./docker.sh shell Open a shell inside the Docker build environment"
21+
echo " ./docker.sh --clean-image Delete the Docker image"
22+
echo " ./docker.sh help Show this help"
23+
echo ""
24+
exit 0
25+
}
26+
27+
# -----------------------------
28+
# Determine action
29+
# -----------------------------
30+
if [ -z "$1" ]; then
31+
ACTION="build"
32+
else
33+
ACTION="$1"
34+
fi
35+
36+
# -----------------------------
37+
# Help
38+
# -----------------------------
39+
if [[ "$ACTION" == "help" || "$ACTION" == "-h" || "$ACTION" == "--help" ]]; then
40+
show_help
41+
fi
42+
43+
# -----------------------------
44+
# OPTION: clean → only make clean
45+
# -----------------------------
46+
if [ "$ACTION" == "clean" ]; then
47+
echo -e "${YELLOW}Running make clean inside Docker...${RESET}"
48+
docker run -it --rm \
49+
-v "$PWD":/usr/src \
50+
"$IMAGE_NAME" \
51+
bash -c "cd /usr/src && make clean"
52+
exit 0
53+
fi
54+
55+
# -----------------------------
56+
# OPTION: rebuild → clean + build
57+
# -----------------------------
58+
if [ "$ACTION" == "rebuild" ]; then
59+
echo -e "${YELLOW}Running make clean inside Docker...${RESET}"
60+
docker run -it --rm \
61+
-v "$PWD":/usr/src \
62+
"$IMAGE_NAME" \
63+
bash -c "cd /usr/src && make clean"
64+
65+
echo -e "${GREEN}Rebuilding ApolloOS...${RESET}"
66+
docker run -it --rm \
67+
-v "$PWD":/usr/src \
68+
"$IMAGE_NAME" \
69+
bash -c "cd /usr/src && ./rebuild_all.sh"
70+
exit 0
71+
fi
72+
73+
# -----------------------------
74+
# OPTION: build → build without clean
75+
# -----------------------------
76+
if [ "$ACTION" == "build" ]; then
77+
# Build image if missing
78+
if ! docker image inspect "$IMAGE_NAME" > /dev/null 2>&1; then
79+
echo -e "${YELLOW}Docker image '$IMAGE_NAME' not found. Building it now...${RESET}"
80+
docker build -t "$IMAGE_NAME" .
81+
if [ $? -ne 0 ]; then
82+
echo -e "${RED}❌ Failed to build Docker image. Aborting.${RESET}"
83+
exit 1
84+
fi
85+
fi
86+
87+
echo -e "${GREEN}Building ApolloOS (no clean)...${RESET}"
88+
docker run -it --rm \
89+
-v "$PWD":/usr/src \
90+
"$IMAGE_NAME" \
91+
bash -c "cd /usr/src && ./rebuild_all.sh"
92+
exit 0
93+
fi
94+
95+
# -----------------------------
96+
# OPTION: shell → open interactive shell
97+
# -----------------------------
98+
if [ "$ACTION" == "shell" ]; then
99+
echo -e "${GREEN}Opening shell inside Docker environment...${RESET}"
100+
docker run -it --rm \
101+
-v "$PWD":/usr/src \
102+
"$IMAGE_NAME" \
103+
bash
104+
exit 0
105+
fi
106+
107+
# -----------------------------
108+
# OPTION: --clean-image → delete Docker image
109+
# -----------------------------
110+
if [ "$ACTION" == "--clean-image" ]; then
111+
echo -e "${YELLOW}Removing Docker image '$IMAGE_NAME'...${RESET}"
112+
docker rmi "$IMAGE_NAME"
113+
exit 0
12114
fi
13115

14-
#Run the docker and start the build
15-
docker run -it --rm -v "$PWD":/usr/src ${IMAGE_NAME} /bin/bash -c "cd /usr/src; ./rebuild_all.sh"
116+
# -----------------------------
117+
# Unknown option
118+
# -----------------------------
119+
echo -e "${RED}Unknown option: $ACTION${RESET}"
120+
show_help

0 commit comments

Comments
 (0)