Here's a quick sketch:
Gravity is the vector $u$. Its components in the plane and against the plane are $v$ and $w$ respectively. You want to find $v$.
The angle between the plane and horizontal is the same as the angle between $w$ and $u$, which allows you to find a simple trig relation to solve the problem.
First thing is, Friction prevents relative motion. What this means is, that the value and the direction of friction will so adjust, that it will try to minimize relative motion between the surface and the block and to prevent it, if possible.
Next, static friction is an self-adjusting force. What this means is that, its magnitude and value is not fixed but it will change depending on the different physical situations, i.e. different forces acting on the body. It's maximum value in this case will be $\mu_s N$ but it can have any value from zero to this maximum. The value depends upon the situation and is always such that it avoids relative motion. (having the maximum value is the best try friction can do to prevent relative motion, and beyond that, if the external force is increased, relative motion occurs and the value of static friction is substituted by kinetic friction.)
In your problem, you should first try and check if a stationary (zero acceleration) solution is possible, i.e. will friction be able to prevent relative motion (between the inclined plane and the block 2). To do this, draw a free body diagram of block $M_2$. It has $T$ tension acting upwards (along the incline of the plane) and $M_2g\sin\theta$ acting downwards (along the incline). Let us suppose a static solution is possible, i.e. friction is able to prevent all motions.
Then, both the blocks must be stationary. This means that the tension $T=M_1g$ since, on block 1 there is only the downward gravitational force which needs to be balanced by the upward tension if it has to stay stationary.
Going back to block 2, the forces along the incline are $M_1g=10N$ upwards and $M_2g\sin\theta=5N$ downwards and the friction. Since the upwards (along the incline) force is greater than that downwards, the friction must act in a downward direction to keep the block in equilibrium. The magnitude of friction needs to be $5N$ which is less than the maximum value of friction possible $\mu_sN=0.6M_2g\cos30=5.196N$, and hence the static solution is possible. Here, the frictional force will be $5N$ and not $5.196N$ as static friction self-adjusts to the value required to maintain a stationary state, i.e. prevent relative motion.
The 2 negative accelerations you get by assuming maximum static friction and then solving, indicates that a static solution is possible, since both accelerations turning out to be negative with maximum static friction means that maximum static friction is more than the other forces and hence friction is capable of balancing other forces and create a static solution.
Best Answer
A shorter way to do this would be to use the concept of a pseudo-force.
When you observe the motion from the inclined plane's frame, you should be applying a pseudo-force (virtual force in the direction opposite to acceleration) because it is an accelerating frame.
Considering this, there are three forces on the block in this frame (which is seen stationery). One is gravity, downwards. Another is the normal reaction from the plane. Third is the pseudo-force, leftwards.
All you gotta do now is balance these three forces, because they cancel out and keep the block stationery.