We investigate the primordial gravitational waves ( PGWs ) in the general scenario where the inflation is preceded by a pre-inflationary stage with the effective equation of state w . Comparing with the results in the usual inflationary models , the power spectrum of PGWs is modified in two aspects : One is the mixture of the perturbation modes caused by he presence of the pre-inflationary period , and the other is the thermal initial state formed at the Planck era of the early Universe . By investigating the observational imprints of these modifications on the B-mode polarization of cosmic microwave background ( CMB ) radiation , we obtain the constraints on the conformal temperature of the thermal gravitational-wave background T < 5.01 \times 10 ^ { -4 } Mpc ^ { -1 } and a tensor-to-scalar ratio r < 0.084 ( 95 \% confident level ) , which follows the bounds on total number of e-folds N > 63.5 for the model with w = 1 / 3 , and N > 65.7 for that with w = 1 . By taking into account various noises and the foreground radiations , we forecast the detection possibility of the thermal gravitational-wave background by the future CMBPol mission , and find that if r > 0.01 , the detection is possible as long as T > 1.5 \times 10 ^ { -4 } Mpc ^ { -1 } . However , the effect of different w is quite small , and it seems impossible to determine its value from the potential observations of CMBPol mission .